|
@@ -309,25 +309,27 @@ enum RailToolbarWidgets {
|
|
|
RTW_BUILD_TUNNEL,
|
|
|
RTW_REMOVE,
|
|
|
RTW_CONVERT_RAIL,
|
|
|
};
|
|
|
|
|
|
|
|
|
/** Toggles state of the Remove button of Build rail toolbar
|
|
|
/**
|
|
|
* Toggles state of the Remove button of Build rail toolbar
|
|
|
* @param w window the button belongs to
|
|
|
*/
|
|
|
static void ToggleRailButton_Remove(Window *w)
|
|
|
{
|
|
|
DeleteWindowById(WC_SELECT_STATION, 0);
|
|
|
w->ToggleWidgetLoweredState(RTW_REMOVE);
|
|
|
w->SetWidgetDirty(RTW_REMOVE);
|
|
|
_remove_button_clicked = w->IsWidgetLowered(RTW_REMOVE);
|
|
|
SetSelectionRed(_remove_button_clicked);
|
|
|
}
|
|
|
|
|
|
/** Updates the Remove button because of Ctrl state change
|
|
|
/**
|
|
|
* Updates the Remove button because of Ctrl state change
|
|
|
* @param w window the button belongs to
|
|
|
* @return true iff the remove buton was changed
|
|
|
*/
|
|
|
static bool RailToolbar_CtrlChanged(Window *w)
|
|
|
{
|
|
|
if (w->IsWidgetDisabled(RTW_REMOVE)) return false;
|
|
@@ -632,13 +634,14 @@ struct BuildRailToolbarWindow : Window {
|
|
|
|
|
|
~BuildRailToolbarWindow()
|
|
|
{
|
|
|
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
|
|
|
}
|
|
|
|
|
|
/** Configures the rail toolbar for railtype given
|
|
|
/**
|
|
|
* Configures the rail toolbar for railtype given
|
|
|
* @param railtype the railtype to display
|
|
|
*/
|
|
|
void SetupRailToolbar(RailType railtype)
|
|
|
{
|
|
|
this->railtype = railtype;
|
|
|
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
|
|
@@ -651,13 +654,14 @@ struct BuildRailToolbarWindow : Window {
|
|
|
this->GetWidget<NWidgetCore>(RTW_AUTORAIL)->widget_data = rti->gui_sprites.auto_rail;
|
|
|
this->GetWidget<NWidgetCore>(RTW_BUILD_DEPOT)->widget_data = rti->gui_sprites.build_depot;
|
|
|
this->GetWidget<NWidgetCore>(RTW_CONVERT_RAIL)->widget_data = rti->gui_sprites.convert_rail;
|
|
|
this->GetWidget<NWidgetCore>(RTW_BUILD_TUNNEL)->widget_data = rti->gui_sprites.build_tunnel;
|
|
|
}
|
|
|
|
|
|
/** Switch to another rail type.
|
|
|
/**
|
|
|
* Switch to another rail type.
|
|
|
* @param railtype New rail type.
|
|
|
*/
|
|
|
void ModifyRailType(RailType railtype)
|
|
|
{
|
|
|
this->SetupRailToolbar(railtype);
|
|
|
this->ReInit();
|
|
@@ -1936,13 +1940,14 @@ bool ResetSignalVariant(int32 p = 0)
|
|
|
_cur_signal_variant = new_variant;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/** Resets the rail GUI - sets default railtype to build
|
|
|
/**
|
|
|
* Resets the rail GUI - sets default railtype to build
|
|
|
* and resets the signal GUI
|
|
|
*/
|
|
|
void InitializeRailGUI()
|
|
|
{
|
|
|
SetDefaultRailGui();
|
|
|
|