add "Launch Game" to main menu

This commit is contained in:
Chris Danford
2005-11-28 05:24:09 +00:00
parent f6f700f910
commit 2784c08ea3
7 changed files with 36 additions and 20 deletions
+8
View File
@@ -51,6 +51,7 @@ BEGIN_MESSAGE_MAP(MainMenuDlg, CDialog)
ON_BN_CLICKED(IDC_OPEN_PREFERENCES, OnBnClickedOpenPreferences)
ON_BN_CLICKED(IDC_CLEAR_PREFERENCES, OnBnClickedClearPreferences)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_BUTTON_LAUNCH_GAME, OnBnClickedButtonLaunchGame)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -241,3 +242,10 @@ void MainMenuDlg::OnBnClickedClearPreferences()
MessageBox( PREFERENCES_INI + " cleared." );
}
void MainMenuDlg::OnBnClickedButtonLaunchGame()
{
// TODO: Add your control notification handler code here
LaunchGame();
exit(0);
}
+1
View File
@@ -49,6 +49,7 @@ protected:
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonLaunchGame();
};
//{{AFX_INSERT_LOCATION}}
+20
View File
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "SMPackageUtil.h"
#include "Registry.h"
#include "../ProductInfo.h"
void WriteStepManiaInstallDirs( const CStringArray& asInstallDirsToWrite )
{
@@ -169,3 +170,22 @@ bool IsValidPackageDirectory(CString path)
return true;
}
void LaunchGame()
{
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
CreateProcess(
NULL, // pointer to name of executable module
PRODUCT_NAME ".exe", // pointer to command line string
NULL, // process security attributes
NULL, // thread security attributes
false, // handle inheritance flag
0, // creation flags
NULL, // pointer to new environment block
NULL, // pointer to current directory name
&si, // pointer to STARTUPINFO
&pi // pointer to PROCESS_INFORMATION
);
}
+1 -18
View File
@@ -349,24 +349,7 @@ void CSmpackageExportDlg::OnButtonExportAsIndividual()
void CSmpackageExportDlg::OnButtonPlay()
{
// TODO: Add your control notification handler code here
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
CreateProcess(
NULL, // pointer to name of executable module
"stepmania.exe", // pointer to command line string
NULL, // process security attributes
NULL, // thread security attributes
false, // handle inheritance flag
0, // creation flags
NULL, // pointer to new environment block
NULL, // pointer to current directory name
&si, // pointer to STARTUPINFO
&pi // pointer to PROCESS_INFORMATION
);
LaunchGame();
exit(0);
}
+2 -1
View File
@@ -75,6 +75,7 @@
#define IDC_CHECK_SHOW_LOG_WINDOW 1054
#define IDC_EDIT_INSTALLATION 1054
#define IDC_RADIO_SOUND_DIRECTSOUND_SOFTWARE 1055
#define IDC_BUTTON_LAUNCH_GAME 1055
#define IDC_RADIO_SOUND_DIRECTSOUND_HARDWARE 1056
#define IDC_RADIO_SOUND_WAVEOUT 1057
@@ -84,7 +85,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 150
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1055
#define _APS_NEXT_CONTROL_VALUE 1056
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif
+2 -1
View File
@@ -106,7 +106,7 @@ CAPTION "Stepmania Package Manager"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "Close",IDOK,255,215,69,14
PUSHBUTTON "Play Stepmania",IDC_BUTTON_PLAY,5,215,70,15
PUSHBUTTON "Launch Game",IDC_BUTTON_PLAY,5,215,70,15
PUSHBUTTON "Export As One",IDC_BUTTON_EXPORT_AS_ONE,255,104,69,15
CONTROL 135,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38
PUSHBUTTON "Export As Individual",IDC_BUTTON_EXPORT_AS_INDIVIDUAL,
@@ -192,6 +192,7 @@ BEGIN
GROUPBOX "Keyboard / Joystick Mappings",IDC_STATIC,7,123,318,39
LTEXT "Erase all of your keyboard and joystick mappings if you've made a mistake mapping keys in the game and can't get back to change them.",
IDC_STATIC,104,133,214,25
PUSHBUTTON "Launch Game",IDC_BUTTON_LAUNCH_GAME,189,324,70,14
END
IDD_CONVERT_THEME DIALOGEX 0, 0, 332, 258
+2
View File
@@ -19,4 +19,6 @@ bool SetPref( CString name, bool val );
CString GetPackageDirectory(CString path);
bool IsValidPackageDirectory(CString path);
void LaunchGame();
#endif