foxygit / doom Log in
commit 88b562df34f7843a5146203962c11ce18c6656ce
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Oct 24 20:10:23 2014 -0400
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Oct 24 20:10:23 2014 -0400

    Proceed by pressing enter at netgame warning screen.

    If there's some discrepancy between clients who are to play a game
    together, a warning dialog is displayed. To acknowledge this message
    and proceed, make the user press enter, not escape, which is
    counter-intuitive.

    This fixes #453 (thanks Alexandre-Xavier).
---
 src/net_gui.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/net_gui.c b/src/net_gui.c
index 8a05b635..da4afc8f 100644
--- a/src/net_gui.c
+++ b/src/net_gui.c
@@ -249,11 +249,19 @@ static void PrintSHA1Digest(char *s, byte *digest)
     printf("\n");
 }

+static void CloseWindow(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(window))
+{
+    TXT_CAST_ARG(txt_window_t, window);
+
+    TXT_CloseWindow(window);
+}
+
 static void CheckSHA1Sums(void)
 {
     boolean correct_wad, correct_deh;
     boolean same_freedoom;
     txt_window_t *window;
+    txt_window_action_t *cont_button;

     if (!net_client_received_wait_data || had_warning)
     {
@@ -295,8 +303,13 @@ static void CheckSHA1Sums(void)
         PrintSHA1Digest("Server", net_client_wait_data.deh_sha1sum);
     }

-    window = TXT_NewWindow("WARNING");
+    window = TXT_NewWindow("WARNING!");
+
+    cont_button = TXT_NewWindowAction(KEY_ENTER, "Continue");
+    TXT_SignalConnect(cont_button, "pressed", CloseWindow, window);

+    TXT_SetWindowAction(window, TXT_HORIZ_LEFT, NULL);
+    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, cont_button);
     TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);

     if (!same_freedoom)