From 240f973f0cc3769166fa9f33da6f1ae789526fe9 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 20 Dec 2016 23:03:06 -0500 Subject: [PATCH] - Implemented Gez's suggestion for disable autoload checkbox on the IWAD selection box. (cherry picked from commit 578e3270e20f6b0dc6dba7e1001c95a963acc283) --- src/d_main.cpp | 4 +++- src/win32/i_system.cpp | 6 ++++++ src/win32/resource.h | 3 +++ src/win32/zdoom.rc | 11 ++++++----- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 04ba34cbb..2b8ff7437 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -205,6 +205,8 @@ CUSTOM_CVAR (String, vid_cursor, "None", CVAR_ARCHIVE | CVAR_NOINITCALL) } } +bool disableautoload = false; // [SP] No auto load + bool wantToRestart; bool DrawFSHUD; // [RH] Draw fullscreen HUD? TArray allwads; @@ -2038,7 +2040,7 @@ static void AddAutoloadFiles(const char *autoname) { LumpFilterIWAD.Format("%s.", autoname); // The '.' is appened to simplify parsing the string - if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload")) + if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload") && !disableautoload) { FString file; diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index ebb3d8c67..52f054dc2 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -130,6 +130,7 @@ EXTERN_CVAR (Bool, queryiwad); // Used on welcome/IWAD screen. EXTERN_CVAR (Int, vid_renderer) EXTERN_CVAR (Bool, fullscreen) +extern bool disableautoload; extern HWND Window, ConWindow, GameTitleWindow; extern HANDLE StdOut; @@ -1169,6 +1170,7 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // Check the current video settings. SendDlgItemMessage( hDlg, vid_renderer ? IDC_WELCOME_OPENGL : IDC_WELCOME_SOFTWARE, BM_SETCHECK, BST_CHECKED, 0 ); SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_SETCHECK, fullscreen ? BST_CHECKED : BST_UNCHECKED, 0 ); + SendDlgItemMessage( hDlg, IDC_WELCOME_NOAUTOLOAD, BM_SETCHECK, disableautoload ? BST_CHECKED : BST_UNCHECKED, 0 ); // Set up our version string. sprintf(szString, "Version %s.", GetVersionString()); @@ -1210,6 +1212,10 @@ BOOL CALLBACK IWADBoxCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // [SP] Upstreamed from Zandronum vid_renderer = SendDlgItemMessage( hDlg, IDC_WELCOME_OPENGL, BM_GETCHECK, 0, 0 ) == BST_CHECKED; fullscreen = SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_GETCHECK, 0, 0 ) == BST_CHECKED; + + // [SP] This is our's. + disableautoload = SendDlgItemMessage( hDlg, IDC_WELCOME_NOAUTOLOAD, BM_GETCHECK, 0, 0 ) == BST_CHECKED; + ctrl = GetDlgItem (hDlg, IDC_IWADLIST); EndDialog(hDlg, SendMessage (ctrl, LB_GETCURSEL, 0, 0)); } diff --git a/src/win32/resource.h b/src/win32/resource.h index 52db9de2e..937a73658 100644 --- a/src/win32/resource.h +++ b/src/win32/resource.h @@ -171,3 +171,6 @@ #define IDC_WELCOME_SOFTWARE 4021 #define IDC_WELCOME_FULLSCREEN 4022 #define IDI_ICONST 151 + +// [SP] This is our's. +#define IDC_WELCOME_NOAUTOLOAD 4023 diff --git a/src/win32/zdoom.rc b/src/win32/zdoom.rc index e64f27c4d..8b29aef9e 100644 --- a/src/win32/zdoom.rc +++ b/src/win32/zdoom.rc @@ -236,7 +236,7 @@ BEGIN END */ // [SP] Upstreamed from Zandronum -IDD_IWADDIALOG DIALOGEX 0, 0, 224, 236 +IDD_IWADDIALOG DIALOGEX 0, 0, 224, 246 STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW @@ -258,11 +258,12 @@ BEGIN BS_AUTORADIOBUTTON,12,160,93,10 CONTROL "Fullscreen",IDC_WELCOME_FULLSCREEN,"Button", BS_AUTOCHECKBOX | WS_TABSTOP, 124,160,48,10 - CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button", + CONTROL "Disable autoload",IDC_WELCOME_NOAUTOLOAD,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,72,192,87,10 - DEFPUSHBUTTON "Play QZDoom",IDOK,8,236-18,90,14 - PUSHBUTTON "Exit",IDCANCEL,224-58,236-18,50,14 - + CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,72,202,87,10 + DEFPUSHBUTTON "Play QZDoom",IDOK,8,246-18,90,14 + PUSHBUTTON "Exit",IDCANCEL,224-58,246-18,50,14 END IDD_EAXPROPERTYLIST DIALOGEX 0, 0, 265, 404