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

Function toolSet

src/OpenLoco/src/Ui/ToolManager.cpp:61–83  ·  view source on GitHub ↗

0x004CE367 tool (al) widgetIndex (dx) w (esi)

Source from the content-addressed store, hash-verified

59 // widgetIndex (dx)
60 // w (esi)
61 bool toolSet(const Ui::Window& w, int16_t widgetIndex, CursorId cursorId)
62 {
63 if (Input::hasFlag(Input::Flags::toolActive))
64 {
65 if (w.type == _toolWindowType && w.number == _toolWindowNumber && widgetIndex == _toolWidgetIndex)
66 {
67 toolCancel();
68 return false;
69 }
70 else
71 {
72 toolCancel();
73 }
74 }
75
76 Input::setFlag(Input::Flags::toolActive);
77 Input::resetFlag(Input::Flags::flag6);
78 ToolManager::setToolCursor(cursorId);
79 ToolManager::setToolWindowType(w.type);
80 ToolManager::setToolWindowNumber(w.number);
81 ToolManager::setToolWidgetIndex(widgetIndex);
82 return true;
83 }
84
85 // 0x004CE3D6
86 void toolCancel()

Callers 14

tabResetFunction · 0.85
paintToolBeginFunction · 0.85
onUpdateFunction · 0.85
onPickupFunction · 0.85
tabResetFunction · 0.85
tabResetFunction · 0.85
openFunction · 0.85
activateMapSelectionToolFunction · 0.85
onMouseDownFunction · 0.85
onMouseUpFunction · 0.85
onToolUpFunction · 0.85
onMouseDownFunction · 0.85

Calls 8

setToolCursorFunction · 0.85
setToolWindowTypeFunction · 0.85
setToolWindowNumberFunction · 0.85
setToolWidgetIndexFunction · 0.85
toolCancelFunction · 0.70
hasFlagFunction · 0.50
setFlagFunction · 0.50
resetFlagFunction · 0.50

Tested by 1

activateMapSelectionToolFunction · 0.68