* * rct2: 0x006EE212 * * @param tool (al) * @param widgetIndex (dx) * @param w (esi) */
| 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 | * |