Skip to content

Commit

Permalink
fix: reset colorpicker slider
Browse files Browse the repository at this point in the history
  • Loading branch information
opZywl committed Jan 16, 2025
1 parent c960eea commit 728866b
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.OpenGlHelper
import org.lwjgl.input.Keyboard
import org.lwjgl.opengl.GL11
import org.lwjgl.opengl.GL11.glAlphaFunc
import java.awt.Color
import java.util.stream.Collectors
import kotlin.math.*
Expand Down Expand Up @@ -1004,10 +1005,22 @@ class SettingComponents(private val module: Module) : Component() {
}

count += (colorPickerHeight / rectHeight) + 0.5f

} else {
count += 0.2f
}

GL11.glDisable(GL11.GL_SCISSOR_TEST)
OpenGlHelper.glBlendFunc(
GL11.GL_SRC_ALPHA,
GL11.GL_ONE_MINUS_SRC_ALPHA,
GL11.GL_ONE,
GL11.GL_ZERO
)
GlStateManager.disableBlend()
GlStateManager.disableAlpha()
GlStateManager.enableAlpha()
glAlphaFunc(GL11.GL_GREATER, 0.1f)
GlStateManager.color(1f, 1f, 1f, 1f)
}

// ----- FontValue -----
Expand Down Expand Up @@ -1112,10 +1125,6 @@ class SettingComponents(private val module: Module) : Component() {
block()
}

/**
* Returns whether we can safely interact with a setting at the given y-position,
* preventing clicks from “spilling over” the visible region.
*/
fun isClickable(y: Float): Boolean {
return y > panelLimitY && y < panelLimitY + 17 + Main.allowedClickGuiHeight
}
Expand Down

0 comments on commit 728866b

Please sign in to comment.