Skip to content

Commit 888417a

Browse files
KoloInDaCribAbnormalPoof
authored andcommitted
gyafyhaswguhyshbughsd
1 parent 3ed6202 commit 888417a

File tree

5 files changed

+66
-12
lines changed

5 files changed

+66
-12
lines changed

source/funkin/data/song/SongData.hx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,16 +1120,9 @@ class SongNoteDataRaw implements ICloneable<SongNoteDataRaw>
11201120

11211121
public function buildTooltip():String
11221122
{
1123-
var result:String = "Kind: ";
1124-
1125-
if ((this.kind?.length ?? 0) == 0)
1126-
{
1127-
result += "Default";
1128-
return result;
1129-
}
1130-
1131-
result += this.kind;
1123+
if ((this.kind?.length ?? 0) == 0) return "";
11321124

1125+
var result:String = 'Kind: ${this.kind}';
11331126
if (this.params.length == 0) return result;
11341127

11351128
result += "\nParams:";

source/funkin/save/Save.hx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class Save
187187
theme: ChartEditorTheme.Light,
188188
playtestStartTime: false,
189189
downscroll: false,
190+
showNoteKinds: true,
190191
metronomeVolume: 1.0,
191192
hitsoundVolumePlayer: 1.0,
192193
hitsoundVolumeOpponent: 1.0,
@@ -358,6 +359,23 @@ class Save
358359
return data.optionsChartEditor.downscroll;
359360
}
360361

362+
public var chartEditorShowNoteKinds(get, set):Bool;
363+
364+
function get_chartEditorShowNoteKinds():Bool
365+
{
366+
if (data.optionsChartEditor.showNoteKinds == null) data.optionsChartEditor.showNoteKinds = true;
367+
368+
return data.optionsChartEditor.showNoteKinds;
369+
}
370+
371+
function set_chartEditorShowNoteKinds(value:Bool):Bool
372+
{
373+
// Set and apply.
374+
data.optionsChartEditor.showNoteKinds = value;
375+
flush();
376+
return data.optionsChartEditor.showNoteKinds;
377+
}
378+
361379
public var chartEditorPlaytestStartTime(get, set):Bool;
362380

363381
function get_chartEditorPlaytestStartTime():Bool
@@ -1844,6 +1862,12 @@ typedef SaveDataChartEditorOptions =
18441862
*/
18451863
var ?downscroll:Bool;
18461864

1865+
/**
1866+
* Show Note Kind Indicator in the Chart Editor.
1867+
* @default `true`
1868+
*/
1869+
var ?showNoteKinds:Bool;
1870+
18471871
/**
18481872
* Metronome volume in the Chart Editor.
18491873
* @default `1.0`

source/funkin/ui/debug/charting/ChartEditorState.hx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
634634
return isViewDownscroll;
635635
}
636636

637+
/**
638+
* Whether to show an indicator if a note is of a non-default kind.
639+
*/
640+
var showNoteKindIndicators:Bool = false;
641+
637642
/**
638643
* The current theme used by the editor.
639644
* Dictates the appearance of many UI elements.
@@ -1858,6 +1863,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
18581863
*/
18591864
var menubarItemDownscroll:MenuCheckBox;
18601865

1866+
/**
1867+
* The `View -> Note Kind Indicator` menu item.
1868+
*/
1869+
var menubarItemViewIndicators:MenuCheckBox;
1870+
18611871
/**
18621872
* The `View -> Increase Difficulty` menu item.
18631873
*/
@@ -2361,6 +2371,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
23612371
noteSnapQuantIndex = save.chartEditorNoteQuant;
23622372
currentLiveInputStyle = save.chartEditorLiveInputStyle;
23632373
isViewDownscroll = save.chartEditorDownscroll;
2374+
showNoteKindIndicators = save.chartEditorShowNoteKinds;
23642375
playtestStartTime = save.chartEditorPlaytestStartTime;
23652376
currentTheme = save.chartEditorTheme;
23662377
metronomeVolume = save.chartEditorMetronomeVolume;
@@ -2390,6 +2401,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
23902401
save.chartEditorNoteQuant = noteSnapQuantIndex;
23912402
save.chartEditorLiveInputStyle = currentLiveInputStyle;
23922403
save.chartEditorDownscroll = isViewDownscroll;
2404+
save.chartEditorShowNoteKinds = showNoteKindIndicators;
23932405
save.chartEditorPlaytestStartTime = playtestStartTime;
23942406
save.chartEditorTheme = currentTheme;
23952407
save.chartEditorMetronomeVolume = metronomeVolume;
@@ -3092,6 +3104,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
30923104
menubarItemDownscroll.onClick = event -> isViewDownscroll = event.value;
30933105
menubarItemDownscroll.selected = isViewDownscroll;
30943106

3107+
menubarItemViewIndicators.onClick = event -> showNoteKindIndicators = menubarItemViewIndicators.selected;
3108+
menubarItemViewIndicators.selected = showNoteKindIndicators;
3109+
30953110
menubarItemDifficultyUp.onClick = _ -> incrementDifficulty(1);
30963111
menubarItemDifficultyDown.onClick = _ -> incrementDifficulty(-1);
30973112

@@ -6313,7 +6328,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
63136328
{
63146329
currentScrollEase = Math.max(0, targetScrollPosition);
63156330
currentScrollEase = Math.min(currentScrollEase, songLengthInPixels);
6316-
scrollPositionInPixels = MathUtil.snap(MathUtil.smoothLerpPrecision(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION, 1 / 1000), currentScrollEase, 1 / 1000);
6331+
scrollPositionInPixels = MathUtil.snap(MathUtil.smoothLerpPrecision(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION,
6332+
1 / 1000), currentScrollEase, 1 / 1000);
63176333
moveSongToScrollPosition();
63186334
}
63196335

source/funkin/ui/debug/charting/components/ChartEditorNoteSprite.hx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package funkin.ui.debug.charting.components;
22

3+
import flixel.text.FlxText;
4+
import flixel.util.FlxColor;
35
import flixel.FlxObject;
46
import flixel.FlxSprite;
57
import flixel.graphics.frames.FlxFramesCollection;
@@ -69,6 +71,11 @@ class ChartEditorNoteSprite extends FlxSprite
6971
public var isGhost:Bool = false;
7072
public var tooltip:ToolTipRegionOptions;
7173

74+
/**
75+
* An indicator if the note is a note kind different than Default ("").
76+
*/
77+
public var kindIndicator:FlxText = new FlxText(5, 5, 100, '*', 16);
78+
7279
public function new(parent:ChartEditorState, isGhost:Bool = false)
7380
{
7481
super();
@@ -97,6 +104,8 @@ class ChartEditorNoteSprite extends FlxSprite
97104
{
98105
addNoteStyleAnimations(fetchNoteStyle(entry));
99106
}
107+
108+
kindIndicator.setFormat("VCR OSD Mono", 24, FlxColor.YELLOW, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
100109
}
101110

102111
static var noteFrameCollection:Null<FlxFramesCollection> = null;
@@ -219,7 +228,7 @@ class ChartEditorNoteSprite extends FlxSprite
219228
// No tooltip for ghost sprites.
220229
if (this.isGhost) return;
221230

222-
if (this.noteData == null)
231+
if (this.noteData == null || (this.tooltip.tipData?.text ?? "").length == 0)
223232
{
224233
// Disable the tooltip.
225234
ToolTipManager.instance.unregisterTooltipRegion(this.tooltip);
@@ -237,6 +246,18 @@ class ChartEditorNoteSprite extends FlxSprite
237246
}
238247
}
239248

249+
override public function draw()
250+
{
251+
super.draw();
252+
253+
if (!parentState.showNoteKindIndicators) return;
254+
if ((this.noteData?.kind ?? "").length == 0) return; // Do not render the note kind indicator if the note kind is default.
255+
256+
kindIndicator.x = this.x;
257+
kindIndicator.y = this.y;
258+
kindIndicator.draw();
259+
}
260+
240261
function get_noteStyle():Null<String>
241262
{
242263
if (this.noteStyle == null)

0 commit comments

Comments
 (0)