29 protected static const string HINTS_PATH_DEFAULT =
"scripts/data/internal/script_console_hints.json";
30 protected static const string HINTS_PATH_OPTIONAL =
"$mission:script_console_hints.json";
34 const string NO_HINT_TEXT =
"No hint";
42 GetGame().GetMission().GetHud().ShowHudPlayer(
false);
43 GetGame().GetMission().GetHud().ShowQuickbarPlayer(
false);
48 plugin.OnScriptMenuOpened(
true);
56 GetGame().GetMission().GetHud().ShowHudPlayer(
true);
57 GetGame().GetMission().GetHud().ShowQuickbarPlayer(
true);
64 plugin.OnScriptMenuOpened(
false);
67 GetGame().GetMission().EnableAllInputs(
true);
101 if (m_JsonData && m_JsonData.WidgetHintBindings &&
w)
104 m_JsonData.WidgetHintBindings.Set(
hash,
text);
122 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console.layout");
123 m_EditTooltipRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_tooltip_edit.layout", layoutRoot);
124 m_EditTooltipRoot.Show(
false);
125 m_HintOkButton =
ButtonWidget.Cast(m_EditTooltipRoot.FindAnyWidget(
"ButtonOk"));
126 m_HintCancelButton =
ButtonWidget.Cast(m_EditTooltipRoot.FindAnyWidget(
"ButtonCancel"));
127 m_HintClearButton =
ButtonWidget.Cast(m_EditTooltipRoot.FindAnyWidget(
"ButtonClear"));
128 m_HintInputText =
EditBoxWidget.Cast(m_EditTooltipRoot.FindAnyWidget(
"InputText"));
130 m_ButtonsWindowWidget = layoutRoot.FindAnyWidget(
"TabButtons");
131 m_ButtonsWindowWidget.Show(
true);
143 m_CloseConsoleButton =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"CloseConsoleButtonWidget"));
176 if (m_JsonData && m_JsonData.WidgetHintBindings)
178 if (m_JsonData.WidgetHintBindings.Contains(
hash))
179 return m_JsonData.WidgetHintBindings.Get(
hash);
197 m_HintEditMode =
false;
242 GetGame().GetUIManager().Back();
248 m_EditTooltipRoot.Show(
true);
250 if (
text == NO_HINT_TEXT)
252 m_HintInputText.SetText(
text);
276 if (
w == m_CloseConsoleButton)
279 GetGame().GetMission().EnableAllInputs(
true);
282 else if (
w == m_HintOkButton)
286 m_EditTooltipRoot.Show(
false);
289 else if (
w == m_HintCancelButton)
292 m_EditTooltipRoot.Show(
false);
295 else if (
w == m_HintClearButton)
296 m_HintInputText.SetText(
"");
320 if (!m_EditTooltipRoot.IsVisible())
328 if (!m_EditTooltipRoot.IsVisible())
332#ifdef PLATFORM_CONSOLE
396 m_HintWidgetRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_hint.layout");
482 if (!
m_Root.IsVisibleHierarchy())
497 m_HintWidgetRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_hint.layout");
class GetServerModListResult m_Id
GetServersResultRow the output structure of the GetServers operation that represents one game server.
PluginConfigDebugProfile m_ConfigDebugProfile
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
ImageWidget m_HintWidgetBackground
Widget m_CurrentHoverWidget
RichTextWidget m_HintWidget
class ScriptConsole extends UIScriptedMenu HintMessage
bool m_HoverSuccessTriggered
void DisplayHint(string message)
void ScriptConsoleEnfScriptTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
void OnWidgetScriptInit(Widget w)
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
ref map< int, string > WidgetHintBindings
bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
bool OnKeyDown(Widget w, int x, int y, int key)
bool OnDoubleClick(Widget w, int x, int y, int button)
bool OnMouseButtonDown(Widget w, int x, int y, int button)
bool OnKeyPress(Widget w, int x, int y, int key)
bool OnChange(Widget w, int x, int y, bool finished)
bool OnClick(Widget w, int x, int y, int button)
Serialization general interface. Serializer API works with:
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
proto bool FileExist(string name)
Check existence of file.
proto native void ClearKey(KeyCode key)
proto native int KeyState(KeyCode key)
static proto float Sqrt(float val)
Returns square root.
static proto float AbsFloat(float f)
Returns absolute value.
proto void GetScreenSize(out int x, out int y)
proto void GetMousePos(out int x, out int y)