diff options
Diffstat (limited to 'src/main/java/kr')
34 files changed, 281 insertions, 182 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/FeatureEditPane.java b/src/main/java/kr/syeyoung/dungeonsguide/config/FeatureEditPane.java index 40641386..f723646c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/FeatureEditPane.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/FeatureEditPane.java @@ -63,7 +63,7 @@ public class FeatureEditPane extends MPanel { @Override public void onBoundsUpdate() { for (MPanel panel :getChildComponents()){ - panel.setSize(new Dimension(bounds.width, 20)); + panel.setSize(new Dimension(getBounds().width, 20)); } } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java index 3a0a01bc..407c33bd 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/MFeature.java @@ -60,23 +60,23 @@ public class MFeature 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 resize(int parentWidth, int parentHeight) { - this.setSize(new Dimension(parentWidth, bounds.height)); + this.setSize(new Dimension(parentWidth, getBounds().height)); } @Override public void onBoundsUpdate() { - int x = bounds.width - 70; + int x = getBounds().width - 70; for (MPanel panel : addons) { - panel.setBounds(new Rectangle(x, 0, 70, bounds.height)); + panel.setBounds(new Rectangle(x, 0, 70, getBounds().height)); x -= 70; } - label.setBounds(new Rectangle(0,0,x, bounds.height)); + label.setBounds(new Rectangle(0,0,x, getBounds().height)); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java new file mode 100755 index 00000000..7d689cdb --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java @@ -0,0 +1,80 @@ +package kr.syeyoung.dungeonsguide.config.guiconfig; + +import kr.syeyoung.dungeonsguide.features.AbstractFeature; +import kr.syeyoung.dungeonsguide.features.FeatureRegistry; +import kr.syeyoung.dungeonsguide.roomedit.MPanel; +import kr.syeyoung.dungeonsguide.roomedit.elements.MTabbedPane; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +public class GuiGuiLocationConfig extends GuiScreen { + + private MPanel mainPanel = new MPanel(); + + public GuiGuiLocationConfig() { + + } + + @Override + public void initGui() { + super.initGui(); + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + mainPanel.setBounds(new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight())); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + + GL11.glPushMatrix(); + GlStateManager.pushAttrib(); + GlStateManager.color(0,0,0,0); + mainPanel.render0(scaledResolution, new Point(0,0), new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks); + GlStateManager.popAttrib(); + GL11.glPopMatrix(); + } + + @Override + public void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + mainPanel.keyTyped0(typedChar, keyCode); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + mainPanel.mouseClicked0(mouseX, mouseY,mouseX,mouseY, mouseButton); + } + + @Override + public void mouseReleased(int mouseX, int mouseY, int state) { + mainPanel.mouseReleased0(mouseX, mouseY,mouseX,mouseY, state); + } + + @Override + public void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { + mainPanel.mouseClickMove0(mouseX,mouseY,mouseX,mouseY,clickedMouseButton,timeSinceLastClick); + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + + int i = Mouse.getEventX() * this.width / this.mc.displayWidth; + int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + + int wheel = Mouse.getDWheel(); + if (wheel != 0) { + mainPanel.mouseScrolled0(i, j,i,j, wheel); + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java new file mode 100644 index 00000000..c8971acd --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java @@ -0,0 +1,23 @@ +package kr.syeyoung.dungeonsguide.config.guiconfig; + +import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.roomedit.MPanel; + +import java.awt.*; + +public class PanelDelegate extends MPanel { + private GuiFeature guiFeature; + public PanelDelegate(GuiFeature guiFeature) { + this.guiFeature = guiFeature; + } + + @Override + public Rectangle getBounds() { + return guiFeature.getFeatureRect(); + } + + @Override + public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { + super.render(absMousex, absMousey, relMousex0, relMousey0, partialTicks, scissor); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java index 8a7a3fd2..adf1bc09 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/MPanel.java @@ -35,30 +35,26 @@ public class MPanel { } public void setPosition(Point pt) { - this.bounds.x = pt.x; - this.bounds.y = pt.y; - onBoundsUpdate(); + this.setBounds(new Rectangle(pt.x, pt.y, getBounds().width, getBounds().height)); } public void setSize(Dimension dim) { - this.bounds.width = dim.width; - this.bounds.height = dim.height; - onBoundsUpdate(); + this.setBounds(new Rectangle(getBounds().x, getBounds().y, dim.width, dim.height)); } public Dimension getSize() { - return bounds.getSize(); + return getBounds().getSize(); } 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; for (MPanel childComponent : childComponents) { - childComponent.resize0(bounds.width, bounds.height); + childComponent.resize0(getBounds().width, getBounds().height); } onBoundsUpdate(); } @@ -78,12 +74,12 @@ public class MPanel { public void render0(ScaledResolution resolution, Point parentPoint, Rectangle parentClip, int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks) { // 0,0 - a a - int relMousex = relMousex0 - bounds.x; - int relMousey = relMousey0 - bounds.y; + int relMousex = relMousex0 - getBounds().x; + int relMousey = relMousey0 - getBounds().y; - GL11.glTranslated(bounds.x, bounds.y, 0); + GL11.glTranslated(getBounds().x, getBounds().y, 0); - Rectangle absBound = bounds.getBounds(); + Rectangle absBound = getBounds(); absBound.setLocation(absBound.x + parentPoint.x, absBound.y + parentPoint.y); Rectangle clip = determineClip(parentClip, absBound); lastAbsClip = clip; @@ -96,7 +92,7 @@ public class MPanel { OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GuiScreen.drawRect(0,0, bounds.width, bounds.height, backgroundColor.getRGB()); + GuiScreen.drawRect(0,0, getBounds().width, getBounds().height, backgroundColor.getRGB()); GL11.glPushMatrix(); render(absMousex, absMousey, relMousex, relMousey, partialTicks, clip); @@ -106,7 +102,7 @@ public class MPanel { GL11.glPopAttrib(); - Point newPt = new Point(parentPoint.x + bounds.x, parentPoint.y + bounds.y); + Point newPt = new Point(parentPoint.x + getBounds().x, parentPoint.y + getBounds().y); for (MPanel mPanel : getChildComponents()){ GL11.glPushMatrix(); @@ -150,8 +146,8 @@ public class MPanel { public void keyTyped(char typedChar, int keyCode) {} public boolean mouseClicked0(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0, int mouseButton) { - int relMousex = relMouseX0 - bounds.x; - int relMousey = relMouseY0 - bounds.y; + int relMousex = relMouseX0 - getBounds().x; + int relMousey = relMouseY0 - getBounds().y; boolean noClip = true; boolean focusedOverall = false; @@ -162,7 +158,7 @@ public class MPanel { } } - if (bounds.contains(relMouseX0, relMouseY0) && noClip) { + if (getBounds().contains(relMouseX0, relMouseY0) && noClip) { isFocused = true; focusedOverall = true; } else { @@ -176,8 +172,8 @@ public class MPanel { public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) {} public void mouseReleased0(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0, int state) { - int relMousex = relMouseX0 - bounds.x; - int relMousey = relMouseY0 - bounds.y; + int relMousex = relMouseX0 - getBounds().x; + int relMousey = relMouseY0 - getBounds().y; for (MPanel childComponent : getChildComponents()) { childComponent.mouseReleased0(absMouseX, absMouseY, relMousex, relMousey, state); @@ -187,8 +183,8 @@ public class MPanel { public void mouseReleased(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int state) {} public void mouseClickMove0(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0, int clickedMouseButton, long timeSinceLastClick) { - int relMousex = relMouseX0 - bounds.x; - int relMousey = relMouseY0 - bounds.y; + int relMousex = relMouseX0 - getBounds().x; + int relMousey = relMouseY0 - getBounds().y; for (MPanel childComponent : getChildComponents()) { childComponent.mouseClickMove0(absMouseX, absMouseY, relMousex, relMousey, clickedMouseButton, timeSinceLastClick); @@ -198,8 +194,8 @@ public class MPanel { public void mouseClickMove(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int clickedMouseButton, long timeSinceLastClick) {} public void mouseScrolled0(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0, int scrollAmount) { - int relMousex = relMouseX0 - bounds.x; - int relMousey = relMouseY0 - bounds.y; + int relMousex = relMouseX0 - getBounds().x; + int relMousey = relMouseY0 - getBounds().y; for (MPanel childComponent : getChildComponents()) { childComponent.mouseScrolled0(absMouseX, absMouseY, relMousex, relMousey, scrollAmount); 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 - |
