MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / focus

Method focus

src/openrct2-ui/scripting/ScWidget.hpp:1096–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094 }
1095
1096 static JSValue focus(JSContext* ctx, JSValue thisVal, int argc, JSValue* argv)
1097 {
1098 WidgetData data = GetWidgetData(thisVal);
1099 auto w = GetWindow(data._class, data._number);
1100 auto wPtr = GetWidget(w, data._widgetIndex);
1101 if (IsCustomWindow(w) && wPtr)
1102 {
1103 Ui::Windows::WindowStartTextbox(
1104 *w, data._widgetIndex, wPtr->string, Ui::Windows::GetWidgetMaxLength(w, data._widgetIndex));
1105 }
1106 return JS_UNDEFINED;
1107 }
1108 };
1109
1110 class ScViewportWidget : public ScWidget

Callers

nothing calls this directly

Calls 3

GetWindowFunction · 0.85
WindowStartTextboxFunction · 0.85
GetWidgetMaxLengthFunction · 0.85

Tested by

no test coverage detected