[default -> sm130futures] Bring up to date.

This commit is contained in:
Jason Felds
2011-05-01 21:35:20 -04:00
115 changed files with 1228 additions and 305 deletions
+11
View File
@@ -294,11 +294,22 @@ class LunaBPMDisplay: public Luna<BPMDisplay>
{
public:
static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); return 0; }
static int SetFromSong( T* p, lua_State *L )
{
if( lua_isnil(L,1) ) { p->NoBPM(); }
else
{
const Song* pSong = Luna<Song>::check( L, 1, true );
p->SetBpmFromSong(pSong);
}
return 0;
}
static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; }
LunaBPMDisplay()
{
ADD_METHOD( SetFromGameState );
ADD_METHOD( SetFromSong );
ADD_METHOD( GetText );
}
};
+4 -1
View File
@@ -17,6 +17,9 @@ REGISTER_ACTOR_CLASS( Banner );
ThemeMetric<bool> SCROLL_RANDOM ("Banner","ScrollRandom");
ThemeMetric<bool> SCROLL_ROULETTE ("Banner","ScrollRoulette");
//ThemeMetric<bool> SCROLL_MODE ("Banner","ScrollMode");
//ThemeMetric<bool> SCROLL_SORT_ORDER ("Banner","ScrollSortOrder");
ThemeMetric<float> SCROLL_SPEED_DIVISOR ("Banner","ScrollSpeedDivisor");
Banner::Banner()
{
@@ -79,7 +82,7 @@ void Banner::Update( float fDeltaTime )
if( m_bScrolling )
{
m_fPercentScrolling += fDeltaTime/2;
m_fPercentScrolling += fDeltaTime/(float)SCROLL_SPEED_DIVISOR;
m_fPercentScrolling -= (int)m_fPercentScrolling;
const RectF *pTextureRect = GetCurrentTextureCoordRect();
+133 -122
View File
@@ -12,12 +12,12 @@
#include "ScreenDimensions.h"
#include "ThemeManager.h"
// "PLAYER_X" offsets are relative to the pad.. ex: Setting this to 10, and the HELPER to 300, will put the dancer at 310
#define PLAYER_X( px ) THEME->GetMetricF("BeginnerHelper",ssprintf("Player%d_X",px+1))
// "PLAYER_X" offsets are relative to the pad. ex: Setting this to 10, and the HELPER to 300, will put the dancer at 310
#define PLAYER_X( px ) THEME->GetMetricF("BeginnerHelper",ssprintf("Player%dX",px+1))
#define PLAYER_ANGLE THEME->GetMetricF("BeginnerHelper","PlayerAngle")
#define DANCEPAD_ANGLE THEME->GetMetricF("BeginnerHelper","DancePadAngle")
// "HELPER" offsets effect the pad/dancer as a whole.. Their relative Y cooridinates are hard-coded for eachother.
// "HELPER" offsets effect the pad/dancer as a whole. Their relative Y cooridinates are hard-coded for each other.
#define HELPER_X THEME->GetMetricF("BeginnerHelper","HelperX")
#define HELPER_Y THEME->GetMetricF("BeginnerHelper","HelperY")
@@ -75,6 +75,108 @@ BeginnerHelper::~BeginnerHelper()
delete m_pDancePad;
}
bool BeginnerHelper::Init( int iDancePadType )
{
ASSERT( !m_bInitialized );
if( !CanUse() )
return false;
// If no players were successfully added, bail.
{
bool bAnyLoaded = false;
for( int pn=0; pn<NUM_PLAYERS; pn++ )
if( m_bPlayerEnabled[pn] )
bAnyLoaded = true;
if( !bAnyLoaded )
return false;
}
// Load the Background and flash. Flash only shows if the BG does.
if( m_bShowBackground )
{
m_sBackground.Load( THEME->GetPathG("BeginnerHelper","background") );
this->AddChild( m_sBackground );
//m_sBackground.SetXY( 1, 1 );
m_sFlash.Load( THEME->GetPathG("BeginnerHelper","flash") );
m_sFlash.SetXY( 0, 0 );
m_sFlash.SetDiffuseAlpha( 0 );
}
// Load StepCircle graphics
for( int lsc=0; lsc<NUM_PLAYERS; lsc++ )
{
for( int lsce=0; lsce<4; lsce++ )
{
m_sStepCircle[lsc][lsce].Load( THEME->GetPathG("BeginnerHelper","stepcircle") );
m_sStepCircle[lsc][lsce].SetZoom( 0 ); // Hide until needed.
this->AddChild(&m_sStepCircle[lsc][lsce]);
// Set StepCircle coordinates
switch( lsce )
{
case 0: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)-80),HELPER_Y); break; // Left
case 1: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)+80),HELPER_Y); break; // Right
case 2: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)),(HELPER_Y-60)); break; // Up
case 3: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)),(HELPER_Y+60)); break; // Down
}
}
}
SHOW_DANCE_PAD.Load( "BeginnerHelper","ShowDancePad" );
// Load the DancePad
if( SHOW_DANCE_PAD )
{
switch( iDancePadType )
{
case 0: break; // No pad
case 1: m_pDancePad->LoadMilkshapeAscii(GetAnimPath(ANIM_DANCE_PAD)); break;
case 2: m_pDancePad->LoadMilkshapeAscii(GetAnimPath(ANIM_DANCE_PADS)); break;
}
m_pDancePad->SetHorizAlign( align_left ); // xxx: hardcoded -aj
m_pDancePad->SetRotationX( DANCEPAD_ANGLE );
m_pDancePad->SetX( HELPER_X );
m_pDancePad->SetY( HELPER_Y );
// xxx: hardcoded -aj
m_pDancePad->SetZoom( 23 ); // Pad should always be 3 units bigger in zoom than the dancer.
}
for( int pl=0; pl<NUM_PLAYERS; pl++ ) // Load players
{
// Skip if not enabled
if( !m_bPlayerEnabled[pl] )
continue;
// Load character data
const Character *Character = GAMESTATE->m_pCurCharacters[pl];
ASSERT( Character != NULL );
// Load textures
m_pDancer[pl]->SetHorizAlign( align_left );
m_pDancer[pl]->LoadMilkshapeAscii( Character->GetModelPath() );
// Load needed animations
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-LEFT", GetAnimPath(ANIM_LEFT) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-DOWN", GetAnimPath(ANIM_DOWN) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-UP", GetAnimPath(ANIM_UP) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-RIGHT", GetAnimPath(ANIM_RIGHT) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-JUMPLR", GetAnimPath(ANIM_JUMPLR) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "rest", Character->GetRestAnimationPath() );
m_pDancer[pl]->SetDefaultAnimation( "rest" ); // Stay bouncing after a step has finished animating
m_pDancer[pl]->PlayAnimation( "rest" );
m_pDancer[pl]->SetRotationX( PLAYER_ANGLE );
m_pDancer[pl]->SetX( HELPER_X+PLAYER_X(pl) );
m_pDancer[pl]->SetY( HELPER_Y+10 );
m_pDancer[pl]->SetZoom( 20 );
m_pDancer[pl]->SetCullMode( CULL_NONE ); // many of the models floating around have the vertex order flipped
}
m_bInitialized = true;
return true;
}
void BeginnerHelper::ShowStepCircle( PlayerNumber pn, int CSTEP )
{
int isc=0; // Save OR issues within array boundries.. it's worth the extra few bytes of memory.
@@ -120,102 +222,6 @@ bool BeginnerHelper::CanUse()
return GAMESTATE->GetCurrentStyle()->m_bCanUseBeginnerHelper;
}
bool BeginnerHelper::Initialize( int iDancePadType )
{
ASSERT( !m_bInitialized );
if( !CanUse() )
return false;
// If no players were successfully added, bail.
{
bool bAnyLoaded = false;
for( int pn=0; pn<NUM_PLAYERS; pn++ )
if( m_bPlayerEnabled[pn] )
bAnyLoaded = true;
if( !bAnyLoaded )
return false;
}
// Load the Background and flash.. Flash only shows if the BG does.
if( m_bShowBackground )
{
m_sBackground.Load( THEME->GetPathG("BeginnerHelper","background") );
this->AddChild( &m_sBackground );
m_sBackground.SetXY( 1, 1 );
m_sFlash.Load( THEME->GetPathG("BeginnerHelper","flash") );
m_sFlash.SetXY( 0, 0 );
m_sFlash.SetDiffuseAlpha( 0 );
}
// Load StepCircle graphics
for( int lsc=0; lsc<NUM_PLAYERS; lsc++ )
{
for( int lsce=0; lsce<4; lsce++ )
{
m_sStepCircle[lsc][lsce].Load( THEME->GetPathG("BeginnerHelper","stepcircle") );
m_sStepCircle[lsc][lsce].SetZoom( 0 ); // Hide until needed.
this->AddChild(&m_sStepCircle[lsc][lsce]);
// Set coordinates of StepCircle
switch( lsce )
{
case 0: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)-80),HELPER_Y); break; // Left
case 1: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)+80),HELPER_Y); break; // Right
case 2: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)),(HELPER_Y-60)); break; // Up
case 3: m_sStepCircle[lsc][lsce].SetXY((HELPER_X+PLAYER_X(lsc)),(HELPER_Y+60)); break; // Down
}
}
}
// Load the DancePad
switch( iDancePadType )
{
case 0: break; // No pad
case 1: m_pDancePad->LoadMilkshapeAscii(GetAnimPath(ANIM_DANCE_PAD)); break;
case 2: m_pDancePad->LoadMilkshapeAscii(GetAnimPath(ANIM_DANCE_PADS)); break;
}
m_pDancePad->SetHorizAlign( align_left );
m_pDancePad->SetRotationX( DANCEPAD_ANGLE );
m_pDancePad->SetX( HELPER_X );
m_pDancePad->SetY( HELPER_Y );
m_pDancePad->SetZoom( 23 ); // Pad should always be 3 units bigger in zoom than the dancer.
for( int pl=0; pl<NUM_PLAYERS; pl++ ) // Load players
{
// Skip if not enabled
if( !m_bPlayerEnabled[pl] )
continue;
// Load character data
const Character *Character = GAMESTATE->m_pCurCharacters[pl];
ASSERT( Character != NULL );
// Load textures
m_pDancer[pl]->SetHorizAlign( align_left );
m_pDancer[pl]->LoadMilkshapeAscii( Character->GetModelPath() );
// Load needed animations
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-LEFT", GetAnimPath(ANIM_LEFT) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-DOWN", GetAnimPath(ANIM_DOWN) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-UP", GetAnimPath(ANIM_UP) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-RIGHT", GetAnimPath(ANIM_RIGHT) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "Step-JUMPLR", GetAnimPath(ANIM_JUMPLR) );
m_pDancer[pl]->LoadMilkshapeAsciiBones( "rest", Character->GetRestAnimationPath() );
m_pDancer[pl]->SetDefaultAnimation( "rest" ); // Stay bouncing after a step has finished animating
m_pDancer[pl]->PlayAnimation( "rest" );
m_pDancer[pl]->SetRotationX( PLAYER_ANGLE );
m_pDancer[pl]->SetX( HELPER_X+PLAYER_X(pl) );
m_pDancer[pl]->SetY( HELPER_Y+10 );
m_pDancer[pl]->SetZoom( 20 );
m_pDancer[pl]->SetCullMode( CULL_NONE ); // many of the models floating around have the vertex order flipped
}
m_bInitialized = true;
return true;
}
void BeginnerHelper::DrawPrimitives()
{
// If not initialized, don't bother with this
@@ -226,32 +232,37 @@ void BeginnerHelper::DrawPrimitives()
m_sFlash.Draw();
bool DrawCelShaded = PREFSMAN->m_bCelShadeModels;
if( DrawCelShaded )
m_pDancePad->DrawCelShaded();
else
// Draw Pad
if( SHOW_DANCE_PAD )
{
DISPLAY->SetLighting( true );
DISPLAY->SetLightDirectional(
0,
RageColor(0.5,0.5,0.5,1),
RageColor(1,1,1,1),
RageColor(0,0,0,1),
RageVector3(0, 0, 1) );
if( DrawCelShaded )
m_pDancePad->DrawCelShaded();
else
{
DISPLAY->SetLighting( true );
DISPLAY->SetLightDirectional(
0,
RageColor(0.5,0.5,0.5,1),
RageColor(1,1,1,1),
RageColor(0,0,0,1),
RageVector3(0, 0, 1) );
m_pDancePad->Draw();
DISPLAY->ClearZBuffer(); // So character doesn't step "into" the dance pad.
DISPLAY->SetLightOff( 0 );
DISPLAY->SetLighting( false );
m_pDancePad->Draw();
DISPLAY->ClearZBuffer(); // So character doesn't step "into" the dance pad.
DISPLAY->SetLightOff( 0 );
DISPLAY->SetLighting( false );
}
}
// Draw StepCircles
for(int scd=0; scd<NUM_PLAYERS; scd++)
for(int scde=0; scde<4; scde++)
m_sStepCircle[scd][scde].Draw();
// Draw Dancers
if( DrawCelShaded )
{
FOREACH_PlayerNumber( pn ) // Draw each dancer
FOREACH_PlayerNumber( pn )
if( GAMESTATE->IsHumanPlayer(pn) )
m_pDancer[pn]->DrawCelShaded();
}
@@ -265,7 +276,7 @@ void BeginnerHelper::DrawPrimitives()
RageColor(0,0,0,1),
RageVector3(0, 0, 1) );
FOREACH_PlayerNumber( pn ) // Draw each dancer
FOREACH_PlayerNumber( pn )
if( GAMESTATE->IsHumanPlayer(pn) )
m_pDancer[pn]->Draw();
@@ -314,7 +325,7 @@ void BeginnerHelper::Step( PlayerNumber pn, int CSTEP )
m_pDancer[pn]->SetRotationY( 0 );
break;
}
m_sFlash.StopEffect();
m_sFlash.StopTweening();
m_sFlash.Sleep( GAMESTATE->m_fCurBPS/16 );
@@ -337,22 +348,22 @@ void BeginnerHelper::Update( float fDeltaTime )
// Check if there are any notes at all on this row.. If not, save scanning.
if( !m_NoteData[pn].IsThereATapAtRow(iRow) )
continue;
// Find all steps on this row, in order to show the correct animations
int iStep = 0;
const int iNumTracks = m_NoteData[pn].GetNumTracks();
for( int t=0; t<iNumTracks; t++ )
if( m_NoteData[pn].GetTapNote(t,iRow).type == TapNote::tap )
iStep |= 1 << t;
// Assign new data
this->Step( pn, iStep );
}
}
// Make sure we don't accidentally scan a row 2x
m_iLastRowChecked = iCurRow;
// Update animations
ActorFrame::Update( fDeltaTime );
m_pDancePad->Update( fDeltaTime );
+6 -2
View File
@@ -4,8 +4,10 @@
#include "ActorFrame.h"
#include "Character.h"
#include "Sprite.h"
#include "AutoActor.h"
#include "PlayerNumber.h"
#include "NoteData.h"
#include "ThemeMetric.h"
class Model;
/** @brief A dancing character that follows the steps of the Song. */
class BeginnerHelper : public ActorFrame
@@ -14,7 +16,7 @@ public:
BeginnerHelper();
~BeginnerHelper();
bool Initialize( int iDancePadType );
bool Init( int iDancePadType );
bool IsInitialized() { return m_bInitialized; }
static bool CanUse();
void AddPlayer( PlayerNumber pn, const NoteData &nd );
@@ -32,12 +34,14 @@ protected:
Model *m_pDancer[NUM_PLAYERS];
Model *m_pDancePad;
Sprite m_sFlash;
Sprite m_sBackground;
AutoActor m_sBackground;
Sprite m_sStepCircle[NUM_PLAYERS][4]; // More memory, but much easier to manage
int m_iLastRowChecked;
int m_iLastRowFlashed;
bool m_bInitialized;
ThemeMetric<bool> SHOW_DANCE_PAD;
};
#endif
+12 -9
View File
@@ -91,7 +91,7 @@ int CourseEntry::GetNumModChanges() const
Course::Course(): m_bIsAutogen(false), m_sPath(""), m_sMainTitle(""),
m_sMainTitleTranslit(""), m_sSubTitle(""), m_sSubTitleTranslit(""),
m_sBannerPath(""), m_sBackgroundPath(""), m_sCDTitlePath(""),
m_sGroupName(""), m_bRepeat(false), m_fGoalSeconds(0),
m_sGroupName(""), m_sScripter(""), m_bRepeat(false), m_fGoalSeconds(0),
m_bShuffle(false), m_iLives(-1), m_bSortByMeter(false),
m_bIncomplete(false), m_vEntries(), m_SortOrder_TotalDifficulty(0),
m_SortOrder_Ranking(0), m_LoadedFromProfile(ProfileSlot_Invalid),
@@ -175,6 +175,7 @@ void Course::Init()
m_sMainTitleTranslit = "";
m_sSubTitle = "";
m_sSubTitleTranslit = "";
m_sScripter = "";
m_sBannerPath = "";
m_sBackgroundPath = "";
@@ -1091,6 +1092,7 @@ public:
static int GetGroupName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGroupName ); return 1; }
static int IsAutogen( T* p, lua_State *L ) { lua_pushboolean(L, p->m_bIsAutogen ); return 1; }
static int GetEstimatedNumStages( T* p, lua_State *L ) { lua_pushnumber(L, p->GetEstimatedNumStages() ); return 1; }
static int GetScripter( T* p, lua_State *L ) { lua_pushstring(L, p->m_sScripter ); return 1; }
static int GetTotalSeconds( T* p, lua_State *L )
{
StepsType st = Enum::Check<StepsType>(L, 1);
@@ -1111,28 +1113,29 @@ public:
LunaCourse()
{
ADD_METHOD( GetPlayMode ); // [sm-ssc] returns PlayMode enum now
ADD_METHOD( GetPlayMode );
ADD_METHOD( GetDisplayFullTitle );
ADD_METHOD( GetTranslitFullTitle );
ADD_METHOD( HasMods );
ADD_METHOD( HasTimedMods );
ADD_METHOD( GetCourseType ); // [sm-ssc] returns CourseType enum now
ADD_METHOD( GetCourseType );
ADD_METHOD( GetCourseEntry );
ADD_METHOD( GetCourseEntries );
ADD_METHOD( GetAllTrails );
ADD_METHOD( GetBannerPath );
ADD_METHOD( GetBackgroundPath ); // sm-ssc addition
ADD_METHOD( GetCourseDir ); // sm-ssc addition
ADD_METHOD( GetBackgroundPath );
ADD_METHOD( GetCourseDir );
ADD_METHOD( GetGroupName );
ADD_METHOD( IsAutogen );
ADD_METHOD( GetEstimatedNumStages );
ADD_METHOD( GetScripter );
ADD_METHOD( GetTotalSeconds );
ADD_METHOD( IsEndless );
ADD_METHOD( IsNonstop ); // sm-ssc addition
ADD_METHOD( IsOni ); // sm-ssc addition
ADD_METHOD( IsNonstop );
ADD_METHOD( IsOni );
ADD_METHOD( GetGoalSeconds );
ADD_METHOD( HasBanner ); // sm-ssc addition
ADD_METHOD( HasBackground ); // sm-ssc addition
ADD_METHOD( HasBanner );
ADD_METHOD( HasBackground );
ADD_METHOD( IsAnEdit );
}
};
+2 -1
View File
@@ -161,9 +161,10 @@ public:
RString m_sMainTitle, m_sMainTitleTranslit;
RString m_sSubTitle, m_sSubTitleTranslit;
RString m_sScripter;
RString m_sBannerPath;
RString m_sBackgroundPath; // after 9 years yes finally -aj
RString m_sBackgroundPath;
RString m_sCDTitlePath;
RString m_sGroupName;
+3 -1
View File
@@ -78,7 +78,9 @@ void CourseContentsList::SetItemFromGameState( Actor *pActor, int iCourseEntryIn
FOREACH_HumanPlayer(pn)
{
const Trail *pTrail = GAMESTATE->m_pCurTrail[pn];
if( pTrail == NULL || iCourseEntryIndex >= (int) pTrail->m_vEntries.size() )
if( pTrail == NULL
|| iCourseEntryIndex >= (int) pTrail->m_vEntries.size()
|| iCourseEntryIndex >= (int) pCourse->m_vEntries.size() )
continue;
const TrailEntry *te = &pTrail->m_vEntries[iCourseEntryIndex];
+4 -1
View File
@@ -65,6 +65,8 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
out.m_sMainTitle = sParams[1];
else if( 0 == stricmp(sValueName, "COURSETRANSLIT") )
out.m_sMainTitleTranslit = sParams[1];
else if( 0 == stricmp(sValueName, "SCRIPTER") )
out.m_sScripter = sParams[1];
else if( 0 == stricmp(sValueName, "REPEAT") )
{
RString str = sParams[1];
@@ -161,6 +163,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
// infer entry::Type from the first param
// todo: make sure these aren't generating bogus entries due
// to a lack of songs. -aj
LOG->Trace("[CourseLoaderCRS] sParams[1] = %s",sParams[1].c_str());
// most played
if( sParams[1].Left(strlen("BEST")) == "BEST" )
{
@@ -176,7 +179,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
new_entry.songSort = SongSort_FewestPlays;
}
// best grades
if( sParams[1].Left(strlen("GRADEBEST")) == "GRADEBEST" )
else if( sParams[1].Left(strlen("GRADEBEST")) == "GRADEBEST" )
{
new_entry.iChooseIndex = atoi( sParams[1].Right(sParams[1].size()-strlen("GRADEBEST")) ) - 1;
CLAMP( new_entry.iChooseIndex, 0, 500 );
+2
View File
@@ -46,6 +46,8 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin
f.PutLine( ssprintf("#COURSE:%s;", course.m_sMainTitle.c_str()) );
if( course.m_sMainTitleTranslit != "" )
f.PutLine( ssprintf("#COURSETRANSLIT:%s;", course.m_sMainTitleTranslit.c_str()) );
if( course.m_sScripter != "" )
f.PutLine( ssprintf("#SCRIPTER:%s;", course.m_sScripter.c_str()) );
if( course.m_bRepeat )
f.PutLine( "#REPEAT:YES;" );
if( course.m_iLives != -1 )
+9
View File
@@ -226,12 +226,14 @@ void FadingBanner::LoadRoulette()
{
BeforeChange();
m_Banner[m_iIndexLatest].LoadRoulette();
m_Banner[m_iIndexLatest].PlayCommand( "Roulette" );
}
void FadingBanner::LoadRandom()
{
BeforeChange();
m_Banner[m_iIndexLatest].LoadRandom();
m_Banner[m_iIndexLatest].PlayCommand( "Random" );
}
void FadingBanner::LoadFromSortOrder( SortOrder so )
@@ -252,6 +254,13 @@ void FadingBanner::LoadCourseFallback()
m_Banner[m_iIndexLatest].LoadCourseFallback();
}
void FadingBanner::LoadCustom( RString sBanner )
{
BeforeChange();
m_Banner[m_iIndexLatest].Load( THEME->GetPathG( "Banner", sBanner ) );
m_Banner[m_iIndexLatest].PlayCommand( sBanner );
}
// lua start
#include "LuaBinding.h"
+1
View File
@@ -29,6 +29,7 @@ public:
void LoadFromSortOrder( SortOrder so );
void LoadFallback();
void LoadCourseFallback();
void LoadCustom( RString sBanner );
bool LoadFromCachedBanner( const RString &path );
bool LoadFromCachedBackground( const RString &path );
-5
View File
@@ -157,11 +157,6 @@ void FontPage::SetTextureCoords( const vector<int> &widths, int iAdvanceExtraPix
void FontPage::SetExtraPixels( int iDrawExtraPixelsLeft, int iDrawExtraPixelsRight )
{
/* Hack: do one more than we were asked to; I think a lot of fonts are one
* too low. - glenn */
iDrawExtraPixelsRight++;
iDrawExtraPixelsLeft++;
if( (iDrawExtraPixelsLeft % 2) == 1 )
++iDrawExtraPixelsLeft;
+3 -5
View File
@@ -31,7 +31,7 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats *
bool bPlayerEnabled = GAMESTATE->IsPlayerEnabled( pPlayerState );
m_sprFrame.Load( THEME->GetPathG(sType,"frame") );
this->AddChild( &m_sprFrame );
this->AddChild( m_sprFrame );
m_sprBattery.Load( THEME->GetPathG(sType,"lives 1x4") );
m_sprBattery.SetName( ssprintf("BatteryP%i",int(pn+1)) );
@@ -87,7 +87,7 @@ void LifeMeterBattery::OnSongEnded()
m_iTrailingLivesLeft = m_iLivesLeft;
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
const Course *pCourse = GAMESTATE->m_pCurCourse;
if( pCourse && pCourse->m_vEntries[GAMESTATE->GetCourseSongIndex()].iGainLives > -1 )
m_iLivesLeft += pCourse->m_vEntries[GAMESTATE->GetCourseSongIndex()].iGainLives;
else
@@ -101,14 +101,12 @@ void LifeMeterBattery::OnSongEnded()
Refresh();
}
void LifeMeterBattery::ChangeLife( TapNoteScore score )
{
if( m_iLivesLeft == 0 )
return;
// xxx: this is hardcoded; we should use metrics for this. -aj
// How to: have a TapNote reference similar to LifeMeterBattery
// xxx: This is hardcoded; we should use metrics for this. -aj
switch( score )
{
case TNS_W1:
+2 -1
View File
@@ -7,6 +7,7 @@
#include "RageSound.h"
#include "PercentageDisplay.h"
#include "ThemeMetric.h"
#include "AutoActor.h"
/** @brief Battery life meter used in Oni mode. */
class LifeMeterBattery : public LifeMeter
@@ -45,7 +46,7 @@ private:
//ThemeMetric<> METRIC_NAME;
ThemeMetric<float> BATTERY_BLINK_TIME;
Sprite m_sprFrame;
AutoActor m_sprFrame;
Sprite m_sprBattery;
BitmapText m_textNumLives;
+5 -1
View File
@@ -24,9 +24,13 @@ ModIcon::ModIcon( const ModIcon &cpy ):
void ModIcon::Load( RString sMetricsGroup )
{
m_sprFilled.Load( THEME->GetPathG(sMetricsGroup,"Filled") );
m_sprFilled->SetName("Filled");
ActorUtil::LoadAllCommands( m_sprFilled, sMetricsGroup );
this->AddChild( m_sprFilled );
m_sprEmpty.Load( THEME->GetPathG(sMetricsGroup,"Empty") );
m_sprEmpty->SetName("Empty");
ActorUtil::LoadAllCommands( m_sprEmpty, sMetricsGroup );
this->AddChild( m_sprEmpty );
m_text.LoadFromFont( THEME->GetPathF(sMetricsGroup,"Text") );
@@ -70,7 +74,7 @@ void ModIcon::Set( const RString &_sText )
m_text.SetText( sText );
// This line makes Lua option rows crash: -aj
m_text.CropToWidth( CROP_TEXT_TO_WIDTH );
//m_text.CropToWidth( CROP_TEXT_TO_WIDTH );
}
/*
+2
View File
@@ -360,6 +360,8 @@ bool MusicWheel::SelectModeMenuItem()
return true;
}
// bool MusicWheel::SelectCustomItem()
void MusicWheel::GetSongList( vector<Song*> &arraySongs, SortOrder so )
{
vector<Song*> apAllSongs;
+1
View File
@@ -57,6 +57,7 @@ protected:
bool SelectSongOrCourse();
bool SelectCourse( const Course *p );
bool SelectModeMenuItem();
//bool SelectCustomItem();
virtual void UpdateSwitch();
+5
View File
@@ -178,6 +178,11 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach
out.m_sGenre = sParams[1];
}
else if( sValueName=="ORIGIN" )
{
out.m_sOrigin = sParams[1];
}
else if( sValueName=="CREDIT" )
{
out.m_sCredit = sParams[1];
+1 -1
View File
@@ -261,7 +261,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in )
RString desc = (USE_CREDIT ? in.GetCredit() : in.GetDescription());
lines.push_back( ssprintf( " %s:", SmEscape(desc).c_str() ) );
lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) );
lines.push_back( ssprintf( " %d:", in.GetMeter() ) );
lines.push_back( ssprintf( " %d:", clamp( in.GetMeter(), MIN_METER, MAX_METER ) ) );
vector<RString> asRadarValues;
// SM files don't use fakes for radar data. Keep it that way.
+2 -1
View File
@@ -55,6 +55,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out )
f.PutLine( ssprintf( "#SUBTITLETRANSLIT:%s;", SmEscape(out.m_sSubTitleTranslit).c_str() ) );
f.PutLine( ssprintf( "#ARTISTTRANSLIT:%s;", SmEscape(out.m_sArtistTranslit).c_str() ) );
f.PutLine( ssprintf( "#GENRE:%s;", SmEscape(out.m_sGenre).c_str() ) );
f.PutLine( ssprintf( "#ORIGIN:%s;", SmEscape(out.m_sOrigin).c_str() ) );
f.PutLine( ssprintf( "#CREDIT:%s;", SmEscape(out.m_sCredit).c_str() ) );
f.PutLine( ssprintf( "#BANNER:%s;", SmEscape(out.m_sBannerFile).c_str() ) );
f.PutLine( ssprintf( "#BACKGROUND:%s;", SmEscape(out.m_sBackgroundFile).c_str() ) );
@@ -293,7 +294,7 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
lines.push_back( ssprintf( "#DESCRIPTION:%s;", SmEscape(in.GetDescription()).c_str() ) );
lines.push_back( ssprintf( "#CHARTSTYLE:%s;", SmEscape(in.GetChartStyle()).c_str() ) );
lines.push_back( ssprintf( "#DIFFICULTY:%s;", DifficultyToString(in.GetDifficulty()).c_str() ) );
lines.push_back( ssprintf( "#METER:%d;", in.GetMeter() ) );
lines.push_back( ssprintf( "#METER:%d;", clamp( in.GetMeter(), MIN_METER, MAX_METER ) ) );
vector<RString> asRadarValues;
FOREACH_PlayerNumber( pn )
+6 -5
View File
@@ -168,7 +168,7 @@ void OptionRow::ChoicesChanged( RowType type )
vbSelected[0] = true;
}
// TRICKY: Insert a down arrow as the first choice in the row.
// TRICKY: Insert a down arrow as the first choice in the row.
if( m_bFirstItemGoesDown )
{
m_pHand->m_Def.m_vsChoices.insert( m_pHand->m_Def.m_vsChoices.begin(), NEXT_ROW_NAME );
@@ -178,7 +178,7 @@ void OptionRow::ChoicesChanged( RowType type )
InitText( type );
/* When choices change, the old focus position is meaningless; reset it. */
// When choices change, the old focus position is meaningless; reset it.
FOREACH_PlayerNumber( p )
SetChoiceInRowWithFocus( p, 0 );
@@ -260,7 +260,7 @@ void OptionRow::InitText( RowType type )
m_ModIcons[p] = new ModIcon( m_pParentType->m_ModIcon );
m_ModIcons[p]->SetDrawOrder(-1); // under title
m_ModIcons[p]->PlayCommand( "On" );
m_Frame.AddChild( m_ModIcons[p] );
GameCommand gc;
@@ -398,7 +398,7 @@ void OptionRow::InitText( RowType type )
this->SortByDrawOrder();
}
/* After importing options, choose which item is focused. */
// After importing options, choose which item is focused.
void OptionRow::AfterImportOptions( PlayerNumber pn )
{
/* We load items for both players on start, since we don't know which players
@@ -604,7 +604,7 @@ void OptionRow::UpdateEnabledDisabled()
FOREACH_HumanPlayer( pn )
{
bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end();
if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers )
{
if( m_bRowHasFocus[pn] ) color = m_pParentType->COLOR_SELECTED;
@@ -645,6 +645,7 @@ void OptionRow::SetModIcon( PlayerNumber pn, const RString &sText, GameCommand &
// update row frame
Message msg( "Refresh" );
msg.SetParam( "GameCommand", &gc );
msg.SetParam( "Text", sText );
m_sprFrame->HandleMessage( msg );
if( m_ModIcons[pn] != NULL )
m_ModIcons[pn]->Set( sText );
+1 -1
View File
@@ -35,7 +35,7 @@
* </li></ul>
*/
#ifndef PRODUCT_VER_BARE
#define PRODUCT_VER_BARE v1.2.4
#define PRODUCT_VER_BARE v1.2.5
#endif
/**
+1 -1
View File
@@ -5,7 +5,7 @@
; see ProductInfo.h for use descriptions
!define PRODUCT_ID "sm-ssc"
!define PRODUCT_VER "v1.2.4"
!define PRODUCT_VER "v1.2.5"
!define PRODUCT_DISPLAY "${PRODUCT_ID} ${PRODUCT_VER}"
!define PRODUCT_BITMAP "ssc"
+1 -1
View File
@@ -824,7 +824,7 @@ public:
if( pProfile )
pProfile->PushSelf(L);
else
lua_pushnil(L );
lua_pushnil(L);
return 1;
}
static int GetLocalProfileFromIndex( T* p, lua_State *L ) { Profile *pProfile = p->GetLocalProfileFromIndex(IArg(1)); ASSERT(pProfile); pProfile->PushSelf(L); return 1; }
+1 -2
View File
@@ -519,8 +519,7 @@ static MenuDef g_AreaMenu(
static MenuDef g_StepsInformation(
"ScreenMiniMenuStepsInformation",
MenuRowDef( ScreenEdit::difficulty, "Difficulty", true, EditMode_Practice, true, true, 0, NULL ),
// xxx: this giant list of numbers SUUUUUUUUUUCKS -aj
MenuRowDef( ScreenEdit::meter, "Meter", true, EditMode_Practice, true, false, 0, "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25" ),
MenuRowDef( ScreenEdit::meter, "Meter", true, EditMode_Practice, true, false, 0, MIN_METER, MAX_METER ),
MenuRowDef( ScreenEdit::description, "Description", true, EditMode_Practice, true, true, 0, NULL ),
MenuRowDef( ScreenEdit::chartstyle, "Chart Style", true, EditMode_Practice, true, true, 0, NULL ),
MenuRowDef( ScreenEdit::step_credit, "Step Author", true, EditMode_Practice, true, true, 0, NULL ),
+3 -2
View File
@@ -351,7 +351,7 @@ void ScreenEvaluation::Init()
{
FOREACH_EnabledPlayer( p )
{
m_sprPercentFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("percent frame p%d",p+1)) );
m_sprPercentFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("PercentFrame p%d",p+1)) );
m_sprPercentFrame[p]->SetName( ssprintf("PercentFrameP%d",p+1) );
ActorUtil::LoadAllCommands( *m_sprPercentFrame[p], m_sName );
SET_XY( m_sprPercentFrame[p] );
@@ -452,6 +452,7 @@ void ScreenEvaluation::Init()
}
// init judgment area
ROLLING_NUMBERS_CLASS.Load( m_sName, "RollingNumbersClass" );
FOREACH_ENUM( JudgmentLine, l )
{
if( l == JudgmentLine_W1 && !GAMESTATE->ShowW1() )
@@ -473,7 +474,7 @@ void ScreenEvaluation::Init()
{
m_textJudgmentLineNumber[l][p].LoadFromFont( THEME->GetPathF(m_sName, "JudgmentLineNumber") );
m_textJudgmentLineNumber[l][p].SetName( JudgmentLineToString(l)+ssprintf("NumberP%d",p+1) );
m_textJudgmentLineNumber[l][p].Load( "RollingNumbersJudgment" );
m_textJudgmentLineNumber[l][p].Load( ROLLING_NUMBERS_CLASS );
ActorUtil::LoadAllCommands( m_textJudgmentLineNumber[l][p], m_sName );
SET_XY( m_textJudgmentLineNumber[l][p] );
this->AddChild( &m_textJudgmentLineNumber[l][p] );
+2 -2
View File
@@ -76,10 +76,9 @@ protected:
// grade area
AutoActor m_sprGradeFrame[NUM_PLAYERS];
GradeDisplay m_Grades[NUM_PLAYERS];
GradeDisplay m_Grades[NUM_PLAYERS];
// points area
bool m_bNewSongsUnlocked;
PercentageDisplay m_Percent[NUM_PLAYERS];
AutoActor m_sprPercentFrame[NUM_PLAYERS];
@@ -115,6 +114,7 @@ protected:
RageSound m_soundStart; // sound played if the player passes or fails
ThemeMetric<bool> SUMMARY;
ThemeMetric<RString> ROLLING_NUMBERS_CLASS;
/** @brief Did a player save a screenshot of their score? */
bool m_bSavedScreenshot[NUM_PLAYERS];
};
+12 -11
View File
@@ -588,6 +588,7 @@ void ScreenGameplay::Init()
if( GAMESTATE->IsCourseMode() )
{
ASSERT( pi->m_ptextCourseSongNumber == NULL );
SONG_NUMBER_FORMAT.Load( m_sName, "SongNumberFormat" );
pi->m_ptextCourseSongNumber = new BitmapText;
pi->m_ptextCourseSongNumber->LoadFromFont( THEME->GetPathF(m_sName,"SongNum") );
pi->m_ptextCourseSongNumber->SetName( ssprintf("SongNumber%s",pi->GetName().c_str()) );
@@ -1011,7 +1012,7 @@ void ScreenGameplay::LoadNextSong()
{
pi->GetPlayerStageStats()->m_iSongsPlayed++;
if( pi->m_ptextCourseSongNumber )
pi->m_ptextCourseSongNumber->SetText( ssprintf("%d", pi->GetPlayerStageStats()->m_iSongsPassed+1) );
pi->m_ptextCourseSongNumber->SetText( ssprintf(SONG_NUMBER_FORMAT.GetValue(), pi->GetPlayerStageStats()->m_iSongsPassed+1) );
}
if( GAMESTATE->m_bMultiplayer )
@@ -1130,13 +1131,12 @@ void ScreenGameplay::LoadNextSong()
m_LyricDisplay.PlayCommand( bAllReverse? "SetReverse": bAtLeastOneReverse? "SetOneReverse": "SetNoReverse" );
// Load lyrics
// XXX: don't load this here
// XXX: don't load this here (who and why? -aj)
LyricsLoader LL;
if( GAMESTATE->m_pCurSong->HasLyrics() )
LL.LoadFromLRCFile(GAMESTATE->m_pCurSong->GetLyricsPath(), *GAMESTATE->m_pCurSong);
/* Set up song-specific graphics. */
// Set up song-specific graphics.
// Check to see if any players are in beginner mode.
// Note: steps can be different if turn modifiers are used.
@@ -1156,21 +1156,22 @@ void ScreenGameplay::LoadNextSong()
if( m_pSongForeground )
m_pSongForeground->Unload();
if( !PREFSMAN->m_bShowBeginnerHelper || !m_BeginnerHelper.Initialize(2) )
if( !PREFSMAN->m_bShowBeginnerHelper || !m_BeginnerHelper.Init(2) )
{
m_BeginnerHelper.SetVisible( false );
/* BeginnerHelper disabled, or failed to load. */
// BeginnerHelper disabled, or failed to load.
if( m_pSongBackground )
m_pSongBackground->LoadFromSong( GAMESTATE->m_pCurSong );
if( !GAMESTATE->m_bDemonstrationOrJukebox )
{
/* This will fade from a preset brightness to the actual brightness (based
* on prefs and "cover"). The preset brightness may be 0 (to fade from
* black), or it might be 1, if the stage screen has the song BG and we're
* coming from it (like Pump). This used to be done in SM_PlayReady, but
* that means it's impossible to snap to the new brightness immediately. */
/* This will fade from a preset brightness to the actual brightness
* (based on prefs and "cover"). The preset brightness may be 0 (to
* fade from black), or it might be 1, if the stage screen has the
* song BG and we're coming from it (like Pump). This used to be done
* in SM_PlayReady, but that means it's impossible to snap to the
* new brightness immediately. */
if( m_pSongBackground )
{
m_pSongBackground->SetBrightness( INITIAL_BACKGROUND_BRIGHTNESS );
+1
View File
@@ -193,6 +193,7 @@ protected:
ThemeMetric<int> FAIL_ON_MISS_COMBO;
ThemeMetric<bool> ALLOW_CENTER_1_PLAYER;
ThemeMetric<bool> UNPAUSE_WITH_START;
ThemeMetric<RString> SONG_NUMBER_FORMAT;
bool IsLastSong();
void SetupSong( int iSongIndex );
+1 -2
View File
@@ -35,8 +35,7 @@ void ScreenGameplaySyncMachine::Init()
SongUtil::GetPlayableSteps( &m_Song, vpSteps );
ASSERT_M(vpSteps.size() > 0, "No playable steps for ScreenGameplaySyncMachine");
Steps *pSteps = vpSteps[0];
// TODO: Either detect which player accessed this file, or FOREACH all of them. -Wolfman2000
GAMESTATE->m_pCurSteps[0].Set( pSteps );
GAMESTATE->m_pCurSteps[GAMESTATE->GetFirstHumanPlayer()].Set( pSteps );
GamePreferences::m_AutoPlay.Set( PC_HUMAN );
+15
View File
@@ -4,6 +4,7 @@
#define SCREEN_MINI_MENU_H
#include "ScreenOptions.h"
#include <sstream>
#include "GameConstantsAndTypes.h"
typedef bool (*MenuRowUpdateEnabled)();
@@ -76,6 +77,20 @@ struct MenuRowDef
PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25);
#undef PUSH
}
MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI,
int d, int low, int high ):
iRowCode(r), sName(n), bEnabled(e), pfnEnabled(NULL),
emShowIn(s), iDefaultChoice(d), choices(),
bThemeTitle(bTT), bThemeItems(bTI)
{
for ( int i = low; i <= high; i++ )
{
std::stringstream ss;
ss << i;
choices.push_back(ss.str().c_str());
}
}
void SetOneUnthemedChoice( const RString &sChoice )
{
+15 -3
View File
@@ -131,11 +131,11 @@ void ScreenOptions::Init()
LOAD_ALL_COMMANDS_AND_SET_XY( m_sprPage );
m_frameContainer.AddChild( m_sprPage );
// init line line highlights
// init line highlights
FOREACH_PlayerNumber( p )
{
m_sprLineHighlight[p].Load( THEME->GetPathG(m_sName,"LineHighlight") );
m_sprLineHighlight[p]->SetName( "LineHighlight" );
m_sprLineHighlight[p].Load( THEME->GetPathG(m_sName, ssprintf("LineHighlight P%d",p+1)) );
m_sprLineHighlight[p]->SetName( ssprintf("LineHighlightP%d",p+1) );
m_sprLineHighlight[p]->SetX( LINE_HIGHLIGHT_X );
LOAD_ALL_COMMANDS( m_sprLineHighlight[p] );
m_frameContainer.AddChild( m_sprLineHighlight[p] );
@@ -878,6 +878,13 @@ void ScreenOptions::ProcessMenuStart( const InputEventPlus &input )
m_pRows[iCurRow]->PositionUnderlines( pn );
RefreshIcons( iCurRow, pn );
Message msg( "SelectMultiple" );
msg.SetParam( "PlayerNumber", pn );
msg.SetParam( "RowIndex", iCurRow );
msg.SetParam( "ChoiceInRow", iChoiceInRow );
msg.SetParam( "Selected", bSelected );
MESSAGEMAN->Broadcast( msg );
if( row.GetFirstItemGoesDown() )
{
// move to the first choice in the row
@@ -990,6 +997,11 @@ void ScreenOptions::ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iCh
int iCurrentChoiceWithFocus = row.GetChoiceInRowWithFocus(pn);
int iDelta = iChoiceIndex - iCurrentChoiceWithFocus;
Message msg( "ChangeValue" );
msg.SetParam( "PlayerNumber", pn );
msg.SetParam( "RowIndex", iRow );
MESSAGEMAN->Broadcast( msg );
ChangeValueInRowRelative( iRow, pn, iDelta, bRepeat );
}
+10 -4
View File
@@ -14,10 +14,11 @@
#include "Style.h"
#include "Steps.h"
static void GetStepsForSong( Song *pSong, vector<Steps*> &vpStepsOut )
{
SongUtil::GetSteps( pSong, vpStepsOut, GAMESTATE->GetCurrentStyle()->m_StepsType );
// xxx: If the StepsType isn't valid for the current game, this will cause
// a crash when changing songs. -aj
StepsUtil::RemoveLockedSteps( pSong, vpStepsOut );
StepsUtil::SortNotesArrayByDifficulty( vpStepsOut );
}
@@ -334,7 +335,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
if( pSong )
{
Steps *pSteps = this->GetStepsForEntry( iEntryIndex );
ASSERT( pSteps );
ASSERT_M( pSteps, "No Steps for this Song!" );
CourseEntry ce;
ce.songID.FromSong( pSong );
ce.stepsCriteria.m_difficulty = pSteps->GetDifficulty();
@@ -447,8 +448,13 @@ void ScreenOptionsEditCourse::AfterChangeRow( PlayerNumber pn )
{
ScreenOptions::AfterChangeRow( pn );
SetCurrentSong();
SetCurrentSteps();
const int iCurRow = m_iCurrentRow[pn];
// only do this if it's not the first row. -aj
if( iCurRow > 0 )
{
SetCurrentSong();
SetCurrentSteps();
}
}
void ScreenOptionsEditCourse::AfterChangeValueInRow( int iRow, PlayerNumber pn )
+17 -4
View File
@@ -1722,10 +1722,13 @@ void ScreenSelectMusic::AfterMusicChange()
m_sSampleMusicToPlay = m_sRandomMusicPath;
break;
case TYPE_CUSTOM:
bWantBanner = false; // we load it ourself, or should
m_Banner.Load( THEME->GetPathG( "Banner", GetMusicWheel()->GetCurWheelItemData( GetMusicWheel()->GetCurrentIndex() )->m_pAction->m_sName.c_str() ) );
if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong )
m_sSampleMusicToPlay = m_sSectionMusicPath;
{
bWantBanner = false; // we load it ourself
RString sBannerName = GetMusicWheel()->GetCurWheelItemData( GetMusicWheel()->GetCurrentIndex() )->m_pAction->m_sName.c_str();
m_Banner.LoadCustom(sBannerName);
if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong )
m_sSampleMusicToPlay = m_sSectionMusicPath;
}
break;
default:
ASSERT(0);
@@ -1855,6 +1858,14 @@ void ScreenSelectMusic::AfterMusicChange()
AfterStepsOrTrailChange( vpns );
}
void ScreenSelectMusic::OpenOptionsList(PlayerNumber pn)
{
if( pn != PLAYER_INVALID )
{
m_OptionsList[pn].Open();
}
}
// lua start
#include "LuaBinding.h"
@@ -1867,11 +1878,13 @@ public:
p->GetMusicWheel()->PushSelf(L);
return 1;
}
static int OpenOptionsList( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); p->OpenOptionsList(pn); return 0; }
LunaScreenSelectMusic()
{
ADD_METHOD( GetGoToOptions );
ADD_METHOD( GetMusicWheel );
ADD_METHOD( OpenOptionsList );
}
};
+3 -1
View File
@@ -47,6 +47,8 @@ public:
bool GetGoToOptions() const { return m_bGoToOptions; }
MusicWheel *GetMusicWheel() { return &m_MusicWheel; }
void OpenOptionsList( PlayerNumber pn );
// Lua
virtual void PushSelf( lua_State *L );
@@ -60,7 +62,7 @@ protected:
void SwitchToPreferredDifficulty();
void AfterMusicChange();
void CheckBackgroundRequests( bool bForce );
void CheckBackgroundRequests( bool bForce );
bool DetectCodes( const InputEventPlus &input );
vector<Steps*> m_vpSteps;
+1
View File
@@ -110,6 +110,7 @@ namespace
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
int iCoins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit;
RString sCredits = CREDITS_CREDITS;
// todo: allow themers to change these strings -aj
if( iCredits > 0 || PREFSMAN->m_iCoinsPerCredit == 1 )
sCredits += ssprintf(" %d", iCredits);
if( PREFSMAN->m_iCoinsPerCredit > 1 )
+4 -4
View File
@@ -41,7 +41,7 @@
* @brief The internal version of the cache for StepMania.
*
* Increment this value to invalidate the current cache. */
const int FILE_CACHE_VERSION = 168;
const int FILE_CACHE_VERSION = 169;
/** @brief How long does a song sample last by default? */
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;
@@ -799,9 +799,7 @@ void Song::TidyUpData()
// Have a default combo segment of one just in case.
if( m_Timing.m_ComboSegments.empty() )
{
ComboSegment seg;
seg.m_iStartRow = 0;
seg.m_iCombo = 1;
ComboSegment seg(0, 1);
m_Timing.m_ComboSegments.push_back( seg );
}
@@ -1504,6 +1502,7 @@ public:
static int GetDisplayArtist( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayArtist() ); return 1; }
static int GetTranslitArtist( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitArtist() ); return 1; }
static int GetGenre( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGenre ); return 1; }
static int GetOrigin( T* p, lua_State *L ) { lua_pushstring(L, p->m_sOrigin ); return 1; }
static int GetAllSteps( T* p, lua_State *L )
{
const vector<Steps*> &v = p->GetAllSteps();
@@ -1629,6 +1628,7 @@ public:
ADD_METHOD( GetDisplayArtist );
ADD_METHOD( GetTranslitArtist );
ADD_METHOD( GetGenre );
ADD_METHOD( GetOrigin );
ADD_METHOD( GetAllSteps );
ADD_METHOD( GetStepsByStepsType );
ADD_METHOD( GetSongDir );
+3 -1
View File
@@ -17,7 +17,7 @@ struct lua_State;
struct BackgroundChange;
/** @brief The version of the .ssc file format. */
const static float STEPFILE_VERSION_NUMBER = 0.57f;
const static float STEPFILE_VERSION_NUMBER = 0.58f;
/** @brief How many edits for this song can each profile have? */
const int MAX_EDITS_PER_SONG_PER_PROFILE = 5;
@@ -222,6 +222,8 @@ public:
* This is read and saved, but never actually used. */
RString m_sCredit;
RString m_sOrigin; // song origin (for .ssc format)
RString m_sMusicFile;
RString m_sInstrumentTrackFile[NUM_InstrumentTrack];
+9
View File
@@ -1890,6 +1890,14 @@ public:
DEFINE_METHOD( ShortenGroupName, ShortenGroupName( SArg(1) ) )
static int GetCourseGroupNames( T* p, lua_State *L )
{
vector<RString> v;
p->GetCourseGroupNames( v );
LuaHelpers::CreateTableFromArray<RString>( v, L );
return 1;
}
LunaSongManager()
{
ADD_METHOD( GetAllSongs );
@@ -1898,6 +1906,7 @@ public:
ADD_METHOD( FindCourse );
ADD_METHOD( GetRandomSong );
ADD_METHOD( GetRandomCourse );
ADD_METHOD( GetCourseGroupNames );
ADD_METHOD( GetNumSongs );
ADD_METHOD( GetNumUnlockedSongs );
ADD_METHOD( GetNumSelectableAndUnlockedSongs );
+22
View File
@@ -806,6 +806,28 @@ void TimingData::ScaleRegion( float fScale, int iStartIndex, int iEndIndex, bool
m_WarpSegments[i].m_iStartRow = lrintf((iSegStartRow - iStartIndex) * fScale) + iStartIndex;
}
for ( unsigned i = 0; i < m_TickcountSegments.size(); i++ )
{
const int iSegStart = m_TickcountSegments[i].m_iStartRow;
if( iSegStart < iStartIndex )
continue;
else if( iSegStart > iEndIndex )
m_TickcountSegments[i].m_iStartRow += lrintf( (iEndIndex - iStartIndex) * (fScale - 1) );
else
m_TickcountSegments[i].m_iStartRow = lrintf( (iSegStart - iStartIndex) * fScale ) + iStartIndex;
}
for ( unsigned i = 0; i < m_ComboSegments.size(); i++ )
{
const int iSegStart = m_ComboSegments[i].m_iStartRow;
if( iSegStart < iStartIndex )
continue;
else if( iSegStart > iEndIndex )
m_ComboSegments[i].m_iStartRow += lrintf( (iEndIndex - iStartIndex) * (fScale - 1) );
else
m_ComboSegments[i].m_iStartRow = lrintf( (iSegStart - iStartIndex) * fScale ) + iStartIndex;
}
// adjust BPM changes to preserve timing
if( bAdjustBPM )
{
+43 -13
View File
@@ -33,7 +33,8 @@ static const char *UnlockRequirementNames[] =
"ExtraCleared",
"ExtraFailed",
"Toasties",
"StagesCleared"
"StagesCleared",
"NumberUnlocked"
};
XToString( UnlockRequirement );
StringToX( UnlockRequirement );
@@ -294,6 +295,7 @@ void UnlockManager::GetPoints( const Profile *pProfile, float fScores[NUM_Unlock
fScores[UnlockRequirement_SongPoints] = GetSongPoints( pProfile );
fScores[UnlockRequirement_DancePoints] = (float) pProfile->m_iTotalDancePoints;
fScores[UnlockRequirement_StagesCleared] = (float) pProfile->GetTotalNumSongsPassed();
fScores[UnlockRequirement_NumUnlocked] = (float) GetNumUnlocked();
}
/* Return true if all songs and/or courses referenced by an unlock are available. */
@@ -469,7 +471,7 @@ void UnlockManager::Load()
}
}
// Make sure that we don't have duplicate unlock IDs. This can cause problems
// Make sure that we don't have duplicate unlock IDs. This can cause problems
// with UnlockCelebrate and with codes.
FOREACH_CONST( UnlockEntry, m_UnlockEntries, ue )
FOREACH_CONST( UnlockEntry, m_UnlockEntries, ue2 )
@@ -514,9 +516,7 @@ void UnlockManager::Load()
}
}
//
// Log unlocks
//
FOREACH_CONST( UnlockEntry, m_UnlockEntries, e )
{
RString str = ssprintf( "Unlock: %s; ", join("\n",e->m_cmd.m_vsArgs).c_str() );
@@ -558,7 +558,7 @@ float UnlockManager::PointsUntilNextUnlock( UnlockRequirement t ) const
for( unsigned a=0; a<m_UnlockEntries.size(); a++ )
if( m_UnlockEntries[a].m_fRequirement[t] > fScores[t] )
fSmallestPoints = min( fSmallestPoints, m_UnlockEntries[a].m_fRequirement[t] );
if( fSmallestPoints == FLT_MAX )
return 0; // no match found
return fSmallestPoints - fScores[t];
@@ -673,7 +673,19 @@ public:
if( pSong ) { pSong->PushSelf(L); return 1; }
return 0;
}
static int GetCourse( T* p, lua_State *L )
{
Course *pCourse = p->m_Course.ToCourse();
if( pCourse ) { pCourse->PushSelf(L); return 1; }
return 0;
}
static int GetCode( T* p, lua_State *L )
{
lua_pushstring( L, p->m_sEntryID );
return 1;
}
// internal
static int GetArgs( T* p, lua_State *L )
{
Command cmd;
@@ -701,11 +713,13 @@ public:
LunaUnlockEntry()
{
ADD_METHOD( IsLocked );
ADD_METHOD( GetCode );
ADD_METHOD( GetDescription );
ADD_METHOD( GetUnlockRewardType );
ADD_METHOD( GetRequirement );
ADD_METHOD( GetRequirePassHardSteps );
ADD_METHOD( GetSong );
ADD_METHOD( GetCourse );
ADD_METHOD( song );
ADD_METHOD( steps );
ADD_METHOD( course );
@@ -748,7 +762,7 @@ public:
static int GetStepsUnlockedByEntryID( T* p, lua_State *L )
{
// Return the song each steps are associated with, too.
// Return the Song each Steps are associated with, too.
vector<Song *> apSongs;
vector<Difficulty> apDifficulty;
UNLOCKMAN->GetStepsUnlockedByEntryID( apSongs, apDifficulty, SArg(1) );
@@ -757,20 +771,36 @@ public:
return 2;
}
static int GetPoints( T* p, lua_State *L ) {
float fScores[NUM_UnlockRequirement];
UNLOCKMAN->GetPoints( PROFILEMAN->GetMachineProfile(), fScores );
lua_pushnumber( L, fScores[Enum::Check<UnlockRequirement>(L, 1)] );
return 1;
}
static int GetPointsForProfile( T* p, lua_State *L ) {
float fScores[NUM_UnlockRequirement];
UNLOCKMAN->GetPoints( Luna<Profile>::check(L,1), fScores );
lua_pushnumber( L, fScores[Enum::Check<UnlockRequirement>(L, 2)] );
return 1;
}
LunaUnlockManager()
{
ADD_METHOD( GetPointsUntilNextUnlock );
ADD_METHOD( AnyUnlocksToCelebrate );
ADD_METHOD( FindEntryID );
ADD_METHOD( UnlockEntryID );
ADD_METHOD( UnlockEntryIndex );
ADD_METHOD( PreferUnlockEntryID );
ADD_METHOD( GetNumUnlocks );
ADD_METHOD( GetNumUnlocked );
ADD_METHOD( GetUnlockEntryIndexToCelebrate );
ADD_METHOD( AnyUnlocksToCelebrate );
ADD_METHOD( GetUnlockEntry );
ADD_METHOD( GetPoints );
ADD_METHOD( GetPointsForProfile );
ADD_METHOD( GetPointsUntilNextUnlock );
ADD_METHOD( GetSongsUnlockedByEntryID );
ADD_METHOD( GetStepsUnlockedByEntryID );
ADD_METHOD( GetUnlockEntry );
ADD_METHOD( GetUnlockEntryIndexToCelebrate );
ADD_METHOD( PreferUnlockEntryID );
ADD_METHOD( UnlockEntryID );
ADD_METHOD( UnlockEntryIndex );
}
};
+2 -1
View File
@@ -25,6 +25,7 @@ enum UnlockRequirement
UnlockRequirement_ExtraFailed,
UnlockRequirement_Toasties,
UnlockRequirement_StagesCleared,
UnlockRequirement_NumUnlocked,
NUM_UnlockRequirement,
UnlockRequirement_Invalid,
};
@@ -100,7 +101,7 @@ public:
// Option is locked due to a #SELECTABLE tag.
#define LOCKED_SELECTABLE 0x4
// Option is disabled by the operator. (For courses, this means that a song in the
// Option is disabled by the operator. (For courses, this means that a song in the
// course is disabled.)
#define LOCKED_DISABLED 0x8