modloader: locale autoloader

This commit is contained in:
minjaesong
2023-09-06 02:15:04 +09:00
parent 70b9cebbd0
commit 7259ca616c
5 changed files with 14 additions and 6 deletions

View File

@@ -211,6 +211,12 @@ object ModMgr {
GameRetextureLoader(moduleName)
}
// add locales if exists
if (hasFile(moduleName, "locales")) {
printdbg(this, "Trying to load Locales on ${moduleName}")
GameLanguageLoader(moduleName)
}
// run entry script in entry point
if (entryPoint.isNotBlank()) {
var newClass: Class<*>? = null

View File

@@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.App
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar.Companion.COMMON_OPEN_CLOSE
import net.torvald.terrarum.ui.Movement
import net.torvald.terrarum.ui.UICanvas
@@ -26,7 +27,7 @@ class UIScreenZoom : UICanvas(
handler.allowESCtoClose = false
}
val zoomText = "${getKeycapPC(handler.toggleKey!!)} $EMDASH Zoom Out"
val zoomText = "${getKeycapPC(handler.toggleKey!!)} ${Lang["GAME_ACTION_ZOOM_OUT"]}"
override var width = App.fontGame.getWidth(zoomText)
override var height = App.fontGame.lineHeight.toInt()

View File

@@ -86,7 +86,7 @@ class UIItemModuleInfoCell(
batch.draw(modIcon, initialX + 35f, initialY + 12f)
batch.shader = null
batch.color = Color.WHITE
App.fontGame.draw(batch, "$ccZero${modName.toUpperCase()}$ccNum $modVer", initialX + 86f + 3f, initialY.toFloat())
App.fontGame.draw(batch, "$ccZero${modProp.properName}$ccNum $modVer", initialX + 86f + 3f, initialY.toFloat())
if (modErrored)
App.fontGame.draw(batch, "$emphRed${modErrors.first().cause?.message}", initialX + 86f + 3f, initialY + 24f)
else