diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
5 files changed, 21 insertions, 16 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java index 97c3f7db..79dcaef9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java @@ -54,8 +54,8 @@ public class FeatureDebuggableMap extends GuiFeature { @Override public void drawDemo(float partialTicks) { FontRenderer fr = getFontRenderer(); - fr.drawString("Please join a dungeon to see preview", getFeatureRect().width / 2 - fr.getStringWidth("Please join a dungeon to see preview") / 2, getFeatureRect().height / 2 - fr.FONT_HEIGHT / 2, 0xFFFFFFFF); + Rectangle featureRect = getFeatureRect().getRectangle(); GL11.glLineWidth(2); - RenderUtils.drawUnfilledBox(0,0,getFeatureRect().width, getFeatureRect().height, 0xff000000, false); + RenderUtils.drawUnfilledBox(0,0,featureRect.width, featureRect.height, 0xff000000, false); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java index ada1e3ef..abb5bebe 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureRoomCoordDisplay.java @@ -48,7 +48,7 @@ public class FeatureRoomCoordDisplay extends GuiFeature { FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; - double scale = getFeatureRect().getHeight() / fontRenderer.FONT_HEIGHT; + double scale = getFeatureRect().getRectangle().getHeight() / fontRenderer.FONT_HEIGHT; GlStateManager.scale(scale, scale, 0); int color = this.<Color>getParameter("color").getValue().getRGB(); @@ -60,6 +60,8 @@ public class FeatureRoomCoordDisplay extends GuiFeature { FontRenderer fr = getFontRenderer(); int facing = (int) (Minecraft.getMinecraft().thePlayer.rotationYaw + 45) % 360; if (facing < 0) facing += 360; + double scale = getFeatureRect().getRectangle().getHeight() / fr.FONT_HEIGHT; + GlStateManager.scale(scale, scale, 0); fr.drawString("X: 0 Y: 3 Z: 5 Facing: "+FeatureRoomCoordDisplay.facing[(facing / 90) % 4], 0,0, this.<Color>getParameter("color").getValue().getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java index 2f958169..a14b9c99 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java @@ -110,17 +110,18 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, DungeonContext context = skyblockStatus.getContext(); MapProcessor mapProcessor = context.getMapProcessor(); MapData mapData = mapProcessor.getLastMapData2(); - Gui.drawRect(0,0,getFeatureRect().width, getFeatureRect().height, RenderUtils.getColorAt(getFeatureRect().x, getFeatureRect().y, this.<AColor>getParameter("background_color").getValue())); + Rectangle featureRect =getFeatureRect().getRectangle(); + Gui.drawRect(0,0,featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, this.<AColor>getParameter("background_color").getValue())); GlStateManager.color(1,1,1,1); GlStateManager.pushMatrix();; if (mapData == null) { - Gui.drawRect(0,0,getFeatureRect().width, getFeatureRect().height, 0xFFFF0000); + Gui.drawRect(0,0,featureRect.width, featureRect.height, 0xFFFF0000); } else { renderMap(partialTicks,mapProcessor,mapData,context); } GlStateManager.popMatrix(); GL11.glLineWidth(2); - RenderUtils.drawUnfilledBox(0,0,getFeatureRect().width, getFeatureRect().height, this.<AColor>getParameter("border_color").getValue()); + RenderUtils.drawUnfilledBox(0,0,featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); } @Override @@ -129,16 +130,18 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener, drawHUD(partialTicks); return; } - Gui.drawRect(0,0,getFeatureRect().width, getFeatureRect().height, RenderUtils.getColorAt(getFeatureRect().x, getFeatureRect().y, this.<AColor>getParameter("background_color").getValue())); + Rectangle featureRect =getFeatureRect().getRectangle(); + Gui.drawRect(0,0,featureRect.width, featureRect.height, RenderUtils.getColorAt(featureRect.x, featureRect.y, this.<AColor>getParameter("background_color").getValue())); FontRenderer fr = getFontRenderer(); - fr.drawString("Please join a dungeon to see preview", getFeatureRect().width / 2 - fr.getStringWidth("Please join a dungeon to see preview") / 2, getFeatureRect().height / 2 - fr.FONT_HEIGHT / 2, 0xFFFFFFFF); + fr.drawString("Please join a dungeon to see preview", featureRect.width / 2 - fr.getStringWidth("Please join a dungeon to see preview") / 2, featureRect.height / 2 - fr.FONT_HEIGHT / 2, 0xFFFFFFFF); GL11.glLineWidth(2); - RenderUtils.drawUnfilledBox(0,0,getFeatureRect().width, getFeatureRect().height, this.<AColor>getParameter("border_color").getValue()); + RenderUtils.drawUnfilledBox(0,0,featureRect.width, featureRect.height, this.<AColor>getParameter("border_color").getValue()); } public void renderMap(float partialTicks, MapProcessor mapProcessor, MapData mapData, DungeonContext context){ float postScale = this.<Boolean>getParameter("playerCenter").getValue() ? this.<Float>getParameter("postScale").getValue() : 1; - int width = getFeatureRect().width; + Rectangle featureRect =getFeatureRect().getRectangle(); + int width = featureRect.width; float scale = (this.<Boolean>getParameter("scale").getValue() ? width / 128.0f : 1); GlStateManager.translate(width / 2, width / 2, 0); GlStateManager.scale(scale, scale, 0); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java index 6af93c63..9534f68f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java @@ -29,7 +29,7 @@ public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitLis public void drawHUD(float partialTicks) { if (System.currentTimeMillis() - leftDungeonTime > 20000) return; FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; - double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; + double scale = getFeatureRect().getRectangle().getHeight() / fr.FONT_HEIGHT; GlStateManager.scale(scale, scale, 0); fr.drawString("Cooldown: "+(20 - (System.currentTimeMillis() - leftDungeonTime) / 1000)+"s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } @@ -37,7 +37,7 @@ public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitLis @Override public void drawDemo(float partialTicks) { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; - double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; + double scale = getFeatureRect().getRectangle().getHeight() / fr.FONT_HEIGHT; GlStateManager.scale(scale, scale, 0); fr.drawString("Cooldown: 20s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java index 0727c36c..e6164fa4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java @@ -71,7 +71,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor(); - Rectangle feature = getFeatureRect(); + Rectangle feature = getFeatureRect().getRectangle(); FontRenderer fr = getFontRenderer(); Gui.drawRect(0, 0, feature.width, fr.FONT_HEIGHT + 4, 0xFF444444); @@ -88,7 +88,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis @Override public void drawDemo(float partialTicks) { - Rectangle feature = getFeatureRect(); + Rectangle feature = getFeatureRect().getRectangle(); FontRenderer fr = getFontRenderer(); Gui.drawRect(0, 0, feature.width, fr.FONT_HEIGHT + 4, 0xFF444444); @@ -128,7 +128,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor(); - Rectangle feature = getFeatureRect(); + Rectangle feature = getFeatureRect().getRectangle(); FontRenderer fr = getFontRenderer(); GlStateManager.translate(feature.x, feature.y, 0); Gui.drawRect(0, 0, feature.width, fr.FONT_HEIGHT + 4, 0xFF444444); @@ -337,7 +337,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; - Rectangle feature = getFeatureRect(); + Rectangle feature = getFeatureRect().getRectangle(); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; Point popupStart = new Point(feature.x + feature.width, (selected + 1) * fr.FONT_HEIGHT +6 + feature.y - dy); if (feature.contains(mouseX, mouseY)) { |