add "Launch Game" to main menu
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ protected:
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedButtonLaunchGame();
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,4 +19,6 @@ bool SetPref( CString name, bool val );
|
||||
CString GetPackageDirectory(CString path);
|
||||
bool IsValidPackageDirectory(CString path);
|
||||
|
||||
void LaunchGame();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user