aboutsummaryrefslogtreecommitdiff
path: root/features/globalSettings
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-11-07 01:23:02 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-11-07 01:23:02 +0800
commit2154f49bceed1ac8eeb1111ea402ddd2b243679d (patch)
treea0bb6d7150068f8cf25be3d2146302c651c4415a /features/globalSettings
parentb7848e65afbd06a9a549ee31912425680ab11536 (diff)
downloadSoopyV2-2154f49bceed1ac8eeb1111ea402ddd2b243679d.tar.gz
SoopyV2-2154f49bceed1ac8eeb1111ea402ddd2b243679d.tar.bz2
SoopyV2-2154f49bceed1ac8eeb1111ea402ddd2b243679d.zip
Add first load page (Still need to add the settings added in that though)
Diffstat (limited to 'features/globalSettings')
-rw-r--r--features/globalSettings/firstLoadPage.js40
-rw-r--r--features/globalSettings/firstLoadPages.js62
-rw-r--r--features/globalSettings/index.js67
3 files changed, 168 insertions, 1 deletions
diff --git a/features/globalSettings/firstLoadPage.js b/features/globalSettings/firstLoadPage.js
new file mode 100644
index 0000000..429c867
--- /dev/null
+++ b/features/globalSettings/firstLoadPage.js
@@ -0,0 +1,40 @@
+import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent"
+import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow"
+import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement"
+
+class FirstLoadPage extends SoopyGuiElement {
+ constructor(){
+ super()
+
+ this.setLocation(0,0,1,1)
+
+ this.guiPage = undefined
+ }
+
+ setLoc(addBack, addNext){
+ if(addBack){
+ let backButton = new ButtonWithArrow().setLocation(0.05, 0.85, 0.2, 0.1).setDirectionRight(false).setText("§0Back")
+
+ backButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ this.guiPage.prevPage()
+ }))
+
+ this.addChild(backButton)
+ }
+ if(addNext){
+ let nextButton = new ButtonWithArrow().setLocation(0.75, 0.85, 0.2, 0.1).setText("§0Next")
+
+ nextButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ this.guiPage.nextPage()
+ }))
+
+ this.addChild(nextButton)
+ }
+ }
+
+ load(){
+
+ }
+}
+
+export default FirstLoadPage \ No newline at end of file
diff --git a/features/globalSettings/firstLoadPages.js b/features/globalSettings/firstLoadPages.js
new file mode 100644
index 0000000..c7a90f0
--- /dev/null
+++ b/features/globalSettings/firstLoadPages.js
@@ -0,0 +1,62 @@
+import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent";
+import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow";
+import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement";
+import SoopyTextElement from "../../../guimanager/GuiElement/SoopyTextElement";
+import FirstLoadPage from "./firstLoadPage";
+
+class WelcomePage extends FirstLoadPage{
+ constructor(){
+ super()
+
+ this.addChild(new SoopyTextElement().setText("§0Welcome to SoopyAddons V2!").setLocation(0.1, 0.05,0.8,0.1).setMaxTextScale(10));
+
+ this.addChild(new SoopyTextElement().setText("§7First lets get privacy settings out of the way.").setLocation(0.1, 0.15,0.8,0.075).setMaxTextScale(10));
+
+ this.settingsArea = new SoopyGuiElement().setLocation(0.1, 0.25,0.8,0.75);
+
+ this.addChild(this.settingsArea);
+ }
+
+ load(){
+ let y = 0
+
+ this.guiPage.mainThing.privacySettings.forEach(setting => {
+ setting = setting.getGuiObject()
+
+ setting.location.location.y.set(y, 0)
+
+ this.settingsArea.addChild(setting);
+
+ y += 0.045+setting.location.size.y.get()
+ })
+ }
+}
+
+class HowToOpenMenuPage extends FirstLoadPage{
+ constructor(){
+ super()
+
+ this.addChild(new SoopyTextElement().setText("§0Your all set!").setLocation(0.1, 0.1,0.8,0.3).setMaxTextScale(10));
+
+ this.addChild(new SoopyTextElement().setText("§7To change any settings, or to access this menu again run §2/soopyaddons§7.").setLocation(0.1, 0.3,0.8,0.1).setMaxTextScale(10));
+
+ let openSettingsButton = new ButtonWithArrow().setText("§0Open settings").setLocation(0.1, 0.5,0.3,0.2).setDirectionRight(false)
+
+ openSettingsButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ ChatLib.command("soopyv2", true)
+ }))
+
+ this.addChild(openSettingsButton);
+
+ let closeButton = new ButtonWithArrow().setText("§0Close").setLocation(0.6, 0.5,0.3,0.2)
+
+ closeButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ Client.currentGui.close()
+ }))
+
+ this.addChild(closeButton);
+
+ }
+}
+
+export default [new WelcomePage(), new HowToOpenMenuPage()] \ No newline at end of file
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
index 422754f..04e3a20 100644
--- a/features/globalSettings/index.js
+++ b/features/globalSettings/index.js
@@ -4,6 +4,9 @@ import Feature from "../../featureClass/class";
import ButtonSetting from "../settings/settingThings/button";
import TextSetting from "../settings/settingThings/textSetting";
import ToggleSetting from "../settings/settingThings/toggle";
+import firstLoadPages from "./firstLoadPages";
+import GuiPage from "../soopyGui/GuiPage"
+import SoopyTextElement from "../../../guimanager/GuiElement/SoopyTextElement";
class Hud extends Feature {
constructor() {
@@ -13,8 +16,8 @@ class Hud extends Feature {
}
initVariables(){
-
this.apiKeySetting = undefined
+ this.GuiPage = undefined
}
onEnable(){
@@ -23,7 +26,20 @@ class Hud extends Feature {
this.notifyNewVersion = new ToggleSetting("Notify when there is a new update", "Will notify you when there is a new version of soopyv2 avalible for download", true, "notify_update", this) //TODO: Make false by default when uploaded on ct website
+
+ // this.reportErrorsSetting = new ToggleSetting("Send module errors to soopy server", "This will allow me to more effectivly fix them", false, "privacy_send_errors", this)
+ // this.sendChatSetting = new ToggleSetting("Send (hashed) chat messages to soopy server", "This will allow the hide spam feature to detect messages that are spam", false, "privacy_send_chat", this)
+
+ // this.privacySettings = [this.reportErrorsSetting, this.sendChatSetting]
+
+ // this.GuiPage = new FirstLoadingPage(this)
+
this.registerChat("&aYour new API key is &r&b${key}&r", this.newKey)
+
+ // new Thread(()=>{
+ // Thread.sleep(1000)
+ // ChatLib.command("soopyv2 first_load_thing", true)//TODO: ONLY RUN ON FIRST INSTALL
+ // }).start()
}
verifyKey(){
@@ -49,6 +65,55 @@ class Hud extends Feature {
}
}
+class FirstLoadingPage extends GuiPage {
+ constructor(mainThing){
+ super(-10)
+
+ this.showBackButton = false
+
+ this.name = "First load thing"
+
+ this.mainThing = mainThing
+
+ this.pageThings = []
+
+ firstLoadPages.forEach((page, i)=>{
+ let newPage = this.newPage()
+
+ newPage.addChild(page)
+
+ page.setLoc(i!==0, i!== firstLoadPages.length-1)
+ page.guiPage = this
+
+ this.pageThings.push(newPage)
+ })
+
+ this.pageNum = 0
+
+ this.finaliseLoading()
+ }
+
+ nextPage(){
+ this.pageNum++
+
+ this.goToPage(this.pageNum)
+ }
+
+ prevPage(){
+ this.pageNum--
+
+ this.goToPage(this.pageNum)
+ }
+
+ onOpen(){
+ this.pageNum = 0
+
+ firstLoadPages.forEach((page, i)=>{
+ page.load()
+ })
+ }
+}
+
module.exports = {
class: new Hud()
} \ No newline at end of file