diff --git a/source/Achievements.hx b/source/Achievements.hx index ab1195c0..b91852e0 100644 --- a/source/Achievements.hx +++ b/source/Achievements.hx @@ -47,8 +47,10 @@ class Achievements { public static function getAchievementIndex(name:String) { for (i in 0...achievementsStuff.length) { - if(achievementsStuff[i][2] == name) { - return i; + if(achievementsStuff[i][2] != null) { + if(achievementsStuff[i][2] == name) { + return i; + } } } return -1; @@ -181,4 +183,4 @@ class AchievementObject extends FlxSpriteGroup { } super.destroy(); } -} \ No newline at end of file +} diff --git a/source/AchievementsMenuState.hx b/source/AchievementsMenuState.hx index 52fcaeca..3d9593d8 100644 --- a/source/AchievementsMenuState.hx +++ b/source/AchievementsMenuState.hx @@ -12,7 +12,6 @@ import flixel.math.FlxMath; import flixel.text.FlxText; import flixel.util.FlxColor; import lime.utils.Assets; -import lime.app.Application; import flixel.FlxSubState; import Achievements; @@ -27,15 +26,12 @@ class AchievementsMenuState extends MusicBeatState private var achievementArray:Array = []; private var achievementIndex:Array = []; private var descText:FlxText; - var descBox:AttachedSprite; override function create() { #if desktop DiscordClient.changePresence("Achievements Menu", null); #end - Application.current.window.title = "Friday Night Funkin': Theoyeah Engine - " + "Awards Menu"; - var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuBGBlue')); menuBG.setGraphicSize(Std.int(menuBG.width * 1.1)); menuBG.updateHitbox(); @@ -47,7 +43,7 @@ class AchievementsMenuState extends MusicBeatState add(grpOptions); Achievements.loadAchievements(); - for (i in 0...Achievements.achievementsStuff.length-1) { + for (i in 0...Achievements.achievementsStuff.length) { if(!Achievements.achievementsStuff[i][4] || Achievements.achievementsMap.exists(Achievements.achievementsStuff[i][2])) { options.push(Achievements.achievementsStuff[i]); achievementIndex.push(i); @@ -73,18 +69,9 @@ class AchievementsMenuState extends MusicBeatState descText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); descText.scrollFactor.set(); descText.borderSize = 2.4; - descBox.sprTracker = descText; add(descText); changeSelection(); - descBox = new AttachedSprite(); - descBox.makeGraphic(1, 1, FlxColor.BLACK); - descBox.xAdd = -10; - descBox.yAdd = -10; - descBox.alphaMult = 0.6; - descBox.alpha = 0.6; - add(descBox); - super.create(); } @@ -133,4 +120,4 @@ class AchievementsMenuState extends MusicBeatState FlxG.sound.play(Paths.sound('scrollMenu'), 0.4); } #end -} +} \ No newline at end of file