Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_ContentDetailsPanelBase.c
Go to the documentation of this file.
1
class
SCR_ContentDetailsPanelBase
:
SCR_ScriptedWidgetComponent
2
{
3
protected
ref
SCR_ContentDetailsPanelBaseWidgets
m_CommonWidgets
=
new
SCR_ContentDetailsPanelBaseWidgets
;
4
5
[
Attribute
()]
6
protected
ref DetailsPanelContentPresetConfig
m_FallbackContent
;
7
8
[
Attribute
(
"500"
)]
9
protected
int
m_iMaxDescriptionLenght
;
10
11
[
Attribute
(
"0"
)]
12
protected
bool
m_bDisplayAdditionalInfo
;
13
14
[
Attribute
(
"{8D067F8167DB936D}UI/layouts/Menus/Common/DetailsPanel/Prefabs/AddonTypeImage.layout"
)]
15
protected
ResourceName
m_sTypeDisplayLayout
;
16
17
[
Attribute
(
"12"
)]
18
protected
int
m_iMaxTypeImages
;
19
20
protected
const
int
DESCRIPTION_LENGHT_OFFSET
= 10;
21
22
protected
SCR_SimpleWarningOverlayComponent
m_WarningOverlay
;
23
protected
ref array<Widget>
m_aTypeImages
= {};
24
25
//------------------------------------------------------------------------------------------------
26
override
void
HandlerAttached
(
Widget
w)
27
{
28
super.HandlerAttached(w);
29
m_CommonWidgets
.Init(w.FindWidget(
"ContentDetailsPanel"
));
// The layout is exported from base layout which is embedded into this layout.
30
31
m_CommonWidgets
.m_WarningOverlayComponent.SetWarningVisible(
false
,
false
);
32
m_CommonWidgets
.m_wAdditionalInfo.SetVisible(
m_bDisplayAdditionalInfo
);
33
}
34
35
//------------------------------------------------------------------------------------------------
36
override
bool
OnUpdate
(
Widget
w)
37
{
38
if
(
SCR_Global
.
IsEditMode
())
39
return
super.OnUpdate(w);
40
41
// This will also get called on updates of children, ignore them
42
if
(w !=
m_wRoot
)
43
return
false
;
44
45
GetGame
().GetCallqueue().Call(
UpdateSize
);
46
47
return
super.OnUpdate(w);
48
}
49
50
//------------------------------------------------------------------------------------------------
51
protected
void
UpdateSize
()
52
{
53
// Resize the height of the picture, it must keep a fixed aspect ratio
54
float
sizex, sizey;
55
m_wRoot
.GetScreenSize(sizex, sizey);
56
float
sizexUnscaled =
GetGame
().GetWorkspace().DPIUnscale(sizex);
57
m_CommonWidgets
.m_wTopSize.EnableHeightOverride(
true
);
58
m_CommonWidgets
.m_wTopSize.SetHeightOverride(sizexUnscaled /
SCR_WorkshopUiCommon
.IMAGE_SIZE_RATIO);
59
}
60
61
//-----------------------------------------------------------------------------------
63
protected
DetailsPanelContentPreset
FallbackContentByTag
(
string
contentTag)
64
{
65
foreach
(
DetailsPanelContentPreset
content
:
m_FallbackContent
.m_aContent)
66
{
67
if
(
content
.m_sTag == contentTag)
68
return
content
;
69
}
70
71
return
m_FallbackContent
.m_DefaultContent;
72
}
73
74
//-----------------------------------------------------------------------------------
76
protected
void
SetDescriptionText
(
string
text)
77
{
78
// Edit text if it's too long
79
if
(text.Length() >
m_iMaxDescriptionLenght
+
DESCRIPTION_LENGHT_OFFSET
)
80
{
81
text = text.Substring(0,
m_iMaxDescriptionLenght
);
82
text +=
"..."
;
83
}
84
85
m_CommonWidgets
.m_wDescriptionText.SetText(text);
86
}
87
88
//-----------------------------------------------------------------------------------
89
protected
Widget
AddTypeDisplay
(
string
image,
ResourceName
imageset,
ResourceName
glowImageset)
90
{
91
if
(
m_aTypeImages
.Count() >=
m_iMaxTypeImages
)
92
return
null;
93
94
Widget
w =
GetGame
().GetWorkspace().CreateWidgets(
m_sTypeDisplayLayout
,
m_CommonWidgets
.m_wTypeImages);
95
if
(!w)
96
return
null;
97
98
m_aTypeImages
.Insert(w);
99
100
SCR_DynamicIconComponent
comp =
SCR_DynamicIconComponent
.Cast(w.FindHandler(
SCR_DynamicIconComponent
));
101
if
(comp)
102
comp.SetImage(image, imageset, glowImageset);
103
104
return
w;
105
}
106
107
//-----------------------------------------------------------------------------------
108
protected
void
ClearTypeDisplays
()
109
{
110
foreach
(
Widget
w :
m_aTypeImages
)
111
{
112
w.RemoveFromHierarchy();
113
}
114
115
m_aTypeImages
.Clear();
116
}
117
}
118
119
//-----------------------------------------------------------------------------------
120
[
BaseContainerProps
(configRoot :
true
)]
121
class
DetailsPanelContentPresetConfig
122
{
123
[
Attribute
()]
124
ref
DetailsPanelContentPreset
m_DefaultContent;
125
126
[
Attribute
()]
127
ref array<ref DetailsPanelContentPreset> m_aContent;
128
}
129
130
//-----------------------------------------------------------------------------------
131
[
BaseContainerProps
(),
BaseContainerCustomTitleField
(
"m_sTag"
)]
132
class
DetailsPanelContentPreset
133
{
134
[
Attribute
()]
135
string
m_sTag
;
136
137
[
Attribute
(
""
,
UIWidgets
.ResourceNamePicker,
"Layout"
,
"edds"
)]
138
ResourceName
m_sImage;
139
140
[
Attribute
()]
141
string
m_sTitle;
142
143
[
Attribute
()]
144
string
m_sTitleImageName;
145
146
[
Attribute
(
UIColors
.GetColorAttribute(
UIColors
.NEUTRAL_INFORMATION))]
147
ref
Color
m_sTitleImageColor;
148
149
[
Attribute
()]
150
string
m_sDescription
;
151
}
content
class RestAPIHelper< JsonApiStruct T > content
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
m_sTag
string m_sTag
Definition
SCR_AvailableActionsDisplay.c:13
m_sDescription
string m_sDescription
Definition
SCR_FlashlightComponent.c:16
BaseContainerCustomTitleField
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition
SCR_KeyBindingMenuConfig.c:116
Color
Definition
Color.c:13
DetailsPanelContentPreset
Definition
SCR_ContentDetailsPanelBase.c:133
ResourceName
Definition
ResourceName.c:13
SCR_ContentDetailsPanelBase
Definition
SCR_ContentDetailsPanelBase.c:2
SCR_ContentDetailsPanelBase::m_CommonWidgets
ref SCR_ContentDetailsPanelBaseWidgets m_CommonWidgets
Definition
SCR_ContentDetailsPanelBase.c:3
SCR_ContentDetailsPanelBase::m_iMaxDescriptionLenght
int m_iMaxDescriptionLenght
Definition
SCR_ContentDetailsPanelBase.c:9
SCR_ContentDetailsPanelBase::DESCRIPTION_LENGHT_OFFSET
const int DESCRIPTION_LENGHT_OFFSET
Definition
SCR_ContentDetailsPanelBase.c:20
SCR_ContentDetailsPanelBase::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_ContentDetailsPanelBase.c:26
SCR_ContentDetailsPanelBase::m_bDisplayAdditionalInfo
bool m_bDisplayAdditionalInfo
Definition
SCR_ContentDetailsPanelBase.c:12
SCR_ContentDetailsPanelBase::UpdateSize
void UpdateSize()
Definition
SCR_ContentDetailsPanelBase.c:51
SCR_ContentDetailsPanelBase::m_WarningOverlay
SCR_SimpleWarningOverlayComponent m_WarningOverlay
Definition
SCR_ContentDetailsPanelBase.c:22
SCR_ContentDetailsPanelBase::OnUpdate
override bool OnUpdate(Widget w)
Definition
SCR_ContentDetailsPanelBase.c:36
SCR_ContentDetailsPanelBase::m_aTypeImages
ref array< Widget > m_aTypeImages
Definition
SCR_ContentDetailsPanelBase.c:23
SCR_ContentDetailsPanelBase::m_iMaxTypeImages
int m_iMaxTypeImages
Definition
SCR_ContentDetailsPanelBase.c:18
SCR_ContentDetailsPanelBase::SetDescriptionText
void SetDescriptionText(string text)
Set description text with enforced text lenght limit.
Definition
SCR_ContentDetailsPanelBase.c:76
SCR_ContentDetailsPanelBase::FallbackContentByTag
DetailsPanelContentPreset FallbackContentByTag(string contentTag)
Get fallback content by tag.
Definition
SCR_ContentDetailsPanelBase.c:63
SCR_ContentDetailsPanelBase::m_FallbackContent
ref DetailsPanelContentPresetConfig m_FallbackContent
Definition
SCR_ContentDetailsPanelBase.c:6
SCR_ContentDetailsPanelBase::m_sTypeDisplayLayout
ResourceName m_sTypeDisplayLayout
Definition
SCR_ContentDetailsPanelBase.c:15
SCR_ContentDetailsPanelBase::AddTypeDisplay
Widget AddTypeDisplay(string image, ResourceName imageset, ResourceName glowImageset)
Definition
SCR_ContentDetailsPanelBase.c:89
SCR_ContentDetailsPanelBase::ClearTypeDisplays
void ClearTypeDisplays()
Definition
SCR_ContentDetailsPanelBase.c:108
SCR_ContentDetailsPanelBaseWidgets
Definition
SCR_ContentDetailsPanelBaseWidgets.c:4
SCR_DynamicIconComponent
Definition
SCR_DynamicIconComponent.c:6
SCR_Global
Definition
Functions.c:7
SCR_Global::IsEditMode
static bool IsEditMode()
Definition
Functions.c:1566
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_SimpleWarningOverlayComponent
Definition
SCR_SimpleWarningOverlayComponent.c:7
SCR_WorkshopUiCommon
Definition
SCR_WorkshopUiCommon.c:6
UIColors
Definition
Constants.c:17
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Menu
Common
SCR_ContentDetailsPanelBase.c
Generated by
1.17.0