aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/gui/components
diff options
context:
space:
mode:
authorMoo2meenn <67310794+Moo2meenn@users.noreply.github.com>2022-05-06 18:50:33 +0300
committerGitHub <noreply@github.com>2022-05-06 18:50:33 +0300
commitb96de6230299c751d0d3953c6546992efccb1111 (patch)
treed9db5ea005b8084b08c639096b42d3e5f6cc517e /src/main/kotlin/cc/woverflow/chatting/gui/components
parent1046d78d70f074074dcf5c4ce522c8dc83654242 (diff)
parentdae58987b89bc01fa2828b5f4840a594f416f592 (diff)
downloadChatting-b96de6230299c751d0d3953c6546992efccb1111.tar.gz
Chatting-b96de6230299c751d0d3953c6546992efccb1111.tar.bz2
Chatting-b96de6230299c751d0d3953c6546992efccb1111.zip
Merge branch 'main' into fix-buttons-height
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/gui/components')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/ClearButton.kt27
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt2
2 files changed, 28 insertions, 1 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/gui/components/ClearButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/ClearButton.kt
new file mode 100644
index 0000000..3035a98
--- /dev/null
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/ClearButton.kt
@@ -0,0 +1,27 @@
+package cc.woverflow.chatting.gui.components
+
+import cc.woverflow.chatting.Chatting
+import gg.essential.universal.UResolution
+import net.minecraft.client.Minecraft
+import net.minecraft.client.gui.Gui
+import net.minecraft.client.renderer.GlStateManager
+import net.minecraft.util.ResourceLocation
+
+class ClearButton :
+ CleanButton(13379014, { UResolution.scaledWidth - 28 }, { UResolution.scaledHeight - 27 }, 12, 12, "",
+ { RenderType.NONE }) {
+
+ override fun onMousePress() {
+ Minecraft.getMinecraft().ingameGUI.chatGUI.clearChatMessages()
+ }
+
+ override fun drawButton(mc: Minecraft, mouseX: Int, mouseY: Int) {
+ super.drawButton(mc, mouseX, mouseY)
+ if (visible) {
+ if (hovered) GlStateManager.color(1f, 1f, 160f / 255f)
+ else GlStateManager.color(1f, 1f, 1f)
+ mc.textureManager.bindTexture(ResourceLocation(Chatting.ID, "delete.png"))
+ Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt
index e72dbe1..b22673b 100644
--- a/src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt
@@ -33,4 +33,4 @@ class ScreenshotButton :
Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
}
}
-}
+} \ No newline at end of file