From e44de4dc2876d771d871255e72c6884b958c05eb Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sun, 7 Nov 2021 19:24:47 +0800 Subject: add apikey menu to first load --- features/cosmetics/hiddenRequirement.js | 7 +++---- features/cosmetics/index.js | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'features/cosmetics') diff --git a/features/cosmetics/hiddenRequirement.js b/features/cosmetics/hiddenRequirement.js index 7e0b57a..dbc3e06 100644 --- a/features/cosmetics/hiddenRequirement.js +++ b/features/cosmetics/hiddenRequirement.js @@ -1,5 +1,4 @@ -let cosmeticsClass = require("./index").class -export default ()=>{ - return !!cosmeticsClass?.cosmeticsData?.[Player.getUUID().toString()] -} \ No newline at end of file +module.exports = {hidden: function(featureManager){ + return !(featureManager.features.cosmetics?.["class"]?.playerHasACosmeticA || false) +}} \ No newline at end of file diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js index 593ac7c..11d9f47 100644 --- a/features/cosmetics/index.js +++ b/features/cosmetics/index.js @@ -16,6 +16,8 @@ class Cosmetics extends Feature { this.cosmeticsData = {} + this.playerHasACosmeticA = false + this.firstPersonVisable = new Toggle("Cosmetics visable in first person", "", false, "cosmetics_first_person_visable", this) this.lessFirstPersonVisable = new Toggle("Make cosmetics less visable in first person mode", "", true, "cosmetics_first_person_less_visable", this).requires(this.firstPersonVisable) @@ -38,6 +40,7 @@ class Cosmetics extends Feature { let data = JSON.parse(FileLib.getUrlContent("http://soopymc.my.to/api/soopyv2/cosmetics.json")) this.cosmeticsData = data + this.playerHasACosmeticA = !!data[Player.getUUID().toString()] this.scanForNewCosmetics() } @@ -88,6 +91,7 @@ class Cosmetics extends Feature { if(this.shouldPlayerHaveCosmetic(player, "dragon_wings") && !this.uuidToCosmetic[player.getUUID().toString()]){ let cosmetic = new DragonWings(player, this) + this.playerHasACosmeticA = true this.loadedCosmetics.push(cosmetic) this.uuidToCosmetic[player.getUUID().toString()] = cosmetic } @@ -134,6 +138,7 @@ class Cosmetics extends Feature { initVariables(){ this.loadedCosmetics = undefined this.uuidToCosmetic = undefined + this.playerHasACosmeticA = undefined } onDisable(){ -- cgit