diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-07 15:24:24 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-07 15:24:24 +0800 |
commit | fd3d053e34ccd6ba21a6a3075ac69118ecc41fc7 (patch) | |
tree | 64ef8986beb7ea81b9433aca90d9907beb4815aa /features | |
parent | 2154f49bceed1ac8eeb1111ea402ddd2b243679d (diff) | |
download | SoopyV2-fd3d053e34ccd6ba21a6a3075ac69118ecc41fc7.tar.gz SoopyV2-fd3d053e34ccd6ba21a6a3075ac69118ecc41fc7.tar.bz2 SoopyV2-fd3d053e34ccd6ba21a6a3075ac69118ecc41fc7.zip |
Fix diana event waypoints
Diffstat (limited to 'features')
-rw-r--r-- | features/mining/index.js | 3 | ||||
-rw-r--r-- | features/soopyGui/index.js | 3 | ||||
-rw-r--r-- | features/streamsGUI/index.js | 136 | ||||
-rw-r--r-- | features/streamsGUI/metadata.json | 8 |
4 files changed, 147 insertions, 3 deletions
diff --git a/features/mining/index.js b/features/mining/index.js index 457ab84..c430e3a 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -1,9 +1,8 @@ /// <reference types="../../../CTAutocomplete" /> /// <reference lib="es2015" /> import Feature from "../../featureClass/class"; -import { drawBoxAtBlockNotVisThruWalls } from "../../utils/renderUtils"; import * as stringUtils from "../../utils/stringUtils"; -import * as utils from "../../utils/utils"; +import * as utils from "../../utils/utils" import HudTextElement from "../hud/HudTextElement"; import LocationSetting from "../settings/settingThings/location"; import ToggleSetting from "../settings/settingThings/toggle"; diff --git a/features/soopyGui/index.js b/features/soopyGui/index.js index 2a70b8f..aa4f691 100644 --- a/features/soopyGui/index.js +++ b/features/soopyGui/index.js @@ -61,13 +61,14 @@ class SoopyGui extends Feature { this.backButton.addEvent(backButtonEvent) this.mainWindowElement.addChild(this.categoryPage) - this.mainWindowElement.addChild(this.backButton) this.sidebarPage = new SoopyBoxElement().setLocation(0.3, 0.2, 0.3, 0.6) // this.sidebarPage.visable = false this.gui.element.addChild(this.sidebarPage) this.gui.element.addChild(this.mainWindowElement) + + this.mainWindowElement.addChild(this.backButton) this.updateButtons() } diff --git a/features/streamsGUI/index.js b/features/streamsGUI/index.js new file mode 100644 index 0000000..0277eb4 --- /dev/null +++ b/features/streamsGUI/index.js @@ -0,0 +1,136 @@ +/// <reference types="../../../CTAutocomplete" /> +/// <reference lib="es2015" /> +import SoopyTextElement from "../../../guimanager/GuiElement/SoopyTextElement"; +import Feature from "../../featureClass/class"; +import GuiPage from "../soopyGui/GuiPage"; +// import SoopyBoxElement from "../../../guimanager/GuiElement/SoopyBoxElement"; +// import SoopyMarkdownElement from "../../../guimanager/GuiElement/SoopyMarkdownElement"; +// import SoopyImageElement from "../../../guimanager/GuiElement/SoopyImageElement"; +// import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement"; +// import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent"; + +class StreamsGui extends Feature { + constructor() { + super() + } + + onEnable(){ + this.initVariables() + + // this.GuiPage = new StreamPage() + } + + initVariables(){ + this.GuiPage = undefined + } + + onDisable(){ + this.initVariables() + } +} + +/* +class StreamPage extends GuiPage { + constructor(){ + super(7) + + this.name = "Skyblock Streams" + + this.pages = [this.newPage()] + + + this.pages[0].addChild(new SoopyTextElement().setText("§0Skyblock Streams").setMaxTextScale(3).setLocation(0.1, 0.05, 0.8, 0.1)) + + this.streamsBox = new SoopyGuiElement().setLocation(0.1, 0.15, 0.8, 0.85) + + this.streamsBox.setScrollable(true) + + this.pages[0].addChild(this.streamsBox) + + this.finaliseLoading() + } + + updateStreams(){ + let streams = JSON.parse(FileLib.getUrlContent("http://soopymc.my.to/api/skyblockstreams")) + + this.streamsBox.clearChildren() + + let y = 0 + + Object.keys(streams.twitch).forEach((channel, i)=>{ + let stream = streams.twitch[channel] + + if(i%2===0){ + this.streamsBox.addChild(new StreamElement().setStream(stream, true).setLocation(0, y, 0.45, 0.55).setStreamPage(this)) + } + if(i%2===1){ + this.streamsBox.addChild(new StreamElement().setStream(stream, true).setLocation(0.55, y, 0.45, 0.55).setStreamPage(this)) + y+= 0.6 + } + }) + } + + openStreamSidebar(data){ + let sidebar = new SoopyGuiElement().setLocation(0,0,1,1) + + this.openSidebarPage(sidebar) + + + } + + onOpen(){ + new Thread(()=>{ + this.updateStreams() + }).start() + } +} + +class StreamElement extends SoopyBoxElement { + constructor(){ + super() + + this.streamData = undefined + + this.channelElement = new SoopyTextElement().setLocation(0.1,0.025,0.8,0.1).setMaxTextScale(10) + + this.channelImg = new SoopyImageElement().setLocation(0.1,0.125,0.8,0.2).loadHeightFromImage() + + this.titleElement = new SoopyMarkdownElement().setLocation(0.1,0.45,0.8,0.1) + + this.channelImg.onImageHeightChange(()=>{ + this.titleElement.location.location.y.set(0.15+this.channelImg.location.size.y.get()) + },this) + + this.streamPage = undefined + + this.addEvent(new SoopyMouseClickEvent().setHandler(()=>{ + this.streamPage.openStreamSidebar(this.streamData) + })) + + this.addChild(this.channelElement) + this.addChild(this.titleElement) + this.addChild(this.channelImg) + } + + setStream(stream, twitch){ + this.streamData = stream + + this.titleElement.setText(stream.title) + + this.channelElement.setText((twitch ? "§0"+stream.user_name : "§0"+stream.channelTitle) + (twitch?"&7 - " + stream.viewer_count + " viewers":"")) + + this.channelImg.setImage(twitch ? `https://static-cdn.jtvnw.net/previews-ttv/live_user_${stream.user_login}-640x360.jpg` : stream.thumbnails.high.url) + + return this + } + + setStreamPage(page){ + this.streamPage = page + + return this + } +}*/ + +module.exports = { + class: new StreamsGui() +}
\ No newline at end of file diff --git a/features/streamsGUI/metadata.json b/features/streamsGUI/metadata.json new file mode 100644 index 0000000..3123559 --- /dev/null +++ b/features/streamsGUI/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "Streams gui", + "description": "Gui for skyblock streams", + "isHidden": true, + "isTogglable": false, + "defaultEnabled": true, + "sortA": 0 +}
\ No newline at end of file |