aboutsummaryrefslogtreecommitdiff
path: root/features/senitherGui
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-15 16:36:38 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-15 16:36:38 +0800
commitbfdf6ed866aa89f59ebd3c438907975029e4ed8e (patch)
treeb411973fb2a4e1cbf59bdb6b5f3571557a513f80 /features/senitherGui
parent7b8088b0e901dd677972ae1cadc6447343c1e7d5 (diff)
downloadSoopyV2-bfdf6ed866aa89f59ebd3c438907975029e4ed8e.tar.gz
SoopyV2-bfdf6ed866aa89f59ebd3c438907975029e4ed8e.tar.bz2
SoopyV2-bfdf6ed866aa89f59ebd3c438907975029e4ed8e.zip
dungeon map improvements + allow searching guilds in senither gui
Diffstat (limited to 'features/senitherGui')
-rw-r--r--features/senitherGui/index.js52
1 files changed, 32 insertions, 20 deletions
diff --git a/features/senitherGui/index.js b/features/senitherGui/index.js
index 6b4efc1..ab80d0d 100644
--- a/features/senitherGui/index.js
+++ b/features/senitherGui/index.js
@@ -197,6 +197,14 @@ class SettingPage extends GuiPage {
this.guildSearchBox = new TextBox().setPlaceholder("Click to search").setLocation(0.2, 0.15, 0.6, 0.1)
this.guildPage.addChild(this.guildSearchBox)
this.guildSearch = ""
+ this.guildSearchBox.text.addEvent(new SoopyContentChangeEvent().setHandler((newVal, oldVal, resetFun)=>{
+ this.guildSearch = newVal
+
+ this.guildsBox.location.scroll.y.set(0, 100)
+ this.guildsBox._scrollAmount = 0
+
+ this.regenGuildElements()
+ }))
this.guildSortThing = "weight.total"
@@ -310,36 +318,40 @@ class SettingPage extends GuiPage {
regenGuildElements(){
this.guildsBox.clearChildren()
+ let yPosThing = 0
+
this.guildData.sort((a, b)=>{
return getThing(b, this.guildSortThing.split("."))-getThing(a, this.guildSortThing.split("."))
}).forEach((g, i)=>{
- let element = new SoopyBoxElement().setLocation(0,i*0.175, 1, 0.15)
+ if(g.name.toLowerCase().includes(this.guildSearch.toLowerCase())){
+ let element = new SoopyBoxElement().setLocation(0,yPosThing*0.175, 1, 0.15)
- element.addEvent(new SoopyHoverChangeEvent().setHandler(()=>{
- if(element.hovered){
- if(element.color[0]+element.color[1]+element.color[2]<0.5*(255+255+255)){
- element.setColorOffset(10, 10, 10, 100)
+ element.addEvent(new SoopyHoverChangeEvent().setHandler(()=>{
+ if(element.hovered){
+ if(element.color[0]+element.color[1]+element.color[2]<0.5*(255+255+255)){
+ element.setColorOffset(10, 10, 10, 100)
+ }else{
+ element.setColorOffset(-10, -10, -10, 100)
+ }
}else{
- element.setColorOffset(-10, -10, -10, 100)
+ element.setColorOffset(0, 0, 0, 100)
}
- }else{
- element.setColorOffset(0, 0, 0, 100)
- }
- }))
+ }))
- element.addChild(new SoopyTextElement().setText("§0#"+(i+1)).setLocation(0,0,0.075,1))
- element.addChild(new SoopyTextElement().setText("§0"+g.name).setLocation(0.1,0,0.2,1))
- element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(Math.floor(g.weight.total))).setLocation(0.325,0,0.15,1).setLore(["§6" + numberWithCommas(g.weight.skill) + " §7skill weight", "§6" + numberWithCommas(g.weight.slayer) + " §7slayer weight", "§6" + numberWithCommas(g.weight.catacomb) + " §7dungeons weight", "§6"+g.weight.multiplier + " §7multiplier"]))
- element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.members)).setLocation(0.475,0,0.1,1))
- element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.average_skill_progress)).setLocation(0.5875,0,0.1,1))
- element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(Math.floor(g.average_slayer))).setLocation(0.7,0,0.15,1))
- element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.average_catacomb)).setLocation(0.8625,0,0.1,1))
- // element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.members)).setLocation(0.75,0,0.2,1))
+ element.addChild(new SoopyTextElement().setText("§0#"+(i+1)).setLocation(0,0,0.075,1))
+ element.addChild(new SoopyTextElement().setText("§0"+g.name).setLocation(0.1,0,0.2,1))
+ element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(Math.floor(g.weight.total))).setLocation(0.325,0,0.15,1).setLore(["§6" + numberWithCommas(g.weight.skill) + " §7skill weight", "§6" + numberWithCommas(g.weight.slayer) + " §7slayer weight", "§6" + numberWithCommas(g.weight.catacomb) + " §7dungeons weight", "§6"+g.weight.multiplier + " §7multiplier"]))
+ element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.members)).setLocation(0.475,0,0.1,1))
+ element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.average_skill_progress)).setLocation(0.5875,0,0.1,1))
+ element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(Math.floor(g.average_slayer))).setLocation(0.7,0,0.15,1))
+ element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.average_catacomb)).setLocation(0.8625,0,0.1,1))
+ // element.addChild(new SoopyTextElement().setText("§0"+numberWithCommas(g.members)).setLocation(0.75,0,0.2,1))
- this.guildsBox.addChild(element)
+ this.guildsBox.addChild(element)
-
+ yPosThing++
+ }
// this.guildPage.addChild(new SoopyTextElement().setText("§0Pos").setLocation(0.1,0.3,0.075*0.8,0.1))
// this.guildPage.addChild(new SoopyTextElement().setText("§0Name").setLocation(0.1+0.1*0.8,0.3,0.2*0.8,0.1))
// this.guildPage.addChild(new SoopyTextElement().setText("§0Weight").setLocation(0.1+0.325*0.8,0.3,0.15*0.8,0.1))