summaryrefslogtreecommitdiff
path: root/rail_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-09 13:26:15 +0000
committerDarkvater <darkvater@openttd.org>2005-05-09 13:26:15 +0000
commit2b96754673a964ba73a7ad5e508a8dfb31a0c701 (patch)
treeccbac52281216762b9143a0756b6a957443b581d /rail_gui.c
parent5f6de3e47c1418388efeabef2a312f689a288175 (diff)
downloadopenttd-2b96754673a964ba73a7ad5e508a8dfb31a0c701.tar.xz
(svn r2285) - Codechange: Fix up some of the missing things from server-checking; namely bridge-type, bridge-length, dragged end-tile (bridge/station), station_spread
- Fix: [ 1197256 ] max station spread patch < 7 does not work. Station spread was not taking into account when not using drag&drop. Fix this up, and add a callback to the settings window to immediately reflect the changes.
Diffstat (limited to 'rail_gui.c')
-rw-r--r--rail_gui.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/rail_gui.c b/rail_gui.c
index bc659196d..3a6d5a61e 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -639,14 +639,14 @@ static void HandleStationPlacement(uint start, uint end)
CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION));
}
-static void StationBuildWndProc(Window *w, WindowEvent *e) {
- int rad;
- switch(e->event) {
+static void StationBuildWndProc(Window *w, WindowEvent *e)
+{
+ switch (e->event) {
case WE_PAINT: {
+ int rad;
uint bits;
- if (WP(w,def_d).close)
- return;
+ if (WP(w,def_d).close) return;
bits = (1<<3) << ( _railstation.orientation);
if (_railstation.dragdrop) {
@@ -673,6 +673,13 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) {
if (_station_show_coverage)
SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
+ /* Update buttons for correct spread value */
+ w->disabled_state = 0;
+ for (bits = _patches.station_spread; bits < 7; bits++) {
+ SETBIT(w->disabled_state, bits + 5);
+ SETBIT(w->disabled_state, bits + 12);
+ }
+
DrawWindowWidgets(w);
StationPickerDrawSprite(39, 42, _cur_railtype, 2);
@@ -687,7 +694,7 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) {
} break;
case WE_CLICK: {
- switch(e->click.widget) {
+ switch (e->click.widget) {
case 3:
case 4:
_railstation.orientation = e->click.widget - 3;