From 48653ec89538f1650106a5e77463412cad4684c2 Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Sun, 31 Oct 2021 09:49:42 +0800
Subject: first commit
---
features/globalSettings/index.js | 51 +++++++++++++++++++++++++++++++++++
features/globalSettings/metadata.json | 8 ++++++
2 files changed, 59 insertions(+)
create mode 100644 features/globalSettings/index.js
create mode 100644 features/globalSettings/metadata.json
(limited to 'features/globalSettings')
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 @@
+///
+///
+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
--
cgit