[Banner, FadingBanner] Various changes:
* Removed (now unused) All Music banner.
* Fixed swapped ScrollRandom and ScrollRoulette metrics.
* Added GetScrolling(), GetPercentScrolling() and SetScrolling(bool,float)
Lua bindings.
This commit is contained in:
@@ -22,6 +22,11 @@ sm-ssc v1.2 | 201012xx
|
||||
* Changed Steps picking logic in ScreenGameplaySyncMachine; now playable Steps
|
||||
are chosen, instead of whatever NoteData happens to be first.
|
||||
Also added pump-single data to ScreenGameplaySyncMachine music.sm. [freem]
|
||||
* [Banner, FadingBanner] Various changes: [freem]
|
||||
* Removed (now unused) All Music banner.
|
||||
* Fixed swapped ScrollRandom and ScrollRoulette metrics.
|
||||
* Added GetScrolling(), GetPercentScrolling() and SetScrolling(bool,float)
|
||||
Lua bindings.
|
||||
|
||||
20101225
|
||||
--------
|
||||
|
||||
+14
-17
@@ -15,7 +15,7 @@
|
||||
|
||||
REGISTER_ACTOR_CLASS( Banner )
|
||||
|
||||
ThemeMetric<bool> SCROLL_RANDOM ("Banner","ScrollRandom");
|
||||
ThemeMetric<bool> SCROLL_RANDOM ("Banner","ScrollRandom");
|
||||
ThemeMetric<bool> SCROLL_ROULETTE ("Banner","ScrollRoulette");
|
||||
|
||||
Banner::Banner()
|
||||
@@ -24,7 +24,7 @@ Banner::Banner()
|
||||
m_fPercentScrolling = 0;
|
||||
}
|
||||
|
||||
/* Ugly: if sIsBanner is false, we're actually loading something other than a banner. */
|
||||
// Ugly: if sIsBanner is false, we're actually loading something other than a banner.
|
||||
void Banner::Load( RageTextureID ID, bool bIsBanner )
|
||||
{
|
||||
if( ID.filename == "" )
|
||||
@@ -86,10 +86,10 @@ void Banner::Update( float fDeltaTime )
|
||||
|
||||
float fTexCoords[8] =
|
||||
{
|
||||
0+m_fPercentScrolling, pTextureRect->top, // top left
|
||||
0+m_fPercentScrolling, pTextureRect->top, // top left
|
||||
0+m_fPercentScrolling, pTextureRect->bottom, // bottom left
|
||||
1+m_fPercentScrolling, pTextureRect->bottom, // bottom right
|
||||
1+m_fPercentScrolling, pTextureRect->top, // top right
|
||||
1+m_fPercentScrolling, pTextureRect->top, // top right
|
||||
};
|
||||
Sprite::SetCustomTextureCoords( fTexCoords );
|
||||
}
|
||||
@@ -100,25 +100,19 @@ void Banner::SetScrolling( bool bScroll, float Percent)
|
||||
m_bScrolling = bScroll;
|
||||
m_fPercentScrolling = Percent;
|
||||
|
||||
/* Set up the texture coord rects for the current state. */
|
||||
// Set up the texture coord rects for the current state.
|
||||
Update(0);
|
||||
}
|
||||
|
||||
void Banner::LoadFromSong( Song* pSong ) // NULL means no song
|
||||
void Banner::LoadFromSong( Song* pSong ) // NULL means no song
|
||||
{
|
||||
if( pSong == NULL ) LoadFallback();
|
||||
else if( pSong->HasBanner() ) Load( pSong->GetBannerPath() );
|
||||
else LoadFallback();
|
||||
if( pSong == NULL ) LoadFallback();
|
||||
else if( pSong->HasBanner() ) Load( pSong->GetBannerPath() );
|
||||
else LoadFallback();
|
||||
|
||||
m_bScrolling = false;
|
||||
}
|
||||
|
||||
void Banner::LoadAllMusic()
|
||||
{
|
||||
Load( THEME->GetPathG("Banner","All") );
|
||||
m_bScrolling = false;
|
||||
}
|
||||
|
||||
void Banner::LoadMode()
|
||||
{
|
||||
Load( THEME->GetPathG("Banner","Mode") );
|
||||
@@ -211,13 +205,13 @@ void Banner::LoadFallbackCharacterIcon()
|
||||
void Banner::LoadRoulette()
|
||||
{
|
||||
Load( THEME->GetPathG("Banner","roulette") );
|
||||
m_bScrolling = (bool)SCROLL_RANDOM;
|
||||
m_bScrolling = (bool)SCROLL_ROULETTE;
|
||||
}
|
||||
|
||||
void Banner::LoadRandom()
|
||||
{
|
||||
Load( THEME->GetPathG("Banner","random") );
|
||||
m_bScrolling = (bool)SCROLL_ROULETTE;
|
||||
m_bScrolling = (bool)SCROLL_RANDOM;
|
||||
}
|
||||
|
||||
void Banner::LoadFromSortOrder( SortOrder so )
|
||||
@@ -298,6 +292,9 @@ public:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int GetScrolling( T* p, lua_State *L ){ lua_pushboolean( L, p->GetScrolling() ); return 1; }
|
||||
static int GetPercentScrolling( T* p, lua_State *L ){ lua_pushnumber( L, p->ScrollingPercent() ); return 1; }
|
||||
static int SetScrolling( T* p, lua_State *L ){ p->SetScrolling( BArg(1), FArg(2) ); return 0; }
|
||||
|
||||
LunaBanner()
|
||||
{
|
||||
|
||||
+1
-1
@@ -25,7 +25,6 @@ public:
|
||||
virtual void Update( float fDeltaTime );
|
||||
|
||||
void LoadFromSong( Song* pSong ); // NULL means no song
|
||||
void LoadAllMusic();
|
||||
void LoadMode();
|
||||
void LoadFromSongGroup( RString sSongGroup );
|
||||
void LoadFromCourse( const Course *pCourse );
|
||||
@@ -42,6 +41,7 @@ public:
|
||||
void LoadFallbackCharacterIcon();
|
||||
|
||||
void SetScrolling( bool bScroll, float Percent = 0 );
|
||||
void GetScrolling() const { return m_bScrolling; }
|
||||
float ScrollingPercent() const { return m_fPercentScrolling; }
|
||||
|
||||
// Lua
|
||||
|
||||
@@ -181,12 +181,6 @@ void FadingBanner::LoadFromSong( const Song* pSong )
|
||||
LoadFromCachedBanner( sPath );
|
||||
}
|
||||
|
||||
void FadingBanner::LoadAllMusic()
|
||||
{
|
||||
BeforeChange();
|
||||
m_Banner[m_iIndexLatest].LoadAllMusic();
|
||||
}
|
||||
|
||||
void FadingBanner::LoadMode()
|
||||
{
|
||||
BeforeChange();
|
||||
|
||||
+3
-4
@@ -19,7 +19,6 @@ public:
|
||||
* resolution banner, set bLowResToHighRes to true. */
|
||||
void Load( RageTextureID ID, bool bLowResToHighRes=false );
|
||||
void LoadFromSong( const Song* pSong ); // NULL means no song
|
||||
void LoadAllMusic();
|
||||
void LoadMode();
|
||||
void LoadFromSongGroup( RString sSongGroup );
|
||||
void LoadFromCourse( const Course* pCourse );
|
||||
@@ -45,11 +44,11 @@ protected:
|
||||
void BeforeChange( bool bLowResToHighRes=false );
|
||||
|
||||
static const int NUM_BANNERS = 5;
|
||||
Banner m_Banner[NUM_BANNERS];
|
||||
Banner m_Banner[NUM_BANNERS];
|
||||
int m_iIndexLatest;
|
||||
|
||||
bool m_bMovingFast;
|
||||
bool m_bSkipNextBannerUpdate;
|
||||
bool m_bMovingFast;
|
||||
bool m_bSkipNextBannerUpdate;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user