diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-08-11 20:36:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 20:36:05 +0800 |
commit | fd9a1fe37623833e5c90642503ea96e220a14d7f (patch) | |
tree | c6a89fe332cc84ee49ebfffc5b809e3e140de912 /features/globalSettings | |
parent | fe6878c328dca8b78a5e4eeb7af7c85e0649b659 (diff) | |
download | SoopyV2-fd9a1fe37623833e5c90642503ea96e220a14d7f.tar.gz SoopyV2-fd9a1fe37623833e5c90642503ea96e220a14d7f.tar.bz2 SoopyV2-fd9a1fe37623833e5c90642503ea96e220a14d7f.zip |
bug fixes
+ fixed it sometimes bypasses clearLog when warping frequently
+ prevent dying/revived in dungeons making it go brrr
Diffstat (limited to 'features/globalSettings')
-rw-r--r-- | features/globalSettings/index.js | 77 |
1 files changed, 58 insertions, 19 deletions
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index a17cf50..61d2173 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -150,6 +150,7 @@ class GlobalSettings extends Feature { this.initOldItemData(); this.todoPickUpLog = {}; this.clearLog = false; + this.maxAmount = 12; this.registerStep(true, 5, () => { let old = this.oldMasterStars.getValue(); @@ -199,41 +200,79 @@ class GlobalSettings extends Feature { } }) let todoText = []; - if (!this.clearLog) { - if (pick) { - Object.keys(this.todoPickUpLog).forEach((i) => { - if (Math.abs(this.todoPickUpLog[i].timeStamp - now) > 5000 || !this.todoPickUpLog[i].Amount || this.todoPickUpLog[i].Amount == 0) { - delete this.todoPickUpLog[i] - return - } - //positive and negative prefix colors - if (todoText.length < 12) todoText.push((this.todoPickUpLog[i].Amount > 0 ? "&r&a+ " : "&r&c- ") + Math.abs(this.todoPickUpLog[i].Amount) + "x &r" + i) - }) - } else { - this.todoPickUpLog = {}; - } + if (pick) { + Object.keys(this.todoPickUpLog).forEach((i) => { + if (Math.abs(this.todoPickUpLog[i].timeStamp - now) > 5000 || !this.todoPickUpLog[i].Amount || this.todoPickUpLog[i].Amount == 0) { + delete this.todoPickUpLog[i] + return + } + //positive and negative prefix colors + if (todoText.length < this.maxAmount) todoText.push((this.todoPickUpLog[i].Amount > 0 ? "&r&a+ " : "&r&c- ") + Math.abs(this.todoPickUpLog[i].Amount) + "x &r" + i) + }) + } else { + this.todoPickUpLog = {}; + } + if (this.guiOpened) { + this.todoPickUpLog = {}; } // doesn't need to put setText() in if (pick) cuz if (!pick) it clears the todo log list this.sbaItemPickUpLogElement.setText(todoText.join("\n")) }) //2 chat registeries below prevents pickup log to go brrr when warping + this.warpedAgain = false this.registerChat("&eSkyBlock Dungeon Warp${p}", () => { - this.clearLog = true - delay(12500, () => { this.clearLog = false }) + this.maxAmount = 0 + this.warpedAgain = true + delay(8000, () => { + if (this.warpedAgain) { + this.warpedAgain = false + this.maxAmount = 12 + } + }) }) this.registerChat("&r&7Warping...${island}", () => { - this.clearLog = true - delay(12500, () => { this.clearLog = false }) + this.maxAmount = 0 + this.warpedAgain = true + delay(8000, () => { + if (this.warpedAgain) { + this.warpedAgain = false + this.maxAmount = 12 + } + }) }) this.registerChat("&r&c ☠ ${info} and became a ghost&r&7.&r", (info, e) => { if (info.includes("You")) { - this.clearLog = true - delay(12500, () => { this.clearLog = false }) + this.maxAmount = 0 + this.warpedAgain = true + delay(5000, () => { + if (this.warpedAgain) { + this.warpedAgain = false + this.maxAmount = 12 + } + }) } }); + this.registerChat("${info}You were revived by ${info2}", () => { + this.maxAmount = 0 + this.warpedAgain = true + delay(5000, () => { + if (this.warpedAgain) { + this.warpedAgain = false + this.maxAmount = 12 + } + }) + }); + this.guiOpened = false; + this.registerEvent('guiOpened', () => { + this.guiOpened = true + }) + this.registerEvent('guiClosed', () => { + this.guiOpened = false + }) + this.firstPageSettings = [this.darkTheme] this.firstLoadPageData = JSON.parse(FileLib.read("soopyAddonsData", "soopyv2firstloaddata.json") || "{}") || {} |