diff options
author | Ninjune x <enderknight537@gmail.com> | 2022-11-17 16:56:06 -0600 |
---|---|---|
committer | Ninjune x <enderknight537@gmail.com> | 2022-11-17 16:56:06 -0600 |
commit | fb63481d2c5b7b468df6c5ebdee30178bc9155f5 (patch) | |
tree | 3ec467f8acb9594c7b5547426a3b640856dc7e37 /gui | |
parent | 9085ac77ce364572b14f132b64ead5cde2194607 (diff) | |
download | coleweight-fb63481d2c5b7b468df6c5ebdee30178bc9155f5.tar.gz coleweight-fb63481d2c5b7b468df6c5ebdee30178bc9155f5.tar.bz2 coleweight-fb63481d2c5b7b468df6c5ebdee30178bc9155f5.zip |
1.6.0 Changelog in releasesv1.6.1
Diffstat (limited to 'gui')
-rw-r--r-- | gui/cwGui.js | 50 | ||||
-rw-r--r-- | gui/settingsGui.js | 29 |
2 files changed, 0 insertions, 79 deletions
diff --git a/gui/cwGui.js b/gui/cwGui.js deleted file mode 100644 index 734593c..0000000 --- a/gui/cwGui.js +++ /dev/null @@ -1,50 +0,0 @@ -import constants from "../util/constants"; - -let cwGui = new Gui() - -export function openCwGui() -{ - cwGui.open() -} - - -register("dragged", (dx, dy, x, y) => { - if (!cwGui.isOpen()) return - constants.data.x = x - constants.data.y = y - constants.data.save() -}); - -register("renderOverlay", () => { - if (cwGui.isOpen()) - { - let txt = "Please set your api key with /cw setkey (key)!" - if (constants.data.api_key != undefined) - txt = "Click anywhere to move!" - Renderer.drawStringWithShadow(txt, Renderer.screen.getWidth()/2 - Renderer.getStringWidth(txt)/2, Renderer.screen.getHeight()/2) - Renderer.drawStringWithShadow(`&aCW: &b0\n&aCW/hr: &b0\n&aUptime: &b0m\n&aColeweight Gained: &b0`, constants.data.x, constants.data.y) - } - if(!constants.data.cwToggle || constants.data.api_key == undefined) return - let coleweight = constants.data.coleweight || 0, - coleweightMessage = "" - - coleweight > 1000 ?coleweightMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`: coleweightMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}` - if(constants.cwValues[0] != undefined && constants.upTimeTrack && constants.calcCwPerHr) - { - constants.cwValuesSum = 0 - for(let i = 0; i < constants.cwValues.length; i++) - { - constants.cwValuesSum += constants.cwValues[i] - } - let eq = Math.ceil((constants.cwValuesSum*(3600/constants.uptime)) * 100) / 100 - eq != Infinity ? constants.coleweightHr = eq : constants.coleweightHr = "Calculating..." - constants.calcCwPerHr = false - } - - if (cwGui.isOpen() || !constants.upTimeTrack) return - let uptimeHr = Math.floor(constants.uptime/60/60) - if(uptimeHr >= 1) - Renderer.drawStringWithShadow(`&aCW: &b${coleweightMessage}\n&aCW/hr: &b${constants.coleweightHr}\n&aUptime: &b${uptimeHr}h ${Math.floor(constants.uptime/60) - uptimeHr*60}m\n&aColeweight Gained: &b${Math.ceil(constants.cwValuesSum*100) / 100}`, constants.data.x, constants.data.y) - else - Renderer.drawStringWithShadow(`&aCW: &b${coleweightMessage}\n&aCW/hr: &b${constants.coleweightHr}\n&aUptime: &b${Math.floor(constants.uptime/60)}m ${Math.floor(constants.uptime%60)}s\n&aColeweight Gained: &b${Math.ceil(constants.cwValuesSum*100) / 100}`, constants.data.x, constants.data.y) -})
\ No newline at end of file diff --git a/gui/settingsGui.js b/gui/settingsGui.js deleted file mode 100644 index 48dbad7..0000000 --- a/gui/settingsGui.js +++ /dev/null @@ -1,29 +0,0 @@ -import { @Vigilant, @ButtonProperty, @SwitchProperty, @SelectorProperty, @TextProperty } from 'Vigilance' -import constants from "../util/constants.js" - -@Vigilant("Coleweight") -class Settings { - @ButtonProperty({ - name: "Change tracker position", - description: "Move the location of the tracker.", - category: "General", - placeholder: "Open" - }) - moveLocation() { - ChatLib.command("cw move", true); - } - - @TextProperty({ - name: "TBA", - description: "TBA; This menu will probably not work while this text is here.", - category: "General", - protected: false - }) - key = ""; - - constructor() { - this.initialize(this); - } -} - -export default new Settings()
\ No newline at end of file |