Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'drawAllInList' function #446

Merged
merged 15 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ object BossHPDisplays {
}

override fun demoRender() {
RenderUtil.drawAllInList(this, GIANT_NAMES.map { "$it §a20M§c❤" })
RenderUtil.drawAllInList(this, GIANT_NAMES.map { "$it §a19.5M§c❤" })
}

override val height: Int
get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * GIANT_NAMES.size
override val width: Int
get() = ScreenRenderer.fontRenderer.getStringWidth("§3§lThe Diamond Giant §a19.9M§c❤")
get() = ScreenRenderer.fontRenderer.getStringWidth("§3§lThe Diamond Giant §a19.5M§c❤")

override val toggled: Boolean
get() = Skytils.config.showGiantHP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ object ChestProfit {
override val height: Int
get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * DungeonChest.entries.size
override val width: Int
get() = ScreenRenderer.fontRenderer.getStringWidth("Obsidian Chest: 300M")
get() = ScreenRenderer.fontRenderer.getStringWidth("Obsidian Chest: +300M")

override val toggled: Boolean
get() = Skytils.config.dungeonChestProfit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ object DungeonTimer {
}

override val height: Int
get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * 5
get() = ScreenRenderer.fontRenderer.FONT_HEIGHT * 6
override val width: Int
get() = ScreenRenderer.fontRenderer.getStringWidth("§7Wither King: 0s")

Expand Down
TakoTheDev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,4 @@ object DungeonListener {

fun canRender() = player != null && player!!.health > 0 && !dead
}
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ object RenderUtil {
val leftAlign = element.scaleX < UResolution.scaledWidth / 2f
val alignment =
if (leftAlign) SmartFontRenderer.TextAlignment.LEFT_RIGHT else SmartFontRenderer.TextAlignment.RIGHT_LEFT
val xPos = if (leftAlign) 0f else element.scaleWidth
val xPos = if (leftAlign) 0f else element.width.toFloat()
for ((i, str) in lines.withIndex()) {
ScreenRenderer.fontRenderer.drawString(
str,
Expand Down