| class HudDebugWinCharLevels extends HudDebugWinBase |
| { |
| TextListboxWidget m_WgtValues; |
| |
| |
| |
| |
| void HudDebugWinCharLevels(Widget widget_root) |
| { |
| m_WgtValues = TextListboxWidget.Cast( widget_root.FindAnyWidget("txl_CharLevels_Values") ); |
| |
| FitWindow(); |
| } |
|
|
| |
| |
| |
| void ~HudDebugWinCharLevels() |
| { |
| SetUpdate( false ); |
| } |
|
|
|
|
| |
| |
| |
| override int GetType() |
| { |
| return HudDebug.HUD_WIN_CHAR_LEVELS; |
| } |
| |
| |
| |
| |
| override void Show() |
| { |
| super.Show(); |
| |
| |
| |
| SetUpdate( true ); |
| } |
|
|
| |
| |
| |
| override void Hide() |
| { |
| super.Hide(); |
| |
| |
| |
| SetUpdate( false ); |
| } |
|
|
| |
| |
| |
| override void SetUpdate( bool state ) |
| { |
| |
| PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() ); |
| |
| PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast( GetPlugin( PluginDeveloperSync ) ); |
| |
| |
| if ( GetGame().IsClient() ) |
| { |
| ref Param1<bool> params = new Param1<bool>( state ); |
| if ( player ) |
| { |
| player.RPCSingleParam( ERPCs.DEV_LEVELS_UPDATE, params, true ); |
| SetRPCSent(); |
| } |
| } |
| |
| else |
| { |
| if ( developer_sync ) |
| { |
| developer_sync.EnableUpdate( state, ERPCs.DEV_LEVELS_UPDATE, player ); |
| } |
| } |
| } |
|
|
|
|
| override void Update() |
| { |
| super.Update(); |
| |
| |
| |
| |
| SetValues(); |
| } |
| |
| void SetValues() |
| { |
| PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast( GetPlugin( PluginDeveloperSync ) ); |
| |
| |
| ClearValues(); |
| |
| if ( developer_sync.m_PlayerLevelsSynced.Count() > 0 ) |
| { |
| |
| for ( int i = 0; i < developer_sync.m_PlayerLevelsSynced.Count(); i++ ) |
| { |
| string bar = MiscGameplayFunctions.ValueToBar(developer_sync.m_PlayerLevelsSynced.Get( i ).GetValue2()); |
| AddValue( developer_sync.m_PlayerLevelsSynced.Get( i ).GetName(), developer_sync.m_PlayerLevelsSynced.Get( i ).GetValue().ToString() ,bar ); |
| } |
| } |
| |
| |
| FitWindow(); |
| } |
|
|
| void AddValue( string title, string value, string value2 ) |
| { |
| int index = m_WgtValues.AddItem( title, NULL, 0 ); |
| m_WgtValues.SetItem( index, value, NULL, 1 ); |
| m_WgtValues.SetItem( index, value2, NULL, 2 ); |
| } |
| |
| void ClearValues() |
| { |
| m_WgtValues.ClearItems(); |
| } |
|
|
| void FitWindow() |
| { |
| |
| } |
| } |
|
|