Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ConfigurableDialogUI.c
Go to the documentation of this file.
1//-------------------------------------------------------------------------------------------
7#define DEBUG_CONFIGURABLE_DIALOGS
8
11typedef ScriptInvokerBase<ScriptInvokerConfigurableDialogMethod> ScriptInvokerConfigurableDialog;
12
13//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
14// Despite being a widget component, this is NOT meant to be placed manually in layouts: it is added by script, so it should not have attributes
15
17{
18 static const ResourceName NAVIGATION_BUTTON_LAYOUT = "{87037226B1A2064B}UI/layouts/WidgetLibrary/Buttons/WLib_NavigationButtonSuperSmall.layout";
19
20 // Attributes
21 [Attribute((1/UIConstants.FADE_RATE_FAST).ToString(), UIWidgets.Auto, "Duration of fade in and fade out animations")]
22 protected float m_fFadeInTime;
23
24 [Attribute(NAVIGATION_BUTTON_LAYOUT, UIWidgets.ResourceNamePicker, "Layout of the navigation button", params: "layout")]
26
27//---- REFACTOR NOTE END ----
28
29//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
30// A unified solution for footers should be used instead
31
32 [Attribute("ButtonsLeft", UIWidgets.Auto, "Widget name of left buttons layout")]
33 protected string m_sWidgetNameButtonsLeft;
34
35 [Attribute("ButtonsRight", UIWidgets.Auto, "Widget name of right buttons layout")]
36 protected string m_sWidgetNameButtonsRight;
37
38 [Attribute("ButtonsCenter", UIWidgets.Auto, "Widget name of center buttons layout")]
40
41//---- REFACTOR NOTE END ----
42
43//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
44// Old untyped invokers
45
46 // Script Invokers
47 ref ScriptInvoker m_OnConfirm = new ScriptInvoker(); // (SCR_ConfigurableDialogUi dlg) - Called when Confirm button was clicked, if you don't override OnConfirm of this class
48 ref ScriptInvoker m_OnCancel = new ScriptInvoker(); // (SCR_ConfigurableDialogUi dlg) - Called when Cancel button was clicked, if you don't override OnConfirm of this class
49 ref ScriptInvoker m_OnClose = new ScriptInvoker(); // (SCR_ConfigurableDialogUi dlg) - Called when dialog is closed, AFTER the fade out animation is over
50 ref ScriptInvoker m_OnCloseStart = new ScriptInvoker(); // (SCR_ConfigurableDialogUi dlg) - Called when dialog is closed, as soon as the fade out animation STARTS
51 ref ScriptInvoker m_OnButtonPressed = new ScriptInvoker(); // (SCR_ConfigurableDialogUi dlg, string tag) - Generic delegate called by all the buttons, returning their EStage
52
53//---- REFACTOR NOTE END ----
54
55 // Widgets
61
62 // Other
63 // TODO: let the dynamic footer handle keeping track of buttons
65
66 protected Widget m_wRoot;
68
70
71 // Menu handler which performs menu-specific actions.
73
74 // Current dialog preset for data
76
77 // Tag of the last button Button pressed
78 protected string m_sLastPressedButtonTag;
79
80 // Prevents Close() to be called multiple times
81 protected bool m_bIsClosing;
82
84
85 static const string BUTTON_CONFIRM = "confirm";
86 static const string BUTTON_CANCEL = "cancel";
87
88
89 //-------------------------------------------------------------------------------------------------------------------------
90 // P U B L I C A P I
91 //-------------------------------------------------------------------------------------------------------------------------
92 //-----------------------------------------------------------------------
94 static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj = null)
95 {
96 // Create presets
97 Resource rsc = BaseContainerTools.LoadContainer(presetsResourceName);
98 BaseContainer container = rsc.GetResource().ToBaseContainer();
99 SCR_ConfigurableDialogUiPresets presets = SCR_ConfigurableDialogUiPresets.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
100
101 // Find preset
102 SCR_ConfigurableDialogUiPreset preset = presets.FindPreset(tag);
103
104 // Bail if preset is not found
105 if (!preset)
106 {
107 Print(string.Format("[SCR_ConfigurableDialogUi] Preset was not found: %1, %2", presets, tag), LogLevel.ERROR);
108 return null;
109 }
110
111 SCR_ConfigurableDialogUi dialog = CreateByPreset(preset, customDialogObj);
112
113 #ifdef DEBUG_CONFIGURABLE_DIALOGS
114 Print(string.Format("[SCR_ConfigurableDialogUi] presetsResourceName: %1, tag: %2, customDialogObj: %3", presetsResourceName, tag, customDialogObj));
115 #endif
116
117 return dialog;
118 }
119
120 //------------------------------------------------------------------------------------------------
125
126 //------------------------------------------------------------------------------------------------
127 static string GetCurrentDialogTag()
128 {
129 if (m_CurrentDialog)
130 return m_CurrentDialog.GetDialogPreset().m_sTag;
131
132 return string.Empty;
133 }
134
135 //------------------------------------------------------------------------------------------------
136 static bool IsPresetValid(ResourceName presetsResourceName, string tag)
137 {
138 // Create presets
139 Resource rsc = BaseContainerTools.LoadContainer(presetsResourceName);
140 BaseContainer container = rsc.GetResource().ToBaseContainer();
141 SCR_ConfigurableDialogUiPresets presets = SCR_ConfigurableDialogUiPresets.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
142
143 // Find preset
144 return presets.FindPreset(tag);
145 }
146
147 //------------------------------------------------------------------------------------------------
149 {
150 // Open the proxy dialog
151 SCR_ConfigurableDialogUiProxy proxyComp = SCR_ConfigurableDialogUiProxy.Cast(GetGame().GetMenuManager().OpenDialog(ChimeraMenuPreset.ConfigurableDialog));
152
153 // Create the base configurable dialog layout inside proxy
154 Widget internalWidget = GetGame().GetWorkspace().CreateWidgets(preset.m_sLayout, proxyComp.GetRootWidget());
155
156 if (!internalWidget)
157 {
158 Print(string.Format("[SCR_ConfigurableDialogUi] internalWidget wans't created"), LogLevel.ERROR);
159 return null;
160 }
161
162 // Create the content layout inside the content area of the base layout, if there should be one
163 if(!preset.m_sContentLayout.IsEmpty())
164 {
165 Widget contentContainer = GetContentWidget(internalWidget);
166
167 if(!contentContainer)
168 {
169 Print(string.Format("[SCR_ConfigurableDialogUi] CreateByPreset() contentContainer wasn't found"), LogLevel.ERROR);
170 return null;
171 }
172
173 Widget contentWidget = GetGame().GetWorkspace().CreateWidgets(preset.m_sContentLayout, contentContainer);
174
175 AlignableSlot.SetHorizontalAlign(contentWidget, LayoutHorizontalAlign.Stretch);
176 }
177
178 SCR_ConfigurableDialogUi dialog = SCR_ConfigurableDialogUi.Cast(internalWidget.FindHandler(SCR_ConfigurableDialogUi));
179
180 // Create a new dialog object, or apply the provided one, if the dialog obj was not found in the layout.
181 if (!dialog)
182 {
183 if (customDialogObj)
184 dialog = customDialogObj;
185 else
186 dialog = new SCR_ConfigurableDialogUi();
188 internalWidget.AddHandler(dialog);
189 }
190
191 dialog.Init(internalWidget, preset, proxyComp);
192 proxyComp.Init(dialog);
193
194 // Set action context
195 if (!preset.m_sActionContext.IsEmpty())
196 proxyComp.SetActionContext(preset.m_sActionContext);
197
198 // Call dialog's events manually
199 dialog.OnMenuOpen(preset);
200
201 m_CurrentDialog = dialog;
202 return dialog;
203 }
204
205 //----------------------------------------------------------------------------------------
207 protected static Widget GetContentWidget(Widget baseWidget)
208 {
209 if(!baseWidget)
210 {
211 Print(string.Format("[SCR_ConfigurableDialogUi] GetContentWidet(): invalid base Widget"), LogLevel.ERROR);
212 return null;
213 }
214
215 Widget contentContainer = baseWidget.FindAnyWidget("ContentLayoutContainer");
216
217 if(!contentContainer)
218 {
219 Print(string.Format("[SCR_ConfigurableDialogUi] GetContentWidet(): couldn't find ContentLayoutContainer widget in base layout"), LogLevel.ERROR);
220 return null;
221 }
222
223 return contentContainer;
224 }
225
226 //----------------------------------------------------------------------------------------
228 {
229 return m_wRoot;
230 }
231
232 //----------------------------------------------------------------------------------------
238
239 //----------------------------------------------------------------------------------------
242 {
243 return GetContentWidget(GetRootWidget()).GetChildren();
244 }
245
246 //----------------------------------------------------------------------------------------
251
252 //------------------------------------------------------------------------------------------------
253 // Closes the dialogue with a fade-out animation
254 void Close()
255 {
256 if (m_bIsClosing)
257 return;
258
259 m_bIsClosing = true;
260 m_OnCloseStart.Invoke(this);
262 }
263
264
265 //------------------------------------------------------------------------------------------------
266 void SetTitle(string text)
267 {
268 if (m_wTitle)
269 m_wTitle.SetText(text);
270 }
271
272
273 //------------------------------------------------------------------------------------------------
274 void SetMessage(string text)
275 {
276 if (m_wMessage)
277 {
278 m_wMessage.SetVisible(true);
279 m_wMessage.SetText(text);
280 }
281 }
282
283 //------------------------------------------------------------------------------------------------
285 {
286 if (m_wMessage)
287 m_wMessage.SetColor(color);
288 }
289
290 //------------------------------------------------------------------------------------------------
292 {
293 return m_wMessage;
294 }
295
296 //------------------------------------------------------------------------------------------------
298 {
299 if (m_wMessage)
300 return m_wMessage.GetText();
301
302 return string.Empty;
303 }
304
305 //------------------------------------------------------------------------------------------------
307 void SetTitleIcon(ResourceName image, string imageName)
308 {
309 if (!m_wImgTitleIcon)
310 return;
311
312 // Set image by input
313 if (image.EndsWith("imageset"))
314 m_wImgTitleIcon.LoadImageFromSet(0, image, imageName);
315 else
316 m_wImgTitleIcon.LoadImageTexture(0, image);
317 }
318
319 //------------------------------------------------------------------------------------------------
321 void SetIconColor(Color color)
322 {
323 if (!m_wImgTitleIcon)
324 return;
325
326 m_wImgTitleIcon.SetColor(color);
327 }
328
329 //------------------------------------------------------------------------------------------------
332 {
333 // Check widgets
335 return;
336
337 // Select color
338 Color color = Color.FromInt(Color.WHITE);
339
340 switch (type)
341 {
342 case EConfigurableDialogStyle.ACTION:
343 color = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
344 break;
345
346 case EConfigurableDialogStyle.WARNING:
347 color = Color.FromInt(UIColors.WARNING.PackToInt());
348 break;
349
350 case EConfigurableDialogStyle.POSITIVE:
351 color = Color.FromInt(UIColors.CONFIRM.PackToInt());
352 break;
353
354 case EConfigurableDialogStyle.ONLINE:
355 color = Color.FromInt(UIColors.ONLINE.PackToInt());
356 break;
357 }
358
359 // Set colors
360 m_wImgTopLine.SetColor(color);
361 m_wImgTitleIcon.SetColor(color);
362 }
363
364 //----------------------------------------------------------------------------------------
367 {
368 if (!button)
369 return;
370
371 button.m_OnActivated.Insert(OnConfirm);
372
376 else
377 m_aButtonComponents.Insert(BUTTON_CONFIRM, button);
378 }
379
380 //----------------------------------------------------------------------------------------
383 {
384 if (!button)
385 return;
386
387 button.m_OnActivated.Insert(OnCancel);
388
392 else
393 m_aButtonComponents.Insert(BUTTON_CANCEL, button);
394 }
395
396 //----------------------------------------------------------------------------------------
398 void BindButtonGeneric(SCR_InputButtonComponent button, string tag = string.Empty)
399 {
400 if (!button)
401 return;
402
403 button.m_OnActivated.Insert(OnButtonPressed);
404
406 Widget root = button.GetRootWidget();
407 string buttonTag = tag;
408 if (root && buttonTag.IsEmpty())
409 buttonTag = root.GetName();
410
411 if(m_aButtonComponents.Contains(buttonTag))
412 m_aButtonComponents.Set(buttonTag, button);
413 else
414 m_aButtonComponents.Insert(buttonTag, button);
415 }
416
417 //----------------------------------------------------------------------------------------
420 {
421 return m_aButtonComponents.Get(tag);
422 }
423
424 //----------------------------------------------------------------------------------------
427 {
428 if(!button)
429 return string.Empty;
430
431 return SCR_MapHelper<string, SCR_InputButtonComponent>.GetKeyByValue(m_aButtonComponents, button);
432 }
433
434 // --- Protected ---
435 //----------------------------------------------------------------------------------------
436 protected void OnConfirm()
437 {
438 m_OnConfirm.Invoke(this);
439 Close();
440 }
441
442
443 //----------------------------------------------------------------------------------------
444 protected void OnCancel()
445 {
446 m_OnCancel.Invoke(this);
447 Close();
448 }
449
450
451 //----------------------------------------------------------------------------------------
457
458 //----------------------------------------------------------------------------------------
462
463 // Menu events
464 void OnMenuUpdate(float tDelta);
470
471 //----------------------------------------------------------------------------------------
472 protected void Init(Widget root, SCR_ConfigurableDialogUiPreset preset, MenuBase proxyMenu)
473 {
474 m_ProxyMenu = proxyMenu;
475 m_DialogPreset = preset;
476 m_wRoot = root;
477
478 InitWidgets();
479
480 // Set title
481 SetTitle(preset.m_sTitle);
482
483 // Set message
484 if (!preset.m_sMessage.IsEmpty())
485 {
486 SetMessage(preset.m_sMessage);
487 }
488
489 // Set style
490 SetStyle(preset.m_eVisualStyle);
491
492 // Set title image
494 m_wImgTitleIcon.SetVisible(preset.m_bShowIcon);
495
496 if (!preset.m_sTitleIconTexture.IsEmpty())
497 {
498 SetTitleIcon(preset.m_sTitleIconTexture, preset.m_sTitleIconImageName);
499 }
500
501 // Footer
502 m_DynamicFooter = SCR_DynamicFooterComponent.FindComponentInHierarchy(GetRootWidget());
503
504 // Create buttons
508
509 foreach (SCR_ConfigurableDialogUiButtonPreset buttonPreset : preset.m_aButtons)
510 {
511 CreateButton(buttonPreset);
512 }
513
514 // Bind actions to default buttons (if they were created)
516 BindButtonConfirm(buttonConfirm);
517
519 BindButtonCancel(buttonCancel);
520 }
521
522 //----------------------------------------------------------------------------------------
523 protected void InitWidgets()
524 {
525 Widget w = m_wRoot;
526
527 // Images
528 m_wImgTopLine = ImageWidget.Cast(w.FindAnyWidget("Separator"));
529 m_wImgTitleIcon = ImageWidget.Cast(w.FindAnyWidget("ImgTitleIcon"));
530
531 // Texts
532 m_wTitle = TextWidget.Cast(w.FindAnyWidget("Title"));
533 m_wMessage = TextWidget.Cast(w.FindAnyWidget("Message"));
534
535 // Verical layout widget
536 m_wContentVerticalLayout = VerticalLayoutWidget.Cast(w.FindAnyWidget("ContentVerticalLayout"));
537
538 // Base Overlay
539 m_wDialogBase = OverlayWidget.Cast(w.FindAnyWidget("DialogBase"));
540 }
541
542 //----------------------------------------------------------------------------------------
544 {
546 float padding, paddingLeft, paddingRight;
547 switch (buttonPreset.m_eAlign)
548 {
550 wLayout = HorizontalLayoutWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetNameButtonsLeft));
551 break;
552
554 wLayout = HorizontalLayoutWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetNameButtonsRight));
555 break;
556
557 default:
558 wLayout = HorizontalLayoutWidget.Cast(GetRootWidget().FindAnyWidget(m_sWidgetNameButtonsCenter)); break;
559 }
560
561 Widget wButton = GetGame().GetWorkspace().CreateWidgets(m_sNavigationButtonLayout, wLayout);
562 wButton.SetName(buttonPreset.m_sTag);
563
565 // TODO: let the dynamic footer handle the padding entirely
566 float left, top, bottom;
567 AlignableSlot.GetPadding(wButton, left, top, padding, bottom);
568 switch (buttonPreset.m_eAlign)
569 {
571 paddingRight = padding;
572 break;
573
575 paddingLeft = padding;
576 break;
577
578 default: break;
579 }
580
581 AlignableSlot.SetPadding(wButton, paddingLeft, 0.0, paddingRight, 0.0);
582
583 // Button setup
585
586 if (!comp)
587 return null;
588
589 comp.SetVisible(buttonPreset.m_bShowButton, false);
590 comp.SetLabel(buttonPreset.m_sLabel);
591 comp.SetAction(buttonPreset.m_sActionName);
592
593 comp.SetHoverSound(buttonPreset.m_sSoundHovered);
594 comp.SetClickedSound(buttonPreset.m_sSoundClicked);
595
596 comp.m_OnActivated.Insert(OnButtonPressed);
597
598 // Cache
599 m_aButtonComponents.Insert(buttonPreset.m_sTag, comp);
600
601 if (m_DynamicFooter)
602 m_DynamicFooter.RegisterButton(comp);
603
604 return comp;
605 }
606
607 //----------------------------------------------------------------------------------------
608 protected void Internal_Close()
609 {
610 if (!m_ProxyMenu)
611 return;
612
613 m_ProxyMenu.Close();
614 m_OnClose.Invoke(this);
615 }
616
617 //----------------------------------------------------------------------------------------
620 protected void InitAttributedVariables()
621 {
622 if (m_sNavigationButtonLayout.IsEmpty())
623 m_sNavigationButtonLayout = NAVIGATION_BUTTON_LAYOUT;
624
625 if (m_sWidgetNameButtonsLeft.IsEmpty())
626 m_sWidgetNameButtonsLeft = "ButtonsLeft";
627
628 if (m_sWidgetNameButtonsRight.IsEmpty())
629 m_sWidgetNameButtonsRight = "ButtonsRight";
630
631 if (m_sWidgetNameButtonsCenter.IsEmpty())
632 m_sWidgetNameButtonsCenter = "ButtonsCenter";
633
634 if (m_fFadeInTime == 0)
635 m_fFadeInTime = 1/UIConstants.FADE_RATE_FAST;
636 }
637}
638
639//-------------------------------------------------------------------------------------------
641class SCR_ConfigurableDialogUiProxy : DialogUI
642{
644
646 {
647 m_Dlg = dlg;
648 }
649
650 //-------------------------------------------------------------------------------------------
651 override void OnMenuUpdate(float tDelta)
652 {
653 super.OnMenuUpdate(tDelta);
654 m_Dlg.OnMenuUpdate(tDelta);
655 }
656
657 //-------------------------------------------------------------------------------------------
658 override void OnMenuFocusGained()
659 {
660 super.OnMenuFocusGained();
661
662 if (m_Dlg)
663 m_Dlg.OnMenuFocusGained();
664 }
665
666 //-------------------------------------------------------------------------------------------
667 override void OnMenuFocusLost()
668 {
669 super.OnMenuFocusLost();
670
671 if (m_Dlg)
672 m_Dlg.OnMenuFocusLost();
673 }
674
675 //-------------------------------------------------------------------------------------------
676 override void OnMenuShow()
677 {
678 super.OnMenuShow();
679
680 if (m_Dlg)
681 m_Dlg.OnMenuShow();
682 }
683
684 //-------------------------------------------------------------------------------------------
685 override void OnMenuHide()
686 {
687 super.OnMenuHide();
688
689 if (m_Dlg)
690 m_Dlg.OnMenuHide();
691 }
692
693 //-------------------------------------------------------------------------------------------
694 override void OnMenuClose()
695 {
696 super.OnMenuClose();
697
698 if (m_Dlg)
699 m_Dlg.OnMenuClose();
700 }
701};
702
703
704//-------------------------------------------------------------------------------------------
712
713
714//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
715// Duplicate of EDialogType
716
717//------------------------------------------------------------------------------------------------
727
728//---- REFACTOR NOTE END ----
729
730//-------------------------------------------------------------------------------------------
731// C O N F I G U R A T I O N C L A S S E S
732//-------------------------------------------------------------------------------------------
733//-------------------------------------------------------------------------------------------
735[BaseContainerProps(configRoot : true), SCR_BaseContainerCustomTitleField("m_sTag")]
737{
738 [Attribute("", UIWidgets.Auto, "Custom tag, used for finding this button at run time")]
739 string m_sTag;
740
741 [Attribute("", UIWidgets.Auto, "Action name the button will listen to")]
742 string m_sActionName;
743
744 [Attribute("", UIWidgets.Auto, "Label of the button")]
745 string m_sLabel;
746
747 [Attribute("0", UIWidgets.ComboBox, "Alignment of the button", "", ParamEnumArray.FromEnum(EConfigurableDialogUiButtonAlign))]
749
750 [Attribute(SCR_SoundEvent.SOUND_FE_BUTTON_HOVER, UIWidgets.EditBox, "")]
751 string m_sSoundHovered;
752
753 [Attribute(SCR_SoundEvent.CLICK, UIWidgets.EditBox, "")]
754 string m_sSoundClicked;
755
756 [Attribute("1", UIWidgets.CheckBox)]
757 bool m_bShowButton;
758};
759
760//-------------------------------------------------------------------------------------------
762[BaseContainerProps(configRoot : true), SCR_BaseContainerCustomTitleField("m_sTag")]
764{
765 [Attribute("{E6B607B27BCC1477}UI/layouts/Menus/Dialogs/ConfigurableDialog.layout", UIWidgets.ResourceNamePicker, ".layout for the base of the dialog", params: "layout")]
766 ResourceName m_sLayout;
767
768 [Attribute("", UIWidgets.ResourceNamePicker, ".layout for the content of the dialog", params: "layout")]
769 ResourceName m_sContentLayout;
770
771 [Attribute("", UIWidgets.Auto, "Custom tag, used for finding this preset at run time.")]
772 string m_sTag;
773
774 [Attribute("0", UIWidgets.ComboBox, "Visual style. Affects color of elements.", "", ParamEnumArray.FromEnum(EDialogType))]
775 EDialogType m_eVisualStyle;
776
777 [Attribute(UIConstants.ICONS_IMAGE_SET, UIWidgets.ResourcePickerThumbnail, "Texture or imageset for title icon", "edds imageset")]
778 ResourceName m_sTitleIconTexture;
779
780 [Attribute("1")]
781 bool m_bShowIcon;
782
783 [Attribute("misc", UIWidgets.Auto)]
784 string m_sTitleIconImageName;
785
786 [Attribute("", UIWidgets.Auto, "Message to be displayed inside, if messaage widget is present.")]
787 string m_sMessage;
788
789 [Attribute("", UIWidgets.Auto, "Title of the dialog")]
790 string m_sTitle;
791
792 [Attribute()]
793 ref array<ref SCR_ConfigurableDialogUiButtonPreset> m_aButtons;
794
795 [Attribute(string.Empty, UIWidgets.EditBox, "Action context of the menu. If empty, MenuContext is used, same as in standard menu manager.")]
796 string m_sActionContext;
797};
798
799
800//-------------------------------------------------------------------------------------------
802[BaseContainerProps(configRoot : true)]
804{
805 [Attribute()]
806 ref array<ref SCR_ConfigurableDialogUiPreset> m_aPresets;
807
808
809 //-------------------------------------------------------------------------------------------
811 SCR_ConfigurableDialogUiPreset FindPreset(string tag)
812 {
813 foreach (auto i : m_aPresets)
814 {
815 if (i.m_sTag == tag)
816 return i;
817 }
818
819 return null;
820 }
821};
override void Init()
ChimeraMenuPreset
Menu presets.
EDialogType
Definition DialogUI.c:237
@ NEUTRAL
@ POSITIVE
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
@ ACTION
func ScriptInvokerConfigurableDialogMethod
ScriptInvokerBase< ScriptInvokerConfigurableDialogMethod > ScriptInvokerConfigurableDialog
SCR_ConfigurableDialogUi m_Dlg
It is here to expose the Menu API to the configurable dialog instance.
EConfigurableDialogStyle
Style of the dialog.
EConfigurableDialogUiButtonAlign
Configuration for button alignment.
EDamageType type
SCR_Faction ScriptedFaction SCR_BaseContainerCustomTitleField("m_sCallsign")
Widget GetContentWidget()
enum SCR_EServicePointType ONLINE
override void OnMenuShow()
override void OnMenuHide()
override void OnMenuFocusGained()
override void OnMenuFocusLost()
Definition Color.c:13
override void OnMenuClose()
Definition DialogUI.c:75
override void OnMenuUpdate(float tDelta)
Definition DialogUI.c:82
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
SCR_InputButtonComponent CreateButton(SCR_ConfigurableDialogUiButtonPreset buttonPreset)
SCR_DynamicFooterComponent m_DynamicFooter
static Widget GetContentWidget(Widget baseWidget)
Returns the container in which to place the content layout. Container must be called ContentLayoutCon...
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
string GetButtonTag(SCR_InputButtonComponent button)
Returns a button's tag.
Widget GetContentLayoutRoot()
Returns the root of the content layout.
ref SCR_ConfigurableDialogUiPreset m_DialogPreset
static SCR_ConfigurableDialogUi GetCurrentDialog()
void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
void BindButtonCancel(SCR_InputButtonComponent button)
Allows to register a custom button to call OnCancel (i.e. one not in the conf files but placed by han...
ref map< string, SCR_InputButtonComponent > m_aButtonComponents
void BindButtonConfirm(SCR_InputButtonComponent button)
Allows to register a custom button to call OnConfirm (i.e. one not in the conf files but placed by ha...
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
static SCR_ConfigurableDialogUi CreateByPreset(SCR_ConfigurableDialogUiPreset preset, SCR_ConfigurableDialogUi customDialogObj=null)
static SCR_ConfigurableDialogUi m_CurrentDialog
void SetTitleIcon(ResourceName image, string imageName)
Set title icons with custom image.
VerticalLayoutWidget m_wContentVerticalLayout
void OnButtonPressed(SCR_InputButtonComponent button)
void Init(Widget root, SCR_ConfigurableDialogUiPreset preset, MenuBase proxyMenu)
SCR_ConfigurableDialogUiPreset GetDialogPreset()
OverlayWidget GetDialogBaseOverlay()
Returns the base dialog overlay (the rectangle covered by the background). Useful for dialog wide dar...
void BindButtonGeneric(SCR_InputButtonComponent button, string tag=string.Empty)
Allows to register a custom button to call OnButtonPressed (i.e. one not in the conf files but placed...
void SetStyle(EConfigurableDialogStyle type)
Sets colors based on style.
void SetIconColor(Color color)
Set title icons with custom image.
void OnMenuUpdate(float tDelta)
static bool IsPresetValid(ResourceName presetsResourceName, string tag)
Class for a .conf file with multiple presets.
bool SetAction(string action, EInputDeviceType currentInputDevice=-1, bool forceUpdate=false)
void SetLabel(string label)
PUBLIC API\.
Definition Types.c:486
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
@ CENTER
Text will be centered.
@ WARNING
Definition LogLevel.c:19
SCR_FieldOfViewSettings Attribute
@ LEFT
navigation
@ RIGHT
LayoutHorizontalAlign
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134