mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
Jump height is now saved to options and so persists across sessions.
This commit is contained in:
parent
e2cd62aeb0
commit
945fa5d2ba
@ -67,6 +67,8 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
static string GetJump(Game g) { return g.LocalPlayer.JumpHeight.ToString("F3"); }
|
||||
static void SetJump(Game g, string v) {
|
||||
g.LocalPlayer.physics.CalculateJumpVelocity(true, Utils.ParseDecimal(v));
|
||||
float jumpVel = g.LocalPlayer.physics.jumpVel;
|
||||
Options.Set(OptionsKey.JumpVelocity, jumpVel.ToString());
|
||||
}
|
||||
|
||||
static string GetWOMHacks(Game g) { return GetBool(g.LocalPlayer.Hacks.WOMStyleHacks); }
|
||||
|
@ -265,9 +265,7 @@ namespace ClassicalSharp.Entities {
|
||||
if (jumpHeight >= 512) jumpVel = 16.5f;
|
||||
if (jumpHeight >= 768) jumpVel = 22.5f;
|
||||
|
||||
while (GetMaxHeight(jumpVel) <= jumpHeight) {
|
||||
jumpVel += 0.001f;
|
||||
}
|
||||
while (GetMaxHeight(jumpVel) <= jumpHeight) { jumpVel += 0.001f; }
|
||||
if (userVel) userJumpVel = jumpVel;
|
||||
}
|
||||
|
||||
|
@ -135,13 +135,18 @@ namespace ClassicalSharp.Entities {
|
||||
}
|
||||
|
||||
public void Init(Game game) {
|
||||
Hacks.SpeedMultiplier = Options.GetFloat(OptionsKey.Speed, 0.1f, 50, 10);
|
||||
Hacks.PushbackPlacing = !game.ClassicMode && Options.GetBool(OptionsKey.PushbackPlacing, false);
|
||||
Hacks.NoclipSlide = Options.GetBool(OptionsKey.NoclipSlide, false);
|
||||
Hacks.WOMStyleHacks = !game.ClassicMode && Options.GetBool(OptionsKey.WOMStyleHacks, false);
|
||||
Hacks.Enabled = !game.PureClassic && Options.GetBool(OptionsKey.HacksOn, true);
|
||||
Hacks.FullBlockStep = !game.ClassicMode && Options.GetBool(OptionsKey.FullBlockStep, false);
|
||||
Health = 20;
|
||||
if (game.ClassicMode) return;
|
||||
|
||||
Hacks.SpeedMultiplier = Options.GetFloat(OptionsKey.Speed, 0.1f, 50, 10);
|
||||
Hacks.PushbackPlacing = Options.GetBool(OptionsKey.PushbackPlacing, false);
|
||||
Hacks.NoclipSlide = Options.GetBool(OptionsKey.NoclipSlide, false);
|
||||
Hacks.WOMStyleHacks = Options.GetBool(OptionsKey.WOMStyleHacks, false);
|
||||
Hacks.FullBlockStep = Options.GetBool(OptionsKey.FullBlockStep, false);
|
||||
physics.userJumpVel = Options.GetFloat(OptionsKey.JumpVelocity, 0.0f, 52.0f, 0.42f);
|
||||
physics.jumpVel = physics.userJumpVel;
|
||||
|
||||
}
|
||||
|
||||
public void Ready(Game game) { }
|
||||
|
@ -38,6 +38,7 @@ namespace ClassicalSharp {
|
||||
public const string HacksOn = "hacks-hacksenabled";
|
||||
public const string FieldOfView = "hacks-fov";
|
||||
public const string Speed = "hacks-speedmultiplier";
|
||||
public const string JumpVelocity = "hacks-jumpvelocity";
|
||||
public const string ModifiableLiquids = "hacks-liquidsbreakable";
|
||||
public const string PushbackPlacing = "hacks-pushbackplacing";
|
||||
public const string NoclipSlide = "hacks-noclipslide";
|
||||
|
@ -41,6 +41,7 @@ typedef UInt8 FpsLimitMethod;
|
||||
#define OptionsKey_HacksEnabled "hacks-hacksenabled"
|
||||
#define OptionsKey_FieldOfView "hacks-fov"
|
||||
#define OptionsKey_Speed "hacks-speedmultiplier"
|
||||
#define OptionsKey_JumpVelocity "hacks-jumpvelocity"
|
||||
#define OptionsKey_ModifiableLiquids "hacks-liquidsbreakable"
|
||||
#define OptionsKey_PushbackPlacing "hacks-pushbackplacing"
|
||||
#define OptionsKey_NoclipSlide "hacks-noclipslide"
|
||||
|
Loading…
x
Reference in New Issue
Block a user