implement force_timescale in configs

This commit is contained in:
kidfearless 2020-12-14 15:12:22 -07:00
parent b2da978f73
commit f997d4e544
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,7 @@
"gravity" "1.0" // Gravity setting, 1.0 for default. Standard for low gravity styles is 0.6.
"speed" "1.0" // Speed multiplier, 1.0 for default. Standard for slowmo styles is 0.5.
"timescale" "1.0" // Timing will scale with this setting.
"force_timescale" "0" // Force the timescale every jump? Default is 0 for normal timescales.
"velocity" "1.0" // % of horizontal velocity to keep per jump. a value 0.9 will make the player lose 10% of their velocity per jump. Likewise, values above 1 will result in speed gains.
"bonus_velocity" "0.0" // Bonus velocity to gain per jump. If set to e.g. 100.0, the player will gain 100 bonus velocity per jump.
"min_velocity" "0.0" // Minimum amount of horizontal velocity to keep per jump. If set to 600.0, the player can't have less than 600 velocity per jump.

View File

@ -2591,6 +2591,20 @@ public SMCResult OnStyleLeaveSection(SMCParser smc)
gSM_StyleKeys[gI_CurrentParserIndex].SetString("timescale", "0.5");
}
// Setting it here so that we can reference the timescale setting.
if(!HasStyleSetting(gI_CurrentParserIndex, "force_timescale"))
{
if(GetStyleSettingFloat(gI_CurrentParserIndex, "timescale") == 1.0)
{
gSM_StyleKeys[gI_CurrentParserIndex].SetString("force_timescale", "0");
}
else
{
gSM_StyleKeys[gI_CurrentParserIndex].SetString("force_timescale", "1");
}
}
if(!gB_Registered && strlen(gS_StyleStrings[gI_CurrentParserIndex].sChangeCommand) > 0 && !gA_StyleSettings[gI_CurrentParserIndex].bInaccessible)
{
char sStyleCommands[32][32];