fixed a bug where hitbox of char/world selector is not changing when chat overlay is on

This commit is contained in:
minjaesong
2021-12-18 15:23:32 +09:00
parent 90197115d4
commit 07345e3128
24 changed files with 2774 additions and 18 deletions

View File

@@ -110,7 +110,7 @@ object IME {
val iconPixmap = Pixmap(Gdx.files.internal("assets/graphics/gui/ime_icons_by_language.tga"))
for (k in 0 until iconPixmap.height step 20) {
val langCode = StringBuilder()
for (c in 0 until 4) {
for (c in 0 until 20) {
val x = c
var charnum = 0
for (b in 0 until 7) {

View File

@@ -59,11 +59,14 @@ object Lang {
localesDir.listFiles().filter { it.isDirectory }.forEach { languageList.add(it.name) }
// temporary filter
languageList.remove("jakanaJP")
languageList.remove("jaJPysi")
for (lang in languageList) {
printdbg(this, "Loading langpack from $localesDir/$lang/")
val langFileListFiles = File("$localesDir/$lang/").listFiles()
langFileListFiles.forEach {
langFileListFiles?.forEach {
// not a polyglot
if (!it.name.startsWith("Polyglot") && it.name.endsWith(".json")) {
processRegularLangfile(it, lang)

View File

@@ -100,7 +100,9 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : UICanvas() {
internal val uiWidth = SAVE_CELL_WIDTH
internal val uiX = (width - uiWidth) / 2
internal val uiX: Int
get() = (Toolkit.drawWidth - uiWidth) / 2
internal val uiXdiffChatOverlay = App.scr.chatWidth / 2
internal val textH = App.fontGame.lineHeight.toInt()
@@ -167,7 +169,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : UICanvas() {
// read savegames
var savegamesCount = 0
App.savegameWorlds.forEach { (_, skimmer) ->
val x = uiX + if (App.getConfigBoolean("fx_streamerslayout")) App.scr.chatWidth / 2 else 0
val x = uiX
val y = titleTopGradEnd + cellInterval * savegamesCount
try {
worldCells.add(UIItemWorldCells(this, x, y, skimmer))
@@ -181,7 +183,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : UICanvas() {
savegamesCount = 0
App.savegamePlayers.forEach { (_, skimmer) ->
val x = uiX + if (App.getConfigBoolean("fx_streamerslayout")) App.scr.chatWidth / 2 else 0
val x = uiX
val y = titleTopGradEnd + cellInterval * savegamesCount
try {
playerCells.add(UIItemPlayerCells(this, x, y, skimmer))
@@ -313,9 +315,15 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : UICanvas() {
batch.inUse {
for (index in 0 until cells.size) {
val it = cells[index]
if (index in listScroll - 2 until listScroll + savesVisible + 2) {
if (App.getConfigBoolean("fx_streamerslayout"))
it.posX += uiXdiffChatOverlay
if (index in listScroll - 2 until listScroll + savesVisible + 2)
it.render(batch, camera)
}
if (App.getConfigBoolean("fx_streamerslayout"))
it.posX -= uiXdiffChatOverlay
}
}
savePixmap = Pixmap.createFromFrameBuffer(0, 0, sliderFBO.width, sliderFBO.height)
@@ -528,6 +536,13 @@ class UIItemPlayerCells(
private val icons = CommonResourcePool.getAsTextureRegionPack("inventory_category")
private var highlightCol: Color = defaultCol
override fun update(delta: Float) {
super.update(delta)
highlightCol = if (mouseUp) litCol else defaultCol
}
override fun render(batch: SpriteBatch, camera: Camera) {
// try to generate a texture
if (skimmer.initialised && !hasTexture) {
@@ -547,7 +562,6 @@ class UIItemPlayerCells(
hasTexture = true
}
val highlightCol = if (mouseUp) litCol else defaultCol
val x = posX.toFloat()
val y = posY.toFloat()
@@ -665,10 +679,7 @@ class UIItemWorldCells(
private val colourBad = Color(0xFF0011FF.toInt())
private val cellCol = CELL_COL
init {
}
private var highlightCol: Color = Color.WHITE
override var clickOnceListener: ((Int, Int, Int) -> Unit)? = { _: Int, _: Int, _: Int ->
UILoadGovernor.worldDisk = skimmer
@@ -678,6 +689,11 @@ class UIItemWorldCells(
internal var hasTexture = false
private set
override fun update(delta: Float) {
super.update(delta)
highlightCol = if (mouseUp) Toolkit.Theme.COL_ACTIVE else Color.WHITE
}
override fun render(batch: SpriteBatch, camera: Camera) {
// try to generate a texture
if (skimmer.initialised && !hasTexture) {
@@ -698,7 +714,6 @@ class UIItemWorldCells(
hasTexture = true
}
val highlightCol = if (mouseUp) Toolkit.Theme.COL_ACTIVE else Color.WHITE
val x = posX.toFloat()
val y = posY.toFloat()

View File

@@ -37,7 +37,9 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
internal val uiWidth = MODULEINFO_CELL_WIDTH
internal val uiX = (width - uiWidth) / 2
internal val uiX: Int
get() = (App.scr.width - uiWidth) / 2
internal val uiXdiffChatOverlay = App.scr.chatWidth / 2
internal val textH = App.fontGame.lineHeight.toInt()
@@ -83,7 +85,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
// read savegames
var savegamesCount = 0
ModMgr.loadOrder.forEachIndexed { index, s ->
val x = uiX + if (App.getConfigBoolean("fx_streamerslayout")) App.scr.chatWidth / 2 else 0
val x = uiX
val y = titleTopGradEnd + cellInterval * savegamesCount
try {
moduleCells.add(UIItemModuleInfoCell(this, index, x, y))
@@ -120,7 +122,14 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
if (index in listScroll - 2 until listScroll + savesVisible + 2) {
// re-position
it.posY = (it.initialY - uiScroll).roundToInt()
if (App.getConfigBoolean("fx_streamerslayout"))
it.posX -= uiXdiffChatOverlay
it.update(delta)
if (App.getConfigBoolean("fx_streamerslayout"))
it.posX += uiXdiffChatOverlay
}
}
}