cleanup newline handling in languages
remove View Statistics button (moved to command line)
This commit is contained in:
@@ -356,9 +356,9 @@ void ThemeManager::UpdateLuaGlobals()
|
||||
#if !defined(SMPACKAGE)
|
||||
/* explicitly refresh cached metrics that we use. */
|
||||
ScreenDimensions::ReloadMetricsAndUpdateLua();
|
||||
#endif
|
||||
|
||||
RunLuaScripts( "*.lua" );
|
||||
#endif
|
||||
}
|
||||
|
||||
RString ThemeManager::GetThemeDirFromName( const RString &sThemeName )
|
||||
@@ -904,14 +904,19 @@ void ThemeManager::GetMetric( const RString &sClassName, const RString &sValueNa
|
||||
valueOut.SetFromExpression( "function(self) " + sValue + "end" );
|
||||
}
|
||||
|
||||
RString ThemeManager::GetString( const RString &sClassName, const RString &sValueName )
|
||||
RString ThemeManager::GetString( const RString &sClassName, const RString &sValueName_ )
|
||||
{
|
||||
RString sValueName = sValueName_;
|
||||
|
||||
// TODO: Are there esacpe rules for this?
|
||||
DEBUG_ASSERT( sValueName.find('=') == sValueName.npos );
|
||||
|
||||
// TODO: Change this to GetMetricRaw and write stubs for missing strings into every language file.
|
||||
// TODO: Move this escaping into IniFile?
|
||||
sValueName.Replace( "\n", "\\n" );
|
||||
|
||||
RString s = GetMetric( sClassName, sValueName );
|
||||
|
||||
// Write stubs for missing strings into every language file.
|
||||
// Language strings may not be empty. Empty strings are considered to need translation
|
||||
if( s.empty() )
|
||||
{
|
||||
@@ -922,6 +927,9 @@ RString ThemeManager::GetString( const RString &sClassName, const RString &sValu
|
||||
ini.SetValue( sClassName, sValueName, s );
|
||||
ini.WriteFile( sFile );
|
||||
}
|
||||
|
||||
s.Replace( "\\n", "\n" );
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#define BITMAP_LOADING 117
|
||||
#define BITMAP_CRASH 121
|
||||
#define BITMAP_ERROR 129
|
||||
#define IDD_OK 129
|
||||
#define IDD_DRIVER 130
|
||||
#define IDD_DISASM_CRASH 199
|
||||
#define IDD_OK 118
|
||||
#define IDD_DRIVER 119
|
||||
#define IDD_DISASM_CRASH 120
|
||||
#define IDC_SHOCKWAVEFLASH1 1000
|
||||
#define IDC_BUTTON_RESTART 1001
|
||||
#define IDM_TOGGLEFULLSCREEN 1002
|
||||
|
||||
@@ -58,7 +58,6 @@ BEGIN_MESSAGE_MAP(MainMenuDlg, CDialog)
|
||||
ON_BN_CLICKED(IDC_CLEAR_PREFERENCES, OnBnClickedClearPreferences)
|
||||
//}}AFX_MSG_MAP
|
||||
ON_BN_CLICKED(IDC_BUTTON_LAUNCH_GAME, OnBnClickedButtonLaunchGame)
|
||||
ON_BN_CLICKED(IDC_VIEW_STATISTICS, OnBnClickedViewStatistics)
|
||||
ON_BN_CLICKED(IDC_LANGUAGES, OnBnClickedLanguages)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
@@ -247,15 +246,6 @@ void MainMenuDlg::OnBnClickedButtonLaunchGame()
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void MainMenuDlg::OnBnClickedViewStatistics()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
RString sPersonalDir = SpecialDirs::GetMyDocumentsDir();
|
||||
RString sFile = sPersonalDir + PRODUCT_ID +"/Save/MachineProfile/Stats.xml";
|
||||
if( NULL == ::ShellExecute( this->m_hWnd, "open", sFile, "", "", SW_SHOWNORMAL ) )
|
||||
MessageBox( "Failed to open '" + sFile + "': " + GetLastErrorString() );
|
||||
}
|
||||
|
||||
void MainMenuDlg::OnBnClickedLanguages()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
@@ -52,7 +52,6 @@ protected:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedButtonLaunchGame();
|
||||
afx_msg void OnBnClickedViewStatistics();
|
||||
afx_msg void OnBnClickedLanguages();
|
||||
};
|
||||
|
||||
|
||||
@@ -237,11 +237,7 @@ void SMPackageUtil::LocalizeDialogAndContents( CDialog &dlg )
|
||||
RString s = sTemp;
|
||||
if( s.empty() )
|
||||
continue;
|
||||
vector<RString> vsBits;
|
||||
split( s, "\n", vsBits, true );
|
||||
FOREACH( RString, vsBits, iter )
|
||||
*iter = THEME->GetString(sGroup,RString(*iter));
|
||||
s = join("\n",vsBits);
|
||||
s = THEME->GetString( sGroup, s );
|
||||
pChild->SetWindowText( s );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,41 +157,37 @@ BEGIN
|
||||
IDC_STATIC,18,144,196,17
|
||||
END
|
||||
|
||||
IDD_MENU DIALOGEX 0, 0, 332, 303
|
||||
IDD_MENU DIALOGEX 0, 0, 332, 265
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "StepMania Tools Main Menu"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Exit",IDOK,275,282,50,14
|
||||
DEFPUSHBUTTON "Exit",IDOK,275,244,50,14
|
||||
CONTROL 1045,IDC_STATIC,"Static",SS_BITMAP,0,0,332,38
|
||||
GROUPBOX "Installation",IDC_STATIC,7,41,318,28
|
||||
PUSHBUTTON "Edit Installations",IDC_EDIT_INSTALLATIONS,241,49,75,15
|
||||
GROUPBOX "Create and Share",IDC_STATIC,7,198,318,79
|
||||
PUSHBUTTON "Export Packages",IDC_EXPORT_PACKAGES,15,213,75,15
|
||||
GROUPBOX "Create and Share",IDC_STATIC,7,161,318,79
|
||||
PUSHBUTTON "Export Packages",IDC_EXPORT_PACKAGES,15,176,75,15
|
||||
LTEXT "Create .smzip package files to share with other users. Packages can contain songs, courses, themes, backgrounds, and more.",
|
||||
IDC_STATIC,104,212,215,18
|
||||
PUSHBUTTON "Create Song",IDC_CREATE_SONG,15,234,75,15
|
||||
IDC_STATIC,104,175,215,18
|
||||
PUSHBUTTON "Create Song",IDC_CREATE_SONG,15,197,75,15
|
||||
LTEXT "Create a new song in from your favorite mp3 or ogg music file.",
|
||||
IDC_STATIC,103,233,215,20
|
||||
GROUPBOX "Troubleshooting",IDC_STATIC,7,109,318,87
|
||||
PUSHBUTTON "Change Preferences",IDC_CHANGE_PREFERENCES,16,120,75,15
|
||||
PUSHBUTTON "Open Preferences",IDC_OPEN_PREFERENCES,16,152,75,15
|
||||
IDC_STATIC,103,196,215,20
|
||||
GROUPBOX "Troubleshooting",IDC_STATIC,7,72,318,87
|
||||
PUSHBUTTON "Change Preferences",IDC_CHANGE_PREFERENCES,16,83,75,15
|
||||
PUSHBUTTON "Open Preferences",IDC_OPEN_PREFERENCES,16,115,75,15
|
||||
LTEXT "Using this feature, you can:\n - Change the graphics API that the game will use.\n - Change the sound API that the game will use.\n - Clear all preferences if the game won't start.\n - Open the preferences file to make changes by hand.",
|
||||
IDC_STATIC,104,123,215,45
|
||||
PUSHBUTTON "Clear Preferences",IDC_CLEAR_PREFERENCES,16,136,75,15
|
||||
PUSHBUTTON "Clear Mappings",IDC_CLEAR_KEYMAPS,16,175,75,15
|
||||
IDC_STATIC,104,86,215,45
|
||||
PUSHBUTTON "Clear Preferences",IDC_CLEAR_PREFERENCES,16,99,75,15
|
||||
PUSHBUTTON "Clear Mappings",IDC_CLEAR_KEYMAPS,16,138,75,15
|
||||
EDITTEXT IDC_EDIT_INSTALLATION,16,51,219,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY
|
||||
LTEXT "Erase all of your keyboard and joystick mappings if you've made a mistake.",
|
||||
IDC_STATIC,104,174,214,18
|
||||
PUSHBUTTON "Launch Game",IDC_BUTTON_LAUNCH_GAME,189,282,70,14
|
||||
PUSHBUTTON "View Statistics",IDC_VIEW_STATISTICS,16,85,75,15
|
||||
LTEXT "View high scores and usage statistics and other data saved from your play.",
|
||||
IDC_STATIC,103,84,215,20
|
||||
GROUPBOX "Statistics",IDC_STATIC,7,72,318,35
|
||||
PUSHBUTTON "Languages",IDC_LANGUAGES,15,255,75,15
|
||||
IDC_STATIC,104,137,214,18
|
||||
PUSHBUTTON "Launch Game",IDC_BUTTON_LAUNCH_GAME,189,244,70,14
|
||||
PUSHBUTTON "Languages",IDC_LANGUAGES,15,218,75,15
|
||||
LTEXT "Create a new or manage existing language translations.",
|
||||
IDC_STATIC,103,254,215,20
|
||||
IDC_STATIC,103,217,215,20
|
||||
LTEXT "StepMania Tools Main Menu",IDC_STATIC_HEADER_TEXT,5,2,
|
||||
280,24
|
||||
END
|
||||
@@ -402,7 +398,7 @@ BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 325
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 296
|
||||
BOTTOMMARGIN, 258
|
||||
END
|
||||
|
||||
IDD_ENTER_COMMENT, DIALOG
|
||||
|
||||
Reference in New Issue
Block a user