XML update
This commit is contained in:
+12
-12
@@ -212,7 +212,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
|
|||||||
{
|
{
|
||||||
FOREACH_CONST_Child( pNode, pChild )
|
FOREACH_CONST_Child( pNode, pChild )
|
||||||
{
|
{
|
||||||
if( pChild->m_sName == "Input" )
|
if( pChild->GetName() == "Input" )
|
||||||
{
|
{
|
||||||
/* If parameters are specified here, save their values to the actor. */
|
/* If parameters are specified here, save their values to the actor. */
|
||||||
RString sName;
|
RString sName;
|
||||||
@@ -235,7 +235,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
|
|||||||
LUA->Release( L );
|
LUA->Release( L );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pChild->m_sName == "Context" )
|
if( pChild->GetName() == "Context" )
|
||||||
{
|
{
|
||||||
RString sName;
|
RString sName;
|
||||||
if( !pChild->GetAttrValue( "Name", sName ) )
|
if( !pChild->GetAttrValue( "Name", sName ) )
|
||||||
@@ -262,17 +262,17 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
|
|||||||
{
|
{
|
||||||
// Load Name, if any.
|
// Load Name, if any.
|
||||||
const RString &sKeyName = pAttr->first;
|
const RString &sKeyName = pAttr->first;
|
||||||
const RString &sValue = pAttr->second;
|
const XNodeValue &sValue = pAttr->second;
|
||||||
if( sKeyName == "Name" ) SetName( sValue );
|
if( sKeyName == "Name" ) SetName( sValue.GetValue<RString>() );
|
||||||
else if( sKeyName == "BaseRotationX" ) SetBaseRotationX( StringToFloat(sValue) );
|
else if( sKeyName == "BaseRotationX" ) SetBaseRotationX( sValue.GetValue<float>() );
|
||||||
else if( sKeyName == "BaseRotationY" ) SetBaseRotationY( StringToFloat(sValue) );
|
else if( sKeyName == "BaseRotationY" ) SetBaseRotationY( sValue.GetValue<float>() );
|
||||||
else if( sKeyName == "BaseRotationZ" ) SetBaseRotationZ( StringToFloat(sValue) );
|
else if( sKeyName == "BaseRotationZ" ) SetBaseRotationZ( sValue.GetValue<float>() );
|
||||||
else if( sKeyName == "BaseZoomX" ) SetBaseZoomX( StringToFloat(sValue) );
|
else if( sKeyName == "BaseZoomX" ) SetBaseZoomX( sValue.GetValue<float>() );
|
||||||
else if( sKeyName == "BaseZoomY" ) SetBaseZoomY( StringToFloat(sValue) );
|
else if( sKeyName == "BaseZoomY" ) SetBaseZoomY( sValue.GetValue<float>() );
|
||||||
else if( sKeyName == "BaseZoomZ" ) SetBaseZoomZ( StringToFloat(sValue) );
|
else if( sKeyName == "BaseZoomZ" ) SetBaseZoomZ( sValue.GetValue<float>() );
|
||||||
else if( EndsWith(sKeyName,"Command") )
|
else if( EndsWith(sKeyName,"Command") )
|
||||||
{
|
{
|
||||||
apActorCommands apac = ActorUtil::ParseActorCommands( sValue );
|
apActorCommands apac = ActorUtil::ParseActorCommands( sValue.GetValue<RString>(), ssprintf("%s: %s", sDir.c_str(), sKeyName.c_str()) );
|
||||||
|
|
||||||
RString sCmdName = sKeyName.Left( sKeyName.size()-7 );
|
RString sCmdName = sKeyName.Left( sKeyName.size()-7 );
|
||||||
AddCommand( sCmdName, apac );
|
AddCommand( sCmdName, apac );
|
||||||
@@ -284,7 +284,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
|
|||||||
//
|
//
|
||||||
FOREACH_CONST_Child( pNode, c )
|
FOREACH_CONST_Child( pNode, c )
|
||||||
{
|
{
|
||||||
RString sKeyName = c->m_sName;
|
RString sKeyName = c->GetName();
|
||||||
|
|
||||||
if( sKeyName != "Command" )
|
if( sKeyName != "Command" )
|
||||||
continue; /* not a command */
|
continue; /* not a command */
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ static void MergeActorXML( XNode *pChild, const XNode *pParent )
|
|||||||
RString sWarning =
|
RString sWarning =
|
||||||
ssprintf( "Overriding \"%s\" (\"%s\") in XML node \"%s\" with \"%s\" in XML node \"%s\"",
|
ssprintf( "Overriding \"%s\" (\"%s\") in XML node \"%s\" with \"%s\" in XML node \"%s\"",
|
||||||
p->first.c_str(),
|
p->first.c_str(),
|
||||||
p->second.c_str(),
|
p->second.GetValue<RString>().c_str(),
|
||||||
pChild->GetName().c_str(),
|
pChild->GetName().c_str(),
|
||||||
sOld.c_str(),
|
sOld.c_str(),
|
||||||
pParent->GetName().c_str() );
|
pParent->GetName().c_str() );
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ void ExportStrings::Nsis()
|
|||||||
FOREACH_CONST_Attr( child, attr )
|
FOREACH_CONST_Attr( child, attr )
|
||||||
{
|
{
|
||||||
RString sName = attr->first;
|
RString sName = attr->first;
|
||||||
RString sValue = attr->second;
|
RString sValue = attr->second.GetValue<RString>();
|
||||||
sValue.Replace( "\\n", "$\\n" );
|
sValue.Replace( "\\n", "$\\n" );
|
||||||
RString sLine = ssprintf( "LangString %s ${LANG_%s} \"%s\"", sName.c_str(), sLangNameUpper.c_str(), sValue.c_str() );
|
RString sLine = ssprintf( "LangString %s ${LANG_%s} \"%s\"", sName.c_str(), sLangNameUpper.c_str(), sValue.c_str() );
|
||||||
out.PutLine( sLine );
|
out.PutLine( sLine );
|
||||||
|
|||||||
@@ -396,14 +396,14 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr
|
|||||||
FOREACH_CONST_Attr( pNode, pAttr )
|
FOREACH_CONST_Attr( pNode, pAttr )
|
||||||
{
|
{
|
||||||
RString sName = pAttr->first;
|
RString sName = pAttr->first;
|
||||||
const RString &sValue = pAttr->second;
|
const XNodeValue &sValue = pAttr->second;
|
||||||
|
|
||||||
sName.MakeUpper();
|
sName.MakeUpper();
|
||||||
|
|
||||||
/* If val is an integer, it's a width, eg. "10=27". */
|
/* If val is an integer, it's a width, eg. "10=27". */
|
||||||
if( IsAnInt(sName) )
|
if( IsAnInt(sName) )
|
||||||
{
|
{
|
||||||
cfg.m_mapGlyphWidths[atoi(sName)] = atoi( sValue );
|
cfg.m_mapGlyphWidths[atoi(sName)] = sValue.GetValue<int>();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,7 +439,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.CharToGlyphNo[c] = atoi( sValue );
|
cfg.CharToGlyphNo[c] = sValue.GetValue<int>();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -488,7 +488,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr
|
|||||||
iCount = iLast - iFirst + 1;
|
iCount = iLast - iFirst + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
RString sRet = cfg.MapRange( asMatches[0], iFirst, atoi(sValue), iCount );
|
RString sRet = cfg.MapRange( asMatches[0], iFirst, sValue.GetValue<int>(), iCount );
|
||||||
if( !sRet.empty() )
|
if( !sRet.empty() )
|
||||||
RageException::Throw( "Font definition \"%s\" has an invalid range \"%s\": %s.",
|
RageException::Throw( "Font definition \"%s\" has an invalid range \"%s\": %s.",
|
||||||
ini.GetPath().c_str(), sName.c_str(), sRet.c_str() );
|
ini.GetPath().c_str(), sName.c_str(), sRet.c_str() );
|
||||||
@@ -514,7 +514,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RStr
|
|||||||
ini.GetPath().c_str(), iFirstFrame, iNumFramesHigh );
|
ini.GetPath().c_str(), iFirstFrame, iNumFramesHigh );
|
||||||
|
|
||||||
/* Decode the string. */
|
/* Decode the string. */
|
||||||
const wstring wdata( RStringToWstring(sValue) );
|
const wstring wdata( RStringToWstring(sValue.GetValue<RString>()) );
|
||||||
|
|
||||||
if( int(wdata.size()) > iNumFramesWide )
|
if( int(wdata.size()) > iNumFramesWide )
|
||||||
RageException::Throw( "The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font is only %i characters wide.",
|
RageException::Throw( "The font definition \"%s\" assigns %i characters to row %i (\"%ls\"), but the font is only %i characters wide.",
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ bool IniFile::WriteFile( RageFileBasic &f ) const
|
|||||||
FOREACH_CONST_Attr( pKey, pAttr )
|
FOREACH_CONST_Attr( pKey, pAttr )
|
||||||
{
|
{
|
||||||
const RString &sName = pAttr->first;
|
const RString &sName = pAttr->first;
|
||||||
const RString &sValue = pAttr->second;
|
const RString &sValue = pAttr->second.GetValue<RString>();
|
||||||
|
|
||||||
// TODO: Are there esacpe rules for these?
|
// TODO: Are there esacpe rules for these?
|
||||||
DEBUG_ASSERT( sName.find('\n') == sName.npos );
|
DEBUG_ASSERT( sName.find('\n') == sName.npos );
|
||||||
|
|||||||
@@ -561,7 +561,8 @@ void InputMapper::ReadMappingsFromDisk()
|
|||||||
FOREACH_CONST_Attr( Key, i )
|
FOREACH_CONST_Attr( Key, i )
|
||||||
{
|
{
|
||||||
const RString &name = i->first;
|
const RString &name = i->first;
|
||||||
const RString &value = i->second;
|
RString value;
|
||||||
|
i->second.GetValue( value );
|
||||||
|
|
||||||
GameInput GameI;
|
GameInput GameI;
|
||||||
GameI.FromString( m_pInputScheme, name );
|
GameI.FromString( m_pInputScheme, name );
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void TitleTrans::LoadFromNode( const XNode* pNode )
|
|||||||
/* Surround each regex with ^(...)$, to force all comparisons to default
|
/* Surround each regex with ^(...)$, to force all comparisons to default
|
||||||
* to being a full-line match. (Add ".*" manually if this isn't wanted.) */
|
* to being a full-line match. (Add ".*" manually if this isn't wanted.) */
|
||||||
const RString &sKeyName = attr->first;
|
const RString &sKeyName = attr->first;
|
||||||
const RString &sValue = attr->second;
|
const RString &sValue = attr->second.GetValue<RString>();
|
||||||
if( sKeyName == "DontTransliterate" ) translit = false;
|
if( sKeyName == "DontTransliterate" ) translit = false;
|
||||||
else if( sKeyName == "TitleFrom" ) TitleFrom = "^(" + sValue + ")$";
|
else if( sKeyName == "TitleFrom" ) TitleFrom = "^(" + sValue + ")$";
|
||||||
else if( sKeyName == "ArtistFrom" ) ArtistFrom = "^(" + sValue + ")$";
|
else if( sKeyName == "ArtistFrom" ) ArtistFrom = "^(" + sValue + ")$";
|
||||||
|
|||||||
Reference in New Issue
Block a user