Fix road/rail station building buttons malfunction when switching from other tool

This commit is contained in:
dP
2025-12-14 16:16:29 +05:00
parent d8a07b6ea2
commit 0586e48c3b
2 changed files with 2 additions and 5 deletions

View File

@@ -2893,8 +2893,6 @@ bool HandlePlacePushButton(Window *w, WidgetID widget, up<Tool> tool) {
return false; return false;
} }
w->LowerWidget(widget);
auto icon = tool->GetCursor(); auto icon = tool->GetCursor();
if ((icon & ANIMCURSOR_FLAG) != 0) { if ((icon & ANIMCURSOR_FLAG) != 0) {
SetAnimatedMouseCursor(_animcursors[icon & ~ANIMCURSOR_FLAG]); SetAnimatedMouseCursor(_animcursors[icon & ~ANIMCURSOR_FLAG]);
@@ -2904,9 +2902,9 @@ bool HandlePlacePushButton(Window *w, WidgetID widget, up<Tool> tool) {
citymania::SetActiveTool(std::move(tool)); citymania::SetActiveTool(std::move(tool));
_thd.window_class = w->window_class; _thd.window_class = w->window_class;
_thd.window_number = w->window_number; _thd.window_number = w->window_number;
w->LowerWidget(widget);
return true; return true;
} }
} // namespace citymania } // namespace citymania

View File

@@ -569,8 +569,7 @@ struct BuildRoadToolbarWindow : Window {
default: NOT_REACHED(); default: NOT_REACHED();
} }
citymania::RoadToolbar_UpdateOptionWidgetStatus(this, widget, _remove_button_clicked, RoadTypeIsRoad(this->roadtype)); citymania::RoadToolbar_UpdateOptionWidgetStatus(this, widget, _remove_button_clicked, RoadTypeIsRoad(this->roadtype));
// this->UpdateOptionWidgetStatus((RoadToolbarWidgets)widget); //this->UpdateOptionWidgetStatus((RoadToolbarWidgets)widget);
// if (citymania::_remove_mod) RoadToolbar_CtrlChanged(this);
} }
EventState OnHotkey(int hotkey) override EventState OnHotkey(int hotkey) override