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

Function ToolSet

src/openrct2/interface/Window.cpp:673–695  ·  view source on GitHub ↗

* * rct2: 0x006EE212 * * @param tool (al) * @param widgetIndex (dx) * @param w (esi) */

Source from the content-addressed store, hash-verified

671 * @param w (esi)
672 */
673 bool ToolSet(const WindowBase& w, WidgetIndex widgetIndex, Tool tool)
674 {
675 if (gInputFlags.has(InputFlag::toolActive))
676 {
677 if (w.classification == gCurrentToolWidget.windowClassification && w.number == gCurrentToolWidget.windowNumber
678 && widgetIndex == gCurrentToolWidget.widgetIndex)
679 {
680 ToolCancel();
681 return true;
682 }
683
684 ToolCancel();
685 }
686
687 gInputFlags.set(InputFlag::toolActive);
688 gInputFlags.unset(InputFlag::leftMousePressed);
689 gInputFlags.unset(InputFlag::allowRightMouseRemoval);
690 gCurrentToolId = tool;
691 gCurrentToolWidget.windowClassification = w.classification;
692 gCurrentToolWidget.windowNumber = w.number;
693 gCurrentToolWidget.widgetIndex = widgetIndex;
694 return false;
695 }
696
697 /**
698 *

Callers 15

onOpenMethod · 0.85
EnableToolMethod · 0.85
onMouseUpMethod · 0.85
ColourOnMouseUpMethod · 0.85
SetupScenerySelectionMethod · 0.85
onUpdateMethod · 0.85
ToggleSceneryWindowFunction · 0.85
SwitchToModeMethod · 0.85

Calls 4

ToolCancelFunction · 0.85
unsetMethod · 0.80
hasMethod · 0.65
setMethod · 0.65

Tested by 1

onOpenMethod · 0.68