From 1b69d7429155a867f8cddc3b919eb5a2e95bb88d Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 15 Jan 2025 20:39:44 +0900 Subject: [PATCH] minor fixes --- assets/graphics/code_input_cells.tga | 4 ++-- src/net/torvald/terrarum/ui/UIItemRedeemCodeArea.kt | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/graphics/code_input_cells.tga b/assets/graphics/code_input_cells.tga index a3619ef92..3e8b0ebd9 100644 --- a/assets/graphics/code_input_cells.tga +++ b/assets/graphics/code_input_cells.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2aabf5f054d00112b20caee427e28eb23cc3abb054641162af0a7fad88cfc10 -size 4242 +oid sha256:1379cb62ec1fc78f3cada4ab15f3b00f5c095a86d1d8d81f1830873adab0c9c1 +size 4626 diff --git a/src/net/torvald/terrarum/ui/UIItemRedeemCodeArea.kt b/src/net/torvald/terrarum/ui/UIItemRedeemCodeArea.kt index 03d184af9..37cb24339 100644 --- a/src/net/torvald/terrarum/ui/UIItemRedeemCodeArea.kt +++ b/src/net/torvald/terrarum/ui/UIItemRedeemCodeArea.kt @@ -22,7 +22,7 @@ class UIItemRedeemCodeArea( ) : UIItem(parentUI, initialX, initialY) { private val CELL_W = 16 - private val CELL_H = 22 + private val CELL_H = 24 override val width = textCols * CELL_W override val height = textRows * CELL_H @@ -85,6 +85,7 @@ class UIItemRedeemCodeArea( Toolkit.drawBoxBorder(batch, posX, posY, width, height) // draw cells + batch.color = Toolkit.Theme.COL_INACTIVE for (y in 0 until textRows) { for (x in 0 until textCols) { batch.draw(inputFormTiles.get(if (x == 0) 0 else if (x == textCols - 1) 2 else 1, 0), @@ -99,9 +100,9 @@ class UIItemRedeemCodeArea( for (x in 0 until textCols) { BigAlphNum.draw( batch, - "${inputText[y * textRows + x]}", + "${inputText.getOrElse(y * textRows + x) { 'A' }}", posX + CELL_W * x + 2f, - posY + CELL_H * y + 3f + posY + CELL_H * y + 4f ) } }