Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AttributesButtonEditorUIComponent.c
Go to the documentation of this file.
2{
3 //---- REFACTOR NOTE START: Enum could be used for better clarity
4
5 [Attribute("0", uiwidget: UIWidgets.ComboBox, "Attribute target type.", enums: { ParamEnum("Global", "0"), ParamEnum("Camera", "1"), ParamEnum("FactionsOnly", "2") })]
6 protected int m_iTarget;
7
8 //---- REFACTOR NOTE END ----
9
10 [Attribute(desc: "Config of the category that should be selected upon opening attribute window.", params: "conf class=SCR_EditorAttributeCategory")]
12
13 protected void OnButtonAction()
14 {
15 SCR_AttributesManagerEditorComponent attributesManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
16 if (!attributesManager)
17 return;
18
19 if (m_Category)
20 attributesManager.SetCurrentCategory(m_Category);
21
22 //---- REFACTOR NOTE START: Enum could be used for better clarity
23
24 switch (m_iTarget)
25 {
26 case 0:
27 attributesManager.StartEditing(GetGame().GetGameMode());
28 break;
29 case 1:
30 attributesManager.StartEditing(SCR_CameraEditorComponent.GetCameraInstance());
31 break;
32 case 2:
33 attributesManager.StartEditing(SCR_TaskSystem.GetInstance());
34 break;
35 }
36
37 //---- REFACTOR NOTE END ----
38 }
39
40 override bool IsUnique()
41 {
42 return false;
43 }
44
46 {
48 if (navButton)
49 navButton.m_OnActivated.Insert(OnButtonAction);
50 else
51 ButtonActionComponent.GetOnAction(w, true).Insert(OnButtonAction);
52 }
53};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_BaseGameMode GetGameMode()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Component to execute action when the button or its shortcut is pressed.
static SCR_ManualCamera GetCameraInstance()
SCR_FieldOfViewSettings Attribute