DayZ 1.24
Loading...
Searching...
No Matches
ItemDropWarningMenu.c File Reference

Go to the source code of this file.

Classes

class  WarningMenuBase
 
class  PlayerRepositionWarningMenu
 

Functions

WarningMenuBase UIScriptedMenu GetText ()
 
void WarningMenuBase ()
 
void ~WarningMenuBase ()
 
override Widget Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
override bool OnClick (Widget w, int x, int y, int button)
 
override void Update (float timeslice)
 
void OnInputPresetChanged ()
 
void OnInputDeviceChanged (EInputDeviceType pInputDeviceType)
 
void UpdateControlsElements ()
 
void UpdateControlsElementVisibility ()
 

Variables

ButtonWidget m_OkButton
 
MultilineTextWidget m_Description
 

Function Documentation

◆ GetText()

Definition at line 1 of file ItemDropWarningMenu.c.

116 {
117 return "#str_item_drop_notification";
118 }

◆ Init()

override Widget GetText::Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

Definition at line 144 of file ItemDropWarningMenu.c.

145{
146 protected ButtonWidget m_OkButton;
148
149 void WarningMenuBase()
150 {
151 if (GetGame().GetMission())
152 {
153 GetGame().GetMission().AddActiveInputExcludes({"menu"});
154
155 GetGame().GetMission().GetHud().ShowHudUI(false);
156 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
157 }
158 }
159
160 void ~WarningMenuBase()
161 {
162 if (GetGame() && GetGame().GetMission())
163 {
164 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
165
166 GetGame().GetMission().GetHud().ShowHudUI(true);
167 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
168
169 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
170 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
171 }
172 }
173
174 override Widget Init()
175 {
176 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
177 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
178 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
179 m_Description.Show(true);
180
181 string text = Widget.TranslateString(GetText());
182 m_Description.SetText(text);
183
184 if (GetGame().GetMission())
185 {
186 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
187 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
188 }
189
190 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
191
192 return layoutRoot;
193 }
194
195 string GetText()
196 {
197 return "";
198 }
199
200 override bool OnClick(Widget w, int x, int y, int button)
201 {
202 super.OnClick(w, x, y, button);
203
204 if (w.GetUserID() == IDC_OK)
205 {
206 Close();
207 return true;
208 }
209
210 return false;
211 }
212
213 override void Update(float timeslice)
214 {
215 super.Update(timeslice);
216
217#ifdef PLATFORM_CONSOLE
218 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
219 Close();
220#endif
221 }
222
223 protected void OnInputPresetChanged()
224 {
225#ifdef PLATFORM_CONSOLE
227#endif
228 }
229
231 {
234 }
235
236 protected void UpdateControlsElements()
237 {
238 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
239 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
240
241 toolbarText.SetText(context);
242 }
243
244 protected void UpdateControlsElementVisibility()
245 {
246 bool toolbarShow = false;
247#ifdef PLATFORM_CONSOLE
248 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
249#endif
250
251 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
252 m_OkButton.Show(!toolbarShow);
253 }
254}
255
257{
258 override string GetText()
259 {
260 return "#str_item_drop_notification";
261 }
262}
263
265{
266 override string GetText()
267 {
268 return "#str_position_change_notification";
269 }
270}
ActionInput GetInput()
Definition ActionBase.c:989
string GetText()
Definition ActionBase.c:264
Icon x
Icon y
void Close()
void ~WarningMenuBase()
void UpdateControlsElementVisibility()
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
void OnInputPresetChanged()
ButtonWidget m_OkButton
WarningMenuBase UIScriptedMenu GetText()
override bool OnClick(Widget w, int x, int y, int button)
MultilineTextWidget m_Description
void UpdateControlsElements()
override Widget Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
void WarningMenuBase()
proto native UAInputAPI GetUApi()
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:151
static const float ICON_SCALE_TOOLBAR
Definition InputUtils.c:15
proto native CGame GetGame()
const int IDC_OK
Definition constants.c:127
proto native volatile void Update()
EInputDeviceType
Definition input.c:3

◆ OnClick()

override bool GetText::OnClick ( Widget w,
int x,
int y,
int button )
protected

Definition at line 170 of file ItemDropWarningMenu.c.

171{
172 protected ButtonWidget m_OkButton;
174
175 void WarningMenuBase()
176 {
177 if (GetGame().GetMission())
178 {
179 GetGame().GetMission().AddActiveInputExcludes({"menu"});
180
181 GetGame().GetMission().GetHud().ShowHudUI(false);
182 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
183 }
184 }
185
186 void ~WarningMenuBase()
187 {
188 if (GetGame() && GetGame().GetMission())
189 {
190 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
191
192 GetGame().GetMission().GetHud().ShowHudUI(true);
193 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
194
195 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
196 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
197 }
198 }
199
200 override Widget Init()
201 {
202 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
203 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
204 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
205 m_Description.Show(true);
206
207 string text = Widget.TranslateString(GetText());
208 m_Description.SetText(text);
209
210 if (GetGame().GetMission())
211 {
212 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
213 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
214 }
215
216 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
217
218 return layoutRoot;
219 }
220
221 string GetText()
222 {
223 return "";
224 }
225
226 override bool OnClick(Widget w, int x, int y, int button)
227 {
228 super.OnClick(w, x, y, button);
229
230 if (w.GetUserID() == IDC_OK)
231 {
232 Close();
233 return true;
234 }
235
236 return false;
237 }
238
239 override void Update(float timeslice)
240 {
241 super.Update(timeslice);
242
243#ifdef PLATFORM_CONSOLE
244 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
245 Close();
246#endif
247 }
248
249 protected void OnInputPresetChanged()
250 {
251#ifdef PLATFORM_CONSOLE
253#endif
254 }
255
257 {
260 }
261
262 protected void UpdateControlsElements()
263 {
264 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
265 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
266
267 toolbarText.SetText(context);
268 }
269
270 protected void UpdateControlsElementVisibility()
271 {
272 bool toolbarShow = false;
273#ifdef PLATFORM_CONSOLE
274 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
275#endif
276
277 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
278 m_OkButton.Show(!toolbarShow);
279 }
280}
281
283{
284 override string GetText()
285 {
286 return "#str_item_drop_notification";
287 }
288}
289
291{
292 override string GetText()
293 {
294 return "#str_position_change_notification";
295 }
296}

◆ OnInputDeviceChanged()

void GetText::OnInputDeviceChanged ( EInputDeviceType pInputDeviceType)
protected

Definition at line 200 of file ItemDropWarningMenu.c.

201{
202 protected ButtonWidget m_OkButton;
204
205 void WarningMenuBase()
206 {
207 if (GetGame().GetMission())
208 {
209 GetGame().GetMission().AddActiveInputExcludes({"menu"});
210
211 GetGame().GetMission().GetHud().ShowHudUI(false);
212 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
213 }
214 }
215
216 void ~WarningMenuBase()
217 {
218 if (GetGame() && GetGame().GetMission())
219 {
220 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
221
222 GetGame().GetMission().GetHud().ShowHudUI(true);
223 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
224
225 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
226 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
227 }
228 }
229
230 override Widget Init()
231 {
232 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
233 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
234 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
235 m_Description.Show(true);
236
237 string text = Widget.TranslateString(GetText());
238 m_Description.SetText(text);
239
240 if (GetGame().GetMission())
241 {
242 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
243 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
244 }
245
246 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
247
248 return layoutRoot;
249 }
250
251 string GetText()
252 {
253 return "";
254 }
255
256 override bool OnClick(Widget w, int x, int y, int button)
257 {
258 super.OnClick(w, x, y, button);
259
260 if (w.GetUserID() == IDC_OK)
261 {
262 Close();
263 return true;
264 }
265
266 return false;
267 }
268
269 override void Update(float timeslice)
270 {
271 super.Update(timeslice);
272
273#ifdef PLATFORM_CONSOLE
274 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
275 Close();
276#endif
277 }
278
279 protected void OnInputPresetChanged()
280 {
281#ifdef PLATFORM_CONSOLE
283#endif
284 }
285
287 {
290 }
291
292 protected void UpdateControlsElements()
293 {
294 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
295 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
296
297 toolbarText.SetText(context);
298 }
299
300 protected void UpdateControlsElementVisibility()
301 {
302 bool toolbarShow = false;
303#ifdef PLATFORM_CONSOLE
304 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
305#endif
306
307 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
308 m_OkButton.Show(!toolbarShow);
309 }
310}
311
313{
314 override string GetText()
315 {
316 return "#str_item_drop_notification";
317 }
318}
319
321{
322 override string GetText()
323 {
324 return "#str_position_change_notification";
325 }
326}

◆ OnInputPresetChanged()

void GetText::OnInputPresetChanged ( )
protected

Definition at line 193 of file ItemDropWarningMenu.c.

194{
195 protected ButtonWidget m_OkButton;
197
198 void WarningMenuBase()
199 {
200 if (GetGame().GetMission())
201 {
202 GetGame().GetMission().AddActiveInputExcludes({"menu"});
203
204 GetGame().GetMission().GetHud().ShowHudUI(false);
205 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
206 }
207 }
208
209 void ~WarningMenuBase()
210 {
211 if (GetGame() && GetGame().GetMission())
212 {
213 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
214
215 GetGame().GetMission().GetHud().ShowHudUI(true);
216 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
217
218 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
219 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
220 }
221 }
222
223 override Widget Init()
224 {
225 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
226 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
227 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
228 m_Description.Show(true);
229
230 string text = Widget.TranslateString(GetText());
231 m_Description.SetText(text);
232
233 if (GetGame().GetMission())
234 {
235 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
236 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
237 }
238
239 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
240
241 return layoutRoot;
242 }
243
244 string GetText()
245 {
246 return "";
247 }
248
249 override bool OnClick(Widget w, int x, int y, int button)
250 {
251 super.OnClick(w, x, y, button);
252
253 if (w.GetUserID() == IDC_OK)
254 {
255 Close();
256 return true;
257 }
258
259 return false;
260 }
261
262 override void Update(float timeslice)
263 {
264 super.Update(timeslice);
265
266#ifdef PLATFORM_CONSOLE
267 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
268 Close();
269#endif
270 }
271
272 protected void OnInputPresetChanged()
273 {
274#ifdef PLATFORM_CONSOLE
276#endif
277 }
278
280 {
283 }
284
285 protected void UpdateControlsElements()
286 {
287 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
288 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
289
290 toolbarText.SetText(context);
291 }
292
293 protected void UpdateControlsElementVisibility()
294 {
295 bool toolbarShow = false;
296#ifdef PLATFORM_CONSOLE
297 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
298#endif
299
300 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
301 m_OkButton.Show(!toolbarShow);
302 }
303}
304
306{
307 override string GetText()
308 {
309 return "#str_item_drop_notification";
310 }
311}
312
314{
315 override string GetText()
316 {
317 return "#str_position_change_notification";
318 }
319}

◆ Update()

override void GetText::Update ( float timeslice)
protected

Definition at line 183 of file ItemDropWarningMenu.c.

184{
185 protected ButtonWidget m_OkButton;
187
188 void WarningMenuBase()
189 {
190 if (GetGame().GetMission())
191 {
192 GetGame().GetMission().AddActiveInputExcludes({"menu"});
193
194 GetGame().GetMission().GetHud().ShowHudUI(false);
195 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
196 }
197 }
198
199 void ~WarningMenuBase()
200 {
201 if (GetGame() && GetGame().GetMission())
202 {
203 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
204
205 GetGame().GetMission().GetHud().ShowHudUI(true);
206 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
207
208 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
209 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
210 }
211 }
212
213 override Widget Init()
214 {
215 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
216 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
217 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
218 m_Description.Show(true);
219
220 string text = Widget.TranslateString(GetText());
221 m_Description.SetText(text);
222
223 if (GetGame().GetMission())
224 {
225 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
226 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
227 }
228
229 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
230
231 return layoutRoot;
232 }
233
234 string GetText()
235 {
236 return "";
237 }
238
239 override bool OnClick(Widget w, int x, int y, int button)
240 {
241 super.OnClick(w, x, y, button);
242
243 if (w.GetUserID() == IDC_OK)
244 {
245 Close();
246 return true;
247 }
248
249 return false;
250 }
251
252 override void Update(float timeslice)
253 {
254 super.Update(timeslice);
255
256#ifdef PLATFORM_CONSOLE
257 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
258 Close();
259#endif
260 }
261
262 protected void OnInputPresetChanged()
263 {
264#ifdef PLATFORM_CONSOLE
266#endif
267 }
268
270 {
273 }
274
275 protected void UpdateControlsElements()
276 {
277 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
278 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
279
280 toolbarText.SetText(context);
281 }
282
283 protected void UpdateControlsElementVisibility()
284 {
285 bool toolbarShow = false;
286#ifdef PLATFORM_CONSOLE
287 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
288#endif
289
290 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
291 m_OkButton.Show(!toolbarShow);
292 }
293}
294
296{
297 override string GetText()
298 {
299 return "#str_item_drop_notification";
300 }
301}
302
304{
305 override string GetText()
306 {
307 return "#str_position_change_notification";
308 }
309}

◆ UpdateControlsElements()

void GetText::UpdateControlsElements ( )
protected

Definition at line 206 of file ItemDropWarningMenu.c.

207{
208 protected ButtonWidget m_OkButton;
210
211 void WarningMenuBase()
212 {
213 if (GetGame().GetMission())
214 {
215 GetGame().GetMission().AddActiveInputExcludes({"menu"});
216
217 GetGame().GetMission().GetHud().ShowHudUI(false);
218 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
219 }
220 }
221
222 void ~WarningMenuBase()
223 {
224 if (GetGame() && GetGame().GetMission())
225 {
226 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
227
228 GetGame().GetMission().GetHud().ShowHudUI(true);
229 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
230
231 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
232 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
233 }
234 }
235
236 override Widget Init()
237 {
238 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
239 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
240 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
241 m_Description.Show(true);
242
243 string text = Widget.TranslateString(GetText());
244 m_Description.SetText(text);
245
246 if (GetGame().GetMission())
247 {
248 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
249 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
250 }
251
252 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
253
254 return layoutRoot;
255 }
256
257 string GetText()
258 {
259 return "";
260 }
261
262 override bool OnClick(Widget w, int x, int y, int button)
263 {
264 super.OnClick(w, x, y, button);
265
266 if (w.GetUserID() == IDC_OK)
267 {
268 Close();
269 return true;
270 }
271
272 return false;
273 }
274
275 override void Update(float timeslice)
276 {
277 super.Update(timeslice);
278
279#ifdef PLATFORM_CONSOLE
280 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
281 Close();
282#endif
283 }
284
285 protected void OnInputPresetChanged()
286 {
287#ifdef PLATFORM_CONSOLE
289#endif
290 }
291
293 {
296 }
297
298 protected void UpdateControlsElements()
299 {
300 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
301 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
302
303 toolbarText.SetText(context);
304 }
305
306 protected void UpdateControlsElementVisibility()
307 {
308 bool toolbarShow = false;
309#ifdef PLATFORM_CONSOLE
310 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
311#endif
312
313 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
314 m_OkButton.Show(!toolbarShow);
315 }
316}
317
319{
320 override string GetText()
321 {
322 return "#str_item_drop_notification";
323 }
324}
325
327{
328 override string GetText()
329 {
330 return "#str_position_change_notification";
331 }
332}

Referenced by UIScriptedMenu::ChangeCurrentCategory(), UIScriptedMenu::Init(), ScriptedWidgetEventHandler::Init(), UIScriptedMenu::LoadMods(), UIScriptedMenu::OnInputDeviceChanged(), ScriptedWidgetEventHandler::OnInputDeviceChanged(), UIScriptedMenu::OnInputPresetChanged(), ScriptedWidgetEventHandler::OnInputPresetChanged(), UIScriptedMenu::OnShow(), UIScriptedMenu::PerformSwitchPreset(), and UIScriptedMenu::RefreshGestures().

◆ UpdateControlsElementVisibility()

void GetText::UpdateControlsElementVisibility ( )
protected

Definition at line 214 of file ItemDropWarningMenu.c.

215{
216 protected ButtonWidget m_OkButton;
218
219 void WarningMenuBase()
220 {
221 if (GetGame().GetMission())
222 {
223 GetGame().GetMission().AddActiveInputExcludes({"menu"});
224
225 GetGame().GetMission().GetHud().ShowHudUI(false);
226 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
227 }
228 }
229
230 void ~WarningMenuBase()
231 {
232 if (GetGame() && GetGame().GetMission())
233 {
234 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
235
236 GetGame().GetMission().GetHud().ShowHudUI(true);
237 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
238
239 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
240 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
241 }
242 }
243
244 override Widget Init()
245 {
246 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
247 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
248 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
249 m_Description.Show(true);
250
251 string text = Widget.TranslateString(GetText());
252 m_Description.SetText(text);
253
254 if (GetGame().GetMission())
255 {
256 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
257 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
258 }
259
260 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
261
262 return layoutRoot;
263 }
264
265 string GetText()
266 {
267 return "";
268 }
269
270 override bool OnClick(Widget w, int x, int y, int button)
271 {
272 super.OnClick(w, x, y, button);
273
274 if (w.GetUserID() == IDC_OK)
275 {
276 Close();
277 return true;
278 }
279
280 return false;
281 }
282
283 override void Update(float timeslice)
284 {
285 super.Update(timeslice);
286
287#ifdef PLATFORM_CONSOLE
288 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
289 Close();
290#endif
291 }
292
293 protected void OnInputPresetChanged()
294 {
295#ifdef PLATFORM_CONSOLE
297#endif
298 }
299
301 {
304 }
305
306 protected void UpdateControlsElements()
307 {
308 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
309 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
310
311 toolbarText.SetText(context);
312 }
313
314 protected void UpdateControlsElementVisibility()
315 {
316 bool toolbarShow = false;
317#ifdef PLATFORM_CONSOLE
318 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
319#endif
320
321 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
322 m_OkButton.Show(!toolbarShow);
323 }
324}
325
327{
328 override string GetText()
329 {
330 return "#str_item_drop_notification";
331 }
332}
333
335{
336 override string GetText()
337 {
338 return "#str_position_change_notification";
339 }
340}

Referenced by UIScriptedMenu::Init(), UIScriptedMenu::OnInputDeviceChanged(), UIScriptedMenu::OnInputPresetChanged(), and UIScriptedMenu::OnShow().

◆ WarningMenuBase()

void GetText::WarningMenuBase ( )
protected

Definition at line 119 of file ItemDropWarningMenu.c.

122{
123 override string GetText()
124 {
125 return "#str_position_change_notification";
126 }
127}

◆ ~WarningMenuBase()

void GetText::~WarningMenuBase ( )
protected

Definition at line 130 of file ItemDropWarningMenu.c.

131{
132 protected ButtonWidget m_OkButton;
134
135 void WarningMenuBase()
136 {
137 if (GetGame().GetMission())
138 {
139 GetGame().GetMission().AddActiveInputExcludes({"menu"});
140
141 GetGame().GetMission().GetHud().ShowHudUI(false);
142 GetGame().GetMission().GetHud().ShowQuickbarUI(false);
143 }
144 }
145
146 void ~WarningMenuBase()
147 {
148 if (GetGame() && GetGame().GetMission())
149 {
150 GetGame().GetMission().RemoveActiveInputExcludes({"menu"}, true);
151
152 GetGame().GetMission().GetHud().ShowHudUI(true);
153 GetGame().GetMission().GetHud().ShowQuickbarUI(true);
154
155 GetGame().GetMission().GetOnInputPresetChanged().Remove(OnInputPresetChanged);
156 GetGame().GetMission().GetOnInputDeviceChanged().Remove(OnInputDeviceChanged);
157 }
158 }
159
160 override Widget Init()
161 {
162 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_dropped_items.layout");
163 m_OkButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("bOK"));
164 m_Description = MultilineTextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
165 m_Description.Show(true);
166
167 string text = Widget.TranslateString(GetText());
168 m_Description.SetText(text);
169
170 if (GetGame().GetMission())
171 {
172 GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
173 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
174 }
175
176 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
177
178 return layoutRoot;
179 }
180
181 string GetText()
182 {
183 return "";
184 }
185
186 override bool OnClick(Widget w, int x, int y, int button)
187 {
188 super.OnClick(w, x, y, button);
189
190 if (w.GetUserID() == IDC_OK)
191 {
192 Close();
193 return true;
194 }
195
196 return false;
197 }
198
199 override void Update(float timeslice)
200 {
201 super.Update(timeslice);
202
203#ifdef PLATFORM_CONSOLE
204 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
205 Close();
206#endif
207 }
208
209 protected void OnInputPresetChanged()
210 {
211#ifdef PLATFORM_CONSOLE
213#endif
214 }
215
217 {
220 }
221
222 protected void UpdateControlsElements()
223 {
224 RichTextWidget toolbarText = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
225 string context = string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#early_access_alpha_understand", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
226
227 toolbarText.SetText(context);
228 }
229
230 protected void UpdateControlsElementVisibility()
231 {
232 bool toolbarShow = false;
233#ifdef PLATFORM_CONSOLE
234 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
235#endif
236
237 layoutRoot.FindAnyWidget("BottomConsoleToolbar").Show(toolbarShow);
238 m_OkButton.Show(!toolbarShow);
239 }
240}
241
243{
244 override string GetText()
245 {
246 return "#str_item_drop_notification";
247 }
248}
249
251{
252 override string GetText()
253 {
254 return "#str_position_change_notification";
255 }
256}

Variable Documentation

◆ m_Description

MultilineTextWidget m_Description
protected

Definition at line 117 of file ItemDropWarningMenu.c.

◆ m_OkButton

ButtonWidget m_OkButton
protected

Definition at line 116 of file ItemDropWarningMenu.c.