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

Function UpdateWidgetText

src/openrct2-ui/scripting/CustomWindow.cpp:1185–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183 }
1184
1185 void UpdateWidgetText(WindowBase* w, WidgetIndex widgetIndex, std::string_view value)
1186 {
1187 if (w->classification == WindowClass::custom)
1188 {
1189 auto& customInfo = GetInfo(static_cast<CustomWindow*>(w));
1190 auto customWidgetInfo = customInfo.GetCustomWidgetDesc(w, widgetIndex);
1191 if (customWidgetInfo != nullptr)
1192 {
1193 customWidgetInfo->Text = value;
1194 w->widgets[widgetIndex].string = customWidgetInfo->Text.data();
1195
1196 auto* windowMgr = GetWindowManager();
1197 windowMgr->InvalidateWidget(*w, widgetIndex);
1198 }
1199 }
1200 }
1201
1202 void UpdateWidgetItems(WindowBase* w, WidgetIndex widgetIndex, const std::vector<std::string>& items)
1203 {

Callers 2

onTextInputMethod · 0.85
text_setMethod · 0.85

Calls 4

GetWindowManagerFunction · 0.85
GetCustomWidgetDescMethod · 0.80
InvalidateWidgetMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected