From 1024b3ee6060208c217a31bef4fe946de03ee9d1 Mon Sep 17 00:00:00 2001 From: Cam the Kirby <92703353+CamtheKirby@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:52:56 -0500 Subject: [PATCH] 1.5.0 Update --- Project.xml | 2 +- assets/preload/locale/en-US/textList.txt | 1 + mods/test/data/charts/test-settings.json | 1 + mods/test/images/ui/testBar.png | Bin 0 -> 1210 bytes source/FreeplayState.hx | 11 ++++---- source/Main.hx | 2 +- source/MainMenuState.hx | 2 +- source/MusicPlayerState.hx | 33 ++++++++++++++++++++++- source/OptionsMenu.hx | 1 + source/Paths.hx | 5 ++++ source/PauseSubState.hx | 2 +- source/PlayState.hx | 25 ++++++++++++++++- 12 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 mods/test/images/ui/testBar.png diff --git a/Project.xml b/Project.xml index abbb6a2..f565a81 100644 --- a/Project.xml +++ b/Project.xml @@ -3,7 +3,7 @@ - + diff --git a/assets/preload/locale/en-US/textList.txt b/assets/preload/locale/en-US/textList.txt index 9ad6c4a..4f2e0c0 100644 --- a/assets/preload/locale/en-US/textList.txt +++ b/assets/preload/locale/en-US/textList.txt @@ -90,6 +90,7 @@ option_disable_fps==Disable FPS & Memory Counter option_enable_fps==Enable FPS & Memory Counter option_songBarType_ShowTime==Song Bar Type: Time Left +option_songBarType_ShowTimeOld==Song Bar Type: Time Left Old option_songBarType_SongName==Song Bar Type: Show Song Name option_enable_compat==Compatibility Mode ON diff --git a/mods/test/data/charts/test-settings.json b/mods/test/data/charts/test-settings.json index 2ca1e81..bfc5b21 100644 --- a/mods/test/data/charts/test-settings.json +++ b/mods/test/data/charts/test-settings.json @@ -6,5 +6,6 @@ "intro": "", "windowName": "", "healthDrain": "", + "healthBarBG": "", "exploitationEffect": false } \ No newline at end of file diff --git a/mods/test/images/ui/testBar.png b/mods/test/images/ui/testBar.png new file mode 100644 index 0000000000000000000000000000000000000000..4b3b40072af7a7b000a665747149d17327bef8bc GIT binary patch literal 1210 zcmV;r1V#IaP)Rn>D*aNG=tgans@x(X6eag|M6WT!9T z6J+57_y)d&;!a!&en7-zm8=Xx0*P@GWP;$#q^n$XRd;pW>dDRI_T1#o{|7~#Q|Hvj z?P2ac)6@5FfPfG}2qA=6D|XWd5JCtcgxE$@WCo^z~>?LYe#aY76e557AKjf1A?dS|0;VaI}t zcJC+KL1Q}KS=ce%xHFyYtf67>8$<6WyP^BAYYa3Y^U3@$*o}|zU^+X*xF1^bozMC< z+HK~?W<4y9U~#nk0V0GrIX5o_u3Yy|PZUDD5CjiAiLHeY`;k2{7TR$EIk2qDfgKV8-z zaYBgg;mK`i|ER~RMbcNSee+lK^Sf_rjx@80nHAX>4xfcVeWLOo%jzkfy%P1WJ827F!Y}buGO5 zA2_ch(^igPq?{qy>{&p1c();v#lpiji4;=AZ@48>iwH=X)@Dn4B*Mom|U_TyO* z>awDqsY*5BGy+Xc&B~^SEy5iDR)bXt^iqA|T z|CNLF6`|e)yoJ^>>VwI~OxOD~M%M=u$BNz)ZHh6*vEB|T7P>xU`C;gL+h?)ZlI{K2 z?)%t$h<&o#eE;H{gpogvozB?Q7XlZ+8^8s|&mQ~@+ym0%o!2mYhT$6mU+FDJ2ysSG zktLpsH-U3~GnsEV7vm0i(6_+D%zgko1nzI*@InY7#EhuO5<& = [ diff --git a/source/MusicPlayerState.hx b/source/MusicPlayerState.hx index b0995d9..92f6afe 100644 --- a/source/MusicPlayerState.hx +++ b/source/MusicPlayerState.hx @@ -19,6 +19,9 @@ import lime.utils.Assets; #if desktop import Discord.DiscordClient; #end +import sys.FileSystem; +import sys.io.File; + using StringTools; @@ -49,6 +52,12 @@ class MusicPlayerState extends MusicBeatState { FlxG.autoPause = false; var initSonglist = CoolUtil.coolTextFile(Paths.txt('djSonglist')); //ah yeah dj song list + var customList = []; + for (folder in FileSystem.readDirectory(TitleState.modFolder + '/songs')){ + if (FileSystem.isDirectory(TitleState.modFolder + '/songs/' + folder) && !customList.contains(folder)) + customList.push('internal,' + folder + ',bf-old,good,true'); + } + for (i in 0...initSonglist.length) { var splitstring:Array = initSonglist[i].split(","); @@ -94,6 +103,21 @@ class MusicPlayerState extends MusicBeatState } } + for (i in 0...customList.length) + { + var splitstring:Array = customList[i].split(","); + if (FileSystem.exists(TitleState.modFolder + '/songs/' + splitstring[1] + '/Voices.ogg')) { + songs.push(new PlaySongMetadata(splitstring[1], splitstring[0] == "external", splitstring[2],splitstring[3] == "bad",splitstring[1] != 'vs-dave-rap', true)); + + if (splitstring[0] != "external" && splitstring[1] != 'vs-dave-rap') //remove this later + { + songs.push(new PlaySongMetadata(splitstring[1], splitstring[0] == "external", splitstring[2],splitstring[3] == "bad",false)); + } + } else { + songs.push(new PlaySongMetadata(splitstring[1], splitstring[0] == "external", splitstring[2],splitstring[3] == "bad",false, true)); + } + } + bg = new FlxSprite().loadGraphic(Paths.image('backgrounds/Aadsta')); bg.loadGraphic(MainMenuState.randomizeBG()); bg.color = 0xFFFD719B; @@ -299,6 +323,11 @@ class MusicPlayerState extends MusicBeatState ShowBar(songs[curSelected].songCharacter); if (!songs[curSelected].ExternalSong) { + if (songs[curSelected].isCustom) { + FreeplayState.isaCustomSong = true; + } else { + FreeplayState.isaCustomSong = false; + } currentlyplaying = true; if (songs[curSelected].hasVocals) { @@ -454,13 +483,15 @@ class PlaySongMetadata public var ShowBadIcon:Bool = false; public var songCharacter:String = ""; public var hasVocals:Bool = true; + public var isCustom:Bool = false; - public function new(song:String, external:Bool, songCharacter:String, bad:Bool, vocal:Bool) + public function new(song:String, external:Bool, songCharacter:String, bad:Bool, vocal:Bool, isCustom:Bool = false) { this.songName = song; this.ExternalSong = external; this.songCharacter = songCharacter; this.ShowBadIcon = bad; this.hasVocals = vocal; + this.isCustom = isCustom; } } diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 62cff09..17ca6c8 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -37,6 +37,7 @@ class OptionsMenu extends MusicBeatState var curLanguage:String = LanguageManager.save.data.language; var songBarOptions = [ 'ShowTime', + 'ShowTimeOld', 'SongName', ]; var curSongBarOptionSelected:Int; diff --git a/source/Paths.hx b/source/Paths.hx index 339b7e1..e784152 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -166,7 +166,12 @@ class Paths inline static public function customImage(key:String) { + if (FileSystem.exists('${key}.png')) { return (FlxGraphic.fromBitmapData(BitmapData.fromFile('${key}.png'))); + } else { + trace('bro that doesn\'t exist ' + '${key}.png'); + return (FlxGraphic.fromBitmapData(BitmapData.fromFile('assets/shared/images/blank.png'))); + } } inline static public function music(key:String, ?library:String) { diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index 523116d..6f7cc8b 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -134,7 +134,7 @@ class PauseSubState extends MusicBeatSubstate for (i in 0...menuItems.length) { - var songText:Alphabet = new Alphabet(0, (70 * i) + 30, LanguageManager.getTextString('${menuItems[i].optionName}'), true, false); + var songText:Alphabet = new Alphabet(0, (70 * i) + 30, i != 4 ? LanguageManager.getTextString('pause_${menuItems[i].optionName}') : menuItems[i].optionName, true, false); songText.isMenuItem = true; songText.targetY = i; grpMenuShit.add(songText); diff --git a/source/PlayState.hx b/source/PlayState.hx index 842d07d..165b021 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -122,6 +122,7 @@ typedef Settings = { var intro:String; var windowName:String; var healthDrain:String; + var healthBarBG:String; var exploitationEffect:Bool; } @@ -1367,6 +1368,7 @@ class PlayState extends MusicBeatState } var healthBarPath = ''; + var customHealthBar = false; switch (SONG.song.toLowerCase()) { case 'exploitation': @@ -1376,10 +1378,23 @@ class PlayState extends MusicBeatState case 'five-nights': healthBarPath = Paths.image('ui/fnafengine'); default: + if (FreeplayState.isaCustomSong && settingsExist) { + if (FileSystem.exists(Paths.image('ui/' + jsonSettings.healthBarBG))) { + healthBarPath = Paths.image('ui/' + jsonSettings.healthBarBG); + } else { + if (jsonSettings.healthBarBG != '' && jsonSettings.healthBarBG != null) { + customHealthBar = true; + healthBarPath = TitleState.modFolder + '/images/ui/' + jsonSettings.healthBarBG; + } else { + healthBarPath = Paths.image('ui/healthBar'); + } + } + } else { healthBarPath = Paths.image('ui/healthBar'); + } } - healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(healthBarPath); + healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(customHealthBar ? Paths.customImage(healthBarPath) : healthBarPath); // I'm learning if (scrollType == 'downscroll') healthBarBG.y = 50; healthBarBG.screenCenter(X); @@ -3150,8 +3165,16 @@ class PlayState extends MusicBeatState } if (songName != null && barType == 'ShowTime') + { + songName.text = FlxStringUtil.formatTime(FlxG.sound.music.time / 1000) + ' / ' + FlxStringUtil.formatTime(FlxG.sound.music.length / 1000); + songName.x = 551; + } + + + if (barType == 'ShowTimeOld') { songName.text = FlxStringUtil.formatTime((FlxG.sound.music.length - FlxG.sound.music.time) / 1000); + songName.x = 615; } if (startingSong && startTimer != null && !startTimer.active)