diff --git a/assets/preload/images/packs/mod.png b/assets/preload/images/packs/mod.png deleted file mode 100644 index 04e9a06..0000000 Binary files a/assets/preload/images/packs/mod.png and /dev/null differ diff --git a/mods/test/Icon.png b/mods/test/Icon.png new file mode 100644 index 0000000..47604f8 Binary files /dev/null and b/mods/test/Icon.png differ diff --git a/mods/test/data/charts/test-cred.txt b/mods/test/data/charts/test-cred.txt new file mode 100644 index 0000000..991afc2 --- /dev/null +++ b/mods/test/data/charts/test-cred.txt @@ -0,0 +1 @@ +Kawai Sprite & MtH \ No newline at end of file diff --git a/source/CreditsPopUp.hx b/source/CreditsPopUp.hx index 2fbad6c..344e0bb 100644 --- a/source/CreditsPopUp.hx +++ b/source/CreditsPopUp.hx @@ -61,6 +61,15 @@ class CreditsPopUp extends FlxSpriteGroup songCreator = 'TH3R34LD34L'; case 'roofs': songCreator = 'sibottle'; + default: + if (FreeplayState.isaCustomSong) { + var custom = CoolUtil.coolTextFile(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt'); + for (i in 0...custom.length) + { + var data:Array = custom[i].split(':'); + songCreator = data[0]; + } + } } switch (PlayState.storyWeek) { @@ -101,6 +110,9 @@ class CreditsPopUp extends FlxSpriteGroup case 16: headingPath = {path: 'songHeadings/expungedHeading', antiAliasing: true, animation: new Animation('expunged', 'Expunged', 24, true, [false, false]), iconOffset: 0}; + default: + if (FreeplayState.isaCustomSong) + headingPath = {path: 'songHeadings/daveHeading', antiAliasing: false, iconOffset: 0}; } switch (PlayState.SONG.song.toLowerCase()) { @@ -108,6 +120,9 @@ class CreditsPopUp extends FlxSpriteGroup headingPath = {path: 'songHeadings/3D-daveHeading', antiAliasing: false, iconOffset: 0}; case 'interdimensional': headingPath = {path: 'songHeadings/interdimensionalHeading', antiAliasing: false, iconOffset: 0}; + default: + if (FreeplayState.isaCustomSong) + headingPath = {path: 'songHeadings/daveHeading', antiAliasing: false, iconOffset: 0}; } if (PlayState.recursedStaticWeek) { diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index f34c588..9f2040e 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -21,6 +21,10 @@ import flixel.FlxObject; import flixel.addons.util.FlxAsyncLoop; #if sys import sys.FileSystem; #end #if desktop import Discord.DiscordClient; #end +import flixel.graphics.FlxGraphic; +import openfl.display.BitmapData; +import openfl.utils.Assets as OpenFlAssets; + using StringTools; @@ -49,7 +53,7 @@ class FreeplayState extends MusicBeatState var customSongs = CoolUtil.coolTextFile(TitleState.modFolder + '/data/CustomSongs.txt'); // idk should work private var Catagories:Array = ['dave', 'joke', 'extras', 'mod']; - var translatedCatagory:Array = [LanguageManager.getTextString('freeplay_dave'), LanguageManager.getTextString('freeplay_joke'), LanguageManager.getTextString('freeplay_extra')]; + var translatedCatagory:Array = [LanguageManager.getTextString('freeplay_dave'), LanguageManager.getTextString('freeplay_joke'), LanguageManager.getTextString('freeplay_extra'), TitleState.currentMod]; private var CurrentPack:Int = 0; private var NameAlpha:Alphabet; @@ -170,7 +174,8 @@ class FreeplayState extends MusicBeatState for (i in 0...Catagories.length) { Highscore.load(); - + if (FileSystem.exists(Paths.image('packs/' + (Catagories[i].toLowerCase())))) { + trace('yay'); var CurrentSongIcon:FlxSprite = new FlxSprite(0,0).loadGraphic(Paths.image('packs/' + (Catagories[i].toLowerCase()), "preload")); CurrentSongIcon.centerOffsets(false); CurrentSongIcon.x = (1000 * i + 1) + (512 - CurrentSongIcon.width); @@ -184,6 +189,22 @@ class FreeplayState extends MusicBeatState icons.push(CurrentSongIcon); add(NameAlpha); titles.push(NameAlpha); + } else { + trace('nae'); + var CurrentSongIcon:FlxSprite = new FlxSprite(0,0).loadGraphic(Paths.customImage('Icon')); + CurrentSongIcon.centerOffsets(false); + CurrentSongIcon.x = (1000 * i + 1) + (512 - CurrentSongIcon.width); + CurrentSongIcon.y = (FlxG.height / 2) - 256; + CurrentSongIcon.antialiasing = true; + + var NameAlpha:Alphabet = new Alphabet(40, (FlxG.height / 2) - 282, translatedCatagory[i], true, false); + NameAlpha.x = CurrentSongIcon.x; + + add(CurrentSongIcon); + icons.push(CurrentSongIcon); + add(NameAlpha); + titles.push(NameAlpha); + } } diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index 335d398..bb61e2e 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -2,6 +2,9 @@ package; import flixel.FlxSprite; import flixel.math.FlxMath; +import flixel.graphics.FlxGraphic; +import openfl.display.BitmapData; + class HealthIcon extends FlxSprite { @@ -34,7 +37,7 @@ class HealthIcon extends FlxSprite if (this.char != char) { if (char != "none") - loadGraphic(Paths.image('ui/iconGrid/' + char, 'preload'), true, 150, 150); + loadGraphic(FlxGraphic.fromBitmapData(BitmapData.fromFile(Paths.image('ui/iconGrid/' + char, 'preload'))), true, 150, 150); else loadGraphic(Paths.image('blank', 'shared')); diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 70b74a0..1551ec9 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -92,9 +92,7 @@ class OptionsMenu extends MusicBeatState + "\n" + (FlxG.save.data.disableFps ? LanguageManager.getTextString('option_enable_fps') : LanguageManager.getTextString('option_disable_fps')) + "\n" + (CompatTool.save.data.compatMode ? LanguageManager.getTextString('option_enable_compat') : LanguageManager.getTextString('option_disable_compat')) + "\n" + (FlxG.save.data.modchart ? 'Mod Chart OFF' : 'Mod Chart ON') - #if debug + "\n" + (FlxG.save.data.botplay ? 'Bot Play ON' : 'Bot Play OFF') - #end ); grpControls = new FlxTypedGroup(); @@ -205,11 +203,9 @@ class OptionsMenu extends MusicBeatState case 12: if (!awaitingExploitation) FlxG.save.data.modchart = !FlxG.save.data.modchart; updateGroupControls(FlxG.save.data.modchart ? 'Mod Chart OFF' : 'Mod Chart ON', 12, 'Vertical'); - #if debug case 13: FlxG.save.data.botplay = !FlxG.save.data.botplay; updateGroupControls(FlxG.save.data.botplay ? 'Bot Play ON' : 'Bot Play OFF', 13, 'Vertical'); - #end } } } diff --git a/source/Paths.hx b/source/Paths.hx index 7fe374e..943e413 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -1,5 +1,7 @@ package; +import flixel.graphics.FlxGraphic; +import openfl.display.BitmapData; import flixel.FlxG; import flixel.graphics.frames.FlxAtlasFrames; import openfl.utils.AssetType; @@ -154,6 +156,10 @@ class Paths return TitleState.modFolder + '/data/charts/$key.json'; } + inline static public function customImage(key:String) + { + return (FlxGraphic.fromBitmapData(BitmapData.fromFile(TitleState.modFolder + '/${key}.png'))); + } inline static public function music(key:String, ?library:String) { return getPath('music/$key.$SOUND_EXT', MUSIC, library); diff --git a/source/PlayState.hx b/source/PlayState.hx index d47616e..2b141b6 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -533,9 +533,9 @@ class PlayState extends MusicBeatState if (FlxG.sound.music != null) FlxG.sound.music.stop(); eyesoreson = FlxG.save.data.eyesores; - #if debug + botPlay = FlxG.save.data.botplay; - #end + modchartoption = !FlxG.save.data.modchart; sicks = 0;