21 if ( instance == null )
49 RegisterKeyBind(
MENU_ANY ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_F1 ,
"PluginDeveloper" ,
"ToggleHelpScreen" ,
"[LCTRL]+[F1]" ,
"Show/Hide help screen");
50 RegisterKeyBind(
MENU_ANY ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_F2 ,
"PluginDeveloper" ,
"ResetGUI" ,
"[LCTRL]+[F2]" ,
"Resets shown UI for testing purposes");
55 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_V ,
"PluginDeveloper" ,
"SpawnFromClipboard" ,
"[Right Shift]" ,
"Spawn item from clipboard");
59 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_INSERT ,-1 ,
"PluginDeveloper" ,
"TeleportAtCursor" ,
"[Insert]" ,
"Teleport player to cursor position");
60 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_HOME ,-1 ,
"PluginDeveloper" ,
"ToggleFreeCamera" ,
"[Home]" ,
"Toggle free camera and teleport player to its position");
61 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_DIVIDE ,-1 ,
"PluginDeveloper" ,
"ToggleFreeCameraBackPos" ,
"[Divide numeric]" ,
"Toggle free camera, no player teleport");
62 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_NUMPAD9 ,
"PluginDeveloperSync" ,
"ToggleFocus" ,
"[LCtrl]+[NUMPAD9]" ,
"Toggle game focus");
66 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_Z ,
"PluginDeveloper" ,
"SetDeveloperItemClient" ,
"Starts watching the item" ,
"Sets the target as Watched item for debug purposes");
67 RegisterKeyBind(
MENU_SCRIPTCONSOLE ,
KeyCode.KC_PRIOR ,-1 ,
"PluginDeveloper" ,
"ScriptHistoryBack" ,
"[Page Up]" ,
"Debug Console => Script history back");
68 RegisterKeyBind(
MENU_SCRIPTCONSOLE ,
KeyCode.KC_NEXT ,-1 ,
"PluginDeveloper" ,
"ScriptHistoryNext" ,
"[Page Down]" ,
"Debug Console => Script history next");
69 RegisterKeyBind(
MENU_SCENE_EDITOR ,
KeyCode.KC_DELETE ,-1 ,
"PluginSceneManager" ,
"DeleteSelectedObject" ,
"[Delete]" ,
"Scene Editor => Delete current selected object");
70 RegisterKeyBind(
MENU_SCENE_EDITOR ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_S ,
"PluginSceneManager" ,
"SceneSave" ,
"[LCtrl]+[S]" ,
"Scene Editor => Save Current Scene");
71 RegisterKeyBind(
MENU_SCENE_EDITOR ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_D ,
"PluginSceneManager" ,
"SelectedObjectDuplicate" ,
"[LCtrl]+[D]" ,
"Scene Editor => Duplicate current selected object");
72 RegisterKeyBind(
MENU_SCENE_EDITOR ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_F ,
"PluginSceneManager" ,
"SelectedObjectFocus" ,
"[LCtrl]+[F]" ,
"Scene Editor => Focus camera on selected object");
73 RegisterKeyBind(
MENU_SCENE_EDITOR ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_E ,
"PluginSceneManager" ,
"RulerToggle" ,
"[LCtrl]+[E]" ,
"Scene Editor => Enable/Disable addition of ruler points");
74 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_PRIOR ,
"PluginRecipesManager" ,
"CallbackGenerateCache" ,
"[LCtrl]+[BACKSPACE]" ,
"PluginRecipesManager => Generate recipe cache and save it to file");
75 RegisterKeyBind(
MENU_ANY ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_DECIMAL ,
"PluginItemDiagnostic" ,
"ToggleDebugWindowEvent" ,
"[LCtrl]+[DECIMAL]" ,
"Close the Item Debug window");
76 RegisterKeyBind(
MENU_ANY ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_NUMPAD0 ,
"PluginDayzPlayerDebug",
"ToggleDebugWindowEvent" ,
"[LCtrl]+[NUMPAD0]" ,
"Open/Close Player debug window");
77 RegisterKeyBind(
MENU_ANY ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_DECIMAL ,
"PluginDayzPlayerDebug",
"ToggleDebugWindowEventP" ,
"[LCtrl]+[DECIMAL]" ,
"Open/Close Player debug window");
78 RegisterKeyBind(
MENU_ANY ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_I ,
"PluginDayZInfectedDebug",
"ToggleDebugWindowEvent" ,
"[LCtrl]+[NUMPAD1]" ,
"Open/Close Infected debug window");
79 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_SCROLL ,
"PluginNutritionDumper" ,
"CheckInit" ,
"[LCtrl]+[SCROLL LOCK]" ,
"Enable Door Ruler");
80 RegisterKeyBind(
MENU_NONE ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_RBRACKET,
"PluginCharPlacement" ,
"CheckInit" ,
"[LCtrl]+[)]" ,
"Enable CharPlacer");
83 RegisterKeyBind(
MENU_CAMERA_TOOLS ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_S ,
"PluginCameraTools" ,
"Save" ,
"[X]" ,
"Recording Tools => Start Recording Camera Path");
84 RegisterKeyBind(
MENU_CAMERA_TOOLS ,
KeyCode.KC_P ,-1 ,
"PluginCameraTools" ,
"PlayPause" ,
"[C]" ,
"Recording Tools => Stop Recording Camera Path");
85 RegisterKeyBind(
MENU_CAMERA_TOOLS ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_Q ,
"PluginCameraTools" ,
"AddKeyframe" ,
"[C]" ,
"Recording Tools => Add Camera Point");
86 RegisterKeyBind(
MENU_CAMERA_TOOLS ,
KeyCode.KC_LCONTROL ,
KeyCode.KC_E ,
"PluginCameraTools" ,
"DeleteKeyframe" ,
"[V]" ,
"Recording Tools => Play Camera Line");
104 RegisterMouseBind(
MENU_NONE ,
MouseState.LEFT ,
MB_EVENT_CLICK ,
"PluginDayZCreatureAIDebug",
"Event_OnClick" ,
"[LMB] Click" ,
"DayZCreature graph debug => Capture entity during capture mode");
129 for (
int i = 0; i < m_KeyBindings.Count(); ++i )
131 KeyBinding key_binding = m_KeyBindings.Get(i);
133 if ( !IsCurrentUIPageValid( key_binding.
GetUIMenuID() ) )
138 bool key1_match =
false;
139 bool key2_match =
false;
141 if ( key_binding.
GetKey1() > -1 )
143 if ( IsKeyPressed(key_binding.
GetKey1()) )
155 if ( key_binding.
GetKey2() > -1 )
157 if ( IsKeyPressed(key_binding.
GetKey2()) )
169 if ( key1_match && key2_match )
194 if (button_info == NULL)
return;
209 if (button_info == NULL)
return;
213 int time_delta_press = time_curr - time_last_press;
214 int time_delta_relase = time_curr - time_last_release;
216 if ( time_delta_relase < DOUBLE_CLICK_TIME )
222 else if ( time_delta_press < CLICK_TIME )
241 for (
int i = 0; i < m_MouseButtons.Count(); ++i )
250 if ( time_hold < time_curr )
265 return m_KeyBindings;
273 return m_MouseBindings;
276 protected const int CLICK_TIME = 200;
277 protected const int DOUBLE_CLICK_TIME = 300;
278 protected const int HOLD_CLICK_TIME_MIN = 300;
287 protected void RegisterKeyBind(
int ui_id,
int key_code1,
int key_code2,
string plugin_name,
string fnc_name,
string info_shortcut,
string info_description )
289 m_KeyBindings.Insert(
new KeyBinding(ui_id, key_code1, key_code2, plugin_name, fnc_name, info_shortcut, info_description) );
295 protected void RegisterMouseBind(
int ui_id,
int mouse_button,
int mouse_event,
string plugin_name,
string fnc_name,
string info_shortcut,
string info_description )
297 m_MouseBindings.Insert(
new MouseBinding(ui_id, mouse_button, mouse_event, plugin_name, fnc_name, info_shortcut, info_description) );
307 if (
GetGame().GetUIManager().GetMenu() )
312 if ( ui_page_current <
MENU_ANY || !CheckMask( ui_page_request, ui_page_current ) )
314 if ( CheckMask( ui_page_request,
MENU_NONE ) || !CheckMask( ui_page_request,
MENU_ANY ) )
325 if ( ( source_mask & target_mask ) == target_mask )
336 protected void OnMouse(
int event_id,
int button )
338 for (
int i = 0; i < m_MouseBindings.Count(); ++i )
344 if ( IsCurrentUIPageValid( mouse_binding.
GetUIMenuID() ) )
358 for (
int i = 0; i < m_MouseButtons.Count(); ++i )
PluginBase GetPlugin(typename plugin_type)
override ScriptInvoker GetUpdateQueue(int call_category)
proto native UIManager GetUIManager()
proto int GetTime()
returns mission time in milliseconds
string GetCallbackTarget()
string GetCallbackFunction()
string GetCallbackTarget()
string GetCallbackFunction()
protected bool IsCurrentUIPageValid(int ui_page_request)
void OnMouseButtonPress(int button)
protected ref array< ref MouseButtonInfo > m_MouseButtons
array< ref MouseBinding > GetMouseBindings()
protected ref array< ref MouseBinding > m_MouseBindings
array< ref KeyBinding > GetKeyBindings()
protected void RegisterKeyBind(int ui_id, int key_code1, int key_code2, string plugin_name, string fnc_name, string info_shortcut, string info_description)
void OnKeyRelease(int key)
protected void OnMouse(int event_id, int button)
override void OnDestroy()
protected ref array< ref KeyBinding > m_KeyBindings
protected void RegisterMouseBind(int ui_id, int mouse_button, int mouse_event, string plugin_name, string fnc_name, string info_shortcut, string info_description)
protected MouseButtonInfo GetMouseButtonInfo(int button)
protected bool IsKeyPressed(int key)
static PluginKeyBinding instance
bool CheckMask(int source_mask, int target_mask)
void OnMouseButtonRelease(int button)
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto volatile int CallFunction(Class inst, string function, out void returnVal, void parm)
proto native int KeyState(KeyCode key)
const int MB_EVENT_RELEASE
const int MB_EVENT_DOUBLECLICK
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...