3 protected bool m_FirstInit =
true;
21#ifdef PLATFORM_CONSOLE
32 m_TabControlsRoot.FindAnyWidget(
"ConsoleControls").Show(
true);
37 m_TabControlsRoot.FindAnyWidget(
"ConsoleControls").Show(
false);
46 m_ResolutionMultiplier =
y / 1080;
61 for (
int i = 0;
i < m_TabsCount;
i++)
72 Error(
"Tabber could not find correctly named tab or control at index " +
i);
76#ifdef PLATFORM_CONSOLE
82 m_InitTimer.Run(0.01,
this,
"AlignTabbers");
98 m_InitTimer =
new Timer();
99 m_TabControlsRoot =
m_Root.FindAnyWidget(
"TabControls");
112 m_TabControlsRoot.Update();
124 tab_child.SetSize(
t_x + 10 * m_ResolutionMultiplier, 1);
148 m_TabControlsRoot.GetSize(
x,
y);
154 m_TabControlsRoot.Update();
160 Widget tab =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/tabber_prefab/tab.layout",
m_Root);
161 Widget control =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/tabber_prefab/tab_control.layout",
m_Root.FindAnyWidget(
"Tab_Control_Container"));
167 control.FindAnyWidget(
"Tab_Control_x_Background").SetName(
"Tab_Control_" +
new_index +
"_Background");
188 return m_Tabs.Get(
index);
193 return m_Tabs.Count();
208 DeselectTabControl(m_SelectedIndex);
209 DeselectTabPanel(m_SelectedIndex);
211 SelectTabControl(
index);
212 SelectTabPanel(
index);
214 m_SelectedIndex =
index;
215 m_OnTabSwitch.Invoke(m_SelectedIndex);
226 int index = m_TabControls.GetKeyByValue(
w);
227 if (m_SelectedIndex ==
index)
243 int index = m_TabControls.GetKeyByValue(
w);
244 if (m_SelectedIndex ==
index)
261 int index = m_TabControls.GetKeyByValue(
w);
262 if (m_SelectedIndex !=
index)
264 m_OnAttemptTabSwitch.Invoke(m_SelectedIndex,
index);
267 PerformSwitchTab(
index);
279 if (
w ==
m_Root.FindAnyWidget(
"Tab_Control_Container"))
289 if (
w ==
m_Root.FindAnyWidget(
"Tab_Control_Container"))
323#ifdef PLATFORM_CONSOLE
367 for (
int i = 0;
i < m_TabControls.Count();
i++)
369 DeselectTabControl(
i);
386 m_OnAttemptTabSwitch.Invoke(m_SelectedIndex,
next_index);
410 m_OnAttemptTabSwitch.Invoke(m_SelectedIndex,
next_index);
424 return m_SelectedIndex;
431 PerformSwitchTab(m_SelectedIndex);
void OnInputPresetChanged()
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
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)