21 #ifdef PLATFORM_CONSOLE
28 switch (pInputDeviceType)
36 if (
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
52 Widget tab_controls =
m_Root.FindAnyWidget(
"Tab_Control_Container");
55 Widget tab_child = tab_controls.GetChildren();
60 tab_child = tab_child.GetSibling();
65 Widget tab_control = tab_controls.FindAnyWidget(
"Tab_Control_" + i);
67 if (tab_control && tab_widget)
69 tab_control.SetHandler(
this);
71 m_Tabs.Insert(i, tab_widget);
75 Error(
"Tabber could not find correctly named tab or control at index " + i);
80 #ifdef PLATFORM_CONSOLE
117 tab_controls_container.Update();
119 Widget tab_child = tab_controls_container.GetChildren();
122 if ( tab_child.IsVisible() )
124 TextWidget tab_text =
TextWidget.Cast( tab_child.FindAnyWidget( tab_child.GetName() +
"_Title" ) );
127 tab_text.GetTextSize( t_x, t_y );
129 tab_controls_container.Update();
134 tab_child = tab_child.GetSibling();
137 tab_child = tab_controls_container.GetChildren();
140 tab_controls_container.GetScreenPos( x_f_c, y_f_c );
144 Widget tab_bg = tab_child.FindAnyWidget( tab_child.GetName() +
"_Background" );
145 tab_child.GetScreenPos(
x,
y );
146 tab_bg.SetPos( ( x_f_c -
x ), 0 );
147 tab_bg.SetSize( total_size, 1 );
149 tab_child = tab_child.GetSibling();
155 tab_controls_container.Update();
156 if (tab_controls_scroller)
157 tab_controls_scroller.Update();
163 int new_index =
m_Tabs.Count();
168 tab.SetName(
"Tab_" + new_index );
169 control.SetName(
"Tab_Control_" + new_index );
170 control_text.SetName(
"Tab_Control_" + new_index +
"_Title" );
171 control.FindAnyWidget(
"Tab_Control_x_Background" ).SetName(
"Tab_Control_" + new_index +
"_Background" );
173 control_text.SetText(
name );
175 control.SetHandler(
this );
177 m_Tabs.Insert( new_index, tab );
192 return m_Tabs.Get( index );
239 Widget tab_title =
TextWidget.Cast(tab_control.FindAnyWidget( tab_control.GetName() +
"_Title" ));
240 tab_title.SetColor(
ARGB(255, 255, 0, 0) );
241 tab_control.SetColor(
ARGB(255, 0, 0 ,0) );
258 Widget tab_title =
TextWidget.Cast(tab_control.FindAnyWidget( tab_control.GetName() +
"_Title" ));
259 tab_title.SetColor(
ARGB(255, 255, 255, 255) );
260 tab_control.SetColor(
ARGB(0, 0, 0 ,0) );
287 if ( w ==
m_Root.FindAnyWidget(
"Tab_Control_Container" ) )
297 if ( w ==
m_Root.FindAnyWidget(
"Tab_Control_Container" ) )
307 Widget tab_control =
m_Root.FindAnyWidget(
"Tab_Control_" + index );
309 tab_control.Show( enable );
326 Widget tab_title =
TextWidget.Cast(tab_control.FindAnyWidget( tab_control.GetName() +
"_Title" ));
328 int color_title =
ARGB(255, 255, 0, 0);
329 int color_backg =
ARGB(255, 0, 0 ,0);
331 #ifdef PLATFORM_CONSOLE
332 color_title =
ARGB(255, 255, 255, 255);
333 color_backg =
ARGB(255, 200, 0 ,0);
336 tab_title.SetColor( color_title );
337 tab_control.SetColor( color_backg );
362 Widget tab_title =
TextWidget.Cast(tab_control.FindAnyWidget( tab_control.GetName() +
"_Title" ));
363 tab_title.SetColor(
ARGB(255, 255, 255,255) );
364 tab_control.SetColor(
ARGB(0, 0, 0 ,0) );
395 if ( next_index >=
m_Tabs.Count() )
420 if ( next_index < 0 )
460 Widget xbControls =
m_Root.FindAnyWidget(
"ConsoleControls");
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native WorkspaceWidget GetWorkspace()
proto native Mission GetMission()
ScriptInvoker GetOnInputDeviceChanged()
ScriptInvoker GetOnInputPresetChanged()
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
ScriptInvoker Class provide list of callbacks usage:
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto void GetScreenSize(out int x, out int y)
int ARGB(int a, int r, int g, int b)