Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
ChimeraMenuBase.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
65
66//------------------------------------------------------------------------------------------------
68// #define MPTEST // TODO: remove
69
70//------------------------------------------------------------------------------------------------
72{
73
74//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
75// The base scripted menu class should not care about edit boxes
76
77 // Editbox type check
78 protected const string INPUT_CONTEXT_EDIT = "MenuTextEditContext";
79 protected bool m_bTextEditActive = false;
81
82//---- REFACTOR NOTE END ----
83
84//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
85// Components not ticking is an important architecture decision and should be respected as such or changed at the engine level: this is a hacky workaround. Also, all invokers for other important events are missing
86
87 ref ScriptInvoker m_OnUpdate = new ScriptInvoker; // (float tDelta)
88
89//---- REFACTOR NOTE END ----
90
91//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
92// Did people get confused and thought it was another menu xD?
93
94 protected static ChimeraMenuBase m_ThisMenu;
95
96 //------------------------------------------------------------------------------------------------
98 {
99 return m_ThisMenu;
100 }
101
102//---- REFACTOR NOTE END ----
103
104 //------------------------------------------------------------------------------------------------
105 override void OnMenuInit()
106 {
107 m_ThisMenu = this;
108 }
109
110 //------------------------------------------------------------------------------------------------
111 override void OnMenuUpdate(float tDelta)
112 {
113 super.OnMenuUpdate(tDelta);
114
115 // Check edit box context active
116 bool ctxActive = GetGame().GetInputManager().IsContextActive(INPUT_CONTEXT_EDIT);
117 m_OnTextEditContextChange.Invoke(ctxActive);
118
119 // Invoke OnUpdate
120 m_OnUpdate.Invoke(tDelta);
121 }
122
123//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
124// Wouldn't it make more sense for a scripted MenuManager to provide the generic events now handled by SCR_MenuHelper?
125
126 //------------------------------------------------------------------------------------------------
127 override void OnMenuOpen()
128 {
129 super.OnMenuOpened();
131 }
132
133 //------------------------------------------------------------------------------------------------
134 override void OnMenuOpened()
135 {
136 super.OnMenuOpened();
138 }
139
140 //------------------------------------------------------------------------------------------------
141 override void OnMenuClose()
142 {
143 super.OnMenuClose();
145 }
146
147 //------------------------------------------------------------------------------------------------
148 override void OnMenuFocusGained()
149 {
150 super.OnMenuFocusGained();
152 }
153
154 //------------------------------------------------------------------------------------------------
155 override void OnMenuFocusLost()
156 {
157 super.OnMenuFocusLost();
159 }
160
161 //------------------------------------------------------------------------------------------------
162 override void OnMenuShow()
163 {
164 super.OnMenuShow();
166 }
167
168 //------------------------------------------------------------------------------------------------
169 override void OnMenuHide()
170 {
171 super.OnMenuHide();
173 }
174
175//---- REFACTOR NOTE END ----
176
177 //------------------------------------------------------------------------------------------------
180 {
181 auto game = GetGame();
182
183 if (!game)
184 return null;
185
186 auto menuManager = game.GetMenuManager();
187
188 if (!menuManager)
189 return null;
190
191 MenuBase menuBase = menuManager.GetOwnerMenu(w);
192
193 if (!menuBase)
194 return null;
195
196 ChimeraMenuBase m = ChimeraMenuBase.Cast(menuBase);
197
198 if (!m)
199 return null;
200
201 return m;
202 }
203};
ChimeraMenuPreset
Menu presets.
@ EditorMenu
@ CareerMenu
@ SettingsSuperMenu
@ MainMenu
@ ScenarioMenu
@ EditorAttributesDialog
@ CareerProfileMenu
@ CreateGroupSettingsDialog
@ CreditsMenu
@ VolunteerForGroupLeaderDialog
@ NewsDialog
@ ContentBrowser
@ LoadingOverlay
@ DebriefingScreenMenu
@ EditorBrowserDialog
@ WelcomeScreenMenu
@ RoleSelectionDialog
@ RespawnSuperMenu
@ EditorActionListDialog
@ EditorSaveDialog
@ CommandPostMapMenu
@ WelcomeDialog
@ GroupFlagDialog
@ ProfileSuperMenu
@ ServerBrowserMenu
@ ErrorDialog
@ EditorLoadDialog
@ ConfigurableDialog
@ GroupMenu
@ CampaignBuildingPlacingMenuDialog
@ PlayMenu
@ Inventory20Menu
@ ReportItemDialog
@ FieldManualDialog
@ CampaignMenu
@ EditorFactionListDialog
@ PlayerListMenu
@ TaskDetail
@ PrivacyPolicyMenu
@ ContentBrowserDetailsMenuSave
@ FeedbackDialog
@ LoginDialogConsole
@ LoginDialog
@ EditorEntityListDialog
@ CreditsLicensesMenu
@ MapMenu
@ EditorModesDialog
@ EditorSelectionMenu
@ GroupSettingsDialog
@ EndgameScreen
@ EditorPlacingMenuDialog
@ WidgetLibraryMenu
@ EditorPlayerListDialog
@ TutorialFastTravel
@ PauseMenu
@ GalleryDialog
@ WorldEditorIngameMenu
@ GamepadRemovalDialog
ref DSGameConfig game
Definition DSConfig.c:81
ArmaReforgerScripted GetGame()
Definition game.c:1398
Constant variables used in various menus.
static ChimeraMenuBase GetOwnerMenu(Widget w)
Returns parent menu of a widget.
override void OnMenuShow()
override void OnMenuHide()
static ChimeraMenuBase m_ThisMenu
override void OnMenuFocusGained()
override void OnMenuOpen()
static ChimeraMenuBase CurrentChimeraMenu()
override void OnMenuClose()
const string INPUT_CONTEXT_EDIT
ref ScriptInvoker m_OnUpdate
override void OnMenuInit()
override void OnMenuUpdate(float tDelta)
override void OnMenuFocusLost()
ref ScriptInvoker m_OnTextEditContextChange
override void OnMenuOpened()
static void OnMenuFocusLost(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuFocusGained(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuClose(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuOpen(ChimeraMenuBase menu)
static void OnMenuOpened(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuShow(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuHide(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134