aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-02 19:43:45 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-02 19:43:45 +0800
commit9d1a7e4ebc4428be0e086dd4d75646294ba51f53 (patch)
tree11e8dec92d7c3bdf52faf29a890022e4dcd39a8d /features
parent7940745eb519224a6826f2b94ab7802cf05d94b8 (diff)
downloadSoopyV2-9d1a7e4ebc4428be0e086dd4d75646294ba51f53.tar.gz
SoopyV2-9d1a7e4ebc4428be0e086dd4d75646294ba51f53.tar.bz2
SoopyV2-9d1a7e4ebc4428be0e086dd4d75646294ba51f53.zip
+make stat history gui main page less cluttered and sidebar for more graphs
+ fix streamsgui preview images being stretched sometimes
Diffstat (limited to 'features')
-rw-r--r--features/dungeonSolvers/index.js2
-rw-r--r--features/statHistoryGui/index.js59
-rw-r--r--features/streamsGUI/index.js8
3 files changed, 44 insertions, 25 deletions
diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js
index 6454116..be405e4 100644
--- a/features/dungeonSolvers/index.js
+++ b/features/dungeonSolvers/index.js
@@ -324,7 +324,7 @@ class DungeonSolvers extends Feature {
step_5min() {
this.ezpz = false
- if (!data.success) return
+ if (!this.FeatureManager.features["dataLoader"].class.mayorData) return
if (this.FeatureManager.features["dataLoader"].class.mayorData.mayor.name === "Paul") {
if (this.FeatureManager.features["dataLoader"].class.currentMayorPerks.has("EZPZ")) {
this.ezpz = true
diff --git a/features/statHistoryGui/index.js b/features/statHistoryGui/index.js
index 173137f..bd9998b 100644
--- a/features/statHistoryGui/index.js
+++ b/features/statHistoryGui/index.js
@@ -14,6 +14,7 @@ import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow";
import { fetch } from "../../utils/networkUtils";
import SoopyImageElement from "../../../guimanager/GuiElement/SoopyImageElement";
import renderLibs from "../../../guimanager/renderLibs";
+import SoopyBoxElement from "../../../guimanager/GuiElement/SoopyBoxElement";
class StatHistoryGUI extends Feature {
constructor() {
@@ -79,6 +80,8 @@ class StatGraphPage extends GuiPage {
}
updateData(player) {
+ this.closeSidebarPage()
+
this.playerLoad = player
this.statArea._scrollAmount = 0
@@ -124,28 +127,40 @@ class StatGraphPage extends GuiPage {
let typeElm = new SoopyTextElement().setText("ยง0" + firstLetterWordCapital(type.replace("total", ""))).setMaxTextScale(2).setLocation(0.1, y, 0.8, 0.1)
this.statArea.addChild(typeElm)
y += 0.15
- let x = 0.05
- Object.keys(graphData[type]).forEach((graph, i) => {
- renderLibs.getImage(graphData[type][graph], true) //load image synchronously into cache so it knows the height
- console.log(graphData[type][graph])
- let graphElm = new SoopyImageElement()
- this.statArea.addChild(graphElm)
- graphElm.setImage(graphData[type][graph])
-
- if (i === 0) {
- graphElm.setLocation(0.1, y, 0.8, 0.25)
- graphElm.loadHeightFromImage()
- y += graphElm.location.size.y.get() + 0.05
- } else {
- graphElm.setLocation(x, y, 0.4, 0.25)
- graphElm.loadHeightFromImage()
- x += 0.5
- if (x > 0.7 || i === Object.keys(graphData[type]).length - 1) {
- x = 0.05
- y += graphElm.location.size.y.get() + 0.05
- }
- }
- })
+ let graph = Object.keys(graphData[type])[0]
+ renderLibs.getImage(graphData[type][graph], true) //load image synchronously into cache so it knows the height
+ let graphElm = new SoopyImageElement()
+ this.statArea.addChild(graphElm)
+ graphElm.setImage(graphData[type][graph])
+
+ graphElm.setLocation(0.1, y, 0.8, 0.25)
+ graphElm.loadHeightFromImage()
+ y += graphElm.location.size.y.get() + 0.05
+
+ if (Object.keys(graphData[type]).length > 1) {
+ graphElm.setLore(["Click to show more graphs"])
+ graphElm.addEvent(new SoopyMouseClickEvent().setHandler(() => {
+ let sideBarElm = new SoopyGuiElement().setLocation(0, 0, 1, 1)
+ sideBarElm.scrollable = true
+ this.openSidebarPage(sideBarElm)
+ let y2 = 0.05
+ new Thread(() => {
+ Object.keys(graphData[type]).forEach((graph, i) => {
+ if (i === 0) return
+ renderLibs.getImage(graphData[type][graph], true) //load image synchronously into cache so it knows the height
+ let graphElm = new SoopyImageElement()
+ sideBarElm.addChild(graphElm)
+ graphElm.setImage(graphData[type][graph])
+
+ graphElm.setLocation(0.1, y2, 0.8, 0.25)
+ graphElm.loadHeightFromImage()
+ y2 += graphElm.location.size.y.get() + 0.05
+ })
+ }).start()
+
+ }))
+ }
+
})
}).start()
})
diff --git a/features/streamsGUI/index.js b/features/streamsGUI/index.js
index d7d75cd..fec9bfa 100644
--- a/features/streamsGUI/index.js
+++ b/features/streamsGUI/index.js
@@ -73,10 +73,14 @@ class StreamPage extends GuiPage {
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))
+ let element = new StreamElement().setLocation(0, y, 0.45, 0.55).setStreamPage(this)
+ this.streamsBox.addChild(element)
+ element.setStream(stream, true)
}
if (i % 2 === 1) {
- this.streamsBox.addChild(new StreamElement().setStream(stream, true).setLocation(0.55, y, 0.45, 0.55).setStreamPage(this))
+ let element = new StreamElement().setLocation(0.55, y, 0.45, 0.55).setStreamPage(this)
+ this.streamsBox.addChild(element)
+ element.setStream(stream, true)
y += 0.6
}
})