aboutsummaryrefslogtreecommitdiff
path: root/features/globalSettings/index.js
diff options
context:
space:
mode:
authorEmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com>2022-08-11 02:40:02 +0800
committerGitHub <noreply@github.com>2022-08-11 02:40:02 +0800
commit3142f3c939b7cae12928b401efbcec193b1ba3c1 (patch)
tree0e00e32c0884d07d8d0c3be9b8561dd8d22f18a5 /features/globalSettings/index.js
parenta34391dd76097c51e9ad8847779db2b88b31d42e (diff)
downloadSoopyV2-3142f3c939b7cae12928b401efbcec193b1ba3c1.tar.gz
SoopyV2-3142f3c939b7cae12928b401efbcec193b1ba3c1.tar.bz2
SoopyV2-3142f3c939b7cae12928b401efbcec193b1ba3c1.zip
small fix
+ 2 registerChats to prevent pickup log going brrr after warping into a different lobby (yes its 10s ish after i tested)
Diffstat (limited to 'features/globalSettings/index.js')
-rw-r--r--features/globalSettings/index.js35
1 files changed, 25 insertions, 10 deletions
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
index ffa7b9f..274457f 100644
--- a/features/globalSettings/index.js
+++ b/features/globalSettings/index.js
@@ -17,6 +17,7 @@ import socketConnection from "../../socketConnection";
import renderLibs from "../../../guimanager/renderLibs";
import { f } from "../../../mappings/mappings";
import { addLore, getSBUUID } from "../../utils/utils";
+import { delay } from "../../utils/delayUtils";
const Files = Java.type("java.nio.file.Files")
const Paths = Java.type("java.nio.file.Paths")
const JavaString = Java.type("java.lang.String")
@@ -106,6 +107,7 @@ class GlobalSettings extends Feature {
this.oldItemData = {};
this.initOldItemData();
this.todoPickUpLog = [];
+ this.clearLog = false;
this.registerStep(true, 5, () => {
let old = this.oldMasterStars.getValue();
@@ -151,18 +153,31 @@ class GlobalSettings extends Feature {
}
})
let todoText = [];
- if (pick) {
- this.todoPickUpLog.forEach((i, index, array) => { //positive and negative prefix colors
- if (Math.abs(i.timeStamp - now) > 5000) {
- array.splice(index, 1)
- }
- todoText.push((i.Amount > -1 ? "&r&a+ " : "&r&c- ") + Math.abs(i.Amount == 0 ? 1 : i.Amount) + "x &r" + i.itemName)
- });
- } else {
- this.todoPickUpLog = [];
- } // doesn't need to put setText() in if (pick) cuz if (!pick) it clears the todo log list
+ if (!this.clearLog) {
+ if (pick) {
+ this.todoPickUpLog.forEach((i, index, array) => { //positive and negative prefix colors
+ if (Math.abs(i.timeStamp - now) > 5000) {
+ array.splice(index, 1)
+ }
+ todoText.push((i.Amount > -1 ? "&r&a+ " : "&r&c- ") + Math.abs(i.Amount == 0 ? 1 : i.Amount) + "x &r" + i.itemName)
+ });
+ } else {
+ 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.registerChat("&eSkyBlock Dungeon Warp${p}", () => {
+ this.clearLog = true
+ delay(10000, () => { this.clearLog = false })
+ })
+
+ this.registerChat("&r&7Warping...${island}", () => {
+ this.clearLog = true
+ delay(10000, () => { this.clearLog = false })
+ })
this.firstPageSettings = [this.darkTheme]