DayZ 1.24
Loading...
Searching...
No Matches
CharacterCreationMenu.c
Go to the documentation of this file.
1class CharacterCreationMenu extends UIScriptedMenu
2{
3#ifdef PLATFORM_CONSOLE
5 protected bool m_CharacterSaved;
6#else
8#endif
9
10 const int TOOLTIP_ID_SAVE = 1;
11 const int TOOLTIP_ID_APPLY = 2;
12
14 protected Widget m_Apply;
15 protected Widget m_Save;
19 protected TextWidget m_Version;
20 protected Widget m_DetailsRoot; //tooltips
24
25 protected ref OptionSelectorEditbox m_NameSelector;
31
33
35 {
36 MissionMainMenu mission = MissionMainMenu.Cast(GetGame().GetMission());
37
38#ifdef PLATFORM_CONSOLE
39 m_Scene = mission.GetIntroSceneXbox();
40#else
41 m_Scene = mission.GetIntroScenePC();
42#endif
43
44 m_Scene.ResetIntroCamera();
45 }
46
48 {
49 return m_Scene.GetIntroCharacter().GetCharacterObj();
50 }
51
53 {
54#ifdef PLATFORM_CONSOLE
56 if (pInputDeviceType == EInputDeviceType.CONTROLLER)
57 {
58 CheckNewOptions(); //TODO - pick only the 'focus' bit
59 }
60#endif
61 }
62
63 override Widget Init()
64 {
65#ifdef PLATFORM_CONSOLE
66 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/character_creation/xbox/character_creation.layout");
67 m_CharacterSaved = false;
68#else
69 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/character_creation/pc/character_creation.layout");
70#endif
71
72 m_CharacterRotationFrame = layoutRoot.FindAnyWidget("character_rotation_frame");
73 m_Apply = layoutRoot.FindAnyWidget("apply");
74 m_Save = layoutRoot.FindAnyWidget("save");
75 m_RandomizeCharacter = layoutRoot.FindAnyWidget("randomize_character");
76 m_BackButton = layoutRoot.FindAnyWidget("back");
77 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget("version"));
78 m_DetailsRoot = layoutRoot.FindAnyWidget("menu_details_tooltip");
79 m_DetailsLabel = TextWidget.Cast(m_DetailsRoot.FindAnyWidget("menu_details_label"));
80 m_DetailsText = RichTextWidget.Cast(m_DetailsRoot.FindAnyWidget("menu_details_tooltip_content"));
81 m_CharacterHeaderText = TextWidget.Cast(layoutRoot.FindAnyWidget("char_header_text"));
82 m_PlayedCharacterInfo = layoutRoot.FindAnyWidget("played_char_info");
83
84 string version;
85 GetGame().GetVersion(version);
86#ifdef PLATFORM_CONSOLE
87 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
88#else
89 version = "#main_menu_version" + " " + version;
90#endif
91 m_Version.SetText(version);
92
93 if (m_Scene && m_Scene.GetIntroCharacter())
94 m_OriginalCharacterID = m_Scene.GetIntroCharacter().GetCharacterID();
95
96 m_NameSelector = new OptionSelectorEditbox(layoutRoot.FindAnyWidget("character_name_setting_option"), m_Scene.GetIntroCharacter().GetCharacterName(), null, false);
97 m_GenderSelector = new OptionSelectorMultistateCharacterMenu(layoutRoot.FindAnyWidget("character_gender_setting_option"), 0, null, false, m_Scene.GetIntroCharacter().GetCharGenderList());
98 if (m_Scene.GetIntroCharacter().IsCharacterFemale())
99 {
100 m_GenderSelector.SetValue("Female");
101 m_SkinSelector = new OptionSelectorMultistateCharacterMenu(layoutRoot.FindAnyWidget("character_head_setting_option"), 0, null, false, m_Scene.GetIntroCharacter().GetCharList(ECharGender.Female));
102 }
103 else
104 {
105 m_GenderSelector.SetValue("Male");
106 m_SkinSelector = new OptionSelectorMultistateCharacterMenu(layoutRoot.FindAnyWidget("character_head_setting_option"), 0, null, false, m_Scene.GetIntroCharacter().GetCharList(ECharGender.Male));
107 }
108
109 m_TopSelector = new OptionSelectorMultistateCharacterMenu(layoutRoot.FindAnyWidget("character_top_setting_option"), 0, null, false, DefaultCharacterCreationMethods.GetConfigAttachmentTypes(InventorySlots.BODY));
110 m_BottomSelector = new OptionSelectorMultistateCharacterMenu(layoutRoot.FindAnyWidget("character_bottom_setting_option"), 0, null, false, DefaultCharacterCreationMethods.GetConfigAttachmentTypes(InventorySlots.LEGS));
111 m_ShoesSelector = new OptionSelectorMultistateCharacterMenu(layoutRoot.FindAnyWidget("character_shoes_setting_option"), 0, null, false, DefaultCharacterCreationMethods.GetConfigAttachmentTypes(InventorySlots.FEET));
112
114 if (scene_char)
115 {
116 Object obj = scene_char.GetInventory().FindAttachment(InventorySlots.BODY);
117 if (obj)
118 m_TopSelector.SetValue(obj.GetType(), false);
119
120 obj = scene_char.GetInventory().FindAttachment(InventorySlots.LEGS);
121 if (obj)
122 m_BottomSelector.SetValue(obj.GetType(), false);
123
124 obj = scene_char.GetInventory().FindAttachment(InventorySlots.FEET);
125 if (obj)
126 m_ShoesSelector.SetValue(obj.GetType(), false);
127
128 m_SkinSelector.SetValue(scene_char.GetType());
129 }
130
131 m_GenderSelector.m_OptionChanged.Insert(GenderChanged);
132 m_SkinSelector.m_OptionChanged.Insert(SkinChanged);
133 m_TopSelector.m_OptionChanged.Insert(TopChanged);
134 m_BottomSelector.m_OptionChanged.Insert(BottomChanged);
135 m_ShoesSelector.m_OptionChanged.Insert(ShoesChanged);
136
137 Refresh();
138 SetCharacter();
140
141 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
142
143 return layoutRoot;
144 }
145
147 {
148 m_GenderSelector.m_OptionChanged.Remove(GenderChanged);
149 m_SkinSelector.m_OptionChanged.Remove(SkinChanged);
150 m_TopSelector.m_OptionChanged.Remove(TopChanged);
151 m_BottomSelector.m_OptionChanged.Remove(BottomChanged);
152 m_ShoesSelector.m_OptionChanged.Remove(ShoesChanged);
153 }
154
155 //Button Events
157 void Apply()
158 {
159 if (!m_Scene.GetIntroCharacter().IsDefaultCharacter())
160 {
161 string name = m_NameSelector.GetValue();
162 if (name == "")
164
165 m_Scene.GetIntroCharacter().SaveCharName(name);
166 }
167
168 MainMenu menu_main = MainMenu.Cast(GetGame().GetUIManager().FindMenu(MENU_MAIN));
169 if (menu_main)
170 menu_main.OnChangeCharacter(false);
171 GetGame().GetUIManager().Back();
172 }
173
175 void Save()
176 {
177 if (m_Scene.GetIntroCharacter().IsDefaultCharacter())
178 {
179 string name = m_NameSelector.GetValue();
180 if (name == "")
182
183 m_Scene.GetIntroCharacter().SaveCharName(name);
184 m_Scene.GetIntroCharacter().SaveDefaultCharacter();
185 m_Scene.GetIntroCharacter().SetToDefaultCharacter();
186 SetCharacterSaved(true);
187 }
188 }
189
190 void Back()
191 {
192 //bring back DefaultCharacter, if it exists (it should), or a previously played one.
193 GetGame().GetMenuData().RequestGetDefaultCharacterData();
194#ifdef PLATFORM_CONSOLE
195 if (m_OriginalCharacterID != GameConstants.DEFAULT_CHARACTER_MENU_ID && m_CharacterSaved)
196 m_OriginalCharacterID = GameConstants.DEFAULT_CHARACTER_MENU_ID;
197#endif
198 m_Scene.GetIntroCharacter().SetCharacterID(m_OriginalCharacterID);
199 m_Scene.GetIntroCharacter().CreateNewCharacterById(m_Scene.GetIntroCharacter().GetCharacterID());
200 GetGame().GetUIManager().Back();
201 }
202
204 {
205 if (m_Scene.GetIntroCharacter().IsDefaultCharacter())
206 GetGame().GetMenuDefaultCharacterData().EquipDefaultCharacter(m_Scene.GetIntroCharacter().GetCharacterObj());
207 }
208
210 {
211 m_Scene.GetIntroCharacter().SetToDefaultCharacter();
212
213 // make random selection
214 m_Scene.GetIntroCharacter().SetCharacterGender(Math.RandomInt(0, 2));
215
216 if (m_Scene.GetIntroCharacter().IsCharacterFemale())
217 {
218 m_GenderSelector.SetValue("Female");
219 m_SkinSelector.LoadNewValues(m_Scene.GetIntroCharacter().GetCharList(ECharGender.Female), 0);
220 m_SkinSelector.SetRandomValue();
221 }
222 else
223 {
224 m_GenderSelector.SetValue("Male");
225 m_SkinSelector.LoadNewValues(m_Scene.GetIntroCharacter().GetCharList(ECharGender.Male), 0);
226 m_SkinSelector.SetRandomValue();
227 }
228
229 GetGame().GetMenuDefaultCharacterData().GenerateRandomEquip();
230
231 m_TopSelector.SetValue(GetGame().GetMenuDefaultCharacterData().GetAttachmentMap().Get(InventorySlots.BODY), false);
232 m_BottomSelector.SetValue(GetGame().GetMenuDefaultCharacterData().GetAttachmentMap().Get(InventorySlots.LEGS), false);
233 m_ShoesSelector.SetValue(GetGame().GetMenuDefaultCharacterData().GetAttachmentMap().Get(InventorySlots.FEET), false);
234
235 Refresh();
236 SetCharacter();
237
239 }
240
241 //Selector Events
243 {
245
246 if (m_GenderSelector.GetStringValue() == "Female")
247 gender = ECharGender.Female;
248
249 m_Scene.GetIntroCharacter().SetCharacterGender(gender);
250
251 m_SkinSelector.LoadNewValues(m_Scene.GetIntroCharacter().GetCharList(gender), 0);
252 m_SkinSelector.SetRandomValue();
253 SetCharacterSaved(false);
254 }
255
257 {
258 m_Scene.GetIntroCharacter().CreateNewCharacterByName(m_SkinSelector.GetStringValue(), false);
259 SetCharacterSaved(false);
260 }
261
263 {
264 GetGame().GetMenuDefaultCharacterData().SetDefaultAttachment(InventorySlots.BODY, m_TopSelector.GetStringValue());
265 GetGame().GetMenuDefaultCharacterData().EquipDefaultCharacter(m_Scene.GetIntroCharacter().GetCharacterObj());
266 SetCharacterSaved(false);
267 }
268
270 {
271 GetGame().GetMenuDefaultCharacterData().SetDefaultAttachment(InventorySlots.LEGS, m_BottomSelector.GetStringValue());
272 GetGame().GetMenuDefaultCharacterData().EquipDefaultCharacter(m_Scene.GetIntroCharacter().GetCharacterObj());
273 SetCharacterSaved(false);
274 }
275
277 {
278 GetGame().GetMenuDefaultCharacterData().SetDefaultAttachment(InventorySlots.FEET, m_ShoesSelector.GetStringValue());
279 GetGame().GetMenuDefaultCharacterData().EquipDefaultCharacter(m_Scene.GetIntroCharacter().GetCharacterObj());
280 SetCharacterSaved(false);
281 }
282
283 override bool OnKeyPress(Widget w, int x, int y, int key)
284 {
285 super.OnKeyPress(w, x, y, key);
286 return false;
287 }
288
289 override bool OnClick(Widget w, int x, int y, int button)
290 {
291 if (w == m_Apply)
292 {
293 Apply();
294 return true;
295 }
296 else if (w == m_Save)
297 {
298 Save();
299 GetGame().GetUIManager().Back();
300 return true;
301 }
302 else if (w == m_RandomizeCharacter)
303 {
305 return true;
306 }
307 else if (w == m_BackButton)
308 {
309 Back();
310 return true;
311 }
312 return false;
313 }
314
315 override bool OnMouseButtonDown(Widget w, int x, int y, int button)
316 {
317#ifndef PLATFORM_CONSOLE
318 if (w == m_CharacterRotationFrame)
319 {
320 if (m_Scene)
322 return true;
323 }
324#endif
325 return false;
326 }
327
328 override bool OnMouseButtonUp(Widget w, int x, int y, int button)
329 {
330#ifndef PLATFORM_CONSOLE
331 if (m_Scene)
333#endif
334 return false;
335 }
336
337 override bool OnMouseEnter(Widget w, int x, int y)
338 {
339 string tooltip_header = "";
340 string tooltip_text = "";
342 switch (w.GetUserID())
343 {
344 case TOOLTIP_ID_APPLY:
345 tooltip_header = "#layout_main_menu_rename";
346 tooltip_text = "#layout_character_creation_apply_tooltip";
347 break;
348
349 case TOOLTIP_ID_SAVE:
350 tooltip_header = "#layout_character_creation_save_character_alt";
351 tooltip_text = "#layout_character_creation_save_tooltip";
352 break;
353 }
355 return true;
356 }
357
358 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
359 {
360 ColorNormal(w);
361 SetFocus(null);
362
363 return true;
364 }
365
366 override bool OnFocus(Widget w, int x, int y)
367 {
368 string tooltip_header = "";
369 string tooltip_text = "";
370 if (IsFocusable(w))
371 {
373 switch (w.GetUserID())
374 {
375 case TOOLTIP_ID_APPLY:
376 tooltip_header = "#layout_main_menu_rename";
377 tooltip_text = "#layout_character_creation_apply_tooltip";
378 break;
379
380 case TOOLTIP_ID_SAVE:
381 tooltip_header = "#layout_character_creation_save_character_alt";
382 tooltip_text = "#layout_character_creation_save_tooltip";
383 break;
384 }
386 return true;
387 }
389 return false;
390 }
391
392 override bool OnFocusLost(Widget w, int x, int y)
393 {
394 if (IsFocusable(w))
395 {
396 ColorNormal(w);
397 return true;
398 }
399 return false;
400 }
401
403 {
404 if (w)
405 return (w == m_Apply || w == m_Save || w == m_RandomizeCharacter || w == m_BackButton);
406 return false;
407 }
408
409 void SetTooltipTexts(Widget w, string header = "", string desc = "")
410 {
411#ifndef PLATFORM_CONSOLE
412 bool show = header != "" && desc != "";
413 m_DetailsRoot.Show(show);
414 m_DetailsLabel.SetText(header);
415 m_DetailsText.SetText(desc);
416
417 //moves the widget to parent, setting is relative to widget alignment, case-specific implementation (getter missing!!!)
418 if (show)
419 {
423
424 w.GetScreenPos(parent_pos_x, parent_pos_y);
425 w.GetScreenSize(parent_size_x, parent_size_y);
426 layoutRoot.GetScreenSize(layout_size_x, layout_size_y);
427
430 m_DetailsRoot.SetPos(set_x, set_y, true);
431 }
432
433 m_DetailsText.Update();
434 m_DetailsLabel.Update();
435 m_DetailsRoot.Update();
436#endif
437 }
438
440 {
441 bool show_widgets = m_Scene.GetIntroCharacter().IsDefaultCharacter();
442 bool was_visible = layoutRoot.FindAnyWidget("character_gender_button").IsVisible();
443 layoutRoot.FindAnyWidget("character_gender_button").Show(show_widgets);
444 layoutRoot.FindAnyWidget("character_head_button").Show(show_widgets);
445 layoutRoot.FindAnyWidget("character_top_button").Show(show_widgets);
446 layoutRoot.FindAnyWidget("character_bottom_button").Show(show_widgets);
447 layoutRoot.FindAnyWidget("character_shoes_button").Show(show_widgets);
448
450 m_GenderSelector.Focus();
451 if (!show_widgets)
452 SetFocus(m_RandomizeCharacter);
453 }
454
455 override void OnShow()
456 {
457#ifdef PLATFORM_CONSOLE
458 m_GenderSelector.Focus();
460#endif
462 }
463
464 override void Refresh()
465 {
466 string name;
467#ifdef PLATFORM_CONSOLE
468 if (GetGame().GetUserManager() && GetGame().GetUserManager().GetSelectedUser())
469 {
470 name = GetGame().GetUserManager().GetSelectedUser().GetName();
471 if (name.LengthUtf8() > 16)
472 {
473 name = name.SubstringUtf8(0, 16);
474 name += "...";
475 }
476 }
477#else
478 name = m_Scene.GetIntroCharacter().GetCharacterName();
479 if (name == "")
481#endif
482
483 m_NameSelector.SetValue(name);
484
485 string version;
486 GetGame().GetVersion(version);
487#ifdef PLATFORM_CONSOLE
488 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
489
490 m_Apply.Show(m_CharacterSaved || !m_Scene.GetIntroCharacter().IsDefaultCharacter());
491 m_Save.Show(!m_CharacterSaved && m_Scene.GetIntroCharacter().IsDefaultCharacter());
492#else
493 version = "#main_menu_version" + " " + version;
494 m_Apply.Show(!m_Scene.GetIntroCharacter().IsDefaultCharacter());
495 m_Save.Show(m_Scene.GetIntroCharacter().IsDefaultCharacter());
496#endif
497 m_PlayedCharacterInfo.Show(!m_Scene.GetIntroCharacter().IsDefaultCharacter());
498
499 if (m_Scene.GetIntroCharacter().IsDefaultCharacter())
500 m_CharacterHeaderText.SetText("#character_menu_header");
501 else
502 m_CharacterHeaderText.SetText("#server_browser_prev_play_filter");
503
504 m_Version.SetText(version);
505
506#ifdef PLATFORM_CONSOLE
509#endif
510 }
511
512 override void Update(float timeslice)
513 {
514 if (GetUApi().GetInputByID(UAUIBack).LocalPress())
515 Back();
516
517 if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
519
520#ifdef PLATFORM_CONSOLE
521 if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
522 {
523 if (m_Scene.GetIntroCharacter().IsDefaultCharacter() && !m_CharacterSaved)
524 Save();
525 }
526#endif
527 }
528
529 override void OnHide()
530 {
531 }
532
533 //Coloring functions (Until WidgetStyles are useful)
535 {
536 if (w.IsInherited(ButtonWidget))
537 {
539 button.SetTextColor(ARGB(255, 200, 0, 0));
540 }
541
542 w.SetColor(ARGB(255, 0, 0, 0));
543
544 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
545 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
546 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
547 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
548 Widget option = Widget.Cast(w.FindAnyWidget(w.GetName() + "_option_wrapper"));
549 Widget option_label = w.FindAnyWidget("option_label");
550
551 if (text1)
552 text1.SetColor(ARGB(255, 255, 0, 0));
553
554 if (text2)
555 text2.SetColor(ARGB(255, 255, 0, 0));
556
557 if (text3)
558 {
559 text3.SetColor(ARGB(255, 255, 0, 0));
560 w.SetAlpha(1);
561 }
562
563 if (image)
564 image.SetColor(ARGB(255, 200, 0, 0));
565
566 if (option)
567 option.SetColor(ARGB(255, 255, 0, 0));
568
569#ifndef PLATFORM_CONSOLE
570 if (option_label)
571 option_label.SetColor(ARGB(255, 255, 0, 0));
572#endif
573 }
574
576 {
577 if (w.IsInherited(ButtonWidget))
578 {
581 }
582
583 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
584 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
585 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
586 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
587 Widget option = w.FindAnyWidget(w.GetName() + "_option_wrapper");
588 Widget option_label = w.FindAnyWidget("option_label");
589
590 if (text1)
592
593 if (text2)
595
596 if (text3)
597 {
599 w.SetAlpha(0);
600 }
601
602 if (image)
604
605 if (option)
606 option.SetColor(ARGB(150, 255, 255, 255));
607
608#ifndef PLATFORM_CONSOLE
609 if (option_label)
611#endif
612 }
613
615 {
616#ifndef PLATFORM_CONSOLE
617 SetFocus(null);
618#endif
619
620 if (w)
621 {
623 if (button)
625 }
626
627 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
628 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
629 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
630 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
631 Widget option = Widget.Cast(w.FindAnyWidget(w.GetName() + "_option_wrapper"));
632 Widget option_label = w.FindAnyWidget("option_label");
633
634 if (text1)
636
637 if (text2)
639
640 if (text3)
641 {
643 w.SetAlpha(1);
644 }
645
646 if (image)
648
649 if (option)
651
652#ifndef PLATFORM_CONSOLE
653 if (option_label)
655#endif
656 }
657
659 {
660#ifdef PLATFORM_CONSOLE
662 Refresh();
663#endif
664 }
665
666 protected void UpdateControlsElements()
667 {
668#ifdef PLATFORM_CONSOLE
669 RichTextWidget toolbar_text = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
670 string text = "";
671 if (!m_CharacterSaved && m_Scene.GetIntroCharacter().IsDefaultCharacter()) //can be saved..
672 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "#layout_character_creation_save_character_alt", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
673 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "#layout_character_creation_toolbar_randomize", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
674 if (m_Scene.GetIntroCharacter().IsDefaultCharacter()) //edit options available
675 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "#layout_character_creation_toolbar_select", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
676 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#layout_character_creation_toolbar_back", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
677 toolbar_text.SetText(text);
678
679 RichTextWidget toolbar_b2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon0"));
680 RichTextWidget toolbar_x2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("RandomizeIcon0"));
681 RichTextWidget toolbar_y2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("SaveIcon0"));
682 RichTextWidget toolbar_y2_2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ApplyIcon0"));
683
687 toolbar_y2.SetText(saveTextIcon);
688 toolbar_y2_2.SetText(saveTextIcon);
689#endif
690 }
691
693 {
694#ifdef PLATFORM_CONSOLE
695 bool toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboard() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
696 layoutRoot.FindAnyWidget("toolbar_bg").Show(toolbarShow);
697 layoutRoot.FindAnyWidget("play_panel_root").Show(!toolbarShow);
698#endif
699 }
700}
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition Inventory.c:167
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Definition DayZGame.c:3528
Mission mission
ECharGender
Definition ECharGender.c:2
Icon x
Icon y
void OptionSelectorMultistateCharacterMenu(Widget parent, int current_index, ScriptedWidgetEventHandler parent_c, bool disabled, notnull array< string > options)
array< ref PlayerStatBase > Get()
proto native UAInputAPI GetUApi()
static int COLOR_NORMAL_TEXT
Definition ColorManager.c:5
static int COLOR_DISABLED_TEXT
IntroSceneCharacter GetIntroCharacter()
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
provides access to slot configuration
Definition EnMath.c:7
void UpdateControlsElementVisibility()
ref OptionSelectorMultistateCharacterMenu m_BottomSelector
ref OptionSelectorMultistateCharacterMenu m_TopSelector
RichTextWidget m_DetailsText
override bool OnMouseEnter(Widget w, int x, int y)
override void OnShow()
void ColorDisable(Widget w)
override bool OnFocus(Widget w, int x, int y)
override void Update(float timeslice)
override void Refresh()
TextWidget m_Version
TextWidget m_CharacterHeaderText
void ColorHighlight(Widget w)
bool IsFocusable(Widget w)
void SetTooltipTexts(Widget w, string header="", string desc="")
ref OptionSelectorMultistateCharacterMenu m_GenderSelector
ref OptionSelectorMultistateCharacterMenu m_SkinSelector
void Apply()
renames character
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
override bool OnKeyPress(Widget w, int x, int y, int key)
override void OnHide()
void SetCharacterSaved(bool state)
override bool OnMouseButtonUp(Widget w, int x, int y, int button)
override bool OnFocusLost(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
ref OptionSelectorMultistateCharacterMenu m_ShoesSelector
void Save()
saves default character
override bool OnMouseButtonDown(Widget w, int x, int y, int button)
DayZIntroScenePC m_Scene
void UpdateControlsElements()
PlayerBase GetPlayerObj()
override Widget Init()
override bool OnClick(Widget w, int x, int y, int button)
void ColorNormal(Widget w)
ref OptionSelectorEditbox m_NameSelector
proto native CGame GetGame()
const int DEFAULT_CHARACTER_MENU_ID
Definition constants.c:840
const string DEFAULT_CHARACTER_NAME
Definition constants.c:838
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
const int MENU_MAIN
Definition constants.c:172
proto native void SetFocus(Widget w)
EInputDeviceType
Definition input.c:3
int ARGB(int a, int r, int g, int b)
Definition proto.c:322