Merge because I forgot to update first.

This commit is contained in:
Colby Klein
2010-12-20 08:41:10 -08:00
34 changed files with 105 additions and 118 deletions
+9
View File
@@ -13,6 +13,15 @@ _____________________________________________________________________________
sm-ssc v1.2 | 201012xx sm-ssc v1.2 | 201012xx
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
20101219
--------
* [WheelNotifyIcon] add BlinkPlayersBest metric. [freem]
* [GameCommand] Add GetScreen, GetSteps, GetCourse, GetTrail, and GetCharacter
Lua bindings. [freem]
* [StreamDisplay] Remove UseThreePartMethod.
* [Style] Add ColumnsPerPlayer and NeedsZoomOutWith2Players bindings. [freem]
* [Profile] Add GetLastUsedHighScoreName Lua binding. [freem]
20101218 20101218
-------- --------
* [MusicWheelItem] Add OverPart. [freem] * [MusicWheelItem] Add OverPart. [freem]
Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+11
View File
@@ -133,6 +133,17 @@ function Actor:Center()
self:y(SCREEN_CENTER_Y) self:y(SCREEN_CENTER_Y)
end end
function Actor:bezier(...)
local a = {...}
local b = {}
local c = 0
assert((a == 10 or a == 6), "bad number of arguments for Actor:bezier()")
for i=3,c do
b[#b+1] = a[i]
end
a[1]:tween(a[2], "TweenMode_Bezier", b)
end
-- (c) 2006 Glenn Maynard -- (c) 2006 Glenn Maynard
-- All rights reserved. -- All rights reserved.
-- --
+15 -14
View File
@@ -1187,6 +1187,7 @@ AfterSetCommand=%TextBannerAfterSet
[WheelNotifyIcon] [WheelNotifyIcon]
ShowTraining=false ShowTraining=false
BlinkPlayersBest=true
# 04 # # 04 #
[Screen] [Screen]
@@ -3381,60 +3382,60 @@ Row6Y=SCREEN_CENTER_Y+80
Row7Y=SCREEN_CENTER_Y+120 Row7Y=SCREEN_CENTER_Y+120
Label1X=SCREEN_CENTER_X-250 Label1X=SCREEN_CENTER_X-250
Label1Y=THEME:GetMetric("EditMode","Row1Y") Label1Y=THEME:GetMetric("EditMenu","Row1Y")
Label1OnCommand=shadowlength,1;zoom,0.75 Label1OnCommand=shadowlength,1;zoom,0.75
Label1OffCommand= Label1OffCommand=
Label2X=SCREEN_CENTER_X-250 Label2X=SCREEN_CENTER_X-250
Label2Y=THEME:GetMetric("EditMode","Row2Y") Label2Y=THEME:GetMetric("EditMenu","Row2Y")
Label2OnCommand=shadowlength,1;zoom,0.75 Label2OnCommand=shadowlength,1;zoom,0.75
Label2OffCommand= Label2OffCommand=
Label3X=SCREEN_CENTER_X-250 Label3X=SCREEN_CENTER_X-250
Label3Y=THEME:GetMetric("EditMode","Row3Y") Label3Y=THEME:GetMetric("EditMenu","Row3Y")
Label3OnCommand=shadowlength,1;zoom,0.75 Label3OnCommand=shadowlength,1;zoom,0.75
Label3OffCommand= Label3OffCommand=
Label4X=SCREEN_CENTER_X-250 Label4X=SCREEN_CENTER_X-250
Label4Y=THEME:GetMetric("EditMode","Row4Y") Label4Y=THEME:GetMetric("EditMenu","Row4Y")
Label4OnCommand=shadowlength,1;zoom,0.75 Label4OnCommand=shadowlength,1;zoom,0.75
Label4OffCommand= Label4OffCommand=
Label5X=SCREEN_CENTER_X-250 Label5X=SCREEN_CENTER_X-250
Label5Y=THEME:GetMetric("EditMode","Row5Y") Label5Y=THEME:GetMetric("EditMenu","Row5Y")
Label5OnCommand=shadowlength,1;zoom,0.75 Label5OnCommand=shadowlength,1;zoom,0.75
Label5OffCommand= Label5OffCommand=
Label6X=SCREEN_CENTER_X-250 Label6X=SCREEN_CENTER_X-250
Label6Y=THEME:GetMetric("EditMode","Row6Y") Label6Y=THEME:GetMetric("EditMenu","Row6Y")
Label6OnCommand=shadowlength,1;zoom,0.75 Label6OnCommand=shadowlength,1;zoom,0.75
Label6OffCommand= Label6OffCommand=
Label7X=SCREEN_CENTER_X-250 Label7X=SCREEN_CENTER_X-250
Label7Y=THEME:GetMetric("EditMode","Row7Y") Label7Y=THEME:GetMetric("EditMenu","Row7Y")
Label7OnCommand=shadowlength,1;zoom,0.75 Label7OnCommand=shadowlength,1;zoom,0.75
Label7OffCommand= Label7OffCommand=
Value1X=SCREEN_CENTER_X Value1X=SCREEN_CENTER_X
Value1Y=THEME:GetMetric("EditMode","Row1Y") Value1Y=THEME:GetMetric("EditMenu","Row1Y")
Value1OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value1OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value1OffCommand= Value1OffCommand=
Value2X=SCREEN_CENTER_X+60 Value2X=SCREEN_CENTER_X+60
Value2Y=THEME:GetMetric("EditMode","Row2Y") Value2Y=THEME:GetMetric("EditMenu","Row2Y")
Value2OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value2OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value2OffCommand= Value2OffCommand=
Value3X=SCREEN_CENTER_X+60 Value3X=SCREEN_CENTER_X+60
Value3Y=THEME:GetMetric("EditMode","Row3Y") Value3Y=THEME:GetMetric("EditMenu","Row3Y")
Value3OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value3OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value3OffCommand= Value3OffCommand=
Value4X=SCREEN_CENTER_X Value4X=SCREEN_CENTER_X
Value4Y=THEME:GetMetric("EditMode","Row4Y") Value4Y=THEME:GetMetric("EditMenu","Row4Y")
Value4OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value4OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value4OffCommand= Value4OffCommand=
Value5X=SCREEN_CENTER_X+60 Value5X=SCREEN_CENTER_X+60
Value5Y=THEME:GetMetric("EditMode","Row5Y") Value5Y=THEME:GetMetric("EditMenu","Row5Y")
Value5OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value5OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value5OffCommand= Value5OffCommand=
Value6X=SCREEN_CENTER_X Value6X=SCREEN_CENTER_X
Value6Y=THEME:GetMetric("EditMode","Row6Y") Value6Y=THEME:GetMetric("EditMenu","Row6Y")
Value6OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value6OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value6OffCommand= Value6OffCommand=
Value7X=SCREEN_CENTER_X+60 Value7X=SCREEN_CENTER_X+60
Value7Y=THEME:GetMetric("EditMode","Row7Y") Value7Y=THEME:GetMetric("EditMenu","Row7Y")
Value7OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65 Value7OnCommand=shadowlength,1;zoom,0.75;maxwidth,SCREEN_CENTER_X*0.65
Value7OffCommand= Value7OffCommand=
-4
View File
@@ -42,10 +42,6 @@ void CourseContentsList::SetFromGameState()
{ {
RemoveAllChildren(); RemoveAllChildren();
// FIXME: Is there a better way to handle when players don't have
// the same number of TrailEntries?
// They have to have the same number, and of the same songs, or gameplay
// isn't going to line up.
if( GAMESTATE->m_MasterPlayerNumber == PlayerNumber_Invalid ) if( GAMESTATE->m_MasterPlayerNumber == PlayerNumber_Invalid )
return; return;
const Trail *pMasterTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber]; const Trail *pMasterTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber];
-2
View File
@@ -73,9 +73,7 @@ void DateTime::StripTime()
tm_sec = 0; tm_sec = 0;
} }
//
// Common SQL/XML format: "YYYY-MM-DD HH:MM:SS" // Common SQL/XML format: "YYYY-MM-DD HH:MM:SS"
//
RString DateTime::GetString() const RString DateTime::GetString() const
{ {
RString s = ssprintf( "%d-%02d-%02d", RString s = ssprintf( "%d-%02d-%02d",
+1
View File
@@ -78,6 +78,7 @@ void StepsDisplayList::LoadFromNode( const XNode* pNode )
for( unsigned m = 0; m < m_Lines.size(); ++m ) for( unsigned m = 0; m < m_Lines.size(); ++m )
{ {
// todo: Row1, Row2? also m_sName+"Row" -aj
m_Lines[m].m_Meter.SetName( "Row" ); m_Lines[m].m_Meter.SetName( "Row" );
m_Lines[m].m_Meter.Load( "StepsDisplayListRow", NULL ); m_Lines[m].m_Meter.Load( "StepsDisplayListRow", NULL );
this->AddChild( &m_Lines[m].m_Meter ); this->AddChild( &m_Lines[m].m_Meter );
+16
View File
@@ -852,6 +852,8 @@ bool GameCommand::IsZero() const
// lua start // lua start
#include "LuaBinding.h" #include "LuaBinding.h"
#include "Game.h" #include "Game.h"
#include "Steps.h"
#include "Character.h"
class LunaGameCommand: public Luna<GameCommand> class LunaGameCommand: public Luna<GameCommand>
{ {
@@ -861,8 +863,13 @@ public:
static int GetIndex( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iIndex ); return 1; } static int GetIndex( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iIndex ); return 1; }
static int GetMultiPlayer( T* p, lua_State *L ) { lua_pushnumber(L, p->m_MultiPlayer); return 1; } static int GetMultiPlayer( T* p, lua_State *L ) { lua_pushnumber(L, p->m_MultiPlayer); return 1; }
static int GetStyle( T* p, lua_State *L ) { if(p->m_pStyle==NULL) lua_pushnil(L); else {Style *pStyle = (Style*)p->m_pStyle; pStyle->PushSelf(L);} return 1; } static int GetStyle( T* p, lua_State *L ) { if(p->m_pStyle==NULL) lua_pushnil(L); else {Style *pStyle = (Style*)p->m_pStyle; pStyle->PushSelf(L);} return 1; }
static int GetScreen( T* p, lua_State *L ) { lua_pushstring(L, p->m_sScreen ); return 1; }
static int GetProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sProfileID ); return 1; } static int GetProfileID( T* p, lua_State *L ) { lua_pushstring(L, p->m_sProfileID ); return 1; }
static int GetSong( T* p, lua_State *L ) { if(p->m_pSong==NULL) lua_pushnil(L); else p->m_pSong->PushSelf(L); return 1; } static int GetSong( T* p, lua_State *L ) { if(p->m_pSong==NULL) lua_pushnil(L); else p->m_pSong->PushSelf(L); return 1; }
static int GetSteps( T* p, lua_State *L ) { if(p->m_pSteps==NULL) lua_pushnil(L); else p->m_pSteps->PushSelf(L); return 1; }
static int GetCourse( T* p, lua_State *L ) { if(p->m_pCourse==NULL) lua_pushnil(L); else p->m_pCourse->PushSelf(L); return 1; }
static int GetTrail( T* p, lua_State *L ) { if(p->m_pTrail==NULL) lua_pushnil(L); else p->m_pTrail->PushSelf(L); return 1; }
static int GetCharacter( T* p, lua_State *L ) { if(p->m_pCharacter==NULL) lua_pushnil(L); else p->m_pCharacter->PushSelf(L); return 1; }
static int GetSongGroup( T* p, lua_State *L ) { lua_pushstring(L, p->m_sSongGroup ); return 1; } static int GetSongGroup( T* p, lua_State *L ) { lua_pushstring(L, p->m_sSongGroup ); return 1; }
static int GetUrl( T* p, lua_State *L ) { lua_pushstring(L, p->m_sUrl ); return 1; } static int GetUrl( T* p, lua_State *L ) { lua_pushstring(L, p->m_sUrl ); return 1; }
@@ -873,9 +880,18 @@ public:
ADD_METHOD( GetIndex ); ADD_METHOD( GetIndex );
ADD_METHOD( GetMultiPlayer ); ADD_METHOD( GetMultiPlayer );
ADD_METHOD( GetStyle ); ADD_METHOD( GetStyle );
//ADD_METHOD( GetDifficulty );
//ADD_METHOD( GetCourseDifficulty );
ADD_METHOD( GetScreen );
//ADD_METHOD( GetPlayMode );
ADD_METHOD( GetProfileID ); ADD_METHOD( GetProfileID );
ADD_METHOD( GetSong ); ADD_METHOD( GetSong );
ADD_METHOD( GetSteps );
ADD_METHOD( GetCourse );
ADD_METHOD( GetTrail );
ADD_METHOD( GetCharacter );
ADD_METHOD( GetSongGroup ); ADD_METHOD( GetSongGroup );
//ADD_METHOD( GetSortOrder );
ADD_METHOD( GetUrl ); ADD_METHOD( GetUrl );
} }
}; };
+1 -1
View File
@@ -1965,7 +1965,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir )
} }
/* The user may be set to prefer a difficulty that isn't always shown; typically, /* The user may be set to prefer a difficulty that isn't always shown; typically,
* Difficulty_Edit. Return the closest shown difficulty <= m_PreferredDifficulty. */ * Difficulty_Edit. Return the closest shown difficulty <= m_PreferredDifficulty. */
Difficulty GameState::GetClosestShownDifficulty( PlayerNumber pn ) const Difficulty GameState::GetClosestShownDifficulty( PlayerNumber pn ) const
{ {
const vector<Difficulty> &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); const vector<Difficulty> &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue();
+4 -6
View File
@@ -63,7 +63,7 @@ void GrooveRadar::TweenOnScreen()
{ {
m_sprRadarLabels[c].SetX( LABEL_OFFSET_X(c) ); m_sprRadarLabels[c].SetX( LABEL_OFFSET_X(c) );
m_sprRadarLabels[c].PlayCommand( "PreDelayOn" ); m_sprRadarLabels[c].PlayCommand( "PreDelayOn" );
m_sprRadarLabels[c].BeginTweening( LABEL_ON_DELAY*c ); // sleep m_sprRadarLabels[c].BeginTweening( LABEL_ON_DELAY*c ); // sleep
m_sprRadarLabels[c].PlayCommand( "PostDelayOn" ); m_sprRadarLabels[c].PlayCommand( "PostDelayOn" );
} }
@@ -83,9 +83,8 @@ void GrooveRadar::TweenOffScreen()
{ {
m_sprRadarLabels[c].StopTweening(); m_sprRadarLabels[c].StopTweening();
m_sprRadarLabels[c].BeginTweening( 0.2f ); m_sprRadarLabels[c].BeginTweening( 0.2f );
/* Make sure we undo glow. We do this at the end of TweenIn, /* Make sure we undo glow. We do this at the end of TweenIn, but we might
* but we might tween off before we complete tweening in, and * tween off before we complete tweening in, and the glow can remain. */
* the glow can remain. */
m_sprRadarLabels[c].SetGlow( RageColor(1,1,1,0) ); m_sprRadarLabels[c].SetGlow( RageColor(1,1,1,0) );
m_sprRadarLabels[c].SetDiffuse( RageColor(1,1,1,0) ); m_sprRadarLabels[c].SetDiffuse( RageColor(1,1,1,0) );
} }
@@ -108,7 +107,7 @@ void GrooveRadar::SetFromRadarValues( PlayerNumber pn, const RadarValues &rv )
m_GrooveRadarValueMap[pn].SetFromSteps( rv ); m_GrooveRadarValueMap[pn].SetFromSteps( rv );
} }
void GrooveRadar::SetFromSteps( PlayerNumber pn, Steps* pSteps ) // NULL means no Song void GrooveRadar::SetFromSteps( PlayerNumber pn, Steps* pSteps ) // NULL means no Song
{ {
if( pSteps == NULL ) if( pSteps == NULL )
{ {
@@ -120,7 +119,6 @@ void GrooveRadar::SetFromSteps( PlayerNumber pn, Steps* pSteps ) // NULL means n
m_GrooveRadarValueMap[pn].SetFromSteps( rv ); m_GrooveRadarValueMap[pn].SetFromSteps( rv );
} }
GrooveRadar::GrooveRadarValueMap::GrooveRadarValueMap() GrooveRadar::GrooveRadarValueMap::GrooveRadarValueMap()
{ {
m_bValuesVisible = false; m_bValuesVisible = false;
+14 -5
View File
@@ -2488,6 +2488,10 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
if( !NeedsTapJudging(tn) ) if( !NeedsTapJudging(tn) )
continue; continue;
// warp hackery
if( iter.Row() >= GAMESTATE->m_iWarpBeginRow && iter.Row() <= (GAMESTATE->m_iWarpBeginRow + BeatToNoteRow(GAMESTATE->m_fWarpLength)) )
continue;
if( tn.type == TapNote::mine ) if( tn.type == TapNote::mine )
{ {
tn.result.tns = TNS_AvoidMine; tn.result.tns = TNS_AvoidMine;
@@ -2524,15 +2528,15 @@ void Player::UpdateJudgedRows()
{ {
int iRow = iter.Row(); int iRow = iter.Row();
// if row is within a warp section, ignore it. -aj
if( iRow >= GAMESTATE->m_iWarpBeginRow &&
iRow <= (GAMESTATE->m_iWarpBeginRow + BeatToNoteRow(GAMESTATE->m_fWarpLength)) )
continue;
if( iLastSeenRow != iRow ) if( iLastSeenRow != iRow )
{ {
iLastSeenRow = iRow; iLastSeenRow = iRow;
// if row is within a warp section, ignore it. -aj
if( iRow >= GAMESTATE->m_iWarpBeginRow &&
iRow <= (GAMESTATE->m_iWarpBeginRow + BeatToNoteRow(GAMESTATE->m_fWarpLength)) )
continue;
// crossed a nonempty row // crossed a nonempty row
if( !NoteDataWithScoring::IsRowCompletelyJudged(m_NoteData, iRow) ) if( !NoteDataWithScoring::IsRowCompletelyJudged(m_NoteData, iRow) )
{ {
@@ -2985,6 +2989,11 @@ void Player::HandleHoldCheckpoint( int iRow, int iNumHoldsHeldThisRow, int iNumH
bNoCheating = false; bNoCheating = false;
#endif #endif
// more warp hackery. -aj
if( iRow >= (unsigned)GAMESTATE->m_iWarpBeginRow &&
iRow <= (unsigned)(GAMESTATE->m_iWarpBeginRow + BeatToNoteRow(GAMESTATE->m_fWarpLength)) )
return;
// don't accumulate combo if AutoPlay is on. // don't accumulate combo if AutoPlay is on.
if( bNoCheating && m_pPlayerState->m_PlayerController == PC_AUTOPLAY ) if( bNoCheating && m_pPlayerState->m_PlayerController == PC_AUTOPLAY )
return; return;
+2
View File
@@ -1939,6 +1939,7 @@ class LunaProfile: public Luna<Profile>
{ {
public: public:
static int GetDisplayName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sDisplayName ); return 1; } static int GetDisplayName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sDisplayName ); return 1; }
static int GetLastUsedHighScoreName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sLastUsedHighScoreName ); return 1; }
static int GetHighScoreList( T* p, lua_State *L ) static int GetHighScoreList( T* p, lua_State *L )
{ {
if( LuaBinding::CheckLuaObjectType(L, 1, "Song") ) if( LuaBinding::CheckLuaObjectType(L, 1, "Song") )
@@ -2035,6 +2036,7 @@ public:
LunaProfile() LunaProfile()
{ {
ADD_METHOD( GetDisplayName ); ADD_METHOD( GetDisplayName );
ADD_METHOD( GetLastUsedHighScoreName );
ADD_METHOD( GetHighScoreList ); ADD_METHOD( GetHighScoreList );
ADD_METHOD( GetCharacter ); ADD_METHOD( GetCharacter );
ADD_METHOD( SetCharacter ); ADD_METHOD( SetCharacter );
+2 -13
View File
@@ -674,9 +674,7 @@ void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pS
GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps ); GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps );
} }
//
// Course stats // Course stats
//
void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut ) void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut )
{ {
HighScore hs = hs_; HighScore hs = hs_;
@@ -686,7 +684,7 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail,
iMachineIndexOut = -1; iMachineIndexOut = -1;
// In event mode, set the score's name immediately to the Profile's last // In event mode, set the score's name immediately to the Profile's last
// used name. If no profile last used name exists, use "EVNT". // used name. If no profile last used name exists, use "EVNT".
if( GAMESTATE->IsEventMode() ) if( GAMESTATE->IsEventMode() )
{ {
Profile* pProfile = GetProfile(pn); Profile* pProfile = GetProfile(pn);
@@ -700,10 +698,7 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail,
hs.SetName( RANKING_TO_FILL_IN_MARKER[pn] ); hs.SetName( RANKING_TO_FILL_IN_MARKER[pn] );
} }
//
// save high score // save high score
//
if( IsPersistentProfile(pn) ) if( IsPersistentProfile(pn) )
GetProfile(pn)->AddCourseHighScore( pCourse, pTrail, hs, iPersonalIndexOut ); GetProfile(pn)->AddCourseHighScore( pCourse, pTrail, hs, iPersonalIndexOut );
if( hs.GetPercentDP() >= PREFSMAN->m_fMinPercentageForMachineCourseHighScore ) if( hs.GetPercentDP() >= PREFSMAN->m_fMinPercentageForMachineCourseHighScore )
@@ -724,10 +719,7 @@ void ProfileManager::IncrementCoursePlayCount( const Course* pCourse, const Trai
GetMachineProfile()->IncrementCoursePlayCount( pCourse, pTrail ); GetMachineProfile()->IncrementCoursePlayCount( pCourse, pTrail );
} }
//
// Category stats // Category stats
//
void ProfileManager::AddCategoryScore( StepsType st, RankingCategory rc, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut ) void ProfileManager::AddCategoryScore( StepsType st, RankingCategory rc, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut )
{ {
HighScore hs = hs_; HighScore hs = hs_;
@@ -804,7 +796,6 @@ int ProfileManager::GetNumLocalProfiles() const
return g_vLocalProfile.size(); return g_vLocalProfile.size();
} }
// lua start // lua start
#include "LuaBinding.h" #include "LuaBinding.h"
@@ -828,7 +819,6 @@ public:
static int GetLocalProfileIDFromIndex( T* p, lua_State *L ) { lua_pushstring(L, p->GetLocalProfileIDFromIndex(IArg(1)) ); return 1; } static int GetLocalProfileIDFromIndex( T* p, lua_State *L ) { lua_pushstring(L, p->GetLocalProfileIDFromIndex(IArg(1)) ); return 1; }
static int GetLocalProfileIndexFromID( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLocalProfileIndexFromID(SArg(1)) ); return 1; } static int GetLocalProfileIndexFromID( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLocalProfileIndexFromID(SArg(1)) ); return 1; }
static int GetNumLocalProfiles( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumLocalProfiles() ); return 1; } static int GetNumLocalProfiles( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumLocalProfiles() ); return 1; }
//static int GetProfileDirectoryForPlayer( T* p, lua_State *L ) { lua_pushstring(L, m_sProfileDir[Enum::Check<PlayerNumber>(L, 1)] ) return 1; }
static int GetProfileDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetProfileDir(Enum::Check<ProfileSlot>(L, 1)) ); return 1; } static int GetProfileDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetProfileDir(Enum::Check<ProfileSlot>(L, 1)) ); return 1; }
static int IsSongNew( T* p, lua_State *L ) { lua_pushboolean(L, p->IsSongNew(Luna<Song>::check(L,1)) ); return 1; } static int IsSongNew( T* p, lua_State *L ) { lua_pushboolean(L, p->IsSongNew(Luna<Song>::check(L,1)) ); return 1; }
@@ -843,8 +833,7 @@ public:
ADD_METHOD( GetLocalProfileIDFromIndex ); ADD_METHOD( GetLocalProfileIDFromIndex );
ADD_METHOD( GetLocalProfileIndexFromID ); ADD_METHOD( GetLocalProfileIndexFromID );
ADD_METHOD( GetNumLocalProfiles ); ADD_METHOD( GetNumLocalProfiles );
//ADD_METHOD( GetProfileDirectoryForPlayer ); // uses PlayerNumber ADD_METHOD( GetProfileDir );
ADD_METHOD( GetProfileDir ); // uses ProfileSlot
ADD_METHOD( IsSongNew ); ADD_METHOD( IsSongNew );
} }
}; };
+6 -51
View File
@@ -20,7 +20,6 @@ StreamDisplay::StreamDisplay()
m_fVelocity = 0; m_fVelocity = 0;
m_fPassingAlpha = 0; m_fPassingAlpha = 0;
m_fHotAlpha = 0; m_fHotAlpha = 0;
m_fThreePartWidth = 0;
m_bAlwaysBounce = false; m_bAlwaysBounce = false;
} }
@@ -33,13 +32,8 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX"); float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX");
int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills"); int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills");
m_bUsingThreePart = THEME->GetMetricB(sMetricsGroup,"UseThreePartMethod");
m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar"); m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar");
// three part method only uses 3 pills
if(iNumPills != 3)
m_bUsingThreePart = false;
FOREACH_ENUM( StreamType, st ) FOREACH_ENUM( StreamType, st )
{ {
ASSERT( m_vpSprPill[st].empty() ); ASSERT( m_vpSprPill[st].empty() );
@@ -48,35 +42,15 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
{ {
Sprite *pSpr = new Sprite; Sprite *pSpr = new Sprite;
if( m_bUsingThreePart ) pSpr->Load( THEME->GetPathG( sMetricsGroup, StreamTypeToString(st) ) );
{
pSpr->Load( THEME->GetPathG( sMetricsGroup, ssprintf("%s part%d",StreamTypeToString(st).c_str(),i) ) );
if(pSpr->GetNumStates() > 1)
{
pSpr->SetAllStateDelays( THEME->GetMetricF( sMetricsGroup, ssprintf("%spart%ddelay",StreamTypeToString(st).c_str(),i) ) );
}
}
else
pSpr->Load( THEME->GetPathG( sMetricsGroup, StreamTypeToString(st) ) );
m_vpSprPill[st].push_back( pSpr ); m_vpSprPill[st].push_back( pSpr );
if( !m_bUsingThreePart ) m_transformPill.TransformItemDirect( *pSpr, -1, i, iNumPills );
{ float f = 1 / fTextureCoordScaleX;
m_transformPill.TransformItemDirect( *pSpr, -1, i, iNumPills ); pSpr->SetCustomTextureRect( RectF(f*i,0,f*(i+1),1) );
float f = 1 / fTextureCoordScaleX;
pSpr->SetCustomTextureRect( RectF(f*i,0,f*(i+1),1) );
}
this->AddChild( pSpr ); this->AddChild( pSpr );
} }
if( m_bUsingThreePart )
{
m_fThreePartWidth = THEME->GetMetricF( sMetricsGroup, "ThreePartWidth" );
// first element positioned depending on metric width specified
m_vpSprPill[st][0]->AddX( -(m_fThreePartWidth/2 + m_vpSprPill[st][0]->GetZoomedWidth()/2) );
}
} }
} }
@@ -131,28 +105,9 @@ void StreamDisplay::Update( float fDeltaSecs )
// XXX scale by current song speed // XXX scale by current song speed
if( !m_bUsingThreePart ) // usual lifebar pSpr->SetCropRight( 1.0f - fPercentFilledThisPill );
{ pSpr->SetTexCoordVelocity( -1, 0 );
pSpr->SetCropRight( 1.0f - fPercentFilledThisPill );
pSpr->SetTexCoordVelocity( -1, 0 );
}
else // using the three-part method
{
if( i==1 ) // middle pill
{
float fMiddleWidth = m_fThreePartWidth * m_fTrailingPercent;
pSpr->ZoomToWidth( fMiddleWidth );
float fMiddleX = m_vpSprPill[st][0]->GetX() + ( fMiddleWidth/2 ) + ( m_vpSprPill[st][0]->GetZoomedWidth()/2 );
pSpr->SetX( fMiddleX );
}
else if( i!=0 ) // last pill
{
float fEndX = m_vpSprPill[st][1]->GetX() + ( m_vpSprPill[st][1]->GetZoomedWidth()/2 ) + ( pSpr->GetZoomedWidth()/2 );
pSpr->SetX( fEndX );
}
}
// Optimization: Don't draw pills that are covered up // Optimization: Don't draw pills that are covered up
switch( st ) switch( st )
{ {
-4
View File
@@ -15,7 +15,6 @@ enum StreamType
NUM_StreamType, NUM_StreamType,
}; };
class StreamDisplay : public ActorFrame class StreamDisplay : public ActorFrame
{ {
public: public:
@@ -43,9 +42,6 @@ private:
float m_fPassingAlpha; float m_fPassingAlpha;
float m_fHotAlpha; float m_fHotAlpha;
bool m_bUsingThreePart;
float m_fThreePartWidth;
bool m_bAlwaysBounce; bool m_bAlwaysBounce;
}; };
+4
View File
@@ -120,12 +120,16 @@ public:
static int GetName( T* p, lua_State *L ) { LuaHelpers::Push( L, (RString) p->m_szName ); return 1; } static int GetName( T* p, lua_State *L ) { LuaHelpers::Push( L, (RString) p->m_szName ); return 1; }
DEFINE_METHOD( GetStyleType, m_StyleType ) DEFINE_METHOD( GetStyleType, m_StyleType )
DEFINE_METHOD( GetStepsType, m_StepsType ) DEFINE_METHOD( GetStepsType, m_StepsType )
DEFINE_METHOD( ColumnsPerPlayer, m_iColsPerPlayer )
DEFINE_METHOD( NeedsZoomOutWith2Players, m_bNeedsZoomOutWith2Players )
LunaStyle() LunaStyle()
{ {
ADD_METHOD( GetName ); ADD_METHOD( GetName );
ADD_METHOD( GetStyleType ); ADD_METHOD( GetStyleType );
ADD_METHOD( GetStepsType ); ADD_METHOD( GetStepsType );
ADD_METHOD( ColumnsPerPlayer );
ADD_METHOD( NeedsZoomOutWith2Players );
} }
}; };
+13 -13
View File
@@ -19,15 +19,15 @@ struct lua_State;
class Style class Style
{ {
public: public:
bool m_bUsedForGameplay; // Can be used only for gameplay? bool m_bUsedForGameplay; // Can be used only for gameplay?
bool m_bUsedForEdit; // Can be used for editing? bool m_bUsedForEdit; // Can be used for editing?
bool m_bUsedForDemonstration; // Can be used for demonstration? bool m_bUsedForDemonstration; // Can be used for demonstration?
bool m_bUsedForHowToPlay; // Can be used for HowToPlay? bool m_bUsedForHowToPlay; // Can be used for HowToPlay?
/* The name of the style. (This is currently unused.) */ // The name of the style. (This is currently unused.)
const char * m_szName; const char * m_szName;
/* Steps format used for each player. For example, "dance versus" reads /* Steps format used for each player. For example, "dance versus" reads
* the Steps with the tag "dance-single". */ * the Steps with the tag "dance-single". */
StepsType m_StepsType; StepsType m_StepsType;
@@ -36,21 +36,21 @@ public:
int m_iColsPerPlayer; // number of total tracks this style expects (e.g. 4 for versus, but 8 for double) int m_iColsPerPlayer; // number of total tracks this style expects (e.g. 4 for versus, but 8 for double)
struct ColumnInfo struct ColumnInfo
{ {
int track; // take note data from this track int track; // take note data from this track
float fXOffset; // x position of the column relative to player center float fXOffset; // x position of the column relative to player center
const char *pzName; // name of this column, or NULL to use the name of a button mapped to it const char *pzName; // name of this column, or NULL to use the name of a button mapped to it
}; };
ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData
/* This maps from game inputs to columns. More than one button may map to a /* This maps from game inputs to columns. More than one button may map to a
* single column. */ * single column. */
enum { NO_MAPPING = -1, END_MAPPING = -2 }; enum { NO_MAPPING = -1, END_MAPPING = -2 };
int m_iInputColumn[NUM_GameController][NUM_GameButton]; // maps each input to a column, or GameButton_Invalid int m_iInputColumn[NUM_GameController][NUM_GameButton]; // maps each input to a column, or GameButton_Invalid
int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
bool m_bNeedsZoomOutWith2Players; bool m_bNeedsZoomOutWith2Players;
bool m_bCanUseBeginnerHelper; bool m_bCanUseBeginnerHelper;
bool m_bLockDifficulties; // used in couple Styles bool m_bLockDifficulties; // used in couple Styles
GameInput StyleInputToGameInput( int iCol, PlayerNumber pn ) const; GameInput StyleInputToGameInput( int iCol, PlayerNumber pn ) const;
// Returns Column_Invalid if the input is an invalid column, such as UL corner in 4 pad mode // Returns Column_Invalid if the input is an invalid column, such as UL corner in 4 pad mode
+6 -4
View File
@@ -13,6 +13,7 @@
*/ */
static ThemeMetric<bool> SHOW_TRAINING ("WheelNotifyIcon","ShowTraining"); static ThemeMetric<bool> SHOW_TRAINING ("WheelNotifyIcon","ShowTraining");
static ThemeMetric<bool> BLINK_BEST_ICON ("WheelNotifyIcon","BlinkPlayersBest");
WheelNotifyIcon::WheelNotifyIcon() WheelNotifyIcon::WheelNotifyIcon()
{ {
@@ -49,15 +50,16 @@ void WheelNotifyIcon::SetFlags( Flags flags )
m_vIconsToShow.push_back( training ); m_vIconsToShow.push_back( training );
// HACK: Make players best blink if it's the only icon // If BLINK_BEST_ICON, make player's best icon blink if it's the only icon.
// TODO: metric this. use m_bPlayersBestHack as variable name, lol -aj if( m_vIconsToShow.size() == 1 && BLINK_BEST_ICON )
if( m_vIconsToShow.size() == 1 )
{ {
if( m_vIconsToShow[0] >= best1 && m_vIconsToShow[0] <= best3 ) if( m_vIconsToShow[0] >= best1 && m_vIconsToShow[0] <= best3 )
m_vIconsToShow.push_back( empty ); m_vIconsToShow.push_back( empty );
} }
m_vIconsToShow.resize( min(m_vIconsToShow.size(),2u) ); // crop to most important 2 // crop to most important 2
// todo: Let themer handle this? -aj
m_vIconsToShow.resize( min(m_vIconsToShow.size(),2u) );
// Broadcast Set message so items can react. (futures) -aj // Broadcast Set message so items can react. (futures) -aj
//Message msg("Set"); //Message msg("Set");