3 TextListboxWidget m_WgtValues;
9 void HudDebugWinCharStomach(
Widget widget_root)
11 m_WgtValues = TextListboxWidget.Cast( widget_root.FindAnyWidget(
"txl_StomachContents") );
12 m_WgtOverall =
TextWidget.Cast( widget_root.FindAnyWidget(
"InfoOverall") );
19 void ~HudDebugWinCharStomach()
30 return HudDebug.HUD_WIN_CHAR_STOMACH;
65 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
70 ref Param1<bool> params =
new Param1<bool>( state );
73 player.RPCSingleParam(
ERPCs.DEV_STOMACH_UPDATE, params,
true );
82 developer_sync.EnableUpdate( state,
ERPCs.DEV_STOMACH_UPDATE, player );
99 void SetContentValues()
101 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
106 for (
int i = 0; i < developer_sync.m_PlayerStomachSynced.Count() - 1; i++ )
109 Param4<int,int,int,float> p4 = Param4<int,int,int,float>.Cast(developer_sync.m_PlayerStomachSynced.Get(i));
110 AddValue(
PlayerStomach.GetClassnameFromID(p4.param1), p4.param2, p4.param3, p4.param4);
113 if( developer_sync.m_PlayerStomachSynced.Count() )
115 int last_index = developer_sync.m_PlayerStomachSynced.Count() - 1;
116 Param1<float> p1 = Param1<float>.Cast(developer_sync.m_PlayerStomachSynced.Get(last_index));
117 m_WgtOverall.SetText(
"Overall volume:" + p1.param1.ToString());
121 m_WgtOverall.SetText(
"");
130 void AddValue(
string classname,
int food_stage,
int agents,
float amount)
132 int index = m_WgtValues.AddItem( classname, NULL, 0 );
133 string stage =
typename.EnumToString(
FoodStageType, food_stage) +
"(" + food_stage.ToString()+
")";;
134 m_WgtValues.SetItem( index, amount.ToString(), NULL, 1 );
135 m_WgtValues.SetItem( index,stage , NULL, 2 );
137 string agent_line =
"("+agents.ToString()+
") ";
139 for(
int i = 0; i < agent_list.Count();i++)
141 agent_line +=
"," +agent_list.Get(i);
144 m_WgtValues.SetItem( index, agent_line , NULL, 3);
150 for(
int i = 0; i < 32; i++)
152 int agent = agents & (1 << i);
155 list.Insert(PluginTransmissionAgents.GetNameByID(agent));
163 m_WgtValues.ClearItems();
168 FitWindowByContent( m_WgtValues );