From d40d86303f33140d410cc4fe3861f1cc8846e4cf Mon Sep 17 00:00:00 2001 From: AwesomeMario128 / Tran Fox <22718078+Tran-Foxxo@users.noreply.github.com> Date: Tue, 16 Jun 2020 00:46:46 -0400 Subject: [PATCH] Update to 6/16/20 - Build 1 --- Changelogs/6-16-20 - Build 1.md | 3 +++ src/Editor.cs | 2 +- src/Game/Timeline.cs | 2 ++ src/IO/TRKLoader.cs | 14 ++++++++++++++ src/Program.cs | 2 +- src/UI/Dialogs/ChangelogWindow.cs | 11 +++++++++-- version | 2 +- 7 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 Changelogs/6-16-20 - Build 1.md diff --git a/Changelogs/6-16-20 - Build 1.md b/Changelogs/6-16-20 - Build 1.md new file mode 100644 index 00000000..677c7e49 --- /dev/null +++ b/Changelogs/6-16-20 - Build 1.md @@ -0,0 +1,3 @@ +# Changelog for 6/16/20 - Build 1 + +* Fixed a issue where the Gravity Well size was not being set when loading a new track. \ No newline at end of file diff --git a/src/Editor.cs b/src/Editor.cs index eae014dd..70867601 100644 --- a/src/Editor.cs +++ b/src/Editor.cs @@ -162,7 +162,7 @@ public double GravityWellSize _track.GravityWellSize = value; Stop(); Reset(); - StandardLine.Zone = value; + StandardLine.Zone = _track.GravityWellSize; _renderer.RefreshTrack(_track); } } diff --git a/src/Game/Timeline.cs b/src/Game/Timeline.cs index f584b278..ed5c89ca 100644 --- a/src/Game/Timeline.cs +++ b/src/Game/Timeline.cs @@ -109,6 +109,8 @@ public void Restart(Rider state, float zoom) Constants.StaticTriggerLineColorChange = Color.FromArgb(255, _track.LineColorR, _track.LineColorG, _track.LineColorB); //Set Gravity RiderConstants.Gravity = new Vector2d(0.175 * _track.XGravity, 0.175 * _track.YGravity); //gravity + //Set Gravity well size + StandardLine.Zone = _track.GravityWellSize; using (changesync.AcquireWrite()) { diff --git a/src/IO/TRKLoader.cs b/src/IO/TRKLoader.cs index 952bdc60..1f953519 100644 --- a/src/IO/TRKLoader.cs +++ b/src/IO/TRKLoader.cs @@ -38,6 +38,17 @@ private static float ParseFloat(string f) "Unable to parse string into float"); return ret; } + private static double ParseDouble(string f) + { + if (!double.TryParse( + f, + NumberStyles.Float, + Program.Culture, + out double ret)) + throw new TrackIO.TrackLoadException( + "Unable to parse string into double"); + return ret; + } private static int ParseInt(string f) { if (!int.TryParse( @@ -66,6 +77,9 @@ private static void ParseMetadata(Track ret, BinaryReader br) case TrackMetadata.xgravity: ret.XGravity = ParseFloat(metadata[1]); break; + case TrackMetadata.gravitywellsize: + ret.GravityWellSize = ParseDouble(metadata[1]); + break; case TrackMetadata.bgcolorR: ret.BGColorR = ParseInt(metadata[1]); break; diff --git a/src/Program.cs b/src/Program.cs index 15ebb181..d096593b 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -36,7 +36,7 @@ public static class Program #endif public static string BinariesFolder = "bin"; public readonly static CultureInfo Culture = new CultureInfo("en-US"); - public static string Version = "6/15/20 - Build 1"; + public static string Version = "6/16/20 - Build 1"; public static string TestVersion = ""; public static string NewVersion = null; public static readonly string WindowTitle = "Line Rider: Advanced (Tran\'s fork) " + Version + TestVersion; diff --git a/src/UI/Dialogs/ChangelogWindow.cs b/src/UI/Dialogs/ChangelogWindow.cs index c695c395..6410c24c 100644 --- a/src/UI/Dialogs/ChangelogWindow.cs +++ b/src/UI/Dialogs/ChangelogWindow.cs @@ -16,8 +16,11 @@ public ChangelogWindow(GameCanvas parent, Editor editor) : base(parent, editor) { Title = "Changelog for " + Program.Version; AutoSizeToContents = false; + SetSize(1100, 380); - var changelogText = "* Crashes due to invalid settings files are now resolved (again because I did it wrong last update).\n" + + var changelogText = "" + + "6/15/20 - Build 1\n" + + "* Crashes due to invalid settings files are now resolved (again because I did it wrong last update).\n" + "* Default save format settings are now available for crash backups `Settings -> Other`.\n" + "* Crash Backups now save in the format `## Crash Backup month.day.year_hours.minutes.filetype`.\n" + "* Fixed a issue where autosaves and quicksaves were saved as `## XXXXsave_day.month.year_hours.minutes.filetype`, not `## XXXXsave_month.day.year_hours.minutes.filetype`.\n" + @@ -32,6 +35,11 @@ public ChangelogWindow(GameCanvas parent, Editor editor) : base(parent, editor) "--* Also custom Gravity Well sizes will modify the box Bosh uses to check for collisions, use the Debug Grid to see this change. \n" + "----* The grid is not accurate on the first frame, this is a bug.\n" + "\n" + + "================================================================================================================================\n" + + "\n" + + "6/16/20 - Build 1\n"+ + "* Fixed a issue where the Gravity Well size was not being set when loading a new track.\n" + + "\n" + "NOTE: Discord is *still* auto disabled on startup for now until I reimplement it in a more stable way."; ControlBase bottomcontainer = new ControlBase(this) @@ -109,7 +117,6 @@ public ChangelogWindow(GameCanvas parent, Editor editor) : base(parent, editor) l.AddText(changelogText, Skin.Colors.Text.Foreground); MakeModal(true); DisableResizing(); - SetSize(1100, 300); } private void CreateLabeledControl(ControlBase parent, string label, ControlBase control) diff --git a/version b/version index 15a2bfc9..51b940a8 100644 --- a/version +++ b/version @@ -1 +1 @@ -6/15/20 - Build 1 \ No newline at end of file +6/16/20 - Build 1 \ No newline at end of file