add ThemeManager to smtools
This commit is contained in:
@@ -13,9 +13,6 @@
|
|||||||
#include "FontCharmaps.h"
|
#include "FontCharmaps.h"
|
||||||
#include "FontCharAliases.h"
|
#include "FontCharAliases.h"
|
||||||
|
|
||||||
/* Last private-use Unicode character: */
|
|
||||||
const wchar_t Font::DEFAULT_GLYPH = 0xF8FF;
|
|
||||||
|
|
||||||
FontPage::FontPage()
|
FontPage::FontPage()
|
||||||
{
|
{
|
||||||
m_pTexture = NULL;
|
m_pTexture = NULL;
|
||||||
@@ -285,7 +282,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const
|
|||||||
map<longchar,glyph*>::const_iterator it = m_iCharToGlyph.find(c);
|
map<longchar,glyph*>::const_iterator it = m_iCharToGlyph.find(c);
|
||||||
|
|
||||||
/* If that's missing, use the default glyph. */
|
/* If that's missing, use the default glyph. */
|
||||||
if(it == m_iCharToGlyph.end()) it = m_iCharToGlyph.find(DEFAULT_GLYPH);
|
if(it == m_iCharToGlyph.end()) it = m_iCharToGlyph.find(FONT_DEFAULT_GLYPH);
|
||||||
|
|
||||||
if(it == m_iCharToGlyph.end())
|
if(it == m_iCharToGlyph.end())
|
||||||
RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
|
RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
|
||||||
@@ -295,7 +292,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const
|
|||||||
|
|
||||||
bool Font::FontCompleteForString( const wstring &str ) const
|
bool Font::FontCompleteForString( const wstring &str ) const
|
||||||
{
|
{
|
||||||
map<longchar,glyph*>::const_iterator m_pDefault = m_iCharToGlyph.find( DEFAULT_GLYPH );
|
map<longchar,glyph*>::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH );
|
||||||
if( m_pDefault == m_iCharToGlyph.end() )
|
if( m_pDefault == m_iCharToGlyph.end() )
|
||||||
RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
|
RageException::Throw( "The default glyph is missing from the font '%s'", path.c_str() );
|
||||||
|
|
||||||
|
|||||||
@@ -134,8 +134,6 @@ public:
|
|||||||
|
|
||||||
void SetDefaultGlyph( FontPage *pPage );
|
void SetDefaultGlyph( FontPage *pPage );
|
||||||
|
|
||||||
static const wchar_t DEFAULT_GLYPH;
|
|
||||||
|
|
||||||
bool IsRightToLeft() const { return m_bRightToLeft; };
|
bool IsRightToLeft() const { return m_bRightToLeft; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -163,6 +161,10 @@ private:
|
|||||||
CString GetPageNameFromFileName( const CString &sFilename );
|
CString GetPageNameFromFileName( const CString &sFilename );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Last private-use Unicode character: */
|
||||||
|
/* This is in the header to reduce file dependencies. */
|
||||||
|
const wchar_t FONT_DEFAULT_GLYPH = 0xF8FF;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ static void InitCharAliases()
|
|||||||
if(!CharAliases.empty())
|
if(!CharAliases.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CharAliases["default"] = Font::DEFAULT_GLYPH; /* ? */
|
CharAliases["default"] = FONT_DEFAULT_GLYPH; /* ? */
|
||||||
CharAliases["invalid"] = INVALID_CHAR; /* 0xFFFD */
|
CharAliases["invalid"] = INVALID_CHAR; /* 0xFFFD */
|
||||||
|
|
||||||
/* The comments here are UTF-8; they won't show up in VC6 (use your
|
/* The comments here are UTF-8; they won't show up in VC6 (use your
|
||||||
|
|||||||
@@ -7,13 +7,7 @@
|
|||||||
#include "RageFile.h"
|
#include "RageFile.h"
|
||||||
#include "RageThreads.h"
|
#include "RageThreads.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
|
||||||
#if !defined(SMPACKAGE)
|
|
||||||
#include "arch/Dialog/Dialog.h"
|
#include "arch/Dialog/Dialog.h"
|
||||||
#define DIALOG_OK Dialog::OK
|
|
||||||
#else
|
|
||||||
#define DIALOG_OK __noop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <csetjmp>
|
#include <csetjmp>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -274,7 +268,7 @@ bool LuaHelpers::RunScriptFile( const CString &sFile )
|
|||||||
if( !f.Open( sFile ) )
|
if( !f.Open( sFile ) )
|
||||||
{
|
{
|
||||||
CString sError = ssprintf( "Couldn't open Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() );
|
CString sError = ssprintf( "Couldn't open Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() );
|
||||||
DIALOG_OK( sError, "LUA_ERROR" );
|
Dialog::OK( sError, "LUA_ERROR" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +276,7 @@ bool LuaHelpers::RunScriptFile( const CString &sFile )
|
|||||||
if( f.Read( sScript ) == -1 )
|
if( f.Read( sScript ) == -1 )
|
||||||
{
|
{
|
||||||
CString sError = ssprintf( "Error reading Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() );
|
CString sError = ssprintf( "Error reading Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() );
|
||||||
DIALOG_OK( sError, "LUA_ERROR" );
|
Dialog::OK( sError, "LUA_ERROR" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,7 +287,7 @@ bool LuaHelpers::RunScriptFile( const CString &sFile )
|
|||||||
{
|
{
|
||||||
LUA->Release(L);
|
LUA->Release(L);
|
||||||
sError = ssprintf( "Lua runtime error: %s", sError.c_str() );
|
sError = ssprintf( "Lua runtime error: %s", sError.c_str() );
|
||||||
DIALOG_OK( sError, "LUA_ERROR" );
|
Dialog::OK( sError, "LUA_ERROR" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LUA->Release(L);
|
LUA->Release(L);
|
||||||
@@ -336,7 +330,7 @@ bool LuaHelpers::RunScript( Lua *L, const CString &sExpression, const CString &s
|
|||||||
if( !LuaHelpers::RunScript( L, sExpression, sName.size()? sName:CString("in"), sError, iReturnValues ) )
|
if( !LuaHelpers::RunScript( L, sExpression, sName.size()? sName:CString("in"), sError, iReturnValues ) )
|
||||||
{
|
{
|
||||||
sError = ssprintf( "Lua runtime error parsing \"%s\": %s", sName.size()? sName.c_str():sExpression.c_str(), sError.c_str() );
|
sError = ssprintf( "Lua runtime error parsing \"%s\": %s", sName.size()? sName.c_str():sExpression.c_str(), sError.c_str() );
|
||||||
DIALOG_OK( sError, "LUA_ERROR" );
|
Dialog::OK( sError, "LUA_ERROR" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "ScreenDimensions.h"
|
#include "ScreenDimensions.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
|
#include "LuaFunctions.h"
|
||||||
|
|
||||||
static ThemeMetric<float> THEME_SCREEN_WIDTH("Common","ScreenWidth");
|
static ThemeMetric<float> THEME_SCREEN_WIDTH("Common","ScreenWidth");
|
||||||
static ThemeMetric<float> THEME_SCREEN_HEIGHT("Common","ScreenHeight");
|
static ThemeMetric<float> THEME_SCREEN_HEIGHT("Common","ScreenHeight");
|
||||||
@@ -79,6 +80,10 @@ void ScreenDimensions::ReloadMetricsAndUpdateLua()
|
|||||||
LUA->SetGlobal( "SCREEN_CENTER_Y", (int) SCREEN_CENTER_Y );
|
LUA->SetGlobal( "SCREEN_CENTER_Y", (int) SCREEN_CENTER_Y );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LuaFunction_NoArgs( GetScreenAspectRatio, ScreenDimensions::GetScreenAspectRatio() );
|
||||||
|
LuaFunction_NoArgs( GetThemeAspectRatio, ScreenDimensions::GetThemeAspectRatio() );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2002 Chris Danford
|
* (c) 2001-2002 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const RString SpecialFiles::KEYMAPS_PATH = "Save/Keymaps.ini";
|
|||||||
const RString SpecialFiles::PREFERENCES_INI_PATH = "Save/Preferences.ini";
|
const RString SpecialFiles::PREFERENCES_INI_PATH = "Save/Preferences.ini";
|
||||||
const RString SpecialFiles::THEMES_DIR = "Themes/";
|
const RString SpecialFiles::THEMES_DIR = "Themes/";
|
||||||
const RString SpecialFiles::LANGUAGES_SUBDIR = "Languages/";
|
const RString SpecialFiles::LANGUAGES_SUBDIR = "Languages/";
|
||||||
|
// TODO: A theme should be able to specify a base language.
|
||||||
const RString SpecialFiles::BASE_LANGUAGE = "en";
|
const RString SpecialFiles::BASE_LANGUAGE = "en";
|
||||||
const RString SpecialFiles::METRICS_FILE = "metrics.ini";
|
const RString SpecialFiles::METRICS_FILE = "metrics.ini";
|
||||||
const RString SpecialFiles::CACHE_DIR = "Cache/";
|
const RString SpecialFiles::CACHE_DIR = "Cache/";
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
#include "arch/ArchHooks/ArchHooks.h"
|
#include "arch/ArchHooks/ArchHooks.h"
|
||||||
#include "arch/Dialog/Dialog.h"
|
#include "arch/Dialog/Dialog.h"
|
||||||
#include "RageFile.h"
|
#include "RageFile.h"
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
|
#endif
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "ThemeMetric.h"
|
#include "ThemeMetric.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
@@ -18,6 +20,7 @@
|
|||||||
#include "Command.h"
|
#include "Command.h"
|
||||||
#include "LocalizedString.h"
|
#include "LocalizedString.h"
|
||||||
#include "SpecialFiles.h"
|
#include "SpecialFiles.h"
|
||||||
|
#include "EnumHelper.h"
|
||||||
|
|
||||||
|
|
||||||
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
||||||
@@ -34,7 +37,6 @@ StringToX( ElementCategory );
|
|||||||
|
|
||||||
|
|
||||||
const RString BASE_THEME_NAME = "default";
|
const RString BASE_THEME_NAME = "default";
|
||||||
// TODO: A theme should be able to specify a base language.
|
|
||||||
|
|
||||||
|
|
||||||
struct Theme
|
struct Theme
|
||||||
@@ -303,9 +305,11 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt
|
|||||||
for( int i = 0; i < NUM_ElementCategory; ++i )
|
for( int i = 0; i < NUM_ElementCategory; ++i )
|
||||||
g_ThemePathCache[i].clear();
|
g_ThemePathCache[i].clear();
|
||||||
|
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
// reload common sounds
|
// reload common sounds
|
||||||
if( SCREENMAN != NULL )
|
if( SCREENMAN != NULL )
|
||||||
SCREENMAN->ThemeChanged();
|
SCREENMAN->ThemeChanged();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Lua globals can use metrics which are cached, and vice versa. Update Lua
|
/* Lua globals can use metrics which are cached, and vice versa. Update Lua
|
||||||
* globals first; it's Lua's job to explicitly update cached metrics that it
|
* globals first; it's Lua's job to explicitly update cached metrics that it
|
||||||
@@ -346,8 +350,10 @@ void ThemeManager::UpdateLuaGlobals()
|
|||||||
RunLuaScripts( "Serialize.lua" );
|
RunLuaScripts( "Serialize.lua" );
|
||||||
LUA->ResetState();
|
LUA->ResetState();
|
||||||
|
|
||||||
/* Important: explicitly refresh cached metrics that we use. */
|
#if !defined(SMPACKAGE)
|
||||||
|
/* explicitly refresh cached metrics that we use. */
|
||||||
ScreenDimensions::ReloadMetricsAndUpdateLua();
|
ScreenDimensions::ReloadMetricsAndUpdateLua();
|
||||||
|
#endif
|
||||||
|
|
||||||
RunLuaScripts( "*.lua" );
|
RunLuaScripts( "*.lua" );
|
||||||
}
|
}
|
||||||
@@ -671,8 +677,10 @@ void ThemeManager::ReloadMetrics()
|
|||||||
// force a reload of the metrics cache
|
// force a reload of the metrics cache
|
||||||
LoadThemeMetrics( g_vThemes, m_sCurThemeName, m_sCurLanguage );
|
LoadThemeMetrics( g_vThemes, m_sCurThemeName, m_sCurLanguage );
|
||||||
|
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
if( SCREENMAN )
|
if( SCREENMAN )
|
||||||
SCREENMAN->SystemMessage( RELOADED_METRICS );
|
SCREENMAN->SystemMessage( RELOADED_METRICS );
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// clear theme path cache
|
// clear theme path cache
|
||||||
@@ -825,11 +833,13 @@ Commands ThemeManager::GetMetricM( const RString &sClassName, const RString &sVa
|
|||||||
return ParseCommands( sValue );
|
return ParseCommands( sValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
apActorCommands ThemeManager::GetMetricA( const RString &sClassName, const RString &sValueName )
|
apActorCommands ThemeManager::GetMetricA( const RString &sClassName, const RString &sValueName )
|
||||||
{
|
{
|
||||||
RString sValue = GetMetricRaw( sClassName, sValueName );
|
RString sValue = GetMetricRaw( sClassName, sValueName );
|
||||||
return apActorCommands( new ActorCommands( sValue ) );
|
return apActorCommands( new ActorCommands( sValue ) );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ThemeManager::NextTheme()
|
void ThemeManager::NextTheme()
|
||||||
{
|
{
|
||||||
@@ -876,10 +886,12 @@ void ThemeManager::GetModifierNames( vector<RString>& AddTo )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
void ThemeManager::GetMetric( const RString &sClassName, const RString &sValueName, apActorCommands &valueOut )
|
void ThemeManager::GetMetric( const RString &sClassName, const RString &sValueName, apActorCommands &valueOut )
|
||||||
{
|
{
|
||||||
valueOut = GetMetricA( sClassName, sValueName );
|
valueOut = GetMetricA( sClassName, sValueName );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ThemeManager::GetMetric( const RString &sClassName, const RString &sValueName, LuaExpression &valueOut )
|
void ThemeManager::GetMetric( const RString &sClassName, const RString &sValueName, LuaExpression &valueOut )
|
||||||
{
|
{
|
||||||
@@ -940,8 +952,6 @@ public:
|
|||||||
static int GetPathG( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathG(SArg(1),SArg(2)) ); return 1; }
|
static int GetPathG( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathG(SArg(1),SArg(2)) ); return 1; }
|
||||||
static int GetPathB( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathB(SArg(1),SArg(2)) ); return 1; }
|
static int GetPathB( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathB(SArg(1),SArg(2)) ); return 1; }
|
||||||
static int GetPathS( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathS(SArg(1),SArg(2)) ); return 1; }
|
static int GetPathS( T* p, lua_State *L ) { lua_pushstring(L, p->GetPathS(SArg(1),SArg(2)) ); return 1; }
|
||||||
static int GetScreenAspectRatio( T* p, lua_State *L ) { lua_pushnumber( L, ScreenDimensions::GetScreenAspectRatio() ); return 1; }
|
|
||||||
static int GetThemeAspectRatio( T* p, lua_State *L ) { lua_pushnumber( L, ScreenDimensions::GetThemeAspectRatio() ); return 1; }
|
|
||||||
|
|
||||||
static void Register(lua_State *L)
|
static void Register(lua_State *L)
|
||||||
{
|
{
|
||||||
@@ -950,8 +960,6 @@ public:
|
|||||||
ADD_METHOD( GetPathG );
|
ADD_METHOD( GetPathG );
|
||||||
ADD_METHOD( GetPathB );
|
ADD_METHOD( GetPathB );
|
||||||
ADD_METHOD( GetPathS );
|
ADD_METHOD( GetPathS );
|
||||||
ADD_METHOD( GetScreenAspectRatio );
|
|
||||||
ADD_METHOD( GetThemeAspectRatio );
|
|
||||||
|
|
||||||
Luna<T>::Register( L );
|
Luna<T>::Register( L );
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include "Command.h"
|
#include "Command.h"
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
#include "ActorCommands.h"
|
#include "ActorCommands.h"
|
||||||
|
#endif
|
||||||
|
#include "LuaReference.h"
|
||||||
|
|
||||||
class IThemeMetric;
|
class IThemeMetric;
|
||||||
class IniFile;
|
class IniFile;
|
||||||
@@ -70,7 +73,9 @@ public:
|
|||||||
bool GetMetricB( const RString &sClassName, const RString &sValueName );
|
bool GetMetricB( const RString &sClassName, const RString &sValueName );
|
||||||
RageColor GetMetricC( const RString &sClassName, const RString &sValueName );
|
RageColor GetMetricC( const RString &sClassName, const RString &sValueName );
|
||||||
Commands GetMetricM( const RString &sClassName, const RString &sValueName );
|
Commands GetMetricM( const RString &sClassName, const RString &sValueName );
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
apActorCommands GetMetricA( const RString &sClassName, const RString &sValueName );
|
apActorCommands GetMetricA( const RString &sClassName, const RString &sValueName );
|
||||||
|
#endif
|
||||||
|
|
||||||
void GetMetric( const RString &sClassName, const RString &sValueName, RString &valueOut ) { valueOut = GetMetric( sClassName, sValueName ); }
|
void GetMetric( const RString &sClassName, const RString &sValueName, RString &valueOut ) { valueOut = GetMetric( sClassName, sValueName ); }
|
||||||
void GetMetric( const RString &sClassName, const RString &sValueName, int &valueOut ) { valueOut = GetMetricI( sClassName, sValueName ); }
|
void GetMetric( const RString &sClassName, const RString &sValueName, int &valueOut ) { valueOut = GetMetricI( sClassName, sValueName ); }
|
||||||
@@ -79,7 +84,9 @@ public:
|
|||||||
void GetMetric( const RString &sClassName, const RString &sValueName, RageColor &valueOut ) { valueOut = GetMetricC( sClassName, sValueName ); }
|
void GetMetric( const RString &sClassName, const RString &sValueName, RageColor &valueOut ) { valueOut = GetMetricC( sClassName, sValueName ); }
|
||||||
void GetMetric( const RString &sClassName, const RString &sValueName, Command &valueOut );
|
void GetMetric( const RString &sClassName, const RString &sValueName, Command &valueOut );
|
||||||
void GetMetric( const RString &sClassName, const RString &sValueName, LuaExpression &valueOut );
|
void GetMetric( const RString &sClassName, const RString &sValueName, LuaExpression &valueOut );
|
||||||
|
#if !defined(SMPACKAGE)
|
||||||
void GetMetric( const RString &sClassName, const RString &sValueName, apActorCommands &valueOut );
|
void GetMetric( const RString &sClassName, const RString &sValueName, apActorCommands &valueOut );
|
||||||
|
#endif
|
||||||
|
|
||||||
RString GetString( const RString &sClassName, const RString &sValueName );
|
RString GetString( const RString &sClassName, const RString &sValueName );
|
||||||
|
|
||||||
|
|||||||
@@ -50,13 +50,15 @@ void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
|
|||||||
RString Dir = join( "/", parts.begin(), parts.end()-1 );
|
RString Dir = join( "/", parts.begin(), parts.end()-1 );
|
||||||
FILEMAN->Mount( "dir", Dir, "/" );
|
FILEMAN->Mount( "dir", Dir, "/" );
|
||||||
|
|
||||||
RString sMyDocumentsDir = GetMyDocumentsDir();
|
RString sMyDocumentsDir = SpecialDirs::GetMyDocumentsDir();
|
||||||
RString sApplicationDataDir = GetApplicationDataDir();
|
RString sApplicationDataDir = SpecialDirs::GetApplicationDataDir();
|
||||||
|
RString sDesktopDir = SpecialDirs::GetDesktopDir();
|
||||||
|
|
||||||
// Mount everything game-writable (not counting the editor) to the user's directory.
|
// Mount everything game-writable (not counting the editor) to the user's directory.
|
||||||
FILEMAN->Mount( "dir", sApplicationDataDir + PRODUCT_ID + "/Cache", "/Cache" );
|
FILEMAN->Mount( "dir", sApplicationDataDir + PRODUCT_ID + "/Cache", "/Cache" );
|
||||||
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Save", "/Save" );
|
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Save", "/Save" );
|
||||||
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Screenshots", "/Screenshots" );
|
FILEMAN->Mount( "dir", sMyDocumentsDir + PRODUCT_ID + "/Screenshots", "/Screenshots" );
|
||||||
|
FILEMAN->Mount( "dir", sDesktopDir, "/Desktop" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static CString LangIdToString( LANGID l )
|
static CString LangIdToString( LANGID l )
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "RegistryAccess.h"
|
#include "RegistryAccess.h"
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
RString GetMyDocumentsDir()
|
RString SpecialDirs::GetMyDocumentsDir()
|
||||||
{
|
{
|
||||||
CString sMyDocumentsDir;
|
CString sMyDocumentsDir;
|
||||||
bool bSuccess = RegistryAccess::GetRegValue( "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", sMyDocumentsDir );
|
bool bSuccess = RegistryAccess::GetRegValue( "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", sMyDocumentsDir );
|
||||||
@@ -13,17 +13,30 @@ RString GetMyDocumentsDir()
|
|||||||
return sMyDocumentsDir;
|
return sMyDocumentsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
RString GetApplicationDataDir()
|
RString SpecialDirs::GetApplicationDataDir()
|
||||||
{
|
{
|
||||||
CString sApplicationDataDir;
|
CString sDir;
|
||||||
TCHAR szDir[MAX_PATH] = "";
|
TCHAR szDir[MAX_PATH] = "";
|
||||||
BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_APPDATA, FALSE );
|
BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_APPDATA, FALSE );
|
||||||
ASSERT( bResult );
|
ASSERT( bResult );
|
||||||
sApplicationDataDir = szDir;
|
sDir = szDir;
|
||||||
sApplicationDataDir += "/";
|
sDir += "/";
|
||||||
return sApplicationDataDir;
|
return sDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RString SpecialDirs::GetDesktopDir()
|
||||||
|
{
|
||||||
|
CString sDir;
|
||||||
|
TCHAR szDir[MAX_PATH] = "";
|
||||||
|
BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_DESKTOP, FALSE );
|
||||||
|
ASSERT( bResult );
|
||||||
|
sDir = szDir;
|
||||||
|
sDir += "/";
|
||||||
|
return sDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2002-2004 Chris Danford
|
* (c) 2002-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
#ifndef SpecialDirs_H
|
#ifndef SpecialDirs_H
|
||||||
#define SpecialDirs_H
|
#define SpecialDirs_H
|
||||||
|
|
||||||
RString GetMyDocumentsDir();
|
namespace SpecialDirs
|
||||||
RString GetApplicationDataDir();
|
{
|
||||||
|
RString GetMyDocumentsDir();
|
||||||
|
RString GetApplicationDataDir();
|
||||||
|
RString GetDesktopDir();
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -297,6 +297,12 @@
|
|||||||
</File>
|
</File>
|
||||||
<Filter
|
<Filter
|
||||||
Name="system">
|
Name="system">
|
||||||
|
<File
|
||||||
|
RelativePath=".\archutils\Win32\AppInstance.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\archutils\Win32\AppInstance.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\archutils\Win32\arch_setup.h">
|
RelativePath=".\archutils\Win32\arch_setup.h">
|
||||||
</File>
|
</File>
|
||||||
@@ -348,6 +354,28 @@
|
|||||||
RelativePath=".\arch\ArchHooks\ArchHooksUtil.cpp">
|
RelativePath=".\arch\ArchHooks\ArchHooksUtil.cpp">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Dialog"
|
||||||
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath=".\arch\Dialog\Dialog.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\arch\Dialog\Dialog.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\arch\Dialog\DialogDriver.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\arch\Dialog\DialogDriver_Win32.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\arch\Dialog\DialogDriver_Win32.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\arch\Dialog\Selector_Dialog.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
@@ -513,18 +541,36 @@
|
|||||||
<Filter
|
<Filter
|
||||||
Name="Data Structures"
|
Name="Data Structures"
|
||||||
Filter="">
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath=".\Command.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Command.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\DateTime.cpp">
|
RelativePath=".\DateTime.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\DateTime.h">
|
RelativePath=".\DateTime.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\FontCharAliases.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\FontCharAliases.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\LocalizedString.cpp">
|
RelativePath=".\LocalizedString.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\LocalizedString.h">
|
RelativePath=".\LocalizedString.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\LuaBinding.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\LuaBinding.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\LuaReference.cpp">
|
RelativePath=".\LuaReference.cpp">
|
||||||
</File>
|
</File>
|
||||||
@@ -541,6 +587,12 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath=".\LuaManager.h">
|
RelativePath=".\LuaManager.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ThemeManager.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ThemeManager.h">
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\smpackage\install.bmp">
|
RelativePath=".\smpackage\install.bmp">
|
||||||
|
|||||||
@@ -376,4 +376,6 @@ void LanguagesDlg::OnBnClickedButtonImport()
|
|||||||
MessageBox( ssprintf("Imported %d strings into '%s'. %d empty strings were ignored.",iNumImported,sLanguageFile.c_str(),iNumIgnored) );
|
MessageBox( ssprintf("Imported %d strings into '%s'. %d empty strings were ignored.",iNumImported,sLanguageFile.c_str(),iNumIgnored) );
|
||||||
else
|
else
|
||||||
MessageBox( ssprintf("Failed to save '%s'.",sLanguageFile.c_str()) );
|
MessageBox( ssprintf("Failed to save '%s'.",sLanguageFile.c_str()) );
|
||||||
|
|
||||||
|
OnSelchangeListThemes();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user