mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 21:44:05 +09:00
game loading is back but newgame is broken
This commit is contained in:
@@ -16,11 +16,10 @@ import net.torvald.terrarum.langpack.Lang
|
||||
open class UIItemTextButton(
|
||||
parentUI: UICanvas,
|
||||
/** Stored text (independent to the Langpack) */
|
||||
val labelText: String,
|
||||
val textfun: () -> String,
|
||||
initialX: Int,
|
||||
initialY: Int,
|
||||
override val width: Int,
|
||||
val readFromLang: Boolean = false,
|
||||
|
||||
/** Colour when mouse is over */
|
||||
var activeCol: Color = Toolkit.Theme.COL_MOUSE_UP,
|
||||
@@ -38,6 +37,7 @@ open class UIItemTextButton(
|
||||
var inactiveCol: Color = Toolkit.Theme.COL_LIST_DEFAULT,
|
||||
|
||||
var disabledCol: Color = Toolkit.Theme.COL_INVENTORY_CELL_BORDER,
|
||||
var disabledTextCol: Color = Color(0x888888FF.toInt()),
|
||||
|
||||
val hasBorder: Boolean = false,
|
||||
|
||||
@@ -63,7 +63,7 @@ open class UIItemTextButton(
|
||||
|
||||
/** Actually displayed text (changes with the app language) */
|
||||
val label: String
|
||||
get() = if (readFromLang) Lang[labelText] else labelText
|
||||
get() = textfun()
|
||||
|
||||
|
||||
override val height: Int = hitboxSize
|
||||
@@ -128,6 +128,7 @@ open class UIItemTextButton(
|
||||
}
|
||||
|
||||
// draw text
|
||||
if (!isEnabled) batch.color = disabledTextCol
|
||||
font.draw(batch, label, fontX, fontY)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.BlendMode
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.toInt
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
|
||||
@@ -79,13 +80,15 @@ class UIItemTextButtonList(
|
||||
val lh = itemHitboxSize
|
||||
val vertOff = lineHeight * i
|
||||
|
||||
val ld0 = { s }
|
||||
val ld1 = { Lang[s] }
|
||||
|
||||
// if (!kinematic) {
|
||||
UIItemTextButton(
|
||||
parentUI, s,
|
||||
parentUI, if (readFromLang) ld1 else ld0,
|
||||
initialX = posX,
|
||||
initialY = posY + vertOff,
|
||||
width = width,
|
||||
readFromLang = readFromLang,
|
||||
activeCol = activeCol,
|
||||
activeBackCol = activeBackCol,
|
||||
activeBackBlendMode = activeBackBlendMode,
|
||||
|
||||
Reference in New Issue
Block a user