From ace1ec499c919afa2669ca3868610a8349b79e97 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Wed, 5 Jan 2022 18:12:47 +0100 Subject: [PATCH] config options for pumpkin and powder snow overlay --- .../profiles/rendering/RenderingProfile.kt | 2 ++ .../profiles/rendering/overlay/OverlayC.kt | 28 +++++++++++++++++++ .../overlays/simple/PowderSnowOverlay.kt | 3 +- .../overlay/overlays/simple/PumpkinOverlay.kt | 4 +++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/overlay/OverlayC.kt diff --git a/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/RenderingProfile.kt b/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/RenderingProfile.kt index a0d43df7b..4ead87118 100644 --- a/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/RenderingProfile.kt +++ b/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/RenderingProfile.kt @@ -26,6 +26,7 @@ import de.bixilon.minosoft.config.profile.profiles.rendering.experimental.Experi import de.bixilon.minosoft.config.profile.profiles.rendering.fog.FogC import de.bixilon.minosoft.config.profile.profiles.rendering.light.LightC import de.bixilon.minosoft.config.profile.profiles.rendering.movement.MovementC +import de.bixilon.minosoft.config.profile.profiles.rendering.overlay.OverlayC import de.bixilon.minosoft.config.profile.profiles.rendering.performance.PerformanceC /** @@ -52,6 +53,7 @@ class RenderingProfile( val light = LightC() val movement = MovementC() val performance = PerformanceC() + val overlay = OverlayC() override fun toString(): String { diff --git a/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/overlay/OverlayC.kt b/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/overlay/OverlayC.kt new file mode 100644 index 000000000..f39caf4c2 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/config/profile/profiles/rendering/overlay/OverlayC.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2020-2022 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program. If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.config.profile.profiles.rendering.overlay + +import de.bixilon.minosoft.config.profile.profiles.rendering.RenderingProfileManager.delegate + +class OverlayC { + /** + * Enables the powder snow 2d overlay if the player is frozen + */ + var powderSnow by delegate(true) + + /** + * Enabled the pumpkin blur overlay if the player is waring a carved pumpkin + */ + var pumpkin by delegate(true) +} diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PowderSnowOverlay.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PowderSnowOverlay.kt index 417ae08eb..2cca347ff 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PowderSnowOverlay.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PowderSnowOverlay.kt @@ -21,10 +21,11 @@ import de.bixilon.minosoft.gui.rendering.textures.TextureUtil.texture import de.bixilon.minosoft.util.KUtil.toResourceLocation class PowderSnowOverlay(renderWindow: RenderWindow, z: Float) : SimpleOverlay(renderWindow, z) { + private val config = renderWindow.connection.profiles.rendering.overlay override val texture: AbstractTexture = renderWindow.textureManager.staticTextures.createTexture("misc/powder_snow_outline".toResourceLocation().texture()) private var ticksFrozen: Int = 0 override val render: Boolean - get() = ticksFrozen > 0 + get() = config.powderSnow && ticksFrozen > 0 override fun update() { ticksFrozen = renderWindow.connection.player.ticksFrozen diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PumpkinOverlay.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PumpkinOverlay.kt index fac98f9d5..ce2c3eca9 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PumpkinOverlay.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/framebuffer/world/overlay/overlays/simple/PumpkinOverlay.kt @@ -22,9 +22,13 @@ import de.bixilon.minosoft.gui.rendering.textures.TextureUtil.texture import de.bixilon.minosoft.util.KUtil.toResourceLocation class PumpkinOverlay(renderWindow: RenderWindow, z: Float) : FirstPersonOverlay(renderWindow, z) { + private val config = renderWindow.connection.profiles.rendering.overlay override val texture: AbstractTexture = renderWindow.textureManager.staticTextures.createTexture("misc/pumpkinblur".toResourceLocation().texture()) override val render: Boolean get() { + if (!config.pumpkin) { + return false + } if (!super.render) { return false }