Win32 - Hooked up SingleInstanceMode to a checkbox in GUI config.

This commit is contained in:
adelikat 2010-05-20 02:16:57 +00:00
parent b68d9a91b8
commit aa42fa2369
5 changed files with 24 additions and 6 deletions

View File

@ -1,4 +1,4 @@
19-may-2010 - ugetab - Win32 - Added single-instance mode, which makes starting a second copy of FCEUX load the file into the first, then exit. 19-may-2010 - ugetab/adelikat - Win32 - Added single-instance mode, which makes starting a second copy of FCEUX load the file into the first, then exit.Mode off by default, togglable under Config -> GUI
18-may-2010 - adelikat - Movie + loadstate errors are handled more gracefully now, more informative error messages and the movie doesn't have to stop 18-may-2010 - adelikat - Movie + loadstate errors are handled more gracefully now, more informative error messages and the movie doesn't have to stop
18-may-2010 - adelikat - Implemented a "full savestate-movie load" mode similar to the implementation in VBA-rr & SNES9x-rr. In this mode loading a savestate in read+write doesn't truncate the movie to its frame count immediately. Instead it waits until input is recording into the movie (next frame). For win32 this feature is togglable in movie options and the context menu. For SDL this is off by default and a toggle will need to be added. 18-may-2010 - adelikat - Implemented a "full savestate-movie load" mode similar to the implementation in VBA-rr & SNES9x-rr. In this mode loading a savestate in read+write doesn't truncate the movie to its frame count immediately. Instead it waits until input is recording into the movie (next frame). For win32 this feature is togglable in movie options and the context menu. For SDL this is off by default and a toggle will need to be added.
17-may-2010 - adelikat - Made gamepad 2 off by default. 17-may-2010 - adelikat - Made gamepad 2 off by default.

View File

@ -150,7 +150,7 @@ static CFGSTRUCT fceuconfig[] = {
NAC("vgamode",vmod), NAC("vgamode",vmod),
NAC("sound",soundo), NAC("sound",soundo),
NAC("sicon",status_icon), NAC("sicon",status_icon),
//adelikat - we want this behvaior //ch4: cause newppu mode fixation after changing through config file lol
AC(newppu), AC(newppu),
NACS("odroms",directory_names[0]), NACS("odroms",directory_names[0]),

View File

@ -3,6 +3,7 @@
#include "gui.h" #include "gui.h"
extern bool rightClickEnabled; //Declared in window.cpp and only an extern here extern bool rightClickEnabled; //Declared in window.cpp and only an extern here
extern bool SingleInstanceOnly;
char ManifestFilePath[2048]; char ManifestFilePath[2048];
bool ManifestFileExists() bool ManifestFileExists()
@ -67,6 +68,16 @@ void CloseGuiDialog(HWND hwndDlg)
rightClickEnabled = false; rightClickEnabled = false;
} }
if(IsDlgButtonChecked(hwndDlg, IDC_SINGLEINSTANCE)==BST_CHECKED)
{
SingleInstanceOnly = true;
}
else
{
SingleInstanceOnly = false;
}
if(IsDlgButtonChecked(hwndDlg, CB_PARTIALVISUALTHEME)==BST_CHECKED) if(IsDlgButtonChecked(hwndDlg, CB_PARTIALVISUALTHEME)==BST_CHECKED)
{ {
FILE * stream = fopen( ManifestFilePath, "w" ); FILE * stream = fopen( ManifestFilePath, "w" );
@ -127,6 +138,10 @@ BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
CheckDlgButton(hwndDlg, CB_PARTIALVISUALTHEME, BST_CHECKED); CheckDlgButton(hwndDlg, CB_PARTIALVISUALTHEME, BST_CHECKED);
} }
if(SingleInstanceOnly){
CheckDlgButton(hwndDlg, IDC_SINGLEINSTANCE, BST_CHECKED);
}
CenterWindowOnScreen(hwndDlg); CenterWindowOnScreen(hwndDlg);
break; break;

View File

@ -622,12 +622,12 @@ BEGIN
PUSHBUTTON "Turbo A",318,195,122,32,12 PUSHBUTTON "Turbo A",318,195,122,32,12
END END
GUICONFIG DIALOGEX 16, 123, 184, 123 GUICONFIG DIALOGEX 16, 123, 184, 158
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "GUI Configuration" CAPTION "GUI Configuration"
FONT 8, "MS Sans Serif", 0, 0, 0x0 FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN BEGIN
DEFPUSHBUTTON "Close",BUTTON_CLOSE,64,101,56,14 DEFPUSHBUTTON "Close",BUTTON_CLOSE,65,121,56,14
CONTROL "Load ""File Open"" dialog when FCEUX starts.",CB_LOAD_FILE_OPEN, CONTROL "Load ""File Open"" dialog when FCEUX starts.",CB_LOAD_FILE_OPEN,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,168,12 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,168,12
CONTROL "Automatically hide menu on game load.",CB_AUTO_HIDE_MENU, CONTROL "Automatically hide menu on game load.",CB_AUTO_HIDE_MENU,
@ -639,6 +639,7 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,68,168,12 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,68,168,12
CONTROL "Partially disable Visual Themes (Requires restart)",CB_PARTIALVISUALTHEME, CONTROL "Partially disable Visual Themes (Requires restart)",CB_PARTIALVISUALTHEME,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,83,168,12 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,83,168,12
CONTROL "Single Instance Mode",IDC_SINGLEINSTANCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,100,85,10
END END
INPUTCONFIG DIALOGEX 122, 105, 349, 199 INPUTCONFIG DIALOGEX 122, 105, 349, 199
@ -1693,7 +1694,7 @@ BEGIN
LEFTMARGIN, 10 LEFTMARGIN, 10
RIGHTMARGIN, 174 RIGHTMARGIN, 174
TOPMARGIN, 8 TOPMARGIN, 8
BOTTOMMARGIN, 100 BOTTOMMARGIN, 135
END END
"INPUTCONFIG", DIALOG "INPUTCONFIG", DIALOG

View File

@ -479,6 +479,8 @@
#define IDC_EDIT_LUAARGS 1256 #define IDC_EDIT_LUAARGS 1256
#define CB_PARTIALVISUALTHEME 1257 #define CB_PARTIALVISUALTHEME 1257
#define DEBUGLOADDEB 1258 #define DEBUGLOADDEB 1258
#define IDC_CHECK2 1258
#define IDC_SINGLEINSTANCE 1258
#define MENU_NETWORK 40040 #define MENU_NETWORK 40040
#define MENU_PALETTE 40041 #define MENU_PALETTE 40041
#define MENU_SOUND 40042 #define MENU_SOUND 40042
@ -799,7 +801,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 160 #define _APS_NEXT_RESOURCE_VALUE 160
#define _APS_NEXT_COMMAND_VALUE 40410 #define _APS_NEXT_COMMAND_VALUE 40410
#define _APS_NEXT_CONTROL_VALUE 1257 #define _APS_NEXT_CONTROL_VALUE 1259
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif