set default install dir when launching smpackage
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "onvertThemeDlg.h"
|
#include "onvertThemeDlg.h"
|
||||||
#include "ChangeGameSettings.h"
|
#include "ChangeGameSettings.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
#include "SMPackageUtil.h"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
@@ -184,6 +185,8 @@ BOOL MainMenuDlg::OnInitDialog()
|
|||||||
TCHAR szCurDir[MAX_PATH];
|
TCHAR szCurDir[MAX_PATH];
|
||||||
GetCurrentDirectory( ARRAYSIZE(szCurDir), szCurDir );
|
GetCurrentDirectory( ARRAYSIZE(szCurDir), szCurDir );
|
||||||
GetDlgItem( IDC_EDIT_INSTALLATION )->SetWindowText( szCurDir );
|
GetDlgItem( IDC_EDIT_INSTALLATION )->SetWindowText( szCurDir );
|
||||||
|
AddStepManiaInstallDir( szCurDir );
|
||||||
|
SetDefaultInstallDir( szCurDir );
|
||||||
|
|
||||||
return TRUE; // return TRUE unless you set the focus to a control
|
return TRUE; // return TRUE unless you set the focus to a control
|
||||||
// EXCEPTION: OCX Property Pages should return FALSE
|
// EXCEPTION: OCX Property Pages should return FALSE
|
||||||
|
|||||||
@@ -86,6 +86,22 @@ void SetDefaultInstallDir( int iInstallDirIndex )
|
|||||||
WriteStepManiaInstallDirs( asInstallDirs );
|
WriteStepManiaInstallDirs( asInstallDirs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetDefaultInstallDir( CString sInstallDir )
|
||||||
|
{
|
||||||
|
CStringArray asInstallDirs;
|
||||||
|
GetStepManiaInstallDirs( asInstallDirs );
|
||||||
|
|
||||||
|
bool bAlreadyInList = false;
|
||||||
|
for( unsigned i=0; i<asInstallDirs.size(); i++ )
|
||||||
|
{
|
||||||
|
if( asInstallDirs[i].CompareNoCase(sInstallDir) == 0 )
|
||||||
|
{
|
||||||
|
SetDefaultInstallDir( i );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool GetPref( CString name, bool &val )
|
bool GetPref( CString name, bool &val )
|
||||||
{
|
{
|
||||||
CRegistry Reg;
|
CRegistry Reg;
|
||||||
|
|||||||
@@ -16,23 +16,23 @@ Resource1=IDR_MAINFRAME
|
|||||||
Resource2=IDD_ENTER_STRING
|
Resource2=IDD_ENTER_STRING
|
||||||
Class3=CSMPackageInstallDlg
|
Class3=CSMPackageInstallDlg
|
||||||
Class4=CSmpackageExportDlg
|
Class4=CSmpackageExportDlg
|
||||||
Resource3=IDD_INSTALL
|
Resource3=IDD_UNINSTALL_OLD_PACKAGES
|
||||||
Class5=EnterName
|
Class5=EnterName
|
||||||
Resource4=IDD_ENTER_COMMENT
|
Resource4=IDD_CONVERT_THEME
|
||||||
Class6=EditInsallations
|
Class6=EditInsallations
|
||||||
Resource5=IDD_DIALOG_NAME
|
Resource5=IDD_MENU
|
||||||
Class7=MainMenuDlg
|
Class7=MainMenuDlg
|
||||||
Resource6=IDD_EDIT_METRICS
|
Resource6=IDD_DIALOG_NAME
|
||||||
Class8=ConvertThemeDlg
|
Class8=ConvertThemeDlg
|
||||||
Resource7=IDD_EDIT_INSTALLATIONS
|
Resource7=IDD_SHOW_COMMENT
|
||||||
Class9=EditMetricsDlg
|
Class9=EditMetricsDlg
|
||||||
Resource8=IDD_CONVERT_THEME
|
Resource8=IDD_ENTER_COMMENT
|
||||||
Resource9=IDD_UNINSTALL_OLD_PACKAGES
|
Resource9=IDD_EXPORTER
|
||||||
Class10=EnterComment
|
Class10=EnterComment
|
||||||
Resource10=IDD_EXPORTER
|
Resource10=IDD_INSTALL
|
||||||
Class11=ShowComment
|
Class11=ShowComment
|
||||||
Resource11=IDD_MENU
|
Resource11=IDD_EDIT_METRICS
|
||||||
Resource12=IDD_SHOW_COMMENT
|
Resource12=IDD_EDIT_INSTALLATIONS
|
||||||
Class12=ChangeGameSettings
|
Class12=ChangeGameSettings
|
||||||
Resource13=IDD_CHANGE_GAME_SETTINGS
|
Resource13=IDD_CHANGE_GAME_SETTINGS
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Microsoft Developer Studio Project File - Name="smpackage" - Package Owner=<4>
|
# Microsoft Developer Studio Project File - Name="smpackage" - Package Owner=<4>
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
# Microsoft Developer Studio Generated Build File, Format Version 60000
|
||||||
# ** DO NOT EDIT **
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ BEGIN
|
|||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
EDITTEXT IDC_EDIT,19,168,136,13,ES_AUTOHSCROLL
|
EDITTEXT IDC_EDIT,19,168,136,13,ES_AUTOHSCROLL
|
||||||
PUSHBUTTON "Add",IDC_BUTTON_ADD,165,168,50,14
|
PUSHBUTTON "Add",IDC_BUTTON_ADD,165,168,50,14
|
||||||
PUSHBUTTON "Remove",IDC_BUTTON_REMOVE,164,42,50,15
|
PUSHBUTTON "Remove",IDC_BUTTON_REMOVE,164,44,50,15
|
||||||
PUSHBUTTON "Make Default",IDC_BUTTON_MAKE_DEFAULT,164,72,50,15
|
PUSHBUTTON "Make Default",IDC_BUTTON_MAKE_DEFAULT,164,24,50,15
|
||||||
GROUPBOX "Add New Installation",IDC_STATIC,7,130,218,59
|
GROUPBOX "Add New Installation",IDC_STATIC,7,130,218,59
|
||||||
GROUPBOX "Current Installations (the top installation is the default)",
|
GROUPBOX "Current Installations (the top installation is the default)",
|
||||||
IDC_STATIC,7,7,218,114
|
IDC_STATIC,7,7,218,114
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ void WriteStepManiaInstallDirs( const CStringArray& asInstallDirsToWrite );
|
|||||||
void GetStepManiaInstallDirs( CStringArray& asInstallDirsOut );
|
void GetStepManiaInstallDirs( CStringArray& asInstallDirsOut );
|
||||||
void AddStepManiaInstallDir( CString sNewInstallDir );
|
void AddStepManiaInstallDir( CString sNewInstallDir );
|
||||||
void SetDefaultInstallDir( int iInstallDirIndex );
|
void SetDefaultInstallDir( int iInstallDirIndex );
|
||||||
|
void SetDefaultInstallDir( CString sInstallDir );
|
||||||
|
|
||||||
bool GetPref( CString name, bool &val );
|
bool GetPref( CString name, bool &val );
|
||||||
bool SetPref( CString name, bool val );
|
bool SetPref( CString name, bool val );
|
||||||
|
|||||||
Reference in New Issue
Block a user