From 74749a19bb95f33cdd8f10f05aec34e9143ff71b Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 22 Dec 2005 03:10:04 +0000 Subject: [PATCH] move localized string to separate file --- stepmania/src/InputMapper.cpp | 1 + stepmania/src/LocalizedString.cpp | 85 +++++++++++++++++++ stepmania/src/LocalizedString.h | 51 +++++++++++ stepmania/src/LocalizedStringLua.cpp | 31 +++++++ stepmania/src/Makefile.am | 5 +- stepmania/src/NetworkSyncManager.cpp | 1 + stepmania/src/Player.cpp | 1 + stepmania/src/RageSoundManager.cpp | 2 +- stepmania/src/RageUtil.cpp | 53 +----------- stepmania/src/RageUtil.h | 18 ---- stepmania/src/RoomWheel.cpp | 1 + stepmania/src/ScreenCenterImage.cpp | 1 + stepmania/src/ScreenDebugOverlay.cpp | 1 + stepmania/src/ScreenEdit.cpp | 1 + stepmania/src/ScreenEditMenu.cpp | 1 + stepmania/src/ScreenEz2SelectMusic.cpp | 2 +- stepmania/src/ScreenJoinMultiplayer.cpp | 2 +- stepmania/src/ScreenNetRoom.cpp | 1 + stepmania/src/ScreenNetworkOptions.cpp | 1 + stepmania/src/ScreenOptionsEditCourse.cpp | 1 + stepmania/src/ScreenOptionsManageCourses.cpp | 1 + .../src/ScreenOptionsManageEditSteps.cpp | 1 + stepmania/src/ScreenOptionsManageProfiles.cpp | 1 + stepmania/src/ScreenOptionsMemoryCard.cpp | 1 + stepmania/src/ScreenPackages.cpp | 1 + stepmania/src/ScreenSMOnlineLogin.cpp | 1 + stepmania/src/ScreenSaveSync.cpp | 1 + stepmania/src/ScreenSelectStyle.cpp | 1 + stepmania/src/ScreenServiceAction.cpp | 1 + stepmania/src/ScreenSyncOverlay.cpp | 1 + stepmania/src/ScreenTitleMenu.cpp | 1 + stepmania/src/SongManager.cpp | 2 +- stepmania/src/StepMania-net2003.vcproj | 9 ++ stepmania/src/StepMania.cpp | 5 +- stepmania/src/ThemeManager.cpp | 1 + stepmania/src/arch/arch.cpp | 1 + 36 files changed, 212 insertions(+), 77 deletions(-) create mode 100644 stepmania/src/LocalizedString.cpp create mode 100644 stepmania/src/LocalizedString.h create mode 100644 stepmania/src/LocalizedStringLua.cpp diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index fbf6c324c0..e7a2b5e1ff 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -11,6 +11,7 @@ #include "Game.h" #include "Style.h" #include "SpecialFiles.h" +#include "LocalizedString.h" static Preference g_sLastSeenInputDevices( "LastSeenInputDevices", "" ); static Preference g_bAutoMapOnJoyChange( "AutoMapOnJoyChange", true ); diff --git a/stepmania/src/LocalizedString.cpp b/stepmania/src/LocalizedString.cpp new file mode 100644 index 0000000000..a2f3fdc71f --- /dev/null +++ b/stepmania/src/LocalizedString.cpp @@ -0,0 +1,85 @@ +#include "global.h" +#include "LocalizedString.h" +#include "Foreach.h" + +static RString (*g_pfnLocalizer)(const RString&,const RString&) = NULL; + +void LocalizedString::RegisterLocalizer( RString (*pfnLocalizer)(const RString&, const RString&) ) +{ + g_pfnLocalizer = pfnLocalizer; +} + +#include "SubscriptionManager.h" +template<> +set* SubscriptionManager::s_pSubscribers = NULL; + +void LocalizedString::RefreshLocalizedStrings() +{ + FOREACHS( LocalizedString*, *SubscriptionManager::s_pSubscribers, p ) + (*p)->Refresh(); +} + +CString LocalizedString::LocalizeString( const CString &sSection, const CString &sName ) +{ + ASSERT( g_pfnLocalizer ); + return g_pfnLocalizer( sSection, sName ); +} + +LocalizedString::LocalizedString( const RString &sSection, const RString &sName ) +{ + m_bLoaded = false; + m_sSection = sSection; + m_sName = sName; + + SubscriptionManager::Subscribe( this ); +} + + +LocalizedString::~LocalizedString() +{ + SubscriptionManager::Unsubscribe( this ); +} + + +LocalizedString::operator RString() const +{ + return GetValue(); +} + +RString LocalizedString::GetValue() const +{ + ASSERT(m_bLoaded); + return m_sValue; +} + +void LocalizedString::Refresh() +{ + m_sValue = LocalizeString( m_sSection, m_sName ); + m_bLoaded = true; +} + + +/* + * Copyright (c) 2001-2005 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/LocalizedString.h b/stepmania/src/LocalizedString.h new file mode 100644 index 0000000000..beb648f727 --- /dev/null +++ b/stepmania/src/LocalizedString.h @@ -0,0 +1,51 @@ +/* LocalizedString - */ + +#ifndef LocalizedString_H +#define LocalizedString_H + +class LocalizedString +{ +public: + static void RegisterLocalizer( RString (*pfnLocalizer)(const RString&,const RString&) ); + static void RefreshLocalizedStrings(); + static CString LocalizeString( const CString &sSection, const CString &sName ); + + + LocalizedString( const RString &sSection, const RString &sName ); + ~LocalizedString(); + void Refresh(); + operator RString() const; + RString GetValue() const; +private: + RString m_sSection; + RString m_sName; + RString m_sValue; + bool m_bLoaded; +}; + +#endif + +/* + * Copyright (c) 2001-2005 Chris Danford, Glenn Maynard + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/LocalizedStringLua.cpp b/stepmania/src/LocalizedStringLua.cpp new file mode 100644 index 0000000000..e7f18b66e8 --- /dev/null +++ b/stepmania/src/LocalizedStringLua.cpp @@ -0,0 +1,31 @@ +#include "global.h" +#include "LocalizedString.h" +#include "LuaFunctions.h" +#include "LuaManager.h" + +LuaFunction( LocalizeString, LocalizedString::LocalizeString( SArg(1), SArg(2) ) ) + +/* + * Copyright (c) 2001-2005 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index d4f3a052b0..61270feb98 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -103,7 +103,10 @@ GameConstantsAndTypes.cpp GameConstantsAndTypes.h \ GameInput.cpp GameInput.h Grade.cpp Grade.h \ HighScore.cpp HighScore.h \ InputEventPlus.h \ -Inventory.cpp Inventory.h LuaFunctions.h \ +Inventory.cpp Inventory.h \ +LocalizedString.cpp LocalizedString.h \ +LocalizedStringLua.cpp \ +LuaFunctions.h \ LuaReference.cpp LuaReference.h \ LuaExpressionTransform.cpp LuaExpressionTransform.h \ LyricsLoader.cpp LyricsLoader.h MenuInput.h \ diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index 3587e4533f..777fc3a719 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -4,6 +4,7 @@ #include "LuaManager.h" #include "LuaFunctions.h" #include "crypto/CryptMD5.h" +#include "LocalizedString.h" NetworkSyncManager *NSMAN; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 3f2c0aadb4..367355c0f5 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -40,6 +40,7 @@ #include "StatsManager.h" #include "Steps.h" #include "GameCommand.h" +#include "LocalizedString.h" CString COMBO_X_NAME( size_t p, size_t both_sides ) { return "ComboXOffset" + (both_sides ? CString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } CString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ){ return "AttackDisplayXOffset" + (both_sides ? CString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index b00e361590..b538d819e8 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -10,6 +10,7 @@ #include "RageTimer.h" #include "RageSoundReader_Preload.h" #include "Foreach.h" +#include "LocalizedString.h" #include "arch/Sound/RageSoundDriver.h" @@ -36,7 +37,6 @@ RageSoundManager::RageSoundManager() } static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); - void RageSoundManager::Init( CString sDrivers ) { m_pDriver = MakeRageSoundDriver( sDrivers ); diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index d1c2893dd9..e32411102d 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -4,6 +4,7 @@ #include "RageLog.h" #include "RageFile.h" #include "Foreach.h" +#include "LocalizedString.h" #include #include @@ -1925,58 +1926,6 @@ bool FileCopy( RageFileBasic &in, RageFileBasic &out, RString &sError, bool *bRe return true; } -static RString (*g_pfnLocalizer)(const RString&,const RString&) = NULL; - -void RegisterLocalizer( RString (*pfnLocalizer)(const RString&, const RString&) ) -{ - g_pfnLocalizer = pfnLocalizer; -} - -#include "SubscriptionManager.h" -template<> -set* SubscriptionManager::s_pSubscribers = NULL; - -void RefreshLocalizedStrings() -{ - FOREACHS( LocalizedString*, *SubscriptionManager::s_pSubscribers, p ) - (*p)->Refresh(); -} - -LocalizedString::LocalizedString( const RString &sSection, const RString &sName ) -{ - m_bLoaded = false; - m_sSection = sSection; - m_sName = sName; - - SubscriptionManager::Subscribe( this ); -} - - -LocalizedString::~LocalizedString() -{ - SubscriptionManager::Unsubscribe( this ); -} - - -LocalizedString::operator RString() const -{ - return GetValue(); -} - -RString LocalizedString::GetValue() const -{ - ASSERT(m_bLoaded); - return m_sValue; -} - -void LocalizedString::Refresh() -{ - ASSERT( g_pfnLocalizer ); - m_sValue = g_pfnLocalizer( m_sSection, m_sName ); - m_bLoaded = true; -} - - /* * Copyright (c) 2001-2005 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index e5713c80f5..6dbc250361 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -503,24 +503,6 @@ void GetConnectsDisconnects( const vector &before, const vector &after, ve GetAsNotInBs( after, before, connects ); } -// String localization -void RegisterLocalizer( RString (*pfnLocalizer)(const RString&,const RString&) ); -void RefreshLocalizedStrings(); - -class LocalizedString -{ -public: - LocalizedString( const RString &sSection, const RString &sName ); - ~LocalizedString(); - void Refresh(); - operator RString() const; - RString GetValue() const; -private: - RString m_sSection; - RString m_sName; - RString m_sValue; - bool m_bLoaded; -}; #endif diff --git a/stepmania/src/RoomWheel.cpp b/stepmania/src/RoomWheel.cpp index d6cf1a5ffa..92af2a73ea 100644 --- a/stepmania/src/RoomWheel.cpp +++ b/stepmania/src/RoomWheel.cpp @@ -3,6 +3,7 @@ #include "RageLog.h" #include "RageUtil.h" #include "ScreenTextEntry.h" +#include "LocalizedString.h" AutoScreenMessage( SM_BackFromRoomName ) diff --git a/stepmania/src/ScreenCenterImage.cpp b/stepmania/src/ScreenCenterImage.cpp index cabbe680aa..d236f9373b 100644 --- a/stepmania/src/ScreenCenterImage.cpp +++ b/stepmania/src/ScreenCenterImage.cpp @@ -9,6 +9,7 @@ #include "HelpDisplay.h" #include "ScreenDimensions.h" #include "InputEventPlus.h" +#include "LocalizedString.h" static ThemeMetric ALLOW_RESIZE("ScreenCenterImage","AllowResize"); diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index ddc8ebedec..fe773718f2 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -20,6 +20,7 @@ #include "RageInput.h" #include "RageDisplay.h" #include "InputEventPlus.h" +#include "LocalizedString.h" static bool g_bIsDisplayed = false; static bool g_bIsSlow = false; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index a6b002668b..13ea328228 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -33,6 +33,7 @@ #include #include "InputEventPlus.h" #include "NotesWriterSM.h" +#include "LocalizedString.h" static Preference g_iDefaultRecordLength( "DefaultRecordLength", 4 ); static Preference g_bEditorShowBGChangesPlay( "EditorShowBGChangesPlay", false ); diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index 93ab7bf517..65a7fd6aca 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -14,6 +14,7 @@ #include "CommonMetrics.h" #include "ScreenTextEntry.h" #include "ScreenPrompt.h" +#include "LocalizedString.h" #define EXPLANATION_TEXT( row ) THEME->GetMetric(m_sName,"Explanation"+EditMenuRowToString(row)) #define EDIT_MENU_TYPE THEME->GetMetric(m_sName,"EditMenuType") diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index e9d79dc166..c64348aacf 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -22,7 +22,7 @@ #include "RageLog.h" #include "song.h" #include "InputEventPlus.h" - +#include "LocalizedString.h" #define PREV_SCREEN THEME->GetMetric ("ScreenEz2SelectMusic","PrevScreen") #define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX") diff --git a/stepmania/src/ScreenJoinMultiplayer.cpp b/stepmania/src/ScreenJoinMultiplayer.cpp index 6c781667ad..c2326d1892 100644 --- a/stepmania/src/ScreenJoinMultiplayer.cpp +++ b/stepmania/src/ScreenJoinMultiplayer.cpp @@ -13,7 +13,7 @@ class Style; #include "ScreenPrompt.h" #include "ScreenManager.h" #include "InputEventPlus.h" - +#include "LocalizedString.h" static const CString MultiPlayerStatusNames[] = { "Joined", diff --git a/stepmania/src/ScreenNetRoom.cpp b/stepmania/src/ScreenNetRoom.cpp index 86ce9086fd..793e9a4a72 100644 --- a/stepmania/src/ScreenNetRoom.cpp +++ b/stepmania/src/ScreenNetRoom.cpp @@ -11,6 +11,7 @@ #include "WheelItemBase.h" //#include "RageLog.h" #include "InputEventPlus.h" +#include "LocalizedString.h" #define TITLEBG_WIDTH THEME->GetMetricF(m_sName,"TitleBGWidth") #define TITLEBG_HEIGHT THEME->GetMetricF(m_sName,"TitleBGHeight") diff --git a/stepmania/src/ScreenNetworkOptions.cpp b/stepmania/src/ScreenNetworkOptions.cpp index 89f2a20e26..c9062040bb 100644 --- a/stepmania/src/ScreenNetworkOptions.cpp +++ b/stepmania/src/ScreenNetworkOptions.cpp @@ -11,6 +11,7 @@ #include "ScreenTextEntry.h" #include "ScreenPrompt.h" #include "NetworkSyncServer.h" +#include "LocalizedString.h" enum { PO_CONNECTION, diff --git a/stepmania/src/ScreenOptionsEditCourse.cpp b/stepmania/src/ScreenOptionsEditCourse.cpp index c72ae3eda6..24b8051d5e 100644 --- a/stepmania/src/ScreenOptionsEditCourse.cpp +++ b/stepmania/src/ScreenOptionsEditCourse.cpp @@ -10,6 +10,7 @@ #include "ScreenMiniMenu.h" #include "ScreenPrompt.h" #include "CourseUtil.h" +#include "LocalizedString.h" enum EditCourseRow { diff --git a/stepmania/src/ScreenOptionsManageCourses.cpp b/stepmania/src/ScreenOptionsManageCourses.cpp index a436d305dc..a179ed7942 100644 --- a/stepmania/src/ScreenOptionsManageCourses.cpp +++ b/stepmania/src/ScreenOptionsManageCourses.cpp @@ -11,6 +11,7 @@ #include "GameManager.h" #include "Difficulty.h" #include "CourseUtil.h" +#include "LocalizedString.h" static void RefreshTrail() { diff --git a/stepmania/src/ScreenOptionsManageEditSteps.cpp b/stepmania/src/ScreenOptionsManageEditSteps.cpp index 03cf3eba77..1210bef473 100644 --- a/stepmania/src/ScreenOptionsManageEditSteps.cpp +++ b/stepmania/src/ScreenOptionsManageEditSteps.cpp @@ -11,6 +11,7 @@ #include "ScreenMiniMenu.h" #include "RageUtil.h" #include "RageFileManager.h" +#include "LocalizedString.h" AutoScreenMessage( SM_BackFromRename ) AutoScreenMessage( SM_BackFromDelete ) diff --git a/stepmania/src/ScreenOptionsManageProfiles.cpp b/stepmania/src/ScreenOptionsManageProfiles.cpp index 33a59a52de..8063a5511c 100644 --- a/stepmania/src/ScreenOptionsManageProfiles.cpp +++ b/stepmania/src/ScreenOptionsManageProfiles.cpp @@ -10,6 +10,7 @@ #include "ProfileManager.h" #include "Profile.h" #include "OptionRowHandler.h" +#include "LocalizedString.h" static ThemeMetric NEW_PROFILE_DEFAULT_NAME( "ScreenOptionsManageProfiles", "NewProfileDefaultName" ); diff --git a/stepmania/src/ScreenOptionsMemoryCard.cpp b/stepmania/src/ScreenOptionsMemoryCard.cpp index 871e9bfa9e..d80fb56efc 100644 --- a/stepmania/src/ScreenOptionsMemoryCard.cpp +++ b/stepmania/src/ScreenOptionsMemoryCard.cpp @@ -6,6 +6,7 @@ #include "GameState.h" #include "ScreenManager.h" #include "ScreenPrompt.h" +#include "LocalizedString.h" REGISTER_SCREEN_CLASS( ScreenOptionsMemoryCard ); diff --git a/stepmania/src/ScreenPackages.cpp b/stepmania/src/ScreenPackages.cpp index 91787fee19..7ca568a057 100644 --- a/stepmania/src/ScreenPackages.cpp +++ b/stepmania/src/ScreenPackages.cpp @@ -12,6 +12,7 @@ #include "ScreenTextEntry.h" #include "ScreenManager.h" #include +#include "LocalizedString.h" #define EXISTINGBG_WIDTH THEME->GetMetricF(m_sName,"PackagesBGWidth") #define WEBBG_WIDTH THEME->GetMetricF(m_sName,"WebBGWidth") diff --git a/stepmania/src/ScreenSMOnlineLogin.cpp b/stepmania/src/ScreenSMOnlineLogin.cpp index 4dbb6cb5bd..1d61a4d11e 100644 --- a/stepmania/src/ScreenSMOnlineLogin.cpp +++ b/stepmania/src/ScreenSMOnlineLogin.cpp @@ -13,6 +13,7 @@ #include "NetworkSyncManager.h" #include "ScreenTextEntry.h" #include "Profile.h" +#include "LocalizedString.h" REGISTER_SCREEN_CLASS(ScreenSMOnlineLogin); diff --git a/stepmania/src/ScreenSaveSync.cpp b/stepmania/src/ScreenSaveSync.cpp index 83a1e23a36..ef247c7cce 100644 --- a/stepmania/src/ScreenSaveSync.cpp +++ b/stepmania/src/ScreenSaveSync.cpp @@ -3,6 +3,7 @@ #include "GameState.h" #include "song.h" #include "PrefsManager.h" +#include "LocalizedString.h" static LocalizedString EARLIER ("ScreenSaveSync","earlier"); diff --git a/stepmania/src/ScreenSelectStyle.cpp b/stepmania/src/ScreenSelectStyle.cpp index 69ad43e0aa..80791a2b29 100644 --- a/stepmania/src/ScreenSelectStyle.cpp +++ b/stepmania/src/ScreenSelectStyle.cpp @@ -11,6 +11,7 @@ #include "LightsManager.h" #include "CommonMetrics.h" #include "Command.h" +#include "LocalizedString.h" #define ICON_GAIN_FOCUS_COMMAND THEME->GetMetricA(m_sName,"IconGainFocusCommand") diff --git a/stepmania/src/ScreenServiceAction.cpp b/stepmania/src/ScreenServiceAction.cpp index 8270ffc34c..392ae83dd7 100644 --- a/stepmania/src/ScreenServiceAction.cpp +++ b/stepmania/src/ScreenServiceAction.cpp @@ -13,6 +13,7 @@ #include "MemoryCardManager.h" #include "GameState.h" #include "PlayerState.h" +#include "LocalizedString.h" static LocalizedString BOOKKEEPING_DATA_CLEARED( "ScreenServiceAction", "Bookkeeping data cleared." ); static CString ClearBookkeepingData() diff --git a/stepmania/src/ScreenSyncOverlay.cpp b/stepmania/src/ScreenSyncOverlay.cpp index 7357a14749..0814377d16 100644 --- a/stepmania/src/ScreenSyncOverlay.cpp +++ b/stepmania/src/ScreenSyncOverlay.cpp @@ -6,6 +6,7 @@ #include "song.h" #include "PrefsManager.h" #include "InputEventPlus.h" +#include "LocalizedString.h" static bool IsGameplay() { diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index fd40a5854c..8b1fd8ce81 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -18,6 +18,7 @@ #include "ProfileManager.h" #include "CharacterManager.h" #include "InputEventPlus.h" +#include "LocalizedString.h" #define COIN_MODE_CHANGE_SCREEN THEME->GetMetric (m_sName,"CoinModeChangeScreen") diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index ac9aa1cd98..aefb252ae0 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -34,6 +34,7 @@ #include "Profile.h" #include "CourseLoaderCRS.h" #include "TitleSubstitution.h" +#include "LocalizedString.h" SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program @@ -104,7 +105,6 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld ) static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder '%s' appears to be a song folder. All song folders must reside in a group folder. For example, 'Songs/Originals/My Song'." ); - void SongManager::SanityCheckGroupDir( CString sDir ) const { // Check to see if they put a song directly inside the group folder. diff --git a/stepmania/src/StepMania-net2003.vcproj b/stepmania/src/StepMania-net2003.vcproj index f4d8d573ea..53360c109d 100644 --- a/stepmania/src/StepMania-net2003.vcproj +++ b/stepmania/src/StepMania-net2003.vcproj @@ -905,6 +905,15 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + + + diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index c506f43ba1..db5a04a868 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -15,6 +15,7 @@ #include "RageMath.h" #include "RageDisplay.h" #include "RageThreads.h" +#include "LocalizedString.h" #include "arch/ArchHooks/ArchHooks.h" #include "arch/LoadingWindow/LoadingWindow.h" @@ -1062,8 +1063,8 @@ int main(int argc, char* argv[]) delete pIcon; } - RegisterLocalizer( LocalizeString ); - RefreshLocalizedStrings(); + LocalizedString::RegisterLocalizer( LocalizeString ); + LocalizedString::RefreshLocalizedStrings(); if( PREFSMAN->m_iSoundWriteAhead ) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index f8f870e959..cc8c4174dc 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -16,6 +16,7 @@ #include "LuaManager.h" #include "ScreenDimensions.h" #include "Command.h" +#include "LocalizedString.h" ThemeManager* THEME = NULL; // global object accessable from anywhere in the program diff --git a/stepmania/src/arch/arch.cpp b/stepmania/src/arch/arch.cpp index 96dacc80ec..f53f28d316 100644 --- a/stepmania/src/arch/arch.cpp +++ b/stepmania/src/arch/arch.cpp @@ -9,6 +9,7 @@ #include "arch.h" #include "arch_platform.h" #include "Foreach.h" +#include "LocalizedString.h" #include "InputHandler/Selector_InputHandler.h" static LocalizedString INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." );