config options for pumpkin and powder snow overlay

This commit is contained in:
Bixilon 2022-01-05 18:12:47 +01:00
parent 9911f17dfa
commit ace1ec499c
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
4 changed files with 36 additions and 1 deletions

View File

@ -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 {

View File

@ -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 <https://www.gnu.org/licenses/>.
*
* 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)
}

View File

@ -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

View File

@ -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
}