mirror of https://github.com/OpenTTD/OpenTTD
(svn r23331) -Fix [FS#4851] (rCS, r148): abort building/moving HQ when clicking on the button again, just like when building rail, stations, etc (sbr)
parent
61abe29108
commit
a9bdd04072
|
@ -2001,6 +2001,11 @@ struct CompanyWindow : Window
|
||||||
|
|
||||||
case CW_WIDGET_BUILD_HQ:
|
case CW_WIDGET_BUILD_HQ:
|
||||||
if ((byte)this->window_number != _local_company) return;
|
if ((byte)this->window_number != _local_company) return;
|
||||||
|
if (this->IsWidgetLowered(CW_WIDGET_BUILD_HQ)) {
|
||||||
|
ResetObjectToPlace();
|
||||||
|
this->RaiseButtons();
|
||||||
|
break;
|
||||||
|
}
|
||||||
SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, HT_RECT, this);
|
SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, HT_RECT, this);
|
||||||
SetTileSelectSize(2, 2);
|
SetTileSelectSize(2, 2);
|
||||||
this->LowerWidget(CW_WIDGET_BUILD_HQ);
|
this->LowerWidget(CW_WIDGET_BUILD_HQ);
|
||||||
|
@ -2008,6 +2013,11 @@ struct CompanyWindow : Window
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CW_WIDGET_RELOCATE_HQ:
|
case CW_WIDGET_RELOCATE_HQ:
|
||||||
|
if (this->IsWidgetLowered(CW_WIDGET_RELOCATE_HQ)) {
|
||||||
|
ResetObjectToPlace();
|
||||||
|
this->RaiseButtons();
|
||||||
|
break;
|
||||||
|
}
|
||||||
SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, HT_RECT, this);
|
SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, HT_RECT, this);
|
||||||
SetTileSelectSize(2, 2);
|
SetTileSelectSize(2, 2);
|
||||||
this->LowerWidget(CW_WIDGET_RELOCATE_HQ);
|
this->LowerWidget(CW_WIDGET_RELOCATE_HQ);
|
||||||
|
|
Loading…
Reference in New Issue