diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-24 17:41:17 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-24 17:41:17 +0100 |
commit | bb35657f6c5869f04c4ce633446a1809a07a0c07 (patch) | |
tree | 1114bb5560dccc7e554fcf363140cfb1bda90d0d /src/main/java/at/hannibal2 | |
parent | 3adeb49eca10cd9c5408d0850e3b93fc57954dca (diff) | |
download | skyhanni-bb35657f6c5869f04c4ce633446a1809a07a0c07.tar.gz skyhanni-bb35657f6c5869f04c4ce633446a1809a07a0c07.tar.bz2 skyhanni-bb35657f6c5869f04c4ce633446a1809a07a0c07.zip |
started with new gui editor
Diffstat (limited to 'src/main/java/at/hannibal2')
53 files changed, 611 insertions, 532 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index b446a992f..0df857b26 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -120,6 +120,7 @@ public class SkyHanniMod { loadModule(new GardenCropMilestones()); loadModule(new OwnInventoryData()); loadModule(new ToolTipData()); + loadModule(new GuiEditManager()); // APIs loadModule(new BazaarApi()); diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 8e3331b33..998d83718 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -1,13 +1,12 @@ package at.hannibal2.skyhanni.config; -import at.hannibal2.skyhanni.SkyHanniMod; import at.hannibal2.skyhanni.config.core.GuiElement; import at.hannibal2.skyhanni.config.core.GuiScreenElementWrapper; import at.hannibal2.skyhanni.config.core.config.Config; import at.hannibal2.skyhanni.config.core.config.Position; import at.hannibal2.skyhanni.config.core.config.annotations.Category; -import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor; import at.hannibal2.skyhanni.config.features.*; +import at.hannibal2.skyhanni.data.GuiEditManager; import at.hannibal2.skyhanni.features.misc.HideArmor; import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager; import com.google.gson.annotations.Expose; @@ -17,9 +16,9 @@ import org.lwjgl.input.Keyboard; public class Features extends Config { private void editOverlay(String activeConfig, int width, int height, Position position) { - Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> { - }, () -> { - }, () -> SkyHanniMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(SkyHanniMod.feature, activeConfig)))); +// Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> { +// }, () -> { +// }, () -> SkyHanniMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(SkyHanniMod.feature, activeConfig)))); } @Override @@ -33,6 +32,11 @@ public class Features extends Config { } } + if (runnableId.equals("editGuiLocations")) { + GuiEditManager.openGuiEditor(); + return; + } + if (runnableId.equals("petDisplay")) { editOverlay(activeConfigCategory, 200, 16, misc.petDisplayPos); return; @@ -236,6 +240,10 @@ public class Features extends Config { } @Expose + @Category(name = "GUI Locations", desc = "Change the locations of GUI elements. (§e/sh gui§7)") + public GUI gui = new GUI(); + + @Expose @Category(name = "Chat", desc = "Change how the chat looks.") public Chat chat = new Chat(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index a279f1fc1..53ac4f37e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigEditor import at.hannibal2.skyhanni.config.commands.SimpleCommand.ProcessCommandRunnable import at.hannibal2.skyhanni.config.core.GuiScreenElementWrapper import at.hannibal2.skyhanni.data.ApiDataLoader +import at.hannibal2.skyhanni.data.GuiEditManager import at.hannibal2.skyhanni.features.bingo.BingoCardDisplay import at.hannibal2.skyhanni.features.bingo.BingoNextStepHelper import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper @@ -22,8 +23,12 @@ object Commands { private val openMainMenu: (Array<String>) -> Unit = { if (it.isNotEmpty()) { - SkyHanniMod.screenToOpen = - GuiScreenElementWrapper(ConfigEditor(SkyHanniMod.feature, StringUtils.join(it, " "))) + if (it[0].lowercase() == "gui") { + GuiEditManager.openGuiEditor() + } else { + SkyHanniMod.screenToOpen = + GuiScreenElementWrapper(ConfigEditor(SkyHanniMod.feature, StringUtils.join(it, " "))) + } } else { SkyHanniMod.screenToOpen = GuiScreenElementWrapper(ConfigEditor(SkyHanniMod.feature)) } diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/GuiPositionEditor.java b/src/main/java/at/hannibal2/skyhanni/config/core/config/GuiPositionEditor.java deleted file mode 100644 index abbb60646..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/GuiPositionEditor.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2022 NotEnoughUpdates contributors - * - * This file is part of NotEnoughUpdates. - * - * NotEnoughUpdates is free software: you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * NotEnoughUpdates is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. - */ - -package at.hannibal2.skyhanni.config.core.config; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; - -import java.io.IOException; - -public class GuiPositionEditor extends GuiScreen { - public PositionNew position = new PositionNew(); - - public int clickedX; - public int clickedY; - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - super.drawDefaultBackground(); - - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - int width = scaledResolution.getScaledWidth(); - int height = scaledResolution.getScaledHeight(); - - int x = position.resolveX(scaledResolution, 200); - int y = position.resolveY(scaledResolution, 100); - - int centerWidth = 176; - int centerHeight = 166; - - float centerWF = centerWidth / 2f / (float) width; - float centerHF = centerHeight / 2f / (float) height; - - float left = 0; - float top = 0; - float right = 0; - float bottom = 0; - - switch (position.getAnchorX()) { - case MIN: { - left = 0; - right = 0.5f - centerWF; - break; - } - case MID: { - left = 0.5f - centerWF; - right = 0.5f + centerWF; - break; - } - case MAX: { - left = 0.5f + centerWF; - right = 1; - break; - } - } - switch (position.getAnchorY()) { - case MIN: { - top = 0; - bottom = 0.5f - centerHF; - break; - } - case MID: { - top = 0.5f - centerHF; - bottom = 0.5f + centerHF; - break; - } - case MAX: { - top = 0.5f + centerHF; - bottom = 1; - break; - } - } - - Gui.drawRect( - (int) (left * width), - (int) (top * height), - (int) (right * width), - (int) (bottom * height), - 0x40404040 - ); - Gui.drawRect(x, y, x + 200, y + 100, 0x80404040); - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - int x = position.resolveX(scaledResolution, 200); - int y = position.resolveY(scaledResolution, 100); - - if (mouseX > x && mouseX < x + 200 && - mouseY > y && mouseY < y + 100) { - clickedX = mouseX; - clickedY = mouseY; - } else { - clickedX = -1; - clickedY = -1; - } - } - - @Override - protected void mouseReleased(int mouseX, int mouseY, int state) { - clickedX = -1; - clickedY = -1; - } - - @Override - protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { - if (clickedX >= 0 && clickedY >= 0) { - int deltaX = mouseX - clickedX; - int deltaY = mouseY - clickedY; - - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - - deltaX = position.moveX(scaledResolution, deltaX, 200); - deltaY = position.moveY(scaledResolution, deltaY, 100); - - clickedX += deltaX; - clickedY += deltaY; - } - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java b/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java index 91032ff1f..65bb35996 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java @@ -32,6 +32,9 @@ public class Position { @Expose private boolean centerY; + private boolean clicked = false; + public String internalName = null; + private static final int EDGE_OFFSET = 0; public Position(int x, int y) { @@ -53,15 +56,17 @@ public class Position { } public Position clone() { - return new Position(x, y, centerX, centerY); + Position position = new Position(x, y, centerX, centerY); + position.internalName = internalName; + return position; } - public boolean isCenterX() { - return centerX; - } +// public boolean isCenterX() { +// return ; +// } public boolean isCenterY() { - return centerY; + return false; } public int getRawX() { @@ -72,13 +77,16 @@ public class Position { return y; } + public void setClicked(boolean state) { + this.clicked = state; + } + public boolean getClicked() { + return clicked; + } + public int getAbsX(ScaledResolution scaledResolution, int objWidth) { int width = scaledResolution.getScaledWidth(); - if (centerX) { - return width / 2 + x; - } - int ret = x; if (x < 0) { ret = width + x - objWidth; @@ -93,10 +101,6 @@ public class Position { public int getAbsY(ScaledResolution scaledResolution, int objHeight) { int height = scaledResolution.getScaledHeight(); - if (centerY) { - return height / 2 + y; - } - int ret = y; if (y < 0) { ret = height + y - objHeight; @@ -113,21 +117,6 @@ public class Position { boolean wasPositiveX = this.x >= 0; this.x += deltaX; - if (centerX) { - if (wasPositiveX) { - if (this.x > screenWidth / 2 - objWidth / 2) { - deltaX += screenWidth / 2 - objWidth / 2 - this.x; - this.x = screenWidth / 2 - objWidth / 2; - } - } else { - if (this.x < -screenWidth / 2 + objWidth / 2) { - deltaX += -screenWidth / 2 + objWidth / 2 - this.x; - this.x = -screenWidth / 2 + objWidth / 2; - } - } - return deltaX; - } - if (wasPositiveX) { if (this.x < EDGE_OFFSET) { deltaX += EDGE_OFFSET - this.x; @@ -162,21 +151,6 @@ public class Position { boolean wasPositiveY = this.y >= 0; this.y += deltaY; - if (centerY) { - if (wasPositiveY) { - if (this.y > screenHeight / 2 - objHeight / 2) { - deltaY += screenHeight / 2 - objHeight / 2 - this.y; - this.y = screenHeight / 2 - objHeight / 2; - } - } else { - if (this.y < -screenHeight / 2 + objHeight / 2) { - deltaY += -screenHeight / 2 + objHeight / 2 - this.y; - this.y = -screenHeight / 2 + objHeight / 2; - } - } - return deltaY; - } - if (wasPositiveY) { if (this.y < EDGE_OFFSET) { deltaY += EDGE_OFFSET - this.y; diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt index 1bb404599..d09fcbc25 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt @@ -16,183 +16,204 @@ * You should have received a copy of the GNU Lesser General Public License * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. */ - -package at.hannibal2.skyhanni.config.core.config.gui; - -import at.hannibal2.skyhanni.config.core.config.Position; -import at.hannibal2.skyhanni.config.core.util.render.TextRenderUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -import java.io.IOException; - -public class GuiPositionEditor extends GuiScreen { - private final Position position; - private final Position originalPosition; - private final int elementWidth; - private final int elementHeight; - private final Runnable renderCallback; - private final Runnable positionChangedCallback; - private final Runnable closedCallback; - private boolean clicked = false; - private int grabbedX = 0; - private int grabbedY = 0; - -// private int guiScaleOverride = -1; - - public GuiPositionEditor( - Position position, int elementWidth, int elementHeight, - Runnable renderCallback, - Runnable positionChangedCallback, - Runnable closedCallback - ) { - this.position = position; - this.originalPosition = position.clone(); - this.elementWidth = elementWidth; - this.elementHeight = elementHeight; - this.renderCallback = renderCallback; - this.positionChangedCallback = positionChangedCallback; - this.closedCallback = closedCallback; - } - -// public GuiPositionEditor withScale(int scale) { -// this.guiScaleOverride = scale; -// return this; -// } - - @Override - public void onGuiClosed() { - super.onGuiClosed(); - closedCallback.run(); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - super.drawScreen(mouseX, mouseY, partialTicks); - ScaledResolution scaledResolution; -// if (guiScaleOverride >= 0) { -// scaledResolution = GuiRenderUtils.pushGuiScale(guiScaleOverride); -// } else { - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); -// } - - this.width = scaledResolution.getScaledWidth(); - this.height = scaledResolution.getScaledHeight(); - mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; - mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; - - drawDefaultBackground(); - - if (clicked) { - grabbedX += position.moveX(mouseX - grabbedX, elementWidth, scaledResolution); - grabbedY += position.moveY(mouseY - grabbedY, elementHeight, scaledResolution); - } - - renderCallback.run(); - - int x = position.getAbsX(scaledResolution, elementWidth); - int y = position.getAbsY(scaledResolution, elementHeight); - - if (position.isCenterX()) x -= elementWidth / 2; - if (position.isCenterY()) y -= elementHeight / 2; - Gui.drawRect(x, y, x + elementWidth, y + elementHeight, 0x80404040); - -// if (guiScaleOverride >= 0) { -// Utils.pushGuiScale(-1); -// } - - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - TextRenderUtils.drawStringCentered("Position Editor", Minecraft.getMinecraft().fontRendererObj, - scaledResolution.getScaledWidth() / 2, 8, true, 0xffffff - ); - TextRenderUtils.drawStringCentered("R to Reset - Arrow keys/mouse to move", Minecraft.getMinecraft().fontRendererObj, - scaledResolution.getScaledWidth() / 2, 18, true, 0xffffff - ); - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - super.mouseClicked(mouseX, mouseY, mouseButton); - - if (mouseButton == 0) { - ScaledResolution scaledResolution; -// if (guiScaleOverride >= 0) { -// scaledResolution = Utils.pushGuiScale(guiScaleOverride); -// } else { - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); -// } - mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; - mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; - - int x = position.getAbsX(scaledResolution, elementWidth); - int y = position.getAbsY(scaledResolution, elementHeight); - if (position.isCenterX()) x -= elementWidth / 2; - if (position.isCenterY()) y -= elementHeight / 2; - - if (mouseX >= x && mouseY >= y && - mouseX <= x + elementWidth && mouseY <= y + elementHeight) { - clicked = true; - grabbedX = mouseX; - grabbedY = mouseY; - } - -// if (guiScaleOverride >= 0) { -// Utils.pushGuiScale(-1); -// } - } - } - - @Override - protected void keyTyped(char typedChar, int keyCode) throws IOException { - if (keyCode == Keyboard.KEY_R) { - position.set(originalPosition); - } else if (!clicked) { - boolean shiftHeld = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); - int dist = shiftHeld ? 10 : 1; - if (keyCode == Keyboard.KEY_DOWN) { - position.moveY(dist, elementHeight, new ScaledResolution(Minecraft.getMinecraft())); - } else if (keyCode == Keyboard.KEY_UP) { - position.moveY(-dist, elementHeight, new ScaledResolution(Minecraft.getMinecraft())); - } else if (keyCode == Keyboard.KEY_LEFT) { - position.moveX(-dist, elementWidth, new ScaledResolution(Minecraft.getMinecraft())); - } else if (keyCode == Keyboard.KEY_RIGHT) { - position.moveX(dist, elementWidth, new ScaledResolution(Minecraft.getMinecraft())); - } - } - super.keyTyped(typedChar, keyCode); - } - - @Override - protected void mouseReleased(int mouseX, int mouseY, int state) { - super.mouseReleased(mouseX, mouseY, state); - clicked = false; - } - - @Override - protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { - super.mouseClickMove(mouseX, mouseY, clickedMouseButton, timeSinceLastClick); - - if (clicked) { - ScaledResolution scaledResolution; -// if (guiScaleOverride >= 0) { -// scaledResolution = Utils.pushGuiScale(guiScaleOverride); -// } else { - scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); -// } - mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; - mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; - - grabbedX += position.moveX(mouseX - grabbedX, elementWidth, scaledResolution); - grabbedY += position.moveY(mouseY - grabbedY, elementHeight, scaledResolution); - positionChangedCallback.run(); - -// if (guiScaleOverride >= 0) { -// Utils.pushGuiScale(-1); -// } - } - } -} +package at.hannibal2.skyhanni.config.core.config.gui + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.core.config.Position +import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsX_ +import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsY_ +import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getDummySize +import at.hannibal2.skyhanni.data.GuiEditManager.Companion.isCenterX_ +import io.github.moulberry.notenoughupdates.util.Utils +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.Keyboard +import org.lwjgl.input.Mouse +import java.io.IOException + +class GuiPositionEditor( + overlayPositions: LinkedHashMap<Position, Position>, + closedCallback: Runnable, +) : GuiScreen() { + private val positions: ArrayList<Position> + private val originalPositions: ArrayList<Position> + private val closedCallback: Runnable + private var grabbedX = 0 + private var grabbedY = 0 + private var clickedPos = -1 + + init { + val pos = ArrayList<Position>() + val ogPos = ArrayList<Position>() + for (i in 0 until overlayPositions.size) { + val overlay = ArrayList(overlayPositions.keys)[i] + pos.add(overlayPositions[overlay]!!) + ogPos.add(pos[i].clone()) + } + positions = pos + originalPositions = ogPos + this.closedCallback = closedCallback + } + + override fun onGuiClosed() { + super.onGuiClosed() + closedCallback.run() + clickedPos = -1 + } + + override fun drawScreen(unusedX: Int, unusedY: Int, partialTicks: Float) { + val border = 2 + var hoveredPos = -1 + + val scaledResolution = ScaledResolution(Minecraft.getMinecraft()) + var mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth + var mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1 + for (i in positions.indices.reversed()) { + val position = positions[i] + val elementWidth = position.getDummySize().x.toInt() + val elementHeight = position.getDummySize().y.toInt() + var x = position.getAbsX_() + var y = position.getAbsY_() + if (position.isCenterX_()) x -= elementWidth / 2 + if (position.isCenterY) y -= elementHeight / 2 + if (mouseX >= x - border && mouseY >= y - border && mouseX <= x + elementWidth + border * 2 && mouseY <= y + elementHeight + border * 2) { + hoveredPos = i + break + } + } + + drawDefaultBackground() + val text = "§cSkyHanni Position Editor" + Utils.drawStringCentered( + text, Minecraft.getMinecraft().fontRendererObj, + (scaledResolution.scaledWidth / 2).toFloat(), 8f, true, 0xffffff + ) + + super.drawScreen(mouseX, mouseY, partialTicks) + GlStateManager.pushMatrix() + width = scaledResolution.scaledWidth + height = scaledResolution.scaledHeight + mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth + mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1 + for (position in positions) { + var elementWidth = position.getDummySize(true).x.toInt() + var elementHeight = position.getDummySize(true).y.toInt() + if (position.clicked) { + grabbedX += position.moveX(mouseX - grabbedX, elementWidth, scaledResolution) + grabbedY += position.moveY(mouseY - grabbedY, elementHeight, scaledResolution) + } + var x = position.getAbsX_() + val y = position.getAbsY_() + if (position.isCenterX_()) x -= elementWidth / 2 + + elementWidth = position.getDummySize().x.toInt() + elementHeight = position.getDummySize().y.toInt() + drawRect(x - border, y - border, x + elementWidth + border * 2, y + elementHeight + border * 2, -0x7fbfbfc0) + + if (hoveredPos != -1) { + val pos = positions[hoveredPos] + Utils.drawStringCentered( + "§b" + pos.internalName, Minecraft.getMinecraft().fontRendererObj, + (scaledResolution.scaledWidth / 2).toFloat(), 18f, true, 0xffffff + ) + val location = "§7x: §e${pos.rawX}§7, y: §e${pos.rawY}" + Utils.drawStringCentered( + location, Minecraft.getMinecraft().fontRendererObj, + (scaledResolution.scaledWidth / 2).toFloat(), 28f, true, 0xffffff + ) + } + } + GlStateManager.popMatrix() + } + + @Throws(IOException::class) + override fun mouseClicked(originalX: Int, priginalY: Int, mouseButton: Int) { + super.mouseClicked(originalX, priginalY, mouseButton) + + val mouseX: Int + val mouseY: Int + if (mouseButton == 0) { + mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth + mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1 + for (i in positions.indices.reversed()) { + val position = positions[i] + val elementWidth = position.getDummySize().x.toInt() + val elementHeight = position.getDummySize().y.toInt() + var x = position.getAbsX_() + val y = position.getAbsY_() + if (position.isCenterX_()) x -= elementWidth / 2 + if (!position.clicked) { + if (mouseX >= x && mouseY >= y && mouseX <= x + elementWidth && mouseY <= y + elementHeight) { + clickedPos = i + position.clicked = true + grabbedX = mouseX + grabbedY = mouseY + break + } + } + } + } + } + + @Throws(IOException::class) + override fun keyTyped(typedChar: Char, keyCode: Int) { + if (clickedPos != -1) { + val position = positions[clickedPos] + val elementWidth = position.getDummySize(true).x.toInt() + val elementHeight = position.getDummySize(true).y.toInt() + if (keyCode == SkyHanniMod.feature.gui.keyBindReset) { + + position.set(originalPositions[positions.indexOf(position)]) + + // TODO option to reset everything +// val ii = 0 +// for (pos in positions) { +// pos.set(originalPositions[ii]) +// } + + + } else if (!position.clicked) { + val shiftHeld = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) + val dist = if (shiftHeld) 10 else 1 + if (keyCode == Keyboard.KEY_DOWN) { + position.moveY(dist, elementHeight, ScaledResolution(Minecraft.getMinecraft())) + } else if (keyCode == Keyboard.KEY_UP) { + position.moveY(-dist, elementHeight, ScaledResolution(Minecraft.getMinecraft())) + } else if (keyCode == Keyboard.KEY_LEFT) { + position.moveX(-dist, elementWidth, ScaledResolution(Minecraft.getMinecraft())) + } else if (keyCode == Keyboard.KEY_RIGHT) { + position.moveX(dist, elementWidth, ScaledResolution(Minecraft.getMinecraft())) + } + } + } + super.keyTyped(typedChar, keyCode) + } + + override fun mouseReleased(mouseX: Int, mouseY: Int, state: Int) { + super.mouseReleased(mouseX, mouseY, state) + for (position in positions) { + position.clicked = false + } + } + + override fun mouseClickMove(originalX: Int, priginalY: Int, clickedMouseButton: Int, timeSinceLastClick: Long) { + super.mouseClickMove(originalX, priginalY, clickedMouseButton, timeSinceLastClick) + + var mouseX: Int + var mouseY: Int + for (position in positions) { + val elementWidth = position.getDummySize(true).x.toInt() + val elementHeight = position.getDummySize(true).y.toInt() + if (position.clicked) { + val scaledResolution = Utils.pushGuiScale(-1) + mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth + mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1 + grabbedX += position.moveX(mouseX - grabbedX, elementWidth, scaledResolution) + grabbedY += position.moveY(mouseY - grabbedY, elementHeight, scaledResolution) + Utils.pushGuiScale(-1) + } + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java b/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java index 5c7c719ae..fb4d868db 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java @@ -2,7 +2,6 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; -import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorButton; import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorColour; import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; @@ -15,8 +14,8 @@ public class Ashfang { public boolean freezeCooldown = false; @Expose - @ConfigOption(name = "Freeze Position", desc = "") - @ConfigEditorButton(runnableId = "ashfangFreezeCooldown", buttonText = "Edit") +// @ConfigOption(name = "Freeze Position", desc = "") +// @ConfigEditorButton(runnableId = "ashfangFreezeCooldown", buttonText = "Edit") public Position freezeCooldownPos = new Position(10, 10, false, true); @Expose @@ -25,8 +24,8 @@ public class Ashfang { public boolean nextResetCooldown = false; @Expose - @ConfigOption(name = "Reset Position", desc = "") - @ConfigEditorButton(runnableId = "ashfangResetCooldown", buttonText = "Edit") +// @ConfigOption(name = "Reset Position", desc = "") +// @ConfigEditorButton(runnableId = "ashfangResetCooldown", buttonText = "Edit") public Position nextResetCooldownPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Bazaar.java b/src/main/java/at/hannibal2/skyhanni/config/features/Bazaar.java index a324d2a86..f592642a2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Bazaar.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bazaar.java @@ -2,7 +2,6 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; -import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorButton; import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; @@ -19,8 +18,8 @@ public class Bazaar { public boolean bestSellMethod = false; @Expose - @ConfigOption(name = "Best Sell Method Position", desc = "") - @ConfigEditorButton(runnableId = "bestSellMethod", buttonText = "Edit") +// @ConfigOption(name = "Best Sell Method Position", desc = "") +// @ConfigEditorButton(runnableId = "bestSellMethod", buttonText = "Edit") public Position bestSellMethodPos = new Position(10, 10, false, true); @Expose @@ -34,7 +33,7 @@ public class Bazaar { public boolean updateTimer = false; @Expose - @ConfigOption(name = "Update timer Position", desc = "") - @ConfigEditorButton(runnableId = "bazzarUpdateTimer", buttonText = "Edit") +// @ConfigOption(name = "Update timer Position", desc = "") +// @ConfigEditorButton(runnableId = "bazzarUpdateTimer", buttonText = "Edit") public Position updateTimerPos = new Position(10, 10, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java index 4eb0547d0..c3c6f6100 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java @@ -1,7 +1,10 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; -import at.hannibal2.skyhanni.config.core.config.annotations.*; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigAccordionId; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorAccordion; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; public class Bingo { @@ -24,8 +27,8 @@ public class Bingo { public boolean stepHelper = false; @Expose - @ConfigOption(name = "Bingo Card Position", desc = "") - @ConfigEditorButton(runnableId = "bingoCard", buttonText = "Edit") +// @ConfigOption(name = "Bingo Card Position", desc = "") +// @ConfigEditorButton(runnableId = "bingoCard", buttonText = "Edit") public Position bingoCardPos = new Position(10, 10, false, true); @ConfigOption(name = "Minion Craft Helper", desc = "") @@ -39,8 +42,8 @@ public class Bingo { public boolean minionCraftHelperEnabled = true; @Expose - @ConfigOption(name = "Minion Craft Helper Position", desc = "") - @ConfigEditorButton(runnableId = "minionCraftHelper", buttonText = "Edit") - @ConfigAccordionId(id = 0) +// @ConfigOption(name = "Minion Craft Helper Position", desc = "") +// @ConfigEditorButton(runnableId = "minionCraftHelper", buttonText = "Edit") +// @ConfigAccordionId(id = 0) public Position minionCraftHelperPos = new Position(10, 10, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java b/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java index 9817a259e..0f2abb6d3 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/DevData.java @@ -1,7 +1,10 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; -import at.hannibal2.skyhanni.config.core.config.annotations.*; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigAccordionId; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorAccordion; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; public class DevData { @@ -23,9 +26,9 @@ public class DevData { public boolean debugEnabled = false; @Expose - @ConfigOption(name = "Debug Location", desc = "") - @ConfigEditorButton(runnableId = "debugPos", buttonText = "Edit") - @ConfigAccordionId(id = 0) +// @ConfigOption(name = "Debug Location", desc = "") +// @ConfigEditorButton(runnableId = "debugPos", buttonText = "Edit") +// @ConfigAccordionId(id = 0) public Position debugPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java index 7a2ed35ed..783ef8f4a 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java @@ -1,7 +1,10 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; -import at.hannibal2.skyhanni.config.core.config.annotations.*; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigAccordionId; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorAccordion; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; public class Dungeon { @@ -22,9 +25,9 @@ public class Dungeon { public boolean showMilestonesDisplay = false; @Expose - @ConfigOption(name = "Milestone Display Position", desc = "") - @ConfigEditorButton(runnableId = "dungeonMilestonesDisplay", buttonText = "Edit") - @ConfigAccordionId(id = 0) +// @ConfigOption(name = "Milestone Display Position", desc = "") +// @ConfigEditorButton(runnableId = "dungeonMilestonesDisplay", buttonText = "Edit") +// @ConfigAccordionId(id = 0) public Position showMileStonesDisplayPos = new Position(10, 10, false, true); @ConfigOption(name = "Death Counter", desc = "") @@ -38,9 +41,9 @@ public class Dungeon { public boolean deathCounterDisplay = false; @Expose - @ConfigOption(name = "Death Counter Position", desc = "") - @ConfigEditorButton(runnableId = "dungeonDeathCounter", buttonText = "Edit") - @ConfigAccordionId(id = 1) +// @ConfigOption(name = "Death Counter Position", desc = "") +// @ConfigEditorButton(runnableId = "dungeonDeathCounter", buttonText = "Edit") +// @ConfigAccordionId(id = 1) public Position deathCounterPos = new Position(10, 10, false, true); @ConfigOption(name = "Clean End", desc = "") @@ -144,9 +147,9 @@ public class Dungeon { public boolean copilotEnabled = false; @Expose - @ConfigOption(name = "Copilot Pos", desc = "") - @ConfigEditorButton(runnableId = "dungeonCopilot", buttonText = "Edit") - @ConfigAccordionId(id = 5) +// @ConfigOption(name = "Copilot Pos", desc = "") +// @ConfigEditorButton(runnableId = "dungeonCopilot", buttonText = "Edit") +// @ConfigAccordionId(id = 5) public Position copilotPos = new Position(10, 10, false, true); @ConfigOption(name = "Party Finder", desc = "") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java b/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java index 3d4dc3df5..236351ce8 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java @@ -84,9 +84,9 @@ public class Fishing { public boolean barnTimer = true; @Expose - @ConfigOption(name = "Fishing Timer Location", desc = "") - @ConfigEditorButton(runnableId = "barnTimer", buttonText = "Edit") - @ConfigAccordionId(id = 2) +// @ConfigOption(name = "Fishing Timer Location", desc = "") +// @ConfigEditorButton(runnableId = "barnTimer", buttonText = "Edit") +// @ConfigAccordionId(id = 2) public Position barnTimerPos = new Position(10, 10, false, true); @Expose @@ -113,9 +113,9 @@ public class Fishing { public boolean sharkFishCounter = false; @Expose - @ConfigOption(name = "Shark Location", desc = "") - @ConfigEditorButton(runnableId = "sharkFishCounter", buttonText = "Edit") - @ConfigAccordionId(id = 3) +// @ConfigOption(name = "Shark Location", desc = "") +// @ConfigEditorButton(runnableId = "sharkFishCounter", buttonText = "Edit") +// @ConfigAccordionId(id = 3) public Position sharkFishCounterPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/GUI.java b/src/main/java/at/hannibal2/skyhanni/config/features/GUI.java new file mode 100644 index 000000000..c752e92cf --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/GUI.java @@ -0,0 +1,37 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.config.core.config.Position; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorButton; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorKeybind; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; +import com.google.gson.annotations.Expose; +import org.lwjgl.input.Keyboard; + +public class GUI { + + @ConfigOption( + name = "Edit GUI Locations", + desc = "Change the position of SkyHanni's overlays" + ) + @ConfigEditorButton( + runnableId = "editGuiLocations", + buttonText = "Edit" + ) + public Position positions = new Position(-1, -1); + + @Expose + @ConfigOption( + name = "Open Hotkey", + desc = "Press this key to open the GUI Editor." + ) + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int keyBindOpen = Keyboard.KEY_NONE; + + @Expose + @ConfigOption( + name = "Hotkey Reset", + desc = "Press this key in the GUI Editor to reset the current element." + ) + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_R) + public int keyBindReset = Keyboard.KEY_R; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index 7f0c8ce10..f55fdb514 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -29,9 +29,9 @@ public class Garden { public boolean skyMartCopperPriceAdvancedStats = false; @Expose - @ConfigOption(name = "Copper Price Position", desc = "") - @ConfigEditorButton(runnableId = "skyMartCopperPrice", buttonText = "Edit") - @ConfigAccordionId(id = 0) +// @ConfigOption(name = "Copper Price Position", desc = "") +// @ConfigEditorButton(runnableId = "skyMartCopperPrice", buttonText = "Edit") +// @ConfigAccordionId(id = 0) public Position skyMartCopperPricePos = new Position(188, -105, false, true); @Expose @@ -53,9 +53,9 @@ public class Garden { public boolean visitorTimerEnabled = true; @Expose - @ConfigOption(name = "Visitor Timer Position", desc = "") - @ConfigEditorButton(runnableId = "visitorTimer", buttonText = "Edit") - @ConfigAccordionId(id = 2) +// @ConfigOption(name = "Visitor Timer Position", desc = "") +// @ConfigEditorButton(runnableId = "visitorTimer", buttonText = "Edit") +// @ConfigAccordionId(id = 2) public Position visitorTimerPos = new Position(-373, -203, false, true); @Expose @@ -71,9 +71,9 @@ public class Garden { public boolean visitorNeedsDisplay = true; @Expose - @ConfigOption(name = "Items Needed Position", desc = "") - @ConfigEditorButton(runnableId = "visitorNeeds", buttonText = "Edit") - @ConfigAccordionId(id = 3) +// @ConfigOption(name = "Items Needed Position", desc = "") +// @ConfigEditorButton(runnableId = "visitorNeeds", buttonText = "Edit") +// @ConfigAccordionId(id = 3) public Position visitorNeedsPos = new Position(155, -57, false, true); @Expose @@ -197,9 +197,9 @@ public class Garden { public List<Integer> cropMilestoneText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4)); @Expose - @ConfigOption(name = "Display Position", desc = "") - @ConfigEditorButton(runnableId = "cropMilestoneProgress", buttonText = "Edit") - @ConfigAccordionId(id = 6) +// @ConfigOption(name = "Display Position", desc = "") +// @ConfigEditorButton(runnableId = "cropMilestoneProgress", buttonText = "Edit") +// @ConfigAccordionId(id = 6) public Position cropMilestoneProgressDisplayPos = new Position(376, 19, false, true); @Expose @@ -245,9 +245,9 @@ public class Garden { public boolean cropMilestoneBestAlwaysOn = false; @Expose - @ConfigOption(name = "Display Position", desc = "") - @ConfigEditorButton(runnableId = "cropMilestoneNext", buttonText = "Edit") - @ConfigAccordionId(id = 7) +// @ConfigOption(name = "Display Position", desc = "") +// @ConfigEditorButton(runnableId = "cropMilestoneNext", buttonText = "Edit") +// @ConfigAccordionId(id = 7) public Position cropMilestoneNextDisplayPos = new Position(-112, -143, false, true); @Expose @@ -283,9 +283,9 @@ public class Garden { public List<Integer> cropMilestoneMushroomPetPerkText = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); @Expose - @ConfigOption(name = "Display Position", desc = "") - @ConfigEditorButton(runnableId = "cropMilestoneMushroomPetPerk", buttonText = "Edit") - @ConfigAccordionId(id = 15) +// @ConfigOption(name = "Display Position", desc = "") +// @ConfigEditorButton(runnableId = "cropMilestoneMushroomPetPerk", buttonText = "Edit") +// @ConfigAccordionId(id = 15) public Position cropMilestoneMushroomPetPerkPos = new Position(-112, -143, false, true); // TODO moulconfig runnable support @@ -370,9 +370,9 @@ public class Garden { public boolean optimalSpeedWarning = false; @Expose - @ConfigOption(name = "Speed Warning Position", desc = "") - @ConfigEditorButton(runnableId = "optimalSpeed", buttonText = "Edit") - @ConfigAccordionId(id = 9) +// @ConfigOption(name = "Speed Warning Position", desc = "") +// @ConfigEditorButton(runnableId = "optimalSpeed", buttonText = "Edit") +// @ConfigAccordionId(id = 9) public Position optimalSpeedPos = new Position(188, -105, false, true); @Expose @@ -387,9 +387,9 @@ public class Garden { public boolean gardenLevelDisplay = true; @Expose - @ConfigOption(name = "Garden Level Position", desc = "") - @ConfigEditorButton(runnableId = "gardenLevel", buttonText = "Edit") - @ConfigAccordionId(id = 10) +// @ConfigOption(name = "Garden Level Position", desc = "") +// @ConfigEditorButton(runnableId = "gardenLevel", buttonText = "Edit") +// @ConfigAccordionId(id = 10) public Position gardenLevelPos = new Position(-375, -215, false, true); @Expose @@ -406,9 +406,9 @@ public class Garden { public boolean eliteFarmingWeightDisplay = true; @Expose - @ConfigOption(name = "Farming Weight Position", desc = "") - @ConfigEditorButton(runnableId = "eliteFarmingWeight", buttonText = "Edit") - @ConfigAccordionId(id = 11) +// @ConfigOption(name = "Farming Weight Position", desc = "") +// @ConfigEditorButton(runnableId = "eliteFarmingWeight", buttonText = "Edit") +// @ConfigAccordionId(id = 11) public Position eliteFarmingWeightPos = new Position(-370, -167, false, true); @Expose @@ -443,9 +443,9 @@ public class Garden { public boolean dicerCounterDisplay = true; @Expose - @ConfigOption(name = "Dicer Counter Position", desc = "") - @ConfigEditorButton(runnableId = "dicerCounter", buttonText = "Edit") - @ConfigAccordionId(id = 12) +// @ConfigOption(name = "Dicer Counter Position", desc = "") +// @ConfigEditorButton(runnableId = "dicerCounter", buttonText = "Edit") +// @ConfigAccordionId(id = 12) public Position dicerCounterPos = new Position(16, -232, false, true); @Expose @@ -494,9 +494,9 @@ public class Garden { public boolean moneyPerHourCompactPrice = false; @Expose - @ConfigOption(name = "Money per hour Position", desc = "") - @ConfigEditorButton(runnableId = "moneyPerHour", buttonText = "Edit") - @ConfigAccordionId(id = 13) +// @ConfigOption(name = "Money per hour Position", desc = "") +// @ConfigEditorButton(runnableId = "moneyPerHour", buttonText = "Edit") +// @ConfigAccordionId(id = 13) public Position moneyPerHourPos = new Position(16, -232, false, true); @Expose @@ -523,9 +523,9 @@ public class Garden { public boolean nextJacobContestOtherGuis = false; @Expose - @ConfigOption(name = "Jacob Contest Position", desc = "") - @ConfigEditorButton(runnableId = "nextJacobContest", buttonText = "Edit") - @ConfigAccordionId(id = 14) +// @ConfigOption(name = "Jacob Contest Position", desc = "") +// @ConfigEditorButton(runnableId = "nextJacobContest", buttonText = "Edit") +// @ConfigAccordionId(id = 14) public Position nextJacobContestPos = new Position(-113, -240, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java b/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java index 31080839a..cd721dd8d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Minions.java @@ -77,9 +77,9 @@ public class Minions { public boolean hopperProfitDisplay = true; @Expose - @ConfigOption(name = "Best Sell Method Position", desc = "") - @ConfigEditorButton(runnableId = "hopperProfitDisplay", buttonText = "Edit") - @ConfigAccordionId(id = 2) +// @ConfigOption(name = "Best Sell Method Position", desc = "") +// @ConfigEditorButton(runnableId = "hopperProfitDisplay", buttonText = "Edit") +// @ConfigAccordionId(id = 2) public Position hopperProfitPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 09df06dff..73d301d78 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -1,7 +1,10 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; -import at.hannibal2.skyhanni.config.core.config.annotations.*; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigAccordionId; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorAccordion; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; public class Misc { @@ -18,9 +21,9 @@ public class Misc { public boolean petDisplay = false; @Expose - @ConfigOption(name = "Pet Display Position", desc = "") - @ConfigEditorButton(runnableId = "petDisplay", buttonText = "Edit") - @ConfigAccordionId(id = 0) +// @ConfigOption(name = "Pet Display Position", desc = "") +// @ConfigEditorButton(runnableId = "petDisplay", buttonText = "Edit") +// @ConfigAccordionId(id = 0) public Position petDisplayPos = new Position(-111, 221, false, true); @Expose @@ -35,9 +38,9 @@ public class Misc { public boolean realTime = false; @Expose - @ConfigOption(name = "Real Time Position", desc = "") - @ConfigEditorButton(runnableId = "realTime", buttonText = "Edit") - @ConfigAccordionId(id = 1) +// @ConfigOption(name = "Real Time Position", desc = "") +// @ConfigEditorButton(runnableId = "realTime", buttonText = "Edit") +// @ConfigAccordionId(id = 1) public Position realTimePos = new Position(10, 10, false, true); @Expose @@ -86,9 +89,9 @@ public class Misc { public boolean nonGodPotEffectDisplay = false; @Expose - @ConfigOption(name = "Pot Effects Position", desc = "") - @ConfigEditorButton(runnableId = "nonGodPotEffect", buttonText = "Edit") - @ConfigAccordionId(id = 5) +// @ConfigOption(name = "Pot Effects Position", desc = "") +// @ConfigEditorButton(runnableId = "nonGodPotEffect", buttonText = "Edit") +// @ConfigAccordionId(id = 5) public Position nonGodPotEffectPos = new Position(10, 10, false, true); @Expose @@ -103,9 +106,9 @@ public class Misc { public boolean crimsonIsleReputationHelper = true; @Expose - @ConfigOption(name = "Reputation Position", desc = "") - @ConfigEditorButton(runnableId = "crimsonIsleReputationHelper", buttonText = "Edit") - @ConfigAccordionId(id = 6) +// @ConfigOption(name = "Reputation Position", desc = "") +// @ConfigEditorButton(runnableId = "crimsonIsleReputationHelper", buttonText = "Edit") +// @ConfigAccordionId(id = 6) public Position crimsonIsleReputationHelperPos = new Position(10, 10, false, true); @Expose @@ -155,9 +158,9 @@ public class Misc { public boolean tpsDisplayEnabled = false; @Expose - @ConfigOption(name = "Tps Display Position", desc = "") - @ConfigEditorButton(runnableId = "tpsDisplay", buttonText = "Edit") - @ConfigAccordionId(id = 8) +// @ConfigOption(name = "Tps Display Position", desc = "") +// @ConfigEditorButton(runnableId = "tpsDisplay", buttonText = "Edit") +// @ConfigAccordionId(id = 8) public Position tpsDisplayPosition = new Position(10, 10, false, true); @Expose @@ -213,9 +216,9 @@ public class Misc { public boolean chickenHeadTimerDisplay = false; @Expose - @ConfigOption(name = "Timer Position", desc = "") - @ConfigEditorButton(runnableId = "chickenHeadTimer", buttonText = "Edit") - @ConfigAccordionId(id = 10) +// @ConfigOption(name = "Timer Position", desc = "") +// @ConfigEditorButton(runnableId = "chickenHeadTimer", buttonText = "Edit") +// @ConfigAccordionId(id = 10) public Position chickenHeadTimerPosition = new Position(-372, 73, false, true); @Expose @@ -224,8 +227,8 @@ public class Misc { public boolean hideExpBottles = false; @Expose - @ConfigOption(name = "Collection Counter Position", desc = "Tracking the number of items you collect. §cDoes not work with sacks.") - @ConfigEditorButton(runnableId = "collectionCounter", buttonText = "Edit") +// @ConfigOption(name = "Collection Counter Position", desc = "Tracking the number of items you collect. §cDoes not work with sacks.") +// @ConfigEditorButton(runnableId = "collectionCounter", buttonText = "Edit") public Position collectionCounterPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Summonings.java b/src/main/java/at/hannibal2/skyhanni/config/features/Summonings.java index 7a35405dc..8a1061bad 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Summonings.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Summonings.java @@ -1,7 +1,10 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.Position; -import at.hannibal2.skyhanni.config.core.config.annotations.*; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigAccordionId; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorAccordion; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; import com.google.gson.annotations.Expose; public class Summonings { @@ -24,9 +27,9 @@ public class Summonings { public boolean summoningMobDisplay = false; @Expose - @ConfigOption(name = "Summoning Mob Display Position", desc = "") - @ConfigEditorButton(runnableId = "summoningMobDisplay", buttonText = "Edit") - @ConfigAccordionId(id = 0) +// @ConfigOption(name = "Summoning Mob Display Position", desc = "") +// @ConfigEditorButton(runnableId = "summoningMobDisplay", buttonText = "Edit") +// @ConfigAccordionId(id = 0) public Position summoningMobDisplayPos = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt new file mode 100644 index 000000000..058eb92a3 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -0,0 +1,114 @@ +package at.hannibal2.skyhanni.data + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.core.config.Position +import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor +import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import io.github.moulberry.notenoughupdates.NotEnoughUpdates +import net.minecraft.client.Minecraft +import net.minecraft.client.gui.ScaledResolution +import net.minecraft.client.renderer.GlStateManager +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import net.minecraftforge.fml.common.gameevent.InputEvent +import org.lwjgl.input.Keyboard +import org.lwjgl.util.vector.Vector2f +import java.util.* + +class GuiEditManager { + + // TODO Make utils method for this + @SubscribeEvent + fun onKeyBindPressed(event: InputEvent.KeyInputEvent) { + if (!LorenzUtils.inSkyBlock) return + + if (!Keyboard.getEventKeyState()) return + val key = if (Keyboard.getEventKey() == 0) Keyboard.getEventCharacter().code + 256 else Keyboard.getEventKey() + if (SkyHanniMod.feature.gui.keyBindOpen == key) { + if (isInGui()) return + openGuiEditor() + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + fun onRenderOverlay(event: GuiRenderEvent) { + latestPositions = currentPositions.toMap() + currentPositions.clear() + } + + companion object { + var currentPositions = mutableMapOf<String, Position>() + private var latestPositions = mapOf<String, Position>() + private var currentBorderSize = mutableMapOf<String, Pair<Int, Int>>() + + @JvmStatic + fun add(position: Position, posLabel: String, x: Int, y: Int) { + var name = position.internalName + if (name == null) { + name = if (posLabel == "none") "none " + UUID.randomUUID() else posLabel + position.internalName = name + } + if (!currentPositions.containsKey(name)) { + currentPositions[name] = position + + + currentBorderSize[posLabel] = Pair(x, y) + } + } + + @JvmStatic + fun openGuiEditor() { + val savedGui = Minecraft.getMinecraft().currentScreen + + val help = LinkedHashMap<Position, Position>() + for (position in latestPositions.values) { + help[position] = position + } + + val guiPositionEditor = GuiPositionEditor(help) { NotEnoughUpdates.INSTANCE.openGui = savedGui } + SkyHanniMod.screenToOpen = guiPositionEditor + } + + @JvmStatic + fun renderLast() { + if (!isInGui()) return + + GlStateManager.translate(0f, 0f, 200f) + + GuiRenderEvent.GameOverlayRenderEvent().postAndCatch() + + GlStateManager.pushMatrix() + GlStateManager.enableDepth() + GuiRenderEvent.ChestBackgroundRenderEvent().postAndCatch() + GlStateManager.popMatrix() + + GlStateManager.translate(0f, 0f, -200f) + } + + fun isInGui() = Minecraft.getMinecraft().currentScreen is GuiPositionEditor + + fun Position.getDummySize(random: Boolean = false): Vector2f { + if (random) { + return Vector2f(15f, 15f) + } else { + val (x, y) = currentBorderSize[internalName] ?: return Vector2f(1f, 1f) + return Vector2f(x.toFloat(), y.toFloat()) + } + } + + fun Position.getAbsX_(): Int { + val width = getDummySize(true).x + return getAbsX(ScaledResolution(Minecraft.getMinecraft()), width.toInt()) + } + + fun Position.getAbsY_(): Int { + val height = getDummySize(true).y + return getAbsY(ScaledResolution(Minecraft.getMinecraft()), height.toInt()) + } + + fun Position.isCenterX_(): Boolean { + return false + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt index b342fb345..11e6f86f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/RenderGuiData.kt @@ -14,19 +14,24 @@ class RenderGuiData { @SubscribeEvent fun onRenderOverlay(event: RenderGameOverlayEvent.Pre) { if (event.type != RenderGameOverlayEvent.ElementType.HOTBAR) return + if (GuiEditManager.isInGui()) return GuiRenderEvent.GameOverlayRenderEvent().postAndCatch() } @SubscribeEvent fun onBackgroundDraw(event: GuiScreenEvent.BackgroundDrawnEvent) { + if (GuiEditManager.isInGui()) return val currentScreen = Minecraft.getMinecraft().currentScreen ?: return - if (currentScreen !is GuiInventory && currentScreen !is GuiChest) return GlStateManager.pushMatrix() GlStateManager.enableDepth() + if (GuiEditManager.isInGui()) { + GuiRenderEvent.GameOverlayRenderEvent().postAndCatch() + } + GuiRenderEvent.ChestBackgroundRenderEvent().postAndCatch() GlStateManager.popMatrix() diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt index 04ad6b841..55239442f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt @@ -71,7 +71,7 @@ class BazaarBestSellMethod { fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { if (!isEnabled()) return - SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(display) + SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(display, posLabel = "Bazaar Best Sell Method") } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarUpdateTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarUpdateTimer.kt index 3c3844ac5..72c306a17 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarUpdateTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarUpdateTimer.kt @@ -34,7 +34,7 @@ class BazaarUpdateTimer { val list = mutableListOf<String>() list.add("Next update in:") list.add(format) - SkyHanniMod.feature.bazaar.updateTimerPos.renderStrings(list, center = true) + SkyHanniMod.feature.bazaar.updateTimerPos.renderStrings(list, posLabel = "Bazaar Update Timer") } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index d97e1c42e..eae5215ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -168,10 +168,10 @@ class BingoCardDisplay { } if (displayMode == 0) { if (Minecraft.getMinecraft().currentScreen !is GuiChat) { - config.bingoCardPos.renderStrings(display) + config.bingoCardPos.renderStrings(display, posLabel = "Bingo Card") } } else if (displayMode == 1) { - config.bingoCardPos.renderStrings(BingoNextStepHelper.currentHelp) + config.bingoCardPos.renderStrings(BingoNextStepHelper.currentHelp, posLabel = "Bingo Card") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 7662a434f..88d69a672 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -250,7 +250,7 @@ class MinionCraftHelper { if (!LorenzUtils.isBingoProfile) return if (!SkyHanniMod.feature.bingo.minionCraftHelperEnabled) return - SkyHanniMod.feature.bingo.minionCraftHelperPos.renderStrings(display, center = true) + SkyHanniMod.feature.bingo.minionCraftHelperPos.renderStrings(display, posLabel = "Minion Craft Helper") } private fun notify(minionName: String) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt index 3364277c2..8b696ad61 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt @@ -128,6 +128,6 @@ class DungeonCopilot { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.copilotPos.renderString(nextStep) + SkyHanniMod.feature.dungeon.copilotPos.renderString(nextStep, posLabel = "Dungeon Copilot") } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt index 61e6df4ff..bf25d664f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt @@ -88,7 +88,7 @@ class DungeonDeathCounter { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + display) + SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + display, posLabel = "Dungeon Death Counter") } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt index b3581551d..2e40a363b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -86,7 +86,7 @@ class DungeonMilestonesDisplay { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + display) + SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + display, posLabel = "Dungeon Milestone") } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/BarnFishingTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/BarnFishingTimer.kt index 702b5fb8f..c534534a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/BarnFishingTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/BarnFishingTimer.kt @@ -101,6 +101,6 @@ class BarnFishingTimer { val name = if (currentCount == 1) "sea creature" else "sea creatures" val text = "$color$timeFormat §8(§e$currentCount §b$name§8)" - SkyHanniMod.feature.fishing.barnTimerPos.renderString(text) + SkyHanniMod.feature.fishing.barnTimerPos.renderString(text, posLabel = "BarnTimer") } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt index cc89adc39..914774af9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt @@ -59,6 +59,6 @@ class SharkFishCounter { if (!SkyHanniMod.feature.fishing.sharkFishCounter) return if (!hasWaterRodInHand) return - SkyHanniMod.feature.fishing.sharkFishCounterPos.renderString(display) + SkyHanniMod.feature.fishing.sharkFishCounterPos.renderString(display, posLabel = "Shark Fish Counter") } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt index 95cb97c8f..fcc171c24 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt @@ -32,7 +32,7 @@ class CropMoneyDisplay { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - config.moneyPerHourPos.renderStringsAndItems(display) + config.moneyPerHourPos.renderStringsAndItems(display, posLabel = "Garden Crop Money Per Hour") } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/DicerRngDropCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/DicerRngDropCounter.kt index 7e87b7b91..04289d46c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/DicerRngDropCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/DicerRngDropCounter.kt @@ -96,7 +96,7 @@ class DicerRngDropCounter { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (isEnabled()) { - SkyHanniMod.feature.garden.dicerCounterPos.renderStrings(display) + SkyHanniMod.feature.garden.dicerCounterPos.renderStrings(display, posLabel = "Dicer Counter") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt index 0ce180d32..b62bffb25 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt @@ -23,7 +23,7 @@ class EliteFarmingWeight { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (isEnabled()) { - config.eliteFarmingWeightPos.renderStrings(display, center = false) + config.eliteFarmingWeightPos.renderStrings(display, posLabel = "Elite Farming Weight") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt index 69b530bc0..6da25ac8b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt @@ -67,14 +67,14 @@ class GardenCropMilestoneDisplay { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - config.cropMilestoneProgressDisplayPos.renderStringsAndItems(progressDisplay) + config.cropMilestoneProgressDisplayPos.renderStringsAndItems(progressDisplay, posLabel = "Crop Milestone Progress") if (config.cropMilestoneMushroomPetPerkEnabled) { - config.cropMilestoneMushroomPetPerkPos.renderStringsAndItems(mushroomCowPerkDisplay) + config.cropMilestoneMushroomPetPerkPos.renderStringsAndItems(mushroomCowPerkDisplay, posLabel = "Mushroom Cow Perk") } if (config.cropMilestoneBestDisplay) { - config.cropMilestoneNextDisplayPos.renderStringsAndItems(bestCropTime.display) + config.cropMilestoneNextDisplayPos.renderStringsAndItems(bestCropTime.display, posLabel = "Best Crop Time") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt index afef573e3..54dbb21a4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt @@ -121,7 +121,7 @@ class GardenLevelDisplay { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - config.gardenLevelPos.renderString(display) + config.gardenLevelPos.renderString(display, posLabel = "Garden Level") } private fun isEnabled() = GardenAPI.inGarden() && config.gardenLevelDisplay diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index 5be04363c..c35d5cd01 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -182,7 +182,7 @@ class GardenNextJacobContest { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - config.nextJacobContestPos.renderSingleLineWithItems(display, 1.7) + config.nextJacobContestPos.renderSingleLineWithItems(display, 1.7, posLabel = "Garden Next Jacob Contest") } @SubscribeEvent @@ -190,7 +190,7 @@ class GardenNextJacobContest { if (!config.nextJacobContestDisplay) return if (!inCalendar) return - config.nextJacobContestPos.renderSingleLineWithItems(display) + config.nextJacobContestPos.renderSingleLineWithItems(display, posLabel = "Garden Next Jacob Contest") } private fun isEnabled() = LorenzUtils.inSkyBlock && config.nextJacobContestDisplay diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt index 271bab488..41258efc1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt @@ -59,7 +59,7 @@ class GardenOptimalSpeed { val text = "Optimal Speed: §f$optimalSpeed" if (optimalSpeed != currentSpeed) { - config.optimalSpeedPos.renderString("§c$text") + config.optimalSpeedPos.renderString("§c$text", posLabel = "Garden Optimal Speed") if (config.optimalSpeedWarning) { if (System.currentTimeMillis() > lastWarnTime + 20_000) { lastWarnTime = System.currentTimeMillis() @@ -70,7 +70,7 @@ class GardenOptimalSpeed { } } } else { - config.optimalSpeedPos.renderString("§a$text") + config.optimalSpeedPos.renderString("§a$text", posLabel = "Garden Optimal Speed") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index ddbdcc997..f292c087b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -426,7 +426,7 @@ class GardenVisitorFeatures { if (!onBarnPlot) return } - config.visitorNeedsPos.renderStringsAndItems(display) + config.visitorNeedsPos.renderStringsAndItems(display, posLabel = "Visitor Items Needed") } class Visitor( diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt index d5ebdce68..820b819be 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt @@ -62,7 +62,7 @@ class GardenVisitorTimer { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.garden.visitorTimerPos.renderString(render) + SkyHanniMod.feature.garden.visitorTimerPos.renderString(render, posLabel = "Garden Visitor Timer") } private fun isEnabled() = GardenAPI.inGarden() && SkyHanniMod.feature.garden.visitorTimerEnabled diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt index d38e9f3b3..790a7020f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt @@ -98,7 +98,7 @@ class SkyMartBestProfit { @SubscribeEvent fun onBackgroundDraw(event: GuiRenderEvent.ChestBackgroundRenderEvent) { if (isEnabled()) { - config.skyMartCopperPricePos.renderStringsAndItems(display) + config.skyMartCopperPricePos.renderStringsAndItems(display, posLabel = "Sky Mart Copper Price") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index 9d70e607f..61259d5d8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -150,6 +150,10 @@ class ItemDisplayOverlayFeatures { for (line in item.getLore()) { val matcher = rangerBootsSpeedCapPattern.matcher(line) if (matcher.matches()) { +// if (!done) { +// done = true +// Thread.dumpStack() +// } return matcher.group(1) } } @@ -158,6 +162,8 @@ class ItemDisplayOverlayFeatures { return "" } + var done = false + private fun grabSackName(name: String): String { val split = name.split(" ") val text = split[0] diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index 30849e01d..b6daa011f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -267,7 +267,7 @@ class MinionFeatures { @SubscribeEvent(priority = EventPriority.LOWEST) fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { if (SkyHanniMod.feature.minions.hopperProfitDisplay) { - SkyHanniMod.feature.minions.hopperProfitPos.renderString(coinsPerDay) + SkyHanniMod.feature.minions.hopperProfitPos.renderString(coinsPerDay, posLabel = "Minion Coins Per Day") } } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt index d9e68a1e3..895974629 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt @@ -58,7 +58,7 @@ class ChickenHeadTimer { "Chicken Head Timer: §b$formatDuration" } - SkyHanniMod.feature.misc.chickenHeadTimerPosition.renderString(displayText) + SkyHanniMod.feature.misc.chickenHeadTimerPosition.renderString(displayText, posLabel = "Chicken Head Timer") } fun isEnabled() = LorenzUtils.inSkyBlock && SkyHanniMod.feature.misc.chickenHeadTimerDisplay diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt index 95289ac0e..6d8003f7c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt @@ -137,6 +137,6 @@ class CollectionCounter { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!LorenzUtils.inSkyBlock) return - SkyHanniMod.feature.misc.collectionCounterPos.renderString(display) + SkyHanniMod.feature.misc.collectionCounterPos.renderString(display, posLabel = "Collection Counter") } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt index 64e171602..693c40210 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CurrentPetDisplay.kt @@ -43,6 +43,6 @@ class CurrentPetDisplay { if (!SkyHanniMod.feature.misc.petDisplay) return - SkyHanniMod.feature.misc.petDisplayPos.renderString(config.currentPet) + SkyHanniMod.feature.misc.petDisplayPos.renderString(config.currentPet, posLabel = "Current Pet") } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index 742e91c1d..93b5f791e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -189,7 +189,7 @@ class NonGodPotEffectDisplay { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(display, extraSpace = 3) + SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(display, extraSpace = 3, posLabel = "Non God Pot Effects") } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt index c8b7e6253..c5bda78c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RealTime.kt @@ -15,7 +15,7 @@ class RealTime { fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!isEnabled()) return - SkyHanniMod.feature.misc.realTimePos.renderString(format.format(System.currentTimeMillis())) + SkyHanniMod.feature.misc.realTimePos.renderString(format.format(System.currentTimeMillis()), posLabel = "Real Time") } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt index 12c57a429..1bc1940bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt @@ -87,7 +87,7 @@ class TpsCounter { if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.misc.tpsDisplayEnabled) return - SkyHanniMod.feature.misc.tpsDisplayPosition.renderString(display, center = false) + SkyHanniMod.feature.misc.tpsDisplayPosition.renderString(display, posLabel = "Tps Display") } private fun getColor(tps: Double): String { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt index 60e3e3f74..0bccfe254 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt @@ -34,7 +34,7 @@ class AshfangFreezeCooldown { val remainingLong = maxDuration - duration if (remainingLong > 0) { var format = TimeUtils.formatDuration(remainingLong, showMilliSeconds = true) - SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString("§cAshfang Freeze: §a$format") + SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString("§cAshfang Freeze: §a$format", posLabel = "Ashfang Freeze Cooldown") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt index c79aae3ee..73bebe98e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt @@ -38,7 +38,7 @@ class AshfangNextResetCooldown { val remainingTime = spawnTime + 46_100 - System.currentTimeMillis() if (remainingTime > 0) { val format = TimeUtils.formatDuration(remainingTime, TimeUnit.SECOND, showMilliSeconds = true) - SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a$format") + SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a$format", posLabel = "Ashfang Reset Cooldown") } else { spawnTime = -1 } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 5184f282a..2b79bbd42 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -96,7 +96,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return - SkyHanniMod.feature.misc.crimsonIsleReputationHelperPos.renderStringsAndItems(display) + SkyHanniMod.feature.misc.crimsonIsleReputationHelperPos.renderStringsAndItems(display, posLabel = "Crimson Isle Reputation Helper") } fun update() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt index 6e2194498..d80c45974 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -147,7 +147,7 @@ class SummoningMobManager { id++ } - SkyHanniMod.feature.summonings.summoningMobDisplayPos.renderStrings(list) + SkyHanniMod.feature.summonings.summoningMobDisplayPos.renderStrings(list, posLabel = "Summoning Mob Display") } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityRenderer.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityRenderer.java new file mode 100644 index 000000000..82b78b0f8 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinEntityRenderer.java @@ -0,0 +1,17 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import at.hannibal2.skyhanni.data.GuiEditManager; +import net.minecraft.client.renderer.EntityRenderer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(EntityRenderer.class) +public class MixinEntityRenderer { + + @Inject(method = "updateCameraAndRender", at = @At("TAIL")) + private void onLastRender(float partialTicks, long nanoTime, CallbackInfo ci) { + GuiEditManager.renderLast(); + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index ea1ac0a82..bc008f43a 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -131,7 +131,7 @@ class LorenzTest { if (!LorenzUtils.inSkyBlock) return if (!SkyHanniMod.feature.dev.debugEnabled) return - SkyHanniMod.feature.dev.debugPos.renderString(text) + SkyHanniMod.feature.dev.debugPos.renderString(text, posLabel = "Test") } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index a8bbc9436..42509da79 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -2,11 +2,13 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.core.util.render.TextRenderUtils.drawStringScaled +import at.hannibal2.skyhanni.data.GuiEditManager +import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsX_ +import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsY_ import at.hannibal2.skyhanni.utils.NEUItems.renderOnScreen import net.minecraft.client.Minecraft import net.minecraft.client.gui.FontRenderer import net.minecraft.client.gui.Gui -import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.renderer.Tessellator import net.minecraft.client.renderer.vertex.DefaultVertexFormats @@ -427,54 +429,67 @@ object RenderUtils { return lastValue + (currentValue - lastValue) * multiplier } - fun Position.renderString(string: String?, extraOffsetX: Int = 0, offsetY: Int = 0, center: Boolean = true) { - val minecraft = Minecraft.getMinecraft() - + fun Position.renderString(string: String?, offsetX: Int = 0, offsetY: Int = 0, posLabel: String) { if (string == null) return if (string == "") return - val display = "§f$string" + val x = renderString0(string, offsetX, offsetY) + GuiEditManager.add(this, posLabel, x, 10) + } + private fun Position.renderString0(string: String?, offsetX: Int = 0, offsetY: Int = 0): Int { + val display = "§f$string" GlStateManager.pushMatrix() - val resolution = ScaledResolution(minecraft) - - val renderer = minecraft.renderManager.fontRenderer ?: return - val offsetX = if (center) { - (200 - renderer.getStringWidth(display)) / 2 - } else { - 0 - } + extraOffsetX + val minecraft = Minecraft.getMinecraft() + val renderer = minecraft.renderManager.fontRenderer - val x = getAbsX(resolution, 200) + offsetX - val y = getAbsY(resolution, 16) + offsetY + val x = getAbsX_() + offsetX + val y = getAbsY_() + offsetY GlStateManager.translate(x + 1.0, y + 1.0, 0.0) renderer.drawStringWithShadow(display, 0f, 0f, 0) + GlStateManager.popMatrix() + + return renderer.getStringWidth(display) } - fun Position.renderStrings(list: List<String>, extraSpace: Int = 0, center: Boolean = false) { + fun Position.renderStrings(list: List<String>, extraSpace: Int = 0, posLabel: String) { if (list.isEmpty()) return var offsetY = 0 + var longestX = 0 for (s in list) { - renderString(s, offsetY = offsetY, center = center) + val x = renderString0(s, offsetY = offsetY) + if (x > longestX) { + longestX = x + } offsetY += 10 + extraSpace } + GuiEditManager.add(this, posLabel, longestX, offsetY) } /** * Accepts a list of lines to print. * Each line is a list of things to print. Can print String or ItemStack objects. */ - fun Position.renderStringsAndItems(list: List<List<Any?>>, extraSpace: Int = 0, itemScale: Double = 1.0) { + fun Position.renderStringsAndItems( + list: List<List<Any?>>, + extraSpace: Int = 0, + itemScale: Double = 1.0, + posLabel: String, + ) { if (list.isEmpty()) return var offsetY = 0 + var longestX = 0 try { for (line in list) { - renderLine(line, offsetY, itemScale) + val x = renderLine(line, offsetY, itemScale) + if (x > longestX) { + longestX = x + } offsetY += 10 + extraSpace + 2 } } catch (e: NullPointerException) { @@ -488,20 +503,21 @@ object RenderUtils { e.printStackTrace() LorenzUtils.debug("NPE in renderStringsAndItems!") } + GuiEditManager.add(this, posLabel, longestX, offsetY) } /** * Accepts a single line to print. * This line is a list of things to print. Can print String or ItemStack objects. */ - fun Position.renderSingleLineWithItems(list: List<Any?>, itemScale: Double = 1.0) { + fun Position.renderSingleLineWithItems(list: List<Any?>, itemScale: Double = 1.0, posLabel: String) { if (list.isEmpty()) return - renderLine(list, 0, itemScale) + val longestX = renderLine(list, 0, itemScale) + GuiEditManager.add(this, posLabel, longestX, 10) } - private fun Position.renderLine(line: List<Any?>, offsetY: Int, itemScale: Double = 1.0) { + private fun Position.renderLine(line: List<Any?>, offsetY: Int, itemScale: Double = 1.0): Int { val renderer = Minecraft.getMinecraft().fontRendererObj - val resolution = ScaledResolution(Minecraft.getMinecraft()) var offsetX = 0 for (any in line) { if (any == null) { @@ -509,12 +525,12 @@ object RenderUtils { continue } if (any is String) { - renderString(any, offsetX, offsetY, center = false) + renderString0(any, offsetX, offsetY) val width = renderer.getStringWidth(any) offsetX += width } else if (any is ItemStack) { - val isX = getAbsX(resolution, 200) + offsetX - val isY = getAbsY(resolution, 16) + offsetY + val isX = getAbsX_() + offsetX + val isY = getAbsY_() + offsetY any.renderOnScreen(isX.toFloat(), isY.toFloat(), itemScale) offsetX += 12 @@ -522,6 +538,7 @@ object RenderUtils { throw RuntimeException("Unknown render object: $any") } } + return offsetX } // totally not modified Autumn Client's TargetStrafe |