From b2f6e310a0fbe451f11f8398e4ee2392da6a6b46 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Sat, 10 Apr 2021 00:22:59 +0200 Subject: [PATCH] config: make hud scale a float --- .../config/config/game/HUDGameConfig.kt | 4 +--- .../minosoft/gui/rendering/hud/HUDRenderer.kt | 2 +- .../minosoft/gui/rendering/hud/HUDScale.kt | 21 ------------------- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDScale.kt diff --git a/src/main/java/de/bixilon/minosoft/config/config/game/HUDGameConfig.kt b/src/main/java/de/bixilon/minosoft/config/config/game/HUDGameConfig.kt index 580794105..b0bf53182 100644 --- a/src/main/java/de/bixilon/minosoft/config/config/game/HUDGameConfig.kt +++ b/src/main/java/de/bixilon/minosoft/config/config/game/HUDGameConfig.kt @@ -13,8 +13,6 @@ package de.bixilon.minosoft.config.config.game -import de.bixilon.minosoft.gui.rendering.hud.HUDScale - data class HUDGameConfig( - var scale: HUDScale = HUDScale.MEDIUM, + var scale: Float = 2.0f, ) diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDRenderer.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDRenderer.kt index 0b9e24378..c6fbaf9b0 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDRenderer.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDRenderer.kt @@ -182,7 +182,7 @@ class HUDRenderer(val connection: PlayConnection, val renderWindow: RenderWindow if (forcePrepare || needsUpdate) { for ((elementProperties, hudElement) in enabledHUDElement.values) { - val realScaleFactor = elementProperties.scale * Minosoft.getConfig().config.game.hud.scale.scale + val realScaleFactor = elementProperties.scale * Minosoft.getConfig().config.game.hud.scale val realSize = Vec2i(hudElement.layout.fakeX ?: hudElement.layout.size.x, hudElement.layout.fakeY ?: hudElement.layout.size.y) * realScaleFactor val elementStart = getRealPosition(realSize, elementProperties, renderWindow.screenDimensions) diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDScale.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDScale.kt deleted file mode 100644 index e8d2629bc..000000000 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDScale.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Minosoft - * Copyright (C) 2020 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.gui.rendering.hud - -enum class HUDScale(val scale: Float) { - TINY(1.0f), - MEDIUM(2.0f), - LARGE(3.0f), - SENIOR(4.0f), -}