1. Client Source
/// 1. @ Source/Client/UserInterface/GameType.h
// Search @ EKeyboardSetting
KEY_ADDKEYBUFFERCONTROL = 100,
// Add above
/// 2. @ Source/Client/UserInterface/PythonPlayerModule.cpp
// Search
PyModule_AddIntConstant(poModule, "KEY_ADDKEYBUFFERCONTROL", KEY_ADDKEYBUFFERCONTROL);
// Add above
PyModule_AddIntConstant(poModule, "KEY_CUSTOM_SYSTEM", KEY_CUSTOM_SYSTEM);
/// 3. @ Source/Client/UserInterface/PythonPlayerInputKeyboard.cpp
// Search
case KEY_SHOW_NAME: PyCallClassMemberFunc(m_ppyGameWindow, "ShowName", Py_BuildValue("()")); break;
// Add below
case KEY_CUSTOM_SYSTEM: PyCallClassMemberFunc(m_ppyGameWindow, "CustomSystem", Py_BuildValue("()")); break;
2. Root
''' 1. @ Client/root/game.py
NOTE: This is the function that the key will call.
'''
# Add to the bottom of the document
def CustomSystem(self):
chat.AppendChat(chat.CHAT_TYPE_INFO, "My Custom System")
''' 2. @ Client/root/uiKeyChange.py
NOTE: Always increase this value when adding new keys.
'''
# Search @ def __init__
# Add below
self.KeySlotMax = self.KeySlotMax + 1
''' 3. @ Client/root/uiKeyChange.py
NOTE: This is the default key for calling the function.
'''
# Search @ def __BuildKeyInfo
KeyUiInfoDick[65] = app.DIK_X
# Add below
KeyUiInfoDick[66] = app.DIK_F10
''' 4. @ Client/root/uiKeyChange.py
NOTE: This is the default function of the key.
'''
# Search @ def __BuildKeyFunction
KeyFunctionInfo[65] = player.KEY_SHOW_NAME
# Add below
KeyFunctionInfo[66] = player.KEY_CUSTOM_SYSTEM
3. UIScript
''' 1. @ Client/UIScript/KeyChange_Window.py '''
# Add to the bottom of the document
window["height"] = window["height"]
window["children"][0]["height"] = window["children"][0]["height"]
window["children"][0]["children"] = window["children"][0]["children"] + [
{ "name" : "Main", "type" : "text", "text" : "Custom System", "text_horizontal_align" : "left", "x" : 28 + 540 + 35, "y" : 75 + 320, },
]