diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 03:34:10 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 03:34:10 +0100 |
commit | 7d0223d1cbc09909b8989c8aea2576a171acdaea (patch) | |
tree | 4d1024f7375c11ba15f5dd348fd4503aae1ddd7d | |
parent | 319654afd68440c9cbc2eedd3ae4718b5c045519 (diff) | |
download | skyhanni-7d0223d1cbc09909b8989c8aea2576a171acdaea.tar.gz skyhanni-7d0223d1cbc09909b8989c8aea2576a171acdaea.tar.bz2 skyhanni-7d0223d1cbc09909b8989c8aea2576a171acdaea.zip |
replaced "text to render" to "display"
7 files changed, 29 insertions, 29 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java b/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java index 3652f76f5..56114c161 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java +++ b/src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java @@ -566,9 +566,9 @@ public class GuiElementTextField { ); GlScissorStack.pop(scaledresolution); } else { -// String toRender = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(ChromaUtils.INSTANCE.chromaStringByColourCode( - String toRender = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(texts[yOffI], searchBarXSize - 10); - Minecraft.getMinecraft().fontRendererObj.drawString(toRender, x + 5, +// String display = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(ChromaUtils.INSTANCE.chromaStringByColourCode( + String display = Minecraft.getMinecraft().fontRendererObj.trimStringToWidth(texts[yOffI], searchBarXSize - 10); + Minecraft.getMinecraft().fontRendererObj.drawString(display, x + 5, y + (searchBarYSize - 8) / 2 + yOff, customTextColour ); } diff --git a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt index f3807be83..f0abb1427 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt @@ -10,11 +10,11 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class SendTitleHelper { companion object { - private var textToRender = "" + private var display = "" private var endTime = 0L fun sendTitle(text: String, duration: Int) { - textToRender = text + display = text endTime = System.currentTimeMillis() + duration } } @@ -36,7 +36,7 @@ class SendTitleHelper { GlStateManager.pushMatrix() GlStateManager.translate((width / 2).toFloat(), (height / 1.8).toFloat(), 0.0f) GlStateManager.scale(4.0f, 4.0f, 4.0f) - TextRenderUtils.drawStringCenteredScaledMaxWidth(textToRender, renderer, 0f, 0f, false, 75, 0) + TextRenderUtils.drawStringCenteredScaledMaxWidth(display, renderer, 0f, 0f, false, 75, 0) GlStateManager.popMatrix() } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt index eb6d98d31..200c3e69e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt @@ -15,18 +15,18 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class BazaarBestSellMethod { companion object { - private var textToRender = "" + private var display = "" } @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.CloseWindowEvent) { - textToRender = "" + display = "" } @SubscribeEvent fun onGuiDraw(event: GuiScreenEvent.DrawScreenEvent.Post) { if (!isEnabled()) return - textToRender = getNewText(event) + display = getNewText(event) } private fun getNewText(event: GuiScreenEvent.DrawScreenEvent.Post): String { @@ -74,7 +74,7 @@ class BazaarBestSellMethod { fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { if (!isEnabled()) return - SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(textToRender) + SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(display) } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt index 672e2d262..e40b66968 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt @@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class DungeonDeathCounter { - private var textToRender = "" + private var display = "" private var deaths = 0 private fun isDeathMessage(message: String): Boolean = when { @@ -60,7 +60,7 @@ class DungeonDeathCounter { private fun update() { if (deaths == 0) { - textToRender = "" + display = "" return } @@ -69,7 +69,7 @@ class DungeonDeathCounter { 3 -> "§c" else -> "§4" } - textToRender = color + "Deaths: $deaths" + display = color + "Deaths: $deaths" } @SubscribeEvent @@ -89,7 +89,7 @@ class DungeonDeathCounter { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + textToRender) + SkyHanniMod.feature.dungeon.deathCounterPos.renderString(DungeonMilestonesDisplay.color + display) } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt index 9457d4a5d..692a077de 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -15,7 +15,7 @@ class DungeonMilestonesDisplay { companion object { - private var textToRender = "" + private var display = "" var color = "" var currentMilestone = 0 var timeReached = 0L @@ -40,8 +40,8 @@ class DungeonMilestonesDisplay { private fun checkVisibility() { if (currentMilestone >= 3) { if (System.currentTimeMillis() > timeReached + 3_000) - if (textToRender != "") { - textToRender = textToRender.substring(1) + if (display != "") { + display = display.substring(1) } } } @@ -68,12 +68,12 @@ class DungeonMilestonesDisplay { 2 -> "§e" else -> "§a" } - textToRender = "Current Milestone: $currentMilestone" + display = "Current Milestone: $currentMilestone" } @SubscribeEvent fun onWorldChange(event: WorldEvent.Load) { - textToRender = "" + display = "" currentMilestone = 0 } @@ -88,7 +88,7 @@ class DungeonMilestonesDisplay { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + textToRender) + SkyHanniMod.feature.dungeon.showMileStonesDisplayPos.renderString(color + display) } private fun isEnabled(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index d00d7a0df..44e9332f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -23,7 +23,7 @@ class NonGodPotEffectDisplay { private var checkFooter = false private val activeEffects = mutableMapOf<String, Long>() - private val textToRender = mutableListOf<String>() + private val display = mutableListOf<String>() private var lastTick = 0L private var nonGodPotEffects = mapOf( @@ -58,7 +58,7 @@ class NonGodPotEffectDisplay { private fun format() { val now = System.currentTimeMillis() - textToRender.clear() + display.clear() if (activeEffects.values.removeIf { now > it }) { //to fetch the real amount of active pots totalEffectsCount = 0 @@ -72,12 +72,12 @@ class NonGodPotEffectDisplay { val color = colorForTime(seconds) - textToRender.add("$label $color$format") + display.add("$label $color$format") } val diff = totalEffectsCount - activeEffects.size if (diff > 0) { - textToRender.add("§eOpen the /effects inventory") - textToRender.add("§eto show the missing $diff effects!") + display.add("§eOpen the /effects inventory") + display.add("§eto show the missing $diff effects!") checkFooter = true } } @@ -182,7 +182,7 @@ class NonGodPotEffectDisplay { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(textToRender) + SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(display) } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 3697838c7..ff28c52ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -430,20 +430,20 @@ object RenderUtils { if (string == null) return if (string == "") return - val textToRender = "§f$string" + val display = "§f$string" GlStateManager.pushMatrix() val resolution = ScaledResolution(minecraft) val renderer = minecraft.renderManager.fontRenderer ?: return - val offsetX = (200 - renderer.getStringWidth(textToRender.removeColor())) / 2 + val offsetX = (200 - renderer.getStringWidth(display.removeColor())) / 2 val x = getAbsX(resolution, 200) + offsetX val y = getAbsY(resolution, 16) + offsetY GlStateManager.translate(x + 1.0, y + 1.0, 0.0) - renderer.drawStringWithShadow(textToRender, 0f, 0f, 0) + renderer.drawStringWithShadow(display, 0f, 0f, 0) GlStateManager.popMatrix() } |