Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AttributesEditorUIComponent.c
Go to the documentation of this file.
1
4{
5 [Attribute()]
7
8 [Attribute(defvalue: "4", desc: "If more then this amount tabs are shown then the text will be hidden and only icon will be shown")]
10
11 [Attribute("200")]
13
14 [Attribute("64")]
15 protected int m_iTabImageOnlyWidth;
16
17 [Attribute()]
18 protected string m_sTabWidgetName;
19
20 [Attribute()]
22
23 [Attribute("NoAttributeNote")]
24 protected string m_sNoAttributeNoteName;
25
26 [Attribute("ButtonClose")]
27 protected string m_sButtonCloseButtonName;
28
29 [Attribute("ButtonCloseAndSave")]
31
32 [Attribute()]
33 protected string m_sButtonResetWidgetName;
34
35 [Attribute()]
37
38 [Attribute()]
39 protected string m_sButtonEndGameCloseName;
40
41 [Attribute()]
43
44 [Attribute("ButtonLockUnlock")]
46
47 [Attribute("CustomTitlePage")]
48 protected string m_sTitleHeaderWidgetName;
49
50 [Attribute("#AR-AttributesDialog_TitlePage_Photo_Text")]
52
53 [Attribute("#AR-AttributesDialog_TitlePage_Admin_Text")]
55
56 [Attribute("#AR-AttributesDialog_TitlePage_FactionOnly_Text")]
58
59 [Attribute("#AR-Tasks_Objective")]
61
62 [Attribute("")]
64
65 [Attribute("#AR-AttributesDialog_TitlePage_Entity_Text")]
67
68 [Attribute("#AR-AttributesDialog_TitlePage_Editing_Text")]
70
71 [Attribute("PlatformImage")]
73
74 [Attribute("PlayerName")]
75 protected string m_sPlayerNameWidgetName;
76
77 [Attribute("2", "If more types then given type, m_sMultiEntitiesTitle will be used as text")]
79
80 [Attribute(desc: "A List of translated names for entity types which is also used to display the order of entity types (Eg if multiple which one to show first)")]
81 protected ref array<ref SCR_EntityAttributeTitleType> m_aEntityTypeNames;
82
83 [Attribute("{E2CBA6F76AAA42AF}UI/Fonts/Roboto/Roboto_Regular.fnt")]
85
86 //End game
87 [Attribute()]
89
90 [Attribute()]
92
93 [Attribute()]
95
96 [Attribute(SCR_SoundEvent.CLICK, UIWidgets.EditBox, "")]
98
99 [Attribute(SCR_SoundEvent.CLICK_CANCEL, UIWidgets.EditBox, "")]
101
102 [Attribute(SCR_SoundEvent.CLICK, UIWidgets.EditBox, "")]
103 protected string m_sSfxOnOpenDialog;
104
105 //~ Set to comfirm or cancel depending if a setting is changed
106 protected string m_sSfxOnCloseDialog;
107
108 protected bool m_bIsEndGame;
109
110 //Tab saving
111 protected bool m_bIsGlobalAttribute;
113
114 //Widget Refs
124
125 //Ref
126 protected SCR_AttributesManagerEditorComponent m_AttributesManager;
127
128 protected int m_iCurrentTab = -1;
129 protected ref array<ResourceName> m_CategoryConfigs;
131 protected bool m_bTabImageOnly;
132
133 //State
135
136 protected void ButtonClose()
137 {
139 if (menu)
140 {
141 menu.RemoveAutoClose();
142 menu.CloseSelf();
143 }
144
146 m_AttributesManager.ConfirmEditing();
147 }
148
149 protected void OnCancelEndGame()
150 {
152 if (menu)
153 {
154 menu.RemoveAutoClose();
155 menu.CloseSelf();
156 }
157
159 m_AttributesManager.CancelEditing();
160 }
161
162 protected void EndGamePopupComfirm()
163 {
165 m_AttributesManager.ConfirmEditing();
166 }
167
168 //---- REFACTOR NOTE START: Hard coded dialog name which can be changed easily in config
169
170 protected void OnAcceptEndGame()
171 {
172 SCR_ConfigurableDialogUi dlg = SCR_CommonDialogs.CreateDialog("session_end");
173 if (!dlg)
174 return;
175
177
178 }
179
180 //---- REFACTOR NOTE END ----
181
182 protected void ButtonReset()
183 {
185 m_AttributesManager.Reset(true);
186 }
187
188 protected void OnReset()
189 {
190 if (m_ResetButton)
191 m_ResetButton.SetEnabled(false);
192
194 {
195 m_ButtonCloseButton.SetVisible(true);
196 m_ButtonCloseAndSaveButton.SetVisible(false);
198 }
199 }
200
201 //To toggle the enable/disable of a conflicted attribute
203 {
205 m_GamepadFocusAttribute.ToggleEnableAttributeTickbox();
206 }
207
208
211 {
212 if (m_ResetButton)
213 m_ResetButton.SetEnabled(true);
214
216 {
217 m_ButtonCloseButton.SetVisible(false);
218 m_ButtonCloseAndSaveButton.SetVisible(true);
220 }
221 }
222
223 protected void RefreshAttributes()
224 {
226
227 Widget widget = GetWidget();
228 if (!widget) return;
229
230 WorkspaceWidget workspace = GetGame().GetWorkspace();
231 if (!workspace) return;
232
233 if (!m_ContentHolder) return;
234
235 if (!m_AttributesManager) return;
236
237 //--- Delete current attributes
238 while (m_ContentHolder.GetChildren())
239 {
240 delete m_ContentHolder.GetChildren();
241 }
242
243 if (m_currentCategory != string.Empty)
244 {
245 //--- Add new attributes
246 array<SCR_BaseEditorAttribute> attributes = new array<SCR_BaseEditorAttribute>;
247 m_AttributesManager.GetEditedAttributes(attributes);
248
249 foreach (SCR_BaseEditorAttribute attribute: attributes)
250 {
251 if (attribute.GetCategoryConfig() != m_currentCategory) continue;
252
253 ResourceName layout = attribute.GetLayout();
254 if (layout.IsEmpty()) continue;
255
256 Widget attributeWidget = workspace.CreateWidgets(layout, m_ContentHolder); //~Todo: Spawn attribute base and add attribute to AttributeHolder
257 if (!attributeWidget) continue;
258
260 if (attributesUI)
261 {
262 attributesUI.Init(attributeWidget, attribute);
263 attributesUI.SetFromVar(attribute.GetVariable());
264
265 //Subscribe to events
266 if (attribute.GetHasConflictingValues())
268
269 attributesUI.GetOnAttributeChanged().Insert(OnAttributeChanged);
270 }
271
272 //So UI knows that values are conflicted and adds indents to all
273 if (!m_bHasConflictingAttributes && attribute.GetHasConflictingValues())
275 }
276 }
277 }
278
279 protected void OnCurrentTabChanged(SCR_TabViewComponent tabView, Widget w, int tabIndex)
280 {
281 //Set text active of selected
282 if (m_bTabImageOnly && m_iCurrentTab > -1)
283 {
285 m_TabViewComponent.ShowTabText(tabIndex, true, m_iTabTextAndImageWidth);
286 }
287
288 if (m_CategoryConfigs.Count() == 0)
289 return;
290
291 if (m_iCurrentTab != tabIndex)
292 {
293 m_iCurrentTab = tabIndex;
294
297
299 m_AttributesManager.SetCurrentCategory(m_currentCategory);
300 }
301 }
302
307 void SetWidgetVisible(bool visible)
308 {
309 Widget widget = GetWidget();
310 if (!widget) return;
311
312 if (visible) RefreshAttributes();
313
314 widget.SetVisible(visible);
315 widget.SetEnabled(visible);
316 }
317
318 //Set which attribute is on focus
320 {
321 m_GamepadFocusAttribute = attributeUI;
322 m_GamepadToggleEnableButton.SetEnabled(m_GamepadFocusAttribute != null && m_GamepadFocusAttribute.GetTickboxEnabled());
323 }
324
325 protected void SetHasConflictingAttribute(bool hasConflicting)
326 {
327 m_bHasConflictingAttributes = hasConflicting;
328
330 m_GamepadToggleEnableButton.GetRootWidget().SetVisible(m_bHasConflictingAttributes && !GetGame().GetInputManager().IsUsingMouseAndKeyboard());
331 }
332
333 //---- REFACTOR NOTE START: End game logic is hard to read and condition to define behavior are too specific and hard to mod
334
335 void InitWidget(array<ResourceName> categoryConfigs, array<ref SCR_EditorAttributeCategory> categories)
336 {
337 SCR_UISoundEntity.SoundEvent(m_sSfxOnOpenDialog, true);
338
339 m_AttributesManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
340 if (!m_AttributesManager) return;
341
342 Widget widget = GetWidget();
343 if (!widget) return;
344
345 WorkspaceWidget workspace = GetGame().GetWorkspace();
346 if (!workspace) return;
347
349 m_PlayerNameWidget = TextWidget.Cast(widget.FindAnyWidget(m_sPlayerNameWidgetName));
350
351 Widget tabWidget = widget.FindAnyWidget(m_sTabWidgetName);
352 if (!tabWidget) return;
353
354 m_TabViewComponent = SCR_TabViewComponent.Cast(tabWidget.FindHandler(SCR_TabViewComponent));
355 if (!m_TabViewComponent) return;
356 m_TabViewComponent.GetOnChanged().Insert(OnCurrentTabChanged);
357
358 m_ContentHolder = widget.FindAnyWidget(m_sContentHolderWidgetName);
359 if (!m_ContentHolder) return;
360
361 ScriptInvoker onReset = ButtonActionComponent.GetOnAction(widget, m_sButtonResetWidgetName);
362 if (onReset) onReset.Insert(ButtonReset);
363
364 Widget resetButton = widget.FindAnyWidget(m_sButtonResetWidgetName);
365 if (resetButton)
366 m_ResetButton = SCR_InputButtonComponent.Cast(resetButton.FindHandler(SCR_InputButtonComponent));
367 if (m_ResetButton)
368 m_ResetButton.SetEnabled(false);
369
370 //Toggle attribute
372 if (onToggle) onToggle.Insert(ButtonAttributeEnableToggle);
373
374 Widget gamePadToggle = widget.FindAnyWidget(m_sGamepadToggleAttributeButtonName);
375 if (gamePadToggle)
376 {
378
380 m_GamepadToggleEnableButton.SetEnabled(false);
381 }
382
383 //Show toggle lock button
385
386 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
387
388 m_CategoryConfigs = categoryConfigs;
389
390 //--- Get current category (must be done before tabs are added, they'll rewrite it)
391 ResourceName currentCategory = m_AttributesManager.GetCurrentCategory();
392
393 if (categoryConfigs.IsEmpty())
394 {
395 Widget noAttributes = widget.FindAnyWidget(m_sNoAttributeNoteName);
396 if (noAttributes)
397 noAttributes.SetVisible(true);
398 }
399
400 bool globalAttributesSet = false;
401
402 //Add tabs
403 foreach (int i, ResourceName categoryConfig: categoryConfigs)
404 {
405 m_TabViewComponent.AddTab(string.Empty, categories[i].GetInfo().GetName(), true, categories[i].GetInfo().GetIconPath());
406
407 if (!globalAttributesSet)
408 {
409 globalAttributesSet = true;
410 m_bIsGlobalAttribute = categories[i].GetIsGlobalAttributeCategory();
411 }
412 }
413
414 array<Managed> editedItems = new array<Managed>;
415 int count = m_AttributesManager.GetEditedItems(editedItems);
416
417 InputManager inputManager = GetGame().GetInputManager();
418
419 //~ Default sfx is cancel unless a setting is changed
421
422 //End game
423 if (count == 1 && SCR_RespawnComponent.Cast(editedItems[0]))
424 {
425 m_bIsEndGame = true;
426
427 Widget closeButton = widget.FindAnyWidget(m_sButtonEndGameCloseName);
428 Widget acceptButton = widget.FindAnyWidget(m_sButtonEndGameAcceptName);
429
430 if (closeButton)
431 {
432 closeButton.SetVisible(true);
433
435 if (onClose)
436 onClose.Insert(OnCancelEndGame);
437 }
438 if (acceptButton)
439 {
440 acceptButton.SetVisible(true);
441
442 ScriptInvoker onAccept = ButtonActionComponent.GetOnAction(widget, m_sButtonEndGameAcceptName);
443 if (onAccept)
444 onAccept.Insert(OnAcceptEndGame);
445 }
446
447 ScriptInvoker onWindowClose = ButtonActionComponent.GetOnAction(widget, m_sOutsideWindowCloseButtonName);
448 if (onWindowClose)
449 onWindowClose.Insert(OnCancelEndGame);
450
451 if (m_ResetButton)
452 m_ResetButton.SetVisible(false);
453
454 inputManager.AddActionListener("EditorAttributes", EActionTrigger.DOWN, OnCancelEndGame);
455 }
456 else
457 {
458 m_ButtonCloseButton = widget.FindAnyWidget(m_sButtonCloseButtonName);
460
462 {
463 m_ButtonCloseButton.SetVisible(true);
464
465 ScriptInvoker onClose = ButtonActionComponent.GetOnAction(widget, m_sButtonCloseButtonName);
466 if (onClose)
467 onClose.Insert(ButtonClose);
468 }
470 {
472 if (onClose)
473 onClose.Insert(ButtonClose);
474
475 m_ButtonCloseAndSaveButton.SetVisible(false);
476 }
477
478 ScriptInvoker onWindowClose = ButtonActionComponent.GetOnAction(widget, m_sOutsideWindowCloseButtonName);
479 if (onWindowClose)
480 onWindowClose.Insert(ButtonClose);
481
482 inputManager.AddActionListener("EditorAttributes", EActionTrigger.DOWN, ButtonClose);
483 }
484
485 //Init
486 m_TabViewComponent.Init();
487
488 //Check if only show images
490 {
491 m_bTabImageOnly = true;
492 m_TabViewComponent.ShowAllTabsText(false, m_iTabImageOnlyWidth);
493 }
494
495 //Set active tab
497 {
498 int currentIndex = Math.Max(m_CategoryConfigs.Find(currentCategory), 0);
499 m_TabViewComponent.ShowTab(currentIndex, true, false);
500 }
501
502 m_AttributesManager.GetOnResetAttributes().Insert(OnReset);
503
504 SetHeaderText(RichTextWidget.Cast(widget.FindAnyWidget(m_sTitleHeaderWidgetName)));
505
506 if (m_bIsEndGame)
507 {
509 if (gameMode)
510 gameMode.GetOnGameModeEnd().Insert(OnCancelEndGame);
511 }
512 }
513
514 //---- REFACTOR NOTE END ----
515
516 //---- REFACTOR NOTE START: Complex and hard to read logic of loops and conditions
517 // Conditions are uncessary specific and this approach is not modular
518
519 //~Todo: Clean up set header script
520 protected void SetHeaderText(RichTextWidget header)
521 {
522 if (!header)
523 return;
524
525 array<Managed> editedItems = {};
526 int count = m_AttributesManager.GetEditedItems(editedItems);
527
528 //Check if multiple entites are selected
529 if (count > 1)
530 {
531 header.SetTextFormat("%1", m_sEditingTitlePart);
532
533 SCR_EditableEntityComponent editableEntity;
534 array<EEditableEntityType> types = {};
535 array<int> typeCounts = {};
536 SCR_EditableEntityComponent groupEntity;
537
538 bool showTypes = true;
539 bool sameNames = true;
540 bool oneGroup = true;
541 string name = string.Empty;
542
543 //Add multiple players
544
545 foreach (Managed item: editedItems)
546 {
547 editableEntity = SCR_EditableEntityComponent.Cast(item);
548
549 if (sameNames)
550 {
551 //If player never display name
552 if (SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(editableEntity.GetOwner()) > 0)
553 {
554 sameNames = false;
555 }
556 else
557 {
558 if (name == string.Empty)
559 {
560 if (editableEntity.GetEntityType() != EEditableEntityType.TASK)
561 name = editableEntity.GetDisplayName();
562 else
563 name = m_sTaskTitle;
564 }
565 else if ((name != editableEntity.GetDisplayName() && editableEntity.GetEntityType() != EEditableEntityType.TASK) || (editableEntity.GetEntityType() == EEditableEntityType.TASK && name != m_sTaskTitle))
566 {
567 sameNames = false;
568
569 if (!showTypes)
570 break;
571 }
572 }
573 }
574
575 //Logic to show types of entity types instead of names when editing
576 if (showTypes)
577 {
578 EEditableEntityType entityType = editableEntity.GetEntityType();
579
580 if (entityType == EEditableEntityType.CHARACTER)
581 {
582 //Is Player so set entity type -1
583 if (SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(editableEntity.GetOwner()) > 0)
584 {
585 oneGroup = false;
586 entityType = -1;
587 }
588 else if (oneGroup)
589 {
590 if (groupEntity == null)
591 groupEntity = editableEntity.GetParentEntity();
592 else if (groupEntity != null && groupEntity != editableEntity.GetParentEntity())
593 oneGroup = false;
594 }
595 }
596 else if (entityType == EEditableEntityType.GROUP && oneGroup)
597 {
598 if (groupEntity != null && groupEntity != editableEntity)
599 oneGroup = false;
600 else
601 groupEntity = editableEntity;
602 }
603 else
604 {
605 oneGroup = false;
606 }
607
608 int index = types.Find(entityType);
609
610 if(index < 0)
611 {
612 types.Insert(entityType);
613 typeCounts.Insert(1);
614
615 if (types.Count() > m_iEntityTypesUntilMulti)
616 {
617 showTypes = false;
618
619 if (!sameNames)
620 break;
621 }
622 }
623 else
624 {
625 typeCounts[index] = typeCounts[index] +1;
626 }
627 }
628 }
629
630 //If all entities have the same name, so display that name
631 if (sameNames)
632 {
633 SetHeaderPart(header, name, count, false);
635 }
636 //If single group with all characters of same parent then show group name and character amount
637 else if (oneGroup)
638 {
639 int characterIndex = types.Find(EEditableEntityType.CHARACTER);
640
641 SetHeaderPart(header, groupEntity.GetDisplayName(), 0 , false);
642 SetHeaderPart(header, TranslateEntityType(types[characterIndex]), typeCounts[characterIndex], true);
644 }
645 //If multiple selected of a type so display those types
646 else if (showTypes)
647 {
648 bool firstShown = false;
649 int indexHighestPriority;
650 int typeNameCount = m_aEntityTypeNames.Count();
651
652 while (types.Count() > 0)
653 {
654 int typesCount = types.Count();
655 int currentPriority = int.MAX;
656
657 for(int i = 0; i < typesCount; i++)
658 {
659 //Is player so always show first
660 if (types[i] == -1)
661 {
662 currentPriority = -1;
663 indexHighestPriority = i;
664 break;
665 }
666
667 //Check the priority of the type
668 for(int t = 0; t < typeNameCount; t++)
669 {
670 if (m_aEntityTypeNames[t].GetType() == types[i])
671 {
672 if (t < currentPriority)
673 {
674 currentPriority = t;
675 indexHighestPriority = i;
676 }
677
678 break;
679 }
680 }
681 }
682
684 SetHeaderPart(header, TranslateEntityType(types[indexHighestPriority]), typeCounts[indexHighestPriority], firstShown);
685 types.Remove(indexHighestPriority);
686 typeCounts.Remove(indexHighestPriority);
687 firstShown = true;
688 }
689 }
690 //If too many types selected show just "entity"
691 else
692 {
694 SetHeaderPart(header, m_sMultiEntitiesTitle, count, false);
695 }
696 }
697 //If editing only 1
698 else if (count == 1)
699 {
700 //Check if gamemode that is being edited
701 if (SCR_GameModeEditor.Cast(editedItems[0]))
702 {
703 SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
704 if (!editorManager)
705 return;
706
707 SCR_EditorModeEntity modeEntity = editorManager.GetCurrentModeEntity();
708 if (!modeEntity)
709 return;
710
711 if (modeEntity.GetModeType() == EEditorMode.ADMIN)
712 {
713 header.SetText(m_sAdminModeTitle);
714 return;
715 }
716
717 //Not admin
718 return;
719 }
720
721 //Factions only being edited
722 SCR_TaskSystem taskSystem = SCR_TaskSystem.Cast(editedItems[0]);
723 if (taskSystem)
724 {
725 header.SetText(m_sFactionOnlyTitle);
726 return;
727 }
728
729 if (m_bIsEndGame)
730 {
731 header.SetText(m_sEndGameTitle);
732 return;
733 }
734
735 //Camera attributes (Check if Armavision)
736 SCR_ManualCamera camera = SCR_ManualCamera.Cast(editedItems[0]);
737 if (camera)
738 {
739 SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
740 if (!editorManager)
741 return;
742
743 SCR_EditorModeEntity modeEntity = editorManager.GetCurrentModeEntity();
744 if (!modeEntity)
745 return;
746
747 //Is arma vision
748 if (modeEntity.GetModeType() == EEditorMode.PHOTO)
749 {
750 header.SetText(m_sPhotoModeTitle);
751 return;
752 }
753 }
754
755 //If player delegate show player name
756 SCR_EditablePlayerDelegateComponent playerDelegate = SCR_EditablePlayerDelegateComponent.Cast(editedItems[0]);
757 if (playerDelegate)
758 {
759 header.SetTextFormat("%1", m_sEditingTitlePart);
760 //SetHeaderPart(header, SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(playerDelegate.GetPlayerID()), 0, false);
761 SetHeaderPart(header, "", 0, false);
762 SetPlayerInfo(playerDelegate.GetPlayerID());
763 return;
764 }
765
766 //Single entity
767 SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(editedItems[0]);
768 if (editableEntity)
769 {
770 header.SetTextFormat("%1", m_sEditingTitlePart);
771
772 //Check if player, if true display player name
773 if (editableEntity.GetEntityType() == EEditableEntityType.CHARACTER)
774 {
775 //Check is player and set name
776 int playerID = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(editableEntity.GetOwner());
777 if (playerID > 0)
778 {
780 SetHeaderPart(header, "", 0, false);
781 SetPlayerInfo(playerID);
782
783 return;
784 }
785 }
786 //One task is being edited
787 else if (editableEntity.GetEntityType() == EEditableEntityType.TASK)
788 {
790 SetHeaderPart(header, m_sTaskTitle, 1, false);
791 return;
792 }
793 else if (editableEntity.GetEntityType() == EEditableEntityType.FACTION)
794 {
796 SetHeaderPart(header, editableEntity.GetDisplayName(), 0, false);
797 return;
798 }
800 SetHeaderPart(header, editableEntity.GetDisplayName(), 1, false);
801 }
802 }
803 }
804
805 //---- REFACTOR NOTE END ----
806
807 protected void SetPlayerInfo(int playerId){
809
810 m_PlayerNameWidget.SetText(SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(playerId));
811 contr.SetPlatformImageTo(playerId, m_PlatformImageWidget);
812
813 m_PlayerNameWidget.SetVisible(true);
814 m_PlatformImageWidget.SetVisible(true);
815 }
816
817 protected void HidePlayerInfo(){
818 m_PlayerNameWidget.SetVisible(false);
819 m_PlatformImageWidget.SetVisible(false);
820 }
821
822 protected void SetHeaderPart(RichTextWidget textWidget, string name, int count, bool showSeperator)
823 {
824 if (showSeperator)
825 textWidget.SetTextFormat("%1 -", textWidget.GetText());
826
827 textWidget.SetTextFormat("%1 %2", textWidget.GetText(), name);
828
829 if (count != 0)
830 textWidget.SetTextFormat("%2 <font name=\"%3\"><color rgba=\"226,168,79,255\">#AR-ValueUnit_Short_Times</color></font>", count.ToString(), textWidget.GetText(), m_sFontForHeaderEntityAmount);
831 }
832
834 {
835 if (type == -1)
836 {
837 return "#AR-AttributesDialog_TitlePage_Player_Text";
838 }
839 else
840 {
842 {
843 if (titleType.GetType() == type)
844 return titleType.GetTypeName();
845 }
846 }
847
848 Print(string.Format("Couldn't find type: %1 in m_aEntityTypeNames", typename.EnumToString(EEditableEntityType, type)), LogLevel.ERROR);
849 return typename.EnumToString(EEditableEntityType, type);
850 }
851
852 protected void OnInputDeviceIsGamepad(bool isGamepad)
853 {
854 //Show toggle lock button
856 }
857
858 override void HandlerDeattached(Widget w)
859 {
861 {
862 m_AttributesManager.GetOnResetAttributes().Remove(OnReset);
863 }
864
866 m_TabViewComponent.GetOnChanged().Remove(OnCurrentTabChanged);
867
868
869 InputManager inputManager = GetGame().GetInputManager();
870 if (inputManager)
871 {
872 if (m_bIsEndGame)
873 inputManager.RemoveActionListener("EditorAttributes", EActionTrigger.DOWN, OnCancelEndGame);
874 else
875 inputManager.RemoveActionListener("EditorAttributes", EActionTrigger.DOWN, ButtonClose);
876 }
877
878 if (m_bIsEndGame)
879 {
881 if (gameMode)
882 gameMode.GetOnGameModeEnd().Remove(OnCancelEndGame);
883 }
884
885 SCR_UISoundEntity.SoundEvent(m_sSfxOnCloseDialog, true);
886
887 }
888};
889
890
893{
894 [Attribute("0", UIWidgets.ComboBox, "Type", "", ParamEnumArray.FromEnum(EEditableEntityType))]
896
897 [Attribute("")]
898 protected ref SCR_UIInfo m_UiInfo;
899
901 {
902 return m_type;
903 }
904
905 string GetTypeName()
906 {
907 return m_UiInfo.GetName();
908 }
909}
910
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_BaseGameMode GetGameMode()
InputManager GetInputManager()
override EGadgetType GetType()
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
EDamageType type
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
override SCR_UIInfo GetInfo()
UI layouts Menus CleanSweep CleanSweepAreaSelection layout
SCR_RadialMenu GetMenu()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SCR_RespawnComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Widget GetWidget()
Component to execute action when the button or its shortcut is pressed.
Input management system for user interactions.
Definition Math.c:13
ref SCR_ArsenalItemTypeUIConfig m_ArsenalItemTypeConfig
LocalizedString TranslateEntityType(EEditableEntityType type)
void SetGamepadAttributeFocus(SCR_BaseEditorAttributeUIComponent attributeUI)
ref array< ref SCR_EntityAttributeTitleType > m_aEntityTypeNames
SCR_BaseEditorAttributeUIComponent m_GamepadFocusAttribute
void InitWidget(array< ResourceName > categoryConfigs, array< ref SCR_EditorAttributeCategory > categories)
void OnAttributeChanged()
Sets Reset button enabled and close to Save and Close.
SCR_AttributesManagerEditorComponent m_AttributesManager
void OnCurrentTabChanged(SCR_TabViewComponent tabView, Widget w, int tabIndex)
void SetHeaderPart(RichTextWidget textWidget, string name, int count, bool showSeperator)
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Called on attribute changed via UI return Event_OnAttributeChanged ScriptInvoker *ScriptInvoker GetOnAttributeChanged()
void SetFromVar(SCR_BaseEditorAttributeVar var)
Initialize GUI from attribute To be overridden by inherited classes param w Widget this component is attached to param attribute Editor attribute this component represents *void Init(Widget w, SCR_BaseEditorAttribute attribute)
ScriptInvoker GetOnGameModeEnd()
EEditableEntityType GetEntityType(IEntity owner=null)
SCR_EditableEntityComponent GetParentEntity()
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
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
SCR_FieldOfViewSettings Attribute
EEditorMode
Editor mode that defines overall functionality.
Definition EEditorMode.c:6
proto external PlayerController GetPlayerController()
EActionTrigger
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134