diff --git a/Source/Actors/Player.cs b/Source/Actors/Player.cs index 0490685..a52ab8c 100644 --- a/Source/Actors/Player.cs +++ b/Source/Actors/Player.cs @@ -256,6 +256,7 @@ public override void Added() { GetCameraTarget(out var orig, out var target, out _); World.Camera.LookAt = target; World.Camera.Position = orig; + World.Camera.FarPlane = Save.Instance.SimplifiedGraphics ? 8000 : 800; if (Save.Instance.Freecam != Save.FreecamMode.Free) { Manager.FreeCamPosition = Position; @@ -2112,10 +2113,10 @@ public void CollectSprites(List populate) { if (drawOrbs && drawOrbsEase > 0) { var ease = drawOrbsEase; var col = Math.Floor(ease * 10) % 2 == 0 ? Hair.Color : Color.White; - var s = (ease < 0.5f) ? (0.5f + ease) : (Ease.CubeOut(1 - (ease - 0.5f) * 2)); + var s = (ease < 0.5f) ? (0.5f + ease) : (Ease.Cube.Out(1 - (ease - 0.5f) * 2)); for (int i = 0; i < 8; i++) { var rot = (i / 8f + ease * 0.25f) * MathF.Tau; - var rad = Ease.CubeOut(ease) * 16; + var rad = Ease.Cube.Out(ease) * 16; var pos = SolidWaistTestPos + World.Camera.Left * MathF.Cos(rot) * rad + World.Camera.Up * MathF.Sin(rot) * rad; var size = 3 * s; populate.Add(Sprite.CreateBillboard(World, pos, "circle", size + 0.5f, Color.Black) with { Post = true }); @@ -2149,7 +2150,7 @@ public void CollectModels(List<(Actor Actor, Model Model)> populate) { continue; // I HATE this alpha fade out but don't have time to make some kind of full-model fade out effect - var alpha = Ease.CubeOut(Calc.ClampedMap(trail.Percent, 0.5f, 1.0f, 1, 0)); + var alpha = Ease.Cube.Out(Calc.ClampedMap(trail.Percent, 0.5f, 1.0f, 1, 0)); foreach (var mat in trail.Model.Materials) mat.Color = trail.Color * alpha; diff --git a/Source/Data/Save.cs b/Source/Data/Save.cs index 7181601..cf7ca01 100644 --- a/Source/Data/Save.cs +++ b/Source/Data/Save.cs @@ -158,6 +158,24 @@ public void ToggleFullscreen() public void ToggleSimplifiedGraphics() { SimplifiedGraphics = !SimplifiedGraphics; + Save.Instance.SyncSettings(); + + if (Game.Scene is World world) { + world.Camera.FarPlane = Save.Instance.SimplifiedGraphics ? 8000 : 800; + + foreach (var actor in world.Actors) { + var fields = actor.GetType().GetFields() + .Where(f => f.FieldType.IsAssignableTo(typeof(Model))); + + foreach (var field in fields) { + var model = (Model)field.GetValue(actor)!; + foreach (var material in model.Materials) { + if (material.Shader == null || !Assets.Shaders.ContainsKey(material.Shader.Name)) continue; + material.Simplified = Save.Instance.SimplifiedGraphics; + } + } + } + } } public void ToggleZGuide() diff --git a/Source/TAS/TASMod.cs b/Source/TAS/TASMod.cs index 19d071e..93d42ed 100644 --- a/Source/TAS/TASMod.cs +++ b/Source/TAS/TASMod.cs @@ -43,29 +43,7 @@ public static void Update() if (TASControls.SimplifiedGraphics.ConsumePress()) { - Save.Instance.SimplifiedGraphics = !Save.Instance.SimplifiedGraphics; - Save.Instance.SyncSettings(); - - if (Game.Scene is World world) - { - world.Camera.FarPlane = Save.Instance.SimplifiedGraphics ? 8000 : 800; - - foreach (var actor in world.Actors) - { - var fields = actor.GetType().GetFields() - .Where(f => f.FieldType.IsAssignableTo(typeof(Model))); - - foreach (var field in fields) - { - var model = (Model) field.GetValue(actor)!; - foreach (var material in model.Materials) - { - if (material.Shader == null || !Assets.Shaders.ContainsKey(material.Shader.Name)) continue; - material.Simplified = Save.Instance.SimplifiedGraphics; - } - } - } - } + Save.Instance.ToggleSimplifiedGraphics(); } if (TASControls.Hitboxes.ConsumePress())