From e157c23ea75c6ea6b49d2f2fcad53e7d528c43fb Mon Sep 17 00:00:00 2001 From: EliteMasterEric <ericmyllyoja@gmail.com> Date: Wed, 30 Aug 2023 02:24:35 -0400 Subject: [PATCH] Apply @:nullSafety to chart editor classes. --- .../ui/debug/charting/ChartEditorCommand.hx | 16 ++++++++++++++++ .../debug/charting/ChartEditorDialogHandler.hx | 1 + .../ui/debug/charting/ChartEditorEventSprite.hx | 1 + .../debug/charting/ChartEditorHoldNoteSprite.hx | 1 + .../ui/debug/charting/ChartEditorNotePreview.hx | 1 + .../ui/debug/charting/ChartEditorNoteSprite.hx | 1 + .../ui/debug/charting/ChartEditorThemeHandler.hx | 1 + 7 files changed, 22 insertions(+) diff --git a/source/funkin/ui/debug/charting/ChartEditorCommand.hx b/source/funkin/ui/debug/charting/ChartEditorCommand.hx index fd179c481..5b2fb6053 100644 --- a/source/funkin/ui/debug/charting/ChartEditorCommand.hx +++ b/source/funkin/ui/debug/charting/ChartEditorCommand.hx @@ -35,6 +35,7 @@ interface ChartEditorCommand public function toString():String; } +@:nullSafety class AddNotesCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -98,6 +99,7 @@ class AddNotesCommand implements ChartEditorCommand } } +@:nullSafety class RemoveNotesCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -153,6 +155,7 @@ class RemoveNotesCommand implements ChartEditorCommand /** * Appends one or more items to the selection. */ +@:nullSafety class SelectItemsCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -220,6 +223,7 @@ class SelectItemsCommand implements ChartEditorCommand } } +@:nullSafety class AddEventsCommand implements ChartEditorCommand { var events:Array<SongEventData>; @@ -278,6 +282,7 @@ class AddEventsCommand implements ChartEditorCommand } } +@:nullSafety class RemoveEventsCommand implements ChartEditorCommand { var events:Array<SongEventData>; @@ -327,6 +332,7 @@ class RemoveEventsCommand implements ChartEditorCommand } } +@:nullSafety class RemoveItemsCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -385,6 +391,7 @@ class RemoveItemsCommand implements ChartEditorCommand } } +@:nullSafety class SwitchDifficultyCommand implements ChartEditorCommand { var prevDifficulty:String; @@ -424,6 +431,7 @@ class SwitchDifficultyCommand implements ChartEditorCommand } } +@:nullSafety class DeselectItemsCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -478,6 +486,7 @@ class DeselectItemsCommand implements ChartEditorCommand * Sets the selection rather than appends it. * Deselects any notes that are not in the new selection. */ +@:nullSafety class SetItemSelectionCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -518,6 +527,7 @@ class SetItemSelectionCommand implements ChartEditorCommand } } +@:nullSafety class SelectAllItemsCommand implements ChartEditorCommand { var previousNoteSelection:Array<SongNoteData>; @@ -553,6 +563,7 @@ class SelectAllItemsCommand implements ChartEditorCommand } } +@:nullSafety class InvertSelectedItemsCommand implements ChartEditorCommand { var previousNoteSelection:Array<SongNoteData>; @@ -587,6 +598,7 @@ class InvertSelectedItemsCommand implements ChartEditorCommand } } +@:nullSafety class DeselectAllItemsCommand implements ChartEditorCommand { var previousNoteSelection:Array<SongNoteData>; @@ -622,6 +634,7 @@ class DeselectAllItemsCommand implements ChartEditorCommand } } +@:nullSafety class CutItemsCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -679,6 +692,7 @@ class CutItemsCommand implements ChartEditorCommand } } +@:nullSafety class FlipNotesCommand implements ChartEditorCommand { var notes:Array<SongNoteData>; @@ -729,6 +743,7 @@ class FlipNotesCommand implements ChartEditorCommand } } +@:nullSafety class PasteItemsCommand implements ChartEditorCommand { var targetTimestamp:Float; @@ -787,6 +802,7 @@ class PasteItemsCommand implements ChartEditorCommand } } +@:nullSafety class ExtendNoteLengthCommand implements ChartEditorCommand { var note:SongNoteData; diff --git a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx index 63dc8bd92..d3160a1a0 100644 --- a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx @@ -40,6 +40,7 @@ using Lambda; /** * Handles dialogs for the new Chart Editor. */ +@:nullSafety class ChartEditorDialogHandler { static final CHART_EDITOR_DIALOG_ABOUT_LAYOUT:String = Paths.ui('chart-editor/dialogs/about'); diff --git a/source/funkin/ui/debug/charting/ChartEditorEventSprite.hx b/source/funkin/ui/debug/charting/ChartEditorEventSprite.hx index 2524f014c..7c0a1e5d7 100644 --- a/source/funkin/ui/debug/charting/ChartEditorEventSprite.hx +++ b/source/funkin/ui/debug/charting/ChartEditorEventSprite.hx @@ -16,6 +16,7 @@ import funkin.play.song.SongData.SongEventData; * A event sprite that can be used to display a song event in a chart. * Designed to be used and reused efficiently. Has no gameplay functionality. */ +@:nullSafety class ChartEditorEventSprite extends FlxSprite { public static final DEFAULT_EVENT = 'Default'; diff --git a/source/funkin/ui/debug/charting/ChartEditorHoldNoteSprite.hx b/source/funkin/ui/debug/charting/ChartEditorHoldNoteSprite.hx index 5805874f6..4d37343ce 100644 --- a/source/funkin/ui/debug/charting/ChartEditorHoldNoteSprite.hx +++ b/source/funkin/ui/debug/charting/ChartEditorHoldNoteSprite.hx @@ -14,6 +14,7 @@ import funkin.play.song.SongData.SongNoteData; * A hold note sprite that can be used to display a note in a chart. * Designed to be used and reused efficiently. Has no gameplay functionality. */ +@:nullSafety class ChartEditorHoldNoteSprite extends SustainTrail { /** diff --git a/source/funkin/ui/debug/charting/ChartEditorNotePreview.hx b/source/funkin/ui/debug/charting/ChartEditorNotePreview.hx index 69655bfe5..be45676f2 100644 --- a/source/funkin/ui/debug/charting/ChartEditorNotePreview.hx +++ b/source/funkin/ui/debug/charting/ChartEditorNotePreview.hx @@ -10,6 +10,7 @@ import flixel.util.FlxSpriteUtil; /** * Handles the note scrollbar preview in the chart editor. */ +@:nullSafety class ChartEditorNotePreview extends FlxSprite { // diff --git a/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx b/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx index 0adbf1a20..f46d4c3fb 100644 --- a/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx +++ b/source/funkin/ui/debug/charting/ChartEditorNoteSprite.hx @@ -11,6 +11,7 @@ import funkin.play.song.SongData.SongNoteData; * A note sprite that can be used to display a note in a chart. * Designed to be used and reused efficiently. Has no gameplay functionality. */ +@:nullSafety class ChartEditorNoteSprite extends FlxSprite { /** diff --git a/source/funkin/ui/debug/charting/ChartEditorThemeHandler.hx b/source/funkin/ui/debug/charting/ChartEditorThemeHandler.hx index 9b1e82df1..e0ef33158 100644 --- a/source/funkin/ui/debug/charting/ChartEditorThemeHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorThemeHandler.hx @@ -20,6 +20,7 @@ enum ChartEditorTheme /** * Static functions which handle building themed UI elements for a provided ChartEditorState. */ +@:nullSafety class ChartEditorThemeHandler { // TODO: There's probably a better system of organization for these colors.