From 5fac6142e849c08279a893f24fe50e5840e94813 Mon Sep 17 00:00:00 2001 From: darkvater Date: Tue, 11 Jan 2005 00:54:06 +0000 Subject: (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu) -Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while -These values are saved in hs.dat; added read/write functions for it -Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game. --- main_gui.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'main_gui.c') diff --git a/main_gui.c b/main_gui.c index 82136abda..77c9d680e 100644 --- a/main_gui.c +++ b/main_gui.c @@ -2402,24 +2402,7 @@ void SetupColorsAndInitialWindow() w = AllocateWindow(0, 0, width, height, MainWindowWndProc, 0, NULL); AssignWindowViewport(w, 0, 0, width, height, 0x8080, 0); - w = AllocateWindowDesc(&_toolb_normal_desc); - w->disabled_state = 1 << 17; // disable zoon-in button (by default game is zoomed in) - - if (_networking) { // if networking, disable fast-forward button - w->disabled_state |= (1 << 1); - if (!_network_server) // if not server, disable pause button - w->disabled_state |= (1 << 0); - } - - w->flags4 &= ~WF_WHITE_BORDER_MASK; - - PositionMainToolbar(w); // already WC_MAIN_TOOLBAR passed (&_toolb_normal_desc) - - _main_status_desc.top = height - 12; - w = AllocateWindowDesc(&_main_status_desc); - w->flags4 &= ~WF_WHITE_BORDER_MASK; - - WP(w,def_d).data_1 = -1280; + ShowVitalWindows(); /* Bring joining GUI to front till the client is really joined */ if (_networking && !_network_server) @@ -2432,7 +2415,7 @@ void SetupColorsAndInitialWindow() w = AllocateWindowDesc(&_toolb_scen_desc); w->disabled_state = 1 << 9; - w->flags4 &= ~WF_WHITE_BORDER_MASK; + CLRBITS(w->flags4, WF_WHITE_BORDER_MASK); PositionMainToolbar(w); // already WC_MAIN_TOOLBAR passed (&_toolb_scen_desc) break; @@ -2441,6 +2424,29 @@ void SetupColorsAndInitialWindow() } } +void ShowVitalWindows(void) +{ + Window *w; + + w = AllocateWindowDesc(&_toolb_normal_desc); + w->disabled_state = 1 << 17; // disable zoom-in button (by default game is zoomed in) + CLRBITS(w->flags4, WF_WHITE_BORDER_MASK); + + if (_networking) { // if networking, disable fast-forward button + SETBIT(w->disabled_state, 1); + if (!_network_server) // if not server, disable pause button + SETBIT(w->disabled_state, 0); + } + + PositionMainToolbar(w); // already WC_MAIN_TOOLBAR passed (&_toolb_normal_desc) + + _main_status_desc.top = _screen.height - 12; + w = AllocateWindowDesc(&_main_status_desc); + CLRBITS(w->flags4, WF_WHITE_BORDER_MASK); + + WP(w,def_d).data_1 = -1280; +} + void GameSizeChanged() { RelocateAllWindows(_screen.width, _screen.height); -- cgit v1.2.3-54-g00ecf