mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 11:24:56 -04:00
config options for pumpkin and powder snow overlay
This commit is contained in:
parent
9911f17dfa
commit
ace1ec499c
@ -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.fog.FogC
|
||||||
import de.bixilon.minosoft.config.profile.profiles.rendering.light.LightC
|
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.movement.MovementC
|
||||||
|
import de.bixilon.minosoft.config.profile.profiles.rendering.overlay.OverlayC
|
||||||
import de.bixilon.minosoft.config.profile.profiles.rendering.performance.PerformanceC
|
import de.bixilon.minosoft.config.profile.profiles.rendering.performance.PerformanceC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,6 +53,7 @@ class RenderingProfile(
|
|||||||
val light = LightC()
|
val light = LightC()
|
||||||
val movement = MovementC()
|
val movement = MovementC()
|
||||||
val performance = PerformanceC()
|
val performance = PerformanceC()
|
||||||
|
val overlay = OverlayC()
|
||||||
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
|
@ -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)
|
||||||
|
}
|
@ -21,10 +21,11 @@ import de.bixilon.minosoft.gui.rendering.textures.TextureUtil.texture
|
|||||||
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||||
|
|
||||||
class PowderSnowOverlay(renderWindow: RenderWindow, z: Float) : SimpleOverlay(renderWindow, z) {
|
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())
|
override val texture: AbstractTexture = renderWindow.textureManager.staticTextures.createTexture("misc/powder_snow_outline".toResourceLocation().texture())
|
||||||
private var ticksFrozen: Int = 0
|
private var ticksFrozen: Int = 0
|
||||||
override val render: Boolean
|
override val render: Boolean
|
||||||
get() = ticksFrozen > 0
|
get() = config.powderSnow && ticksFrozen > 0
|
||||||
|
|
||||||
override fun update() {
|
override fun update() {
|
||||||
ticksFrozen = renderWindow.connection.player.ticksFrozen
|
ticksFrozen = renderWindow.connection.player.ticksFrozen
|
||||||
|
@ -22,9 +22,13 @@ import de.bixilon.minosoft.gui.rendering.textures.TextureUtil.texture
|
|||||||
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||||
|
|
||||||
class PumpkinOverlay(renderWindow: RenderWindow, z: Float) : FirstPersonOverlay(renderWindow, z) {
|
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 texture: AbstractTexture = renderWindow.textureManager.staticTextures.createTexture("misc/pumpkinblur".toResourceLocation().texture())
|
||||||
override val render: Boolean
|
override val render: Boolean
|
||||||
get() {
|
get() {
|
||||||
|
if (!config.pumpkin) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (!super.render) {
|
if (!super.render) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user