aboutsummaryrefslogtreecommitdiff
path: root/features/globalSettings
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-10-31 09:49:42 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-10-31 09:49:42 +0800
commit48653ec89538f1650106a5e77463412cad4684c2 (patch)
tree09687cd579462e04d539fd4615369fa6dae13902 /features/globalSettings
downloadSoopyV2-48653ec89538f1650106a5e77463412cad4684c2.tar.gz
SoopyV2-48653ec89538f1650106a5e77463412cad4684c2.tar.bz2
SoopyV2-48653ec89538f1650106a5e77463412cad4684c2.zip
first commit
Diffstat (limited to 'features/globalSettings')
-rw-r--r--features/globalSettings/index.js51
-rw-r--r--features/globalSettings/metadata.json8
2 files changed, 59 insertions, 0 deletions
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
new file mode 100644
index 0000000..5b459f9
--- /dev/null
+++ b/features/globalSettings/index.js
@@ -0,0 +1,51 @@
+/// <reference types="../../../CTAutocomplete" />
+/// <reference lib="es2015" />
+import Feature from "../../featureClass/class";
+import ButtonSetting from "../settings/settingThings/button";
+import TextSetting from "../settings/settingThings/textSetting";
+
+class Hud extends Feature {
+ constructor() {
+ super()
+
+ this.initVariables()
+ }
+
+ initVariables(){
+
+ this.apiKeySetting = undefined
+ }
+
+ onEnable(){
+ this.apiKeySetting = new TextSetting("Api Key", "Your hypixel api key", "", "api_key", this, "Run /api new to load", true)
+ this.verifyApiKey = new ButtonSetting("Verify api key", "Click this to make sure the api key is working", "verify_key", this, "Click!", this.verifyKey, undefined)
+
+ this.registerChat("&aYour new API key is &r&b${key}&r", this.newKey)
+ }
+
+ verifyKey(){
+ if(this.module.apiKeySetting.getValue() == ""){
+ ChatLib.chat("&c[SOOPY V2] You need to set an api key first!")
+ return
+ }
+
+ var url = "https://api.hypixel.net/key?key=" + this.module.apiKeySetting.getValue()
+
+ ChatLib.chat("&c[SOOPY V2] The rest of checking is yet to be coded!")
+ }
+
+ newKey(key){
+ ChatLib.chat("&c[SOOPY V2] Copied api key!")
+ this.apiKeySetting.setValue(key)
+ }
+
+ onDisable(){
+ this.fpsEnabledSetting.delete()
+
+ this.initVariables()
+ }
+}
+
+module.exports = {
+ class: new Hud()
+} \ No newline at end of file
diff --git a/features/globalSettings/metadata.json b/features/globalSettings/metadata.json
new file mode 100644
index 0000000..801716f
--- /dev/null
+++ b/features/globalSettings/metadata.json
@@ -0,0 +1,8 @@
+{
+ "name": "Global Settings",
+ "description": "Settings that are applied globally",
+ "isHidden": false,
+ "isTogglable": false,
+ "defaultEnabled": true,
+ "sortA": 5
+} \ No newline at end of file