Skip to content

Commit

Permalink
blend stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jun 12, 2024
1 parent d3cf882 commit d0ba703
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.polyfrost.chatting.chat

import cc.polyfrost.oneconfig.config.annotations.Exclude
import cc.polyfrost.oneconfig.config.annotations.Switch
import cc.polyfrost.oneconfig.hud.BasicHud
import cc.polyfrost.oneconfig.libs.universal.UMatrixStack
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/org/polyfrost/chatting/chat/ChatWindow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class ChatWindow : BasicHud(true, 2f, 1080 - 27f - 45f - 12f) {
nanoVG(true) {
drawBackground(position.x, position.bottomY - animationHeight, animationWidth, animationHeight, scale)
}
GlStateManager.disableBlend()
GlStateManager.disableAlpha()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ open class CleanButton(
if (visible) {
val fontrenderer = mc.fontRendererObj
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f)
GlStateManager.enableAlpha()
GlStateManager.enableBlend()
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
GlStateManager.blendFunc(770, 771)
hovered =
mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height
if (!Chatting.isPatcher || !PatcherConfig.transparentChatInputField) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ class ClearButton :
super.drawButton(mc, mouseX, mouseY)
if (visible) {
GlStateManager.pushMatrix()
GlStateManager.enableBlend()
GlStateManager.enableAlpha()
GlStateManager.enableBlend()
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
GlStateManager.blendFunc(770, 771)
mc.textureManager.bindTexture(ResourceLocation(Chatting.ID, "delete.png"))
val color = if (hovered) chatButtonHoveredColor else chatButtonColor
if (ChattingConfig.buttonShadow) {
Expand All @@ -49,8 +50,6 @@ class ClearButton :
}
GlStateManager.color(color.red / 255f, color.green / 255f, color.blue / 255f, color.alpha / 255f)
Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
GlStateManager.disableAlpha()
GlStateManager.disableBlend()
GlStateManager.popMatrix()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ class ScreenshotButton :
super.drawButton(mc, mouseX, mouseY)
if (visible) {
GlStateManager.pushMatrix()
GlStateManager.enableBlend()
GlStateManager.enableAlpha()
GlStateManager.enableBlend()
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
GlStateManager.blendFunc(770, 771)
mc.textureManager.bindTexture(ResourceLocation(Chatting.ID, "screenshot.png"))
val color = if (hovered) ChattingConfig.chatButtonHoveredColor else ChattingConfig.chatButtonColor
if (ChattingConfig.buttonShadow) {
Expand All @@ -39,8 +40,6 @@ class ScreenshotButton :
}
GlStateManager.color(color.red / 255f, color.green / 255f, color.blue / 255f, color.alpha / 255f)
Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
GlStateManager.disableAlpha()
GlStateManager.disableBlend()
GlStateManager.popMatrix()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ class SearchButton() :
super.drawButton(mc, mouseX, mouseY)
if (visible) {
GlStateManager.pushMatrix()
GlStateManager.enableBlend()
GlStateManager.enableAlpha()
GlStateManager.enableBlend()
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0)
GlStateManager.blendFunc(770, 771)
mc.textureManager.bindTexture(ResourceLocation(Chatting.ID, "search.png"))
val color = if (isEnabled()) OneColor(200, 200, 200, 255) else if (hovered) ChattingConfig.chatButtonHoveredColor else ChattingConfig.chatButtonColor
if (ChattingConfig.buttonShadow) {
Expand All @@ -47,8 +48,6 @@ class SearchButton() :
}
GlStateManager.color(color.red / 255f, color.green / 255f, color.blue / 255f, color.alpha / 255f)
Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
GlStateManager.disableAlpha()
GlStateManager.disableBlend()
GlStateManager.popMatrix()
}
}
Expand Down

0 comments on commit d0ba703

Please sign in to comment.