Added hide lights feature in player options

This commit is contained in:
dando92
2025-03-18 07:24:58 -07:00
committed by teejusb
parent 6b50f9a90c
commit 8320afe796
5 changed files with 103 additions and 3 deletions
+42
View File
@@ -34,6 +34,16 @@ XToString( DrainType );
XToLocalizedString( DrainType );
LuaXType( DrainType );
static const char* HideLightTypeNames[] = {
"NoHideLights",
"HideAllLights",
"HideMarqueeLights",
"HideBassLights",
};
XToString(HideLightType);
XToLocalizedString(HideLightType);
LuaXType(HideLightType);
static const char *ModTimerTypeNames[] = {
"Game",
"Beat",
@@ -65,6 +75,7 @@ void PlayerOptions::Init()
{
m_LifeType = LifeType_Bar;
m_DrainType = DrainType_Normal;
m_HideLightType = HideLightType_NoHideLights;
m_ModTimerType = ModTimerType_Default;
m_BatteryLives = 4;
m_MinTNSToHideNotes= PREFSMAN->m_MinTNSToHideNotes;
@@ -127,6 +138,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
DO_COPY( m_LifeType );
DO_COPY( m_DrainType );
DO_COPY( m_HideLightType );
DO_COPY( m_ModTimerType );
DO_COPY( m_BatteryLives );
APPROACH( fModTimerMult );
@@ -245,6 +257,24 @@ void PlayerOptions::GetMods( std::vector<RString> &AddTo, bool bForceNoteSkin )
FAIL_M(ssprintf("Invalid LifeType: %i", m_LifeType));
}
switch (m_HideLightType)
{
case HideLightType_NoHideLights:
AddTo.push_back("NoHideLights");
break;
case HideLightType_HideAllLights:
AddTo.push_back("HideAllLights");
break;
case HideLightType_HideMarqueeLights:
AddTo.push_back("HideMarqueeLights");
break;
case HideLightType_HideBassLights:
AddTo.push_back("HideBassLights");
break;
default:
FAIL_M(ssprintf("Invalid HideLightType: %i", m_HideLightType));
}
if( !m_fTimeSpacing )
{
if( m_fMaxScrollBPM )
@@ -747,6 +777,13 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
else if( sBit == "norecover" || sBit == "power-drop" ) { m_DrainType= DrainType_NoRecover; }
else if( sBit == "suddendeath" || sBit == "death" ) { m_DrainType= DrainType_SuddenDeath; }
else if( sBit == "normal-drain" ) { m_DrainType= DrainType_Normal; }
else if (sBit.find("lights") != sBit.npos)
{
if (sBit == "nohidelights") m_HideLightType = HideLightType_NoHideLights;
else if (sBit == "hidealllights") m_HideLightType = HideLightType_HideAllLights;
else if (sBit == "hidemarqueelights") m_HideLightType = HideLightType_HideMarqueeLights;
else if (sBit == "hidebasslights") m_HideLightType = HideLightType_HideBassLights;
}
else if( sBit == "boost" ) SET_FLOAT( fAccels[ACCEL_BOOST] )
else if( sBit == "brake" || sBit == "land" ) SET_FLOAT( fAccels[ACCEL_BRAKE] )
else if( sBit.find("wave") != sBit.npos)
@@ -1412,6 +1449,7 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
#define COMPARE(x) { if( x != other.x ) return false; }
COMPARE(m_LifeType);
COMPARE(m_DrainType);
COMPARE(m_HideLightType);
COMPARE(m_ModTimerType);
COMPARE(m_fModTimerMult);
COMPARE(m_fModTimerOffset);
@@ -1495,6 +1533,7 @@ PlayerOptions& PlayerOptions::operator=(PlayerOptions const& other)
#define CPY_SPEED(x) m_ ## x = other.m_ ## x; m_Speed ## x = other.m_Speed ## x;
CPY(m_LifeType);
CPY(m_DrainType);
CPY(m_HideLightType);
CPY(m_ModTimerType);
CPY_SPEED(fModTimerMult);
CPY_SPEED(fModTimerOffset);
@@ -1771,6 +1810,7 @@ void PlayerOptions::ResetPrefs( ResetPrefsType type )
}
CPY(m_LifeType);
CPY(m_DrainType);
CPY(m_HideLightType);
CPY(m_BatteryLives);
CPY(m_ModTimerType);
CPY(m_fModTimerMult);
@@ -1830,6 +1870,7 @@ public:
ENUM_INTERFACE(LifeSetting, LifeType, LifeType);
ENUM_INTERFACE(DrainSetting, DrainType, DrainType);
ENUM_INTERFACE(HideLightSetting, HideLightType, HideLightType);
ENUM_INTERFACE(ModTimerSetting, ModTimerType, ModTimerType)
INT_INTERFACE(BatteryLives, BatteryLives);
FLOAT_INTERFACE(ModTimerMult, ModTimerMult, true);
@@ -2391,6 +2432,7 @@ public:
ADD_METHOD(LifeSetting);
ADD_METHOD(DrainSetting);
ADD_METHOD(HideLightSetting);
ADD_METHOD(ModTimerSetting);
ADD_METHOD(ModTimerMult);
ADD_METHOD(ModTimerOffset);