Skip to content

Commit 8b848f2

Browse files
committed
prettier gui
1 parent b5fe04e commit 8b848f2

File tree

14 files changed

+68
-16
lines changed

14 files changed

+68
-16
lines changed

src/main/java/com/lambda/mixin/render/BackgroundRendererMixin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* blue = (float)vec3d3.getZ();
3636
* }</pre>
3737
*/
38+
// FixMe: This crashes the game
3839
@Mixin(BackgroundRenderer.class)
3940
public class BackgroundRendererMixin {
4041
@Redirect(method = "getFogColor", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Vec3d;getX()D"))

src/main/kotlin/com/lambda/config/settings/FunctionSetting.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ open class FunctionSetting<T>(
3838
get() =
3939
{
4040
button(name) { value() }
41+
4142
sameLine()
4243
helpMarker(description)
4344
}

src/main/kotlin/com/lambda/config/settings/StringSetting.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ class StringSetting(
4747
override val layout: ImGuiBuilder.() -> Unit
4848
get() =
4949
{
50-
if (multiline) inputTextMultiline(name, ::value, flags = flags)
51-
else inputText(name, ::value, flags)
50+
text(name)
5251

5352
sameLine()
5453
helpMarker(description)
54+
55+
if (multiline) inputTextMultiline(name, ::value, flags = flags)
56+
else inputText(name, ::value, flags)
5557
}
5658

5759
override fun CommandBuilder.buildCommand(registry: CommandRegistryAccess) {

src/main/kotlin/com/lambda/config/settings/comparable/BooleanSetting.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class BooleanSetting(
4545
get() =
4646
{
4747
checkbox(name, ::value)
48+
4849
sameLine()
4950
helpMarker(description)
5051
}

src/main/kotlin/com/lambda/config/settings/comparable/EnumSetting.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ class EnumSetting<T : Enum<T>>(
6161
override val layout: ImGuiBuilder.() -> Unit
6262
get() =
6363
{
64-
slider(name, ::index, 0, value.enumValues.size - 1, format = "", flags = AlwaysClamp)
64+
text(name)
65+
66+
sameLine()
67+
helpMarker(description)
68+
69+
slider("##$name", ::index, 0, value.enumValues.size - 1, format = "", flags = AlwaysClamp)
6570

6671
val min = ImGui.getItemRectMin()
6772
val max = ImGui.getItemRectMax()

src/main/kotlin/com/lambda/config/settings/complex/BlockPosSetting.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ class BlockPosSetting(
5050
override val layout: ImGuiBuilder.() -> Unit
5151
get() =
5252
{
53-
inputVec3i(name, value) { value = it.blockPos }
53+
text(name)
54+
5455
sameLine()
5556
helpMarker(description)
57+
58+
inputVec3i("##$name", value) { value = it.blockPos }
5659
}
5760

5861
override fun CommandBuilder.buildCommand(registry: CommandRegistryAccess) {

src/main/kotlin/com/lambda/config/settings/complex/ColorSetting.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.lambda.brigadier.required
2626
import com.lambda.config.AbstractSetting
2727
import com.lambda.gui.dsl.ImGuiBuilder
2828
import com.lambda.util.extension.CommandBuilder
29+
import imgui.ImGui
2930
import net.minecraft.command.CommandRegistryAccess
3031
import java.awt.Color
3132

@@ -46,12 +47,12 @@ class ColorSetting(
4647
override val layout: ImGuiBuilder.() -> Unit
4748
get() =
4849
{
49-
colorButton(name, value) {
50-
colorPicker(name, ::value)
51-
}
50+
text(name)
5251

5352
sameLine()
5453
helpMarker(description)
54+
55+
colorEdit("##$name", ::value)
5556
}
5657

5758
override fun CommandBuilder.buildCommand(registry: CommandRegistryAccess) {

src/main/kotlin/com/lambda/config/settings/complex/Vec3dSetting.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ class Vec3dSetting(
4242
override val layout: ImGuiBuilder.() -> Unit
4343
get() =
4444
{
45-
inputVec3d(name, ::value as Vec3d) // wat da hell
45+
text(name)
46+
4647
sameLine()
4748
helpMarker(description)
49+
50+
inputVec3d(name, ::value as Vec3d) // wat da hell
4851
}
4952

5053
override fun CommandBuilder.buildCommand(registry: CommandRegistryAccess) {

src/main/kotlin/com/lambda/config/settings/numeric/DoubleSetting.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ class DoubleSetting(
4949
override val layout: ImGuiBuilder.() -> Unit
5050
get() =
5151
{
52-
inputDouble(name, ::value)
52+
text(name)
53+
5354
sameLine()
5455
helpMarker(description)
56+
57+
inputDouble("##$name", ::value)
5558
}
5659

5760
override fun CommandBuilder.buildCommand(registry: CommandRegistryAccess) {

src/main/kotlin/com/lambda/config/settings/numeric/FloatSetting.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ class FloatSetting(
4848
override val layout: ImGuiBuilder.() -> Unit
4949
get() =
5050
{
51-
inputFloat(name, ::value)
51+
text(name)
52+
5253
sameLine()
5354
helpMarker(description)
55+
56+
inputFloat("##$name", ::value)
5457
}
5558

5659
override fun CommandBuilder.buildCommand(registry: CommandRegistryAccess) {

0 commit comments

Comments
 (0)