diff options
author | rubidium <rubidium@openttd.org> | 2008-08-02 22:50:22 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-02 22:50:22 +0000 |
commit | b3656c78ad6251c2ea209a95edb86e57601c500e (patch) | |
tree | abe2444a5662737afa57998c6d26279976fd2583 /src/rail_gui.cpp | |
parent | 64a576b854a62648551fdf318db00dfbfc4369f5 (diff) | |
download | openttd-b3656c78ad6251c2ea209a95edb86e57601c500e.tar.xz |
(svn r13938) -Codechange [YAPP]: Add the new signals to the build signal GUI. (michi_cc)
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r-- | src/rail_gui.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 3b5d9dfde..d091e11c1 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1354,10 +1354,14 @@ enum BuildSignalWidgets { BSW_SEMAPHORE_ENTRY, BSW_SEMAPHORE_EXIT, BSW_SEMAPHORE_COMBO, + BSW_SEMAPHORE_PBS, + BSW_SEMAPHORE_PBS_OWAY, BSW_ELECTRIC_NORM, BSW_ELECTRIC_ENTRY, BSW_ELECTRIC_EXIT, BSW_ELECTRIC_COMBO, + BSW_ELECTRIC_PBS, + BSW_ELECTRIC_PBS_OWAY, BSW_CONVERT, BSW_DRAG_SIGNALS_DENSITY, BSW_DRAG_SIGNALS_DENSITY_DECREASE, @@ -1404,10 +1408,14 @@ public: this->DrawSignalSprite(BSW_SEMAPHORE_ENTRY, SPR_IMG_SIGNAL_SEMAPHORE_ENTRY, -1, 13); // xsize of sprite + 1 == 10 this->DrawSignalSprite(BSW_SEMAPHORE_EXIT, SPR_IMG_SIGNAL_SEMAPHORE_EXIT, 0, 12); // xsize of sprite + 1 == 9 this->DrawSignalSprite(BSW_SEMAPHORE_COMBO, SPR_IMG_SIGNAL_SEMAPHORE_COMBO, 0, 12); // xsize of sprite + 1 == 9 + this->DrawSignalSprite(BSW_SEMAPHORE_PBS, SPR_IMG_SIGNAL_SEMAPHORE_PBS, 0, 12); // xsize of sprite + 1 == 9 + this->DrawSignalSprite(BSW_SEMAPHORE_PBS_OWAY, SPR_IMG_SIGNAL_SEMAPHORE_PBSOWAY, -1, 13); // xsize of sprite + 1 == 10 this->DrawSignalSprite(BSW_ELECTRIC_NORM, SPR_IMG_SIGNAL_ELECTRIC_NORM, -1, 4); this->DrawSignalSprite(BSW_ELECTRIC_ENTRY, SPR_IMG_SIGNAL_ELECTRIC_ENTRY, -2, 6); this->DrawSignalSprite(BSW_ELECTRIC_EXIT, SPR_IMG_SIGNAL_ELECTRIC_EXIT, -2, 6); this->DrawSignalSprite(BSW_ELECTRIC_COMBO, SPR_IMG_SIGNAL_ELECTRIC_COMBO, -2, 6); + this->DrawSignalSprite(BSW_ELECTRIC_PBS, SPR_IMG_SIGNAL_ELECTRIC_PBS, -1, 4); + this->DrawSignalSprite(BSW_ELECTRIC_PBS_OWAY,SPR_IMG_SIGNAL_ELECTRIC_OBSOWAY,-2, 6); /* Draw dragging signal density value in the BSW_DRAG_SIGNALS_DENSITY widget */ SetDParam(0, _settings_client.gui.drag_signals_density); @@ -1423,13 +1431,17 @@ public: case BSW_SEMAPHORE_ENTRY: case BSW_SEMAPHORE_EXIT: case BSW_SEMAPHORE_COMBO: + case BSW_SEMAPHORE_PBS: + case BSW_SEMAPHORE_PBS_OWAY: case BSW_ELECTRIC_NORM: case BSW_ELECTRIC_ENTRY: case BSW_ELECTRIC_EXIT: case BSW_ELECTRIC_COMBO: + case BSW_ELECTRIC_PBS: + case BSW_ELECTRIC_PBS_OWAY: this->RaiseWidget((_cur_signal_variant == SIG_ELECTRIC ? BSW_ELECTRIC_NORM : BSW_SEMAPHORE_NORM) + _cur_signal_type); - _cur_signal_type = (SignalType)((uint)((widget - BSW_SEMAPHORE_NORM) % (SIGTYPE_COMBO + 1))); + _cur_signal_type = (SignalType)((uint)((widget - BSW_SEMAPHORE_NORM) % (SIGTYPE_LAST + 1))); _cur_signal_variant = widget >= BSW_ELECTRIC_NORM ? SIG_ELECTRIC : SIG_SEMAPHORE; break; @@ -1461,29 +1473,33 @@ public: /** Widget definition of the build signal window */ static const Widget _signal_builder_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // BSW_CLOSEBOX -{ WWT_CAPTION, RESIZE_NONE, COLOUR_DARK_GREEN, 11, 109, 0, 13, STR_SIGNAL_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // BSW_CAPTION +{ WWT_CAPTION, RESIZE_NONE, COLOUR_DARK_GREEN, 11, 152, 0, 13, STR_SIGNAL_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // BSW_CAPTION { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 21, 14, 40, STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_NORM_TIP}, // BSW_SEMAPHORE_NORM { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 22, 43, 14, 40, STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TIP}, // BSW_SEMAPHORE_ENTRY { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 44, 65, 14, 40, STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TIP}, // BSW_SEMAPHORE_EXIT { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 66, 87, 14, 40, STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TIP}, // BSW_SEMAPHORE_COMBO +{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 88, 109, 14, 40, STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_PBS_TIP}, // BSW_SEMAPHORE_PBS +{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 109, 130, 14, 40, STR_NULL, STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TIP},// BSW_SEMAPHORE_PBS_OWAY { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 21, 41, 67, STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_NORM_TIP}, // BSW_ELECTRIC_NORM { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 22, 43, 41, 67, STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TIP}, // BSW_ELECTRIC_ENTRY { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 44, 65, 41, 67, STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_EXIT_TIP}, // BSW_ELECTRIC_EXIT { WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 66, 87, 41, 67, STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_COMBO_TIP}, // BSW_ELECTRIC_COMBO +{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 88, 109, 41, 67, STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_PBS_TIP}, // BSW_ELECTRIC_PBS +{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 109, 130, 41, 67, STR_NULL, STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TIP},// BSW_ELECTRIC_PBS_OWAY -{ WWT_IMGBTN, RESIZE_NONE, COLOUR_DARK_GREEN, 88, 109, 14, 40, SPR_IMG_SIGNAL_CONVERT, STR_SIGNAL_CONVERT_TIP}, // BSW_CONVERT -{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 88, 109, 41, 67, STR_NULL, STR_DRAG_SIGNALS_DENSITY_TIP}, // BSW_DRAG_SIGNALS_DENSITY -{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 90, 98, 54, 65, SPR_ARROW_LEFT, STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP}, // BSW_DRAG_SIGNALS_DENSITY_DECREASE -{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 99, 107, 54, 65, SPR_ARROW_RIGHT, STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP}, // BSW_DRAG_SIGNALS_DENSITY_INCREASE +{ WWT_IMGBTN, RESIZE_NONE, COLOUR_DARK_GREEN, 131, 152, 14, 40, SPR_IMG_SIGNAL_CONVERT, STR_SIGNAL_CONVERT_TIP}, // BSW_CONVERT +{ WWT_PANEL, RESIZE_NONE, COLOUR_DARK_GREEN, 131, 152, 41, 67, STR_NULL, STR_DRAG_SIGNALS_DENSITY_TIP}, // BSW_DRAG_SIGNALS_DENSITY +{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 133, 141, 54, 65, SPR_ARROW_LEFT, STR_DRAG_SIGNALS_DENSITY_DECREASE_TIP}, // BSW_DRAG_SIGNALS_DENSITY_DECREASE +{ WWT_PUSHIMGBTN, RESIZE_NONE, COLOUR_GREY, 142, 150, 54, 65, SPR_ARROW_RIGHT, STR_DRAG_SIGNALS_DENSITY_INCREASE_TIP}, // BSW_DRAG_SIGNALS_DENSITY_INCREASE { WIDGETS_END}, }; /** Signal selection window description */ static const WindowDesc _signal_builder_desc = { - WDP_AUTO, WDP_AUTO, 110, 68, 110, 68, + WDP_AUTO, WDP_AUTO, 153, 68, 153, 68, WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _signal_builder_widgets, @@ -1779,6 +1795,6 @@ void InitializeRailGUI() SetDefaultRailGui(); _convert_signal_button = false; - _cur_signal_type = SIGTYPE_NORMAL; + _cur_signal_type = _default_signal_type[_settings_client.gui.default_signal_type]; ResetSignalVariant(); } |