[fix] Window clipping rounding and colors

This commit is contained in:
Xiaro 2021-01-05 17:33:04 -05:00
parent 618747ad1f
commit 55237b8c82
No known key found for this signature in database
GPG Key ID: 996D265D6E155377
3 changed files with 10 additions and 9 deletions

@ -1 +1 @@
Subproject commit fea63e2afccef89e229944d19051381a5150d782
Subproject commit 110cc5be2c48a9e920510e60d75b3c3fc6d9f24d

View File

@ -8,11 +8,12 @@ import me.zeroeightsix.kami.util.TickTimer
import me.zeroeightsix.kami.util.graphics.GlStateUtils
import me.zeroeightsix.kami.util.graphics.VertexHelper
import me.zeroeightsix.kami.util.math.Vec2f
import org.kamiblue.commons.extension.ceilToInt
import org.kamiblue.commons.extension.floorToInt
import org.lwjgl.input.Mouse
import org.lwjgl.opengl.GL11.*
import java.util.*
import kotlin.math.max
import kotlin.math.roundToInt
open class ListWindow(
name: String,
@ -128,10 +129,10 @@ open class ListWindow(
private fun renderChildren(renderBlock: (Component) -> Unit) {
GlStateUtils.scissor(
((renderPosX + lineSpace * 1.618) * ClickGUI.getScaleFactor()).roundToInt(),
((mc.displayHeight - (renderPosY + renderHeight) * ClickGUI.getScaleFactor())).roundToInt(),
((renderWidth - lineSpace * 3.236) * ClickGUI.getScaleFactor()).roundToInt(),
((renderHeight - draggableHeight) * ClickGUI.getScaleFactor()).roundToInt()
((renderPosX + lineSpace * 1.618) * ClickGUI.getScaleFactor() - 0.5f).floorToInt(),
mc.displayHeight - ((renderPosY + renderHeight) * ClickGUI.getScaleFactor() - 0.5f).floorToInt(),
((renderWidth - lineSpace * 3.236) * ClickGUI.getScaleFactor() + 1.0f).ceilToInt(),
((renderHeight - draggableHeight) * ClickGUI.getScaleFactor() + 1.0f).ceilToInt()
)
glEnable(GL_SCISSOR_TEST)
glTranslatef(0.0f, -renderScrollProgress, 0.0f)

View File

@ -12,9 +12,9 @@ import me.zeroeightsix.kami.util.color.ColorHolder
alwaysEnabled = true
)
object GuiColors : Module() {
private val primarySetting = setting("PrimaryColor", ColorHolder(57, 87, 159, 255))
private val outlineSetting = setting("OutlineColor", ColorHolder(111, 111, 111, 0)) // TODO outlines are set to 0 alpha until we fix the left side
private val backgroundSetting = setting("BackgroundColor", ColorHolder(16, 16, 16, 200))
private val primarySetting = setting("PrimaryColor", ColorHolder(111, 166, 222, 255))
private val outlineSetting = setting("OutlineColor", ColorHolder(88, 99, 111, 200))
private val backgroundSetting = setting("BackgroundColor", ColorHolder(30, 36, 48, 200))
private val textSetting = setting("TextColor", ColorHolder(255, 255, 255, 255))
private val aHover = setting("HoverAlpha", 32, 0..255, 1)