Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
EditorAttributesDialogUI.c
Go to the documentation of this file.
1
3
class
EditorAttributesDialogUI
:
EditorMenuBase
4
{
5
private
SCR_AttributesManagerEditorComponent m_AttributesManager;
6
private
ref array<ResourceName> m_CategoryConfigs;
7
private
ref array<ref SCR_EditorAttributeCategory> m_Categories;
8
9
protected
void
InitCategories
()
10
{
11
array<SCR_BaseEditorAttribute> attributes =
new
array<SCR_BaseEditorAttribute>;
12
m_AttributesManager.GetEditedAttributes(attributes);
13
14
m_CategoryConfigs =
new
array<ResourceName>;
15
m_Categories =
new
array<ref SCR_EditorAttributeCategory>;
16
array<int> priorities =
new
array<int>;
17
18
//--- Get categories from all attributes
19
foreach
(
SCR_BaseEditorAttribute
attribute: attributes)
20
{
21
ResourceName
categoryConfig = attribute.GetCategoryConfig();
22
if
(m_CategoryConfigs.Find(categoryConfig) == -1)
23
{
24
//--- Get category container
25
Resource
categoryContainer =
BaseContainerTools
.LoadContainer(categoryConfig);
26
if
(!categoryContainer)
27
{
28
Print
(
string
.Format(
"Error loading category '%1'!"
, categoryConfig),
LogLevel
.ERROR);
29
continue
;
30
}
31
32
SCR_EditorAttributeCategory
category
=
SCR_EditorAttributeCategory
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(categoryContainer.GetResource().ToBaseContainer()));
33
if
(!
category
)
34
{
35
Print
(
string
.Format(
"SCR_EditorAttributeCategory not found in %1!"
, categoryConfig),
LogLevel
.ERROR);
36
continue
;
37
}
38
39
//--- Add to the array sorted by priority
40
int
priority =
category
.GetPriority();
41
int
index
= 0;
42
int
count = m_CategoryConfigs.Count();
43
bool
breakCalled =
false
;
44
45
for
(
int
c = 0; c < count; c++)
46
{
47
if
(priority > priorities[c])
48
{
49
index
= c;
50
breakCalled =
true
;
51
break
;
52
}
53
}
54
55
if
(breakCalled)
56
{
57
m_CategoryConfigs.InsertAt(categoryConfig,
index
);
58
m_Categories.InsertAt(
category
,
index
);
59
priorities.InsertAt(
category
.GetPriority(),
index
);
60
}
61
else
{
62
m_CategoryConfigs.Insert(categoryConfig);
63
m_Categories.Insert(
category
);
64
priorities.Insert(
category
.GetPriority());
65
}
66
}
67
}
68
}
69
70
void
RemoveAutoClose
()
71
{
72
if
(m_AttributesManager)
73
{
74
m_AttributesManager.GetOnAttributesConfirm().Remove(CloseSelf);
75
m_AttributesManager.GetOnAttributesCancel().Remove(CloseSelf);
76
}
77
}
78
79
override
void
OnMenuOpen
()
80
{
81
m_AttributesManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent,
true
));
82
if
(!m_AttributesManager)
83
return
;
84
85
m_AttributesManager.GetOnAttributesConfirm().Insert(CloseSelf);
86
m_AttributesManager.GetOnAttributesCancel().Insert(CloseSelf);
87
88
InitCategories
();
89
SCR_AttributesEditorUIComponent
attributesUI =
SCR_AttributesEditorUIComponent
.Cast(
GetRootWidget
().FindHandler(
SCR_AttributesEditorUIComponent
));
90
if
(attributesUI)
91
{
92
attributesUI.
InitWidget
(m_CategoryConfigs, m_Categories);
93
}
94
}
95
96
override
void
OnMenuClose
()
97
{
98
RemoveAutoClose
();
99
}
100
};
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
GetRootWidget
Widget GetRootWidget()
Definition
SCR_ModularButtonComponent.c:189
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
BaseContainerTools
Definition
BaseContainerTools.c:13
EditorAttributesDialogUI
Definition
EditorAttributesDialogUI.c:4
EditorAttributesDialogUI::InitCategories
void InitCategories()
Definition
EditorAttributesDialogUI.c:9
EditorAttributesDialogUI::RemoveAutoClose
void RemoveAutoClose()
Definition
EditorAttributesDialogUI.c:70
EditorAttributesDialogUI::OnMenuOpen
override void OnMenuOpen()
Definition
EditorAttributesDialogUI.c:79
EditorAttributesDialogUI::OnMenuClose
override void OnMenuClose()
Definition
EditorAttributesDialogUI.c:96
EditorMenuBase
Definition
EditorMenuBase.c:8
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_AttributesEditorUIComponent
Definition
SCR_AttributesEditorUIComponent.c:4
SCR_AttributesEditorUIComponent::InitWidget
void InitWidget(array< ResourceName > categoryConfigs, array< ref SCR_EditorAttributeCategory > categories)
Definition
SCR_AttributesEditorUIComponent.c:335
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition
SCR_BaseEditorAttribute.c:4
SCR_EditorAttributeCategory
Definition
SCR_EditorAttributeCategory.c:9
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
scripts
Game
Editor
UI
Menus
EditorAttributesDialogUI.c
Generated by
1.17.0