various fixes

This commit is contained in:
minjaesong
2022-03-16 12:50:43 +09:00
parent 40a7c6876a
commit 52f0dfdeb9
17 changed files with 116 additions and 115 deletions

View File

@@ -218,7 +218,7 @@ object ModMgr {
val hash = digester.digest(File(jarFilePath).readBytes()).joinToString("","","") { it.toInt().and(255).toString(16).uppercase().padStart(2,'0') }
if (jarHash != hash) {
println("Hash expected: $jarHash, got: $hash")
printdbg(this, "Hash expected: $jarHash, got: $hash")
throw IllegalStateException("Module Jarfile hash mismatch")
}

View File

@@ -144,7 +144,10 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
val SIZE_NORMAL = Point2i(9000, 2250)
val SIZE_LARGE = Point2i(13500, 2970)
val SIZE_HUGE = Point2i(22500, 4500)
val WORLDSIZE = arrayOf(SIZE_SMALL, SIZE_NORMAL, SIZE_LARGE, SIZE_HUGE)
val WORLDSIZE = if (App.IS_DEVELOPMENT_BUILD)
arrayOf(Point2i(2880, 1350), SIZE_SMALL, SIZE_NORMAL, SIZE_LARGE, SIZE_HUGE)
else
arrayOf(SIZE_SMALL, SIZE_NORMAL, SIZE_LARGE, SIZE_HUGE)
val worldgenThreadExecutor = ThreadExecutor()
}

View File

@@ -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?,

View File

@@ -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

View File

@@ -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
}

View File

@@ -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())

View File

@@ -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

View File

@@ -53,6 +53,7 @@ import kotlin.math.roundToInt
* ...
* endClosing()
* ```
* NOTE: show/hide is a UICanvas function, while do/endSomething() is UIHandler function.
*
* Created by minjaesong on 2015-12-31.
*/