Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
dispatchercaller.c
Go to the documentation of this file.
1 class DispatcherCaller extends Dispatcher
2 {
3  private void SendLogAtClient(Param1<string> p)
4  {
5  PluginDeveloper m = PluginDeveloper.Cast( GetPlugin(PluginDeveloper) );
6 
7  if ( m != NULL )
8  {
9  m.SendServerLogToClient(p.param1);
10  }
11  }
12 
13  private void ScriptConsoleAddPrint(Param1<string> p)
14  {
15  UIScriptedMenu ui_menu = GetGame().GetUIManager().GetMenu();
16  if ( ui_menu && ui_menu.GetID() == MENU_SCRIPTCONSOLE )
17  {
18  ScriptConsole scripted_console = ScriptConsole.Cast( ui_menu );
19  ScriptConsoleEnfScriptTab tab = ScriptConsoleEnfScriptTab.Cast(scripted_console.GetTabHandler(ScriptConsoleEnfScriptTab));
20  if (tab)
21  tab.Add(p.param1);
22  }
23  }
24 
25  private void ScriptConsoleHistoryBack()
26  {
27  UIScriptedMenu ui_menu = GetGame().GetUIManager().GetMenu();
28  if ( ui_menu.GetID() == MENU_SCRIPTCONSOLE )
29  {
30  ScriptConsole scriptConsole = ScriptConsole.Cast( ui_menu );
31  ScriptConsoleEnfScriptTab handler = ScriptConsoleEnfScriptTab.Cast(scriptConsole.GetSelectedHandler());
32  if (handler)
33  {
34  handler.HistoryBack();
35  }
36  }
37  }
38 
39  private void ScriptConsoleHistoryForward()
40  {
41  UIScriptedMenu ui_menu = GetGame().GetUIManager().GetMenu();
42  if ( ui_menu.GetID() == MENU_SCRIPTCONSOLE )
43  {
44  ScriptConsole scriptConsole = ScriptConsole.Cast( ui_menu );
45  ScriptConsoleEnfScriptTab handler = ScriptConsoleEnfScriptTab.Cast(scriptConsole.GetSelectedHandler());
46  if (handler)
47  {
48  handler.HistoryForward();
49  }
50 
51  }
52  }
53 
54  private void SceneEditorCommand(Param params)
55  {
56  UIScriptedMenu ui_menu = GetGame().GetUIManager().GetMenu();
57  if ( ui_menu && ui_menu.GetID() == MENU_SCENE_EDITOR )
58  {
59  SceneEditorMenu editor_menu = SceneEditorMenu.Cast( ui_menu );
60  editor_menu.SceneEditorCommand( params );
61  }
62  }
63 
64  private void MissionGameplayHideInventory()
65  {
66  MissionGameplay mission = MissionGameplay.Cast( GetGame().GetMission() );
67  if ( mission )
68  {
69  mission.HideInventory();
70  }
71  }
72 
73  override Param CallMethod(CallID call_id, Param params)
74  {
75  switch(call_id)
76  {
77  case CALL_ID_SEND_LOG:
78  SendLogAtClient(Param1<string>.Cast( params ));
79  break;
81  ScriptConsoleAddPrint(Param1<string>.Cast( params ));
82  break;
84  SceneEditorCommand( params );
85  break;
87  MissionGameplayHideInventory();
88  break;
90  return new Param1<string>(ScriptConsoleItemsTab.GetLastSelectedObject());
92  ScriptConsoleHistoryBack();
93  break;
95  ScriptConsoleHistoryForward();
96  break;
97  }
98 
99 
100  return null;
101  }
102 }
GetGame
proto native CGame GetGame()
UIScriptedMenu
Definition: dayzgame.c:63
MENU_SCENE_EDITOR
const int MENU_SCENE_EDITOR
Definition: constants.c:167
mission
Mission mission
Definition: displaystatus.c:28
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
Dispatcher
Definition: dispatcher.c:13
CALL_ID_SCENE_EDITOR_COMMAND
const CallID CALL_ID_SCENE_EDITOR_COMMAND
Definition: dispatcher.c:9
CallMethod
Param CallMethod(CallID call_id, Param params)
Definition: dispatcher.c:36
MENU_SCRIPTCONSOLE
const int MENU_SCRIPTCONSOLE
Definition: constants.c:175
Param3
Definition: entityai.c:95
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
ScriptConsoleItemsTab
Definition: scriptconsoleitemstab.c:3
CALL_ID_HIDE_INVENTORY
const CallID CALL_ID_HIDE_INVENTORY
Definition: dispatcher.c:10
CALL_ID_SEND_LOG
const CallID CALL_ID_SEND_LOG
Definition: dispatcher.c:3
CALL_ID_SCR_CNSL_HISTORY_BACK
const CallID CALL_ID_SCR_CNSL_HISTORY_BACK
Definition: dispatcher.c:4
CALL_ID_SCR_CNSL_HISTORY_NEXT
const CallID CALL_ID_SCR_CNSL_HISTORY_NEXT
Definition: dispatcher.c:5
CALL_ID_SCR_CNSL_GETSELECTEDITEM
const CallID CALL_ID_SCR_CNSL_GETSELECTEDITEM
Definition: dispatcher.c:11
CALL_ID_SCR_CNSL_ADD_PRINT
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Definition: dispatcher.c:6
ScriptConsoleEnfScriptTab
Definition: scriptconsoleenfscripttab.c:1