diff options
author | Darkvater <darkvater@openttd.org> | 2006-12-30 01:52:09 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-12-30 01:52:09 +0000 |
commit | f475636186a7c4d3aac9ae8998cdd3cd9f3983f9 (patch) | |
tree | 1966fa0f816ba2f76eb61aa26361eda5de1eb0eb /main_gui.c | |
parent | c87fcab77216fa2a3c8a5a334c32099665b1241d (diff) | |
download | openttd-f475636186a7c4d3aac9ae8998cdd3cd9f3983f9.tar.xz |
(svn r7638) -Codechange: Remove special window ShowJoinStatusWindowAfterJoin and shuffle around
some code for SetupColorsAndInitialWindow. Because we know that after a successful
load all windows are removed we can setup default windows in this function, and
show ShowJoinStatusWindow in PACKET_SERVER_MAP.
-Setup the global _network_join_status for ShowJoinStatusWindow in the only two
places where the function is called, instead of inside it.
-Turn the join status window into a modal window of the network window so it
stays on top.
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/main_gui.c b/main_gui.c index bf991e88f..caebe5afa 100644 --- a/main_gui.c +++ b/main_gui.c @@ -2359,7 +2359,6 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) void ShowSelectGameWindow(void); -extern void ShowJoinStatusWindowAfterJoin(void); void SetupColorsAndInitialWindow(void) { @@ -2377,32 +2376,20 @@ void SetupColorsAndInitialWindow(void) width = _screen.width; height = _screen.height; + w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL); + AssignWindowViewport(w, 0, 0, width, height, TileXY(32, 32), 0); + // XXX: these are not done switch (_game_mode) { - case GM_MENU: - w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL); - AssignWindowViewport(w, 0, 0, width, height, TileXY(32, 32), 0); - ShowSelectGameWindow(); - break; - case GM_NORMAL: - w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL); - AssignWindowViewport(w, 0, 0, width, height, TileXY(32, 32), 0); - - ShowVitalWindows(); - - /* Bring joining GUI to front till the client is really joined */ - if (_networking && !_network_server) - ShowJoinStatusWindowAfterJoin(); - - break; - case GM_EDITOR: - w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL); - AssignWindowViewport(w, 0, 0, width, height, 0, 0); + default: NOT_REACHED(); + case GM_MENU: + ShowSelectGameWindow(); + break; - ShowVitalWindows(); - break; - default: - NOT_REACHED(); + case GM_NORMAL: + case GM_EDITOR: + ShowVitalWindows(); + break; } } |