Auto-select last used tool for railroad

This commit is contained in:
Sergii Pylypenko
2014-11-14 20:27:58 +02:00
parent fc39f895bc
commit ebe0f379a8
2 changed files with 12 additions and 1 deletions

View File

@@ -755,6 +755,16 @@ struct BuildRailToolbarWindow : Window {
DeleteWindowByClass(WC_BUILD_BRIDGE);
}
virtual void SelectLastTool()
{
// User misplaced something - activate last selected tool again
if (this->last_user_action == WIDGET_LIST_END)
return;
Point dummy = {0, 0};
this->RaiseWidget(this->last_user_action);
this->OnClick(dummy, this->last_user_action, 0);
}
virtual void OnPlacePresize(Point pt, TileIndex tile_from)
{
TileIndex tile_to = tile_from;