diff --git a/src/net/torvald/terrarum/App.java b/src/net/torvald/terrarum/App.java index 824520ca5..e3d434a0b 100644 --- a/src/net/torvald/terrarum/App.java +++ b/src/net/torvald/terrarum/App.java @@ -557,7 +557,7 @@ public class App implements ApplicationListener { false, 64, false, 0.5f, false ); - fontUITitle.setInterchar(2); + fontUITitle.setInterchar(1); fontGameFBO = new TerrarumSansBitmap(FONT_DIR, false, true, false, false, 64, false, 203f/255f, false diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIGraphicsControlPanel.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIGraphicsControlPanel.kt index 6374f66bd..9e08433ab 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIGraphicsControlPanel.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIGraphicsControlPanel.kt @@ -167,8 +167,11 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() { options.forEachIndexed { index, strings -> val mode = strings[2] + + val font = if (mode == "h1") App.fontUITitle else App.fontGame + val label = (strings[1] as () -> String).invoke() - val labelWidth = App.fontGame.getWidth(label) + val labelWidth = font.getWidth(label) batch.color = when (mode) { "h1" -> Toolkit.Theme.COL_MOUSE_UP "p" -> Color.LIGHT_GRAY @@ -180,7 +183,7 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() { else drawX + width/2 - panelgap - labelWidth // right aligned at the middle of the panel, offsetted by panelgap - App.fontGame.draw(batch, label, xpos.toFloat(), drawY + optionsYpos[index] - 2f) + font.draw(batch, label, xpos.toFloat(), drawY + optionsYpos[index] - 2f) // draw hrule if (mode == "h1") { diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt index 99ca02d03..089cb5a54 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIIMEConfig.kt @@ -180,7 +180,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() { // todo show "Keyboard"/"Gamepad" accordingly val title = Lang["MENU_CONTROLS_KEYBOARD"] batch.color = Color.WHITE - App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat()) + App.fontUITitle.draw(batch, title, drawX.toFloat() + (width - App.fontUITitle.getWidth(title)) / 2, drawY.toFloat()) // button help for string input UI diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt index b719dab3d..0203022d4 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIKeyboardControlPanel.kt @@ -201,7 +201,9 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() { // todo show "Keyboard"/"Gamepad" accordingly batch.color = Color.WHITE val title = Lang["MENU_CONTROLS_KEYBOARD"] - App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat()) + App.fontUITitle.draw(batch, title, drawX.toFloat() + (width - App.fontUITitle.getWidth(title)) / 2, drawY.toFloat()) + + val desc = Lang["MENU_LABEL_KEYCONFIG_HELP1"] App.fontGame.draw(batch, desc, drawX.toFloat() + (width - App.fontGame.getWidth(desc)) / 2, drawY + 360f) diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UILoadDemoSavefiles.kt b/src/net/torvald/terrarum/modulebasegame/ui/UILoadDemoSavefiles.kt index 5e5dae373..c329fd0fe 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UILoadDemoSavefiles.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UILoadDemoSavefiles.kt @@ -374,7 +374,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : UICanvas() { // draw texts val loadGameTitleStr = Lang[titles[mode]]// + "$EMDASH$hash" // "Game Load" - App.fontUITitle.draw(batch, loadGameTitleStr, (width - App.fontGame.getWidth(loadGameTitleStr)).div(2).toFloat(), titleTextPosY.toFloat()) + App.fontUITitle.draw(batch, loadGameTitleStr, (width - App.fontUITitle.getWidth(loadGameTitleStr)).div(2).toFloat(), titleTextPosY.toFloat()) // Control help App.fontGame.draw(batch, controlHelp, uiX.toFloat(), controlHelperY.toFloat()) } diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UINewCharacter.kt b/src/net/torvald/terrarum/modulebasegame/ui/UINewCharacter.kt index da7528225..88fff0612 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UINewCharacter.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UINewCharacter.kt @@ -107,7 +107,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() { batch.color = Color.WHITE // ui title // val titlestr = Lang["CONTEXT_WORLD_NEW"] -// App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontGame.getWidth(titlestr)).div(2).toFloat(), titleTextPosY.toFloat()) +// App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontUITitle.getWidth(titlestr)).div(2).toFloat(), titleTextPosY.toFloat()) // name/seed input labels diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UINewWorld.kt b/src/net/torvald/terrarum/modulebasegame/ui/UINewWorld.kt index 45cac9733..26854eed4 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UINewWorld.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UINewWorld.kt @@ -131,7 +131,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() { batch.color = Color.WHITE // ui title // val titlestr = Lang["CONTEXT_WORLD_NEW"] -// App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontGame.getWidth(titlestr)).div(2).toFloat(), titleTextPosY.toFloat()) +// App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontUITitle.getWidth(titlestr)).div(2).toFloat(), titleTextPosY.toFloat()) // draw size previews val texture = tex[sizeSelector.selection.coerceAtMost(tex.lastIndex)] diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UITitleModules.kt b/src/net/torvald/terrarum/modulebasegame/ui/UITitleModules.kt index fde9edd4a..f22f03881 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UITitleModules.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UITitleModules.kt @@ -192,7 +192,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() { // draw texts val loadGameTitleStr = Lang["MENU_MODULES"]// + "$EMDASH$hash" // "Game Load" - App.fontUITitle.draw(batch, loadGameTitleStr, (width - App.fontGame.getWidth(loadGameTitleStr)).div(2).toFloat(), titleTextPosY.toFloat()) + App.fontUITitle.draw(batch, loadGameTitleStr, (width - App.fontUITitle.getWidth(loadGameTitleStr)).div(2).toFloat(), titleTextPosY.toFloat()) // Control help App.fontGame.draw(batch, controlHelp, uiX.toFloat(), controlHelperY.toFloat()) } diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIWorldPortalSearch.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIWorldPortalSearch.kt index 2be8b21e3..aed75e6db 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIWorldPortalSearch.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIWorldPortalSearch.kt @@ -16,6 +16,7 @@ import net.torvald.terrarum.modulebasegame.TerrarumIngame import net.torvald.terrarum.modulebasegame.WorldgenLoadScreen import net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer import net.torvald.terrarum.modulebasegame.serialise.ReadActor +import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.INVENTORY_CELLS_OFFSET_Y import net.torvald.terrarum.savegame.ByteArray64Reader import net.torvald.terrarum.savegame.VDFileID import net.torvald.terrarum.savegame.VirtualDisk @@ -53,8 +54,6 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() { private val sizeSelY = 186 + 40 - internal val titleTextPosY: Int = App.scr.tvSafeGraphicsHeight + 10 - private val sizeSelector = UIItemInlineRadioButtons(this, drawX + radioX, drawY + sizeSelY, radioCellWidth, listOf( @@ -149,8 +148,8 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() { batch.color = Color.WHITE // ui title -// val titlestr = Lang["CONTEXT_WORLD_NEW"] -// App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontGame.getWidth(titlestr)).div(2).toFloat(), titleTextPosY.toFloat()) + val titlestr = Lang["CONTEXT_WORLD_SEARCH"] + App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontUITitle.getWidth(titlestr)).div(2).toFloat(), INVENTORY_CELLS_OFFSET_Y() - 72f) // draw size previews val texture = tex[sizeSelector.selection.coerceAtMost(tex.lastIndex)]