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 a88cfa4c2..d2a2327bb 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit a88cfa4c2eb3d4b8fc0bb0f7770d6a8359755bb4 +Subproject commit d2a2327bb1eb04a1aa07d7340201f42217829005 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/docs/troubleshooting.md b/docs/troubleshooting.md index 26958a467..27208689b 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -1,6 +1,12 @@ # Troubleshooting Common Issues - Weird macro error with a very tall call stack: Restart Visual Studio Code + - NOTE: This is caused by Polymod somewhere, and seems to only occur when there is another compile error somewhere in the program. There is a bounty up for it. + - `Get Thread Context Failed`: Turn off other expensive applications while building + - `Type not found: T1`: This is thrown by `json2object`, make sure the data type of `@:default` is correct. - NOTE: `flixel.util.typeLimit.OneOfTwo` isn't supported. + +- `Class lists not properly generated. Try cleaning out your export folder, restarting your IDE, and rebuilding your project.` + - This is a bug specific to HTML5. Simply perform the steps listed (don't forget to restart the IDE too). diff --git a/hmm.json b/hmm.json index 593011448..57c9378aa 100644 --- a/hmm.json +++ b/hmm.json @@ -11,7 +11,7 @@ "name": "flixel", "type": "git", "dir": null, - "ref": "8437a86aa5dafdb3f5dcb91d212cb10a4ee6e53b", + "ref": "da04cbda49a4c5eebe93fb61296dbaf4f0f1b556", "url": "https://github.com/EliteMasterEric/flixel" }, { @@ -49,7 +49,7 @@ "name": "haxeui-core", "type": "git", "dir": null, - "ref": "bfdb49886f256a8c37edfc4f46586727d68e2756", + "ref": "91ed8d7867c52af5ea2a9513204057d69ab33c8e", "url": "https://github.com/haxeui/haxeui-core" }, { @@ -144,7 +144,7 @@ "name": "polymod", "type": "git", "dir": null, - "ref": "e8a07b81e3bc535238ad8649e38f5d43c46f1b65", + "ref": "80d1d309803c1b111866524f9769325e3b8b0b1b", "url": "https://github.com/larsiusprime/polymod" }, { diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 10bf505f0..b8ded63da 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -35,15 +35,15 @@ class Conductor static var timeChanges:Array = []; /** - * The current time change. + * The most recent time change for the current song position. */ - static var currentTimeChange:SongTimeChange; + public static var currentTimeChange(default, null):SongTimeChange; /** * The current position in the song in milliseconds. - * Updated every frame based on the audio position. + * Update this every frame based on the audio position using `Conductor.update()`. */ - public static var songPosition:Float = 0; + public static var songPosition(default, null):Float = 0; /** * Beats per minute of the current song at the current time. 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 e17aee6f2..9f0a8f2b2 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1375,8 +1375,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 6840fa091..b8b7b3bea 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