Skip to content

Commit

Permalink
Merge branch 'etternalmemestatus' of https://github.com/etternagame/e…
Browse files Browse the repository at this point in the history
…tterna into etternalmemestatus
  • Loading branch information
xwidghet committed Jun 10, 2017
2 parents b34db73 + a61ffae commit bb017e4
Show file tree
Hide file tree
Showing 32 changed files with 23 additions and 715 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,27 +251,6 @@ while drawindex<#hsTable and startind<=finishind do
drawindex = drawindex+1
end

if tonumber(PREFSMAN:GetPreference("MaxHighScoresPerListForPlayer")) ~= 3 then
themeConfig:get_data().global.ScoreBoardNag = false
themeConfig:set_dirty()
themeConfig:save()
end

if themeConfig:get_data().global.ScoreBoardNag and #origTable == tonumber(PREFSMAN:GetPreference("MaxHighScoresPerListForPlayer")) then
t[#t+1] = LoadFont("Common normal")..{
InitCommand=cmd(xy,framex+frameWidth/2,framey+4*spacing;zoom,0.30;valign,0;diffusealpha,0.8;maxwidth,frameWidth/0.30),
BeginCommand=function(self)
local text = string.format("You have reached the maximum number of saved scores for this chart."..
" \n Lower ranked scores will be removed as you save more scores.\n\n"..
" Please increase the values for 'Max Machine Scores' and \n'Max Player Scores'"..
" from the Arcade Options to raise this limit.\n\n\n"..
"This will no longer appear once the limit is set to any non-default value.\n(You may change back afterwards if you want)\n\n"..
"The current limit is %s. (Default is 3)",PREFSMAN:GetPreference("MaxHighScoresPerListForPlayer") or 0)
self:settext(text)
end
}
end

--Update function for showing mouse rollovers
local function Update(self)
t.InitCommand=cmd(SetUpdateFunction,Update);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ local minanyms = {
"Scalding brain fart",
"Luridescence",
"Frothy Loin",
"Ministry of Silly Steps",

-- the profile names of yore
"mystic memer",
Expand Down Expand Up @@ -49,9 +50,11 @@ local minanyms = {
"SERENADE UNDER PORCUPINE",
"SERRATED HAMBURGER",
"INTERGALACTIC TURKEY",
"TURTLE LOVE",
"BICYCLE LAUGH",
"GODLY PLATE OF THE WHALE",
"PURPLE PARKING METERSTICK",
"BROCCOLI MOISTURIZER",

-- Ye olde names
"Shoeeater9000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,8 @@ local sortTable = {
SortOrder_TopGrades = 'Grade',
SortOrder_Artist = 'Artist',
SortOrder_Genre = 'Genre',
SortOrder_BeginnerMeter = 'Beginner Meter',
SortOrder_EasyMeter = 'Easy Meter',
SortOrder_DoubleMediumMeter = 'Normal Meter',
SortOrder_HardMeter = 'Hard Meter',
SortOrder_ChallengeMeter = 'Insane Meter',
SortOrder_DoubleEasyMeter = 'Double Easy Meter',
SortOrder_DoubleMediumMeter = 'Double Normal Meter',
SortOrder_DoubleHardMeter = 'Double Hard Meter',
SortOrder_DoubleChallengeMeter = 'Double Insane Meter',
SortOrder_ModeMenu = 'Mode Menu',
SortOrder_AllCourses = 'All Courses',
SortOrder_Nonstop = 'Nonstop',
SortOrder_Oni = 'Oni',
SortOrder_Endless = 'Endless',
SortOrder_Length = 'Song Length',
SortOrder_Roulette = 'Roulette',
SortOrder_Recent = 'Recently Played'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,8 @@ local sortTable = {
SortOrder_TopGrades = 'Grade',
SortOrder_Artist = 'Artist',
SortOrder_Genre = 'Genre',
SortOrder_BeginnerMeter = 'Beginner Meter',
SortOrder_EasyMeter = 'Easy Meter',
SortOrder_MediumMeter = 'Normal Meter',
SortOrder_HardMeter = 'Hard Meter',
SortOrder_ChallengeMeter = 'Insane Meter',
SortOrder_DoubleEasyMeter = 'Double Easy Meter',
SortOrder_DoubleMediumMeter = 'Double Normal Meter',
SortOrder_DoubleHardMeter = 'Double Hard Meter',
SortOrder_DoubleChallengeMeter = 'Double Insane Meter',
SortOrder_ModeMenu = 'Mode Menu',
SortOrder_AllCourses = 'All Courses',
SortOrder_Nonstop = 'Nonstop',
SortOrder_Oni = 'Oni',
SortOrder_Endless = 'Endless',
SortOrder_Length = 'Song Length',
SortOrder_Roulette = 'Roulette',
SortOrder_Recent = 'Recently Played',
SortOrder_Favorites = 'Favorites'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,8 @@ local sortTable = {
SortOrder_TopGrades = 'Grade',
SortOrder_Artist = 'Artist',
SortOrder_Genre = 'Genre',
SortOrder_BeginnerMeter = 'Beginner Meter',
SortOrder_EasyMeter = 'Easy Meter',
SortOrder_MediumMeter = 'Normal Meter',
SortOrder_HardMeter = 'Hard Meter',
SortOrder_ChallengeMeter = 'Insane Meter',
SortOrder_DoubleEasyMeter = 'Double Easy Meter',
SortOrder_DoubleMediumMeter = 'Double Normal Meter',
SortOrder_DoubleHardMeter = 'Double Hard Meter',
SortOrder_DoubleChallengeMeter = 'Double Insane Meter',
SortOrder_ModeMenu = 'Mode Menu',
SortOrder_AllCourses = 'All Courses',
SortOrder_Nonstop = 'Nonstop',
SortOrder_Oni = 'Oni',
SortOrder_Endless = 'Endless',
SortOrder_Length = 'Song Length',
SortOrder_Roulette = 'Roulette',
SortOrder_Recent = 'Recently Played',
SortOrder_Favorites = 'Favorites'
}
Expand Down
Binary file modified extern/MinaCalc/MinaCalc.lib
Binary file not shown.
106 changes: 0 additions & 106 deletions src/GameCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ void GameCommand::Init()
m_sProfileID = "";
m_sUrl = "";
m_bUrlExits = true;

m_bInsertCredit = false;
m_bClearCredits = false;
m_bStopMusic = false;
m_bApplyDefaultOptions = false;
m_bFadeMusic = false;
Expand Down Expand Up @@ -342,16 +339,6 @@ void GameCommand::LoadOne( const Command& cmd )
m_vsScreensToPrepare.push_back( sValue );
}

else if( sName == "insertcredit" )
{
m_bInsertCredit = true;
}

else if( sName == "clearcredits" )
{
m_bClearCredits = true;
}

else if( sName == "stopmusic" )
{
m_bStopMusic = true;
Expand Down Expand Up @@ -414,45 +401,6 @@ void GameCommand::LoadOne( const Command& cmd )
#undef MAKE_INVALID
}

int GetNumCreditsPaid()
{
int iNumCreditsPaid = GAMESTATE->GetNumSidesJoined();

// players other than the first joined for free
if( GAMESTATE->GetPremium() == Premium_2PlayersFor1Credit )
iNumCreditsPaid = min( iNumCreditsPaid, 1 );

return iNumCreditsPaid;
}


int GetCreditsRequiredToPlayStyle( const Style *style )
{
// GameState::GetCoinsNeededToJoin returns 0 if the coin mode isn't
// CoinMode_Pay, which means the theme can't make sure that there are
// enough credits available.
// So we have to check the coin mode here
// and return 0 if the player doesn't have to pay.
if( GAMESTATE->GetCoinMode() != CoinMode_Pay )
{
return 0;
}
if( GAMESTATE->GetPremium() == Premium_2PlayersFor1Credit )
return 1;

switch( style->m_StyleType )
{
case StyleType_OnePlayerOneSide:
return 1;
case StyleType_TwoPlayersSharedSides:
case StyleType_TwoPlayersTwoSides:
return 2;
case StyleType_OnePlayerTwoSides:
return (GAMESTATE->GetPremium() == Premium_DoubleFor1Credit) ? 1 : 2;
DEFAULT_FAIL( style->m_StyleType );
}
}

static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm )
{
return true;
Expand All @@ -467,43 +415,6 @@ bool GameCommand::IsPlayable( RString *why ) const
return false;
}

if ( m_pStyle )
{
int iCredits;
if( GAMESTATE->GetCoinMode() == CoinMode_Pay )
iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
else
iCredits = NUM_PLAYERS;

const int iNumCreditsPaid = GetNumCreditsPaid();
const int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);

/* With PREFSMAN->m_bDelayedCreditsReconcile disabled, enough credits must
* be paid. (This means that enough sides must be joined.) Enabled, simply
* having enough credits lying in the machine is sufficient; we'll deduct the
* extra in Apply(). */
int iNumCreditsAvailable = iNumCreditsPaid;
if( PREFSMAN->m_bDelayedCreditsReconcile )
iNumCreditsAvailable += iCredits;

if( iNumCreditsAvailable < iNumCreditsRequired )
{
if( why )
*why = ssprintf( "need %i credits, have %i", iNumCreditsRequired, iNumCreditsAvailable );
return false;
}

/* If both sides are joined, disallow singles modes, since easy to select
* them accidentally, instead of versus mode. */
if( m_pStyle->m_StyleType == StyleType_OnePlayerOneSide &&
GAMESTATE->GetNumPlayersEnabled() > 1 )
{
if( why )
*why = "too many players joined for ONE_PLAYER_ONE_CREDIT";
return false;
}
}

/* Don't allow a PlayMode that's incompatible with our current Style (if set),
* and vice versa. */
if( m_pm != PlayMode_Invalid || m_pStyle != NULL )
Expand Down Expand Up @@ -581,20 +492,6 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
if( m_pStyle != NULL )
{
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
// for the sides that will be joined as a result of applying this option.
if( GAMESTATE->GetCoinMode() == CoinMode_Pay )
{
int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
int iNumCreditsPaid = GetNumCreditsPaid();
int iNumCreditsOwed = iNumCreditsRequired - iNumCreditsPaid;
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins - iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit );
LOG->Trace( "Deducted %i coins, %i remaining",
iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit, GAMESTATE->m_iCoins.Get() );
}

// If only one side is joined and we picked a style that requires both
// sides, join the other side.
switch( m_pStyle->m_StyleType )
Expand Down Expand Up @@ -699,9 +596,6 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
FOREACH_CONST( RString, m_vsScreensToPrepare, s )
SCREENMAN->PrepareScreen( *s );

if( m_bClearCredits )
StepMania::ClearCredits();

if( m_bApplyDefaultOptions )
{
// applying options affects only the current stage
Expand Down
6 changes: 0 additions & 6 deletions src/GameCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class Style;
struct Game;
struct lua_State;

int GetNumCreditsPaid();
int GetCreditsRequiredToPlayStyle( const Style *style );

class GameCommand
{
public:
Expand All @@ -35,7 +32,6 @@ class GameCommand
m_sSongGroup(""), m_SortOrder(SortOrder_Invalid),
m_sSoundPath(""), m_vsScreensToPrepare(),
m_sProfileID(""), m_sUrl(""), m_bUrlExits(true),
m_bInsertCredit(false), m_bClearCredits(false),
m_bStopMusic(false), m_bApplyDefaultOptions(false),
m_bFadeMusic(false), m_fMusicFadeOutVolume(-1),
m_fMusicFadeOutSeconds(-1), m_bApplyCommitsScreens(true)
Expand Down Expand Up @@ -95,8 +91,6 @@ class GameCommand
// sm-ssc adds:
bool m_bUrlExits; // for making stepmania not exit on url

bool m_bInsertCredit;
bool m_bClearCredits;
bool m_bStopMusic;
bool m_bApplyDefaultOptions;
// sm-ssc also adds:
Expand Down
31 changes: 0 additions & 31 deletions src/GameConstantsAndTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,6 @@ static const char *StageResultNames[] = {
XToString( StageResult );
LuaXType( StageResult );

static const char *CoinModeNames[] = {
"Home",
"Pay",
"Free",
};
XToString( CoinMode );
StringToX( CoinMode );
LuaXType( CoinMode );


static const char *PremiumNames[] = {
"Off",
"DoubleFor1Credit",
"2PlayersFor1Credit",
};
XToString( Premium );
StringToX( Premium );
XToLocalizedString( Premium );
LuaXType( Premium );


static const char *SortOrderNames[] = {
"Preferred",
"Group",
Expand All @@ -154,17 +133,7 @@ static const char *SortOrderNames[] = {
"TopGrades",
"Artist",
"Genre",
"BeginnerMeter",
"EasyMeter",
"MediumMeter",
"HardMeter",
"ChallengeMeter",
"DoubleEasyMeter",
"DoubleMediumMeter",
"DoubleHardMeter",
"DoubleChallengeMeter",
"ModeMenu",
"Roulette",
"Recent",
"Favorites",
};
Expand Down
Loading

0 comments on commit bb017e4

Please sign in to comment.