no module titlescreen: clickable load order path

This commit is contained in:
minjaesong
2022-02-24 13:44:51 +09:00
parent 900cef6435
commit 8ee221b93d
12 changed files with 47 additions and 16 deletions

View File

@@ -18,5 +18,5 @@
"MENU_OPTIONS_PARTICLES": "Partikel", "MENU_OPTIONS_PARTICLES": "Partikel",
"MENU_IO_IMPORT": "Importieren", "MENU_IO_IMPORT": "Importieren",
"APP_NOMODULE_1": "Derzeit ist kein Modul geladen.", "APP_NOMODULE_1": "Derzeit ist kein Modul geladen.",
"APP_NOMODULE_2": "Bitte konfigurieren Sie Ihren Ladeauftrag neu auf:" "APP_NOMODULE_2": "Bitte konfigurieren Sie Ihre Ladereihenfolge und starten Sie neu:"
} }

View File

@@ -22,5 +22,5 @@
"MENU_OPTIONS_PARTICLES": "Particles", "MENU_OPTIONS_PARTICLES": "Particles",
"MENU_IO_IMPORT": "Import", "MENU_IO_IMPORT": "Import",
"APP_NOMODULE_1": "No Module is currently loaded.", "APP_NOMODULE_1": "No Module is currently loaded.",
"APP_NOMODULE_2": "Please reconfigure your Load Order on:" "APP_NOMODULE_2": "Please configure your Load Order and restart:"
} }

View File

@@ -18,5 +18,5 @@
"MENU_OPTIONS_PARTICLES": "Partícula", "MENU_OPTIONS_PARTICLES": "Partícula",
"MENU_IO_IMPORT": "Importar", "MENU_IO_IMPORT": "Importar",
"APP_NOMODULE_1": "Actualmente no hay ningún módulo cargado.", "APP_NOMODULE_1": "Actualmente no hay ningún módulo cargado.",
"APP_NOMODULE_2": "Vuelva a configurar su orden de carga en:" "APP_NOMODULE_2": "Configure su orden de carga y reinicie:"
} }

View File

@@ -18,5 +18,5 @@
"MENU_OPTIONS_PARTICLES": "Hiukkaset", "MENU_OPTIONS_PARTICLES": "Hiukkaset",
"MENU_IO_IMPORT": "Tuo", "MENU_IO_IMPORT": "Tuo",
"APP_NOMODULE_1": "Moduulia ei ole ladattu tällä hetkellä.", "APP_NOMODULE_1": "Moduulia ei ole ladattu tällä hetkellä.",
"APP_NOMODULE_2": "Määritä lataustilauksesi uudelleen:" "APP_NOMODULE_2": "Määritä latausjärjestys ja käynnistä se uudelleen:"
} }

View File

@@ -19,5 +19,5 @@
"MENU_OPTIONS_PARTICLES": "Particules", "MENU_OPTIONS_PARTICLES": "Particules",
"MENU_IO_IMPORT": "Importer", "MENU_IO_IMPORT": "Importer",
"APP_NOMODULE_1": "Aucun module nest actuellement chargé.", "APP_NOMODULE_1": "Aucun module nest actuellement chargé.",
"APP_NOMODULE_2": "Veuillez reconfigurer votre ordre de chargement sur :" "APP_NOMODULE_2": "Veuillez configurer votre Load Order et redémarrer :"
} }

View File

@@ -18,5 +18,5 @@
"MENU_OPTIONS_PARTICLES": "कणों", "MENU_OPTIONS_PARTICLES": "कणों",
"MENU_IO_IMPORT": "Import", "MENU_IO_IMPORT": "Import",
"APP_NOMODULE_1": "वर्तमान में कोई मॉड्यूल लोड नहीं है।", "APP_NOMODULE_1": "वर्तमान में कोई मॉड्यूल लोड नहीं है।",
"APP_NOMODULE_2": "कृपया निम्न फ़ाइल पर अपना लोड ऑर्डर पुन: कॉन्फ़िगर करें:" "APP_NOMODULE_2": "कृपया अपना लोड ऑर्डर कॉन्फ़िगर करें और पुनः आरंभ करें:"
} }

View File

@@ -18,5 +18,5 @@
"MENU_OPTIONS_PARTICLES": "粒子の数", "MENU_OPTIONS_PARTICLES": "粒子の数",
"MENU_IO_IMPORT": "インポート", "MENU_IO_IMPORT": "インポート",
"APP_NOMODULE_1": "現在ロードされたモジュールがありません。", "APP_NOMODULE_1": "現在ロードされたモジュールがありません。",
"APP_NOMODULE_2": "次のファイルでロードオーダーを設定してください。" "APP_NOMODULE_2": "次のファイルでロードオーダーを設定してゲームを再起動してください。"
} }

View File

@@ -21,5 +21,5 @@
"MENU_OPTIONS_PARTICLES": "입자 수", "MENU_OPTIONS_PARTICLES": "입자 수",
"MENU_IO_IMPORT": "가져오기", "MENU_IO_IMPORT": "가져오기",
"APP_NOMODULE_1": "현재 불러와진 모듈이 없습니다.", "APP_NOMODULE_1": "현재 불러와진 모듈이 없습니다.",
"APP_NOMODULE_2": "다음의 파일에서 불러오기 순서를 설정하십시오." "APP_NOMODULE_2": "다음의 파일에서 불러오기 순서를 설정하고 게임을 재시작하십시오."
} }

View File

@@ -17,5 +17,5 @@
"MENU_OPTIONS_PARTICLES": "Частица", "MENU_OPTIONS_PARTICLES": "Частица",
"MENU_IO_IMPORT": "Импорт", "MENU_IO_IMPORT": "Импорт",
"APP_NOMODULE_1": "В настоящее время модуль не загружен.", "APP_NOMODULE_1": "В настоящее время модуль не загружен.",
"APP_NOMODULE_2": "Измените конфигурацию вашего порядка загрузки на:" "APP_NOMODULE_2": "Пожалуйста, настройте порядок загрузки и перезапустите:"
} }

View File

@@ -24,5 +24,5 @@
"MENU_OPTIONS_PARTICLES": "微粒数", "MENU_OPTIONS_PARTICLES": "微粒数",
"MENU_IO_IMPORT": "匯入", "MENU_IO_IMPORT": "匯入",
"APP_NOMODULE_1": "当前未加载任何模块。", "APP_NOMODULE_1": "当前未加载任何模块。",
"APP_NOMODULE_2": "请重新配置您的加载顺序:" "APP_NOMODULE_2": "请配置您的加载顺序并重新启动"
} }

View File

@@ -20,5 +20,5 @@
"MENU_OPTIONS_PARTICLES": "粒子数", "MENU_OPTIONS_PARTICLES": "粒子数",
"MENU_IO_IMPORT": "Import", "MENU_IO_IMPORT": "Import",
"APP_NOMODULE_1": "當前未加載任何模塊。", "APP_NOMODULE_1": "當前未加載任何模塊。",
"APP_NOMODULE_2": "請重新配置您的加載順序:" "APP_NOMODULE_2": "請配置您的加載順序並重新啟動"
} }

View File

@@ -1,11 +1,16 @@
package net.torvald.terrarum package net.torvald.terrarum
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input
import com.badlogic.gdx.Input.Keys
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Pixmap import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer import com.badlogic.gdx.graphics.glutils.FrameBuffer
import net.torvald.terrarum.langpack.Lang import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.ui.Toolkit import net.torvald.terrarum.ui.Toolkit
import java.awt.Desktop
import java.io.File
/** /**
* Created by minjaesong on 2021-12-11. * Created by minjaesong on 2021-12-11.
@@ -21,6 +26,15 @@ class NoModuleDefaultTitlescreen(batch: FlippingSpriteBatch) : IngameInstance(ba
private var init = false private var init = false
private val pathText = App.loadOrderDir private val pathText = App.loadOrderDir
private val pathFile = File(App.loadOrderDir)//.parentFile
private val pathButtonW = App.fontGameFBO.getWidth(pathText)
private val pathButtonH = 20
private var pathButtonX = 0f
private var pathButtonY = 0f
private var gamemode = 0
private val fbatch = SpriteBatch()
override fun render(updateRate: Float) { override fun render(updateRate: Float) {
gdxClearAndSetBlend(0f, 0f, 0f, 0f) gdxClearAndSetBlend(0f, 0f, 0f, 0f)
@@ -46,8 +60,8 @@ class NoModuleDefaultTitlescreen(batch: FlippingSpriteBatch) : IngameInstance(ba
batch.color = Color.WHITE batch.color = Color.WHITE
wot.reversed().forEachIndexed { index, s -> wot.reversed().forEachIndexed { index, s ->
if (index == 0) { if (index == 0) {
batch.color = Toolkit.Theme.COL_HIGHLIGHT pathButtonX = (Toolkit.drawWidth - pathButtonW) / 2f
App.fontGameFBO.draw(batch, pathText, (Toolkit.drawWidth - App.fontGameFBO.getWidth(pathText)) / 2f, heights[index] + centering) pathButtonY = heights[index] + centering
} }
else { else {
batch.color = Color.WHITE batch.color = Color.WHITE
@@ -58,14 +72,31 @@ class NoModuleDefaultTitlescreen(batch: FlippingSpriteBatch) : IngameInstance(ba
} }
} }
batch.inUse { if (gamemode == 0) {
batch.color = Color.WHITE val mouseOnLink = (Gdx.input.x.toFloat() in pathButtonX - 48..pathButtonX + 48 + pathButtonW &&
batch.draw(fbo.colorBufferTexture, 0f, 0f) App.scr.hf - Gdx.input.y in pathButtonY - 12..pathButtonY + pathButtonH + 12)
if (mouseOnLink && Gdx.input.isButtonJustPressed(Input.Buttons.LEFT)) {
Desktop.getDesktop().open(pathFile)
}
fbatch.inUse {
it.color = Color.WHITE
it.draw(fbo.colorBufferTexture, 0f, fbo.height.toFloat(), fbo.width.toFloat(), -fbo.height.toFloat())
it.color = if (mouseOnLink) Toolkit.Theme.COL_HIGHLIGHT else Toolkit.Theme.COL_ACTIVE
App.fontGame.draw(it, pathText, pathButtonX, pathButtonY)
}
if (Gdx.input.isKeyPressed(Keys.ESCAPE)) gamemode = 1
}
else if (gamemode == 1) {
} }
} }
override fun dispose() { override fun dispose() {
super.dispose() super.dispose()
fbatch.dispose()
fbo.dispose() fbo.dispose()
} }