From 681e58ccc467ccaf97fc66186358af048df728c8 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 10 Jul 2008 05:37:36 +0000 Subject: [PATCH] Keep the startup window open when CON compilation fails so people can copy CON errors out of it directly without looking at eduke32.log git-svn-id: https://svn.eduke32.com/eduke32@851 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/startwin.editor.c | 7 +++++-- polymer/eduke32/source/gamedef.c | 11 +++++++++-- polymer/eduke32/source/startwin.game.c | 7 +++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/polymer/build/src/startwin.editor.c b/polymer/build/src/startwin.editor.c index 78f5ee025..345bcbc87 100755 --- a/polymer/build/src/startwin.editor.c +++ b/polymer/build/src/startwin.editor.c @@ -363,18 +363,21 @@ int startwin_close(void) int startwin_puts(const char *buf) { const char *p = NULL, *q = NULL; - char workbuf[1024]; + static char workbuf[1024]; static int newline = 0; int curlen, linesbefore, linesafter; HWND edctl; int vis; + static HWND dactrl = NULL; if (!startupdlg) return 1; edctl = pages[TAB_MESSAGES]; if (!edctl) return -1; - vis = ((int)SendMessage(GetDlgItem(startupdlg, WIN_STARTWIN_TABCTL), TCM_GETCURSEL,0,0) == TAB_MESSAGES); + if (!dactrl) dactrl = GetDlgItem(startupdlg, WIN_STARTWIN_TABCTL); + + vis = ((int)SendMessage(dactrl, TCM_GETCURSEL,0,0) == TAB_MESSAGES); if (vis) SendMessage(edctl, WM_SETREDRAW, FALSE,0); curlen = SendMessage(edctl, WM_GETTEXTLENGTH, 0,0); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 61ef89b8e..ba22cd3ca 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5163,7 +5163,7 @@ void loadefs(const char *filenam) { if (groupfile != -1 && loadfromgrouponly == 0) { - initprintf("Error(s) found in file `%s'. Do you want to use the INTERNAL DEFAULTS (y/N)?\n",filenam); +// initprintf("Error(s) found in file `%s'. Do you want to use the INTERNAL DEFAULTS (y/N)?\n",filenam); i=wm_ynbox("CON File Compilation Error", "Error(s) found in file `%s'. Do you want to use the " "INTERNAL DEFAULTS?",filenam); @@ -5174,7 +5174,14 @@ void loadefs(const char *filenam) loadfromgrouponly = 1; return; } - else gameexit(""); + else + { +#if (defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)) + while(!quitevent) // keep the window open so people can copy CON errors out of it + handleevents(); +#endif + gameexit(""); + } } } } diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index 3b13357a1..2672b57e5 100755 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -491,18 +491,21 @@ int startwin_close(void) int startwin_puts(const char *buf) { const char *p = NULL, *q = NULL; - char workbuf[1024]; + static char workbuf[1024]; static int newline = 0; int curlen, linesbefore, linesafter; HWND edctl; int vis; + static HWND dactrl = NULL; if (!startupdlg) return 1; edctl = pages[TAB_MESSAGES]; if (!edctl) return -1; - vis = ((int)SendMessage(GetDlgItem(startupdlg, WIN_STARTWIN_TABCTL), TCM_GETCURSEL,0,0) == TAB_MESSAGES); + if (!dactrl) dactrl = GetDlgItem(startupdlg, WIN_STARTWIN_TABCTL); + + vis = ((int)SendMessage(dactrl, TCM_GETCURSEL,0,0) == TAB_MESSAGES); if (vis) SendMessage(edctl, WM_SETREDRAW, FALSE,0); curlen = SendMessage(edctl, WM_GETTEXTLENGTH, 0,0);