Skip to content

Commit

Permalink
chat button background colors
Browse files Browse the repository at this point in the history
  • Loading branch information
RedthMC committed Nov 7, 2023
1 parent cd25a22 commit c7eda89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ object ChattingConfig : Config(
)
var inputBoxBackgroundColor = OneColor(0, 0, 0, 128)

@Color(
name = "Chat Button Background Color", category = "General",
description = "The color of the chat button background."
)
var chatButtonBackgroundColor = OneColor(0, 0, 0, 128)

@Color(
name = "Chat Button Hovered Background Color", category = "General",
description = "The color of the chat button background when hovered."
)
var chatButtonHoveredBackgroundColor = OneColor(255, 255, 255, 128)

@Switch(
name = "Inform Outdated Mods", category = "General",
description = "Inform the user when a mod can be replaced by Chatting."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package cc.woverflow.chatting.gui.components

import cc.polyfrost.oneconfig.renderer.TextRenderer
import cc.woverflow.chatting.Chatting
import cc.woverflow.chatting.config.ChattingConfig
import cc.woverflow.chatting.hook.GuiNewChatHook
import club.sk1er.patcher.config.PatcherConfig
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.renderer.GlStateManager
import java.awt.Color

/**
* Taken from ChatShortcuts under MIT License
Expand Down Expand Up @@ -68,7 +68,7 @@ open class CleanButton(
yPosition,
xPosition + width,
yPosition + height,
if (hovered) hoveredColor else color
(if (hovered) ChattingConfig.chatButtonHoveredBackgroundColor else ChattingConfig.chatButtonBackgroundColor).rgb
)
}
mouseDragged(mc, mouseX, mouseY)
Expand Down Expand Up @@ -98,7 +98,5 @@ open class CleanButton(
}

companion object {
val hoveredColor = Color(255, 255, 255, 128).rgb
val color = Color(0, 0, 0, 128).rgb
}
}

0 comments on commit c7eda89

Please sign in to comment.