Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
huddebugwincharlevels.c
Go to the documentation of this file.
1
class
HudDebugWinCharLevels
extends
HudDebugWinBase
2
{
3
TextListboxWidget
m_WgtValues
;
4
5
//============================================
6
// Constructor
7
//============================================
8
void
HudDebugWinCharLevels
(
Widget
widget_root)
9
{
10
m_WgtValues
= TextListboxWidget.Cast( widget_root.FindAnyWidget(
"txl_CharLevels_Values"
) );
11
12
FitWindow
();
13
}
14
15
//============================================
16
// Destructor
17
//============================================
18
void
~HudDebugWinCharLevels
()
19
{
20
SetUpdate
(
false
);
21
}
22
23
24
//============================================
25
// GetWinType
26
//============================================
27
override
int
GetType
()
28
{
29
return
HudDebug
.HUD_WIN_CHAR_LEVELS;
30
}
31
32
//============================================
33
// Show
34
//============================================
35
override
void
Show
()
36
{
37
super.Show();
38
39
//Print("Show()");
40
41
SetUpdate
(
true
);
42
}
43
44
//============================================
45
// Hide
46
//============================================
47
override
void
Hide
()
48
{
49
super.Hide();
50
51
//Print("Hide()");
52
53
SetUpdate
(
false
);
54
}
55
56
//============================================
57
// SetUpdate
58
//============================================
59
override
void
SetUpdate
(
bool
state )
60
{
61
//Disable update on server (PluginDeveloperSync)
62
PlayerBase
player =
PlayerBase
.Cast(
g_Game
.GetPlayer() );
63
64
PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin
( PluginDeveloperSync ) );
65
66
//if client, send RPC
67
if
(
g_Game
.IsClient() )
68
{
69
ref Param1<bool> params =
new
Param1<bool>( state );
70
if
( player )
71
{
72
player.RPCSingleParam(
ERPCs
.DEV_LEVELS_UPDATE, params,
true
);
73
SetRPCSent
();
74
}
75
}
76
//else set directly
77
else
78
{
79
if
( developer_sync )
80
{
81
developer_sync.EnableUpdate( state,
ERPCs
.DEV_LEVELS_UPDATE, player );
82
}
83
}
84
}
85
86
87
override
void
Update
()
88
{
89
super.Update();
90
91
//Print("Update()");
92
93
//refresh notifiers
94
SetValues
();
95
}
96
97
void
SetValues
()
98
{
99
PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin
( PluginDeveloperSync ) );
100
101
//clear window
102
ClearValues
();
103
104
if
( developer_sync.m_PlayerLevelsSynced.Count() > 0 )
105
{
106
//set
107
for
(
int
i = 0; i < developer_sync.m_PlayerLevelsSynced.Count(); i++ )
108
{
109
string
bar = MiscGameplayFunctions.ValueToBar(developer_sync.m_PlayerLevelsSynced.Get( i ).GetValue2());
110
AddValue
( developer_sync.m_PlayerLevelsSynced.Get( i ).GetName(), developer_sync.m_PlayerLevelsSynced.Get( i ).GetValue().ToString() ,bar );
111
}
112
}
113
114
//fit to screen
115
FitWindow
();
116
}
117
118
void
AddValue
(
string
title,
string
value,
string
value2 )
119
{
120
int
index =
m_WgtValues
.AddItem( title, NULL, 0 );
121
m_WgtValues
.SetItem( index, value, NULL, 1 );
122
m_WgtValues
.SetItem( index, value2, NULL, 2 );
123
}
124
125
void
ClearValues
()
126
{
127
m_WgtValues
.ClearItems();
128
}
129
130
void
FitWindow
()
131
{
132
//FitWindowByContent( m_WgtValues );
133
}
134
}
HudDebugWinBase
Definition
huddebugwinbase.c:2
HudDebugWinBase::Hide
override void Hide()
Definition
huddebugwincharlevels.c:47
HudDebugWinBase::SetUpdate
override void SetUpdate(bool state)
Definition
huddebugwincharlevels.c:59
HudDebugWinBase::SetRPCSent
void SetRPCSent()
Definition
huddebugwinbase.c:39
HudDebugWinBase::FitWindow
void FitWindow()
Definition
huddebugwincharlevels.c:130
HudDebugWinBase::m_WgtValues
TextListboxWidget m_WgtValues
Definition
huddebugwincharlevels.c:3
HudDebugWinBase::AddValue
void AddValue(string title, string value, string value2)
Definition
huddebugwincharlevels.c:118
HudDebugWinBase::Update
override void Update()
Definition
huddebugwincharlevels.c:87
HudDebugWinBase::GetType
override int GetType()
Definition
huddebugwincharlevels.c:27
HudDebugWinBase::SetUpdate
void SetUpdate(bool state)
HudDebugWinBase::SetValues
void SetValues()
Definition
huddebugwincharlevels.c:97
HudDebugWinBase::HudDebugWinCharLevels
void HudDebugWinCharLevels(Widget widget_root)
Definition
huddebugwincharlevels.c:8
HudDebugWinBase::~HudDebugWinCharLevels
void ~HudDebugWinCharLevels()
Definition
huddebugwincharlevels.c:18
HudDebugWinBase::ClearValues
void ClearValues()
Definition
huddebugwincharlevels.c:125
HudDebugWinBase::Show
override void Show()
Definition
huddebugwincharlevels.c:35
PlayerBase
Definition
playerbaseclient.c:2
Widget
Definition
enwidgets.c:190
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
ERPCs
ERPCs
Definition
erpcs.c:2
HudDebug
void HudDebug()
Definition
huddebug.c:108
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition
pluginmanager.c:325
Games
Dayz
scripts
5_mission
gui
scriptshuddebug
huddebugwincharlevels.c
Generated by
1.17.0