From c9d6ea2570c3b9460e0a239dc7bbd1620ab46e72 Mon Sep 17 00:00:00 2001 From: darkvater Date: Sun, 23 Jan 2005 15:25:17 +0000 Subject: (svn r1617) -Fix: Ugly hack to only call ResetObjectToPlaceon childwindows of build-toolbar if the window is closed manually (with 'X'); if not checked ResetObjectToPlace is called twice resulting in undesired actions (eg. clicked button is unclicked immediately). --- rail_gui.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'rail_gui.c') diff --git a/rail_gui.c b/rail_gui.c index bd6f37990..18f249b78 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -761,9 +761,6 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) { case WE_CLICK: { switch(e->click.widget) { - case 0: - ResetObjectToPlace(); - break; case 3: case 4: _railstation.orientation = e->click.widget - 3; @@ -821,7 +818,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) { } break; case WE_DESTROY: - ResetObjectToPlace(); + if (!WP(w,def_d).close) + ResetObjectToPlace(); break; } } @@ -888,13 +886,7 @@ static void BuildTrainDepotWndProc(Window *w, WindowEvent *e) } case WE_CLICK: { switch(e->click.widget) { - case 0: - ResetObjectToPlace(); - break; - case 3: - case 4: - case 5: - case 6: + case 3: case 4: case 5: case 6: _build_depot_direction = e->click.widget - 3; SndPlayFx(SND_15_BEEP); SetWindowDirty(w); @@ -908,7 +900,8 @@ static void BuildTrainDepotWndProc(Window *w, WindowEvent *e) return; case WE_DESTROY: - ResetObjectToPlace(); + if (!WP(w,def_d).close) + ResetObjectToPlace(); break; } } -- cgit v1.2.3-54-g00ecf