DayZ 1.24
Loading...
Searching...
No Matches
HudDebugWinTemperature.c
Go to the documentation of this file.
1class HudDebugWinTemperature extends HudDebugWinBase
2{
3 private PluginDeveloper m_ModuleDeveloper;
4
6 protected PluginDeveloperSync m_PluginDeveloperSync;
7 //============================================
8 // HudDebugWinTemperature
9 //============================================
11 {
12 m_EnviroTextWidget = TextWidget.Cast(widget_root.FindAnyWidget("txt_Temp"));
13 m_PluginDeveloperSync = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
14
15 }
16
17 //============================================
18 // ~HudDebugWinTemperature
19 //============================================
21 {
22 }
23
24 //============================================
25 // Set Update
26 //============================================
27 override void SetUpdate(bool state)
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 }
49
50 //============================================
51 // Show / Hide
52 //============================================
53 override void Show()
54 {
55 super.Show();
56
57 SetUpdate(true);
58 }
59
60 override void Hide()
61 {
62 super.Hide();
63
64 SetUpdate(false);
65 }
66
67
68 //============================================
69 // Update
70 //============================================
71 override void Update()
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 }
86
87 //============================================
88 // GetWinType
89 //============================================
90 override int GetType()
91 {
92 return HudDebug.HUD_WIN_TEMPERATURE;
93 }
94}
ERPCs
Definition ERPCs.c:2
void HudDebug()
Definition HudDebug.c:104
Widget m_WgtRoot
Definition HudDebug.c:92
PluginDeveloperSync m_PluginDeveloperSync
PlayerBase GetPlayer()
PluginBase GetPlugin(typename plugin_type)
static ref Param1< bool > PARAM1_BOOL
PluginDeveloperSync m_PluginDeveloperSync
PluginDeveloper m_ModuleDeveloper
void SetUpdate(bool state)
void HudDebugWinTemperature(Widget widget_root)
override void SetUpdate(bool state)
proto native CGame GetGame()