ActorCommands -> ActorUtil::ParseActorCommands
This commit is contained in:
@@ -261,7 +261,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
|
||||
else if( sKeyName == "BaseZoomZ" ) SetBaseZoomZ( StringToFloat(sValue) );
|
||||
else if( EndsWith(sKeyName,"Command") )
|
||||
{
|
||||
apActorCommands apac = ActorCommands( sValue );
|
||||
apActorCommands apac = ActorUtil::ParseActorCommands( sValue );
|
||||
|
||||
RString sCmdName = sKeyName.Left( sKeyName.size()-7 );
|
||||
AddCommand( sCmdName, apac );
|
||||
|
||||
@@ -394,6 +394,11 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent, Actor
|
||||
}
|
||||
}
|
||||
|
||||
apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands )
|
||||
{
|
||||
return ActorCommands( sCommands );
|
||||
}
|
||||
|
||||
void ActorUtil::SetXY( Actor& actor, const RString &sType )
|
||||
{
|
||||
ASSERT( !actor.GetName().empty() );
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "Actor.h"
|
||||
#include "RageTexture.h"
|
||||
#include "ActorCommands.h"
|
||||
|
||||
class XNode;
|
||||
|
||||
@@ -45,7 +46,7 @@ namespace ActorUtil
|
||||
void Register( const RString& sClassName, CreateActorFn pfn );
|
||||
Actor* Create( const RString& sClassName, const RString& sDir, const XNode* pNode, Actor *pParentActor );
|
||||
|
||||
|
||||
apActorCommands ParseActorCommands( const RString &sCommands );
|
||||
void SetXY( Actor& actor, const RString &sType );
|
||||
void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName );
|
||||
void LoadCommandFromName( Actor& actor, const RString &sType, const RString &sCommandName, const RString &sName );
|
||||
|
||||
@@ -158,7 +158,7 @@ void BGAnimation::LoadFromNode( const RString& sDir, const XNode* pNode )
|
||||
Actor *pActor = new Actor;
|
||||
pActor->SetName( "BGAnimation dummy" );
|
||||
pActor->SetHidden( true );
|
||||
apActorCommands ap = ActorCommands( ssprintf("sleep,%f",fLengthSeconds) );
|
||||
apActorCommands ap = ActorUtil::ParseActorCommands( ssprintf("sleep,%f",fLengthSeconds) );
|
||||
pActor->AddCommand( "On", ap );
|
||||
AddChild( pActor );
|
||||
}
|
||||
|
||||
@@ -187,12 +187,12 @@ void BackgroundImpl::Init()
|
||||
RString sCmdLeaves;
|
||||
bool bSuccess = xml.GetAttrValue( "LeavesCommand", sCmdLeaves );
|
||||
ASSERT( bSuccess );
|
||||
bgt.cmdLeaves = ActorCommands( sCmdLeaves );
|
||||
bgt.cmdLeaves = ActorUtil::ParseActorCommands( sCmdLeaves );
|
||||
|
||||
RString sCmdRoot;
|
||||
bSuccess = xml.GetAttrValue( "RootCommand", sCmdRoot );
|
||||
ASSERT( bSuccess );
|
||||
bgt.cmdRoot = ActorCommands( sCmdRoot );
|
||||
bgt.cmdRoot = ActorUtil::ParseActorCommands( sCmdRoot );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
|
||||
* may look something like "BGAnimation, BGAnimationLayer, Sprite" or it
|
||||
* may be deeper, like "BGAnimation, BGAnimationLayer, BGAnimation,
|
||||
* BGAnimationLayer, Sprite". */
|
||||
pBGA->RunCommands( ActorCommands("effectclock,music") );
|
||||
pBGA->RunCommands( ActorUtil::ParseActorCommands("effectclock,music") );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ bool NoteSkinManager::GetMetricB( const RString &sButtonName, const RString &sVa
|
||||
|
||||
apActorCommands NoteSkinManager::GetMetricA( const RString &sButtonName, const RString &sValueName )
|
||||
{
|
||||
return ActorCommands( GetMetric(sButtonName,sValueName) );
|
||||
return ActorUtil::ParseActorCommands( GetMetric(sButtonName,sValueName) );
|
||||
}
|
||||
|
||||
RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sElement )
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#define NOTE_SKIN_MANAGER_H
|
||||
|
||||
#include "ActorCommands.h"
|
||||
#include "ActorUtil.h"
|
||||
#include "RageTypes.h"
|
||||
#include "PlayerNumber.h"
|
||||
#include "IniFile.h"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "GameState.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "PlayerState.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
#define ITEM_X( i ) THEME->GetMetricF("ScoreDisplayBattle",ssprintf("Item%dX",i+1))
|
||||
#define ITEM_Y( i ) THEME->GetMetricF("ScoreDisplayBattle",ssprintf("Item%dY",i+1))
|
||||
@@ -50,14 +51,14 @@ void ScoreDisplayBattle::Update( float fDelta )
|
||||
|
||||
if( sNewModifier == "" )
|
||||
{
|
||||
m_ItemIcon[s].RunCommands( ActorCommands( "linear,0.25;zoom,0" ) );
|
||||
m_ItemIcon[s].RunCommands( ActorUtil::ParseActorCommands( "linear,0.25;zoom,0" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Cache all of the icon graphics so we don't load them dynamically from disk.
|
||||
m_ItemIcon[s].Load( THEME->GetPathG("ScoreDisplayBattle","icon "+sNewModifier) );
|
||||
m_ItemIcon[s].StopTweening();
|
||||
apActorCommands acmds = ActorCommands(
|
||||
apActorCommands acmds = ActorUtil::ParseActorCommands(
|
||||
"diffuse,1,1,1,1;zoom,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
"sleep,0.1;linear,0;diffusealpha,1;"
|
||||
|
||||
@@ -103,7 +103,7 @@ void ScreenEnding::Init()
|
||||
break;
|
||||
}
|
||||
SET_XY_AND_ON_COMMAND( m_sprRemoveMemoryCard[p] );
|
||||
m_sprRemoveMemoryCard[p].AddCommand( ssprintf("CardRemovedP%dMessage",p+1), ActorCommands("hidden,1") );
|
||||
m_sprRemoveMemoryCard[p].AddCommand( ssprintf("CardRemovedP%dMessage",p+1), ActorUtil::ParseActorCommands("hidden,1") );
|
||||
this->AddChild( &m_sprRemoveMemoryCard[p] );
|
||||
}
|
||||
|
||||
|
||||
@@ -410,10 +410,10 @@ void ScreenEz2SelectMusic::MenuBack( const InputEventPlus &input )
|
||||
|
||||
void ScreenEz2SelectMusic::TweenOffScreen()
|
||||
{
|
||||
apActorCommands cmds = ActorCommands( "linear,0.5;zoomy,0" );
|
||||
apActorCommands cmds = ActorUtil::ParseActorCommands( "linear,0.5;zoomy,0" );
|
||||
m_MusicBannerWheel.RunCommands( cmds );
|
||||
|
||||
apActorCommands cmds2 = ActorCommands( "Linear,1;DiffuseAlpha,0" );
|
||||
apActorCommands cmds2 = ActorUtil::ParseActorCommands( "Linear,1;DiffuseAlpha,0" );
|
||||
m_PumpDifficultyCircle.RunCommands( cmds2 );
|
||||
m_Guide.RunCommands( cmds2 );
|
||||
m_PumpDifficultyRating.RunCommands( cmds2 );
|
||||
|
||||
@@ -157,12 +157,12 @@ void ScreenUnlockStatus::Init()
|
||||
//LOG->Trace("Target Row: %f", TargetRow);
|
||||
//LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() );
|
||||
RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY);
|
||||
text->RunCommands( ActorCommands(sCommand) );
|
||||
text->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
|
||||
}
|
||||
else
|
||||
{
|
||||
RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY);
|
||||
text->RunCommands( ActorCommands(sCommand) );
|
||||
text->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
|
||||
}
|
||||
|
||||
item.push_back(text);
|
||||
@@ -189,12 +189,12 @@ void ScreenUnlockStatus::Init()
|
||||
//LOG->Trace("Target Row: %f", TargetRow);
|
||||
//LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() );
|
||||
RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY);
|
||||
IconCount->RunCommands( ActorCommands(sCommand) );
|
||||
IconCount->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
|
||||
}
|
||||
else
|
||||
{
|
||||
RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY);
|
||||
IconCount->RunCommands( ActorCommands(sCommand) );
|
||||
IconCount->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
|
||||
}
|
||||
|
||||
ItemIcons.push_back(IconCount);
|
||||
@@ -252,7 +252,7 @@ void ScreenUnlockStatus::Init()
|
||||
NewText->SetXY(ScrollingTextX, ScrollingTextStartY);
|
||||
{
|
||||
RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows ));
|
||||
NewText->RunCommands( ActorCommands(sCommand) );
|
||||
NewText->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
|
||||
}
|
||||
|
||||
// new unlock graphic
|
||||
@@ -263,7 +263,7 @@ void ScreenUnlockStatus::Init()
|
||||
NewIcon->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE);
|
||||
{
|
||||
RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows ));
|
||||
NewIcon->RunCommands( ActorCommands(sCommand) );
|
||||
NewIcon->RunCommands( ActorUtil::ParseActorCommands(sCommand) );
|
||||
}
|
||||
|
||||
ItemIcons.push_back(NewIcon);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "SpecialFiles.h"
|
||||
#include "EnumHelper.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
||||
|
||||
@@ -945,7 +946,7 @@ RageColor ThemeManager::GetMetricC( const RString &sClassName, const RString &sV
|
||||
apActorCommands ThemeManager::GetMetricA( const RString &sClassName, const RString &sValueName )
|
||||
{
|
||||
RString sValue = GetMetricRaw( g_pLoadedThemeData->iniMetrics, sClassName, sValueName );
|
||||
return ActorCommands( sValue );
|
||||
return ActorUtil::ParseActorCommands( sValue );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user