assert if we try to use a non-loaded string

This commit is contained in:
Chris Danford
2006-01-07 06:48:42 +00:00
parent 4d49c60bff
commit 3a523f9c3e
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -32,12 +32,15 @@ RString LocalizedString::LocalizeString( const RString &sSection, const RString
LocalizedString::LocalizedString()
{
g_Subscribers.Subscribe( this );
m_bValueLoaded = false;
}
LocalizedString::LocalizedString( const RString &sSection, const RString &sName )
{
Load( sSection, sName );
g_Subscribers.Subscribe( this );
m_bValueLoaded = false;
Load( sSection, sName );
Refresh();
}
@@ -70,11 +73,12 @@ const RString &LocalizedString::GetValue() const
void LocalizedString::Refresh()
{
m_sValue = LocalizeString( m_sSection, m_sName );
m_bValueLoaded = true;
}
bool LocalizedString::IsLoaded() const
{
return !m_sSection.empty() && !m_sName.empty();
return m_bValueLoaded;
}
LuaFunction( LocalizeString, LocalizedString::LocalizeString( SArg(1), SArg(2) ) )