diff options
author | darkvater <darkvater@openttd.org> | 2004-09-12 15:29:37 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-09-12 15:29:37 +0000 |
commit | 99687cf513905a04ae18dfbcbe6fd13c6cbe9694 (patch) | |
tree | 6a2158dce07948cb902981f67daff0a278fe73f2 /main_gui.c | |
parent | f64c1bda4ba0d4723974117e27452a68611d5db4 (diff) | |
download | openttd-99687cf513905a04ae18dfbcbe6fd13c6cbe9694.tar.xz |
(svn r214) -Feature: CMD_NET_INSTANT [just in time command handling over network] (sign_de)
-Fix: Only server can pause in network, action disabled for clients
-Fix: Direct Connect editbox can handle up to max ~35 characters
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/main_gui.c b/main_gui.c index 3465681c3..17acb1256 100644 --- a/main_gui.c +++ b/main_gui.c @@ -83,7 +83,9 @@ typedef void ToolbarButtonProc(Window *w); static void ToolbarPauseClick(Window *w) { - if (DoCommandP(0, _pause?0:1, 0, NULL, CMD_PAUSE)) + if (_networking && !_networking_server) { return;} // only server can pause the game + + if (DoCommandP(0, _pause?0:1, 0, NULL, CMD_PAUSE | CMD_NET_INSTANT)) SndPlayFx(0x13); } @@ -1654,14 +1656,11 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) GfxFillRect(0, 0, w->width-1, w->height-1, 0xB2); GfxFillRect(0, 0, w->width-1, w->height-1, 0x80B4); - // if networking, disable fast-forward button - if (_networking) w->disabled_state |= (1 << 1); - // if spectator, disable things if (_current_player == OWNER_SPECTATOR){ - w->disabled_state |= (1 << 0) | (1 << 19) | (1<<20) | (1<<21) | (1<<22) | (1<<23); + w->disabled_state |= (1 << 19) | (1<<20) | (1<<21) | (1<<22) | (1<<23); } else { - w->disabled_state &= ~((1 << 0) | (1 << 19) | (1<<20) | (1<<21) | (1<<22) | (1<<23)); + w->disabled_state &= ~((1 << 19) | (1<<20) | (1<<21) | (1<<22) | (1<<23)); } DrawWindowWidgets(w); @@ -2225,7 +2224,14 @@ void SetupColorsAndInitialWindow() AssignWindowViewport(w, 0, 0, width, height, 0x8080, 0); w = AllocateWindowDesc(&_toolb_normal_desc); - w->disabled_state = 1 << 17; + 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 (!_networking_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) |