Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
huddebugwintemperature.c
Go to the documentation of this file.
1 class HudDebugWinTemperature extends HudDebugWinBase
2 {
3  private PluginDeveloper m_ModuleDeveloper;
4 
5  private TextWidget m_EnviroTextWidget;
6  protected PluginDeveloperSync m_PluginDeveloperSync;
7  //============================================
8  // HudDebugWinTemperature
9  //============================================
10  void HudDebugWinTemperature(Widget widget_root)
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  //============================================
20  void ~HudDebugWinTemperature()
21  {
22  }
23 
24  //============================================
25  // Set Update
26  //============================================
27  override void SetUpdate( bool state )
28  {
29  //Disable update on server (PluginDeveloperSync)
30  PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
31 
32  //if client, send RPC
33  if ( GetGame().IsClient() )
34  {
35  CachedObjectsParams.PARAM1_BOOL.param1 = state;
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  {
47  m_PluginDeveloperSync.EnableUpdate( state, ERPCs.DEV_TEMP_UPDATE, player );
48  }
49  }
50  }
51 
52  //============================================
53  // Show / Hide
54  //============================================
55  override void Show()
56  {
57  super.Show();
58 
59  SetUpdate( true );
60  }
61 
62  override void Hide()
63  {
64  super.Hide();
65 
66  SetUpdate( false );
67  }
68 
69 
70  //============================================
71  // Update
72  //============================================
73  override void Update()
74  {
75  super.Update();
76  PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast( GetPlugin( PluginDeveloperSync ) );
77 
78  m_EnviroTextWidget.SetText(developer_sync.m_EnvironmentDebugMessage);
79  int sX, sY;
80  m_EnviroTextWidget.GetTextSize(sX, sY);
81  m_EnviroTextWidget.SetSize(sX, sY);
82 
83  AutoHeightSpacer spacer;
84  m_WgtRoot.GetScript(spacer);
85  if (spacer)
86  {
87  spacer.Update();
88  }
89  }
90 
91  //============================================
92  // GetWinType
93  //============================================
94  override int GetType()
95  {
96  return HudDebug.HUD_WIN_TEMPERATURE;
97  }
98 }
GetGame
proto native CGame GetGame()
m_WgtRoot
Widget m_WgtRoot
Definition: huddebug.c:92
AutoHeightSpacer
Definition: autoheightspacer.c:2
Show
proto native void Show(bool show, bool immedUpdate=true)
SetUpdate
override void SetUpdate(bool state)
Definition: huddebugwincharagents.c:57
HudDebugWinBase
Definition: huddebugwinbase.c:1
CachedObjectsParams
Definition: utilityclasses.c:9
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
PlayerBase
Definition: playerbaseclient.c:1
TextWidget
Definition: enwidgets.c:219
m_PluginDeveloperSync
protected PluginDeveloperSync m_PluginDeveloperSync
Definition: huddebugwincharmodifiers.c:28
Update
proto native volatile void Update()
Definition: playersoundmanager.c:125
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
HudDebug
void HudDebug()
Definition: huddebug.c:104
ERPCs
ERPCs
Definition: erpcs.c:1
Widget
Definition: enwidgets.c:189
Hide
void Hide()
Definition: dayzgame.c:165
GetType
override int GetType()
Definition: huddebugwincharagents.c:49