aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/renderables
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-10-13 09:54:05 -0400
committerGitHub <noreply@github.com>2024-10-13 15:54:05 +0200
commite0ae2e8ad4602b3e96fb6ec39716709f225d2461 (patch)
treeb70ad5cec46af89dd0f05a61d39027a964c03693 /src/main/java/at/hannibal2/skyhanni/utils/renderables
parent113389a86c769d4d3a547fac5b7440fa8f29bc6f (diff)
downloadskyhanni-e0ae2e8ad4602b3e96fb6ec39716709f225d2461.tar.gz
skyhanni-e0ae2e8ad4602b3e96fb6ec39716709f225d2461.tar.bz2
skyhanni-e0ae2e8ad4602b3e96fb6ec39716709f225d2461.zip
Backend: Detekt Fixes Part 7 (#2667)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/renderables')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt
index 94f0bc16e..c7c66084e 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt
@@ -260,7 +260,16 @@ interface Renderable {
val isInNeuSettings = openGui.startsWith("io.github.moulberry.notenoughupdates.")
val result =
- isGuiScreen && isGuiPositionEditor && inMenu && isNotInSignAndOnSlot && isConfigScreen && !isInNeuPv && !isInSkytilsPv && !neuFocus && !isInSkytilsSettings && !isInNeuSettings
+ isGuiScreen &&
+ isGuiPositionEditor &&
+ inMenu &&
+ isNotInSignAndOnSlot &&
+ isConfigScreen &&
+ !isInNeuPv &&
+ !isInSkytilsPv &&
+ !neuFocus &&
+ !isInSkytilsSettings &&
+ !isInNeuSettings
if (debug) {
if (!result) {
@@ -614,7 +623,12 @@ interface Renderable {
override val horizontalAlign = content.horizontalAlign
override val verticalAlign = content.verticalAlign
- val searchWidth get() = (Minecraft.getMinecraft().fontRendererObj.getStringWidth(searchPrefix + textInput.editTextWithAlwaysCarriage()) * scale).toInt() + 1
+ val searchWidth: Int
+ get() {
+ val fontRenderer = Minecraft.getMinecraft().fontRendererObj
+ val string = searchPrefix + textInput.editTextWithAlwaysCarriage()
+ return (fontRenderer.getStringWidth(string) * scale).toInt() + 1
+ }
init {
textInput.registerToEvent(key) {