Separate styles for players. Notefields positioned between margins. Edit mode works for kickbox.
This commit is contained in:
@@ -15,6 +15,34 @@ ________________________________________________________________________________
|
||||
* [Player] "ComboBreakOnImmediateHoldLetGo" theme metric added. [sillybear]
|
||||
* [PlayerState] ApplyPreferredOptionsToOtherLevels function added. [kyzentun]
|
||||
|
||||
2014/12/07
|
||||
----------
|
||||
* [Game] GetSeparateStyles function added. Use this to detect whether a game
|
||||
allows the players to play different styles. [kyzentun] (used by kickbox)
|
||||
* [GameManager] Lua Scripts/ folders are now reloaded when the Game mode is
|
||||
changed. [kyzentun]
|
||||
* [GameState] CanSafelyEnterGameplay function added. [kyzentun]
|
||||
In kickbox game mode, players can have different styles set, pass a
|
||||
PlayerNumber when using SetCurrentStyle or GetCurrentStyle.
|
||||
* [kickbox] New game mode with 4 styles. [kyzentun]
|
||||
* [ScreenGameplay] Notefield positioning is handled a bit differently now.
|
||||
See comments in _fallback/metrics.ini above the [ScreenGameplay]
|
||||
MarginFunction metric. Basically, you can define a lua function that
|
||||
returns the space you want at the edges and in the center instead of
|
||||
setting position metrics. Do NOT use Style:GetWidth to calculate the
|
||||
margins your function returns.
|
||||
ScreenGameplay now handles zooming the notefield to fit in the space
|
||||
instead of using the NeedsZoomOutWith2Players flag in the style.
|
||||
If the notefield doesn't fit in the space between the margins, and there is
|
||||
only one player, the player will be centered even if the Center1Player pref
|
||||
is false. [kyzentun]
|
||||
* [Style] NeedsZoomOutWith2Players decapitated. Always returns false now.
|
||||
GetWidth added. [kyzentun]
|
||||
* [techno] Techno game mode no longer has special column width for versus.
|
||||
Techno was the only game mode that used the NeedsZoomOutWith2Players flag,
|
||||
and the zoom factor it applied was 0.6, and the special versus column width
|
||||
was 0.6*normal, so this should make no difference. [kyzentun]
|
||||
|
||||
2014/12/03
|
||||
----------
|
||||
* [command line arg] --game command line arg added for setting the game type
|
||||
@@ -68,6 +96,10 @@ ________________________________________________________________________________
|
||||
----------
|
||||
* [RollingNumbers] Cropping and color during tweens fixed. [kyzentun]
|
||||
|
||||
2014/10/27
|
||||
----------
|
||||
* [Changelog] Vospi read the release notes.
|
||||
|
||||
2014/10/23
|
||||
----------
|
||||
* [Global] approach, multiapproach, lerp, and lerp_color lua functions added. [kyzentun]
|
||||
|
||||
@@ -702,6 +702,7 @@
|
||||
<Function name='CountNotesSeparately'/>
|
||||
<Function name='GetMapJudgmentTo'/>
|
||||
<Function name='GetName'/>
|
||||
<Function name='GetSeparateStyles'/>
|
||||
</Class>
|
||||
<Class name='GameCommand'>
|
||||
<Function name='GetAnnouncer'/>
|
||||
@@ -750,6 +751,7 @@
|
||||
<Function name='ApplyPreferredModifiers'/>
|
||||
<Function name='ApplyPreferredSongOptionsToOtherLevels'/>
|
||||
<Function name='ApplyStageModifiers'/>
|
||||
<Function name='CanSafelyEnterGameplay'/>
|
||||
<Function name='ClearStageModifiersIllegalForCourse'/>
|
||||
<Function name='CurrentOptionsDisqualifyPlayer'/>
|
||||
<Function name='Dopefish'/>
|
||||
@@ -1659,6 +1661,7 @@
|
||||
<Function name='GetName'/>
|
||||
<Function name='GetStepsType'/>
|
||||
<Function name='GetStyleType'/>
|
||||
<Function name='GetWidth'/>
|
||||
<Function name='LockedDifficulty'/>
|
||||
<Function name='NeedsZoomOutWith2Players'/>
|
||||
</Class>
|
||||
|
||||
@@ -2131,6 +2131,9 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='GetName' return='string' arguments=''>
|
||||
Returns the name of the game such as "dance" or "pump".
|
||||
</Function>
|
||||
<Function name='GetSeparateStyles' return='bool' arguments=''>
|
||||
Returns whether this game allows the players to have separate styles.
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='GameCommand'>
|
||||
<Function name='GetAnnouncer' return='string' arguments=''>
|
||||
@@ -2270,6 +2273,16 @@ save yourself some time, copy this for undocumented things:
|
||||
The second argument is optional. Apply the GameCommand represented by <code>sCommand</code>
|
||||
for <code>pn</code>, if given. See <Link class='GameCommand' />.
|
||||
</Function>
|
||||
<Function name='CanSafelyEnterGameplay' return='bool,string' arguments=''>
|
||||
Checks various things to determine whether the game will crash when gameplay starts. Returns false and a string if gameplay cannot be entered safely.<br />
|
||||
Might not work in all cases, but will catch things like a player not having
|
||||
steps set or no current song or style. Mainly exists for people with a custom ScreenSelectMusic replacement.<br />
|
||||
Example:<br />
|
||||
local can, reason= GAMESTATE:CanSafelyEnterGameplay()<br />
|
||||
if not can then<br />
|
||||
lua.ReportScriptError("Cannot safely enter gameplay: " .. tostring(reason))<br />
|
||||
end<br />
|
||||
</Function>
|
||||
<Function name='ClearStageModifiersIllegalForCourse' return='void' arguments=''>
|
||||
Removes any stage modifiers that are illegal for course play.
|
||||
</Function>
|
||||
@@ -4716,11 +4729,14 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='GetColumnDrawOrder' return='int' arguments='int column'>
|
||||
Returns the draw order of the column.
|
||||
</Function>
|
||||
<Function name='GetWidth' return='float' arguments='PlayerNumber pn'>
|
||||
Returns the width of the notefield for the given player with this style.
|
||||
</Function>
|
||||
<Function name='LockedDifficulty' return='bool' arguments=''>
|
||||
Returns <code>true</code> if this style locks the difficulty for both players.
|
||||
</Function>
|
||||
<Function name='NeedsZoomOutWith2Players' return='bool' arguments=''>
|
||||
Returns <code>true</code> if the Style needs to be zoomed out with two players.
|
||||
Deprecated. Always returns false.
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='TapNote'>
|
||||
|
||||
@@ -27,6 +27,55 @@ function GetExtraColorThreshold()
|
||||
return Modes[CurGameName()] or 10
|
||||
end
|
||||
|
||||
-- GameplayMargins exists to provide a layer of backwards compatibility for
|
||||
-- people using the X position metrics to set where the notefields are.
|
||||
-- This makes it somewhat complex.
|
||||
-- Rather than trying to understand how it works, you can simply do this:
|
||||
-- (example values in parentheses)
|
||||
-- 1. Decide how much space you want in the center between notefields. (80)
|
||||
-- 2. Decide how much space you want on each side. (40)
|
||||
-- 3. Write a simple function that just returns those numbers:
|
||||
-- function GameplayMargins() return 40, 80, 40 end
|
||||
-- Then the engine does the work of figuring out where each notefield should
|
||||
-- be centered.
|
||||
function GameplayMargins(enabled_players, styletype)
|
||||
local other= {[PLAYER_1]= PLAYER_2, [PLAYER_2]= PLAYER_1}
|
||||
local margins= {[PLAYER_1]= {40, 40}, [PLAYER_2]= {40, 40}}
|
||||
-- Use a fake style width because calculating the real style width throws off
|
||||
-- the code in the engine.
|
||||
local fake_style_width= 272
|
||||
-- Handle the case of a single player that is centered first because it's
|
||||
-- simpler.
|
||||
if Center1Player() then
|
||||
local pn= enabled_players[1]
|
||||
fake_style_width= 544
|
||||
local center= _screen.cx
|
||||
local left= center - (fake_style_width / 2)
|
||||
local right= _screen.w - center - (fake_style_width / 2)
|
||||
-- center margin width will be ignored.
|
||||
return left, 80, right
|
||||
end
|
||||
local half_screen= _screen.w / 2
|
||||
local left= {[PLAYER_1]= 0, [PLAYER_2]= half_screen}
|
||||
for i, pn in ipairs(enabled_players) do
|
||||
local edge= left[pn]
|
||||
local center= THEME:GetMetric("ScreenGameplay",
|
||||
"Player"..ToEnumShortString(pn)..ToEnumShortString(styletype).."X")
|
||||
-- Adjust for the p2 center being on the right side.
|
||||
center= center - edge
|
||||
margins[pn][1]= center - (fake_style_width / 2)
|
||||
margins[pn][2]= half_screen - center - (fake_style_width / 2)
|
||||
if #enabled_players == 1 then
|
||||
margins[other[pn]][1]= margins[pn][2]
|
||||
margins[other[pn]][2]= margins[pn][1]
|
||||
end
|
||||
end
|
||||
local left= margins[PLAYER_1][1]
|
||||
local center= margins[PLAYER_1][2] + margins[PLAYER_2][1]
|
||||
local right= margins[PLAYER_2][2]
|
||||
return left, center, right
|
||||
end
|
||||
|
||||
-- AllowOptionsMenu()
|
||||
-- [en] returns if you are able to select options
|
||||
-- on ScreenSelectMusic.
|
||||
|
||||
@@ -1130,7 +1130,7 @@ AttackDisplayXOffsetOneSideP2=0
|
||||
AttackDisplayXOffsetBothSides=0
|
||||
AttackDisplayY=-70
|
||||
AttackDisplayYReverse=70
|
||||
; HACK: These shouldn't go to the render pipe at all if IsGame("pump")
|
||||
# HACK: These shouldn't go to the render pipe at all if IsGame("pump")
|
||||
HoldJudgmentYStandard=IsGame("pump") and -99999 or -90
|
||||
HoldJudgmentYReverse=IsGame("pump") and -99999 or 90
|
||||
BrightGhostComboThreshold=100
|
||||
@@ -3413,7 +3413,25 @@ MusicFadeOutSeconds=0.5
|
||||
OutTransitionLength=5
|
||||
CourseTransitionLength=0.5
|
||||
BeginFailedDelay=1.0
|
||||
#
|
||||
# New way to control where the notefields are on gameplay.
|
||||
# The MarginFunction will be passed GAMESTATE:EnabledPlayers() and the
|
||||
# current styletype. The function must return three values:
|
||||
# Left margin width, center margin width, right margin width.
|
||||
# The engine will then position the notefields and adjust their size to fit
|
||||
# in the space not occupied by the margins. If there is only one player and
|
||||
# that player would normally be centered (OnePlayerTwoSides or
|
||||
# TwoPlayersSharedSides, or the Center1Player preference), then the center
|
||||
# margin value will be ignored.
|
||||
# Mods applied to the player may still move the notefield into the margin,
|
||||
# this is just for controlling its initial position and size.
|
||||
# The purpose of this is to allow the engine more flexibility in styles,
|
||||
# for example, one player playing dance-solo while the other plays
|
||||
# dance-single.
|
||||
MarginFunction=GameplayMargins
|
||||
# These X values for each player and styletype are deprecated in favor of
|
||||
# writing a MarginFunction that returns the margin sizes you prefer.
|
||||
# The MarginFunction supplied by _fallback will use these metrics for
|
||||
# backwards compatibility.
|
||||
PlayerP1OnePlayerOneSideX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||
PlayerP2OnePlayerOneSideX=math.floor(scale((2.15/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||
PlayerP1TwoPlayersTwoSidesX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||
|
||||
+14
-13
@@ -82,16 +82,16 @@ namespace
|
||||
|
||||
void ArrowEffects::Update()
|
||||
{
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
|
||||
static float fLastTime = 0;
|
||||
float fTime = RageTimer::GetTimeSinceStartFast();
|
||||
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
{
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pn);
|
||||
const Style::ColumnInfo* pCols = pStyle->m_ColumnInfo[pn];
|
||||
const SongPosition &position = GAMESTATE->m_bIsUsingStepTiming
|
||||
? GAMESTATE->m_pPlayerState[pn]->m_Position : GAMESTATE->m_Position;
|
||||
const float field_zoom= GAMESTATE->m_pPlayerState[pn]->m_NotefieldZoom;
|
||||
|
||||
PerPlayerData &data = g_EffectData[pn];
|
||||
|
||||
@@ -127,8 +127,8 @@ void ArrowEffects::Update()
|
||||
|
||||
for( int i=iStartCol; i<=iEndCol; i++ )
|
||||
{
|
||||
data.m_fMinTornadoX[iColNum] = min( data.m_fMinTornadoX[iColNum], pCols[i].fXOffset );
|
||||
data.m_fMaxTornadoX[iColNum] = max( data.m_fMaxTornadoX[iColNum], pCols[i].fXOffset );
|
||||
data.m_fMinTornadoX[iColNum] = min( data.m_fMinTornadoX[iColNum], pCols[i].fXOffset * field_zoom );
|
||||
data.m_fMaxTornadoX[iColNum] = max( data.m_fMaxTornadoX[iColNum], pCols[i].fXOffset * field_zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
{
|
||||
float fPixelOffsetFromCenter = 0; // fill this in below
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber);
|
||||
const float* fEffects = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects;
|
||||
|
||||
// TODO: Don't index by PlayerNumber.
|
||||
@@ -448,7 +448,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
|
||||
if( fEffects[PlayerOptions::EFFECT_TORNADO] != 0 )
|
||||
{
|
||||
const float fRealPixelOffset = pCols[iColNum].fXOffset;
|
||||
const float fRealPixelOffset = pCols[iColNum].fXOffset * pPlayerState->m_NotefieldZoom;
|
||||
const float fPositionBetween = SCALE( fRealPixelOffset, data.m_fMinTornadoX[iColNum], data.m_fMaxTornadoX[iColNum],
|
||||
TORNADO_POSITION_SCALE_TO_LOW, TORNADO_POSITION_SCALE_TO_HIGH );
|
||||
float fRads = acosf( fPositionBetween );
|
||||
@@ -469,8 +469,8 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
const int iFirstCol = 0;
|
||||
const int iLastCol = pStyle->m_iColsPerPlayer-1;
|
||||
const int iNewCol = SCALE( iColNum, iFirstCol, iLastCol, iLastCol, iFirstCol );
|
||||
const float fOldPixelOffset = pCols[iColNum].fXOffset;
|
||||
const float fNewPixelOffset = pCols[iNewCol].fXOffset;
|
||||
const float fOldPixelOffset = pCols[iColNum].fXOffset * pPlayerState->m_NotefieldZoom;
|
||||
const float fNewPixelOffset = pCols[iNewCol].fXOffset * pPlayerState->m_NotefieldZoom;
|
||||
const float fDistance = fNewPixelOffset - fOldPixelOffset;
|
||||
fPixelOffsetFromCenter += fDistance * fEffects[PlayerOptions::EFFECT_FLIP];
|
||||
}
|
||||
@@ -515,7 +515,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
}
|
||||
}
|
||||
|
||||
fPixelOffsetFromCenter += pCols[iColNum].fXOffset;
|
||||
fPixelOffsetFromCenter += pCols[iColNum].fXOffset * pPlayerState->m_NotefieldZoom;
|
||||
|
||||
if( fEffects[PlayerOptions::EFFECT_TINY] != 0 )
|
||||
{
|
||||
@@ -764,10 +764,11 @@ bool ArrowEffects::NeedZBuffer( const PlayerState* pPlayerState )
|
||||
float ArrowEffects::GetZoom( const PlayerState* pPlayerState )
|
||||
{
|
||||
float fZoom = 1.0f;
|
||||
// FIXME: Move the zoom values into Style
|
||||
if( GAMESTATE->GetCurrentStyle()->m_bNeedsZoomOutWith2Players &&
|
||||
(GAMESTATE->GetNumSidesJoined()==2 || GAMESTATE->AnyPlayersAreCpu()) )
|
||||
fZoom *= 0.6f;
|
||||
// Design change: Instead of having a flag in the style that toggles a
|
||||
// fixed zoom (0.6) that is only applied to the columns, ScreenGameplay now
|
||||
// calculates a zoom factor to apply to the notefield and puts it in the
|
||||
// PlayerState. -Kyz
|
||||
fZoom*= pPlayerState->m_NotefieldZoom;
|
||||
|
||||
float fTinyPercent = pPlayerState->m_PlayerOptions.GetCurrent().m_fEffects[PlayerOptions::EFFECT_TINY];
|
||||
if( fTinyPercent != 0 )
|
||||
|
||||
+3
-3
@@ -213,9 +213,9 @@ void BPMDisplay::SetBpmFromSteps( const Steps* pSteps )
|
||||
void BPMDisplay::SetBpmFromCourse( const Course* pCourse )
|
||||
{
|
||||
ASSERT( pCourse != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) != NULL );
|
||||
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType;
|
||||
Trail *pTrail = pCourse->GetTrail( st );
|
||||
// GetTranslitFullTitle because "Crashinfo.txt is garbled because of the ANSI output as usual." -f
|
||||
ASSERT_M( pTrail != NULL, ssprintf("Course '%s' has no trail for StepsType '%s'", pCourse->GetTranslitFullTitle().c_str(), StringConversion::ToString(st).c_str() ) );
|
||||
@@ -259,7 +259,7 @@ void BPMDisplay::SetFromGameState()
|
||||
}
|
||||
if( GAMESTATE->m_pCurCourse.Get() )
|
||||
{
|
||||
if( GAMESTATE->GetCurrentStyle() == NULL )
|
||||
if( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) == NULL )
|
||||
; // This is true when backing out from ScreenSelectCourse to ScreenTitleMenu. So, don't call SetBpmFromCourse where an assert will fire.
|
||||
else
|
||||
SetBpmFromCourse( GAMESTATE->m_pCurCourse );
|
||||
|
||||
+1
-1
@@ -205,7 +205,7 @@ void BackgroundImpl::Init()
|
||||
{
|
||||
bOneOrMoreChars = true;
|
||||
// Disable dancing characters if Beginner Helper will be showing.
|
||||
if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() &&
|
||||
if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse(p) &&
|
||||
GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner )
|
||||
bShowingBeginnerHelper = true;
|
||||
}
|
||||
|
||||
+11
-4
@@ -78,7 +78,7 @@ BeginnerHelper::~BeginnerHelper()
|
||||
bool BeginnerHelper::Init( int iDancePadType )
|
||||
{
|
||||
ASSERT( !m_bInitialized );
|
||||
if( !CanUse() )
|
||||
if( !CanUse(PLAYER_INVALID) )
|
||||
return false;
|
||||
|
||||
// If no players were successfully added, bail.
|
||||
@@ -200,7 +200,7 @@ void BeginnerHelper::AddPlayer( PlayerNumber pn, const NoteData &ns )
|
||||
ASSERT( pn >= 0 && pn < NUM_PLAYERS );
|
||||
ASSERT( GAMESTATE->IsHumanPlayer(pn) );
|
||||
|
||||
if( !CanUse() )
|
||||
if( !CanUse(pn) )
|
||||
return;
|
||||
|
||||
const Character *Character = GAMESTATE->m_pCurCharacters[pn];
|
||||
@@ -212,13 +212,20 @@ void BeginnerHelper::AddPlayer( PlayerNumber pn, const NoteData &ns )
|
||||
m_bPlayerEnabled[pn] = true;
|
||||
}
|
||||
|
||||
bool BeginnerHelper::CanUse()
|
||||
bool BeginnerHelper::CanUse(PlayerNumber pn)
|
||||
{
|
||||
for (int i=0; i<NUM_ANIMATIONS; ++i )
|
||||
if( !DoesFileExist(GetAnimPath((Animation)i)) )
|
||||
return false;
|
||||
|
||||
return GAMESTATE->GetCurrentStyle()->m_bCanUseBeginnerHelper;
|
||||
// This does not pass PLAYER_INVALID to GetCurrentStyle because that would
|
||||
// only check the first non-NULL style. Both styles need to be checked. -Kyz
|
||||
if(pn == PLAYER_INVALID)
|
||||
{
|
||||
return GAMESTATE->GetCurrentStyle(PLAYER_1)->m_bCanUseBeginnerHelper ||
|
||||
GAMESTATE->GetCurrentStyle(PLAYER_2)->m_bCanUseBeginnerHelper;
|
||||
}
|
||||
return GAMESTATE->GetCurrentStyle(pn)->m_bCanUseBeginnerHelper;
|
||||
}
|
||||
|
||||
void BeginnerHelper::DrawPrimitives()
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
|
||||
bool Init( int iDancePadType );
|
||||
bool IsInitialized() { return m_bInitialized; }
|
||||
static bool CanUse();
|
||||
static bool CanUse(PlayerNumber pn);
|
||||
void AddPlayer( PlayerNumber pn, const NoteData &nd );
|
||||
void ShowStepCircle( PlayerNumber pn, int CSTEP );
|
||||
bool m_bShowBackground;
|
||||
|
||||
+5
-5
@@ -95,14 +95,14 @@ void CourseUtil::SortCoursePointerArrayByDifficulty( vector<Course*> &vpCoursesI
|
||||
void CourseUtil::SortCoursePointerArrayByRanking( vector<Course*> &vpCoursesInOut )
|
||||
{
|
||||
for( unsigned i=0; i<vpCoursesInOut.size(); i++ )
|
||||
vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType );
|
||||
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByRanking );
|
||||
}
|
||||
|
||||
void CourseUtil::SortCoursePointerArrayByTotalDifficulty( vector<Course*> &vpCoursesInOut )
|
||||
{
|
||||
for( unsigned i=0; i<vpCoursesInOut.size(); i++ )
|
||||
vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType );
|
||||
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTotalDifficulty );
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector<Course*> &vpCours
|
||||
course_sort_val.clear();
|
||||
for( unsigned i = 0; i < vpCoursesInOut.size(); ++i )
|
||||
{
|
||||
int iMeter = vpCoursesInOut[i]->GetMeter( GAMESTATE->GetCurrentStyle()->m_StepsType, Difficulty_Medium );
|
||||
int iMeter = vpCoursesInOut[i]->GetMeter( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType, Difficulty_Medium );
|
||||
course_sort_val[vpCoursesInOut[i]] = ssprintf( "%06i", iMeter );
|
||||
}
|
||||
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle );
|
||||
@@ -448,8 +448,8 @@ bool EditCourseUtil::ValidateEditCourseName( const RString &sAnswer, RString &sE
|
||||
|
||||
void EditCourseUtil::UpdateAndSetTrail()
|
||||
{
|
||||
ASSERT( GAMESTATE->m_pCurStyle != NULL );
|
||||
StepsType st = GAMESTATE->m_pCurStyle->m_StepsType;
|
||||
ASSERT( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) != NULL );
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType;
|
||||
Trail *pTrail = NULL;
|
||||
if( GAMESTATE->m_pCurCourse )
|
||||
pTrail = GAMESTATE->m_pCurCourse->GetTrailForceRegenCache( st );
|
||||
|
||||
@@ -277,7 +277,7 @@ void StepsDisplayList::SetFromGameState()
|
||||
FOREACH_CONST( Difficulty, difficulties, d )
|
||||
{
|
||||
m_Rows[i].m_dc = *d;
|
||||
m_Lines[i].m_Meter.SetFromStepsTypeAndMeterAndDifficultyAndCourseType( GAMESTATE->m_pCurStyle->m_StepsType, 0, *d, CourseType_Invalid );
|
||||
m_Lines[i].m_Meter.SetFromStepsTypeAndMeterAndDifficultyAndCourseType( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType, 0, *d, CourseType_Invalid );
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,12 +62,14 @@ public:
|
||||
static int GetName( T* p, lua_State *L ) { lua_pushstring( L, p->m_szName ); return 1; }
|
||||
static int CountNotesSeparately( T* p, lua_State *L ) { lua_pushboolean( L, p->m_bCountNotesSeparately ); return 1; }
|
||||
DEFINE_METHOD( GetMapJudgmentTo, GetMapJudgmentTo(Enum::Check<TapNoteScore>(L, 1)) )
|
||||
DEFINE_METHOD(GetSeparateStyles, m_PlayersHaveSeparateStyles);
|
||||
|
||||
LunaGame()
|
||||
{
|
||||
ADD_METHOD( GetName );
|
||||
ADD_METHOD( CountNotesSeparately );
|
||||
ADD_METHOD( GetMapJudgmentTo );
|
||||
ADD_METHOD( GetSeparateStyles );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ struct Game
|
||||
/** @brief Do we count multiple notes in a row as separate notes, or as one note? */
|
||||
bool m_bCountNotesSeparately;
|
||||
bool m_bTickHolds;
|
||||
bool m_PlayersHaveSeparateStyles;
|
||||
|
||||
InputScheme m_InputScheme;
|
||||
|
||||
|
||||
+5
-5
@@ -84,7 +84,7 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
|
||||
{
|
||||
if( m_pm != PlayMode_Invalid && GAMESTATE->m_PlayMode != m_pm )
|
||||
return false;
|
||||
if( m_pStyle && GAMESTATE->GetCurrentStyle() != m_pStyle )
|
||||
if( m_pStyle && GAMESTATE->GetCurrentStyle(pn) != m_pStyle )
|
||||
return false;
|
||||
// HACK: don't compare m_dc if m_pSteps is set. This causes problems
|
||||
// in ScreenSelectOptionsMaster::ImportOptions if m_PreferredDifficulty
|
||||
@@ -289,7 +289,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
if( !m_bInvalid )
|
||||
{
|
||||
Song *pSong = (m_pSong != NULL)? m_pSong:GAMESTATE->m_pCurSong;
|
||||
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle();
|
||||
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber());
|
||||
if( pSong == NULL || pStyle == NULL )
|
||||
{
|
||||
MAKE_INVALID("Must set Song and Style to set Steps.");
|
||||
@@ -327,7 +327,7 @@ void GameCommand::LoadOne( const Command& cmd )
|
||||
if( !m_bInvalid )
|
||||
{
|
||||
Course *pCourse = (m_pCourse != NULL)? m_pCourse:GAMESTATE->m_pCurCourse;
|
||||
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle();
|
||||
const Style *pStyle = m_pStyle ? m_pStyle : GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber());
|
||||
if( pCourse == NULL || pStyle == NULL )
|
||||
{
|
||||
MAKE_INVALID("Must set Course and Style to set Trail.");
|
||||
@@ -598,7 +598,7 @@ bool GameCommand::IsPlayable( RString *why ) const
|
||||
if( m_pm != PlayMode_Invalid || m_pStyle != NULL )
|
||||
{
|
||||
const PlayMode pm = (m_pm != PlayMode_Invalid) ? m_pm : GAMESTATE->m_PlayMode;
|
||||
const Style *style = (m_pStyle != NULL)? m_pStyle: GAMESTATE->GetCurrentStyle();
|
||||
const Style *style = (m_pStyle != NULL)? m_pStyle: GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber());
|
||||
if( !AreStyleAndPlayModeCompatible( style, pm ) )
|
||||
{
|
||||
if( why )
|
||||
@@ -705,7 +705,7 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
|
||||
|
||||
if( m_pStyle != NULL )
|
||||
{
|
||||
GAMESTATE->SetCurrentStyle( m_pStyle );
|
||||
GAMESTATE->SetCurrentStyle( m_pStyle, GAMESTATE->GetMasterPlayerNumber() );
|
||||
|
||||
// It's possible to choose a style that didn't have enough players joined.
|
||||
// If enough players aren't joined, then we need to subtract credits
|
||||
|
||||
@@ -239,6 +239,7 @@ namespace
|
||||
* case going from theme to theme, but if it was, it should be fixed
|
||||
* now. There's probably be a better way to do it, but I'm not sure
|
||||
* what it'd be. -aj */
|
||||
THEME->UpdateLuaGlobals();
|
||||
THEME->ReloadMetrics();
|
||||
g_NewGame= RString();
|
||||
g_NewTheme= RString();
|
||||
|
||||
+148
-194
@@ -170,7 +170,6 @@ static const Style g_Style_Dance_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
true, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -206,7 +205,6 @@ static const Style g_Style_Dance_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
true, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -250,7 +248,6 @@ static const Style g_Style_Dance_Double =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -286,7 +283,6 @@ static const Style g_Style_Dance_Couple =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
true, // m_bCanUseBeginnerHelper
|
||||
true, // m_bLockDifficulties
|
||||
};
|
||||
@@ -326,7 +322,6 @@ static const Style g_Style_Dance_Solo =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -370,7 +365,6 @@ static const Style g_Style_Dance_Couple_Edit =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -405,7 +399,6 @@ static const Style g_Style_Dance_ThreePanel =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -443,7 +436,6 @@ static const Style g_Style_Dance_Solo_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,5,1,4,2,3 // outside in
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
}; */
|
||||
@@ -487,10 +479,8 @@ static const Style g_Style_Dance_Routine =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
true, // m_bLockDifficulties
|
||||
|
||||
};
|
||||
|
||||
static const Style *g_apGame_Dance_Styles[] =
|
||||
@@ -512,6 +502,7 @@ static const Game g_Game_Dance =
|
||||
g_apGame_Dance_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"dance", // m_szName
|
||||
NUM_DANCE_BUTTONS, // m_iButtonsPerController
|
||||
@@ -600,7 +591,6 @@ static const Style g_Style_Pump_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -638,7 +628,6 @@ static const Style g_Style_Pump_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -678,7 +667,6 @@ static const Style g_Style_Pump_HalfDouble =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,3,1,4,0,5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -726,7 +714,6 @@ static const Style g_Style_Pump_Double =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4, 2+5,1+5,3+5,0+5,4+5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -764,7 +751,6 @@ static const Style g_Style_Pump_Couple =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
true, // m_bLockDifficulties
|
||||
};
|
||||
@@ -812,7 +798,6 @@ static const Style g_Style_Pump_Couple_Edit =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4, 2+5,1+5,3+5,0+5,4+5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -860,7 +845,6 @@ static const Style g_Style_Pump_Routine =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,1,3,0,4,7,6,8,5,9
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
true, // m_bLockDifficulties
|
||||
};
|
||||
@@ -883,6 +867,7 @@ static const Game g_Game_Pump =
|
||||
g_apGame_Pump_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
true, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"pump", // m_szName
|
||||
NUM_PUMP_BUTTONS, // m_iButtonsPerController
|
||||
@@ -961,7 +946,6 @@ static const Style g_Style_KB7_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6 // doesn't work?
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1005,7 +989,6 @@ static const Style g_Style_KB7_Small =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6 // doesn't work?
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
}; */
|
||||
@@ -1047,7 +1030,6 @@ static const Style g_Style_KB7_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6
|
||||
},
|
||||
true, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1066,6 +1048,7 @@ static const Game g_Game_KB7 =
|
||||
g_apGame_KB7_Styles, // m_apStyles
|
||||
true, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"kb7", // m_szName
|
||||
NUM_KB7_BUTTONS, // m_iButtonsPerController
|
||||
@@ -1134,7 +1117,6 @@ static const Style g_Style_Ez2_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,0,4,1,3 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1176,7 +1158,6 @@ static const Style g_Style_Ez2_Real =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
3,0,6,1,5,2,4 // This should be from back to front: Down, UpLeft, UpRight, Lower Left Hand, Lower Right Hand, Upper Left Hand, Upper Right Hand
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1214,7 +1195,6 @@ static const Style g_Style_Ez2_Single_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,0,4,1,3 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1256,7 +1236,6 @@ static const Style g_Style_Ez2_Real_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
3,0,6,2,4,1,5 // This should be from back to front: Down, UpLeft, UpRight, Lower Left Hand, Lower Right Hand, Upper Left Hand, Upper Right Hand
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1304,7 +1283,6 @@ static const Style g_Style_Ez2_Double =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,0,4,1,3,7,5,9,6,8 // This should be from back to front: Down, UpLeft, UpRight, Upper Left Hand, Upper Right Hand
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1338,6 +1316,7 @@ static const Game g_Game_Ez2 =
|
||||
g_apGame_Ez2_Styles, // m_apStyles
|
||||
true, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"ez2", // m_szName
|
||||
NUM_EZ2_BUTTONS, // m_iButtonsPerController
|
||||
@@ -1404,7 +1383,6 @@ static const Style g_Style_Para_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,0,4,1,3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1442,7 +1420,6 @@ static const Style g_Style_Para_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
2,0,4,1,3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1471,6 +1448,7 @@ static const Game g_Game_Para =
|
||||
g_apGame_Para_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"para", // m_szName
|
||||
NUM_PARA_BUTTONS, // m_iButtonsPerController
|
||||
@@ -1538,7 +1516,6 @@ static const Style g_Style_DS3DDX_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1569,6 +1546,7 @@ static const Game g_Game_DS3DDX =
|
||||
g_apGame_DS3DDX_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"ds3ddx", // m_szName
|
||||
NUM_DS3DDX_BUTTONS, // m_iButtonsPerController
|
||||
@@ -1638,7 +1616,6 @@ static const Style g_Style_Beat_Single5 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1678,7 +1655,6 @@ static const Style g_Style_Beat_Versus5 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1730,7 +1706,6 @@ static const Style g_Style_Beat_Double5 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7,8,9,10,11
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1774,7 +1749,6 @@ static const Style g_Style_Beat_Single7 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1818,7 +1792,6 @@ static const Style g_Style_Beat_Versus7 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1879,7 +1852,6 @@ static const Style g_Style_Beat_Double7 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -1915,6 +1887,7 @@ static const Game g_Game_Beat =
|
||||
g_apGame_Beat_Styles, // m_apStyles
|
||||
true, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"beat", // m_szName
|
||||
NUM_BEAT_BUTTONS, // m_iButtonsPerController
|
||||
@@ -1982,7 +1955,6 @@ static const Style g_Style_Maniax_Single =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2018,7 +1990,6 @@ static const Style g_Style_Maniax_Versus =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2062,7 +2033,6 @@ static const Style g_Style_Maniax_Double =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2095,6 +2065,7 @@ static const Game g_Game_Maniax =
|
||||
g_apGame_Maniax_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"maniax", // m_szName
|
||||
NUM_MANIAX_BUTTONS, // m_iButtonsPerController
|
||||
@@ -2124,7 +2095,6 @@ static const Game g_Game_Maniax =
|
||||
//ThemeMetric<int> TECHNO_COL_SPACING ("ColumnSpacing","Techno");
|
||||
static const int TECHNO_COL_SPACING = 56;
|
||||
//ThemeMetric<int> TECHNO_VERSUS_COL_SPACING ("ColumnSpacing","TechnoVersus");
|
||||
static const int TECHNO_VERSUS_COL_SPACING = 33;
|
||||
static const Style g_Style_Techno_Single4 =
|
||||
{ // STYLE_TECHNO_SINGLE4
|
||||
true, // m_bUsedForGameplay
|
||||
@@ -2156,7 +2126,6 @@ static const Style g_Style_Techno_Single4 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2196,7 +2165,6 @@ static const Style g_Style_Techno_Single5 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2240,7 +2208,6 @@ static const Style g_Style_Techno_Single8 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
true, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2276,7 +2243,6 @@ static const Style g_Style_Techno_Versus4 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2316,7 +2282,6 @@ static const Style g_Style_Techno_Versus5 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2333,24 +2298,24 @@ static const Style g_Style_Techno_Versus8 =
|
||||
8, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_5, +TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_6, +TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_7, +TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_8, +TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_1, -TECHNO_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_5, +TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_6, +TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_7, +TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_8, +TECHNO_COL_SPACING*3.5f, NULL },
|
||||
},
|
||||
{ // PLAYER_2
|
||||
{ TRACK_1, -TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_5, +TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_6, +TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_7, +TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_8, +TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_1, -TECHNO_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_5, +TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_6, +TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_7, +TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_8, +TECHNO_COL_SPACING*3.5f, NULL },
|
||||
},
|
||||
},
|
||||
{ // m_iInputColumn[NUM_GameController][NUM_GameButton]
|
||||
@@ -2362,7 +2327,6 @@ static const Style g_Style_Techno_Versus8 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
true, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2406,7 +2370,6 @@ static const Style g_Style_Techno_Double4 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2466,7 +2429,6 @@ static const Style g_Style_Techno_Double5 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7,8,9
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2483,40 +2445,40 @@ static const Style g_Style_Techno_Double8 =
|
||||
16, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -TECHNO_VERSUS_COL_SPACING*7.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_VERSUS_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_VERSUS_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_VERSUS_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_5, -TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_6, -TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_7, -TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_8, -TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_9, +TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_10, +TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_11, +TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_12, +TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_13, +TECHNO_VERSUS_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_14, +TECHNO_VERSUS_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_15, +TECHNO_VERSUS_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_16, +TECHNO_VERSUS_COL_SPACING*7.5f, NULL },
|
||||
{ TRACK_1, -TECHNO_COL_SPACING*7.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_5, -TECHNO_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_6, -TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_7, -TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_8, -TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_9, +TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_10, +TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_11, +TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_12, +TECHNO_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_13, +TECHNO_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_14, +TECHNO_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_15, +TECHNO_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_16, +TECHNO_COL_SPACING*7.5f, NULL },
|
||||
},
|
||||
{ // PLAYER_2
|
||||
{ TRACK_1, -TECHNO_VERSUS_COL_SPACING*7.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_VERSUS_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_VERSUS_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_VERSUS_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_5, -TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_6, -TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_7, -TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_8, -TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_9, +TECHNO_VERSUS_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_10, +TECHNO_VERSUS_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_11, +TECHNO_VERSUS_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_12, +TECHNO_VERSUS_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_13, +TECHNO_VERSUS_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_14, +TECHNO_VERSUS_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_15, +TECHNO_VERSUS_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_16, +TECHNO_VERSUS_COL_SPACING*7.5f, NULL },
|
||||
{ TRACK_1, -TECHNO_COL_SPACING*7.5f, NULL },
|
||||
{ TRACK_2, -TECHNO_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_3, -TECHNO_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_4, -TECHNO_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_5, -TECHNO_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_6, -TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_7, -TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_8, -TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_9, +TECHNO_COL_SPACING*0.5f, NULL },
|
||||
{ TRACK_10, +TECHNO_COL_SPACING*1.5f, NULL },
|
||||
{ TRACK_11, +TECHNO_COL_SPACING*2.5f, NULL },
|
||||
{ TRACK_12, +TECHNO_COL_SPACING*3.5f, NULL },
|
||||
{ TRACK_13, +TECHNO_COL_SPACING*4.5f, NULL },
|
||||
{ TRACK_14, +TECHNO_COL_SPACING*5.5f, NULL },
|
||||
{ TRACK_15, +TECHNO_COL_SPACING*6.5f, NULL },
|
||||
{ TRACK_16, +TECHNO_COL_SPACING*7.5f, NULL },
|
||||
},
|
||||
},
|
||||
{ // m_iInputColumn[NUM_GameController][NUM_GameButton]
|
||||
@@ -2526,7 +2488,6 @@ static const Style g_Style_Techno_Double8 =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2575,6 +2536,7 @@ static const Game g_Game_Techno =
|
||||
g_apGame_Techno_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"techno", // m_szName
|
||||
NUM_TECHNO_BUTTONS, // m_iButtonsPerController
|
||||
@@ -2647,7 +2609,6 @@ static const Style g_Style_Popn_Five =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2693,7 +2654,6 @@ static const Style g_Style_Popn_Nine =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7,8
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2726,6 +2686,7 @@ static const Game g_Game_Popn =
|
||||
g_apGame_Popn_Styles, // m_apStyles
|
||||
true, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"popn", // m_szName
|
||||
NUM_POPN_BUTTONS, // m_iButtonsPerController
|
||||
@@ -2815,7 +2776,6 @@ static const Style g_Style_Lights_Cabinet =
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0,1,2,3,4,5,6,7
|
||||
},
|
||||
false, // m_bNeedsZoomOutWith2Players
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
@@ -2832,6 +2792,7 @@ static const Game g_Game_Lights =
|
||||
g_apGame_Lights_Styles, // m_apStyles
|
||||
false, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
false, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"lights", // m_szName
|
||||
NUM_LIGHTS_BUTTONS, // m_iButtonsPerController
|
||||
@@ -2897,14 +2858,14 @@ static const int KICKBOX_COL_SPACING= 64;
|
||||
|
||||
static const Style g_Style_Kickbox_Human=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
true, // Used for edit
|
||||
true, // Used for demonstration
|
||||
true, // Used for how to play
|
||||
"human", // name
|
||||
StepsType_kickbox_human, // stepstype
|
||||
StyleType_OnePlayerOneSide, // styletype
|
||||
4, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
true, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
true, // m_bUsedForHowToPlay
|
||||
"human", // m_szName
|
||||
StepsType_kickbox_human, // m_StepsType
|
||||
StyleType_OnePlayerOneSide, // m_StyleType
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*1.5f, NULL },
|
||||
@@ -2926,21 +2887,20 @@ static const Style g_Style_Kickbox_Human=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Human_Versus=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
false, // Used for edit
|
||||
true, // Used for demonstration
|
||||
false, // Used for how to play
|
||||
"hversus", // name
|
||||
StepsType_kickbox_human, // stepstype
|
||||
StyleType_TwoPlayersTwoSides, // styletype
|
||||
4, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
false, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
false, // m_bUsedForHowToPlay
|
||||
"hversus", // m_szName
|
||||
StepsType_kickbox_human, // m_StepsType
|
||||
StyleType_TwoPlayersTwoSides, // m_StyleType
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*1.5f, NULL },
|
||||
@@ -2962,21 +2922,20 @@ static const Style g_Style_Kickbox_Human_Versus=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Quadarm=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
true, // Used for edit
|
||||
true, // Used for demonstration
|
||||
true, // Used for how to play
|
||||
"quadarm", // name
|
||||
StepsType_kickbox_quadarm, // stepstype
|
||||
StyleType_OnePlayerOneSide, // styletype
|
||||
4, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
true, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
true, // m_bUsedForHowToPlay
|
||||
"quadarm", // m_szName
|
||||
StepsType_kickbox_quadarm, // m_StepsType
|
||||
StyleType_OnePlayerOneSide, // m_StyleType
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*1.5f, NULL },
|
||||
@@ -2998,21 +2957,20 @@ static const Style g_Style_Kickbox_Quadarm=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Quadarm_Versus=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
false, // Used for edit
|
||||
true, // Used for demonstration
|
||||
false, // Used for how to play
|
||||
"qversus", // name
|
||||
StepsType_kickbox_quadarm, // stepstype
|
||||
StyleType_TwoPlayersTwoSides, // styletype
|
||||
4, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
false, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
false, // m_bUsedForHowToPlay
|
||||
"qversus", // m_szName
|
||||
StepsType_kickbox_quadarm, // m_StepsType
|
||||
StyleType_TwoPlayersTwoSides, // m_StyleType
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*1.5f, NULL },
|
||||
@@ -3034,21 +2992,20 @@ static const Style g_Style_Kickbox_Quadarm_Versus=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Insect=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
true, // Used for edit
|
||||
true, // Used for demonstration
|
||||
true, // Used for how to play
|
||||
"insect", // name
|
||||
StepsType_kickbox_insect, // stepstype
|
||||
StyleType_OnePlayerOneSide, // styletype
|
||||
6, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
true, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
true, // m_bUsedForHowToPlay
|
||||
"insect", // m_szName
|
||||
StepsType_kickbox_insect, // m_StepsType
|
||||
StyleType_OnePlayerOneSide, // m_StyleType
|
||||
6, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*2.5f, NULL },
|
||||
@@ -3074,21 +3031,20 @@ static const Style g_Style_Kickbox_Insect=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3, 4, 5
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Insect_Versus=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
false, // Used for edit
|
||||
true, // Used for demonstration
|
||||
false, // Used for how to play
|
||||
"iversus", // name
|
||||
StepsType_kickbox_insect, // stepstype
|
||||
StyleType_TwoPlayersTwoSides, // styletype
|
||||
6, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
false, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
false, // m_bUsedForHowToPlay
|
||||
"iversus", // m_szName
|
||||
StepsType_kickbox_insect, // m_StepsType
|
||||
StyleType_TwoPlayersTwoSides, // m_StyleType
|
||||
6, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*2.5f, NULL },
|
||||
@@ -3114,21 +3070,20 @@ static const Style g_Style_Kickbox_Insect_Versus=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3, 4, 5
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Arachnid=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
true, // Used for edit
|
||||
true, // Used for demonstration
|
||||
true, // Used for how to play
|
||||
"arachnid", // name
|
||||
StepsType_kickbox_arachnid, // stepstype
|
||||
StyleType_OnePlayerOneSide, // styletype
|
||||
8, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
true, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
true, // m_bUsedForHowToPlay
|
||||
"arachnid", // m_szName
|
||||
StepsType_kickbox_arachnid, // m_StepsType
|
||||
StyleType_OnePlayerOneSide, // m_StyleType
|
||||
8, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*3.5f, NULL },
|
||||
@@ -3158,21 +3113,20 @@ static const Style g_Style_Kickbox_Arachnid=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3, 4, 5, 6, 7
|
||||
},
|
||||
false, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style g_Style_Kickbox_Arachnid_Versus=
|
||||
{
|
||||
true, // Used for gameplay
|
||||
false, // Used for edit
|
||||
true, // Used for demonstration
|
||||
false, // Used for how to play
|
||||
"aversus", // name
|
||||
StepsType_kickbox_arachnid, // stepstype
|
||||
StyleType_TwoPlayersTwoSides, // styletype
|
||||
8, // cols per player
|
||||
true, // m_bUsedForGameplay
|
||||
false, // m_bUsedForEdit
|
||||
true, // m_bUsedForDemonstration
|
||||
false, // m_bUsedForHowToPlay
|
||||
"aversus", // m_szName
|
||||
StepsType_kickbox_arachnid, // m_StepsType
|
||||
StyleType_TwoPlayersTwoSides, // m_StyleType
|
||||
8, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, -KICKBOX_COL_SPACING*3.5f, NULL },
|
||||
@@ -3202,9 +3156,8 @@ static const Style g_Style_Kickbox_Arachnid_Versus=
|
||||
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
0, 1, 2, 3, 4, 5, 6, 7
|
||||
},
|
||||
true, // needs zoom out with 2 players
|
||||
false, // can use beginner helper
|
||||
false, // lock difficulties
|
||||
false, // m_bCanUseBeginnerHelper
|
||||
false, // m_bLockDifficulties
|
||||
};
|
||||
|
||||
static const Style* g_apGame_Kickbox_Styles[] =
|
||||
@@ -3222,14 +3175,15 @@ static const Style* g_apGame_Kickbox_Styles[] =
|
||||
|
||||
static const Game g_Game_Kickbox =
|
||||
{
|
||||
"kickbox", // name
|
||||
g_apGame_Kickbox_Styles, // styles
|
||||
true, // count notes separately
|
||||
false, // tick holds
|
||||
{ // input scheme
|
||||
"kickbox",
|
||||
NUM_KICKBOX_BUTTONS, // buttons per controller
|
||||
{ // button names
|
||||
"kickbox", // m_szName
|
||||
g_apGame_Kickbox_Styles, // m_apStyles
|
||||
true, // m_bCountNotesSeparately
|
||||
false, // m_bTickHolds
|
||||
true, // m_PlayersHaveSeparateStyles
|
||||
{ // m_InputScheme
|
||||
"kickbox", // m_szName
|
||||
NUM_KICKBOX_BUTTONS, // m_iButtonsPerController
|
||||
{ // m_szButtonNames
|
||||
{ "DownLeftFoot", GameButton_Invalid },
|
||||
{ "UpLeftFoot", GameButton_Invalid },
|
||||
{ "UpLeftFist", GAME_BUTTON_LEFT },
|
||||
|
||||
+169
-46
@@ -20,6 +20,7 @@
|
||||
#include "LuaReference.h"
|
||||
#include "MessageManager.h"
|
||||
#include "MemoryCardManager.h"
|
||||
#include "NoteData.h"
|
||||
#include "NoteSkinManager.h"
|
||||
#include "PlayerState.h"
|
||||
#include "PrefsManager.h"
|
||||
@@ -136,7 +137,11 @@ GameState::GameState() :
|
||||
{
|
||||
g_pImpl = new GameStateImpl;
|
||||
|
||||
SetCurrentStyle( NULL );
|
||||
m_pCurStyle.Set(NULL);
|
||||
FOREACH_PlayerNumber(rpn)
|
||||
{
|
||||
m_SeparatedStyles[rpn]= NULL;
|
||||
}
|
||||
|
||||
m_pCurGame.Set( NULL );
|
||||
m_iCoins.Set( 0 );
|
||||
@@ -153,12 +158,12 @@ GameState::GameState() :
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
m_pPlayerState[p] = new PlayerState;
|
||||
m_pPlayerState[p]->m_PlayerNumber = p;
|
||||
m_pPlayerState[p]->SetPlayerNumber(p);
|
||||
}
|
||||
FOREACH_MultiPlayer( p )
|
||||
{
|
||||
m_pMultiPlayerState[p] = new PlayerState;
|
||||
m_pMultiPlayerState[p]->m_PlayerNumber = PLAYER_1;
|
||||
m_pMultiPlayerState[p]->SetPlayerNumber(PLAYER_1);
|
||||
m_pMultiPlayerState[p]->m_mp = p;
|
||||
}
|
||||
|
||||
@@ -285,7 +290,7 @@ void GameState::Reset()
|
||||
ASSERT( THEME != NULL );
|
||||
|
||||
m_timeGameStarted.SetZero();
|
||||
SetCurrentStyle( NULL );
|
||||
SetCurrentStyle( NULL, PLAYER_INVALID );
|
||||
FOREACH_MultiPlayer( p )
|
||||
m_MultiPlayerStatus[p] = MultiPlayerStatus_NotJoined;
|
||||
FOREACH_PlayerNumber( pn )
|
||||
@@ -391,23 +396,23 @@ void GameState::JoinPlayer( PlayerNumber pn )
|
||||
}
|
||||
|
||||
// Set the current style to something appropriate for the new number of joined players.
|
||||
if( ALLOW_LATE_JOIN && m_pCurStyle != NULL )
|
||||
if( ALLOW_LATE_JOIN && GetCurrentStyle(PLAYER_INVALID) != NULL )
|
||||
{
|
||||
const Style *pStyle;
|
||||
// Only use one player for StyleType_OnePlayerTwoSides and StepsTypes
|
||||
// that can only be played by one player (e.g. dance-solo,
|
||||
// dance-threepanel, popn-nine). -aj
|
||||
// XXX?: still shows joined player as "Insert Card". May not be an issue? -aj
|
||||
if( m_pCurStyle->m_StyleType == StyleType_OnePlayerTwoSides ||
|
||||
m_pCurStyle->m_StepsType == StepsType_dance_solo ||
|
||||
m_pCurStyle->m_StepsType == StepsType_dance_threepanel ||
|
||||
m_pCurStyle->m_StepsType == StepsType_popn_nine )
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, 1, m_pCurStyle->m_StepsType );
|
||||
if( GetCurrentStyle(PLAYER_INVALID)->m_StyleType == StyleType_OnePlayerTwoSides ||
|
||||
GetCurrentStyle(PLAYER_INVALID)->m_StepsType == StepsType_dance_solo ||
|
||||
GetCurrentStyle(PLAYER_INVALID)->m_StepsType == StepsType_dance_threepanel ||
|
||||
GetCurrentStyle(PLAYER_INVALID)->m_StepsType == StepsType_popn_nine )
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, 1, GetCurrentStyle(PLAYER_INVALID)->m_StepsType );
|
||||
else
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), m_pCurStyle->m_StepsType );
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, GetNumSidesJoined(), GetCurrentStyle(PLAYER_INVALID)->m_StepsType );
|
||||
|
||||
// use SetCurrentStyle in case of StyleType_OnePlayerTwoSides
|
||||
SetCurrentStyle( pStyle );
|
||||
SetCurrentStyle( pStyle, pn );
|
||||
}
|
||||
|
||||
Message msg( MessageIDToString(Message_PlayerJoined) );
|
||||
@@ -657,7 +662,7 @@ int GameState::GetNumStagesForCurrentSongAndStepsOrCourse() const
|
||||
int iNumStagesOfThisSong = 1;
|
||||
if( m_pCurSong )
|
||||
{
|
||||
const Style *pStyle = m_pCurStyle;
|
||||
const Style *pStyle = GetCurrentStyle(PLAYER_INVALID);
|
||||
int numSidesJoined = GetNumSidesJoined();
|
||||
if( pStyle == NULL )
|
||||
{
|
||||
@@ -894,6 +899,86 @@ void GameState::SaveCurrentSettingsToProfile( PlayerNumber pn )
|
||||
pProfile->m_lastCourse.FromCourse( m_pPreferredCourse );
|
||||
}
|
||||
|
||||
bool GameState::CanSafelyEnterGameplay(RString& reason)
|
||||
{
|
||||
if(!IsCourseMode())
|
||||
{
|
||||
Song const* song= m_pCurSong;
|
||||
if(song == NULL)
|
||||
{
|
||||
reason= "Current song is NULL.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Course const* song= m_pCurCourse;
|
||||
if(song == NULL)
|
||||
{
|
||||
reason= "Current course is NULL.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
FOREACH_EnabledPlayer(pn)
|
||||
{
|
||||
Style const* style= GetCurrentStyle(pn);
|
||||
if(style == NULL)
|
||||
{
|
||||
reason= ssprintf("Style for player %d is NULL.", pn+1);
|
||||
return false;
|
||||
}
|
||||
if(!IsCourseMode())
|
||||
{
|
||||
Steps const* steps= m_pCurSteps[pn];
|
||||
if(steps == NULL)
|
||||
{
|
||||
reason= ssprintf("Steps for player %d is NULL.", pn+1);
|
||||
return false;
|
||||
}
|
||||
if(steps->m_StepsType != style->m_StepsType)
|
||||
{
|
||||
reason= ssprintf("Player %d StepsType %s for steps does not equal "
|
||||
"StepsType %s for style.", pn+1,
|
||||
GAMEMAN->GetStepsTypeInfo(steps->m_StepsType).szName,
|
||||
GAMEMAN->GetStepsTypeInfo(style->m_StepsType).szName);
|
||||
return false;
|
||||
}
|
||||
if(steps->m_pSong != m_pCurSong)
|
||||
{
|
||||
reason= ssprintf("Steps for player %d are not for the current song.",
|
||||
pn+1);
|
||||
return false;
|
||||
}
|
||||
NoteData ndtemp;
|
||||
steps->GetNoteData(ndtemp);
|
||||
if(ndtemp.GetNumTracks() != style->m_iColsPerPlayer)
|
||||
{
|
||||
reason= ssprintf("Steps for player %d have %d columns, style has %d "
|
||||
"columns.", pn+1, ndtemp.GetNumTracks(), style->m_iColsPerPlayer);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Trail const* steps= m_pCurTrail[pn];
|
||||
if(steps == NULL)
|
||||
{
|
||||
reason= ssprintf("Steps for player %d is NULL.", pn+1);
|
||||
return false;
|
||||
}
|
||||
if(steps->m_StepsType != style->m_StepsType)
|
||||
{
|
||||
reason= ssprintf("Player %d StepsType %s for steps does not equal "
|
||||
"StepsType %s for style.", pn+1,
|
||||
GAMEMAN->GetStepsTypeInfo(steps->m_StepsType).szName,
|
||||
GAMEMAN->GetStepsTypeInfo(style->m_StepsType).szName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void GameState::Update( float fDelta )
|
||||
{
|
||||
m_SongOptions.Update( fDelta );
|
||||
@@ -1197,7 +1282,7 @@ RString GameState::GetPlayerDisplayName( PlayerNumber pn ) const
|
||||
|
||||
bool GameState::PlayersCanJoin() const
|
||||
{
|
||||
bool b = GetNumSidesJoined() == 0 || GetCurrentStyle() == NULL; // selecting a style finalizes the players
|
||||
bool b = GetNumSidesJoined() == 0 || GetCurrentStyle(PLAYER_INVALID) == NULL; // selecting a style finalizes the players
|
||||
if( ALLOW_LATE_JOIN.IsLoaded() && ALLOW_LATE_JOIN )
|
||||
{
|
||||
Screen *pScreen = SCREENMAN->GetTopScreen();
|
||||
@@ -1216,39 +1301,66 @@ int GameState::GetNumSidesJoined() const
|
||||
return iNumSidesJoined;
|
||||
}
|
||||
|
||||
const Game* GameState::GetCurrentGame()
|
||||
const Game* GameState::GetCurrentGame() const
|
||||
{
|
||||
ASSERT( m_pCurGame != NULL ); // the game must be set before calling this
|
||||
return m_pCurGame;
|
||||
}
|
||||
|
||||
const Style* GameState::GetCurrentStyle() const
|
||||
const Style* GameState::GetCurrentStyle(PlayerNumber pn) const
|
||||
{
|
||||
return m_pCurStyle;
|
||||
}
|
||||
|
||||
void GameState::SetCurrentStyle( const Style *pStyle )
|
||||
{
|
||||
m_pCurStyle.Set( pStyle );
|
||||
if( INPUTMAPPER )
|
||||
if(GetCurrentGame() == NULL) { return NULL; }
|
||||
if(!GetCurrentGame()->m_PlayersHaveSeparateStyles)
|
||||
{
|
||||
if( GetCurrentStyle() && GetCurrentStyle()->m_StyleType == StyleType_OnePlayerTwoSides )
|
||||
INPUTMAPPER->SetJoinControllers( this->GetMasterPlayerNumber() );
|
||||
else
|
||||
INPUTMAPPER->SetJoinControllers( PLAYER_INVALID );
|
||||
return m_pCurStyle;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pn >= NUM_PLAYERS)
|
||||
{
|
||||
return m_SeparatedStyles[PLAYER_1] == NULL ? m_SeparatedStyles[PLAYER_2]
|
||||
: m_SeparatedStyles[PLAYER_1];
|
||||
}
|
||||
return m_SeparatedStyles[pn];
|
||||
}
|
||||
}
|
||||
|
||||
bool GameState::SetCompatibleStyle(StepsType stype)
|
||||
void GameState::SetCurrentStyle(const Style *style, PlayerNumber pn)
|
||||
{
|
||||
if(!GetCurrentGame()->m_PlayersHaveSeparateStyles)
|
||||
{
|
||||
m_pCurStyle.Set(style);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SeparatedStyles[pn]= style;
|
||||
if(pn == PLAYER_INVALID)
|
||||
{
|
||||
FOREACH_PlayerNumber(rpn)
|
||||
{
|
||||
m_SeparatedStyles[rpn]= style;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(INPUTMAPPER)
|
||||
{
|
||||
if(GetCurrentStyle(pn) && GetCurrentStyle(pn)->m_StyleType == StyleType_OnePlayerTwoSides)
|
||||
INPUTMAPPER->SetJoinControllers(this->GetMasterPlayerNumber());
|
||||
else
|
||||
INPUTMAPPER->SetJoinControllers(PLAYER_INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
bool GameState::SetCompatibleStyle(StepsType stype, PlayerNumber pn)
|
||||
{
|
||||
bool style_incompatible= false;
|
||||
if(!m_pCurStyle)
|
||||
if(!GetCurrentStyle(pn))
|
||||
{
|
||||
style_incompatible= true;
|
||||
}
|
||||
else
|
||||
{
|
||||
style_incompatible= stype != m_pCurStyle->m_StepsType;
|
||||
style_incompatible= stype != GetCurrentStyle(pn)->m_StepsType;
|
||||
}
|
||||
if(CommonMetrics::AUTO_SET_STYLE && style_incompatible)
|
||||
{
|
||||
@@ -1258,9 +1370,9 @@ bool GameState::SetCompatibleStyle(StepsType stype)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SetCurrentStyle(compatible_style);
|
||||
SetCurrentStyle(compatible_style, pn);
|
||||
}
|
||||
return stype == m_pCurStyle->m_StepsType;
|
||||
return stype == GetCurrentStyle(pn)->m_StepsType;
|
||||
}
|
||||
|
||||
bool GameState::IsPlayerEnabled( PlayerNumber pn ) const
|
||||
@@ -1303,7 +1415,7 @@ bool GameState::IsHumanPlayer( PlayerNumber pn ) const
|
||||
if( pn == PLAYER_INVALID )
|
||||
return false;
|
||||
|
||||
if( GetCurrentStyle() == NULL ) // no style chosen
|
||||
if( GetCurrentStyle(pn) == NULL ) // no style chosen
|
||||
{
|
||||
if( PlayersCanJoin() )
|
||||
return m_bSideIsJoined[pn]; // only allow input from sides that have already joined
|
||||
@@ -1311,7 +1423,7 @@ bool GameState::IsHumanPlayer( PlayerNumber pn ) const
|
||||
return true; // if we can't join, then we're on a screen like MusicScroll or GameOver
|
||||
}
|
||||
|
||||
StyleType type = GetCurrentStyle()->m_StyleType;
|
||||
StyleType type = GetCurrentStyle(pn)->m_StyleType;
|
||||
switch( type )
|
||||
{
|
||||
case StyleType_TwoPlayersTwoSides:
|
||||
@@ -1669,7 +1781,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
|
||||
{
|
||||
CHECKPOINT;
|
||||
|
||||
StepsType st = GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GetCurrentStyle(pn)->m_StepsType;
|
||||
|
||||
// Find unique Song and Steps combinations that were played.
|
||||
// We must keep only the unique combination or else we'll double-count
|
||||
@@ -2012,7 +2124,7 @@ bool GameState::DifficultiesLocked() const
|
||||
return true;
|
||||
if( IsCourseMode() )
|
||||
return PREFSMAN->m_bLockCourseDifficulties;
|
||||
if( GetCurrentStyle()->m_bLockDifficulties )
|
||||
if( GetCurrentStyle(PLAYER_INVALID)->m_bLockDifficulties )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -2099,7 +2211,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
|
||||
return false;
|
||||
if( find(v.begin(),v.end(),cd) == v.end() )
|
||||
continue; /* not available */
|
||||
if( !pCourse || pCourse->GetTrail( GetCurrentStyle()->m_StepsType, cd ) )
|
||||
if( !pCourse || pCourse->GetTrail( GetCurrentStyle(pn)->m_StepsType, cd ) )
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2319,13 +2431,21 @@ public:
|
||||
else { Song *pS = Luna<Song>::check( L, 1, true ); p->m_pCurSong.Set( pS ); }
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static void SetCompatibleStyleOrError(T* p, lua_State* L, StepsType stype)
|
||||
static int CanSafelyEnterGameplay(T* p, lua_State* L)
|
||||
{
|
||||
if(!p->SetCompatibleStyle(stype))
|
||||
RString reason;
|
||||
bool can= p->CanSafelyEnterGameplay(reason);
|
||||
lua_pushboolean(L, can);
|
||||
LuaHelpers::Push(L, reason);
|
||||
return 2;
|
||||
}
|
||||
static void SetCompatibleStyleOrError(T* p, lua_State* L, StepsType stype, PlayerNumber pn)
|
||||
{
|
||||
if(!p->SetCompatibleStyle(stype, pn))
|
||||
{
|
||||
luaL_error(L, "No compatible style for steps/trail.");
|
||||
}
|
||||
if(!p->m_pCurStyle)
|
||||
if(!p->GetCurrentStyle(pn))
|
||||
{
|
||||
luaL_error(L, "No style set and AutoSetStyle is false, cannot set steps/trail.");
|
||||
}
|
||||
@@ -2348,7 +2468,7 @@ public:
|
||||
else
|
||||
{
|
||||
Steps *pS = Luna<Steps>::check(L,2);
|
||||
SetCompatibleStyleOrError(p, L, pS->m_StepsType);
|
||||
SetCompatibleStyleOrError(p, L, pS->m_StepsType, pn);
|
||||
p->m_pCurSteps[pn].Set(pS);
|
||||
}
|
||||
COMMON_RETURN_SELF;
|
||||
@@ -2378,7 +2498,7 @@ public:
|
||||
else
|
||||
{
|
||||
Trail *pS = Luna<Trail>::check(L,2);
|
||||
SetCompatibleStyleOrError(p, L, pS->m_StepsType);
|
||||
SetCompatibleStyleOrError(p, L, pS->m_StepsType, pn);
|
||||
p->m_pCurTrail[pn].Set(pS);
|
||||
}
|
||||
COMMON_RETURN_SELF;
|
||||
@@ -2579,7 +2699,8 @@ public:
|
||||
}
|
||||
static int GetCurrentStyle( T* p, lua_State *L )
|
||||
{
|
||||
Style *pStyle = const_cast<Style *> (p->GetCurrentStyle());
|
||||
PlayerNumber pn= Enum::Check<PlayerNumber>(L, 1, true, true);
|
||||
Style *pStyle = const_cast<Style *> (p->GetCurrentStyle(pn));
|
||||
LuaHelpers::Push( L, pStyle );
|
||||
return 1;
|
||||
}
|
||||
@@ -2732,9 +2853,9 @@ public:
|
||||
|
||||
static void ClearIncompatibleStepsAndTrails( T *p, lua_State* L )
|
||||
{
|
||||
const Style *style = p->m_pCurStyle;
|
||||
FOREACH_HumanPlayer( pn )
|
||||
{
|
||||
const Style *style = p->GetCurrentStyle(pn);
|
||||
if( p->m_pCurSteps[pn] && ( !style || style->m_StepsType != p->m_pCurSteps[pn]->m_StepsType ) )
|
||||
{
|
||||
p->m_pCurSteps[pn].Set( NULL );
|
||||
@@ -2779,8 +2900,9 @@ public:
|
||||
{
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
PlayerNumber pn= Enum::Check<PlayerNumber>(L, 2, true, true);
|
||||
|
||||
p->SetCurrentStyle( pStyle );
|
||||
p->SetCurrentStyle(pStyle, pn);
|
||||
ClearIncompatibleStepsAndTrails( p, L );
|
||||
|
||||
COMMON_RETURN_SELF;
|
||||
@@ -2789,7 +2911,7 @@ public:
|
||||
static int SetCurrentPlayMode( T* p, lua_State *L )
|
||||
{
|
||||
PlayMode pm = Enum::Check<PlayMode>( L, 1 );
|
||||
if( AreStyleAndPlayModeCompatible( p, L, p->m_pCurStyle, pm ) )
|
||||
if( AreStyleAndPlayModeCompatible( p, L, p->GetCurrentStyle(PLAYER_INVALID), pm ) )
|
||||
{
|
||||
p->m_PlayMode.Set( pm );
|
||||
}
|
||||
@@ -2811,6 +2933,7 @@ public:
|
||||
ADD_METHOD( GetPlayerState );
|
||||
ADD_METHOD( GetMultiPlayerState );
|
||||
ADD_METHOD( ApplyGameCommand );
|
||||
ADD_METHOD( CanSafelyEnterGameplay );
|
||||
ADD_METHOD( GetCurrentSong );
|
||||
ADD_METHOD( SetCurrentSong );
|
||||
ADD_METHOD( GetCurrentSteps );
|
||||
|
||||
+10
-4
@@ -73,6 +73,8 @@ public:
|
||||
void SaveCurrentSettingsToProfile( PlayerNumber pn );
|
||||
Song* GetDefaultSong() const;
|
||||
|
||||
bool CanSafelyEnterGameplay(RString& reason);
|
||||
|
||||
void Update( float fDelta );
|
||||
|
||||
// Main state info
|
||||
@@ -85,7 +87,11 @@ public:
|
||||
* @param pGame the game to start using. */
|
||||
void SetCurGame( const Game *pGame );
|
||||
BroadcastOnChangePtr<const Game> m_pCurGame;
|
||||
private: // DO NOT access directly. Use Get/SetCurrentStyle.
|
||||
BroadcastOnChangePtr<const Style> m_pCurStyle;
|
||||
// Only used if the Game specifies that styles are separate.
|
||||
Style const* m_SeparatedStyles[NUM_PlayerNumber];
|
||||
public:
|
||||
/** @brief Determine which side is joined.
|
||||
*
|
||||
* The left side is player 1, and the right side is player 2. */
|
||||
@@ -127,10 +133,10 @@ public:
|
||||
bool EnoughCreditsToJoin() const { return m_iCoins >= GetCoinsNeededToJoin(); }
|
||||
int GetNumSidesJoined() const;
|
||||
|
||||
const Game* GetCurrentGame();
|
||||
const Style* GetCurrentStyle() const;
|
||||
void SetCurrentStyle( const Style *pStyle );
|
||||
bool SetCompatibleStyle(StepsType stype);
|
||||
const Game* GetCurrentGame() const;
|
||||
const Style* GetCurrentStyle(PlayerNumber pn) const;
|
||||
void SetCurrentStyle(const Style *style, PlayerNumber pn);
|
||||
bool SetCompatibleStyle(StepsType stype, PlayerNumber pn);
|
||||
|
||||
void GetPlayerInfo( PlayerNumber pn, bool& bIsEnabledOut, bool& bIsHumanOut );
|
||||
bool IsPlayerEnabled( PlayerNumber pn ) const;
|
||||
|
||||
@@ -15,16 +15,16 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset
|
||||
m_pPlayerState = pPlayerState;
|
||||
m_fYReverseOffsetPixels = fYReverseOffset;
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pn);
|
||||
NOTESKIN->SetPlayerNumber( pn );
|
||||
|
||||
// init arrows
|
||||
for( int c=0; c<pStyle->m_iColsPerPlayer; c++ )
|
||||
{
|
||||
const RString &sButton = GAMESTATE->GetCurrentStyle()->ColToButtonName( c );
|
||||
const RString &sButton = GAMESTATE->GetCurrentStyle(pn)->ColToButtonName( c );
|
||||
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( c, pn );
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyle(pn)->StyleInputToGameInput( c, pn );
|
||||
NOTESKIN->SetGameController( GameI.controller );
|
||||
|
||||
m_bHoldShowing.push_back( TapNoteSubType_Invalid );
|
||||
@@ -92,7 +92,7 @@ void GhostArrowRow::Update( float fDeltaTime )
|
||||
|
||||
void GhostArrowRow::DrawPrimitives()
|
||||
{
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber);
|
||||
for( unsigned i=0; i<m_Ghost.size(); i++ )
|
||||
{
|
||||
const int c = pStyle->m_iColumnDrawOrder[i];
|
||||
|
||||
@@ -257,6 +257,19 @@ inline bool TableContainsOnlyStrings(lua_State* L, int index)
|
||||
#define BArg(n) (MyLua_checkboolean(L,(n)))
|
||||
#define FArg(n) ((float) luaL_checknumber(L,(n)))
|
||||
|
||||
// SafeFArg is for places that need to get a number off the lua stack, but
|
||||
// can't risk an error being raised. IArg and luaL_optnumber would both raise
|
||||
// an error on a type mismatch. -Kyz
|
||||
inline int SafeFArg(lua_State* L, int index, RString const& err, int def)
|
||||
{
|
||||
if(lua_isnumber(L, index))
|
||||
{
|
||||
return lua_tonumber(L, index);
|
||||
}
|
||||
LuaHelpers::ReportScriptError(err);
|
||||
return def;
|
||||
}
|
||||
|
||||
#define LuaFunction( func, expr ) \
|
||||
int LuaFunc_##func( lua_State *L ); \
|
||||
int LuaFunc_##func( lua_State *L ) { \
|
||||
|
||||
+10
-10
@@ -445,7 +445,7 @@ void MusicWheel::GetSongList( vector<Song*> &arraySongs, SortOrder so )
|
||||
if( PREFSMAN->m_bOnlyPreferredDifficulties )
|
||||
{
|
||||
// if the song has steps that fit the preferred difficulty of the default player
|
||||
if( pSong->HasStepsTypeAndDifficulty( GAMESTATE->GetCurrentStyle()->m_StepsType,GAMESTATE->m_PreferredDifficulty[GAMESTATE->GetFirstHumanPlayer()] ) )
|
||||
if( pSong->HasStepsTypeAndDifficulty( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType,GAMESTATE->m_PreferredDifficulty[GAMESTATE->GetFirstHumanPlayer()] ) )
|
||||
arraySongs.push_back( pSong );
|
||||
}
|
||||
else
|
||||
@@ -472,7 +472,7 @@ void MusicWheel::GetSongList( vector<Song*> &arraySongs, SortOrder so )
|
||||
else
|
||||
{
|
||||
// If the song has at least one steps, add it.
|
||||
if( pSong->HasStepsType(GAMESTATE->GetCurrentStyle()->m_StepsType) )
|
||||
if( pSong->HasStepsType(GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType) )
|
||||
arraySongs.push_back( pSong );
|
||||
}
|
||||
}
|
||||
@@ -484,7 +484,7 @@ void MusicWheel::GetSongList( vector<Song*> &arraySongs, SortOrder so )
|
||||
{
|
||||
Song* pSong;
|
||||
Steps* pSteps;
|
||||
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyle(), pSong, pSteps );
|
||||
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyle(PLAYER_INVALID), pSong, pSteps );
|
||||
|
||||
if( find( arraySongs.begin(), arraySongs.end(), pSong ) == arraySongs.end() )
|
||||
arraySongs.push_back( pSong );
|
||||
@@ -728,7 +728,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
{
|
||||
Song* pSong;
|
||||
Steps* pSteps;
|
||||
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyle(), pSong, pSteps );
|
||||
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyle(PLAYER_INVALID), pSong, pSteps );
|
||||
|
||||
for( unsigned i=0; i<arrayWheelItemDatas.size(); i++ )
|
||||
{
|
||||
@@ -830,7 +830,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
}
|
||||
|
||||
// check that this course has at least one song playable in the current style
|
||||
if( !pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyle()->m_StepsType) )
|
||||
if( !pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType) )
|
||||
continue;
|
||||
|
||||
if( sThisSection != sLastSection ) // new section, make a section item
|
||||
@@ -856,7 +856,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
MusicWheelItemData& WID = *arrayWheelItemDatas[i];
|
||||
if( WID.m_pSong != NULL )
|
||||
{
|
||||
WID.m_Flags.bHasBeginnerOr1Meter = WID.m_pSong->IsEasy( GAMESTATE->GetCurrentStyle()->m_StepsType ) && SHOW_EASY_FLAG;
|
||||
WID.m_Flags.bHasBeginnerOr1Meter = WID.m_pSong->IsEasy( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType ) && SHOW_EASY_FLAG;
|
||||
WID.m_Flags.bEdits = false;
|
||||
set<StepsType> vStepsType;
|
||||
SongUtil::GetPlayableStepsTypes( WID.m_pSong, vStepsType );
|
||||
@@ -919,7 +919,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
if( GAMESTATE->IsAnExtraStage() )
|
||||
{
|
||||
Steps *pSteps;
|
||||
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyle(), pExtraStageSong, pSteps );
|
||||
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->GetCurrentStyle(PLAYER_INVALID), pExtraStageSong, pSteps );
|
||||
}
|
||||
|
||||
/* Mark any songs that aren't playable in aiRemove. */
|
||||
@@ -984,7 +984,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
}
|
||||
|
||||
/* If the song has no steps for the current style, remove it. */
|
||||
if( !CommonMetrics::AUTO_SET_STYLE && !pSong->HasStepsType(GAMESTATE->GetCurrentStyle()->m_StepsType) )
|
||||
if( !CommonMetrics::AUTO_SET_STYLE && !pSong->HasStepsType(GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType) )
|
||||
{
|
||||
aiRemove[i] = true;
|
||||
continue;
|
||||
@@ -1000,7 +1000,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
|
||||
if( WID.m_Type == WheelItemDataType_Course )
|
||||
{
|
||||
if( !WID.m_pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyle()->m_StepsType) )
|
||||
if( !WID.m_pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType) )
|
||||
aiRemove[i] = true;
|
||||
}
|
||||
}
|
||||
@@ -1573,7 +1573,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal()
|
||||
RString sPreferredGroup = m_sExpandedSectionName;
|
||||
vector<MusicWheelItemData *> &wid = getWheelItemsData(GAMESTATE->m_SortOrder);
|
||||
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType;
|
||||
|
||||
#define NUM_PROBES 1000
|
||||
for( int i=0; i<NUM_PROBES; i++ )
|
||||
|
||||
@@ -338,7 +338,7 @@ void MusicWheelItem::RefreshGrades()
|
||||
else if( GAMESTATE->m_pCurTrail[p] )
|
||||
st = GAMESTATE->m_pCurTrail[p]->m_StepsType;
|
||||
else
|
||||
st = GAMESTATE->m_pCurStyle->m_StepsType;
|
||||
st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType;
|
||||
|
||||
m_pGradeDisplay[p]->SetVisible( true );
|
||||
|
||||
|
||||
@@ -642,7 +642,7 @@ void NetworkSyncManager::ProcessInput()
|
||||
StyleName = m_packet.ReadNT();
|
||||
|
||||
GAMESTATE->SetCurGame( GAMEMAN->StringToGame(GameName) );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMESTATE->m_pCurGame,StyleName) );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMESTATE->m_pCurGame,StyleName), PLAYER_INVALID );
|
||||
|
||||
SCREENMAN->SetNewScreen( "ScreenNetSelectMusic" ); //Should this be metric'd out?
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ void NoteDataUtil::SplitCompositeNoteData( const NoteData &in, vector<NoteData>
|
||||
occuring to begin with, but at this time, I am unsure how to deal with it.
|
||||
Hopefully this hack can be removed soon. -- Jason "Wolfman2000" Felds
|
||||
*/
|
||||
const Style *curStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style *curStyle = GAMESTATE->GetCurrentStyle(PLAYER_INVALID);
|
||||
if( (curStyle == NULL || curStyle->m_StyleType == StyleType_TwoPlayersSharedSides )
|
||||
&& int( tn.pn ) > NUM_PlayerNumber )
|
||||
{
|
||||
|
||||
+2
-2
@@ -290,9 +290,9 @@ void NoteDisplay::Load( int iColNum, const PlayerState* pPlayerState, float fYRe
|
||||
m_fYReverseOffsetPixels = fYReverseOffsetPixels;
|
||||
|
||||
const PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iColNum, pn );
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber)->StyleInputToGameInput( iColNum, pn );
|
||||
|
||||
const RString &sButton = GAMESTATE->GetCurrentStyle()->ColToButtonName( iColNum );
|
||||
const RString &sButton = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber)->ColToButtonName( iColNum );
|
||||
|
||||
cache->Load( sButton );
|
||||
|
||||
|
||||
+23
-13
@@ -100,9 +100,9 @@ void NoteField::CacheNoteSkin( const RString &sNoteSkin_ )
|
||||
LockNoteSkin l( sNoteSkinLower );
|
||||
|
||||
LOG->Trace("NoteField::CacheNoteSkin: cache %s", sNoteSkinLower.c_str() );
|
||||
NoteDisplayCols *nd = new NoteDisplayCols( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
||||
NoteDisplayCols *nd = new NoteDisplayCols( GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer );
|
||||
|
||||
for( int c=0; c<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; c++ )
|
||||
for( int c=0; c<GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer; c++ )
|
||||
nd->display[c].Load( c, m_pPlayerState, m_fYReverseOffsetPixels );
|
||||
nd->m_ReceptorArrowRow.Load( m_pPlayerState, m_fYReverseOffsetPixels );
|
||||
nd->m_GhostArrowRow.Load( m_pPlayerState, m_fYReverseOffsetPixels );
|
||||
@@ -124,7 +124,7 @@ void NoteField::UncacheNoteSkin( const RString &sNoteSkin_ )
|
||||
void NoteField::CacheAllUsedNoteSkins()
|
||||
{
|
||||
// If we're in Routine mode, apply our per-player noteskins.
|
||||
if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_TwoPlayersSharedSides )
|
||||
if( GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_StyleType == StyleType_TwoPlayersSharedSides )
|
||||
{
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
GAMESTATE->ApplyStageModifiers( pn, ROUTINE_NOTESKIN.GetValue(pn) );
|
||||
@@ -171,16 +171,26 @@ void NoteField::CacheAllUsedNoteSkins()
|
||||
}
|
||||
}
|
||||
|
||||
void NoteField::Init( const PlayerState* pPlayerState, float fYReverseOffsetPixels )
|
||||
void NoteField::Init( const PlayerState* pPlayerState, float fYReverseOffsetPixels, bool use_states_zoom )
|
||||
{
|
||||
m_pPlayerState = pPlayerState;
|
||||
m_fYReverseOffsetPixels = fYReverseOffsetPixels;
|
||||
CacheAllUsedNoteSkins();
|
||||
// Design change: Instead of having a flag in the style that toggles a
|
||||
// fixed zoom that is only applied to the columns, ScreenGameplay now
|
||||
// calculates a zoom factor to apply to the notefield and puts it in the
|
||||
// PlayerState. -Kyz
|
||||
// use_states_zoom flag exists because edit mode has to set its own special
|
||||
// zoom factor. -Kyz
|
||||
if(use_states_zoom)
|
||||
{
|
||||
SetZoom(pPlayerState->m_NotefieldZoom);
|
||||
}
|
||||
}
|
||||
|
||||
void NoteField::Load(
|
||||
const NoteData *pNoteData,
|
||||
int iDrawDistanceAfterTargetsPixels,
|
||||
int iDrawDistanceAfterTargetsPixels,
|
||||
int iDrawDistanceBeforeTargetsPixels )
|
||||
{
|
||||
ASSERT( pNoteData != NULL );
|
||||
@@ -192,10 +202,10 @@ void NoteField::Load(
|
||||
m_fPercentFadeToFail = -1;
|
||||
|
||||
//int i1 = m_pNoteData->GetNumTracks();
|
||||
//int i2 = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer;
|
||||
ASSERT_M(m_pNoteData->GetNumTracks() == GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer,
|
||||
ssprintf("NumTracks %d = ColsPerPlayer %d",m_pNoteData->GetNumTracks(),
|
||||
GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer));
|
||||
//int i2 = GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer;
|
||||
ASSERT_M(m_pNoteData->GetNumTracks() == GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer,
|
||||
ssprintf("NumTracks %d = ColsPerPlayer %d",m_pNoteData->GetNumTracks(),
|
||||
GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer));
|
||||
|
||||
// The NoteSkin may have changed at the beginning of a new course song.
|
||||
RString sNoteSkinLower = m_pPlayerState->m_PlayerOptions.GetCurrent().m_sNoteSkin;
|
||||
@@ -294,7 +304,7 @@ void NoteField::Update( float fDeltaTime )
|
||||
|
||||
float NoteField::GetWidth() const
|
||||
{
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber);
|
||||
float fMinX, fMaxX;
|
||||
// TODO: Remove use of PlayerNumber.
|
||||
pStyle->GetMinAndMaxColX( m_pPlayerState->m_PlayerNumber, fMinX, fMaxX );
|
||||
@@ -1203,10 +1213,10 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
float fSelectedRangeGlow = SCALE( RageFastCos(RageTimer::GetTimeSinceStartFast()*2), -1, 1, 0.1f, 0.3f );
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
ASSERT_M(m_pNoteData->GetNumTracks() == GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer,
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber);
|
||||
ASSERT_M(m_pNoteData->GetNumTracks() == GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer,
|
||||
ssprintf("NumTracks %d != ColsPerPlayer %d",m_pNoteData->GetNumTracks(),
|
||||
GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer));
|
||||
GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber)->m_iColsPerPlayer));
|
||||
|
||||
for( int j=0; j<m_pNoteData->GetNumTracks(); j++ ) // for each arrow column
|
||||
{
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public:
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
virtual void Init( const PlayerState* pPlayerState, float fYReverseOffsetPixels );
|
||||
virtual void Init( const PlayerState* pPlayerState, float fYReverseOffsetPixels, bool use_states_zoom= true );
|
||||
virtual void Load(
|
||||
const NoteData* pNoteData,
|
||||
int iDrawDistanceAfterTargetsPixels,
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@ RString OptionRow::GetRowTitle() const
|
||||
else if( GAMESTATE->m_pCurCourse )
|
||||
{
|
||||
const Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType;
|
||||
const Trail* pTrail = pCourse->GetTrail( st );
|
||||
ASSERT( pTrail != NULL );
|
||||
pTrail->GetDisplayBpms( bpms );
|
||||
|
||||
@@ -434,13 +434,16 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
|
||||
m_Def.m_vsChoices.push_back( "" );
|
||||
m_aListEntries.push_back( GameCommand() );
|
||||
}
|
||||
else if(GAMESTATE->GetCurrentStyle() && GAMESTATE->IsCourseMode() && GAMESTATE->m_pCurCourse) // playing a course
|
||||
// TODO: Fix this OptionRow to fetch steps for all styles available.
|
||||
// This is broken in kickbox game mode because kickbox uses separated
|
||||
// styles. -Kyz
|
||||
else if(GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber()) && GAMESTATE->IsCourseMode() && GAMESTATE->m_pCurCourse) // playing a course
|
||||
{
|
||||
m_Def.m_bOneChoiceForAllPlayers = (bool)PREFSMAN->m_bLockCourseDifficulties;
|
||||
m_Def.m_layoutType = StringToLayoutType( STEPS_ROW_LAYOUT_TYPE );
|
||||
|
||||
vector<Trail*> vTrails;
|
||||
GAMESTATE->m_pCurCourse->GetTrails( vTrails, GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
GAMESTATE->m_pCurCourse->GetTrails( vTrails, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType );
|
||||
for( unsigned i=0; i<vTrails.size(); i++ )
|
||||
{
|
||||
Trail* pTrail = vTrails[i];
|
||||
@@ -453,13 +456,13 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
|
||||
m_aListEntries.push_back( mc );
|
||||
}
|
||||
}
|
||||
else if(GAMESTATE->GetCurrentStyle() && GAMESTATE->m_pCurSong) // playing a song
|
||||
else if(GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber()) && GAMESTATE->m_pCurSong) // playing a song
|
||||
{
|
||||
m_Def.m_layoutType = StringToLayoutType( STEPS_ROW_LAYOUT_TYPE );
|
||||
|
||||
vector<Steps*> vpSteps;
|
||||
Song *pSong = GAMESTATE->m_pCurSong;
|
||||
SongUtil::GetSteps( pSong, vpSteps, GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
SongUtil::GetSteps( pSong, vpSteps, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType );
|
||||
StepsUtil::RemoveLockedSteps( pSong, vpSteps );
|
||||
StepsUtil::SortNotesArrayByDifficulty( vpSteps );
|
||||
for( unsigned i=0; i<vpSteps.size(); i++ )
|
||||
|
||||
@@ -193,7 +193,7 @@ void PercentageDisplay::Refresh()
|
||||
|
||||
bool PercentageDisplay::ShowDancePointsNotPercentage() const
|
||||
{
|
||||
// Use staight dance points in workout because the percentage denominator isn't accurate - we don't know when the players are going to stop.
|
||||
// Use straight dance points in workout because the percentage denominator isn't accurate - we don't know when the players are going to stop.
|
||||
|
||||
if( GAMESTATE->m_pCurCourse )
|
||||
{
|
||||
|
||||
+19
-19
@@ -300,7 +300,7 @@ void Player::Init(
|
||||
|
||||
{
|
||||
// Init judgment positions
|
||||
bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyle()->GetUsesCenteredArrows();
|
||||
bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber)->GetUsesCenteredArrows();
|
||||
Actor TempJudgment;
|
||||
TempJudgment.SetName( "Judgment" );
|
||||
ActorUtil::LoadCommand( TempJudgment, sType, "Transform" );
|
||||
@@ -499,13 +499,13 @@ void Player::Init(
|
||||
}
|
||||
|
||||
// Load HoldJudgments
|
||||
m_vpHoldJudgment.resize( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
||||
for( int i = 0; i < GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; ++i )
|
||||
m_vpHoldJudgment.resize( GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer );
|
||||
for( int i = 0; i < GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer; ++i )
|
||||
m_vpHoldJudgment[i] = NULL;
|
||||
|
||||
if( HasVisibleParts() )
|
||||
{
|
||||
for( int i = 0; i < GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; ++i )
|
||||
for( int i = 0; i < GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer; ++i )
|
||||
{
|
||||
HoldJudgment *pJudgment = new HoldJudgment;
|
||||
// xxx: assumes sprite; todo: don't force 1x2 -aj
|
||||
@@ -523,7 +523,7 @@ void Player::Init(
|
||||
this->AddChild( m_pNoteField );
|
||||
}
|
||||
|
||||
m_vbFretIsDown.resize( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
||||
m_vbFretIsDown.resize( GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer );
|
||||
FOREACH( bool, m_vbFretIsDown, b )
|
||||
*b = false;
|
||||
|
||||
@@ -649,7 +649,7 @@ void Player::Load()
|
||||
// m_pScore->Init( pn );
|
||||
|
||||
/* Apply transforms. */
|
||||
NoteDataUtil::TransformNoteData( m_NoteData, m_pPlayerState->m_PlayerOptions.GetStage(), GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
NoteDataUtil::TransformNoteData( m_NoteData, m_pPlayerState->m_PlayerOptions.GetStage(), GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType );
|
||||
|
||||
const Song* pSong = GAMESTATE->m_pCurSong;
|
||||
|
||||
@@ -668,7 +668,7 @@ void Player::Load()
|
||||
// it has to do with there only being four cases. This is a lame
|
||||
// workaround, but since only DDR has ever really implemented those
|
||||
// modes, it's stayed like this. -aj
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType;
|
||||
NoteDataUtil::TransformNoteData( m_NoteData, m_pPlayerState->m_PlayerOptions.GetStage(), st );
|
||||
|
||||
if (BATTLE_RAVE_MIRROR)
|
||||
@@ -707,7 +707,7 @@ void Player::Load()
|
||||
m_pNoteField->Load( &m_NoteData, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels );
|
||||
}
|
||||
|
||||
bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyle()->GetUsesCenteredArrows();
|
||||
bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->GetUsesCenteredArrows();
|
||||
if( m_pAttackDisplay )
|
||||
m_pAttackDisplay->SetX( ATTACK_DISPLAY_X.GetValue(pn, bPlayerUsingBothSides) - 40 );
|
||||
// set this in Update //m_pAttackDisplay->SetY( bReverse ? ATTACK_DISPLAY_Y_REVERSE : ATTACK_DISPLAY_Y );
|
||||
@@ -860,7 +860,7 @@ void Player::Update( float fDeltaTime )
|
||||
|
||||
// Update Y positions
|
||||
{
|
||||
for( int c=0; c<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; c++ )
|
||||
for( int c=0; c<GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer; c++ )
|
||||
{
|
||||
float fPercentReverse = m_pPlayerState->m_PlayerOptions.GetCurrent().GetReversePercentForColumn(c);
|
||||
float fHoldJudgeYPos = SCALE( fPercentReverse, 0.f, 1.f, HOLD_JUDGMENT_Y_STANDARD, HOLD_JUDGMENT_Y_REVERSE );
|
||||
@@ -920,14 +920,14 @@ void Player::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
// update pressed flag
|
||||
const int iNumCols = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer;
|
||||
const int iNumCols = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer;
|
||||
ASSERT_M( iNumCols <= MAX_COLS_PER_PLAYER, ssprintf("%i > %i", iNumCols, MAX_COLS_PER_PLAYER) );
|
||||
for( int col=0; col < iNumCols; ++col )
|
||||
{
|
||||
ASSERT( m_pPlayerState != NULL );
|
||||
|
||||
// TODO: Remove use of PlayerNumber.
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber );
|
||||
|
||||
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI );
|
||||
|
||||
@@ -1221,7 +1221,7 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
|
||||
}
|
||||
else
|
||||
{
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn );
|
||||
// this previously read as bIsHoldingButton &=
|
||||
// was there a specific reason for this? - Friez
|
||||
bIsHoldingButton &= INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
|
||||
@@ -1505,7 +1505,7 @@ void Player::ApplyWaitingTransforms()
|
||||
|
||||
// if re-adding noteskin changes, this is one place to edit -aj
|
||||
|
||||
NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle()->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) );
|
||||
NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) );
|
||||
}
|
||||
m_pPlayerState->m_ModsToApply.clear();
|
||||
}
|
||||
@@ -1516,7 +1516,7 @@ void Player::DrawPrimitives()
|
||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
|
||||
// May have both players in doubles (for battle play); only draw primary player.
|
||||
if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_OnePlayerTwoSides &&
|
||||
if( GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StyleType == StyleType_OnePlayerTwoSides &&
|
||||
pn != GAMESTATE->GetMasterPlayerNumber() )
|
||||
return;
|
||||
|
||||
@@ -2141,7 +2141,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
||||
int iNumTracksHeld = 0;
|
||||
for( int t=0; t<m_NoteData.GetNumTracks(); t++ )
|
||||
{
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( t, pn );
|
||||
const float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
|
||||
if( fSecsHeld > 0 && fSecsHeld < m_fTimingWindowJump )
|
||||
iNumTracksHeld++;
|
||||
@@ -2417,7 +2417,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
||||
{
|
||||
bool bNoteRowMatchesFrets = true;
|
||||
int iFirstNoteCol = -1;
|
||||
for( int i=0; i<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; i++ )
|
||||
for( int i=0; i<GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer; i++ )
|
||||
{
|
||||
const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow );
|
||||
bool bIsNote = (tn.type != TapNoteType_Empty);
|
||||
@@ -2444,7 +2444,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
|
||||
else
|
||||
{
|
||||
int iLastNoteCol = -1;
|
||||
for( int i=GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer-1; i>=0; i-- )
|
||||
for( int i=GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_iColsPerPlayer-1; i>=0; i-- )
|
||||
{
|
||||
const TapNote &tn = m_NoteData.GetTapNote( i, iRowOfOverlappingNoteOrRow );
|
||||
bool bIsNote = (tn.type != TapNoteType_Empty);
|
||||
@@ -2950,7 +2950,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
|
||||
if( !REQUIRE_STEP_ON_HOLD_HEADS )
|
||||
{
|
||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn );
|
||||
if( PREFSMAN->m_fPadStickSeconds > 0.f )
|
||||
{
|
||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp );
|
||||
@@ -2969,7 +2969,7 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
|
||||
// Hold the panel while crossing a mine will cause the mine to explode
|
||||
// TODO: Remove use of PlayerNumber.
|
||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->StyleInputToGameInput( iTrack, pn );
|
||||
if( PREFSMAN->m_fPadStickSeconds > 0 )
|
||||
{
|
||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp );
|
||||
|
||||
+47
-3
@@ -723,7 +723,9 @@ void PlayerOptions::ToggleOneTurn( Turn t )
|
||||
float PlayerOptions::GetReversePercentForColumn( int iCol ) const
|
||||
{
|
||||
float f = 0;
|
||||
int iNumCols = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer;
|
||||
ASSERT(m_pn == PLAYER_1 || m_pn == PLAYER_2);
|
||||
ASSERT(GAMESTATE->GetCurrentStyle(m_pn) != NULL);
|
||||
int iNumCols = GAMESTATE->GetCurrentStyle(m_pn)->m_iColsPerPlayer;
|
||||
|
||||
f += m_fScrolls[SCROLL_REVERSE];
|
||||
|
||||
@@ -784,6 +786,48 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
PlayerOptions& PlayerOptions::operator=(PlayerOptions const& other)
|
||||
{
|
||||
// Do not copy m_pn from the other, it must be preserved as what PlayerState set it to.
|
||||
#define CPY(x) x= other.x;
|
||||
CPY(m_LifeType);
|
||||
CPY(m_DrainType);
|
||||
CPY(m_BatteryLives);
|
||||
CPY(m_fTimeSpacing);
|
||||
CPY(m_fScrollSpeed);
|
||||
CPY(m_fScrollBPM);
|
||||
CPY(m_fMaxScrollBPM);
|
||||
CPY(m_fRandomSpeed);
|
||||
CPY(m_FailType);
|
||||
CPY(m_MinTNSToHideNotes);
|
||||
CPY(m_bMuteOnError);
|
||||
CPY(m_fDark);
|
||||
CPY(m_fBlind);
|
||||
CPY(m_fCover);
|
||||
CPY(m_fRandAttack);
|
||||
CPY(m_fNoAttack);
|
||||
CPY(m_fPlayerAutoPlay);
|
||||
CPY(m_fPerspectiveTilt);
|
||||
CPY(m_fSkew);
|
||||
CPY(m_sNoteSkin);
|
||||
for( int i = 0; i < PlayerOptions::NUM_ACCELS; ++i )
|
||||
CPY(m_fAccels[i]);
|
||||
for( int i = 0; i < PlayerOptions::NUM_EFFECTS; ++i )
|
||||
CPY(m_fEffects[i]);
|
||||
for( int i = 0; i < PlayerOptions::NUM_APPEARANCES; ++i )
|
||||
CPY(m_fAppearances[i]);
|
||||
for( int i = 0; i < PlayerOptions::NUM_SCROLLS; ++i )
|
||||
CPY(m_fScrolls[i]);
|
||||
for( int i = 0; i < PlayerOptions::NUM_TURNS; ++i )
|
||||
CPY(m_bTurns[i]);
|
||||
for( int i = 0; i < PlayerOptions::NUM_TRANSFORMS; ++i )
|
||||
CPY(m_bTransforms[i]);
|
||||
#undef CPY
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerNumber pn ) const
|
||||
{
|
||||
if( m_fTimeSpacing && pSteps->HasSignificantTimingChanges() )
|
||||
@@ -835,7 +879,7 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerN
|
||||
DisplayBpms bpms;
|
||||
if( GAMESTATE->IsCourseMode() )
|
||||
{
|
||||
Trail *pTrail = GAMESTATE->m_pCurCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
Trail *pTrail = GAMESTATE->m_pCurCourse->GetTrail( GAMESTATE->GetCurrentStyle(m_pn)->m_StepsType );
|
||||
pTrail->GetDisplayBpms( bpms );
|
||||
}
|
||||
else
|
||||
@@ -1357,7 +1401,7 @@ public:
|
||||
static int GetReversePercentForColumn( T *p, lua_State *L )
|
||||
{
|
||||
const int colNum = IArg(1);
|
||||
const int numColumns = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer;
|
||||
const int numColumns = GAMESTATE->GetCurrentStyle(p->m_pn)->m_iColsPerPlayer;
|
||||
|
||||
// We don't want to go outside the bounds.
|
||||
if(colNum < 0 || colNum > numColumns)
|
||||
|
||||
@@ -96,6 +96,7 @@ public:
|
||||
|
||||
bool operator==( const PlayerOptions &other ) const;
|
||||
bool operator!=( const PlayerOptions &other ) const { return !operator==(other); }
|
||||
PlayerOptions& operator=(PlayerOptions const& other);
|
||||
|
||||
/** @brief The various acceleration mods. */
|
||||
enum Accel {
|
||||
@@ -183,6 +184,8 @@ public:
|
||||
|
||||
float GetReversePercentForColumn( int iCol ) const; // accounts for all Directions
|
||||
|
||||
PlayerNumber m_pn; // Needed for fetching the style.
|
||||
|
||||
LifeType m_LifeType;
|
||||
DrainType m_DrainType; // only used with LifeBar
|
||||
int m_BatteryLives;
|
||||
|
||||
@@ -27,6 +27,7 @@ Grade GetGradeFromPercent( float fPercent );
|
||||
|
||||
void PlayerStageStats::InternalInit()
|
||||
{
|
||||
m_pStyle= NULL;
|
||||
m_for_multiplayer= false;
|
||||
m_player_number= PLAYER_1;
|
||||
m_multiplayer_number= MultiPlayer_P1;
|
||||
@@ -85,6 +86,7 @@ void PlayerStageStats::Init(MultiPlayer pn)
|
||||
|
||||
void PlayerStageStats::AddStats( const PlayerStageStats& other )
|
||||
{
|
||||
m_pStyle= other.m_pStyle;
|
||||
m_bJoined = other.m_bJoined;
|
||||
FOREACH_CONST( Steps*, other.m_vpPossibleSteps, s )
|
||||
m_vpPossibleSteps.push_back( *s );
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "PlayerNumber.h"
|
||||
#include <map>
|
||||
class Steps;
|
||||
class Style;
|
||||
struct lua_State;
|
||||
/** @brief Contains statistics for one stage of play - either one song, or a whole course. */
|
||||
class PlayerStageStats
|
||||
@@ -36,6 +37,7 @@ public:
|
||||
bool m_for_multiplayer;
|
||||
PlayerNumber m_player_number;
|
||||
MultiPlayer m_multiplayer_number;
|
||||
const Style* m_pStyle;
|
||||
|
||||
bool m_bJoined;
|
||||
bool m_bPlayerCanAchieveFullCombo;
|
||||
|
||||
@@ -16,6 +16,7 @@ PlayerState::PlayerState()
|
||||
|
||||
void PlayerState::Reset()
|
||||
{
|
||||
m_NotefieldZoom= 1.0f;
|
||||
m_PlayerOptions.Init();
|
||||
|
||||
m_fLastDrawnBeat = -100;
|
||||
@@ -96,6 +97,15 @@ void PlayerState::Update( float fDelta )
|
||||
m_fSecondsUntilAttacksPhasedOut = max( 0, m_fSecondsUntilAttacksPhasedOut - fDelta );
|
||||
}
|
||||
|
||||
void PlayerState::SetPlayerNumber(PlayerNumber pn)
|
||||
{
|
||||
m_PlayerNumber = pn;
|
||||
FOREACH_ENUM(ModsLevel, ml)
|
||||
{
|
||||
m_PlayerOptions.Get(ml).m_pn= pn;
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerState::ResetToDefaultPlayerOptions( ModsLevel l )
|
||||
{
|
||||
PlayerOptions po;
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
* @param fDelta the current time. */
|
||||
void Update( float fDelta );
|
||||
|
||||
void SetPlayerNumber(PlayerNumber pn);
|
||||
|
||||
/**
|
||||
* @brief The PlayerNumber assigned to this Player: usually 1 or 2.
|
||||
*
|
||||
@@ -51,6 +53,10 @@ public:
|
||||
*/
|
||||
MultiPlayer m_mp;
|
||||
|
||||
// This is used by ArrowEffects and the NoteField to zoom both appropriately
|
||||
// to fit in the space available. -Kyz
|
||||
float m_NotefieldZoom;
|
||||
|
||||
// Music statistics:
|
||||
SongPosition m_Position;
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ void ReceptorArrow::Load( const PlayerState* pPlayerState, int iColNo )
|
||||
m_iColNo = iColNo;
|
||||
|
||||
const PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iColNo, pn );
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyle(pn)->StyleInputToGameInput( iColNo, pn );
|
||||
NOTESKIN->SetPlayerNumber( pn );
|
||||
NOTESKIN->SetGameController( GameI.controller );
|
||||
|
||||
RString sButton = GAMESTATE->GetCurrentStyle()->ColToButtonName( iColNo );
|
||||
RString sButton = GAMESTATE->GetCurrentStyle(pn)->ColToButtonName( iColNo );
|
||||
m_pReceptor.Load( NOTESKIN->LoadActor(sButton, "Receptor") );
|
||||
this->AddChild( m_pReceptor );
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void ReceptorArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOff
|
||||
m_pPlayerState = pPlayerState;
|
||||
m_fYReverseOffsetPixels = fYReverseOffset;
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber);
|
||||
|
||||
for( int c=0; c<pStyle->m_iColsPerPlayer; c++ )
|
||||
{
|
||||
@@ -70,7 +70,7 @@ void ReceptorArrowRow::Update( float fDeltaTime )
|
||||
|
||||
void ReceptorArrowRow::DrawPrimitives()
|
||||
{
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber);
|
||||
for( unsigned i=0; i<m_ReceptorArrow.size(); i++ )
|
||||
{
|
||||
const int c = pStyle->m_iColumnDrawOrder[i];
|
||||
|
||||
@@ -74,7 +74,7 @@ void ScoreKeeperNormal::Load(
|
||||
// We might have been given lots of songs; don't keep them in memory uncompressed.
|
||||
pSteps->Compress();
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(m_pPlayerState->m_PlayerNumber);
|
||||
NoteData ndPre;
|
||||
pStyle->GetTransformedNoteDataForStyle( m_pPlayerState->m_PlayerNumber, ndTemp, ndPre );
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ void ScreenContinue::Init()
|
||||
|
||||
void ScreenContinue::BeginScreen()
|
||||
{
|
||||
GAMESTATE->SetCurrentStyle( NULL );
|
||||
GAMESTATE->SetCurrentStyle( NULL, PLAYER_INVALID );
|
||||
|
||||
// Unjoin human players with 0 stages left and reset non-human players.
|
||||
// We need to reset non-human players because data in non-human (CPU)
|
||||
|
||||
@@ -50,7 +50,7 @@ void ScreenDemonstration::Init()
|
||||
|
||||
ASSERT( vStylePossible.size() > 0 );
|
||||
const Style* pStyle = vStylePossible[ RandomInt(vStylePossible.size()) ];
|
||||
GAMESTATE->SetCurrentStyle( pStyle );
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
}
|
||||
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
|
||||
+15
-14
@@ -1273,7 +1273,7 @@ void ScreenEdit::Init()
|
||||
m_CurrentAction = MAIN_MENU_CHOICE_INVALID;
|
||||
m_InputPlayerNumber = PLAYER_INVALID;
|
||||
|
||||
if( GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_TwoPlayersSharedSides )
|
||||
if( GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StyleType == StyleType_TwoPlayersSharedSides )
|
||||
m_InputPlayerNumber = PLAYER_1;
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
@@ -1328,7 +1328,8 @@ void ScreenEdit::Init()
|
||||
ModsLevel_Preferred, m_sNoteSkin, sNoteSkin );
|
||||
}
|
||||
}
|
||||
m_PlayerStateEdit.m_PlayerNumber = PLAYER_1;
|
||||
m_PlayerStateEdit.SetPlayerNumber(PLAYER_1);
|
||||
m_PlayerStateEdit.m_NotefieldZoom= 1.0f;
|
||||
// If we always go with the GAMESTATE NoteSkin, we will have fun effects
|
||||
// like Vivid or Flat in the editor notefield. This is not conducive to
|
||||
// productive editing.
|
||||
@@ -1349,7 +1350,7 @@ void ScreenEdit::Init()
|
||||
m_pSteps->GetNoteData( m_NoteDataEdit );
|
||||
m_NoteFieldEdit.SetXY( EDIT_X, EDIT_Y );
|
||||
m_NoteFieldEdit.SetZoom( 0.5f );
|
||||
m_NoteFieldEdit.Init( &m_PlayerStateEdit, PLAYER_HEIGHT*2 );
|
||||
m_NoteFieldEdit.Init( &m_PlayerStateEdit, PLAYER_HEIGHT*2, false );
|
||||
m_NoteFieldEdit.Load( &m_NoteDataEdit, -240, 850 );
|
||||
this->AddChild( &m_NoteFieldEdit );
|
||||
|
||||
@@ -1511,9 +1512,9 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
{
|
||||
// TODO: Find a way to prevent STATE_RECORDING when in Song Timing.
|
||||
|
||||
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
|
||||
for( int t=0; t<GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_iColsPerPlayer; t++ ) // for each track
|
||||
{
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, PLAYER_1 );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->StyleInputToGameInput( t, PLAYER_1 );
|
||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI );
|
||||
fSecsHeld = min( fSecsHeld, m_RemoveNoteButtonLastChanged.Ago() );
|
||||
if( fSecsHeld == 0 )
|
||||
@@ -1565,9 +1566,9 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
* range.
|
||||
*/
|
||||
bool bButtonIsBeingPressed = false;
|
||||
for( int t=0; t<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track
|
||||
for( int t=0; t<GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_iColsPerPlayer; t++ ) // for each track
|
||||
{
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, PLAYER_1 );
|
||||
GameInput GameI = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->StyleInputToGameInput( t, PLAYER_1 );
|
||||
if( INPUTMAPPER->IsBeingPressed(GameI) )
|
||||
bButtonIsBeingPressed = true;
|
||||
}
|
||||
@@ -1912,9 +1913,9 @@ bool ScreenEdit::Input( const InputEventPlus &input )
|
||||
|
||||
static void ShiftToRightSide( int &iCol, int iNumTracks )
|
||||
{
|
||||
switch( GAMESTATE->GetCurrentStyle()->m_StyleType )
|
||||
switch( GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StyleType )
|
||||
{
|
||||
DEFAULT_FAIL( GAMESTATE->GetCurrentStyle()->m_StyleType );
|
||||
DEFAULT_FAIL( GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StyleType );
|
||||
case StyleType_OnePlayerOneSide:
|
||||
break;
|
||||
case StyleType_TwoPlayersTwoSides:
|
||||
@@ -2900,7 +2901,7 @@ bool ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
||||
if( input.pn != PLAYER_1 )
|
||||
return false; // ignore
|
||||
|
||||
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
const int iCol = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->GameInputToColumn( input.GameI );
|
||||
|
||||
//Is this actually a column? If not, ignore the input.
|
||||
if( iCol == -1 )
|
||||
@@ -3017,13 +3018,13 @@ bool ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
if( GamePreferences::m_AutoPlay == PC_HUMAN && GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetCurrent().m_fPlayerAutoPlay == 0 )
|
||||
{
|
||||
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
const int iCol = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->GameInputToColumn( input.GameI );
|
||||
bool bRelease = input.type == IET_RELEASE;
|
||||
switch( input.pn )
|
||||
{
|
||||
case PLAYER_2:
|
||||
// ignore player 2 input unless this mode requires it
|
||||
if( GAMESTATE->GetCurrentStyle()->m_StyleType != StyleType_TwoPlayersSharedSides )
|
||||
if( GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StyleType != StyleType_TwoPlayersSharedSides )
|
||||
break;
|
||||
|
||||
// fall through to input handling logic:
|
||||
@@ -4833,7 +4834,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
|
||||
const NoteData OldClipboard( m_Clipboard );
|
||||
HandleAlterMenuChoice( cut, false );
|
||||
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType;
|
||||
TurnType tt = (TurnType)iAnswers[c];
|
||||
switch( tt )
|
||||
{
|
||||
@@ -4855,7 +4856,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
|
||||
int iBeginRow = m_NoteFieldEdit.m_iBeginMarker;
|
||||
int iEndRow = m_NoteFieldEdit.m_iEndMarker;
|
||||
TransformType tt = (TransformType)iAnswers[c];
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType;
|
||||
|
||||
switch( tt )
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ REGISTER_SCREEN_CLASS( ScreenEditMenu );
|
||||
void ScreenEditMenu::Init()
|
||||
{
|
||||
// HACK: Disable any style set by the editor.
|
||||
GAMESTATE->m_pCurStyle.Set( NULL );
|
||||
GAMESTATE->SetCurrentStyle( NULL, PLAYER_INVALID );
|
||||
|
||||
// Enable all players.
|
||||
FOREACH_PlayerNumber( pn )
|
||||
@@ -185,7 +185,7 @@ bool ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
|
||||
GAMESTATE->m_pCurSong.Set( pSong );
|
||||
GAMESTATE->m_pCurCourse.Set( NULL );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GetEditorStyleForStepsType(st) );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GetEditorStyleForStepsType(st), PLAYER_INVALID );
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps );
|
||||
|
||||
// handle error cases
|
||||
|
||||
@@ -30,7 +30,7 @@ ScreenEnding::ScreenEnding()
|
||||
PROFILEMAN->LoadFirstAvailableProfile(PLAYER_2);
|
||||
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus"), PLAYER_INVALID );
|
||||
GAMESTATE->JoinPlayer( PLAYER_1 );
|
||||
GAMESTATE->JoinPlayer( PLAYER_2 );
|
||||
GAMESTATE->m_pCurSong.Set( SONGMAN->GetRandomSong() );
|
||||
|
||||
@@ -103,9 +103,8 @@ void ScreenEvaluation::Init()
|
||||
StageStats &ss = STATSMAN->m_vPlayedStageStats.back();
|
||||
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus"), PLAYER_INVALID );
|
||||
ss.m_playMode = GAMESTATE->m_PlayMode;
|
||||
ss.m_pStyle = GAMESTATE->GetCurrentStyle();
|
||||
ss.m_Stage = Stage_1st;
|
||||
enum_add( ss.m_Stage, rand()%3 );
|
||||
ss.m_EarnedExtraStage = (EarnedExtraStage)(rand() % NUM_EarnedExtraStage);
|
||||
@@ -120,6 +119,7 @@ void ScreenEvaluation::Init()
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
ss.m_player[p].m_pStyle = GAMESTATE->GetCurrentStyle(p);
|
||||
if( RandomInt(2) )
|
||||
PO_GROUP_ASSIGN_N( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_bTransforms, PlayerOptions::TRANSFORM_ECHO, true ); // show "disqualified"
|
||||
SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_fMusicRate, 1.1f );
|
||||
|
||||
+127
-26
@@ -65,7 +65,6 @@
|
||||
#define SHOW_LIFE_METER_FOR_DISABLED_PLAYERS THEME->GetMetricB(m_sName,"ShowLifeMeterForDisabledPlayers")
|
||||
#define SHOW_SCORE_IN_RAVE THEME->GetMetricB(m_sName,"ShowScoreInRave")
|
||||
#define SONG_POSITION_METER_WIDTH THEME->GetMetricF(m_sName,"SongPositionMeterWidth")
|
||||
#define PLAYER_X( sName, styleType ) THEME->GetMetricF(m_sName,ssprintf("Player%s%sX",sName.c_str(),StyleTypeToString(styleType).c_str()))
|
||||
#define STOP_COURSE_EARLY THEME->GetMetricB(m_sName,"StopCourseEarly") // evaluate this every time it's used
|
||||
|
||||
static ThemeMetric<float> INITIAL_BACKGROUND_BRIGHTNESS ("ScreenGameplay","InitialBackgroundBrightness");
|
||||
@@ -444,7 +443,14 @@ void ScreenGameplay::Init()
|
||||
// fill in difficulty of CPU players with that of the first human player
|
||||
// this should not need to worry about step content.
|
||||
FOREACH_PotentialCpuPlayer(p)
|
||||
GAMESTATE->m_pCurSteps[p].Set( GAMESTATE->m_pCurSteps[ GAMESTATE->GetFirstHumanPlayer() ] );
|
||||
{
|
||||
PlayerNumber human_pn= GAMESTATE->GetFirstHumanPlayer();
|
||||
GAMESTATE->m_pCurSteps[p].Set( GAMESTATE->m_pCurSteps[human_pn] );
|
||||
if(GAMESTATE->GetCurrentGame()->m_PlayersHaveSeparateStyles)
|
||||
{
|
||||
GAMESTATE->SetCurrentStyle(GAMESTATE->GetCurrentStyle(human_pn), p);
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_EnabledPlayer(p)
|
||||
ASSERT( GAMESTATE->m_pCurSteps[p].Get() != NULL );
|
||||
@@ -458,7 +464,14 @@ void ScreenGameplay::Init()
|
||||
STATSMAN->m_CurStageStats.m_Stage = GAMESTATE->GetCurrentStage();
|
||||
STATSMAN->m_CurStageStats.m_iStageIndex = GAMESTATE->m_iCurrentStageIndex;
|
||||
STATSMAN->m_CurStageStats.m_playMode = GAMESTATE->m_PlayMode;
|
||||
STATSMAN->m_CurStageStats.m_pStyle = GAMESTATE->GetCurrentStyle();
|
||||
FOREACH_PlayerNumber(pn)
|
||||
{
|
||||
STATSMAN->m_CurStageStats.m_player[pn].m_pStyle= GAMESTATE->GetCurrentStyle(pn);
|
||||
}
|
||||
FOREACH_MultiPlayer(pn)
|
||||
{
|
||||
STATSMAN->m_CurStageStats.m_multiPlayer[pn].m_pStyle= GAMESTATE->GetCurrentStyle(PLAYER_INVALID);
|
||||
}
|
||||
|
||||
/* Record combo rollover. */
|
||||
FOREACH_EnabledPlayerInfoNotDummy( m_vPlayerInfo, pi )
|
||||
@@ -501,26 +514,98 @@ void ScreenGameplay::Init()
|
||||
this->AddChild( &m_Toasty );
|
||||
}
|
||||
|
||||
// Use the margin function to calculate where the notefields should be and
|
||||
// what size to zoom them to. This way, themes get margins to put cut-ins
|
||||
// in, and the engine can have players on different styles without the
|
||||
// notefields overlapping. -Kyz
|
||||
LuaReference margarine;
|
||||
float margins[NUM_PLAYERS][2];
|
||||
FOREACH_PlayerNumber(pn)
|
||||
{
|
||||
margins[pn][0]= 40;
|
||||
margins[pn][1]= 40;
|
||||
}
|
||||
THEME->GetMetric(m_sName, "MarginFunction", margarine);
|
||||
if(margarine.GetLuaType() != LUA_TFUNCTION)
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("MarginFunction metric for %s must be a function.", m_sName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
Lua* L= LUA->Get();
|
||||
margarine.PushSelf(L);
|
||||
lua_createtable(L, 0, 0);
|
||||
int next_player_slot= 1;
|
||||
FOREACH_EnabledPlayer(pn)
|
||||
{
|
||||
Enum::Push(L, pn);
|
||||
lua_rawseti(L, -2, next_player_slot);
|
||||
++next_player_slot;
|
||||
}
|
||||
Enum::Push(L, GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StyleType);
|
||||
RString err= "Error running MarginFunction: ";
|
||||
if(LuaHelpers::RunScriptOnStack(L, err, 2, 3, true))
|
||||
{
|
||||
RString marge= "Margin value must be a number.";
|
||||
margins[PLAYER_1][0]= SafeFArg(L, -3, marge, 40);
|
||||
float center= SafeFArg(L, -2, marge, 80);
|
||||
margins[PLAYER_1][1]= center / 2.0f;
|
||||
margins[PLAYER_2][0]= center / 2.0f;
|
||||
margins[PLAYER_2][1]= SafeFArg(L, -1, marge, 40);
|
||||
}
|
||||
lua_settop(L, 0);
|
||||
LUA->Release(L);
|
||||
}
|
||||
|
||||
float left_edge[NUM_PLAYERS]= {0.0f, SCREEN_WIDTH / 2.0f};
|
||||
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
|
||||
{
|
||||
RString sName = ssprintf("Player%s", pi->GetName().c_str());
|
||||
pi->m_pPlayer->SetName( sName );
|
||||
|
||||
Style const* style= GAMESTATE->GetCurrentStyle(pi->m_pn);
|
||||
float style_width= style->GetWidth(pi->m_pn);
|
||||
float edge= left_edge[pi->m_pn];
|
||||
float screen_space;
|
||||
float field_space;
|
||||
float left_marge;
|
||||
float right_marge;
|
||||
#define CENTER_PLAYER_BLOCK \
|
||||
{ \
|
||||
edge= 0.0f; \
|
||||
screen_space= SCREEN_WIDTH; \
|
||||
left_marge= margins[PLAYER_1][0]; \
|
||||
right_marge= margins[PLAYER_2][1]; \
|
||||
field_space= screen_space - left_marge - right_marge; \
|
||||
}
|
||||
// If pi->m_pn is set, then the player will be visible. If not, then it's not
|
||||
// visible and don't bother setting its position.
|
||||
|
||||
float fPlayerX;
|
||||
if( GAMESTATE->m_bMultiplayer && !pi->m_bIsDummy )
|
||||
{
|
||||
fPlayerX = SCREEN_CENTER_X;
|
||||
}
|
||||
if(GAMESTATE->m_bMultiplayer && !pi->m_bIsDummy)
|
||||
CENTER_PLAYER_BLOCK
|
||||
else
|
||||
{
|
||||
fPlayerX = PLAYER_X( pi->GetName(), GAMESTATE->GetCurrentStyle()->m_StyleType );
|
||||
if( Center1Player() )
|
||||
fPlayerX = SCREEN_CENTER_X;
|
||||
screen_space= SCREEN_WIDTH / 2.0f;
|
||||
left_marge= margins[pi->m_pn][0];
|
||||
right_marge= margins[pi->m_pn][1];
|
||||
field_space= screen_space - left_marge - right_marge;
|
||||
if(Center1Player() ||
|
||||
(style_width > field_space && GAMESTATE->GetNumPlayersEnabled() == 1
|
||||
&& (bool)ALLOW_CENTER_1_PLAYER))
|
||||
CENTER_PLAYER_BLOCK
|
||||
}
|
||||
#undef CENTER_PLAYER_BLOCK
|
||||
float player_x= edge + left_marge + (field_space / 2.0f);
|
||||
float field_zoom= field_space / style_width;
|
||||
/*
|
||||
LuaHelpers::ReportScriptErrorFmt("Positioning player %d at %.0f: "
|
||||
"screen_space %.0f, left_edge %.0f, field_space %.0f, left_marge %.0f,"
|
||||
" right_marge %.0f, style_width %.0f, field_zoom %.2f.",
|
||||
pi->m_pn+1, player_x, screen_space, left_edge[pi->m_pn], field_space,
|
||||
left_marge, right_marge, style_width, field_zoom);
|
||||
*/
|
||||
pi->GetPlayerState()->m_NotefieldZoom= min(1.0f, field_zoom);
|
||||
|
||||
pi->m_pPlayer->SetX( fPlayerX );
|
||||
pi->m_pPlayer->SetX(player_x);
|
||||
pi->m_pPlayer->RunCommands( PLAYER_INIT_COMMAND );
|
||||
//ActorUtil::LoadAllCommands(pi->m_pPlayer, m_sName);
|
||||
this->AddChild( pi->m_pPlayer );
|
||||
@@ -602,7 +687,7 @@ void ScreenGameplay::Init()
|
||||
|
||||
#if !defined(WITHOUT_NETWORKING)
|
||||
// Only used in SMLAN/SMOnline:
|
||||
if( !m_bForceNoNetwork && NSMAN->useSMserver && GAMESTATE->GetCurrentStyle()->m_StyleType != StyleType_OnePlayerTwoSides )
|
||||
if( !m_bForceNoNetwork && NSMAN->useSMserver && GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StyleType != StyleType_OnePlayerTwoSides )
|
||||
{
|
||||
m_bShowScoreboard = PREFSMAN->m_bEnableScoreboard.Get();
|
||||
PlayerNumber pn = GAMESTATE->GetFirstDisabledPlayer();
|
||||
@@ -825,7 +910,7 @@ bool ScreenGameplay::Center1Player() const
|
||||
(bool)ALLOW_CENTER_1_PLAYER &&
|
||||
GAMESTATE->m_PlayMode != PLAY_MODE_BATTLE &&
|
||||
GAMESTATE->m_PlayMode != PLAY_MODE_RAVE &&
|
||||
GAMESTATE->GetCurrentStyle()->m_StyleType == StyleType_OnePlayerOneSide;
|
||||
GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StyleType == StyleType_OnePlayerOneSide;
|
||||
}
|
||||
|
||||
// fill in m_apSongsQueue, m_vpStepsQueue, m_asModifiersQueue
|
||||
@@ -989,7 +1074,7 @@ void ScreenGameplay::SetupSong( int iSongIndex )
|
||||
NoteData originalNoteData;
|
||||
pSteps->GetNoteData( originalNoteData );
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pi->m_pn);
|
||||
NoteData ndTransformed;
|
||||
pStyle->GetTransformedNoteDataForStyle( pi->GetStepsAndTrailIndex(), originalNoteData, ndTransformed );
|
||||
|
||||
@@ -2049,7 +2134,6 @@ void ScreenGameplay::UpdateLights()
|
||||
if( m_CabinetLightsNoteData.GetNumTracks() == 0 ) // light data wasn't loaded
|
||||
return;
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
bool bBlinkCabinetLight[NUM_CabinetLight];
|
||||
bool bBlinkGameButton[NUM_GameController][NUM_GameButton];
|
||||
ZERO( bBlinkCabinetLight );
|
||||
@@ -2075,6 +2159,7 @@ void ScreenGameplay::UpdateLights()
|
||||
|
||||
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
|
||||
{
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pi->m_pn);
|
||||
const NoteData &nd = pi->m_pPlayer->GetNoteData();
|
||||
for( int t=0; t<nd.GetNumTracks(); t++ )
|
||||
{
|
||||
@@ -2187,12 +2272,28 @@ void ScreenGameplay::SendCrossedMessages()
|
||||
iNumTracksWithTapOrHoldHead++;
|
||||
|
||||
// send crossed message
|
||||
const Style *pStyle = GAMESTATE->GetCurrentStyle();
|
||||
RString sButton = pStyle->ColToButtonName( t );
|
||||
Message msg( i == 0 ? "NoteCrossed" : "NoteWillCross" );
|
||||
msg.SetParam( "ButtonName", sButton );
|
||||
msg.SetParam( "NumMessagesFromCrossed", i );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
if(GAMESTATE->GetCurrentGame()->m_PlayersHaveSeparateStyles)
|
||||
{
|
||||
FOREACH_EnabledPlayerNumberInfo(m_vPlayerInfo, pi)
|
||||
{
|
||||
const Style *pStyle = GAMESTATE->GetCurrentStyle(pi->m_pn);
|
||||
RString sButton = pStyle->ColToButtonName( t );
|
||||
Message msg( i == 0 ? "NoteCrossed" : "NoteWillCross" );
|
||||
msg.SetParam( "ButtonName", sButton );
|
||||
msg.SetParam( "NumMessagesFromCrossed", i );
|
||||
msg.SetParam("PlayerNumber", pi->m_pn);
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Style *pStyle = GAMESTATE->GetCurrentStyle(PLAYER_INVALID);
|
||||
RString sButton = pStyle->ColToButtonName( t );
|
||||
Message msg( i == 0 ? "NoteCrossed" : "NoteWillCross" );
|
||||
msg.SetParam( "ButtonName", sButton );
|
||||
msg.SetParam( "NumMessagesFromCrossed", i );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
}
|
||||
}
|
||||
|
||||
if( iNumTracksWithTapOrHoldHead > 0 )
|
||||
@@ -2280,7 +2381,7 @@ bool ScreenGameplay::Input( const InputEventPlus &input )
|
||||
* If this is also a style button, don't do this; pump center is start.
|
||||
*/
|
||||
bool bHoldingGiveUp = false;
|
||||
if( GAMESTATE->GetCurrentStyle()->GameInputToColumn(input.GameI) == Column_Invalid )
|
||||
if( GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn(input.GameI) == Column_Invalid )
|
||||
{
|
||||
bHoldingGiveUp |= ( START_GIVES_UP && input.MenuI == GAME_BUTTON_START );
|
||||
bHoldingGiveUp |= ( BACK_GIVES_UP && input.MenuI == GAME_BUTTON_BACK );
|
||||
@@ -2306,7 +2407,7 @@ bool ScreenGameplay::Input( const InputEventPlus &input )
|
||||
/* Only handle GAME_BUTTON_BACK as a regular BACK button if BACK_GIVES_UP is
|
||||
* disabled. */
|
||||
bool bHoldingBack = false;
|
||||
if( GAMESTATE->GetCurrentStyle()->GameInputToColumn(input.GameI) == Column_Invalid )
|
||||
if( GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn(input.GameI) == Column_Invalid )
|
||||
{
|
||||
bHoldingBack |= input.MenuI == GAME_BUTTON_BACK && !BACK_GIVES_UP;
|
||||
}
|
||||
@@ -2338,7 +2439,7 @@ bool ScreenGameplay::Input( const InputEventPlus &input )
|
||||
if( !input.GameI.IsValid() )
|
||||
return false;
|
||||
|
||||
int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
int iCol = GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn( input.GameI );
|
||||
|
||||
// Don't pass on any inputs to Player that aren't a press or a release.
|
||||
switch( input.type )
|
||||
|
||||
@@ -15,7 +15,7 @@ ScreenGameplayLesson::ScreenGameplayLesson()
|
||||
|
||||
void ScreenGameplayLesson::Init()
|
||||
{
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber()) != NULL );
|
||||
ASSERT( GAMESTATE->m_pCurSong != NULL );
|
||||
|
||||
/* Now that we've set up, init the base class. */
|
||||
|
||||
@@ -18,7 +18,7 @@ void ScreenGameplaySyncMachine::Init()
|
||||
m_bForceNoNetwork = true;
|
||||
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame), PLAYER_INVALID );
|
||||
AdjustSync::ResetOriginalSyncData();
|
||||
|
||||
RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music");
|
||||
@@ -99,7 +99,7 @@ void ScreenGameplaySyncMachine::HandleScreenMessage( const ScreenMessage SM )
|
||||
GAMESTATE->m_pCurSteps[pn].Set( NULL );
|
||||
}
|
||||
GAMESTATE->m_PlayMode.Set( PlayMode_Invalid );
|
||||
GAMESTATE->SetCurrentStyle( NULL );
|
||||
GAMESTATE->SetCurrentStyle( NULL, PLAYER_INVALID );
|
||||
GAMESTATE->m_pCurSong.Set( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void ScreenHowToPlay::Init()
|
||||
}
|
||||
}
|
||||
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame), PLAYER_INVALID );
|
||||
|
||||
if( USE_PLAYER )
|
||||
{
|
||||
@@ -146,7 +146,7 @@ void ScreenHowToPlay::Init()
|
||||
loaderSM.LoadFromSimfile( sStepsPath, m_Song, false );
|
||||
m_Song.AddAutoGenNotes();
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(PLAYER_INVALID);
|
||||
|
||||
Steps *pSteps = SongUtil::GetClosestNotes( &m_Song, pStyle->m_StepsType, Difficulty_Beginner );
|
||||
ASSERT_M( pSteps != NULL, ssprintf("No playable steps of StepsType '%s' for ScreenHowToPlay", StringConversion::ToString(pStyle->m_StepsType).c_str()) );
|
||||
|
||||
@@ -379,7 +379,7 @@ void ScreenInstallOverlay::Update( float fDeltaTime )
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->m_bSideIsJoined[0] = true;
|
||||
GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
|
||||
GAMESTATE->m_pCurStyle.Set( vpStyle[0] );
|
||||
GAMESTATE->SetCurrentStyle( vpStyle[0], PLAYER_1 );
|
||||
GAMESTATE->m_pCurSong.Set( pSong );
|
||||
GAMESTATE->m_pPreferredSong = pSong;
|
||||
sInitialScreen = StepMania::GetSelectMusicScreen();
|
||||
|
||||
@@ -83,7 +83,7 @@ void ScreenJukebox::SetSong()
|
||||
continue; // skip
|
||||
|
||||
Difficulty dc = vDifficultiesToShow[ RandomInt(vDifficultiesToShow.size()) ];
|
||||
Steps* pSteps = SongUtil::GetStepsByDifficulty( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, dc );
|
||||
Steps* pSteps = SongUtil::GetStepsByDifficulty( pSong, GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType, dc );
|
||||
|
||||
if( pSteps == NULL )
|
||||
continue; // skip
|
||||
@@ -152,7 +152,7 @@ void ScreenJukebox::SetSong()
|
||||
GAMESTATE->m_pCurCourse.Set( lCourse );
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) );
|
||||
GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType ) );
|
||||
ASSERT( GAMESTATE->m_pCurTrail[p] != NULL );
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ static LocalizedString NO_MATCHING_STEPS("ScreenJukebox", "NoMatchingSteps");
|
||||
void ScreenJukebox::Init()
|
||||
{
|
||||
// ScreenJukeboxMenu must set this
|
||||
ASSERT( GAMESTATE->GetCurrentStyle() != NULL );
|
||||
ASSERT( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) != NULL );
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
|
||||
SetSong();
|
||||
|
||||
@@ -120,16 +120,16 @@ ScreenNameEntry::ScreenNameEntry()
|
||||
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
||||
GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus"), PLAYER_INVALID );
|
||||
StageStats ss;
|
||||
for( int z = 0; z < 3; ++z )
|
||||
{
|
||||
ss.m_vpPlayedSongs.push_back( SONGMAN->GetRandomSong() );
|
||||
ss.m_vpPossibleSongs = ss.m_vpPlayedSongs;
|
||||
ss.m_pStyle = GAMESTATE->GetCurrentStyle();
|
||||
ss.m_player[PLAYER_1].m_pStyle = GAMESTATE->GetCurrentStyle(PLAYER_1);
|
||||
ss.m_playMode = GAMESTATE->m_PlayMode;
|
||||
ASSERT( ss.m_vpPlayedSongs[0]->GetAllSteps().size() != 0 );
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_1)->m_StepsType;
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
@@ -247,7 +247,7 @@ void ScreenNameEntry::Init()
|
||||
|
||||
ASSERT( GAMESTATE->IsHumanPlayer(p) ); // they better be enabled if they made a high score!
|
||||
|
||||
const float fPlayerX = PLAYER_X( p, GAMESTATE->GetCurrentStyle()->m_StyleType );
|
||||
const float fPlayerX = PLAYER_X( p, GAMESTATE->GetCurrentStyle(p)->m_StyleType );
|
||||
|
||||
{
|
||||
LockNoteSkin l( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetCurrent().m_sNoteSkin );
|
||||
@@ -258,7 +258,7 @@ void ScreenNameEntry::Init()
|
||||
this->AddChild( &m_ReceptorArrowRow[p] );
|
||||
}
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle();
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(p);
|
||||
const int iMaxCols = min( int(ABS_MAX_RANKING_NAME_LENGTH), pStyle->m_iColsPerPlayer );
|
||||
m_ColToStringIndex[p].insert(m_ColToStringIndex[p].begin(), pStyle->m_iColsPerPlayer, -1);
|
||||
int CurrentStringIndex = 0;
|
||||
@@ -270,7 +270,7 @@ void ScreenNameEntry::Init()
|
||||
break; // We have enough columns.
|
||||
|
||||
// Find out if this column is associated with the START menu button.
|
||||
GameInput gi = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iCol, p );
|
||||
GameInput gi = GAMESTATE->GetCurrentStyle(p)->StyleInputToGameInput( iCol, p );
|
||||
GameButton mb = INPUTMAPPER->GameButtonToMenuButton( gi.button );
|
||||
if( mb == GAME_BUTTON_START )
|
||||
continue;
|
||||
@@ -338,7 +338,7 @@ bool ScreenNameEntry::Input( const InputEventPlus &input )
|
||||
if( input.type != IET_FIRST_PRESS || !input.GameI.IsValid() )
|
||||
return false; // ignore
|
||||
|
||||
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
const int iCol = GAMESTATE->GetCurrentStyle(input.pn)->GameInputToColumn( input.GameI );
|
||||
bool bHandled = false;
|
||||
if( iCol != Column_Invalid && m_bStillEnteringName[input.pn] )
|
||||
{
|
||||
|
||||
@@ -24,20 +24,20 @@ void ScreenNameEntryTraditional::Init()
|
||||
GAMESTATE->m_bSideIsJoined[PLAYER_2] = true;
|
||||
GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus") );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle( GAMEMAN->GetDefaultGame(),"versus"), GAMESTATE->GetMasterPlayerNumber() );
|
||||
for( int z = 0; z < 3; ++z )
|
||||
{
|
||||
StageStats ss;
|
||||
const vector<Song*> &apSongs = SONGMAN->GetAllSongs();
|
||||
ss.m_vpPlayedSongs.push_back( apSongs[rand()%apSongs.size()] );
|
||||
ss.m_vpPossibleSongs = ss.m_vpPlayedSongs;
|
||||
ss.m_pStyle = GAMESTATE->GetCurrentStyle();
|
||||
ss.m_playMode = GAMESTATE->m_PlayMode;
|
||||
ASSERT( ss.m_vpPlayedSongs[0]->GetAllSteps().size() );
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
ss.m_player[p].m_pStyle = GAMESTATE->GetCurrentStyle(p);
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(p)->m_StepsType;
|
||||
Steps *pSteps = ss.m_vpPlayedSongs[0]->GetAllSteps()[0];
|
||||
ss.m_player[p].m_iStepsPlayed = 1;
|
||||
GAMESTATE->m_pCurSteps[p].Set( pSteps );
|
||||
|
||||
@@ -209,7 +209,7 @@ void ScreenNetEvaluation::UpdateStats()
|
||||
|
||||
m_textPlayerOptions[m_pActivePlayer].SetText( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].playerOptions );
|
||||
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType;
|
||||
Difficulty dc = NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty;
|
||||
Steps *pSteps = SongUtil::GetOneSteps( GAMESTATE->m_pCurSong, st, dc );
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ bool ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
|
||||
|
||||
if( GAMESTATE->m_pCurSong == NULL )
|
||||
return false;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(pn)->m_StepsType;
|
||||
vector <Steps *> MultiSteps;
|
||||
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
|
||||
if(MultiSteps.size() == 0)
|
||||
@@ -449,9 +449,9 @@ void ScreenNetSelectMusic::StartSelectedSong()
|
||||
{
|
||||
Song * pSong = m_MusicWheel.GetSelectedSong();
|
||||
GAMESTATE->m_pCurSong.Set( pSong );
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; //StepsType_dance_single;
|
||||
FOREACH_EnabledPlayer (pn)
|
||||
{
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(pn)->m_StepsType; //StepsType_dance_single;
|
||||
GAMESTATE->m_PreferredDifficulty[pn].Set( m_DC[pn] );
|
||||
Steps *pSteps = SongUtil::GetStepsByDifficulty(pSong, st, m_DC[pn]);
|
||||
GAMESTATE->m_pCurSteps[pn].Set( pSteps );
|
||||
@@ -476,7 +476,7 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
|
||||
return;
|
||||
}
|
||||
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(pn)->m_StepsType;
|
||||
|
||||
Steps * pSteps = SongUtil::GetStepsByDifficulty( GAMESTATE->m_pCurSong, st, m_DC[pn] );
|
||||
GAMESTATE->m_pCurSteps[pn].Set( pSteps );
|
||||
@@ -503,7 +503,7 @@ void ScreenNetSelectMusic::MusicChanged()
|
||||
FOREACH_EnabledPlayer (pn)
|
||||
{
|
||||
m_DC[pn] = GAMESTATE->m_PreferredDifficulty[pn];
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(pn)->m_StepsType;
|
||||
vector <Steps *> MultiSteps;
|
||||
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
|
||||
if(MultiSteps.size() == 0)
|
||||
|
||||
@@ -203,7 +203,7 @@ void ScreenOptionsCourseOverview::ProcessMenuStart( const InputEventPlus &input
|
||||
{
|
||||
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||
random_shuffle( pCourse->m_vEntries.begin(), pCourse->m_vEntries.end() );
|
||||
Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->m_pCurStyle->m_StepsType );
|
||||
Trail *pTrail = pCourse->GetTrailForceRegenCache( GAMESTATE->GetCurrentStyle(input.pn)->m_StepsType );
|
||||
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail );
|
||||
SCREENMAN->PlayStartSound();
|
||||
MESSAGEMAN->Broadcast("CurrentCourseChanged");
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
static void GetStepsForSong( Song *pSong, vector<Steps*> &vpStepsOut )
|
||||
{
|
||||
SongUtil::GetSteps( pSong, vpStepsOut, GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
SongUtil::GetSteps( pSong, vpStepsOut, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->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 );
|
||||
|
||||
@@ -79,7 +79,7 @@ void ScreenOptionsManageCourses::BeginScreen()
|
||||
vector<const Style*> vpStyles;
|
||||
GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vpStyles );
|
||||
const Style *pStyle = vpStyles[0];
|
||||
GAMESTATE->SetCurrentStyle( pStyle );
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
|
||||
if( GAMESTATE->m_stEdit == StepsType_Invalid ||
|
||||
GAMESTATE->m_cdEdit == Difficulty_Invalid )
|
||||
|
||||
@@ -142,7 +142,7 @@ void ScreenOptionsManageEditSteps::HandleScreenMessage( const ScreenMessage SM )
|
||||
Steps *pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
ASSERT( pSteps != NULL );
|
||||
const Style *pStyle = GAMEMAN->GetEditorStyleForStepsType( pSteps->m_StepsType );
|
||||
GAMESTATE->SetCurrentStyle( pStyle );
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
// do base behavior
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void ScreenSelectMusic::Init()
|
||||
if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName )
|
||||
{
|
||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus") );
|
||||
GAMESTATE->SetCurrentStyle( GAMEMAN->GameAndStringToStyle(GAMEMAN->GetDefaultGame(),"versus"), PLAYER_INVALID );
|
||||
GAMESTATE->JoinPlayer( PLAYER_1 );
|
||||
GAMESTATE->SetMasterPlayerNumber(PLAYER_1);
|
||||
}
|
||||
@@ -235,17 +235,17 @@ void ScreenSelectMusic::BeginScreen()
|
||||
vector<StepsType> vst;
|
||||
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst );
|
||||
const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] );
|
||||
GAMESTATE->SetCurrentStyle( pStyle );
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
}
|
||||
|
||||
if( GAMESTATE->GetCurrentStyle() == NULL )
|
||||
if( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) == NULL )
|
||||
{
|
||||
LuaHelpers::ReportScriptError("The Style has not been set. A theme must set the Style before loading ScreenSelectMusic.");
|
||||
// Instead of crashing, set the first compatible style.
|
||||
vector<StepsType> vst;
|
||||
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst );
|
||||
const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0] );
|
||||
GAMESTATE->SetCurrentStyle( pStyle );
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_PlayMode == PlayMode_Invalid )
|
||||
@@ -1457,7 +1457,7 @@ bool ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
vector<StepsType> vst;
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), stCurrent );
|
||||
}
|
||||
GAMESTATE->SetCurrentStyle( pStyle );
|
||||
GAMESTATE->SetCurrentStyle( pStyle, PLAYER_INVALID );
|
||||
}
|
||||
|
||||
/* If we're currently waiting on song assets, abort all except the music
|
||||
@@ -1846,7 +1846,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
if( CommonMetrics::AUTO_SET_STYLE )
|
||||
pStyle = pCourse->GetCourseStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined() );
|
||||
if( pStyle == NULL )
|
||||
pStyle = GAMESTATE->GetCurrentStyle();
|
||||
pStyle = GAMESTATE->GetCurrentStyle(PLAYER_INVALID);
|
||||
lCourse->GetTrails( m_vpTrails, pStyle->m_StepsType );
|
||||
|
||||
m_sSampleMusicToPlay = m_sCourseMusicPath;
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ SnapDisplay::SnapDisplay()
|
||||
|
||||
void SnapDisplay::Load()
|
||||
{
|
||||
m_iNumCols = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer;
|
||||
m_iNumCols = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_iColsPerPlayer;
|
||||
|
||||
m_sprIndicators[0].SetX( -ARROW_SIZE * (m_iNumCols/2 + 0.5f) );
|
||||
m_sprIndicators[1].SetX( ARROW_SIZE * (m_iNumCols/2 + 0.5f) );
|
||||
|
||||
+5
-5
@@ -1167,7 +1167,7 @@ void SongManager::GetCoursesInGroup( vector<Course*> &AddTo, const RString &sCou
|
||||
AddTo.push_back( m_pCourses[i] );
|
||||
}
|
||||
|
||||
bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut )
|
||||
bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut, StepsType stype )
|
||||
{
|
||||
const RString sCourseSuffix = sPreferredGroup + (bExtra2 ? "/extra2.crs" : "/extra1.crs");
|
||||
RString sCoursePath = SpecialFiles::SONGS_DIR + sCourseSuffix;
|
||||
@@ -1184,7 +1184,7 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredG
|
||||
CourseLoaderCRS::LoadFromCRSFile( sCoursePath, course );
|
||||
if( course.GetEstimatedNumStages() <= 0 ) return false;
|
||||
|
||||
Trail *pTrail = course.GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType );
|
||||
Trail *pTrail = course.GetTrail(stype);
|
||||
if( pTrail->m_vEntries.empty() )
|
||||
return false;
|
||||
|
||||
@@ -1231,11 +1231,11 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const Style *sd, Song*& pSong
|
||||
GAMESTATE->m_pCurSong? GAMESTATE->m_pCurSong->m_sGroupName.c_str():"") );
|
||||
|
||||
// Check preferred group
|
||||
if( GetExtraStageInfoFromCourse(bExtra2, sGroup, pSongOut, pStepsOut) )
|
||||
if( GetExtraStageInfoFromCourse(bExtra2, sGroup, pSongOut, pStepsOut, sd->m_StepsType) )
|
||||
return;
|
||||
|
||||
// Optionally, check the Songs folder for extra1/2.crs files.
|
||||
if( GetExtraStageInfoFromCourse(bExtra2, "", pSongOut, pStepsOut) )
|
||||
if( GetExtraStageInfoFromCourse(bExtra2, "", pSongOut, pStepsOut, sd->m_StepsType) )
|
||||
return;
|
||||
|
||||
// Choose a hard song for the extra stage
|
||||
@@ -1894,7 +1894,7 @@ int FindCourseIndexOfSameMode( T begin, T end, const Course *p )
|
||||
|
||||
/* If it's not playable in this mode, don't increment. It might result in
|
||||
* different output in different modes, but that's better than having holes. */
|
||||
if( !(*it)->IsPlayableIn( GAMESTATE->GetCurrentStyle()->m_StepsType ) )
|
||||
if( !(*it)->IsPlayableIn( GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType ) )
|
||||
continue;
|
||||
if( (*it)->GetPlayMode() != pm )
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ public:
|
||||
protected:
|
||||
void LoadStepManiaSongDir( RString sDir, LoadingWindow *ld );
|
||||
void LoadDWISongDir( RString sDir );
|
||||
bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut );
|
||||
bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut, StepsType stype );
|
||||
void SanityCheckGroupDir( RString sDir ) const;
|
||||
void AddGroup( RString sDir, RString sGroupDirName );
|
||||
int GetNumEditsLoadedFromProfile( ProfileSlot slot ) const;
|
||||
|
||||
+6
-6
@@ -478,7 +478,7 @@ void SongUtil::SortSongPointerArrayByGrades( vector<Song*> &vpSongsInOut, bool b
|
||||
int iCounts[NUM_Grade];
|
||||
const Profile *pProfile = PROFILEMAN->GetMachineProfile();
|
||||
ASSERT( pProfile != NULL );
|
||||
pProfile->GetGrades( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, iCounts );
|
||||
pProfile->GetGrades( pSong, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType, iCounts );
|
||||
|
||||
RString foo;
|
||||
foo.reserve(256);
|
||||
@@ -632,7 +632,7 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
|
||||
case SORT_TOP_GRADES:
|
||||
{
|
||||
int iCounts[NUM_Grade];
|
||||
PROFILEMAN->GetMachineProfile()->GetGrades( pSong, GAMESTATE->GetCurrentStyle()->m_StepsType, iCounts );
|
||||
PROFILEMAN->GetMachineProfile()->GetGrades( pSong, GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType, iCounts );
|
||||
|
||||
for( int i=Grade_Tier01; i<NUM_Grade; ++i )
|
||||
{
|
||||
@@ -932,10 +932,10 @@ void SongUtil::GetPlayableStepsTypes( const Song *pSong, set<StepsType> &vOut )
|
||||
{
|
||||
vector<const Style*> vpPossibleStyles;
|
||||
// If AutoSetStyle, or a Style hasn't been chosen, check StepsTypes for all Styles.
|
||||
if( CommonMetrics::AUTO_SET_STYLE || GAMESTATE->m_pCurStyle == NULL )
|
||||
if( CommonMetrics::AUTO_SET_STYLE || GAMESTATE->GetCurrentStyle(PLAYER_INVALID) == NULL )
|
||||
GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles );
|
||||
else
|
||||
vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle );
|
||||
vpPossibleStyles.push_back( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) );
|
||||
|
||||
// Only allow OneSide Styles in Workout
|
||||
if( GAMESTATE->m_bMultiplayer )
|
||||
@@ -1048,13 +1048,13 @@ bool SongUtil::GetStepsTypeAndDifficultyFromSortOrder( SortOrder so, StepsType &
|
||||
case SORT_MEDIUM_METER:
|
||||
case SORT_HARD_METER:
|
||||
case SORT_CHALLENGE_METER:
|
||||
stOut = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
stOut = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType;
|
||||
break;
|
||||
case SORT_DOUBLE_EASY_METER:
|
||||
case SORT_DOUBLE_MEDIUM_METER:
|
||||
case SORT_DOUBLE_HARD_METER:
|
||||
case SORT_DOUBLE_CHALLENGE_METER:
|
||||
stOut = GAMESTATE->GetCurrentStyle()->m_StepsType; // in case we don't find any matches below
|
||||
stOut = GAMESTATE->GetCurrentStyle(GAMESTATE->GetMasterPlayerNumber())->m_StepsType; // in case we don't find any matches below
|
||||
vector<const Style*> vpStyles;
|
||||
GAMEMAN->GetStylesForGame(GAMESTATE->m_pCurGame,vpStyles);
|
||||
FOREACH_CONST( const Style*, vpStyles, i )
|
||||
|
||||
+2
-5
@@ -20,7 +20,6 @@ StageStats::StageStats()
|
||||
m_playMode = PlayMode_Invalid;
|
||||
m_Stage = Stage_Invalid;
|
||||
m_iStageIndex = -1;
|
||||
m_pStyle = NULL;
|
||||
m_vpPlayedSongs.clear();
|
||||
m_vpPossibleSongs.clear();
|
||||
m_EarnedExtraStage = EarnedExtraStage_No;
|
||||
@@ -54,7 +53,6 @@ void StageStats::AssertValid( PlayerNumber pn ) const
|
||||
ASSERT( m_player[pn].m_vpPossibleSteps.size() != 0 );
|
||||
ASSERT( m_player[pn].m_vpPossibleSteps[0] != NULL );
|
||||
ASSERT_M( m_playMode < NUM_PlayMode, ssprintf("playmode %i", m_playMode) );
|
||||
ASSERT( m_pStyle != NULL );
|
||||
ASSERT_M( m_player[pn].m_vpPossibleSteps[0]->GetDifficulty() < NUM_Difficulty, ssprintf("Invalid Difficulty %i", m_player[pn].m_vpPossibleSteps[0]->GetDifficulty()) );
|
||||
ASSERT_M( (int) m_vpPlayedSongs.size() == m_player[pn].m_iStepsPlayed, ssprintf("%i Songs Played != %i Steps Played for player %i", (int)m_vpPlayedSongs.size(), (int)m_player[pn].m_iStepsPlayed, pn) );
|
||||
ASSERT_M( m_vpPossibleSongs.size() == m_player[pn].m_vpPossibleSteps.size(), ssprintf("%i Possible Songs != %i Possible Steps for player %i", (int)m_vpPossibleSongs.size(), (int)m_player[pn].m_vpPossibleSteps.size(), pn) );
|
||||
@@ -69,7 +67,6 @@ void StageStats::AssertValid( MultiPlayer pn ) const
|
||||
ASSERT( m_multiPlayer[pn].m_vpPossibleSteps.size() != 0 );
|
||||
ASSERT( m_multiPlayer[pn].m_vpPossibleSteps[0] != NULL );
|
||||
ASSERT_M( m_playMode < NUM_PlayMode, ssprintf("playmode %i", m_playMode) );
|
||||
ASSERT( m_pStyle != NULL );
|
||||
ASSERT_M( m_player[pn].m_vpPossibleSteps[0]->GetDifficulty() < NUM_Difficulty, ssprintf("difficulty %i", m_player[pn].m_vpPossibleSteps[0]->GetDifficulty()) );
|
||||
ASSERT( (int) m_vpPlayedSongs.size() == m_player[pn].m_iStepsPlayed );
|
||||
ASSERT( m_vpPossibleSongs.size() == m_player[pn].m_vpPossibleSteps.size() );
|
||||
@@ -216,7 +213,7 @@ void StageStats::FinalizeScores( bool bSummary )
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
const HighScore &hs = m_player[p].m_HighScore;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(p)->m_StepsType;
|
||||
|
||||
const Song* pSong = GAMESTATE->m_pCurSong;
|
||||
const Steps* pSteps = GAMESTATE->m_pCurSteps[p];
|
||||
@@ -270,7 +267,7 @@ void StageStats::FinalizeScores( bool bSummary )
|
||||
|
||||
HighScore &hs = m_player[p].m_HighScore;
|
||||
Profile* pProfile = PROFILEMAN->GetMachineProfile();
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle(p)->m_StepsType;
|
||||
|
||||
const HighScoreList *pHSL = NULL;
|
||||
if( bSummary )
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
Stage m_Stage;
|
||||
int m_iStageIndex;
|
||||
PlayMode m_playMode;
|
||||
const Style* m_pStyle;
|
||||
vector<Song*> m_vpPlayedSongs;
|
||||
vector<Song*> m_vpPossibleSongs;
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ static StageStats AccumPlayedStageStats( const vector<StageStats>& vss )
|
||||
|
||||
if( !vss.empty() )
|
||||
{
|
||||
ssreturn.m_pStyle = vss[0].m_pStyle;
|
||||
ssreturn.m_playMode = vss[0].m_playMode;
|
||||
}
|
||||
|
||||
@@ -111,7 +110,7 @@ void AddPlayerStatsToProfile( Profile *pProfile, const StageStats &ss, PlayerNum
|
||||
CHECKPOINT;
|
||||
|
||||
StyleID sID;
|
||||
sID.FromStyle( ss.m_pStyle );
|
||||
sID.FromStyle( ss.m_player[pn].m_pStyle );
|
||||
|
||||
ASSERT( (int) ss.m_vpPlayedSongs.size() == ss.m_player[pn].m_iStepsPlayed );
|
||||
for( int i=0; i<ss.m_player[pn].m_iStepsPlayed; i++ )
|
||||
|
||||
+26
-2
@@ -70,7 +70,7 @@ GameInput Style::StyleInputToGameInput( int iCol, PlayerNumber pn ) const
|
||||
}
|
||||
}
|
||||
|
||||
FAIL_M( ssprintf("Invalid column number %i for player %i in the style %s", iCol, pn, GAMESTATE->GetCurrentStyle()->m_szName) );
|
||||
FAIL_M( ssprintf("Invalid column number %i for player %i in the style %s", iCol, pn, m_szName) );
|
||||
};
|
||||
|
||||
int Style::GameInputToColumn( const GameInput &GameI ) const
|
||||
@@ -106,6 +106,16 @@ void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut
|
||||
}
|
||||
}
|
||||
|
||||
float Style::GetWidth(PlayerNumber pn) const
|
||||
{
|
||||
float left, right;
|
||||
GetMinAndMaxColX(pn, left, right);
|
||||
// left and right are the center positions of the columns. The full width
|
||||
// needs to be from the edges.
|
||||
float width= right - left;
|
||||
return width + (width / static_cast<float>(m_iColsPerPlayer-1));
|
||||
}
|
||||
|
||||
RString Style::ColToButtonName( int iCol ) const
|
||||
{
|
||||
const char *pzColumnName = m_ColumnInfo[PLAYER_1][iCol].pzName;
|
||||
@@ -127,7 +137,20 @@ public:
|
||||
DEFINE_METHOD( GetStyleType, m_StyleType )
|
||||
DEFINE_METHOD( GetStepsType, m_StepsType )
|
||||
DEFINE_METHOD( ColumnsPerPlayer, m_iColsPerPlayer )
|
||||
DEFINE_METHOD( NeedsZoomOutWith2Players, m_bNeedsZoomOutWith2Players )
|
||||
static int NeedsZoomOutWith2Players(T* p, lua_State *L)
|
||||
{
|
||||
// m_bNeedsZoomOutWith2Players was removed in favor of having
|
||||
// ScreenGameplay use the style's width and margin values to calculate
|
||||
// the zoom. So this always returns false. -Kyz
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
static int GetWidth(T* p, lua_State* L)
|
||||
{
|
||||
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
|
||||
lua_pushnumber(L, p->GetWidth(pn));
|
||||
return 1;
|
||||
}
|
||||
DEFINE_METHOD( LockedDifficulty, m_bLockDifficulties )
|
||||
|
||||
static int GetColumnInfo( T* p, lua_State *L )
|
||||
@@ -173,6 +196,7 @@ public:
|
||||
ADD_METHOD( GetColumnDrawOrder );
|
||||
ADD_METHOD( ColumnsPerPlayer );
|
||||
ADD_METHOD( NeedsZoomOutWith2Players );
|
||||
ADD_METHOD( GetWidth );
|
||||
ADD_METHOD( LockedDifficulty );
|
||||
}
|
||||
};
|
||||
|
||||
+6
-1
@@ -67,7 +67,11 @@ public:
|
||||
int m_iInputColumn[NUM_GameController][NUM_GameButton];
|
||||
int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
||||
/** @brief Does this style need to be zoomed out with two players due to too many columns? */
|
||||
bool m_bNeedsZoomOutWith2Players;
|
||||
// Design change: Instead of having a flag in the style that toggles a
|
||||
// fixed zoom that is only applied to the columns, ScreenGameplay now
|
||||
// calculates a zoom factor to apply to the notefield and puts it in the
|
||||
// PlayerState. -Kyz
|
||||
//bool m_bNeedsZoomOutWith2Players;
|
||||
/** @brief Can this style use the BeginnerHelper for assisting new people to the game? */
|
||||
bool m_bCanUseBeginnerHelper;
|
||||
/**
|
||||
@@ -88,6 +92,7 @@ public:
|
||||
bool GetUsesCenteredArrows() const;
|
||||
void GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& original, NoteData& noteDataOut ) const;
|
||||
void GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const;
|
||||
float GetWidth(PlayerNumber pn) const;
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
Reference in New Issue
Block a user