mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
various fixes
This commit is contained in:
@@ -16,7 +16,7 @@ import net.torvald.terrarum.ui.*
|
||||
/**
|
||||
* Created by minjaesong on 2021-11-10.
|
||||
*/
|
||||
class UIKeyboardInputConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
|
||||
override var width = 480
|
||||
override var height = 600
|
||||
@@ -179,7 +179,7 @@ class UIKeyboardInputConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
|
||||
// title
|
||||
// TODO only when text input using gamepad is supported, and even then, use text spinner
|
||||
// val title = Lang["MENU_CONTROLS_KEYBOARD"]
|
||||
// val title = Lang["MENU_LABEL_IME"]
|
||||
// App.fontGame.draw(batch, title, drawX.toFloat() + (width - App.fontGame.getWidth(title)) / 2, drawY.toFloat())
|
||||
|
||||
batch.color = Color.WHITE
|
||||
@@ -230,7 +230,7 @@ class UIKeyboardInputConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
* @param key LibGDX keycode. Set it to `null` to "disable" the key. Also see [com.badlogic.gdx.Input.Keys]
|
||||
*/
|
||||
private class UIItemInputKeycap(
|
||||
val parent: UIKeyboardInputConfig,
|
||||
val parent: UIIMEConfig,
|
||||
initialX: Int,
|
||||
initialY: Int,
|
||||
val key: Int?,
|
||||
@@ -32,7 +32,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
private val gameMenu = arrayOf(
|
||||
"MENU_IO_SAVE_GAME",
|
||||
"MENU_OPTIONS_CONTROLS",
|
||||
"MENU_CONTROLS_KEYBOARD",
|
||||
"MENU_LABEL_IME",
|
||||
"MENU_LABEL_LANGUAGE",
|
||||
"MENU_LABEL_QUIT",
|
||||
)
|
||||
@@ -77,7 +77,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
private val savingUI = UIItemSaving(this, (width - UIItemSaving.WIDTH) / 2, (height - UIItemSaving.HEIGHT) / 2)
|
||||
private val keyConfigUI = UIKeyboardControlPanel(null)
|
||||
private val languageUI = UITitleLanguage(null)
|
||||
private val keyboardSetupUI = UIKeyboardInputConfig(null)
|
||||
private val keyboardSetupUI = UIIMEConfig(null)
|
||||
|
||||
private var oldScreen = 0
|
||||
private var screen = 0
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
import net.torvald.terrarum.DefaultConfig
|
||||
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.*
|
||||
|
||||
@@ -270,7 +269,7 @@ private class UIItemKeycap(
|
||||
this.posX = initialX + parent.kbx
|
||||
this.posY = initialY + parent.kby
|
||||
}
|
||||
else if (parent is UIKeyboardInputConfig) {
|
||||
else if (parent is UIIMEConfig) {
|
||||
this.posX = initialX + parent.kbx
|
||||
this.posY = initialY + parent.kby
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
|
||||
private val radioCellWidth = 100
|
||||
private val inputWidth = 340
|
||||
private val radioX = (width - (radioCellWidth * 4 + 9)) / 2
|
||||
private val radioX = (width - (radioCellWidth * (if (App.IS_DEVELOPMENT_BUILD) 5 else 4) + 9)) / 2
|
||||
private val inputX = width - inputWidth
|
||||
|
||||
private val sizeSelY = 186 + 40
|
||||
@@ -53,12 +53,22 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
|
||||
private val sizeSelector = UIItemInlineRadioButtons(this,
|
||||
drawX + radioX, drawY + sizeSelY, radioCellWidth,
|
||||
listOf(
|
||||
{ Lang["CONTEXT_DESCRIPTION_SMALL"] },
|
||||
{ Lang["MENU_SETTING_MEDIUM"] }, // ;p
|
||||
{ Lang["CONTEXT_DESCRIPTION_BIG"] },
|
||||
{ Lang["CONTEXT_DESCRIPTION_HUGE"] }
|
||||
))
|
||||
if (App.IS_DEVELOPMENT_BUILD)
|
||||
listOf(
|
||||
{ Lang["CONTEXT_DESCRIPTION_TINY"] },
|
||||
{ Lang["CONTEXT_DESCRIPTION_SMALL"] },
|
||||
{ Lang["MENU_SETTING_MEDIUM"] }, // ;p
|
||||
{ Lang["CONTEXT_DESCRIPTION_BIG"] },
|
||||
{ Lang["CONTEXT_DESCRIPTION_HUGE"] }
|
||||
)
|
||||
else
|
||||
listOf(
|
||||
{ Lang["CONTEXT_DESCRIPTION_SMALL"] },
|
||||
{ Lang["MENU_SETTING_MEDIUM"] }, // ;p
|
||||
{ Lang["CONTEXT_DESCRIPTION_BIG"] },
|
||||
{ Lang["CONTEXT_DESCRIPTION_HUGE"] }
|
||||
)
|
||||
)
|
||||
|
||||
private val rng = HQRNG()
|
||||
|
||||
@@ -125,7 +135,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
// App.fontUITitle.draw(batch, titlestr, drawX + (width - App.fontGame.getWidth(titlestr)).div(2).toFloat(), titleTextPosY.toFloat())
|
||||
|
||||
// draw size previews
|
||||
val texture = tex[sizeSelector.selection]
|
||||
val texture = tex[sizeSelector.selection.coerceAtMost(tex.lastIndex)]
|
||||
val tx = drawX + (width - texture.regionWidth) / 2
|
||||
val ty = drawY + (160 - texture.regionHeight) / 2
|
||||
batch.draw(texture, tx.toFloat(), ty.toFloat())
|
||||
|
||||
@@ -16,7 +16,7 @@ object UITitleRemoConYaml {
|
||||
- MENU_OPTIONS
|
||||
- MENU_LABEL_GRAPHICS : net.torvald.terrarum.modulebasegame.ui.UIGraphicsControlPanel
|
||||
- MENU_OPTIONS_CONTROLS : net.torvald.terrarum.modulebasegame.ui.UIKeyboardControlPanel
|
||||
- MENU_CONTROLS_KEYBOARD : net.torvald.terrarum.modulebasegame.ui.UIKeyboardInputConfig
|
||||
- MENU_LABEL_IME : net.torvald.terrarum.modulebasegame.ui.UIIMEConfig
|
||||
- MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage
|
||||
- MENU_MODULES : net.torvald.terrarum.ModOptionsHost
|
||||
- MENU_LABEL_RETURN+WRITETOCONFIG
|
||||
|
||||
Reference in New Issue
Block a user