From ea2bb3d9b27f7bd7f84610cee6765cdb2e8feb91 Mon Sep 17 00:00:00 2001 From: ImAxel0 Date: Sun, 16 Jun 2024 09:57:10 +0200 Subject: [PATCH] v1.2.1 - Increased note blocks roundness - Note blocks roundness can be personalized in the settings window - Added black border on note blocks when glowing effect is turned off to improve notes separation - Pan button is now middle mouse when in edit mode to avoid conflict with right mouse button - Minor changes --- Openthesia/ScreenCanvas.cs | 8 +++++--- Openthesia/Settings.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Openthesia/ScreenCanvas.cs b/Openthesia/ScreenCanvas.cs index 05c31ce..6fa4fdd 100644 --- a/Openthesia/ScreenCanvas.cs +++ b/Openthesia/ScreenCanvas.cs @@ -29,6 +29,7 @@ public class ScreenCanvas private static bool _isRectMode; private static bool _isRightRect; private static bool _isHoveringTextBtn; + private static bool _isProgressBarHovered; private static float _panVelocity; private static float _fallSpeed = 2f; @@ -307,7 +308,7 @@ private static void DrawPlaybackNotes() } } - if (IsEditMode) + if (IsEditMode && !_isProgressBarHovered) { if (ImGui.GetIO().KeyCtrl && ImGui.IsMouseDown(ImGuiMouseButton.Left) && !_isRectMode) { @@ -768,14 +769,15 @@ public static void RenderScreen(bool playMode = false) ImGuiTheme.Style.Colors[(int)ImGuiCol.SliderGrab] = Settings.R_HandColor; ImGuiTheme.Style.Colors[(int)ImGuiCol.SliderGrabActive] = Settings.R_HandColor; - if (ImGui.SliderFloat("##Progress slider", ref MidiPlayer.Seconds, 0, (float)MidiFileData.MidiFile.GetDuration().TotalSeconds, "%.1f", + if (ImGui.SliderFloat("##Progress slider", ref MidiPlayer.Seconds, 0, (float)MidiFileData.MidiFile.GetDuration().TotalSeconds, "%.1f", ImGuiSliderFlags.NoRoundToFormat | ImGuiSliderFlags.AlwaysClamp | ImGuiSliderFlags.NoInput)) { long ms = (long)(MidiPlayer.Seconds * 1000000); MidiPlayer.Playback.MoveToTime(new MetricTimeSpan(ms)); MidiPlayer.Timer = MidiPlayer.Seconds * 100 * _fallSpeed; } - if (ImGui.IsItemHovered() && ImGui.IsMouseDragging(ImGuiMouseButton.Left)) + _isProgressBarHovered = ImGui.IsItemHovered(); + if (_isProgressBarHovered && ImGui.IsMouseDragging(ImGuiMouseButton.Left)) { ImGui.SetMouseCursor(ImGuiMouseCursor.ResizeEW); } diff --git a/Openthesia/Settings.cs b/Openthesia/Settings.cs index eca7861..89fa2c5 100644 --- a/Openthesia/Settings.cs +++ b/Openthesia/Settings.cs @@ -37,7 +37,7 @@ public class Settings private static bool _fpsCounter; public static bool FpsCounter { get { return _fpsCounter; } } - private static int _noteRoundness = 5; + private static int _noteRoundness = 7; public static int NoteRoundness { get { return _noteRoundness; } } public static Themes Theme { get; private set; } = Themes.Sky;