DayZ 1.24
Loading...
Searching...
No Matches
HudDebugWinBase Class Reference
Collaboration diagram for HudDebugWinBase:
[legend]

Protected Member Functions

void HudDebugWinBase (Widget widget_root)
 
int GetType ()
 
void Init (Widget widget_root)
 
void SetUpdate (bool state)
 
void Update ()
 
void SetRPCSent ()
 
void Show ()
 
void Hide ()
 
bool IsVisible ()
 
void FitWindowByContent (TextListboxWidget wgt)
 
void SetValueListSize (int x, int y, TextListboxWidget wgt)
 
void HudDebugWinTemperature (Widget widget_root)
 
void ~HudDebugWinTemperature ()
 
override void SetUpdate (bool state)
 
override void Show ()
 
override void Hide ()
 
override void Update ()
 
override int GetType ()
 

Protected Attributes

bool m_Show
 
bool m_RPCSent
 
PluginDeveloperSync m_PluginDeveloperSync
 

Private Member Functions

void HudDebugWinCharDebug (Widget widget_root)
 
void ~HudDebugWinCharDebug ()
 
override void Update ()
 
override int GetType ()
 
void HudDebugWinCharLevels (Widget widget_root)
 
void ~HudDebugWinCharLevels ()
 
override int GetType ()
 
override void Show ()
 
override void Hide ()
 
override void SetUpdate (bool state)
 
override void Update ()
 
void SetValues ()
 
void AddValue (string title, string value, string value2)
 
void ClearValues ()
 
void FitWindow ()
 
void HudDebugWinCharStats (Widget widget_root)
 
void ~HudDebugWinCharStats ()
 
override int GetType ()
 
override void Show ()
 
override void Hide ()
 
override void SetUpdate (bool state)
 
override void Update ()
 
void SetupValues ()
 
void UpdateValues ()
 
void AddValue (string title, string value)
 
void ClearValues ()
 
void FitWindow ()
 
bool OnClick (Widget w, int x, int y, int button)
 
bool OnChange (Widget w, int x, int y, bool finished)
 
void ResetStats ()
 
void RPCChangeStat (string stat, float value)
 
void HudDebugWinCharStomach (Widget widget_root)
 
void ~HudDebugWinCharStomach ()
 
override int GetType ()
 
override void Show ()
 
override void Hide ()
 
override void SetUpdate (bool state)
 
override void Update ()
 
void SetContentValues ()
 
void AddValue (string classname, int food_stage, int agents, float amount)
 
array< stringGetAgentsArray (int agents)
 
void ClearValues ()
 
void FitWindow ()
 
void HudDebugWinVersion (Widget widget_root)
 
void ~HudDebugWinVersion ()
 
override void Update ()
 
override int GetType ()
 

Private Attributes

Widget m_WgtRoot
 
PluginDeveloper m_ModuleDeveloper
 
TextWidget m_PlayerPosTextWidget
 
TextWidget m_ClipboardTextWidget
 
TextListboxWidget m_WgtValues
 
Widget m_WgtPanel
 
ref array< ref Widgetm_StatWidgets = new array<ref Widget>
 
ref map< ref SliderWidget, stringm_SliderWidgets = new map<ref SliderWidget, string>
 
ref array< ref TextWidgetm_StatValues = new array<ref TextWidget>
 
ref map< ref EditBoxWidget, stringm_StatValuesInput = new map<ref EditBoxWidget, string>
 
bool m_Populated
 
bool m_ChangingSlider
 
TextWidget m_WgtOverall
 
TextWidget m_EnviroTextWidget
 
TextWidget m_VersionTextWidget
 

Detailed Description

Definition at line 1 of file HudDebugWinBase.c.

Constructor & Destructor Documentation

◆ HudDebugWinBase()

void HudDebugWinBase::HudDebugWinBase ( Widget widget_root)
inlineprotected

Definition at line 10 of file HudDebugWinBase.c.

11 {
13 }

References m_WgtRoot.

◆ ~HudDebugWinCharDebug()

void HudDebugWinBase::~HudDebugWinCharDebug ( )
inlineprivate

Definition at line 20 of file HudDebugWinCharDebug.c.

21 {
22 }

◆ ~HudDebugWinCharLevels()

void HudDebugWinBase::~HudDebugWinCharLevels ( )
inlineprivate

Definition at line 18 of file HudDebugWinCharLevels.c.

19 {
20 SetUpdate(false);
21 }
void SetUpdate(bool state)

References SetUpdate().

◆ ~HudDebugWinCharStats()

void HudDebugWinBase::~HudDebugWinCharStats ( )
inlineprivate

Definition at line 25 of file HudDebugWinCharStats.c.

26 {
27 SetUpdate(false);
28 }

References SetUpdate().

◆ ~HudDebugWinCharStomach()

void HudDebugWinBase::~HudDebugWinCharStomach ( )
inlineprivate

Definition at line 19 of file HudDebugWinCharStomach.c.

20 {
21 SetUpdate(false);
22 }

References SetUpdate().

◆ ~HudDebugWinTemperature()

void HudDebugWinBase::~HudDebugWinTemperature ( )
inlineprotected

Definition at line 20 of file HudDebugWinTemperature.c.

21 {
22 }

◆ ~HudDebugWinVersion()

void HudDebugWinBase::~HudDebugWinVersion ( )
inlineprivate

Definition at line 22 of file HudDebugWinVersion.c.

23 {
24 }

Member Function Documentation

◆ AddValue() [1/3]

void HudDebugWinBase::AddValue ( string classname,
int food_stage,
int agents,
float amount )
inlineprivate

Definition at line 125 of file HudDebugWinCharStomach.c.

126 {
127 int index = m_WgtValues.AddItem(classname, NULL, 0);
128 string stage = typename.EnumToString(FoodStageType, food_stage) + "(" + food_stage.ToString() + ")";;
129 m_WgtValues.SetItem(index, amount.ToString(), NULL, 1);
130 m_WgtValues.SetItem(index, stage, NULL, 2);
132 string agent_line = "(" + agents.ToString() + ") ";
133
134 for (int i = 0; i < agent_list.Count(); i++)
135 agent_line += "," + agent_list.Get(i);
136
137 m_WgtValues.SetItem(index, agent_line, NULL, 3);
138 }
FoodStageType
Definition FoodStage.c:2
TextListboxWidget m_WgtValues
array< string > GetAgentsArray(int agents)
proto string ToString()

References GetAgentsArray(), and float::ToString().

◆ AddValue() [2/3]

void HudDebugWinBase::AddValue ( string title,
string value )
inlineprivate

Definition at line 170 of file HudDebugWinCharStats.c.

171 {
172 Widget widget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_hud_debug_stat.layout", m_WgtPanel);
173
174 TextWidget tw = TextWidget.Cast(widget.FindAnyWidget("StatName"));
175 tw.SetText(title);
176 m_StatWidgets.Insert(widget);
177
178 TextWidget tw_output = TextWidget.Cast(widget.FindAnyWidget("OutputValue"));
179 m_StatValues.Insert(tw_output);
180
181 EditBoxWidget ebw_input = EditBoxWidget.Cast(widget.FindAnyWidget("InputValue"));
183
184 SliderWidget sw = SliderWidget.Cast(widget.FindAnyWidget("StatSlider"));
185 m_SliderWidgets.Insert(sw, title);
186
187
188 //int index = m_WgtValues.AddItem( title, NULL, 0 );
189 //m_WgtValues.SetItem( index, value, NULL, 1 );
190
194 }
ref map< ref EditBoxWidget, string > m_StatValuesInput
ref map< ref SliderWidget, string > m_SliderWidgets
ref array< ref Widget > m_StatWidgets
ref array< ref TextWidget > m_StatValues
proto native CGame GetGame()

References GetGame().

◆ AddValue() [3/3]

void HudDebugWinBase::AddValue ( string title,
string value,
string value2 )
inlineprivate

Definition at line 116 of file HudDebugWinCharLevels.c.

117 {
118 int index = m_WgtValues.AddItem(title, NULL, 0);
119 m_WgtValues.SetItem(index, value, NULL, 1);
120 m_WgtValues.SetItem(index, value2, NULL, 2);
121 }

Referenced by SetContentValues(), SetupValues(), and SetValues().

◆ ClearValues() [1/3]

void HudDebugWinBase::ClearValues ( )
inlineprivate

Definition at line 123 of file HudDebugWinCharLevels.c.

124 {
125 m_WgtValues.ClearItems();
126 }

Referenced by SetContentValues(), and SetValues().

◆ ClearValues() [2/3]

void HudDebugWinBase::ClearValues ( )
inlineprivate

Definition at line 196 of file HudDebugWinCharStats.c.

197 {
198 m_StatWidgets.Clear();
199 //m_WgtValues.ClearItems();
200 }

◆ ClearValues() [3/3]

void HudDebugWinBase::ClearValues ( )
inlineprivate

Definition at line 152 of file HudDebugWinCharStomach.c.

153 {
154 m_WgtValues.ClearItems();
155 }

◆ FitWindow() [1/3]

void HudDebugWinBase::FitWindow ( )
inlineprivate

Definition at line 128 of file HudDebugWinCharLevels.c.

129 {
130 //FitWindowByContent( m_WgtValues );
131 }

Referenced by HudDebugWinCharLevels(), SetModifiers(), SetupValues(), and SetValues().

◆ FitWindow() [2/3]

void HudDebugWinBase::FitWindow ( )
inlineprivate

Definition at line 202 of file HudDebugWinCharStats.c.

203 {
205 if (wgt)
207 }
void FitWindowByContent(TextListboxWidget wgt)

References FitWindowByContent().

◆ FitWindow() [3/3]

void HudDebugWinBase::FitWindow ( )
inlineprivate

Definition at line 157 of file HudDebugWinCharStomach.c.

158 {
160 }

References FitWindowByContent().

◆ FitWindowByContent()

void HudDebugWinBase::FitWindowByContent ( TextListboxWidget wgt)
inlineprotected

Definition at line 72 of file HudDebugWinBase.c.

73 {
74 int size_of_value = 17;
75 SetValueListSize(250, size_of_value * wgt.GetNumItems(), wgt);
76 }
void SetValueListSize(int x, int y, TextListboxWidget wgt)

References SetValueListSize().

Referenced by FitWindow(), and FitWindow().

◆ GetAgentsArray()

array< string > HudDebugWinBase::GetAgentsArray ( int agents)
inlineprivate

Definition at line 140 of file HudDebugWinCharStomach.c.

141 {
143 for (int i = 0; i < 32; i++)
144 {
145 int agent = agents & (1 << i);
146 if (agent)
147 list.Insert(PluginTransmissionAgents.GetNameByID(agent));
148 }
149 return list;
150 }

Referenced by AddValue().

◆ GetType() [1/7]

int HudDebugWinBase::GetType ( )
inlineprotected

Definition at line 18 of file HudDebugWinBase.c.

19 {
20 return HudDebug.HUD_WIN_UNDEFINED;
21 }
void HudDebug()
Definition HudDebug.c:104

References HudDebug().

◆ GetType() [2/7]

override int HudDebugWinBase::GetType ( )
inlineprivate

Definition at line 49 of file HudDebugWinCharDebug.c.

50 {
51 return HudDebug.HUD_WIN_CHAR_DEBUG;
52 }

References HudDebug().

◆ GetType() [3/7]

override int HudDebugWinBase::GetType ( )
inlineprivate

Definition at line 27 of file HudDebugWinCharLevels.c.

28 {
29 return HudDebug.HUD_WIN_CHAR_LEVELS;
30 }

References HudDebug().

◆ GetType() [4/7]

override int HudDebugWinBase::GetType ( )
inlineprivate

Definition at line 34 of file HudDebugWinCharStats.c.

35 {
36 return HudDebug.HUD_WIN_CHAR_STATS;
37 }

References HudDebug().

◆ GetType() [5/7]

override int HudDebugWinBase::GetType ( )
inlineprivate

Definition at line 28 of file HudDebugWinCharStomach.c.

29 {
30 return HudDebug.HUD_WIN_CHAR_STOMACH;
31 }

References HudDebug().

◆ GetType() [6/7]

override int HudDebugWinBase::GetType ( )
inlineprotected

Definition at line 90 of file HudDebugWinTemperature.c.

91 {
92 return HudDebug.HUD_WIN_TEMPERATURE;
93 }

References HudDebug().

◆ GetType() [7/7]

override int HudDebugWinBase::GetType ( )
inlineprivate

Definition at line 37 of file HudDebugWinVersion.c.

38 {
39 return HudDebug.HUD_WIN_VERSION;
40 }

References HudDebug().

◆ Hide() [1/5]

void HudDebugWinBase::Hide ( )
inlineprotected

Definition at line 55 of file HudDebugWinBase.c.

56 {
57 m_WgtRoot.Show(false);
58 m_Show = false;
59 }

References m_Show, and m_WgtRoot.

◆ Hide() [2/5]

override void HudDebugWinBase::Hide ( )
inlineprivate

Definition at line 47 of file HudDebugWinCharLevels.c.

48 {
49 super.Hide();
50
51 //Print("Hide()");
52
53 SetUpdate(false);
54 }

References SetUpdate().

◆ Hide() [3/5]

override void HudDebugWinBase::Hide ( )
inlineprivate

Definition at line 54 of file HudDebugWinCharStats.c.

55 {
56 super.Hide();
57
58 //Print("Hide()");
59
60 SetUpdate(false);
61 }

References SetUpdate().

◆ Hide() [4/5]

override void HudDebugWinBase::Hide ( )
inlineprivate

Definition at line 48 of file HudDebugWinCharStomach.c.

49 {
50 super.Hide();
51
52 //Print("Hide()");
53
54 SetUpdate(false);
55 }

References SetUpdate().

◆ Hide() [5/5]

override void HudDebugWinBase::Hide ( )
inlineprotected

Definition at line 60 of file HudDebugWinTemperature.c.

61 {
62 super.Hide();
63
64 SetUpdate(false);
65 }

References SetUpdate().

◆ HudDebugWinCharDebug()

void HudDebugWinBase::HudDebugWinCharDebug ( Widget widget_root)
inlineprivate

Definition at line 11 of file HudDebugWinCharDebug.c.

12 {
13 m_PlayerPosTextWidget = TextWidget.Cast(widget_root.FindAnyWidget("txt_PlayerPos"));
14 m_ClipboardTextWidget = TextWidget.Cast(widget_root.FindAnyWidget("txt_Clipboard"));
15 }
TextWidget m_PlayerPosTextWidget
TextWidget m_ClipboardTextWidget

◆ HudDebugWinCharLevels()

void HudDebugWinBase::HudDebugWinCharLevels ( Widget widget_root)
inlineprivate

Definition at line 8 of file HudDebugWinCharLevels.c.

9 {
10 m_WgtValues = TextListboxWidget.Cast(widget_root.FindAnyWidget("txl_CharLevels_Values"));
11
12 FitWindow();
13 }

References FitWindow().

◆ HudDebugWinCharStats()

void HudDebugWinBase::HudDebugWinCharStats ( Widget widget_root)
inlineprivate

Definition at line 15 of file HudDebugWinCharStats.c.

16 {
18 m_WgtPanel = Widget.Cast(m_WgtRoot.FindAnyWidget("Stats"));
19 //FitWindow();
20 }

References m_WgtRoot.

◆ HudDebugWinCharStomach()

void HudDebugWinBase::HudDebugWinCharStomach ( Widget widget_root)
inlineprivate

Definition at line 9 of file HudDebugWinCharStomach.c.

10 {
11 m_WgtValues = TextListboxWidget.Cast(widget_root.FindAnyWidget("txl_StomachContents"));
12 m_WgtOverall = TextWidget.Cast(widget_root.FindAnyWidget("InfoOverall"));
13 //FitWindow();
14 }

◆ HudDebugWinTemperature()

void HudDebugWinBase::HudDebugWinTemperature ( Widget widget_root)
inlineprotected

Definition at line 10 of file HudDebugWinTemperature.c.

11 {
12 m_EnviroTextWidget = TextWidget.Cast(widget_root.FindAnyWidget("txt_Temp"));
13 m_PluginDeveloperSync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
14
15 }
PluginBase GetPlugin(typename plugin_type)
PluginDeveloperSync m_PluginDeveloperSync

References GetPlugin(), and m_PluginDeveloperSync.

◆ HudDebugWinVersion()

void HudDebugWinBase::HudDebugWinVersion ( Widget widget_root)
inlineprivate

Definition at line 10 of file HudDebugWinVersion.c.

11 {
12 m_VersionTextWidget = TextWidget.Cast(widget_root.FindAnyWidget("txt_Version"));
13
14 string version;
15 g_Game.GetVersion(version);
16 m_VersionTextWidget.SetText(string.Format("exe: %1 | scripts: %2", version, GetPBOAPI().GetPBOVersion("dta\\scripts.pbo")));
17 }
DayZGame g_Game
Definition DayZGame.c:3528
proto native owned string GetPBOVersion(string openName)
class PBOAPI GetPBOAPI()
TextWidget m_VersionTextWidget

References g_Game, GetPBOAPI(), and GetPBOVersion().

◆ Init()

void HudDebugWinBase::Init ( Widget widget_root)
protected

◆ IsVisible()

bool HudDebugWinBase::IsVisible ( )
inlineprotected

Definition at line 64 of file HudDebugWinBase.c.

65 {
66 return m_WgtRoot.IsVisible();
67 }

References m_WgtRoot.

◆ OnChange()

bool HudDebugWinBase::OnChange ( Widget w,
int x,
int y,
bool finished )
inlineprivate

Definition at line 219 of file HudDebugWinCharStats.c.

220 {
221 if (m_StatValuesInput.Contains(EditBoxWidget.Cast(w)) && finished)
222 {
224 RPCChangeStat(m_StatValuesInput.Get(EditBoxWidget.Cast(w)), ebw.GetText().ToFloat());
225 return true;
226 }
227 if (m_SliderWidgets.Contains(SliderWidget.Cast(w)))
228 {
229 m_ChangingSlider = true;
230 string stat_name = m_SliderWidgets.Get(SliderWidget.Cast(w));
233 for (int i = 0; i < player.m_PlayerStats.GetPCO().Get().Count(); i++)
234 {
235 string label = player.m_PlayerStats.GetPCO().Get().Get(i).GetLabel();
236 if (label == stat_name)
237 {
238 float stat_min = player.m_PlayerStats.GetPCO().Get().Get(i).GetMin();
239 float stat_max = player.m_PlayerStats.GetPCO().Get().Get(i).GetMax();
240 float current_value_norm = sw.GetCurrent() / 100;
242
244 }
245 }
246 //Print("OnChange " + finished);
247 if (finished)
248 m_ChangingSlider = false;
249 }
250
251 return false;
252 }
PlayerBase GetPlayer()
array< ref PlayerStatBase > Get()
void RPCChangeStat(string stat, float value)

References Count, Get(), GetGame(), GetPlayer(), and RPCChangeStat().

◆ OnClick()

bool HudDebugWinBase::OnClick ( Widget w,
int x,
int y,
int button )
inlineprivate

Definition at line 209 of file HudDebugWinCharStats.c.

210 {
211 if (w.GetName() == "ResetStats")
212 {
213 ResetStats();
214 return true;
215 }
216 return false;
217 }

References ResetStats().

◆ ResetStats()

void HudDebugWinBase::ResetStats ( )
inlineprivate

Definition at line 255 of file HudDebugWinCharStats.c.

256 {
258
259 //if client, send RPC
260
261 ref Param1<bool> params = new Param1<bool>(false);
262 if (player)
263 player.RPCSingleParam(ERPCs.DEV_RPC_STATS_RESET, params, true);
264 }
ERPCs
Definition ERPCs.c:2

References GetGame(), and GetPlayer().

Referenced by OnClick().

◆ RPCChangeStat()

void HudDebugWinBase::RPCChangeStat ( string stat,
float value )
inlineprivate

Definition at line 266 of file HudDebugWinCharStats.c.

267 {
269
270 //if client, send RPC
271
273 if (player)
274 player.RPCSingleParam(ERPCs.DEV_RPC_STAT_SET, params, true);
275 }

References GetGame(), and GetPlayer().

Referenced by OnChange().

◆ SetContentValues()

void HudDebugWinBase::SetContentValues ( )
inlineprivate

Definition at line 97 of file HudDebugWinCharStomach.c.

98 {
99 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
100
101 //clear window
102 ClearValues();
103
104 for (int i = 0; i < developer_sync.m_PlayerStomachSynced.Count() - 1; i++)
105 {
106 //new Param4<int,int,int,float>(id, food_stage, agents, amount);
108 AddValue(PlayerStomach.GetClassnameFromID(p4.param1), p4.param2, p4.param3, p4.param4);
109 }
110
111 if (developer_sync.m_PlayerStomachSynced.Count())
112 {
113 int last_index = developer_sync.m_PlayerStomachSynced.Count() - 1;
114 Param1<float> p1 = Param1<float>.Cast(developer_sync.m_PlayerStomachSynced.Get(last_index));
115 m_WgtOverall.SetText("Overall volume:" + p1.param1.ToString());
116 }
117 else
118 m_WgtOverall.SetText("");
119
120
121 //fit to screen
122 //FitWindow();
123 }
void PlayerStomach(PlayerBase player)
void AddValue(string title, string value, string value2)

References AddValue(), ClearValues(), GetPlugin(), and PlayerStomach().

Referenced by Update().

◆ SetRPCSent()

void HudDebugWinBase::SetRPCSent ( )
inlineprotected

Definition at line 37 of file HudDebugWinBase.c.

38 {
39 m_RPCSent = true;
40 }

References m_RPCSent.

Referenced by SetUpdate(), and SetUpdate().

◆ SetUpdate() [1/5]

◆ SetUpdate() [2/5]

override void HudDebugWinBase::SetUpdate ( bool state)
inlineprivate

Definition at line 59 of file HudDebugWinCharLevels.c.

60 {
61 //Disable update on server (PluginDeveloperSync)
63
64 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
65
66 //if client, send RPC
67 if (GetGame().IsClient())
68 {
70 if (player)
71 {
72 player.RPCSingleParam(ERPCs.DEV_LEVELS_UPDATE, params, true);
73 SetRPCSent();
74 }
75 }
76 //else set directly
77 else
78 {
80 developer_sync.EnableUpdate(state, ERPCs.DEV_LEVELS_UPDATE, player);
81 }
82 }

References GetGame(), GetPlayer(), GetPlugin(), and SetRPCSent().

◆ SetUpdate() [3/5]

override void HudDebugWinBase::SetUpdate ( bool state)
inlineprivate

Definition at line 66 of file HudDebugWinCharStats.c.

67 {
68 //Disable update on server (PluginDeveloperSync)
70
71 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
72
73 //if client, send RPC
74 if (GetGame().IsClient())
75 {
77 if (player)
78 {
79 player.RPCSingleParam(ERPCs.DEV_STATS_UPDATE, params, true);
80 SetRPCSent();
81 }
82 }
83 //else set directly
84 else
85 {
87 developer_sync.EnableUpdate(state, ERPCs.DEV_STATS_UPDATE, player);
88 }
89 }

References GetGame(), GetPlayer(), GetPlugin(), and SetRPCSent().

◆ SetUpdate() [4/5]

override void HudDebugWinBase::SetUpdate ( bool state)
inlineprivate

Definition at line 60 of file HudDebugWinCharStomach.c.

61 {
62 //Disable update on server (PluginDeveloperSync)
64
65 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
66
67 //if client, send RPC
68 if (GetGame().IsClient())
69 {
71 if (player)
72 {
73 player.RPCSingleParam(ERPCs.DEV_STOMACH_UPDATE, params, true);
74 SetRPCSent();
75 }
76 }
77 //else set directly
78 else
79 {
81 developer_sync.EnableUpdate(state, ERPCs.DEV_STOMACH_UPDATE, player);
82 }
83 }

References GetGame(), GetPlayer(), GetPlugin(), and SetRPCSent().

◆ SetUpdate() [5/5]

override void HudDebugWinBase::SetUpdate ( bool state)
inlineprotected

Definition at line 27 of file HudDebugWinTemperature.c.

28 {
29 //Disable update on server (PluginDeveloperSync)
31
32 //if client, send RPC
33 if (GetGame().IsClient())
34 {
36 if (player)
37 {
38 player.RPCSingleParam(ERPCs.DEV_TEMP_UPDATE, CachedObjectsParams.PARAM1_BOOL, true);
39 SetRPCSent();
40 }
41 }
42 //else set directly
43 else
44 {
46 m_PluginDeveloperSync.EnableUpdate(state, ERPCs.DEV_TEMP_UPDATE, player);
47 }
48 }
static ref Param1< bool > PARAM1_BOOL

References GetGame(), GetPlayer(), m_PluginDeveloperSync, CachedObjectsParams::PARAM1_BOOL, and SetRPCSent().

◆ SetupValues()

void HudDebugWinBase::SetupValues ( )
inlineprivate

Definition at line 107 of file HudDebugWinCharStats.c.

108 {
109 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
110
111 //clear window
112 //ClearValues();
113
114 if (developer_sync.m_PlayerStatsSynced.Count() > 0)
115 {
116 //set
117 for (int i = 0; i < developer_sync.m_PlayerStatsSynced.Count(); i++)
118 AddValue(developer_sync.m_PlayerStatsSynced.Get(i).GetName(), developer_sync.m_PlayerStatsSynced.Get(i).GetValue().ToString());
119 //fit to screen
120 FitWindow();
121 m_Populated = true;
122 }
123 }

References AddValue(), FitWindow(), and GetPlugin().

Referenced by Update().

◆ SetValueListSize()

void HudDebugWinBase::SetValueListSize ( int x,
int y,
TextListboxWidget wgt )
inlineprotected

Definition at line 81 of file HudDebugWinBase.c.

82 {
83 int offset = 10;
84 int size_of_title = 20;
85
86 wgt.SetSize(x, y);
87
88 int root_size_x = x + (2 * offset);
89 int root_size_y = y + (2 * offset) + size_of_title;
90
92 }
Icon x
Icon y

References m_WgtRoot, x, and y.

Referenced by FitWindowByContent().

◆ SetValues()

void HudDebugWinBase::SetValues ( )
inlineprivate

Definition at line 95 of file HudDebugWinCharLevels.c.

96 {
97 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
98
99 //clear window
100 ClearValues();
101
102 if (developer_sync.m_PlayerLevelsSynced.Count() > 0)
103 {
104 //set
105 for (int i = 0; i < developer_sync.m_PlayerLevelsSynced.Count(); i++)
106 {
107 string bar = MiscGameplayFunctions.ValueToBar(developer_sync.m_PlayerLevelsSynced.Get(i).GetValue2());
108 AddValue(developer_sync.m_PlayerLevelsSynced.Get(i).GetName(), developer_sync.m_PlayerLevelsSynced.Get(i).GetValue().ToString(), bar);
109 }
110 }
111
112 //fit to screen
113 FitWindow();
114 }

References AddValue(), ClearValues(), FitWindow(), and GetPlugin().

Referenced by Update().

◆ Show() [1/5]

void HudDebugWinBase::Show ( )
inlineprotected

Definition at line 46 of file HudDebugWinBase.c.

47 {
48 m_WgtRoot.Show(true);
49 m_Show = true;
50 }

References m_Show, and m_WgtRoot.

◆ Show() [2/5]

override void HudDebugWinBase::Show ( )
inlineprivate

Definition at line 35 of file HudDebugWinCharLevels.c.

36 {
37 super.Show();
38
39 //Print("Show()");
40
41 SetUpdate(true);
42 }

References SetUpdate().

◆ Show() [3/5]

override void HudDebugWinBase::Show ( )
inlineprivate

Definition at line 42 of file HudDebugWinCharStats.c.

43 {
44 super.Show();
45
46 //Print("Show()");
47
48 SetUpdate(true);
49 }

References SetUpdate().

◆ Show() [4/5]

override void HudDebugWinBase::Show ( )
inlineprivate

Definition at line 36 of file HudDebugWinCharStomach.c.

37 {
38 super.Show();
39
40 //Print("Show()");
41
42 SetUpdate(true);
43 }

References SetUpdate().

◆ Show() [5/5]

override void HudDebugWinBase::Show ( )
inlineprotected

Definition at line 53 of file HudDebugWinTemperature.c.

54 {
55 super.Show();
56
57 SetUpdate(true);
58 }

References SetUpdate().

◆ Update() [1/7]

void HudDebugWinBase::Update ( )
inlineprotected

Definition at line 27 of file HudDebugWinBase.c.

28 {
29 if (m_Show && !m_RPCSent)
30 SetUpdate(true);
31 }

References m_RPCSent, m_Show, and SetUpdate().

◆ Update() [2/7]

override void HudDebugWinBase::Update ( )
inlineprivate

Definition at line 27 of file HudDebugWinCharDebug.c.

28 {
29 super.Update();
30
32 if (player != NULL)
33 {
34 vector pos = player.GetPosition();
35 string pos_str = "Pos: " + pos[0].ToString() + " " + pos[2].ToString();
37 }
38
39 string clipboard;
40 GetGame().CopyFromClipboard(clipboard);
41 clipboard = clipboard.Substring(0, Math.Min(clipboard.Length(), 128)); //max 128 chars
42 clipboard = "Clipboard: " + clipboard;
44 }
Definition EnMath.c:7
proto string ToString(bool beautify=true)
Vector to string.
static proto float Min(float x, float y)
Returns smaller of two given values.

References GetGame(), GetPlayer(), Math::Min(), and vector::ToString().

◆ Update() [3/7]

override void HudDebugWinBase::Update ( )
inlineprivate

Definition at line 85 of file HudDebugWinCharLevels.c.

86 {
87 super.Update();
88
89 //Print("Update()");
90
91 //refresh notifiers
92 SetValues();
93 }

References SetValues().

◆ Update() [4/7]

override void HudDebugWinBase::Update ( )
inlineprivate

Definition at line 92 of file HudDebugWinCharStats.c.

93 {
94 super.Update();
95 //Print("panel:" + m_WgtPanel);
96 //Print("Update()");
97
98 //refresh notifiers
99
100
101 if (!m_Populated)
102 SetupValues();
103
104 UpdateValues();
105 }

References SetupValues(), and UpdateValues().

◆ Update() [5/7]

override void HudDebugWinBase::Update ( )
inlineprivate

Definition at line 86 of file HudDebugWinCharStomach.c.

87 {
88 super.Update();
89
90 //Print("Update()");
91
92 //refresh notifiers
94 }

References SetContentValues().

◆ Update() [6/7]

override void HudDebugWinBase::Update ( )
inlineprotected

Definition at line 71 of file HudDebugWinTemperature.c.

72 {
73 super.Update();
74 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
75
76 m_EnviroTextWidget.SetText(developer_sync.m_EnvironmentDebugMessage);
77 int sX, sY;
78 m_EnviroTextWidget.GetTextSize(sX, sY);
79 m_EnviroTextWidget.SetSize(sX, sY);
80
82 m_WgtRoot.GetScript(spacer);
83 if (spacer)
84 spacer.Update();
85 }

References GetPlugin(), and m_WgtRoot.

◆ Update() [7/7]

override void HudDebugWinBase::Update ( )
inlineprivate

Definition at line 29 of file HudDebugWinVersion.c.

30 {
31 super.Update();
32 }

◆ UpdateValues()

void HudDebugWinBase::UpdateValues ( )
inlineprivate

Definition at line 126 of file HudDebugWinCharStats.c.

127 {
128 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
129 if (developer_sync.m_PlayerStatsSynced.Count() > 0)
130 {
131 for (int i = 0; i < developer_sync.m_PlayerStatsSynced.Count(); i++)
132 {
133 string stat_name = developer_sync.m_PlayerStatsSynced.Get(i).GetName();
134 float val_norm = developer_sync.m_PlayerStatsSynced.Get(i).GetValueNorm();
135 float value = developer_sync.m_PlayerStatsSynced.Get(i).GetValue();
136
137 if (stat_name == "BloodType")
138 {
139 string type, name;
140 bool positive;
141
142 name = value.ToString();
143 name += "(" + BloodTypes.GetBloodTypeName(Math.Round(value), type, positive) + ")";
144 m_StatValues.Get(i).SetText(name);
145 }
146 else
147 m_StatValues.Get(i).SetText(value.ToString());
148
149 if (!m_ChangingSlider)
150 m_SliderWidgets.GetKeyByValue(stat_name).SetCurrent(val_norm * 100);
151 /*
152 EditBoxWidget w;
153 w.
154 AddValue( developer_sync.m_PlayerStatsSynced.Get( i ).GetName(), developer_sync.m_PlayerStatsSynced.Get( i ).GetValue().ToString() );
155 */
156 }
157 }
158
159 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
static string GetBloodTypeName(int bloodtype, out string type, out bool positive)
Definition BloodType.c:82
static proto float Round(float f)
Returns mathematical round of value.

References BloodTypes::GetBloodTypeName(), GetPlugin(), name, and Math::Round().

Referenced by Update().

Member Data Documentation

◆ m_ChangingSlider

bool HudDebugWinBase::m_ChangingSlider
private

Definition at line 10 of file HudDebugWinCharStats.c.

◆ m_ClipboardTextWidget

TextWidget HudDebugWinBase::m_ClipboardTextWidget
private

Definition at line 6 of file HudDebugWinCharDebug.c.

◆ m_EnviroTextWidget

TextWidget HudDebugWinBase::m_EnviroTextWidget
private

Definition at line 5 of file HudDebugWinTemperature.c.

◆ m_ModuleDeveloper

PluginDeveloper HudDebugWinBase::m_ModuleDeveloper
private

Definition at line 3 of file HudDebugWinCharDebug.c.

◆ m_PlayerPosTextWidget

TextWidget HudDebugWinBase::m_PlayerPosTextWidget
private

Definition at line 5 of file HudDebugWinCharDebug.c.

◆ m_PluginDeveloperSync

PluginDeveloperSync HudDebugWinBase::m_PluginDeveloperSync
protected

Definition at line 6 of file HudDebugWinTemperature.c.

◆ m_Populated

bool HudDebugWinBase::m_Populated
private

Definition at line 9 of file HudDebugWinCharStats.c.

◆ m_RPCSent

bool HudDebugWinBase::m_RPCSent
protected

Definition at line 5 of file HudDebugWinBase.c.

Referenced by SetRPCSent(), and Update().

◆ m_Show

bool HudDebugWinBase::m_Show
protected

Definition at line 4 of file HudDebugWinBase.c.

Referenced by Hide(), Show(), and Update().

◆ m_SliderWidgets

ref map<ref SliderWidget, string> HudDebugWinBase::m_SliderWidgets = new map<ref SliderWidget, string>
private

Definition at line 6 of file HudDebugWinCharStats.c.

◆ m_StatValues

ref array<ref TextWidget> HudDebugWinBase::m_StatValues = new array<ref TextWidget>
private

Definition at line 7 of file HudDebugWinCharStats.c.

◆ m_StatValuesInput

ref map<ref EditBoxWidget, string> HudDebugWinBase::m_StatValuesInput = new map<ref EditBoxWidget, string>
private

Definition at line 8 of file HudDebugWinCharStats.c.

◆ m_StatWidgets

ref array<ref Widget> HudDebugWinBase::m_StatWidgets = new array<ref Widget>
private

Definition at line 5 of file HudDebugWinCharStats.c.

◆ m_VersionTextWidget

TextWidget HudDebugWinBase::m_VersionTextWidget
private

Definition at line 5 of file HudDebugWinVersion.c.

◆ m_WgtOverall

TextWidget HudDebugWinBase::m_WgtOverall
private

Definition at line 4 of file HudDebugWinCharStomach.c.

◆ m_WgtPanel

Widget HudDebugWinBase::m_WgtPanel
private

Definition at line 4 of file HudDebugWinCharStats.c.

◆ m_WgtRoot

Widget HudDebugWinBase::m_WgtRoot
private

Definition at line 3 of file HudDebugWinBase.c.

Referenced by Hide(), HudDebugWinBase(), IsVisible(), SetValueListSize(), and Show().

◆ m_WgtValues

TextListboxWidget HudDebugWinBase::m_WgtValues
private

Definition at line 3 of file HudDebugWinCharLevels.c.


The documentation for this class was generated from the following files: