aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-08-24 00:20:33 +0900
committersyeyoung <cyong06@naver.com>2021-08-24 00:20:33 +0900
commit0c05fa4edc4558bd33176acff66b1fa70af906b7 (patch)
tree856fccf08e56a7dc957e792f891d1ad99a60cd36 /src/main/java/kr/syeyoung/dungeonsguide
parentab1f4fb39c77711c73251fb90c2f6b31d54e0970 (diff)
downloadSkyblock-Dungeons-Guide-0c05fa4edc4558bd33176acff66b1fa70af906b7.tar.gz
Skyblock-Dungeons-Guide-0c05fa4edc4558bd33176acff66b1fa70af906b7.tar.bz2
Skyblock-Dungeons-Guide-0c05fa4edc4558bd33176acff66b1fa70af906b7.zip
Optimized Mechanic Browser
- As expected setBounds call to MScalablePanel is expensive
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
index 7b8309ed..21898427 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
@@ -182,6 +182,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis
mPanels.add(new MPassiveLabelAndElement("Scale", new MFloatSelectionButton(FeatureMechanicBrowse.this.<Float>getParameter("scale").getValue()) {{
setOnUpdate(() ->{
FeatureMechanicBrowse.this.<Float>getParameter("scale").setValue(this.getData());
+ mGuiMechanicBrowser.initGui();
}); }
}));
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java
index 6ef99866..27d5e583 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/MGuiMechanicBrowser.java
@@ -34,12 +34,12 @@ public class MGuiMechanicBrowser extends MGui {
@Override
public void initGui() {
super.initGui();
+ panelMechanicBrowser.setBounds(featureMechanicBrowse.getFeatureRect().getRectangle());
+ panelMechanicBrowser.setScale(featureMechanicBrowse.getScale());
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- panelMechanicBrowser.setBounds(featureMechanicBrowse.getFeatureRect().getRectangle());
- panelMechanicBrowser.setScale(featureMechanicBrowse.getScale());
super.drawScreen(mouseX, mouseY, partialTicks);
}
}