diff options
author | syeyoung <cyong06@naver.com> | 2021-08-24 00:20:33 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-08-24 00:20:33 +0900 |
commit | 0c05fa4edc4558bd33176acff66b1fa70af906b7 (patch) | |
tree | 856fccf08e56a7dc957e792f891d1ad99a60cd36 /src/main/java/kr/syeyoung/dungeonsguide | |
parent | ab1f4fb39c77711c73251fb90c2f6b31d54e0970 (diff) | |
download | Skyblock-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')
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); } } |