Add a button to show/hide advanced(block) signal types

This commit is contained in:
dP
2025-09-28 15:20:19 +05:00
parent 569657e904
commit c19d61bdac
3 changed files with 22 additions and 0 deletions

View File

@@ -6431,3 +6431,5 @@ CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_ROAD_VEHICLE :{BLACK}Show
CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_SHIP :{BLACK}Show hidden ({NUM})
CM_STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT :{BLACK}Show hidden ({NUM})
CM_STR_SHOW_BLOCK_SIGNAL_TOOLTIP :Show advanced signal types
CM_STR_HIDE_BLOCK_SIGNAL_TOOLTIP :Hide advanced signal types

View File

@@ -1688,6 +1688,7 @@ private:
this->GetWidget<NWidgetStacked>(WID_BS_BLOCK_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
this->GetWidget<NWidgetStacked>(WID_BS_BLOCK_SPACER_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : SZSP_NONE);
this->GetWidget<NWidgetStacked>(CM_WID_BS_BLOCK_BUTTON_SEL)->SetDisplayedPlane(show_non_path_signals ? 0 : 1);
}
public:
@@ -1810,6 +1811,18 @@ public:
}
break;
case CM_WID_BS_HIDE_BLOCK:
_settings_client.gui.signal_gui_mode = SIGNAL_GUI_PATH;
this->SetSignalUIMode();
this->ReInit();
break;
case CM_WID_BS_SHOW_BLOCK:
_settings_client.gui.signal_gui_mode = SIGNAL_GUI_ALL;
this->SetSignalUIMode();
this->ReInit();
break;
default: break;
}
@@ -1843,6 +1856,10 @@ static constexpr NWidgetPart _nested_signal_builder_widgets[] = {
/* Container for both signal groups, spacers, and convert/autofill buttons. */
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SELECTION, INVALID_COLOUR, CM_WID_BS_BLOCK_BUTTON_SEL),
NWidget(WWT_PUSHARROWBTN, COLOUR_DARK_GREEN, CM_WID_BS_HIDE_BLOCK), SetMinimalSize(9, 12), SetArrowWidgetTypeTip(AWV_DECREASE, CM_STR_HIDE_BLOCK_SIGNAL_TOOLTIP), SetFill(0, 1),
NWidget(WWT_PUSHARROWBTN, COLOUR_DARK_GREEN, CM_WID_BS_SHOW_BLOCK), SetMinimalSize(9, 12), SetArrowWidgetTypeTip(AWV_INCREASE, CM_STR_SHOW_BLOCK_SIGNAL_TOOLTIP), SetFill(0, 1),
EndContainer(),
/* Block signals (can be hidden). */
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BS_BLOCK_SEL),
NWidget(NWID_VERTICAL, NWidContainerFlag::EqualSize),

View File

@@ -88,6 +88,9 @@ enum BuildSignalWidgets : WidgetID {
WID_BS_DRAG_SIGNALS_DENSITY_INCREASE, ///< Increase the signal density.
WID_BS_BLOCK_SEL, ///< Container for the block signal group, which can be hidden.
WID_BS_BLOCK_SPACER_SEL, ///< Container for the spacer between block and path signal groups, which can be hidden.
CM_WID_BS_BLOCK_BUTTON_SEL, ///< Container for show/hide block signal group buttons.
CM_WID_BS_SHOW_BLOCK, ///< Button for showing block signal group.
CM_WID_BS_HIDE_BLOCK, ///< Button for hiding block signal group.
};
/** Widgets of the #BuildRailDepotWindow class. */