diff options
author | syeyoung <cyong06@naver.com> | 2020-12-30 14:12:27 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2020-12-30 14:12:27 +0900 |
commit | 876fdf88c580c51dc794188c71e12898e6616dd8 (patch) | |
tree | bf25e93f6f95507fd90aacc133f0fd8be801634a /src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements | |
parent | 00c92d34b5373441f798da15341d5606693be684 (diff) | |
download | Skyblock-Dungeons-Guide-876fdf88c580c51dc794188c71e12898e6616dd8.tar.gz Skyblock-Dungeons-Guide-876fdf88c580c51dc794188c71e12898e6616dd8.tar.bz2 Skyblock-Dungeons-Guide-876fdf88c580c51dc794188c71e12898e6616dd8.zip |
use method, instead of field.
using field direct is baaaaaad
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements')
10 files changed, 50 insertions, 50 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java index 0334895f..7d6581fc 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java @@ -36,12 +36,12 @@ public class MButton extends MPanel { bg = hover; } if (bg != null) - Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB()); + Gui.drawRect(0,0,getBounds().width, getBounds().height, bg.getRGB()); FontRenderer renderer = Minecraft.getMinecraft().fontRendererObj; int width = renderer.getStringWidth(getText()); - int x = (bounds.width - width) / 2; - int y = (bounds.height - renderer.FONT_HEIGHT) / 2; + int x = (getBounds().width - width) / 2; + int y = (getBounds().height - renderer.FONT_HEIGHT) / 2; renderer.drawString(getText(), x,y, foreground.getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java index fc5ef5c0..c61e4f08 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java @@ -64,8 +64,8 @@ public class MIntegerSelectionButton extends MPanel { @Override public void onBoundsUpdate() { - dec.setBounds(new Rectangle(0,0,bounds.height, bounds.height)); - inc.setBounds(new Rectangle(bounds.width - bounds.height, 0, bounds.height, bounds.height)); - selected.setBounds(new Rectangle(bounds.height, 0, bounds.width - bounds.height - bounds.height, bounds.height)); + dec.setBounds(new Rectangle(0,0,getBounds().height, getBounds().height)); + inc.setBounds(new Rectangle(getBounds().width - getBounds().height, 0, getBounds().height, getBounds().height)); + selected.setBounds(new Rectangle(getBounds().height, 0, getBounds().width - getBounds().height - getBounds().height, getBounds().height)); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabel.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabel.java index 457f24fc..d01b858f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabel.java @@ -32,14 +32,14 @@ public class MLabel extends MPanel { int width = renderer.getStringWidth(getText()); int x,y; if (alignment == Alignment.CENTER) { - x = (bounds.width - width) / 2; - y = (bounds.height - renderer.FONT_HEIGHT) / 2; + x = (getBounds().width - width) / 2; + y = (getBounds().height - renderer.FONT_HEIGHT) / 2; } else if (alignment == Alignment.LEFT) { x = 0; - y = (bounds.height - renderer.FONT_HEIGHT) / 2; + y = (getBounds().height - renderer.FONT_HEIGHT) / 2; } else if (alignment == Alignment.RIGHT) { - x = bounds.width - width; - y = (bounds.height - renderer.FONT_HEIGHT) / 2; + x = getBounds().width - width; + y = (getBounds().height - renderer.FONT_HEIGHT) / 2; } else{ return; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java index af3fe01d..9bab1bdb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java @@ -25,8 +25,8 @@ public class MLabelAndElement extends MPanel { @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { - if (hover != null && new Rectangle(new Point(0,0),bounds.getSize()).contains(relMousex0, relMousey0)) { - Gui.drawRect(0,0,bounds.width, bounds.height, hover.getRGB()); + if (hover != null && new Rectangle(new Point(0,0),getBounds().getSize()).contains(relMousex0, relMousey0)) { + Gui.drawRect(0,0,getBounds().width, getBounds().height, hover.getRGB()); } } @@ -39,14 +39,14 @@ public class MLabelAndElement extends MPanel { @Override public void resize(int parentWidth, int parentHeight) { - this.setSize(new Dimension(parentWidth, bounds.height)); - label.setBounds(new Rectangle(0,0,parentHeight / 3, bounds.height)); - element.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, bounds.height)); + this.setSize(new Dimension(parentWidth, getBounds().height)); + label.setBounds(new Rectangle(0,0,parentHeight / 3, getBounds().height)); + element.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, getBounds().height)); } @Override public void onBoundsUpdate() { - label.setBounds(new Rectangle(0,0,bounds.width / 3, bounds.height)); - element.setBounds(new Rectangle(bounds.width / 3,0,bounds.width / 3 * 2, bounds.height)); + label.setBounds(new Rectangle(0,0,getBounds().width / 3, getBounds().height)); + element.setBounds(new Rectangle(getBounds().width / 3,0,getBounds().width / 3 * 2, getBounds().height)); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MParameter.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MParameter.java index f22bbc99..12ad9972 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MParameter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MParameter.java @@ -44,14 +44,14 @@ public class MParameter extends MPanel { @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { - if (hover != null && new Rectangle(new Point(0,0),bounds.getSize()).contains(relMousex0, relMousey0)) { - Gui.drawRect(0,0,bounds.width, bounds.height, hover.getRGB()); + if (hover != null && new Rectangle(new Point(0,0),getBounds().getSize()).contains(relMousex0, relMousey0)) { + Gui.drawRect(0,0,getBounds().width, getBounds().height, hover.getRGB()); } } @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { - if (this.bounds.x > -20 && lastAbsClip.contains(absMouseX, absMouseY)) { + if (this.getBounds().x > -20 && lastAbsClip.contains(absMouseX, absMouseY)) { // open new gui; EditingContext.getEditingContext().openGui(new GuiDungeonParameterEdit(this, processorParameterEditPane)); } @@ -59,14 +59,14 @@ public class MParameter extends MPanel { @Override public void resize(int parentWidth, int parentHeight) { - this.setSize(new Dimension(parentWidth, bounds.height)); - label.setBounds(new Rectangle(0,0,parentHeight / 3, bounds.height)); - data.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, bounds.height)); + this.setSize(new Dimension(parentWidth, getBounds().height)); + label.setBounds(new Rectangle(0,0,parentHeight / 3, getBounds().height)); + data.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, getBounds().height)); } @Override public void onBoundsUpdate() { - label.setBounds(new Rectangle(0,0,bounds.width / 3, bounds.height)); - data.setBounds(new Rectangle(bounds.width / 3,0,bounds.width / 3 * 2, bounds.height)); + label.setBounds(new Rectangle(0,0,getBounds().width / 3, getBounds().height)); + data.setBounds(new Rectangle(getBounds().width / 3,0,getBounds().width / 3 * 2, getBounds().height)); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java index 088a1bd9..39eec74f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java @@ -67,8 +67,8 @@ public class MStringSelectionButton extends MPanel { @Override public void onBoundsUpdate() { - dec.setBounds(new Rectangle(0,0,bounds.height, bounds.height)); - inc.setBounds(new Rectangle(bounds.width - bounds.height, 0, bounds.height, bounds.height)); - selected.setBounds(new Rectangle(bounds.height, 0, bounds.width - bounds.height - bounds.height, bounds.height)); + dec.setBounds(new Rectangle(0,0,getBounds().height, getBounds().height)); + inc.setBounds(new Rectangle(getBounds().width - getBounds().height, 0, getBounds().height, getBounds().height)); + selected.setBounds(new Rectangle(getBounds().height, 0, getBounds().width - getBounds().height - getBounds().height, getBounds().height)); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabButton.java index c21c1ff5..799c68a9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabButton.java @@ -42,12 +42,12 @@ public class MTabButton extends MPanel { bg = hover; } if (bg != null) - Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB()); + Gui.drawRect(0,0,getBounds().width, getBounds().height, bg.getRGB()); FontRenderer renderer = Minecraft.getMinecraft().fontRendererObj; int width = renderer.getStringWidth(text); - int x = (bounds.width - width) / 2; - int y = (bounds.height - renderer.FONT_HEIGHT) / 2; + int x = (getBounds().width - width) / 2; + int y = (getBounds().height - renderer.FONT_HEIGHT) / 2; renderer.drawString(text, x,y, foreground.getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabbedPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabbedPane.java index 48053cb6..7ac824ba 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabbedPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTabbedPane.java @@ -37,7 +37,7 @@ public class MTabbedPane extends MPanel { panel2.add(panel); panel2.setBackgroundColor(background2); tabs.put(tab, panel2); - panel2.setBounds(new Rectangle(0,15,bounds.width, bounds.height-15)); + panel2.setBounds(new Rectangle(0,15,getBounds().width, getBounds().height-15)); MTabButton button = new MTabButton(this, tab); button.setBackgroundColor(background2.brighter()); @@ -64,9 +64,9 @@ public class MTabbedPane extends MPanel { @Override public void setBounds(Rectangle bounds) { if (bounds == null) return; - this.bounds.x = bounds.x; - this.bounds.y = bounds.y; - this.bounds.width = bounds.width; - this.bounds.height = bounds.height; + this.bounds.x = getBounds().x; + this.bounds.y = getBounds().y; + this.bounds.width = getBounds().width; + this.bounds.height = getBounds().height; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTextField.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTextField.java index 017f5670..4f6a54cf 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTextField.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MTextField.java @@ -42,13 +42,13 @@ public class MTextField extends MPanel { @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle clip) { - Gui.drawRect(0,0,bounds.width, bounds.height, isFocused ? Color.white.getRGB() : Color.gray.getRGB()); - Gui.drawRect(1,1,bounds.width - 2, bounds.height - 2, Color.black.getRGB()); + Gui.drawRect(0,0,getBounds().width, getBounds().height, isFocused ? Color.white.getRGB() : Color.gray.getRGB()); + Gui.drawRect(1,1,getBounds().width - 2, getBounds().height - 2, Color.black.getRGB()); Minecraft mc = Minecraft.getMinecraft(); clip(new ScaledResolution(mc), clip.x + 1, clip.y + 1, clip.width - 2, clip.height - 2); FontRenderer fr = mc.fontRendererObj; - int y = (bounds.height - fr.FONT_HEIGHT) / 2; + int y = (getBounds().height - fr.FONT_HEIGHT) / 2; fr.drawString(text, 3 - xOffset, y, foreground.getRGB()); // draw selection if (isFocused) { @@ -72,7 +72,7 @@ public class MTextField extends MPanel { @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { - Rectangle actualField = new Rectangle(1, 3,bounds.width - 2, bounds.height - 6); + Rectangle actualField = new Rectangle(1, 3,getBounds().width - 2, getBounds().height - 6); if (!actualField.contains(relMouseX, relMouseY)) return; if (!lastAbsClip.contains(absMouseX, absMouseY)) return; @@ -139,11 +139,11 @@ public class MTextField extends MPanel { xOffset = 0; } int width = Minecraft.getMinecraft().fontRendererObj.getStringWidth(text); - int overflow = bounds.width - 3 - width; + int overflow = getBounds().width - 3 - width; if (overflow >= 0) { xOffset = 0; - } else if (width - xOffset + 10 < bounds.width) { - xOffset = width - bounds.width+10; + } else if (width - xOffset + 10 < getBounds().width) { + xOffset = width - getBounds().width+10; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MValue.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MValue.java index 3f8f2ec6..a7b910c5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MValue.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MValue.java @@ -39,26 +39,26 @@ public class MValue<T> extends MPanel { @Override public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { - if (hover != null && new Rectangle(new Point(0,0),bounds.getSize()).contains(relMousex0, relMousey0)) { - Gui.drawRect(0,0,bounds.width, bounds.height, hover.getRGB()); + if (hover != null && new Rectangle(new Point(0,0),getBounds().getSize()).contains(relMousex0, relMousey0)) { + Gui.drawRect(0,0,getBounds().width, getBounds().height, hover.getRGB()); } } @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { - if (this.bounds.x > -20 && lastAbsClip.contains(absMouseX, absMouseY)) { + if (this.getBounds().x > -20 && lastAbsClip.contains(absMouseX, absMouseY)) { EditingContext.getEditingContext().openGui(new GuiDungeonValueEdit(data, addons)); } } @Override public void resize(int parentWidth, int parentHeight) { - this.setSize(new Dimension(parentWidth, bounds.height)); - dataLab.setBounds(new Rectangle(0,0,parentWidth, bounds.height)); + this.setSize(new Dimension(parentWidth, getBounds().height)); + dataLab.setBounds(new Rectangle(0,0,parentWidth, getBounds().height)); } @Override public void onBoundsUpdate() { - dataLab.setBounds(new Rectangle(0,0,bounds.width, bounds.height)); + dataLab.setBounds(new Rectangle(0,0,getBounds().width, getBounds().height)); } } |