From d79b11cc32a8106bb2face3b860ab31fd07859c0 Mon Sep 17 00:00:00 2001 From: Vortex2Oblivion <73261680+Vortex2Oblivion@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:25:16 -0500 Subject: [PATCH] dox but fr this time --- .github/workflows/workflow.yml | 6 +- .gitignore | 4 +- Project.xml | 1 + docs/docs.hxml | 53 +- docs/docs.sh | 2 +- source/modding/SwitchModSubstate.hx | 8 +- source/models/Model.hx | 4 +- source/models/Scene3D.hx | 4 +- source/states/MainMenuState.hx | 3 +- source/states/ModsMenu.hx | 8 +- source/states/OptionsMenu.hx | 9 +- source/states/PlayState.hx | 7 +- source/{tools => toolbox}/CharacterCreator.hx | 2 +- source/{tools => toolbox}/ChartingState.hx | 2 +- source/{tools => toolbox}/StageMakingState.hx | 2 +- .../{tools => }/toolbox/ToolboxPlaceholder.hx | 13 +- source/tools/ChartingStateDev.hx | 605 ------------------ source/tools/toolbox/NewModWizard.hx | 7 - source/tools/toolbox/Toolbox.hx | 130 ---- source/ui/Option.hx | 2 +- 20 files changed, 75 insertions(+), 797 deletions(-) rename source/{tools => toolbox}/CharacterCreator.hx (99%) rename source/{tools => toolbox}/ChartingState.hx (99%) rename source/{tools => toolbox}/StageMakingState.hx (99%) rename source/{tools => }/toolbox/ToolboxPlaceholder.hx (95%) delete mode 100644 source/tools/ChartingStateDev.hx delete mode 100644 source/tools/toolbox/NewModWizard.hx delete mode 100644 source/tools/toolbox/Toolbox.hx diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0461239072..2003be89a1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -46,6 +46,7 @@ jobs: haxelib git scriptless-polymod https://github.com/swordcube/scriptless-polymod haxelib install hxvlc haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc + haxelib install dox haxelib git flixelTextureAtlas https://github.com/Smokey555/Flixel-TextureAtlas.git haxelib git fnf-modcharting-tools https://github.com/EdwhakKB/FNF-Modcharting-Tools haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate @@ -97,6 +98,7 @@ jobs: haxelib git hscript-improved https://github.com/FNF-CNE-Devs/hscript-improved haxelib git openfl https://github.com/openfl/openfl haxelib git HxWebView https://github.com/Vortex2Oblivion/HxWebView + haxelib install dox haxelib git flixelTextureAtlas https://github.com/Smokey555/Flixel-TextureAtlas.git haxelib git fnf-modcharting-tools https://github.com/EdwhakKB/FNF-Modcharting-Tools haxelib install flixel-screenshot-plugin @@ -144,7 +146,8 @@ jobs: haxelib install away3d haxelib git hxNoise https://github.com/whuop/hxNoise haxelib install hxvlc - haxelib git openfl https://github.com/openfl/openfl + haxelib install openfl + haxelib install dox haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc haxelib git flixelTextureAtlas https://github.com/Smokey555/Flixel-TextureAtlas.git haxelib git fnf-modcharting-tools https://github.com/EdwhakKB/FNF-Modcharting-Tools @@ -189,6 +192,7 @@ jobs: haxelib install flixel-ui haxelib install flixel-addons haxelib install systools + haxelib install dox haxelib git linc_luajit https://github.com/Leather128/linc_luajit.git haxelib git hscript-improved https://github.com/FNF-CNE-Devs/hscript-improved haxelib git HxWebView https://github.com/Vortex2Oblivion/HxWebView diff --git a/.gitignore b/.gitignore index 07fb7df88e..e8a4d7d8d3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ export/ art/flashFiles/RECOVER_* crash/export/ .*/ -!.github \ No newline at end of file +!.github +pages/ +docs/doc.xml \ No newline at end of file diff --git a/Project.xml b/Project.xml index 5b0c69b1f6..c367cf631a 100644 --- a/Project.xml +++ b/Project.xml @@ -115,6 +115,7 @@ + diff --git a/docs/docs.hxml b/docs/docs.hxml index 7826784f0d..49e241970f 100644 --- a/docs/docs.hxml +++ b/docs/docs.hxml @@ -1,45 +1,49 @@ -D openfl --D flixel=5.5.0 +-D flixel -D lime --D hscript-improved +-D hscript -D flixel-addons -D flixel-ui +-D hscript-improved -D tjson --D scriptless-polymod +-D hxNoise -D flxanimate -D flixelTextureAtlas --D discord_rpc --D linc_luajit --D flixel-screenshot-plugin +-D scriptless-polymod +-D HxWebView +-D hxcpp-debug-server +-D hxcpp -D away3d +-D linc_luajit -D hxvlc --D HxWebView --D hxNoise -D systools -D fnf-modcharting-tools + + + -L lime -L openfl -L flixel -L hscript-improved +-L flixel-addons +-L hxNoise -L tjson --L scriptless-polymod +-L flixel-ui -L flxanimate -L flixelTextureAtlas --L discord_rpc --L linc_luajit --L flixel-screenshot-plugin +-L scriptless-polymod +-L HxWebView +-L hxcpp-debug-server +-L hxcpp -L away3d +-L linc_luajit -L hxvlc --L HxWebView --L hxNoise -L systools -L fnf-modcharting-tools - - --macro lime._internal.macros.DefineMacro.run() --macro openfl.utils._internal.ExtraParamsMacro.include() --remap flash:openfl @@ -47,17 +51,26 @@ -cp source ---macro include('flx3D') +--define polymod +--define THREE_D_ALLOWED +--define LUA_ALLOWED +--define VIDEOS_ALLOWED +--define LEATHER + + +--macro include('external') --macro include('game') --macro include('modding') ---macro include('models') --macro include('shaders') --macro include('states') --macro include('substates') ---macro include('tools') --macro include('ui') --macro include('utilities') ---macro keep('main') +--macro include('toolbox') +--macro include('models') + + +--macro keep('Main') --no-output diff --git a/docs/docs.sh b/docs/docs.sh index f9caa74363..823934f706 100644 --- a/docs/docs.sh +++ b/docs/docs.sh @@ -1,4 +1,4 @@ #! /bin/sh haxe docs/docs.hxml -haxelib run dox -i docs -o pages --title "Leather Engine Documentation" \ No newline at end of file +haxelib run dox -i docs -o pages --title "Leather Engine Documentation" -ex .*^ -in /* \ No newline at end of file diff --git a/source/modding/SwitchModSubstate.hx b/source/modding/SwitchModSubstate.hx index 5560d3f8cf..a0a0ffe085 100644 --- a/source/modding/SwitchModSubstate.hx +++ b/source/modding/SwitchModSubstate.hx @@ -14,10 +14,10 @@ import utilities.MusicUtilities; import ui.Option; import ui.Checkbox; import flixel.group.FlxGroup; -import tools.ChartingState; -import tools.StageMakingState; +import toolbox.ChartingState; +import toolbox.StageMakingState; import flixel.sound.FlxSound; -import tools.CharacterCreator; +import toolbox.CharacterCreator; import utilities.Controls.Control; import flash.text.TextField; import flixel.FlxG; @@ -31,7 +31,7 @@ import flixel.util.FlxColor; import lime.utils.Assets; import ui.Alphabet; import game.Song; -import tools.StageMakingState; +import toolbox.StageMakingState; import game.Highscore; class SwitchModSubstate extends MusicBeatSubstate diff --git a/source/models/Model.hx b/source/models/Model.hx index f76250bce7..d1c0f70202 100644 --- a/source/models/Model.hx +++ b/source/models/Model.hx @@ -1,3 +1,4 @@ +#if THREE_D_ALLOWED package models; import away3d.entities.Mesh; import away3d.events.Asset3DEvent; @@ -77,4 +78,5 @@ class Model extends FlxView3D { { super.destroy(); } -} \ No newline at end of file +} +#end \ No newline at end of file diff --git a/source/models/Scene3D.hx b/source/models/Scene3D.hx index f6569cd15d..027f138a92 100644 --- a/source/models/Scene3D.hx +++ b/source/models/Scene3D.hx @@ -1,3 +1,4 @@ +#if THREE_D_ALLOWED package models; import away3d.core.base.Geometry; @@ -315,4 +316,5 @@ class Scene3D extends FlxView3D view.scene.addChild(spr3D); return spr3D; } -} \ No newline at end of file +} +#end \ No newline at end of file diff --git a/source/states/MainMenuState.hx b/source/states/MainMenuState.hx index 9e6d6bdf1b..9dec2ff1ef 100644 --- a/source/states/MainMenuState.hx +++ b/source/states/MainMenuState.hx @@ -2,7 +2,6 @@ package states; import modding.scripts.languages.HScript; import flixel.system.debug.interaction.tools.Tool; -import tools.toolbox.Toolbox; import utilities.Options; import flixel.util.FlxTimer; import game.Replay; @@ -297,7 +296,7 @@ class MainMenuState extends MusicBeatState FlxG.switchState(new ReplaySelectorState()); #end case 'toolbox': - FlxG.switchState(new tools.toolbox.ToolboxPlaceholder()); + FlxG.switchState(new toolbox.ToolboxPlaceholder()); } allScriptCall("changeState"); } diff --git a/source/states/ModsMenu.hx b/source/states/ModsMenu.hx index 4af771319e..5c8b49ffa3 100644 --- a/source/states/ModsMenu.hx +++ b/source/states/ModsMenu.hx @@ -12,10 +12,10 @@ import utilities.MusicUtilities; import ui.Option; import ui.Checkbox; import flixel.group.FlxGroup; -import tools.ChartingState; -import tools.StageMakingState; +import toolbox.ChartingState; +import toolbox.StageMakingState; import flixel.sound.FlxSound; -import tools.CharacterCreator; +import toolbox.CharacterCreator; import utilities.Controls.Control; import flash.text.TextField; import flixel.FlxG; @@ -29,7 +29,7 @@ import flixel.util.FlxColor; import lime.utils.Assets; import ui.Alphabet; import game.Song; -import tools.StageMakingState; +import toolbox.StageMakingState; import game.Highscore; class ModsMenu extends MusicBeatState diff --git a/source/states/OptionsMenu.hx b/source/states/OptionsMenu.hx index e1a431c378..04ac1314ce 100644 --- a/source/states/OptionsMenu.hx +++ b/source/states/OptionsMenu.hx @@ -9,10 +9,10 @@ import utilities.MusicUtilities; import ui.Option; import ui.Checkbox; import flixel.group.FlxGroup; -import tools.ChartingState; -import tools.StageMakingState; +import toolbox.ChartingState; +import toolbox.StageMakingState; import flixel.sound.FlxSound; -import tools.CharacterCreator; +import toolbox.CharacterCreator; import utilities.Controls.Control; import flash.text.TextField; import flixel.FlxG; @@ -26,10 +26,9 @@ import flixel.util.FlxColor; import lime.utils.Assets; import ui.Alphabet; import game.Song; -import tools.StageMakingState; +import toolbox.StageMakingState; import game.Highscore; import openfl.utils.Assets as OpenFLAssets; -import tools.ChartingStateDev; class OptionsMenu extends MusicBeatState { var curSelected:Int = 0; diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index ff8a871614..5166d37595 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -27,7 +27,6 @@ import flixel.util.FlxStringUtil; import openfl.display.BitmapData; import flixel.graphics.FlxGraphic; import flixel.system.FlxAssets.FlxShader; -import flixel.addons.display.FlxShaderMaskCamera; import substates.ResultsScreenSubstate; import haxe.Json; import game.Replay; @@ -43,7 +42,7 @@ import utilities.NoteVariables; import flixel.input.FlxInput.FlxInputState; import flixel.group.FlxGroup; import utilities.Ratings; -import tools.ChartingState; +import toolbox.ChartingState; import game.Section.SwagSection; import flixel.FlxBasic; import flixel.FlxCamera; @@ -2942,9 +2941,9 @@ class PlayState extends MusicBeatState { SONG.keyCount = ogKeyCount; SONG.playerKeyCount = ogPlayerKeyCount; - FlxG.switchState(new tools.CharacterCreator(SONG.player2, curStage)); + FlxG.switchState(new toolbox.CharacterCreator(SONG.player2, curStage)); - tools.CharacterCreator.lastState = "PlayState"; + toolbox.CharacterCreator.lastState = "PlayState"; #if discord_rpc DiscordClient.changePresence("Creating A Character", null, null, true); diff --git a/source/tools/CharacterCreator.hx b/source/toolbox/CharacterCreator.hx similarity index 99% rename from source/tools/CharacterCreator.hx rename to source/toolbox/CharacterCreator.hx index 9a7c2892d0..40052bc1b9 100644 --- a/source/tools/CharacterCreator.hx +++ b/source/toolbox/CharacterCreator.hx @@ -1,4 +1,4 @@ -package tools; +package toolbox; #if discord_rpc import utilities.Discord.DiscordClient; diff --git a/source/tools/ChartingState.hx b/source/toolbox/ChartingState.hx similarity index 99% rename from source/tools/ChartingState.hx rename to source/toolbox/ChartingState.hx index 4d60f455ba..4921e804dd 100644 --- a/source/tools/ChartingState.hx +++ b/source/toolbox/ChartingState.hx @@ -1,4 +1,4 @@ -package tools; +package toolbox; import flixel.util.FlxTimer; import flixel.FlxObject; diff --git a/source/tools/StageMakingState.hx b/source/toolbox/StageMakingState.hx similarity index 99% rename from source/tools/StageMakingState.hx rename to source/toolbox/StageMakingState.hx index 9c34616ed7..139755d219 100644 --- a/source/tools/StageMakingState.hx +++ b/source/toolbox/StageMakingState.hx @@ -1,4 +1,4 @@ -package tools; +package toolbox; import flixel.addons.ui.FlxUIInputText; import flixel.addons.ui.FlxUINumericStepper; diff --git a/source/tools/toolbox/ToolboxPlaceholder.hx b/source/toolbox/ToolboxPlaceholder.hx similarity index 95% rename from source/tools/toolbox/ToolboxPlaceholder.hx rename to source/toolbox/ToolboxPlaceholder.hx index 2ff572c963..5f9b7c3806 100644 --- a/source/tools/toolbox/ToolboxPlaceholder.hx +++ b/source/toolbox/ToolboxPlaceholder.hx @@ -1,4 +1,4 @@ -package tools.toolbox; +package toolbox; import states.MainMenuState; import states.MusicBeatState; @@ -12,10 +12,10 @@ import utilities.MusicUtilities; import ui.Option; import ui.Checkbox; import flixel.group.FlxGroup; -import tools.ChartingState; -import tools.StageMakingState; +import toolbox.ChartingState; +import toolbox.StageMakingState; import flixel.sound.FlxSound; -import tools.CharacterCreator; +import toolbox.CharacterCreator; import utilities.Controls.Control; import flash.text.TextField; import flixel.FlxG; @@ -29,10 +29,9 @@ import flixel.util.FlxColor; import lime.utils.Assets; import ui.Alphabet; import game.Song; -import tools.StageMakingState; +import toolbox.StageMakingState; import game.Highscore; import openfl.utils.Assets as OpenFLAssets; -import tools.ChartingStateDev; class ToolboxPlaceholder extends states.MusicBeatState { var curSelected:Int = 0; @@ -163,4 +162,4 @@ class ToolboxPlaceholder extends states.MusicBeatState { } } } -} +} \ No newline at end of file diff --git a/source/tools/ChartingStateDev.hx b/source/tools/ChartingStateDev.hx deleted file mode 100644 index 6ee2ebdab0..0000000000 --- a/source/tools/ChartingStateDev.hx +++ /dev/null @@ -1,605 +0,0 @@ -package tools; - -#if discord_rpc -import utilities.Discord.DiscordClient; -#end -import game.Section.SwagSection; -import flixel.math.FlxMath; -import game.Conductor; -import states.LoadingState; -import game.Song; -import states.PlayState; -import flixel.FlxObject; -import flixel.util.FlxColor; -import flixel.addons.display.FlxGridOverlay; -import flixel.FlxG; -import utilities.CoolUtil; -import lime.utils.Assets; -import ui.HealthIcon; -import flixel.sound.FlxSound; -import game.Note; -import flixel.group.FlxGroup.FlxTypedGroup; -import flixel.FlxSprite; -import game.Song.SwagSong; -import flixel.text.FlxText; -import openfl.net.FileReference; -import states.MusicBeatState; - -using StringTools; - -class ChartingStateDev extends MusicBeatState -{ - // Constants - var Grid_Size:Int = 40; - - // Coolness - var FileRef:FileReference; - var SONG:SwagSong; - - // SONG Variables - var Cur_Section:Int = 0; - var Song_Name:String = "Test"; - var Difficulty:String = 'Normal'; - - var Cur_Mod:String = "default"; - - // UI Shit Lmao - var Info_Text:FlxText; - var Song_Line:FlxSprite; - var Grid_Highlight:FlxSprite; - - var Current_Notes:FlxTypedGroup; - var Current_Sustains:FlxTypedGroup; - - var Note_Grid:FlxSprite; - var Note_Grid_Above:FlxSprite; - var Note_Grid_Below:FlxSprite; - var Note_Grid_Seperator:FlxSprite; - - /* icons lol */ - var P1_Tex:HealthIcon; - var P2_Tex:HealthIcon; - - var Section_Left_Icon:FlxSprite; - var Next_Section_Left_Icon:FlxSprite; - - /* divider between left and right icons lmao */ - var Section_Right_Icon:FlxSprite; - var Next_Section_Right_Icon:FlxSprite; - - /* stop icons lol */ - // Note Variables - var Selected_Note:Array; - var Cur_Note_Char:Int = 0; - - // Other - var Vocal_Track:FlxSound; - - var Character_Lists:Map> = new Map>(); - - var Camera_Object:FlxObject = new FlxObject(); - - var Inst_Track:FlxSound; - - override function create() - { - #if discord_rpc - DiscordClient.changePresence("Charting a song", null, null); - #end - - // FOR WHEN COMING IN FROM THE TOOLS PAGE LOL - if (Assets.getLibrary("shared") == null) - Assets.loadLibrary("shared"); - - var characterList = CoolUtil.coolTextFile(Paths.txt('characterList')); - - for (Text in characterList) - { - var Properties = Text.split(":"); - - var name = Properties[0]; - var mod = Properties[1]; - - var base_array; - - if (Character_Lists.get(mod) != null) - base_array = Character_Lists.get(mod); - else - base_array = []; - - base_array.push(name); - Character_Lists.set(mod, base_array); - } - - if (PlayState.SONG != null) - { - SONG = PlayState.SONG; - SONG.speed = PlayState.previousScrollSpeedLmao; - } - else - SONG = Song.loadFromJson("tutorial", "tutorial"); - - P1_Tex = new HealthIcon(SONG.player1); - P2_Tex = new HealthIcon(SONG.player2); - - FlxG.mouse.visible = true; - - Current_Notes = new FlxTypedGroup(); - Current_Sustains = new FlxTypedGroup(); - - Camera_Object.screenCenter(X); - Camera_Object.y = Grid_Size * 26; - - FlxG.camera.follow(Camera_Object); - - loadSong(SONG.song); - Conductor.changeBPM(SONG.bpm); - Conductor.mapBPMChanges(SONG); - - updateGrid(); - - Info_Text = new FlxText(0, 4, 0, "Time: 0.0 / " + (Inst_Track.length / 1000), 20); - Info_Text.setFormat(null, 20, FlxColor.WHITE, RIGHT); - Info_Text.x = FlxG.width - Info_Text.width; - Info_Text.scrollFactor.set(); - add(Info_Text); - - add(Current_Sustains); - add(Current_Notes); - } - - override function update(elapsed:Float) - { - super.update(elapsed); - - if (FlxG.keys.justPressed.ENTER) - { - FlxG.mouse.visible = false; - PlayState.SONG = SONG; - FlxG.sound.music.stop(); - Vocal_Track.stop(); - LoadingState.loadAndSwitchState(new PlayState()); - } - - if (FlxG.keys.justPressed.SPACE) - { - if (Inst_Track.playing) - { - Inst_Track.pause(); - - if (SONG.needsVoices) - Vocal_Track.pause(); - } - else - { - if (SONG.needsVoices) - Vocal_Track.time = Inst_Track.time; - - Inst_Track.play(); - - if (SONG.needsVoices) - Vocal_Track.play(); - } - } - - if (controls.RESET) - { - Inst_Track.stop(); - - if (SONG.needsVoices) - Vocal_Track.stop(); - } - - var Previous_Y = Camera_Object.y; - var Above_Value = Note_Grid_Above.y + Note_Grid_Above.height; - var Below_Value = Note_Grid_Below.y; - - if (FlxG.mouse.wheel != 0) - { - var Prev_Playing = Inst_Track.playing; - - if (Prev_Playing) - Inst_Track.pause(); - - Inst_Track.time += -1 * (FlxG.mouse.wheel * Grid_Size); - - if (Inst_Track.time < 0) - Inst_Track.time = Inst_Track.length; - - if (Inst_Track.time > Inst_Track.length) - Inst_Track.time = 0; - - if (SONG.needsVoices) - Vocal_Track.time = Inst_Track.time; - - if (Prev_Playing) - { - Inst_Track.play(); - - if (SONG.needsVoices) - Vocal_Track.play(); - } - } - - Camera_Object.y = getYfromStrum((Inst_Track.time - sectionStartTime()) % (Conductor.stepCrochet * SONG.notes[Cur_Section].lengthInSteps)); - - Conductor.songPosition = Inst_Track.time; - - updateCurStep(); - updateSection(); - - Info_Text.text = ("Time: " + (Inst_Track.time / 1000) + " / " + (Inst_Track.length / 1000) + "\n" + "Cur Beat: " + curBeat + "\n" + "Cur Step: " - + curStep + "\n" + "Cur Section: " + Cur_Section + "\n" + "BPM: " + Conductor.bpm + "\n"); - - Info_Text.x = FlxG.width - Info_Text.width; - } - - function cleanupSections() - { - // get rid of bad sections lmao - while (sectionStartTime(SONG.notes.length - 1) >= Inst_Track.length) - SONG.notes.pop(); - } - - function updateGrid() - { - var Next_Section = Cur_Section + 1; - - if (Next_Section > SONG.notes.length - 1) - addSection(SONG.notes[Cur_Section].lengthInSteps); - - if (sectionStartTime(Next_Section) >= Inst_Track.length) - Next_Section = 0; - - cleanupSections(); - - var Prev_Section = Cur_Section - 1; - - if (Prev_Section < 0) - Prev_Section = SONG.notes.length - 1; - - var prev_sectionInfo:Array = SONG.notes[Prev_Section].sectionNotes; - var sectionInfo:Array = SONG.notes[Cur_Section].sectionNotes; - var next_sectionInfo:Array = SONG.notes[Next_Section].sectionNotes; - - if (Note_Grid_Above != null) - { - remove(Note_Grid_Above); - Note_Grid_Above.kill(); - Note_Grid_Above.destroy(); - - remove(Note_Grid); - Note_Grid.kill(); - Note_Grid.destroy(); - - remove(Note_Grid_Below); - Note_Grid_Below.kill(); - Note_Grid_Below.destroy(); - } - - Note_Grid_Above = FlxGridOverlay.create(Grid_Size, Grid_Size, Grid_Size * (SONG.keyCount * 2), Grid_Size * SONG.notes[Prev_Section].lengthInSteps); - - Note_Grid_Above.screenCenter(); - Note_Grid_Above.color = FlxColor.fromRGB(180, 180, 180); - - add(Note_Grid_Above); - - Note_Grid = FlxGridOverlay.create(Grid_Size, Grid_Size, Grid_Size * (SONG.keyCount * 2), Grid_Size * SONG.notes[Cur_Section].lengthInSteps); - - Note_Grid.screenCenter(); - Note_Grid.y = Note_Grid_Above.y + Note_Grid_Above.height; - - add(Note_Grid); - - Note_Grid_Below = FlxGridOverlay.create(Grid_Size, Grid_Size, Grid_Size * (SONG.keyCount * 2), Grid_Size * SONG.notes[Next_Section].lengthInSteps); - - Note_Grid_Below.screenCenter(); - Note_Grid_Below.y = Note_Grid.y + Note_Grid.height; - Note_Grid_Below.color = FlxColor.fromRGB(180, 180, 180); - - add(Note_Grid_Below); - - /* THIS SECTION */ - if (Section_Left_Icon != null) - { - remove(Section_Left_Icon); - Section_Left_Icon.kill(); - Section_Left_Icon.destroy(); - - remove(Section_Right_Icon); - Section_Right_Icon.kill(); - Section_Right_Icon.destroy(); - - remove(Next_Section_Left_Icon); - Next_Section_Left_Icon.kill(); - Next_Section_Left_Icon.destroy(); - - remove(Next_Section_Right_Icon); - Next_Section_Right_Icon.kill(); - Next_Section_Right_Icon.destroy(); - } - - Section_Left_Icon = new FlxSprite(); - Section_Left_Icon.loadGraphicFromSprite((SONG.notes[Cur_Section].mustHitSection ? P1_Tex : P2_Tex)); - Section_Left_Icon.scrollFactor.set(1, 1); - Section_Left_Icon.setGraphicSize(Grid_Size); - Section_Left_Icon.updateHitbox(); - Section_Left_Icon.x = Note_Grid.x - Section_Left_Icon.width; - Section_Left_Icon.y = Note_Grid.y; - Section_Left_Icon.animation.add("char", [0, 1, 2], 0, false, false); - Section_Left_Icon.animation.play("char"); - add(Section_Left_Icon); - - Section_Right_Icon = new FlxSprite(); - Section_Right_Icon.loadGraphicFromSprite((SONG.notes[Cur_Section].mustHitSection ? P2_Tex : P1_Tex)); - Section_Right_Icon.scrollFactor.set(1, 1); - Section_Right_Icon.setGraphicSize(Grid_Size); - Section_Right_Icon.updateHitbox(); - Section_Right_Icon.x = Note_Grid.x + Note_Grid.width; - Section_Right_Icon.y = Note_Grid.y; - Section_Right_Icon.animation.add("char", [0, 1, 2], 0, false, false); - Section_Right_Icon.animation.play("char"); - add(Section_Right_Icon); - - /* NEXT SECTION */ - Next_Section_Left_Icon = new FlxSprite(); - Next_Section_Left_Icon.loadGraphicFromSprite((SONG.notes[Next_Section].mustHitSection ? P1_Tex : P2_Tex)); - Next_Section_Left_Icon.scrollFactor.set(1, 1); - Next_Section_Left_Icon.setGraphicSize(Grid_Size); - Next_Section_Left_Icon.updateHitbox(); - Next_Section_Left_Icon.x = Note_Grid_Below.x - Next_Section_Left_Icon.width; - Next_Section_Left_Icon.y = Note_Grid_Below.y; - Next_Section_Left_Icon.animation.add("char", [0, 1, 2], 0, false, false); - Next_Section_Left_Icon.animation.play("char"); - add(Next_Section_Left_Icon); - - Next_Section_Right_Icon = new FlxSprite(); - Next_Section_Right_Icon.loadGraphicFromSprite((SONG.notes[Next_Section].mustHitSection ? P2_Tex : P1_Tex)); - Next_Section_Right_Icon.scrollFactor.set(1, 1); - Next_Section_Right_Icon.setGraphicSize(Grid_Size); - Next_Section_Right_Icon.updateHitbox(); - Next_Section_Right_Icon.x = Note_Grid_Below.x + Note_Grid_Below.width; - Next_Section_Right_Icon.y = Note_Grid_Below.y; - Next_Section_Right_Icon.animation.add("char", [0, 1, 2], 0, false, false); - Next_Section_Right_Icon.animation.play("char"); - add(Next_Section_Right_Icon); - - /* COOL SHIT */ - if (Note_Grid_Seperator != null) - { - remove(Note_Grid_Seperator); - Note_Grid_Seperator.kill(); - Note_Grid_Seperator.destroy(); - - remove(Song_Line); - Song_Line.kill(); - Song_Line.destroy(); - } - - Note_Grid_Seperator = new FlxSprite(Note_Grid_Above.x + Note_Grid_Above.width / 2, Note_Grid_Above.y); - Note_Grid_Seperator.makeGraphic(2, Std.int(Note_Grid_Above.height + Note_Grid.height + Note_Grid_Below.height), FlxColor.BLACK); - add(Note_Grid_Seperator); - - Song_Line = new FlxSprite(); - Song_Line.makeGraphic(Std.int(Note_Grid.width), 2); - Song_Line.screenCenter(); - Song_Line.scrollFactor.set(); - add(Song_Line); - - Current_Notes.forEach(function(Note:Note) - { - remove(Note); - Note.kill(); - Note.destroy(); - }); - - Current_Sustains.forEach(function(Sustain:FlxSprite) - { - remove(Sustain); - Sustain.kill(); - Sustain.destroy(); - }); - - Current_Notes.clear(); - Current_Sustains.clear(); - - if (SONG.notes[Cur_Section].changeBPM && SONG.notes[Cur_Section].bpm > 0) - { - Conductor.changeBPM(SONG.notes[Cur_Section].bpm); - FlxG.log.add('CHANGED BPM!'); - } - else - { - // get last bpm - var daBPM:Float = SONG.bpm; - - for (i in 0...Cur_Section) - if (SONG.notes[i].changeBPM) - daBPM = SONG.notes[i].bpm; - - Conductor.changeBPM(daBPM); - } - - for (i in prev_sectionInfo) - { - var daNoteInfo = i[1]; - var daStrumTime = i[0]; - var daSus = i[2]; - - var note:Note = new Note(daStrumTime, daNoteInfo % SONG.keyCount); - note.sustainLength = daSus; - - note.setGraphicSize(Grid_Size, Grid_Size); - note.updateHitbox(); - - note.x = Note_Grid.x + Math.floor(daNoteInfo * Grid_Size); - note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime(Prev_Section)) % (Conductor.stepCrochet * SONG.notes[Prev_Section].lengthInSteps), - Note_Grid_Above)); - - note.rawNoteData = daNoteInfo; - - Current_Notes.add(note); - - if (daSus > 0) - { - var sustainVis:FlxSprite = new FlxSprite(note.x + (Grid_Size / 2), - note.y + Grid_Size).makeGraphic(8, - Math.floor(FlxMath.remapToRange(daSus, 0, Conductor.stepCrochet * SONG.notes[Prev_Section].lengthInSteps, 0, Note_Grid_Above.height))); - - Current_Sustains.add(sustainVis); - } - } - - for (i in sectionInfo) - { - var daNoteInfo = i[1]; - var daStrumTime = i[0]; - var daSus = i[2]; - - var note:Note = new Note(daStrumTime, daNoteInfo % SONG.keyCount); - note.sustainLength = daSus; - - note.setGraphicSize(Grid_Size, Grid_Size); - note.updateHitbox(); - - note.x = Note_Grid.x + Math.floor(daNoteInfo * Grid_Size); - note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime(Cur_Section)) % (Conductor.stepCrochet * SONG.notes[Cur_Section].lengthInSteps), - Note_Grid)); - - note.rawNoteData = daNoteInfo; - - Current_Notes.add(note); - - if (daSus > 0) - { - var sustainVis:FlxSprite = new FlxSprite(note.x + (Grid_Size / 2), - note.y + Grid_Size).makeGraphic(8, - Math.floor(FlxMath.remapToRange(daSus, 0, Conductor.stepCrochet * SONG.notes[Cur_Section].lengthInSteps, 0, Note_Grid.height))); - - Current_Sustains.add(sustainVis); - } - } - - for (i in next_sectionInfo) - { - var daNoteInfo = i[1]; - var daStrumTime = i[0]; - var daSus = i[2]; - - var note:Note = new Note(daStrumTime, daNoteInfo % SONG.keyCount); - note.sustainLength = daSus; - - note.setGraphicSize(Grid_Size, Grid_Size); - note.updateHitbox(); - - note.x = Note_Grid.x + Math.floor(daNoteInfo * Grid_Size); - note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime(Next_Section)) % (Conductor.stepCrochet * SONG.notes[Next_Section].lengthInSteps), - Note_Grid_Below)); - - note.rawNoteData = daNoteInfo; - - Current_Notes.add(note); - - if (daSus > 0) - { - var sustainVis:FlxSprite = new FlxSprite(note.x + (Grid_Size / 2), - note.y + Grid_Size).makeGraphic(8, - Math.floor(FlxMath.remapToRange(daSus, 0, Conductor.stepCrochet * SONG.notes[Next_Section].lengthInSteps, 0, Note_Grid_Below.height))); - - Current_Sustains.add(sustainVis); - } - } - } - - function loadSong(daSong:String):Void - { - if (FlxG.sound.music != null) - FlxG.sound.music.stop(); - - FlxG.sound.music = new FlxSound().loadEmbedded(Paths.inst(daSong)); - FlxG.sound.music.persist = true; - - if (SONG.needsVoices) - Vocal_Track = new FlxSound().loadEmbedded(Paths.voices(daSong)); - else - Vocal_Track = new FlxSound(); - - FlxG.sound.list.add(Vocal_Track); - - FlxG.sound.music.pause(); - Vocal_Track.pause(); - - FlxG.sound.music.onComplete = function() - { - if (SONG.needsVoices && Vocal_Track.playing) - { - Vocal_Track.pause(); - Vocal_Track.time = 0; - } - - FlxG.sound.music.pause(); - FlxG.sound.music.time = 0; - }; - - Inst_Track = FlxG.sound.music; - } - - function getYfromStrum(strumTime:Float, ?baseGrid:FlxSprite):Float - { - if (baseGrid == null) - baseGrid = Note_Grid; - - return FlxMath.remapToRange(strumTime, 0, ((16 / Conductor.timeScale[1]) * Conductor.timeScale[0]) * Conductor.stepCrochet, baseGrid.y, - baseGrid.y + baseGrid.height); - } - - function sectionStartTime(?cur_Section:Int):Float - { - if (cur_Section == null) - cur_Section = Cur_Section; - - var daBPM:Float = SONG.bpm; - var daPos:Float = 0; - - for (i in 0...cur_Section) - { - if (SONG.notes[i].changeBPM && SONG.notes[i].bpm != daBPM) - daBPM = SONG.notes[i].bpm; - - daPos += (16 / Conductor.timeScale[1]) * (1000 * (60 / daBPM)); - } - - return daPos; - } - - function updateSection() - { - var Start_Section = Cur_Section; - - for (i in 0...SONG.notes.length) - { - if (sectionStartTime(i) <= Inst_Track.time) - Cur_Section = i; - } - - if (Start_Section != Cur_Section) - updateGrid(); - } - - function addSection(?lengthInSteps:Int = 16):Void - { - var sec:SwagSection = { - lengthInSteps: lengthInSteps, - bpm: SONG.bpm, - changeBPM: false, - mustHitSection: true, - sectionNotes: [], - typeOfSection: 0, - altAnim: false, - changeTimeScale: false, - timeScale: Conductor.timeScale - }; - - SONG.notes.push(sec); - } -} diff --git a/source/tools/toolbox/NewModWizard.hx b/source/tools/toolbox/NewModWizard.hx deleted file mode 100644 index 30c0f4a9ca..0000000000 --- a/source/tools/toolbox/NewModWizard.hx +++ /dev/null @@ -1,7 +0,0 @@ -package tools.toolbox; - -import states.MusicBeatState; - -class NewModWizard extends MusicBeatState{ - -} \ No newline at end of file diff --git a/source/tools/toolbox/Toolbox.hx b/source/tools/toolbox/Toolbox.hx deleted file mode 100644 index 2e654f2038..0000000000 --- a/source/tools/toolbox/Toolbox.hx +++ /dev/null @@ -1,130 +0,0 @@ -package tools.toolbox; - -import flixel.text.FlxText; -import modding.ModList; -import modding.PolymodHandler; -import tools.toolbox.NewModWizard; -import utilities.CoolUtil; -import flixel.addons.ui.FlxUIButton; -import flixel.ui.FlxButton; -import states.MainMenuState; -import flixel.FlxG; -import openfl.utils.Assets; -import flixel.util.FlxColor; -import flixel.FlxSprite; -import states.MusicBeatState; -import flixel.group.FlxGroup.FlxTypedGroup; - -#if discord_rpc -import utilities.Discord.DiscordClient; -#end - - -class Toolbox extends MusicBeatState { - - var ui_Skin:Null; - - var curSelected:Int = 0; - - public var modList:FlxTypedGroup = new FlxTypedGroup(); - - var descriptionText:FlxText; - var descBg:FlxSprite; - - - override public function create() { - #if discord_rpc - // Updating Discord Rich Presence - DiscordClient.changePresence("In the Toolbox", null); - #end - FlxG.mouse.visible = true; - if (ui_Skin == null || ui_Skin == "default") - ui_Skin = Options.getData("uiSkin"); - - MusicBeatState.windowNameSuffix = " Toolbox"; - - var menuBG:FlxSprite; - - if(Options.getData("menuBGs")) - if (!Assets.exists(Paths.image('ui skins/' + ui_Skin + '/backgrounds' + '/menuToolbox'))) - menuBG = new FlxSprite().loadGraphic(Paths.image('ui skins/default/backgrounds/menuToolbox')); - else - menuBG = new FlxSprite().loadGraphic(Paths.image('ui skins/' + ui_Skin + '/backgrounds' + '/menuToolbox')); - else - menuBG = new FlxSprite().makeGraphic(1286, 730, FlxColor.fromString("#00E108"), false, "optimizedMenuDesat"); - - menuBG.setGraphicSize(Std.int(menuBG.width * 1.1)); - menuBG.updateHitbox(); - menuBG.screenCenter(); - menuBG.antialiasing = true; - add(menuBG); - - super.create(); - - descBg = new FlxSprite(0, FlxG.height - 90).makeGraphic(FlxG.width, 90, 0xFF000000); - descBg.alpha = 0.6; - add(descBg); - - descriptionText = new FlxText(descBg.x, descBg.y + 4, FlxG.width, "Template Description", 18); - descriptionText.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.WHITE, CENTER); - descriptionText.borderColor = FlxColor.BLACK; - descriptionText.borderSize = 1; - descriptionText.borderStyle = OUTLINE; - descriptionText.scrollFactor.set(); - descriptionText.screenCenter(X); - add(descriptionText); - - - add(modList); - } - - function loadMods() - { - modList.forEachExists(function(option:FlxButton) - { - modList.remove(option); - option.kill(); - option.destroy(); - }); - - var optionLoopNum:Int = 0; - - for(modId in PolymodHandler.metadataArrays) - { - var modOption = new FlxButton(10, optionLoopNum, modId); - modList.add(modOption); - optionLoopNum++; - } - } - - override public function update(elapsed){ - super.update(elapsed); - if (curSelected < 0) - curSelected = modList.length - 1; - - if (curSelected >= modList.length) - curSelected = 0; - if (controls.BACK) FlxG.switchState(new MainMenuState()); - var bruh = 0; - - for (x in modList.members) - { - x.y = bruh - curSelected; - - if(x.y == 0) - { - descriptionText.screenCenter(X); - - @:privateAccess - descriptionText.text = - ModList.modMetadatas.get(x.text).description - + "\nAuthor: " + ModList.modMetadatas.get(x.text)._author - + "\nLeather Engine Version: " + ModList.modMetadatas.get(x.text).apiVersion - + "\nMod Version: " + ModList.modMetadatas.get(x.text).modVersion - + "\n"; - } - - bruh++; - } - } -} \ No newline at end of file diff --git a/source/ui/Option.hx b/source/ui/Option.hx index 1e775ce8e7..42cfb641cf 100644 --- a/source/ui/Option.hx +++ b/source/ui/Option.hx @@ -200,7 +200,7 @@ class GameStateOption extends Option { super(_Option_Name, null, _Option_Row); // SETTING VALUES // - tools.CharacterCreator.lastState = "OptionsMenu"; + toolbox.CharacterCreator.lastState = "OptionsMenu"; this.Game_State = _Game_State; }