MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / update

Function update

src/OpenLoco/src/Ui/Windows/ToolTip.cpp:202–225  ·  view source on GitHub ↗

0x004C9216

Source from the content-addressed store, hash-verified

200
201 // 0x004C9216
202 void update(Ui::Window* window, int32_t widgetIndex, StringId stringId, int32_t cursorX, int32_t cursorY)
203 {
204 WindowManager::close(WindowType::tooltip, 0);
205
206 Ui::ToolTip::setWindowType(window->type);
207 Ui::ToolTip::setWindowNumber(window->number);
208 Ui::ToolTip::setWidgetIndex(widgetIndex);
209
210 auto toolArgs = window->callTooltip(widgetIndex, window->widgets[widgetIndex].id);
211 if (!toolArgs)
212 {
213 return;
214 }
215
216 auto wnd = WindowManager::find(WindowType::error, 0);
217 if (wnd != nullptr)
218 {
219 return;
220 }
221
222 Ui::ToolTip::setCurrentStringId(stringId);
223
224 common(window, widgetIndex, stringId, cursorX, cursorY, *toolArgs);
225 }
226
227 // 0x004C9397
228 static void draw(Ui::Window& window, Gfx::DrawingContext& drawingCtx)

Callers 2

openFunction · 0.70
openFunction · 0.70

Calls 9

setWindowTypeFunction · 0.85
setWindowNumberFunction · 0.85
setWidgetIndexFunction · 0.85
findFunction · 0.85
setCurrentStringIdFunction · 0.85
commonFunction · 0.85
setNotShownTicksFunction · 0.85
callTooltipMethod · 0.80
closeFunction · 0.70

Tested by

no test coverage detected