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_SliderBloodAttributeComponent.c
Go to the documentation of this file.
1
class
SCR_SliderBloodAttributeComponent
:
SCR_SliderEditorAttributeUIComponent
2
{
3
[
Attribute
(
"BloodUnconsciousBar"
,
desc
:
"Image that shows when Character becomes conscious"
)]
4
protected
string
m_sUnconsciousBarName
;
5
6
[
Attribute
(
"BloodUnconsciousBarTop"
,
desc
:
"Set at the end of the bar"
)]
7
protected
string
m_sUnconsciousBarTopName
;
8
9
[
Attribute
(
"BloodUnconsciousFillRight"
,
desc
:
"Filler make sure the bar is set the correct size"
)]
10
protected
string
m_sUnconsciousFillerRightName
;
11
12
[
Attribute
(
"1"
,
desc
:
"Size of the BarTop"
)]
13
protected
float
m_iUnconsciousBarTopSize
;
14
15
protected
float
m_fUnconsciousLevel
;
16
17
protected
Widget
m_UnconsciousBar
;
18
protected
Widget
m_UnconsciousBarTop
;
19
protected
Widget
m_UnconsciousFillerRight
;
20
21
override
void
Init
(
Widget
w,
SCR_BaseEditorAttribute
attribute)
22
{
23
m_UnconsciousBar
= w.FindAnyWidget(
m_sUnconsciousBarName
);
24
m_UnconsciousBarTop
= w.FindAnyWidget(
m_sUnconsciousBarTopName
);
25
m_UnconsciousFillerRight
= w.FindAnyWidget(
m_sUnconsciousFillerRightName
);
26
27
LayoutSlot
.SetFillWeight(
m_UnconsciousBarTop
,
m_iUnconsciousBarTopSize
);
28
29
if
(!
m_UnconsciousBar
|| !
m_UnconsciousFillerRight
|| !
m_UnconsciousBarTop
)
30
return
;
31
32
SCR_BaseEditorAttributeVar
var = attribute.
GetVariableOrCopy
();
33
if
(!var)
34
return
;
35
36
vector
bloodData = var.
GetVector
();
37
38
m_fUnconsciousLevel
= bloodData[1] * 100;
39
40
super.Init(w, attribute);
41
}
42
47
float
GetUnconsciousLevel
()
48
{
49
return
m_fUnconsciousLevel
;
50
}
51
52
override
void
SetSliderSettings
(
SCR_BaseEditorAttributeVar
var,
SCR_BaseEditorAttributeEntrySlider
sliderData)
53
{
54
super.SetSliderSettings(var, sliderData);
55
UpdateBloodSlider
();
56
}
57
58
//Sets a default state for the UI and var value if conflicting attribute
59
override
void
SetVariableToDefaultValue
(
SCR_BaseEditorAttributeVar
var)
60
{
61
super.SetVariableToDefaultValue(var);
62
UpdateBloodSlider
();
63
}
64
65
override
void
SetFromVar
(
SCR_BaseEditorAttributeVar
var)
66
{
67
super.SetFromVar(var);
68
UpdateBloodSlider
();
69
}
70
71
override
bool
OnChangeInternal
(
Widget
w,
int
x,
int
y,
bool
finished)
72
{
73
super.OnChangeInternal(w, x, y, finished);
74
UpdateBloodSlider
();
75
return
false
;
76
}
77
78
protected
void
UpdateBloodSlider
()
79
{
80
float
value =
m_SliderWidgetComponent
.GetValue();
81
82
if
(value >=
m_fUnconsciousLevel
)
83
{
84
m_UnconsciousBarTop
.SetVisible(
true
);
85
LayoutSlot
.SetFillWeight(
m_UnconsciousBar
,
Math
.Clamp(
m_fUnconsciousLevel
-
m_iUnconsciousBarTopSize
, 0, 100));
86
LayoutSlot
.SetFillWeight(
m_UnconsciousFillerRight
,
Math
.Clamp(100 -
m_fUnconsciousLevel
, 0, 100));
87
}
88
else
89
{
90
if
(value >=
m_iUnconsciousBarTopSize
)
91
{
92
m_UnconsciousBarTop
.SetVisible(
true
);
93
LayoutSlot
.SetFillWeight(
m_UnconsciousBar
,
Math
.Clamp(value -
m_iUnconsciousBarTopSize
, 0 , 100));
94
LayoutSlot
.SetFillWeight(
m_UnconsciousFillerRight
,
Math
.Clamp(100 - value, 0, 100));
95
}
96
else
97
{
98
m_UnconsciousBarTop
.SetVisible(
false
);
99
LayoutSlot
.SetFillWeight(
m_UnconsciousBar
,
Math
.Clamp(value, 0 , 100));
100
LayoutSlot
.SetFillWeight(
m_UnconsciousFillerRight
,
Math
.Clamp(100 - value, 0, 100));
101
}
102
}
103
}
104
};
SCR_BaseEditorAttributeEntrySlider
void SCR_BaseEditorAttributeEntrySlider(SCR_EditorAttributeBaseValues sliderValues)
Definition
SCR_BaseEditorAttribute.c:589
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
LayoutSlot
Definition
LayoutSlot.c:13
Math
Definition
Math.c:13
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_BaseEditorAttribute::GetVariableOrCopy
sealed SCR_BaseEditorAttributeVar GetVariableOrCopy()
Definition
SCR_BaseEditorAttribute.c:326
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::GetVector
vector GetVector()
Definition
SCR_BaseEditorAttributeVar.c:74
SCR_SliderBloodAttributeComponent
Definition
SCR_SliderBloodAttributeComponent.c:2
SCR_SliderBloodAttributeComponent::GetUnconsciousLevel
float GetUnconsciousLevel()
Definition
SCR_SliderBloodAttributeComponent.c:47
SCR_SliderBloodAttributeComponent::m_UnconsciousBarTop
Widget m_UnconsciousBarTop
Definition
SCR_SliderBloodAttributeComponent.c:18
SCR_SliderBloodAttributeComponent::m_UnconsciousBar
Widget m_UnconsciousBar
Definition
SCR_SliderBloodAttributeComponent.c:17
SCR_SliderBloodAttributeComponent::m_fUnconsciousLevel
float m_fUnconsciousLevel
Definition
SCR_SliderBloodAttributeComponent.c:15
SCR_SliderBloodAttributeComponent::UpdateBloodSlider
void UpdateBloodSlider()
Definition
SCR_SliderBloodAttributeComponent.c:78
SCR_SliderBloodAttributeComponent::m_sUnconsciousBarName
string m_sUnconsciousBarName
Definition
SCR_SliderBloodAttributeComponent.c:4
SCR_SliderBloodAttributeComponent::SetFromVar
override void SetFromVar(SCR_BaseEditorAttributeVar var)
Definition
SCR_SliderBloodAttributeComponent.c:65
SCR_SliderBloodAttributeComponent::Init
override void Init(Widget w, SCR_BaseEditorAttribute attribute)
Definition
SCR_SliderBloodAttributeComponent.c:21
SCR_SliderBloodAttributeComponent::m_sUnconsciousFillerRightName
string m_sUnconsciousFillerRightName
Definition
SCR_SliderBloodAttributeComponent.c:10
SCR_SliderBloodAttributeComponent::m_iUnconsciousBarTopSize
float m_iUnconsciousBarTopSize
Definition
SCR_SliderBloodAttributeComponent.c:13
SCR_SliderBloodAttributeComponent::m_UnconsciousFillerRight
Widget m_UnconsciousFillerRight
Definition
SCR_SliderBloodAttributeComponent.c:19
SCR_SliderBloodAttributeComponent::SetVariableToDefaultValue
override void SetVariableToDefaultValue(SCR_BaseEditorAttributeVar var)
Definition
SCR_SliderBloodAttributeComponent.c:59
SCR_SliderBloodAttributeComponent::SetSliderSettings
override void SetSliderSettings(SCR_BaseEditorAttributeVar var, SCR_BaseEditorAttributeEntrySlider sliderData)
Definition
SCR_SliderBloodAttributeComponent.c:52
SCR_SliderBloodAttributeComponent::m_sUnconsciousBarTopName
string m_sUnconsciousBarTopName
Definition
SCR_SliderBloodAttributeComponent.c:7
SCR_SliderBloodAttributeComponent::OnChangeInternal
override bool OnChangeInternal(Widget w, int x, int y, bool finished)
Definition
SCR_SliderBloodAttributeComponent.c:71
SCR_SliderEditorAttributeUIComponent
Definition
SCR_SliderEditorAttributeUIComponent.c:4
SCR_SliderEditorAttributeUIComponent::m_SliderWidgetComponent
SCR_SliderComponent m_SliderWidgetComponent
Definition
SCR_SliderEditorAttributeUIComponent.c:5
Widget
Definition
Widget.c:13
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Editor
UI
Components
Attributes
SCR_SliderBloodAttributeComponent.c
Generated by
1.17.0