Skip to content
This repository was archived by the owner on May 12, 2024. It is now read-only.

Commit 16402ff

Browse files
committed
New GUI color theme
1 parent f4ebbbf commit 16402ff

File tree

6 files changed

+6
-49
lines changed

6 files changed

+6
-49
lines changed

src/main/kotlin/dev/luna5ama/trollhack/gui/hudgui/AbstractHudElement.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ abstract class AbstractHudElement(
8282

8383
open fun renderFrame() {
8484
RenderUtils2D.drawRectFilled(renderWidth, renderHeight, GuiSetting.backGround)
85-
RenderUtils2D.drawRectOutline(renderWidth, renderHeight, 1.0f, GuiSetting.outline)
85+
RenderUtils2D.drawRectOutline(renderWidth, renderHeight, 1.0f, GuiSetting.primary)
8686
}
8787

8888
init {

src/main/kotlin/dev/luna5ama/trollhack/gui/hudgui/elements/player/InventoryViewer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal object InventoryViewer : HudElement(
3131
RenderUtils2D.drawRectFilled(0.0f, 0.0f, 162.0f, 54.0f, color = GuiSetting.backGround)
3232
}
3333
if (border) {
34-
RenderUtils2D.drawRectOutline(0.0f, 0.0f, 162.0f, 54.0f, lineWidth = 2.0f, color = GuiSetting.text)
34+
RenderUtils2D.drawRectOutline(0.0f, 0.0f, 162.0f, 54.0f, lineWidth = 2.0f, color = GuiSetting.primary)
3535
}
3636
}
3737

src/main/kotlin/dev/luna5ama/trollhack/gui/rgui/component/Slider.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ open class Slider(
113113
)
114114
RenderUtils2D.drawRectFilled(0.0f, 0.0f, renderWidth, renderHeight, overlayColor)
115115

116-
// Slider frame
117-
if (GuiSetting.outline.a > 0) {
118-
RenderUtils2D.drawRectOutline(0.0f, 0.0f, renderWidth, renderHeight, 1.25f, GuiSetting.outline)
119-
}
120-
121116
// Slider name
122117
val displayText = inputField.takeIf { listening } ?: name
123118
val prev = if (prevState == MouseState.NONE) 0.0f else 1.0f

src/main/kotlin/dev/luna5ama/trollhack/gui/rgui/windows/ColorPicker.kt

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,6 @@ object ColorPicker : TitledWindow("Color Picker", 0.0f, 0.0f, 200.0f, 200.0f, Se
218218

219219
RenderUtils2D.releaseGl()
220220

221-
// Outline
222-
RenderUtils2D.drawRectOutline(
223-
fieldPos.first.x,
224-
fieldPos.first.y,
225-
fieldPos.second.x,
226-
fieldPos.second.y,
227-
1.5f,
228-
GuiSetting.outline
229-
)
230-
231221
// Circle pointer
232222
val interpolatedSaturation = MathUtils.lerp(prevSaturation, saturation, RenderUtils3D.partialTicks)
233223
val interpolatedBrightness = MathUtils.lerp(prevBrightness, brightness, RenderUtils3D.partialTicks)
@@ -274,16 +264,6 @@ object ColorPicker : TitledWindow("Color Picker", 0.0f, 0.0f, 200.0f, 200.0f, Se
274264
RenderUtils2D.draw(GL_TRIANGLE_STRIP)
275265
RenderUtils2D.releaseGl()
276266

277-
// Outline
278-
RenderUtils2D.drawRectOutline(
279-
huePos.first.x,
280-
huePos.first.y,
281-
huePos.second.x,
282-
huePos.second.y,
283-
1.5f,
284-
GuiSetting.outline
285-
)
286-
287267
// Arrow pointer
288268
val interpolatedHue = prevHue + (hue - prevHue) * mc.renderPartialTicks
289269
val pointerPosY = huePos.first.y + fieldHeight * interpolatedHue
@@ -315,14 +295,6 @@ object ColorPicker : TitledWindow("Color Picker", 0.0f, 0.0f, 200.0f, 200.0f, Se
315295
prevColorPos.second.y,
316296
prevColor
317297
)
318-
RenderUtils2D.drawRectOutline(
319-
prevColorPos.first.x,
320-
prevColorPos.first.y,
321-
prevColorPos.second.x,
322-
prevColorPos.second.y,
323-
1.5f,
324-
GuiSetting.outline
325-
)
326298

327299
// Current color
328300
val currentColor = ColorRGB(r.value, g.value, b.value)
@@ -333,14 +305,6 @@ object ColorPicker : TitledWindow("Color Picker", 0.0f, 0.0f, 200.0f, 200.0f, Se
333305
currentColorPos.second.y,
334306
currentColor
335307
)
336-
RenderUtils2D.drawRectOutline(
337-
currentColorPos.first.x,
338-
currentColorPos.first.y,
339-
currentColorPos.second.x,
340-
currentColorPos.second.y,
341-
1.5f,
342-
GuiSetting.outline
343-
)
344308

345309
// Previous hex
346310

src/main/kotlin/dev/luna5ama/trollhack/module/modules/client/GuiSetting.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ internal object GuiSetting : Module(
2626
val darkness by setting("Darkness", 0.25f, 0.0f..1.0f, 0.05f)
2727
val fadeInTime by setting("Fade In Time", 0.4f, 0.0f..1.0f, 0.05f)
2828
val fadeOutTime by setting("Fade Out Time", 0.4f, 0.0f..1.0f, 0.05f)
29-
private val primarySetting by setting("Primary Color", ColorRGB(255, 160, 240, 220))
30-
private val outlineSetting by setting("Outline Color", ColorRGB(240, 250, 255, 48))
31-
private val backgroundSetting by setting("Background Color", ColorRGB(36, 40, 48, 160))
29+
private val primarySetting by setting("Primary Color", ColorRGB(255, 140, 180, 220))
30+
private val backgroundSetting by setting("Background Color", ColorRGB(40, 32, 36, 160))
3231
private val textSetting by setting("Text Color", ColorRGB(255, 250, 253, 255))
33-
private val aHover by setting("Hover Alpha", 32, 0..255, 1)
32+
private val aHover by setting("Hover Alpha", 24, 0..255, 1)
3433

3534
val primary get() = primarySetting
3635
val idle get() = if (primary.lightness < 0.9f) ColorRGB(255, 255, 255, 0) else ColorRGB(0, 0, 0, 0)
3736
val hover get() = idle.alpha(aHover)
3837
val click get() = idle.alpha(aHover * 2)
3938
val backGround get() = backgroundSetting
40-
val outline get() = outlineSetting
4139
val text get() = textSetting
4240

4341
private var prevScale = scaleSetting.value / 100.0f

src/main/kotlin/dev/luna5ama/trollhack/module/modules/render/MapPreview.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ internal object MapPreview : Module(
8787

8888
// Draw the background
8989
drawRectFilled(x1, y1, x2, y2, GuiSetting.backGround)
90-
drawRectOutline(x1, y1, x2, y2, 1.5f, GuiSetting.outline)
90+
drawRectOutline(x1, y1, x2, y2, 1.5f, GuiSetting.primary)
9191

9292
// Draw the name
9393
mc.fontRenderer.drawStringWithShadow(stack.displayName, 2f, -15f, Color.WHITE.rgb)

0 commit comments

Comments
 (0)