From: Holger Schemel Date: Tue, 26 Jun 2018 20:10:04 +0000 (+0200) Subject: added connecting to network server from setup menu without program restart X-Git-Tag: 4.1.1.0~100 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=69e307f77043b50302713c513fc29e73025dc92e;p=rocksndiamonds.git added connecting to network server from setup menu without program restart --- diff --git a/src/init.h b/src/init.h index bd4ba9c1..7a90d880 100644 --- a/src/init.h +++ b/src/init.h @@ -44,6 +44,8 @@ void InitGfxBuffers(); void InitGadgets(); void InitImageTextures(); +void InitNetworkServer(); + void DisplayExitMessage(char *, va_list); void OpenAll(void); diff --git a/src/screens.c b/src/screens.c index d545ef30..54e27e31 100644 --- a/src/screens.c +++ b/src/screens.c @@ -6447,7 +6447,27 @@ static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx) if (si->value == &setup.network_mode && setup.network_mode && !network.enabled) - Request("Please restart game to enable network games!", REQ_CONFIRM); + { + network.enabled = TRUE; + + SetGameStatus(GAME_MODE_LOADING); + SetDrawBackgroundMask(REDRAW_NONE); + + FadeOut(REDRAW_ALL); + + ClearRectangle(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); + + FadeIn(REDRAW_ALL); + + InitNetworkServer(); + + SetGameStatus(GAME_MODE_SETUP); + SetDrawBackgroundMask(REDRAW_FIELD); + + redraw_mask = REDRAW_ALL; + + DrawSetupScreen(); + } } static struct TokenInfo *getSetupInfoFinal(struct TokenInfo *setup_info_orig)