Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
plugindiagmenumodding.c
Go to the documentation of this file.
1 
8 #ifdef DOXYGEN
9 #ifdef MODDING_TEST
10 #ifdef DIAG_DEVELOPER
11 
18 #ifdef DOXYGEN
19 class PluginDiagMenuModded // Just to not have it show up for the regular entry... Doxygen doesn't know about modding
20 #else
21 modded class PluginDiagMenu
22 #endif
23 {
30  protected string m_ModdedDiagsExampleRootMenu = "BI - DiagsModdingExample";
31 
35  protected string m_ModdedDiagsExampleSubMenu = "Example Sub Menu";
36 
43  protected int m_ModdedDiagsExampleRootMenuID;
44  protected int m_ModdedDiagsExampleBoolID;
45  protected int m_ModdedDiagsExampleSubMenuID;
46  protected int m_ModdedDiagsExampleRangeID;
48 
49  //---------------------------------------------
55  override protected void RegisterModdedDiagsIDs()
56  {
57  super.RegisterModdedDiagsIDs();
58 
59  m_ModdedDiagsExampleRootMenuID = GetModdedDiagID();
60  m_ModdedDiagsExampleBoolID = GetModdedDiagID();
61  m_ModdedDiagsExampleSubMenuID = GetModdedDiagID();
62  m_ModdedDiagsExampleRangeID = GetModdedDiagID();
63  }
64 
65  //---------------------------------------------
72  override protected void RegisterModdedDiags()
73  {
74  super.RegisterModdedDiags();
75 
76  // Register the root menu of your mod under the ModdedRootMenu
77  // Then register all following menus and items under this menu
78  // This can not be enforced, but it will help keep things clean
79  // Including being able to easily identify where a debug is coming from
80  // So that reports of a broken debug can be sent to the correct developer
81  //
82  // If you have multiple mods, you might even want to consider to create a root menu with your developer name
83  // And then put the mod menus as a submenu
84  // To prevent someone running a lot of mods from having an overflooded menu
85  // DiagMenu.MenuExists(...) could serve to help to identify if the root menu already exists when using this format
86  // So that the multiple mods can know if they still have to register your root menu or not
87  DiagMenu.RegisterMenu(m_ModdedDiagsExampleRootMenuID, m_ModdedDiagsExampleRootMenu, GetModdedRootMenu());
88  {
89  DiagMenu.RegisterBool(m_ModdedDiagsExampleBoolID, "", "Modded Example Bool", m_ModdedDiagsExampleRootMenuID);
90 
91  // A sub menu inside the root of the mod menu
92  // The curly braces are simply for readability
93  DiagMenu.RegisterMenu(m_ModdedDiagsExampleSubMenuID, m_ModdedDiagsExampleSubMenu, m_ModdedDiagsExampleRootMenuID);
94  {
95  DiagMenu.RegisterRange(m_ModdedDiagsExampleRangeID, "", "Modded Example Range", m_ModdedDiagsExampleSubMenuID, "3 9 6 3");
96  }
97  }
98  }
99 }
100 
101 #ifdef DOXYGEN
102 class DummyDoxygenClass
103 {
104  int m_IgnoreThisVariable;
105 }
106 #endif
107 
113 #ifdef DOXYGEN
114 class PluginDiagMenuClientModded // Just to not have it show up for the regular entry... Doxygen doesn't know about modding
115 #else
116 modded class PluginDiagMenuClient
117 #endif
118 {
123  override protected void BindCallbacks()
124  {
125  super.BindCallbacks();
126 
127  DiagMenu.BindCallback(m_ModdedDiagsExampleBoolID, CBModdedDiadIDsExampleBool);
128  DiagMenu.BindCallback(m_ModdedDiagsExampleRangeID, CBModdedDiadIDsExampleRange);
129  }
130 
142  static void CBModdedDiadIDsExampleBool(bool enabled)
143  {
144  Print("CBModdedDiadIDsExampleBool: " + enabled);
145  }
146 
160  static void CBModdedDiadIDsExampleRange(float value)
161  {
162  Print("CBModdedDiadIDsExampleRange: " + value);
163  }
164 }
165 
166 #endif
167 #endif
168 #endif
169 
170 //@}
PluginDiagMenuClient
Definition: plugindiagmenuclient.c:6
DiagMenu
Definition: endebug.c:232
Print
proto void Print(void var)
Prints content of variable to console/log.
PluginDiagMenu
Definition: plugindiagmenu.c:29