From d6fe54ee79c1d0ca855559f5f7442793aa949baa Mon Sep 17 00:00:00 2001 From: Kolo <67389779+JustKolosaki@users.noreply.github.com> Date: Wed, 2 Jul 2025 20:31:10 +0200 Subject: [PATCH] gyafyhaswguhyshbughsd --- source/funkin/data/song/SongData.hx | 11 ++------- source/funkin/save/Save.hx | 24 +++++++++++++++++++ .../ui/debug/charting/ChartEditorState.hx | 18 +++++++++++++- .../components/ChartEditorNoteSprite.hx | 23 +++++++++++++++++- 4 files changed, 65 insertions(+), 11 deletions(-) diff --git a/source/funkin/data/song/SongData.hx b/source/funkin/data/song/SongData.hx index 522463ca1..565b362ea 100644 --- a/source/funkin/data/song/SongData.hx +++ b/source/funkin/data/song/SongData.hx @@ -1120,16 +1120,9 @@ class SongNoteDataRaw implements ICloneable public function buildTooltip():String { - var result:String = "Kind: "; - - if ((this.kind?.length ?? 0) == 0) - { - result += "Default"; - return result; - } - - result += this.kind; + if ((this.kind?.length ?? 0) == 0) return ""; + var result:String = 'Kind: ${this.kind}'; if (this.params.length == 0) return result; result += "\nParams:"; diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index c19c11af7..e77daa9b5 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -187,6 +187,7 @@ class Save theme: ChartEditorTheme.Light, playtestStartTime: false, downscroll: false, + showNoteKinds: true, metronomeVolume: 1.0, hitsoundVolumePlayer: 1.0, hitsoundVolumeOpponent: 1.0, @@ -358,6 +359,23 @@ class Save return data.optionsChartEditor.downscroll; } + public var chartEditorShowNoteKinds(get, set):Bool; + + function get_chartEditorShowNoteKinds():Bool + { + if (data.optionsChartEditor.showNoteKinds == null) data.optionsChartEditor.showNoteKinds = true; + + return data.optionsChartEditor.showNoteKinds; + } + + function set_chartEditorShowNoteKinds(value:Bool):Bool + { + // Set and apply. + data.optionsChartEditor.showNoteKinds = value; + flush(); + return data.optionsChartEditor.showNoteKinds; + } + public var chartEditorPlaytestStartTime(get, set):Bool; function get_chartEditorPlaytestStartTime():Bool @@ -1842,6 +1860,12 @@ typedef SaveDataChartEditorOptions = */ var ?downscroll:Bool; + /** + * Show Note Kind Indicator in the Chart Editor. + * @default `true` + */ + var ?showNoteKinds:Bool; + /** * Metronome volume in the Chart Editor. * @default `1.0` diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 6d70adcee..14dc92afe 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -634,6 +634,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return isViewDownscroll; } + /** + * Whether to show an indicator if a note is of a non-default kind. + */ + var showNoteKindIndicators:Bool = false; + /** * The current theme used by the editor. * Dictates the appearance of many UI elements. @@ -1858,6 +1863,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState */ var menubarItemDownscroll:MenuCheckBox; + /** + * The `View -> Note Kind Indicator` menu item. + */ + var menubarItemViewIndicators:MenuCheckBox; + /** * The `View -> Increase Difficulty` menu item. */ @@ -2361,6 +2371,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState noteSnapQuantIndex = save.chartEditorNoteQuant; currentLiveInputStyle = save.chartEditorLiveInputStyle; isViewDownscroll = save.chartEditorDownscroll; + showNoteKindIndicators = save.chartEditorShowNoteKinds; playtestStartTime = save.chartEditorPlaytestStartTime; currentTheme = save.chartEditorTheme; metronomeVolume = save.chartEditorMetronomeVolume; @@ -2390,6 +2401,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState save.chartEditorNoteQuant = noteSnapQuantIndex; save.chartEditorLiveInputStyle = currentLiveInputStyle; save.chartEditorDownscroll = isViewDownscroll; + save.chartEditorShowNoteKinds = showNoteKindIndicators; save.chartEditorPlaytestStartTime = playtestStartTime; save.chartEditorTheme = currentTheme; save.chartEditorMetronomeVolume = metronomeVolume; @@ -3092,6 +3104,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemDownscroll.onClick = event -> isViewDownscroll = event.value; menubarItemDownscroll.selected = isViewDownscroll; + menubarItemViewIndicators.onClick = event -> showNoteKindIndicators = menubarItemViewIndicators.selected; + menubarItemViewIndicators.selected = showNoteKindIndicators; + menubarItemDifficultyUp.onClick = _ -> incrementDifficulty(1); menubarItemDifficultyDown.onClick = _ -> incrementDifficulty(-1); @@ -6313,7 +6328,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { currentScrollEase = Math.max(0, targetScrollPosition); currentScrollEase = Math.min(currentScrollEase, songLengthInPixels); - scrollPositionInPixels = MathUtil.snap(MathUtil.smoothLerpPrecision(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION, 1 / 1000), currentScrollEase, 1 / 1000); + scrollPositionInPixels = MathUtil.snap(MathUtil.smoothLerpPrecision(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION, + 1 / 1000), currentScrollEase, 1 / 1000); moveSongToScrollPosition(); } diff --git a/source/funkin/ui/debug/charting/components/ChartEditorNoteSprite.hx b/source/funkin/ui/debug/charting/components/ChartEditorNoteSprite.hx index d735d832c..de03dde59 100644 --- a/source/funkin/ui/debug/charting/components/ChartEditorNoteSprite.hx +++ b/source/funkin/ui/debug/charting/components/ChartEditorNoteSprite.hx @@ -1,5 +1,7 @@ package funkin.ui.debug.charting.components; +import flixel.text.FlxText; +import flixel.util.FlxColor; import flixel.FlxObject; import flixel.FlxSprite; import flixel.graphics.frames.FlxFramesCollection; @@ -69,6 +71,11 @@ class ChartEditorNoteSprite extends FlxSprite public var isGhost:Bool = false; public var tooltip:ToolTipRegionOptions; + /** + * An indicator if the note is a note kind different than Default (""). + */ + public var kindIndicator:FlxText = new FlxText(5, 5, 100, '*', 16); + public function new(parent:ChartEditorState, isGhost:Bool = false) { super(); @@ -97,6 +104,8 @@ class ChartEditorNoteSprite extends FlxSprite { addNoteStyleAnimations(fetchNoteStyle(entry)); } + + kindIndicator.setFormat("VCR OSD Mono", 24, FlxColor.YELLOW, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); } static var noteFrameCollection:Null = null; @@ -219,7 +228,7 @@ class ChartEditorNoteSprite extends FlxSprite // No tooltip for ghost sprites. if (this.isGhost) return; - if (this.noteData == null) + if (this.noteData == null || (this.tooltip.tipData?.text ?? "").length == 0) { // Disable the tooltip. ToolTipManager.instance.unregisterTooltipRegion(this.tooltip); @@ -237,6 +246,18 @@ class ChartEditorNoteSprite extends FlxSprite } } + override public function draw() + { + super.draw(); + + if (!parentState.showNoteKindIndicators) return; + if ((this.noteData?.kind ?? "").length == 0) return; // Do not render the note kind indicator if the note kind is default. + + kindIndicator.x = this.x; + kindIndicator.y = this.y; + kindIndicator.draw(); + } + function get_noteStyle():Null { if (this.noteStyle == null)