From 8c517664e88ac141642a02ad5ccf57d97d876e04 Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Tue, 23 Mar 2021 20:10:13 -0400 Subject: [PATCH 1/6] [new] Add FogColor --- .../client/module/modules/render/SkyColor.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/main/kotlin/org/kamiblue/client/module/modules/render/SkyColor.kt diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/render/SkyColor.kt b/src/main/kotlin/org/kamiblue/client/module/modules/render/SkyColor.kt new file mode 100644 index 0000000000..fd5d6f57c7 --- /dev/null +++ b/src/main/kotlin/org/kamiblue/client/module/modules/render/SkyColor.kt @@ -0,0 +1,24 @@ +package org.kamiblue.client.module.modules.render + +import org.kamiblue.client.module.Category +import org.kamiblue.client.module.Module +import net.minecraftforge.client.event.EntityViewRenderEvent +import org.kamiblue.event.listener.listener + +internal object FogColor : Module( + name = "FogColor", + description = "Recolors render fog", + category = Category.RENDER +) { + private val r by setting("Red", 111, 0..255, 1) + private val g by setting("Green", 166, 0..255, 1) + private val b by setting("Blue", 222, 0..255, 1) + + init { + listener { + it.red = r.toFloat() / 255f + it.green = g.toFloat() / 255f + it.blue = b.toFloat() / 255f + } + } +} From 52c8cf8de809fe7e56c125c09364943470ba4d42 Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Tue, 23 Mar 2021 20:17:01 -0400 Subject: [PATCH 2/6] Rename SkyColor to FogColor --- .../client/module/modules/render/{SkyColor.kt => FogColor.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/kotlin/org/kamiblue/client/module/modules/render/{SkyColor.kt => FogColor.kt} (100%) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/render/SkyColor.kt b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt similarity index 100% rename from src/main/kotlin/org/kamiblue/client/module/modules/render/SkyColor.kt rename to src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt From 8b9670146a8f7ea632033f98080c53098360c016 Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Wed, 24 Mar 2021 13:05:52 -0400 Subject: [PATCH 3/6] Use ColorHolder for FogColor --- .../kamiblue/client/module/modules/render/FogColor.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt index fd5d6f57c7..3fb68f8270 100644 --- a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt +++ b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt @@ -3,6 +3,7 @@ package org.kamiblue.client.module.modules.render import org.kamiblue.client.module.Category import org.kamiblue.client.module.Module import net.minecraftforge.client.event.EntityViewRenderEvent +import org.kamiblue.client.util.color.ColorHolder import org.kamiblue.event.listener.listener internal object FogColor : Module( @@ -10,15 +11,13 @@ internal object FogColor : Module( description = "Recolors render fog", category = Category.RENDER ) { - private val r by setting("Red", 111, 0..255, 1) - private val g by setting("Green", 166, 0..255, 1) - private val b by setting("Blue", 222, 0..255, 1) + private val Color = setting("Color", ColorHolder(111, 166, 222, 255)) init { listener { - it.red = r.toFloat() / 255f - it.green = g.toFloat() / 255f - it.blue = b.toFloat() / 255f + it.red = Color.value.r.toFloat() / 255f + it.green = Color.value.g.toFloat() / 255f + it.blue = Color.value.b.toFloat() / 255f } } } From 568aeb69bf76f46344aebdb060850d759767c6ac Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:10:12 -0400 Subject: [PATCH 4/6] Disable Alpha --- .../org/kamiblue/client/module/modules/render/FogColor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt index 3fb68f8270..0707587aa1 100644 --- a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt +++ b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt @@ -11,7 +11,7 @@ internal object FogColor : Module( description = "Recolors render fog", category = Category.RENDER ) { - private val Color = setting("Color", ColorHolder(111, 166, 222, 255)) + private val Color = setting("Color", ColorHolder(111, 166, 222), false) init { listener { From e674d88894c0d05905f1b6f56ce83960a3047858 Mon Sep 17 00:00:00 2001 From: Jacob Herd <53945697+ToxicAven@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:18:28 -0400 Subject: [PATCH 5/6] Remember good practices --- .../org/kamiblue/client/module/modules/render/FogColor.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt index 3fb68f8270..0c1a9601c9 100644 --- a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt +++ b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt @@ -11,13 +11,13 @@ internal object FogColor : Module( description = "Recolors render fog", category = Category.RENDER ) { - private val Color = setting("Color", ColorHolder(111, 166, 222, 255)) + private val color = setting("Color", ColorHolder(111, 166, 222, 255)) init { listener { - it.red = Color.value.r.toFloat() / 255f - it.green = Color.value.g.toFloat() / 255f - it.blue = Color.value.b.toFloat() / 255f + it.red = color.value.r.toFloat() / 255f + it.green = color.value.g.toFloat() / 255f + it.blue = color.value.b.toFloat() / 255f } } } From c70e413280943b47760ba19546afd8707709f098 Mon Sep 17 00:00:00 2001 From: liv Date: Thu, 25 Mar 2021 13:59:12 -0400 Subject: [PATCH 6/6] Apply suggestions from code review --- .../org/kamiblue/client/module/modules/render/FogColor.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt index 4425326e0d..a76b90201a 100644 --- a/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt +++ b/src/main/kotlin/org/kamiblue/client/module/modules/render/FogColor.kt @@ -12,13 +12,13 @@ internal object FogColor : Module( category = Category.RENDER ) { - private val color = setting("Color", ColorHolder(111, 166, 222), false) + private val color by setting("Color", ColorHolder(111, 166, 222), false) init { listener { - it.red = color.value.r.toFloat() / 255f - it.green = color.value.g.toFloat() / 255f - it.blue = color.value.b.toFloat() / 255f + it.red = color.r.toFloat() / 255f + it.green = color.g.toFloat() / 255f + it.blue = color.b.toFloat() / 255f } } }