diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-07 19:24:47 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-07 19:24:47 +0800 |
commit | e44de4dc2876d771d871255e72c6884b958c05eb (patch) | |
tree | 26bbc40b5a94072f1bd73c4bd472687e1cd62ef5 /features/cosmetics | |
parent | fb19a8b072e8529b9d90bd3fb322da31ca4911df (diff) | |
download | SoopyV2-e44de4dc2876d771d871255e72c6884b958c05eb.tar.gz SoopyV2-e44de4dc2876d771d871255e72c6884b958c05eb.tar.bz2 SoopyV2-e44de4dc2876d771d871255e72c6884b958c05eb.zip |
add apikey menu to first load
Diffstat (limited to 'features/cosmetics')
-rw-r--r-- | features/cosmetics/hiddenRequirement.js | 7 | ||||
-rw-r--r-- | features/cosmetics/index.js | 5 |
2 files changed, 8 insertions, 4 deletions
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(){ |