DayZ
1.24
Loading...
Searching...
No Matches
Header.c
Go to the documentation of this file.
1
class
Header
:
LayoutHolder
2
{
3
protected
int
m_DefaultColor
;
4
protected
int
m_DefaultFontSize
;
5
6
protected
EntityAI
m_Entity
;
7
8
protected
Widget
m_CollapseButton
;
9
protected
Widget
m_UpArrowButton
;
10
protected
Widget
m_DownArrowButton
;
11
protected
TextWidget
m_HeaderText
;
12
13
void
Header
(
LayoutHolder
parent,
string
function_name
)
14
{
15
m_CollapseButton
= GetMainWidget().FindAnyWidget(
"collapse_button"
);
16
m_UpArrowButton
= GetMainWidget().FindAnyWidget(
"opened"
);
17
m_DownArrowButton
= GetMainWidget().FindAnyWidget(
"closed"
);
18
19
#ifdef PLATFORM_CONSOLE
20
m_CollapseButton
.Show(
false
);
21
#else
22
WidgetEventHandler
.
GetInstance
().RegisterOnMouseButtonDown(
m_CollapseButton
,
m_Parent
,
function_name
);
23
WidgetEventHandler
.
GetInstance
().RegisterOnDropReceived(
m_CollapseButton
,
m_Parent
,
"OnDropReceivedFromHeader"
);
24
#endif
25
WidgetEventHandler
.
GetInstance
().RegisterOnDropReceived(GetMainWidget(),
m_Parent
,
"OnDropReceivedFromHeader"
);
26
WidgetEventHandler
.
GetInstance
().RegisterOnDraggingOver(GetMainWidget(),
this
,
"DraggingOverHeader"
);
27
28
m_HeaderText
=
TextWidget
.Cast(GetMainWidget().
FindAnyWidget
(
"TextWidget0"
));
29
30
m_DefaultColor
= GetRootWidget().GetColor();
31
}
32
33
void
SetName
(
string
name
)
34
{
35
name
.ToUpper();
36
m_HeaderText
.SetText(
name
);
37
}
38
39
void
SetItemPreview
(
EntityAI
entity_ai
)
40
{
41
#ifndef PLATFORM_CONSOLE
42
m_Entity
=
entity_ai
;
43
ItemPreviewWidget
item_preview
=
ItemPreviewWidget
.Cast(GetMainWidget().
FindAnyWidget
(
"Render"
));
44
item_preview
.SetItem(
entity_ai
);
45
item_preview
.SetView(
entity_ai
.GetViewIndex());
46
#endif
47
}
48
49
void
DraggingOverHeader
(
Widget
w
,
int
x
,
int
y
,
Widget
receiver
)
50
{
51
if
(
w
==
null
)
52
return
;
53
54
Container
parent_container
=
Container
.Cast(
m_Parent
);
55
parent_container
.DraggingOverHeader(
w
,
x
,
y
,
receiver
);
56
}
57
58
void
OnDropReceivedFromHeader
(
Widget
w
,
int
x
,
int
y
,
Widget
receiver
)
59
{
60
Container
parent_container
=
Container
.Cast(
m_Parent
);
61
parent_container
.OnDropReceivedFromHeader(
w
,
x
,
y
,
receiver
);
62
}
63
64
override
void
SetActive
(
bool
active
)
65
{
66
super
.SetActive(
active
);
67
68
if
(
active
)
69
GetMainWidget().SetColor(
ARGBF
(1, 1, 0, 0));
70
else
71
GetMainWidget().SetColor(
m_DefaultColor
);
72
}
73
74
void
ShowCollapseButton
(
bool
state
)
75
{
76
m_CollapseButton
.Show(
state
);
77
}
78
}
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
x
Icon x
y
Icon y
m_Parent
Widget m_Parent
Definition
SizeToChild.c:86
Container
Definition
CargoContainer.c:3
EntityAI
Definition
Building.c:6
Header
Definition
Header.c:2
Header::OnDropReceivedFromHeader
void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
Definition
Header.c:58
Header::m_Entity
EntityAI m_Entity
Definition
Header.c:6
Header::DraggingOverHeader
void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
Definition
Header.c:49
Header::m_DefaultFontSize
int m_DefaultFontSize
Definition
Header.c:4
Header::m_DownArrowButton
Widget m_DownArrowButton
Definition
Header.c:10
Header::ShowCollapseButton
void ShowCollapseButton(bool state)
Definition
Header.c:74
Header::SetItemPreview
void SetItemPreview(EntityAI entity_ai)
Definition
Header.c:39
Header::SetName
void SetName(string name)
Definition
Header.c:33
Header::SetActive
override void SetActive(bool active)
Definition
Header.c:64
Header::m_DefaultColor
int m_DefaultColor
Definition
Header.c:3
Header::m_CollapseButton
Widget m_CollapseButton
Definition
Header.c:8
Header::m_UpArrowButton
Widget m_UpArrowButton
Definition
Header.c:9
Header::m_HeaderText
TextWidget m_HeaderText
Definition
Header.c:11
Header::Header
void Header(LayoutHolder parent, string function_name)
Definition
Header.c:13
ItemPreviewWidget
Definition
gameplay.c:274
LayoutHolder
Definition
Container.c:2
Param3
Definition
EntityAI.c:95
TextWidget
Definition
EnWidgets.c:220
WidgetEventHandler
Definition
WidgetEventHandler.c:2
WidgetEventHandler::GetInstance
static WidgetEventHandler GetInstance()
Definition
WidgetEventHandler.c:22
Widget
Definition
EnWidgets.c:190
FindAnyWidget
proto native Widget FindAnyWidget(string pathname)
ARGBF
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition
proto.c:332
scripts
5_Mission
GUI
InventoryNew
ContainedItems
Headers
Header.c
Generated by
1.10.0