diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 22fccbf09..8a58596b9 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -13,9 +13,24 @@ jobs: steps: - name: ensure git cli is installed run: apt update && apt install sudo git -y - - uses: actions/checkout@v3 - - name: print latest_commit - run: echo ${{ github.sha }} + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + fetch-depth: 0 + token: ${{ secrets.GH_RO_PAT }} + - name: check whether submodules exist + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + + # debug output + echo gh=${{ github.sha }} + echo head=$(git rev-parse HEAD) + echo art=$(git -C art rev-parse HEAD) + echo assets=$(git -C assets rev-parse HEAD) + + # checks if HEAD commit hash in submodules is diff from current repo, and therefore exists + test $(git rev-parse HEAD) != $(git -C art rev-parse HEAD) + test $(git rev-parse HEAD) != $(git -C assets rev-parse HEAD) - id: should_run continue-on-error: true name: check latest commit is less than a day @@ -33,9 +48,10 @@ jobs: apt install sudo git curl unzip -y echo $GITHUB_WORKSPACE git config --global --add safe.directory $GITHUB_WORKSPACE - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' + fetch-depth: 0 token: ${{ secrets.GH_RO_PAT }} - uses: ./.github/actions/setup-haxeshit - name: Build game @@ -56,9 +72,10 @@ jobs: contents: write actions: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' + fetch-depth: 0 token: ${{ secrets.GH_RO_PAT }} - uses: ./.github/actions/setup-haxeshit - name: Make HXCPP cache dir @@ -91,9 +108,10 @@ jobs: # contents: write # actions: write # steps: -# - uses: actions/checkout@v3 +# - uses: actions/checkout@v4 # with: # submodules: 'recursive' +# fetch-depth: 0 # token: ${{ secrets.GH_RO_PAT }} # - uses: ./.github/actions/setup-haxeshit # - name: Run unit tests diff --git a/Project.xml b/Project.xml index 46ba7f155..4c0ffdce7 100644 --- a/Project.xml +++ b/Project.xml @@ -162,10 +162,13 @@ - + + + +
diff --git a/assets b/assets index c6aef3e3e..2dd4ab0eb 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit c6aef3e3e6abc573c75dc5dbc90059ccdb6da83c +Subproject commit 2dd4ab0eb9979422c1c4cb849ebe899b7bf1758a diff --git a/docs/style-guide.md b/docs/style-guide.md index 1131cca2b..4c4e01492 100644 --- a/docs/style-guide.md +++ b/docs/style-guide.md @@ -32,6 +32,10 @@ Example: public function checkSyncError(?targetTime:Float):Float ``` +## Commenting Unused Code + +Do not comment out sections of code that are unused. Keep these snippets elsewhere or remove them. Older chunks of code can be retrieved by referring to the older Git commits, and having large chunks of commented code makes files longer and more confusing to navigate. + ## License Headers Do not include headers specifying code license on individual files in the repo, since the main `LICENSE.md` file covers all of them. diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index f5555b66e..c9039ce40 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -233,6 +233,7 @@ class PauseSubState extends MusicBeatSubState if (PlayStatePlaylist.isStoryMode) { + PlayStatePlaylist.reset(); openSubState(new funkin.ui.transition.StickerSubState(null, STORY)); } else diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index c9512aa93..7d20f4697 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1354,8 +1354,7 @@ class PlayState extends MusicBeatSubState else { // lolol - lime.app.Application.current.window.alert('Nice job, you ignoramus. $id isn\'t a real stage.\nI\'m falling back to the default so the game doesn\'t shit itself.', - 'Stage Error'); + lime.app.Application.current.window.alert('Unable to load stage ${id}, is its data corrupted?.', 'Stage Error'); } } diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 1f8713d4f..1a0f94341 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -19,17 +19,18 @@ import flixel.tweens.FlxEase; import flixel.tweens.FlxTween; import flixel.tweens.misc.VarTween; import flixel.util.FlxColor; -import funkin.ui.mainmenu.MainMenuState; import flixel.util.FlxSort; import flixel.util.FlxTimer; import funkin.audio.visualize.PolygonSpectogram; import funkin.audio.VoicesGroup; import funkin.data.notestyle.NoteStyleRegistry; +import funkin.data.song.SongData.SongCharacterData; import funkin.data.song.SongData.SongChartData; import funkin.data.song.SongData.SongEventData; import funkin.data.song.SongData.SongMetadata; import funkin.data.song.SongData.SongNoteData; import funkin.data.song.SongDataUtils; +import funkin.data.song.SongRegistry; import funkin.input.Cursor; import funkin.input.TurboKeyHandler; import funkin.modding.events.ScriptEvent; @@ -53,6 +54,7 @@ import funkin.save.Save; import funkin.ui.debug.charting.commands.AddEventsCommand; import funkin.ui.debug.charting.commands.AddNotesCommand; import funkin.ui.debug.charting.commands.ChartEditorCommand; +import funkin.ui.debug.charting.commands.ChartEditorCommand; import funkin.ui.debug.charting.commands.CutItemsCommand; import funkin.ui.debug.charting.commands.DeselectAllItemsCommand; import funkin.ui.debug.charting.commands.DeselectItemsCommand; @@ -73,15 +75,21 @@ import funkin.ui.debug.charting.components.ChartEditorEventSprite; import funkin.ui.debug.charting.components.ChartEditorHoldNoteSprite; import funkin.ui.debug.charting.components.ChartEditorNotePreview; import funkin.ui.debug.charting.components.ChartEditorNoteSprite; +import funkin.ui.debug.charting.components.ChartEditorPlaybarHead; import funkin.ui.debug.charting.components.ChartEditorSelectionSquareSprite; +import funkin.ui.debug.charting.handlers.ChartEditorShortcutHandler; import funkin.ui.haxeui.components.CharacterPlayer; import funkin.ui.haxeui.HaxeUIState; +import funkin.ui.mainmenu.MainMenuState; import funkin.util.Constants; +import funkin.util.FileUtil; import funkin.util.SortUtil; import funkin.util.WindowUtil; import haxe.DynamicAccess; import haxe.io.Bytes; import haxe.io.Path; +import haxe.ui.backend.flixel.UIRuntimeState; +import haxe.ui.backend.flixel.UIState; import haxe.ui.components.DropDown; import haxe.ui.components.Label; import haxe.ui.components.NumberStepper; @@ -90,16 +98,18 @@ import haxe.ui.components.TextField; import haxe.ui.containers.dialogs.CollapsibleDialog; import haxe.ui.containers.Frame; import haxe.ui.containers.menus.Menu; +import haxe.ui.containers.menus.MenuBar; import haxe.ui.containers.menus.MenuItem; import haxe.ui.containers.TreeView; import haxe.ui.containers.TreeViewNode; import haxe.ui.core.Component; import haxe.ui.core.Screen; import haxe.ui.events.DragEvent; +import haxe.ui.events.MouseEvent; +import haxe.ui.events.UIEvent; import haxe.ui.events.UIEvent; import haxe.ui.focus.FocusManager; import openfl.display.BitmapData; -import funkin.util.FileUtil; using Lambda; @@ -107,24 +117,22 @@ using Lambda; * A state dedicated to allowing the user to create and edit song charts. * Built with HaxeUI for use by both developers and modders. * - * Some functionality is moved to other classes to help maintain my sanity. + * Some functionality is split into handler classes to help maintain my sanity. * * @author MasterEric */ -@:nullSafety -class ChartEditorState extends HaxeUIState +// @:nullSafety + +@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/main-view.xml")) +class ChartEditorState extends UIState // UIState derives from MusicBeatState { /** * CONSTANTS */ // ============================== - // XML Layouts - public static final CHART_EDITOR_LAYOUT:String = Paths.ui('chart-editor/main-view'); - - public static final CHART_EDITOR_NOTIFBAR_LAYOUT:String = Paths.ui('chart-editor/components/notifbar'); - public static final CHART_EDITOR_PLAYBARHEAD_LAYOUT:String = Paths.ui('chart-editor/components/playbar-head'); - + // Layouts public static final CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/notedata'); + public static final CHART_EDITOR_TOOLBOX_EVENTDATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/eventdata'); public static final CHART_EDITOR_TOOLBOX_METADATA_LAYOUT:String = Paths.ui('chart-editor/toolbox/metadata'); public static final CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT:String = Paths.ui('chart-editor/toolbox/difficulty'); @@ -866,7 +874,8 @@ class ChartEditorState extends HaxeUIState // ============================== /** - * The chill audio track that plays when you open the Chart Editor. + * The chill audio track that plays in the chart editor. + * Plays when the main music is NOT being played. */ var welcomeMusic:FlxSound = new FlxSound(); @@ -1209,6 +1218,110 @@ class ChartEditorState extends HaxeUIState return currentSongMetadata.playData.characters.instrumental = value; } + /** + * HAXEUI COMPONENTS + */ + // ============================== + + /** + * The layout containing the playbar. + * Constructed manually and added to the layout so we can control its position. + */ + var playbarHeadLayout:Null = null; + + // NOTE: All the components below are automatically assigned via HaxeUI macros. + /** + * The menubar at the top of the screen. + */ + // var menubar:MenuBar; + /** + * The `File -> New Chart` menu item. + */ + // var menubarItemNewChart:MenuItem; + /** + * The `File -> Open Chart` menu item. + */ + // var menubarItemOpenChart:MenuItem; + /** + * The `File -> Open Recent` menu. + */ + // var menubarOpenRecent:Menu; + /** + * The `File -> Save Chart` menu item. + */ + // var menubarItemSaveChart:MenuItem; + /** + * The `File -> Save Chart As` menu item. + */ + // var menubarItemSaveChartAs:MenuItem; + /** + * The `File -> Preferences` menu item. + */ + // var menubarItemPreferences:MenuItem; + /** + * The `File -> Exit` menu item. + */ + // var menubarItemExit:MenuItem; + /** + * The `Edit -> Undo` menu item. + */ + // var menubarItemUndo:MenuItem; + /** + * The `Edit -> Redo` menu item. + */ + // var menubarItemRedo:MenuItem; + /** + * The `Edit -> Cut` menu item. + */ + // var menubarItemCut:MenuItem; + /** + * The `Edit -> Copy` menu item. + */ + // var menubarItemCopy:MenuItem; + /** + * The `Edit -> Paste` menu item. + */ + // var menubarItemPaste:MenuItem; + /** + * The `Edit -> Paste Unsnapped` menu item. + */ + // var menubarItemPasteUnsnapped:MenuItem; + /** + * The `Edit -> Delete` menu item. + */ + // var menubarItemDelete:MenuItem; + /** + * The label by the playbar telling the song position. + */ + // var playbarSongPos:Label; + /** + * The label by the playbar telling the song time remaining. + */ + // var playbarSongRemaining:Label; + /** + * The label by the playbar telling the note snap. + */ + // var playbarNoteSnap:Label; + /** + * The button by the playbar to jump to the start of the song. + */ + // var playbarStart:Button; + /** + * The button by the playbar to jump backwards in the song. + */ + // var playbarBack:Button; + /** + * The button by the playbar to play or pause the song. + */ + // var playbarPlay:Button; + /** + * The button by the playbar to jump forwards in the song. + */ + // var playbarForward:Button; + /** + * The button by the playbar to jump to the end of the song. + */ + // var playbarEnd:Button; /** * RENDER OBJECTS */ @@ -1298,41 +1411,6 @@ class ChartEditorState extends HaxeUIState */ var menuBG:Null = null; - /** - * The layout containing the playbar head slider. - */ - var playbarHeadLayout:Null = null; - - /** - * The submenu in the menubar containing recently opened files. - */ - var menubarOpenRecent:Null = null; - - /** - * The item in the menubar to save the currently opened chart. - */ - var menubarItemSaveChart:Null = null; - - /** - * The playbar head slider. - */ - var playbarHead:Null = null; - - /** - * The label by the playbar telling the song position. - */ - var playbarSongPos:Null