File size: 1,539 Bytes
24b81cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
class HudDebugWinCharDebug extends HudDebugWinBase
{
private PluginDeveloper m_ModuleDeveloper;
private TextWidget m_PlayerPosTextWidget;
private TextWidget m_ClipboardTextWidget;
//============================================
// HudDebugWinCharDebug
//============================================
void HudDebugWinCharDebug(Widget widget_root)
{
m_PlayerPosTextWidget = TextWidget.Cast( widget_root.FindAnyWidget("txt_PlayerPos") );
m_ClipboardTextWidget = TextWidget.Cast( widget_root.FindAnyWidget("txt_Clipboard") );
}
//============================================
// ~HudDebugWinCharDebug
//============================================
void ~HudDebugWinCharDebug()
{
}
//============================================
// Update
//============================================
override void Update()
{
super.Update();
PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
if ( player != NULL )
{
vector pos = player.GetPosition();
string pos_str = "Pos: " + pos[0].ToString() + " " + pos[2].ToString();
m_PlayerPosTextWidget.SetText(pos_str);
}
string clipboard;
GetGame().CopyFromClipboard(clipboard);
clipboard = clipboard.Substring( 0, Math.Min( clipboard.Length(), 128 ) ); //max 128 chars
clipboard = "Clipboard: " + clipboard;
m_ClipboardTextWidget.SetText(clipboard);
}
//============================================
// GetWinType
//============================================
override int GetType()
{
return HudDebug.HUD_WIN_CHAR_DEBUG;
}
}
|