diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-06 17:32:46 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-10-06 17:32:46 +0800 |
commit | ac4bec7b9a9feb8372ede945f9869c197789c660 (patch) | |
tree | f9e51136a48c1f13bd41a5e3b515e935a5e54ea8 /src/features/hud/index.js | |
parent | 26996a65c93de407e4a12403f967b722a6dbf710 (diff) | |
download | SoopyV2-ac4bec7b9a9feb8372ede945f9869c197789c660.tar.gz SoopyV2-ac4bec7b9a9feb8372ede945f9869c197789c660.tar.bz2 SoopyV2-ac4bec7b9a9feb8372ede945f9869c197789c660.zip |
Location hud element
Diffstat (limited to 'src/features/hud/index.js')
-rw-r--r-- | src/features/hud/index.js | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/features/hud/index.js b/src/features/hud/index.js index 81f9285..52868da 100644 --- a/src/features/hud/index.js +++ b/src/features/hud/index.js @@ -102,6 +102,23 @@ class Hud extends Feature { this.hudElements.push(this.petElement) this.scanGuiForPet = new ToggleSetting("Scan pets menu gui for selected pet", "Only disable if you get a lot of lag in the pets menu", true, "scan_pets_menu", this).requires(this.petEnabledSetting) + this.locationEnabledSetting = new ToggleSetting("Show Location", "Whether the location (xyz) is rendered onto the screen", false, "location_enabled", this) + this.locationElement = new HudTextElement() + .setToggleSetting(this.locationEnabledSetting) + .setLocationSetting(new LocationSetting("XYZ Location", "Allows you to edit the location of the location text", "location_location", this, [10, 120, 1, 1]) + .requires(this.locationEnabledSetting) + .editTempText("&6Loc&7> &f123.456 | 123.456 | 123.456")) + this.hudElements.push(this.locationElement) + this.locationYEnabledSetting = new ToggleSetting("Show Y in location", "Wether to include ur Y value in location", true, "location_y_enabled", this).requires(this.locationEnabledSetting) + this.locationOnlyDungSetting = new ToggleSetting("Only show location in dungeon", "(If u want to use this to show how to mine thru stairs)", false, "location_dung_enabled", this).requires(this.locationEnabledSetting) + this.locationDecimals = new DropdownSetting("Decimal places in location setting", "", "3", "location_decimal_setting", this, { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4" + }).requires(this.locationEnabledSetting) + this.soulflowEnabledSetting = new ToggleSetting("Show Soulflow", "Whether the soulflow count is rendered onto the screen", true, "soulflow_enabled", this) this.soulflowShowWhen0Setting = new ToggleSetting("Show When 0 Soulflow", "If this is off it wont render when you have 0 soulflow", true, "soulflow_showwhen_0", this).requires(this.soulflowEnabledSetting) this.soulflowElement = new HudTextElement() @@ -311,12 +328,12 @@ class Hud extends Feature { }) this.registerSoopy("apiLoad", this.apiLoad) - if (this.FeatureManager.features["dataLoader"] && this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock) { + if (this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock) { this.apiLoad(this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock, "skyblock", true, true) this.lastSwappedPet = Date.now() } - if (this.FeatureManager.features["dataLoader"] && this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock_raw) { + if (this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock_raw) { this.apiLoad(this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock_raw, "skyblock", false, true) } @@ -377,6 +394,27 @@ class Hud extends Feature { } } + if (this.locationEnabledSetting.getValue()) { + + if (this.locationOnlyDungSetting.getValue()) { + if (!this.FeatureManager.features["dataLoader"].class.isInDungeon) { + this.locationElement.setText("") + return + } + } + + let locData = [] + locData.push(Player.getX()) + if (this.locationYEnabledSetting.getValue()) locData.push(Player.getY()) + locData.push(Player.getZ()) + + locData = locData.map(a => a.toFixed(parseInt(this.locationDecimals.getValue()))) + + let locString = locData.join("&7 | &f") + + this.locationElement.setText("&6Loc&7> &f" + locString) + } + if (!this.lagEnabled.getValue()) return if (this.packetMoves > 0) { this.secondPackets++ @@ -600,7 +638,7 @@ class Hud extends Feature { if (!Player.getPlayer()) return if (!Player.getInventory()) return - if (this.FeatureManager.features["dataLoader"] && !this.FeatureManager.features["dataLoader"].class.isInSkyblock) { + if (!this.FeatureManager.features["dataLoader"].class.isInSkyblock) { this.soulflowElement.setText("") this.petElement.setText("") return @@ -618,7 +656,7 @@ class Hud extends Feature { updatePotsTime() { if (!this.showPotsHud.getValue()) return - if (!this.FeatureManager.features["dataLoader"] || !this.FeatureManager.features["dataLoader"].class.isInSkyblock || this.FeatureManager.features["dataLoader"].class.isInDungeon) { + if (!this.FeatureManager.features["dataLoader"].class.isInSkyblock || this.FeatureManager.features["dataLoader"].class.isInDungeon) { this.potsHudElement.setText("") return } @@ -798,7 +836,7 @@ class Hud extends Feature { } updateHudThingos() { - let insb = !!(this.FeatureManager.features["dataLoader"] && this.FeatureManager.features["dataLoader"].class?.isInSkyblock) + let insb = !!(this.FeatureManager.features["dataLoader"].class?.isInSkyblock) this.hudStat.forEach(stat => { if (stat.enabled.getValue()) { |