summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-11 00:54:06 +0000
committerdarkvater <darkvater@openttd.org>2005-01-11 00:54:06 +0000
commit5fac6142e849c08279a893f24fe50e5840e94813 (patch)
treee10943405d0221995867614d413adaef452ac9b6 /main_gui.c
parent085563653fb49794ca2c0ef09f544b08a80012f9 (diff)
downloadopenttd-5fac6142e849c08279a893f24fe50e5840e94813.tar.xz
(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.
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c44
1 files changed, 25 insertions, 19 deletions
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);