26 ButtonWidget m_CloseConsoleButton;
29 protected static const string HINTS_PATH_DEFAULT =
"scripts/data/internal/script_console_hints.json";
42 g_Game.GetMission().GetHud().ShowHudPlayer(
false);
43 g_Game.GetMission().GetHud().ShowQuickbarPlayer(
false);
48 plugin.OnScriptMenuOpened(
true);
56 g_Game.GetMission().GetHud().ShowHudPlayer(
true);
57 g_Game.GetMission().GetHud().ShowQuickbarPlayer(
true);
64 plugin.OnScriptMenuOpened(
false);
68 g_Game.GetMission().EnableAllInputs(
true);
95 if (!JsonFileLoader<JsonHintsData>.LoadFile(
path, data, errorMessage))
106 m_JsonData.WidgetHintBindings.Set(hash, text);
107 Print(
"setting: " + text);
124 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console.layout");
125 m_EditTooltipRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_tooltip_edit.layout", layoutRoot);
138 RegisterTab(
new ScriptConsoleEnfScriptServerTab(layoutRoot.FindAnyWidget(
"EnScriptPanel"),
this,ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"EnScriptButtonWidgetServer"))));
142 if (!
g_Game.IsDedicatedServer())
145 if (!
g_Game.IsDedicatedServer())
148 m_CloseConsoleButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"CloseConsoleButtonWidget"));
167 string nameThis = w.GetName();
168 string nameParent =
"";
172 nameParent = w.GetParent().GetName();
175 string namesCombined = nameThis + nameParent;
176 return namesCombined.Hash();
185 if (
m_JsonData.WidgetHintBindings.Contains(hash))
187 return m_JsonData.WidgetHintBindings.Get(hash);
219 super.OnKeyPress(w,
x,
y, key);
229 super.OnKeyDown(w,
x,
y, key);
239 super.Update(timeslice);
261 g_Game.GetUIManager().Back();
278 if (handler.IsSelected())
280 handler.Update(timeslice);
287 super.OnMouseButtonDown(w,
x,
y,button);
296 override bool OnClick(Widget w,
int x,
int y,
int button)
298 super.OnClick(w,
x,
y, button);
300 if (w == m_CloseConsoleButton)
303 g_Game.GetMission().EnableAllInputs(
true);
334 super.OnDoubleClick(w,
x,
y, button);
344 super.OnMouseLeave(w, enterW,
x,
y);
357 super.OnMouseEnter(w,
x,
y);
364 #ifdef PLATFORM_CONSOLE
370 override bool OnChange(Widget w,
int x,
int y,
bool finished)
372 super.OnChange(w,
x,
y, finished);
380 override bool OnItemSelected(Widget w,
int x,
int y,
int row,
int column,
int oldRow,
int oldColumn)
382 super.OnItemSelected(w,
x,
y, row, column, oldRow, oldColumn);
394 if (tabType == handler.Type())
420 handler.Select(handler == selectedHandler, selectedHandler);
427 g_Game.GetMission().RemoveActiveInputExcludes({
"movement"},
true);
433 g_Game.GetMission().AddActiveInputExcludes({
"movement"});
444 GetLayoutRoot().FindAnyWidget(
"MenuWindow").SetColor(
ARGB(0, 0, 0, 0));
448 GetLayoutRoot().FindAnyWidget(
"MenuWindow").SetColor(
ARGB(128, 0, 0, 0));
456 m_HintWidgetRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_hint.layout");
466 int screenW, screenH;
472 float relativeX = mouseX / screenW;
473 float relativeY = mouseY / screenH;
478 offsetX = -width - offsetX;
480 offsetY = -height - offsetY;
490 super.OnRPCEx(rpc_type, ctx);
491 #ifdef DIAG_DEVELOPER
495 handler.OnRPCEx(rpc_type,ctx);
517 "UAVoiceModifierHelper",
519 "UAVoiceDistanceDown",
521 "UAVoiceOverNetToggle",
522 "UAVoiceOverNetMute",
533 "UABuldSelectToggle",
536 "UABuldSelectAddMod",
537 "UABuldSelectRemoveMod",
538 "UABuldModifySelected",
540 "UABuldRotationXAxisMod",
541 "UABuldRotationZAxisMod",
542 "UABuldCoordModCycle",
543 "UABuldSampleTerrainHeight",
544 "UABuldSetTerrainHeight",
549 "UABuldBrushRatioUp",
550 "UABuldBrushRatioDown",
551 "UABuldBrushOuterUp",
552 "UABuldBrushOuterDown",
553 "UABuldBrushStrengthUp",
554 "UABuldBrushStrengthDown",
555 "UABuldToggleNearestObjectArrow",
556 "UABuldCycleBrushMod",
557 "UABuldSelectionType",
558 "UABuldCreateLastSelectedObject",
559 "UABuldDuplicateSelection",
560 "UABuldDeleteSelection",
580 "UABuldViewerMoveForward",
581 "UABuldViewerMoveBack",
582 "UABuldViewerMoveLeft",
583 "UABuldViewerMoveRight",
584 "UABuldViewerMoveUp",
585 "UABuldViewerMoveDown",
586 "UABuldObjectRotateLeft",
587 "UABuldObjectRotateRight",
588 "UABuldObjectRotateForward",
589 "UABuldObjectRotateBack",
590 "UABuldPreviousAnimation",
591 "UABuldNextAnimation",
592 "UABuldRecedeAnimation",
593 "UABuldAdvanceAnimation"
598 inputExcludes.Remove(0);
601 g_Game.GetMission().AddActiveInputExcludes(inputExcludes);
608class ScriptConsoleToolTipEventHandler : ScriptedWidgetEventHandler
633 m_Timer.Run(0.1,
this,
"Tick", NULL,
true);
647 if (!
m_Root.IsVisibleHierarchy())
664 m_HintWidgetRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/script_console/script_console_hint.layout");
674 int screenW, screenH;
680 float relativeX = mouseX / screenW;
681 float relativeY = mouseY / screenH;
686 offsetX = -width - offsetX;
688 offsetY = -height - offsetY;
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
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)
proto void GetScreenSize(out int x, out int y)
proto void GetMousePos(out int x, out int y)
PluginConfigDebugProfile m_ConfigDebugProfile
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
int ARGB(int a, int r, int g, int b)
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 ScriptConsoleWeatherTab(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)