fix: scroll controller for portal listing is 2 px shorter that it should

This commit is contained in:
minjaesong
2023-06-18 00:40:55 +09:00
parent 4cc52b5585
commit 376595d7cd
4 changed files with 34 additions and 6 deletions

View File

@@ -67,9 +67,9 @@ class UIWorldPortal : UICanvas(
"$SP${App.gamepadLabelRT} ${Lang["GAME_INVENTORY"]}"
private val transitionalSearch = UIWorldPortalSearch(this)
private val transitionalListing = UIWorldPortalListing(this)
private val transitionalCargo = UIWorldPortalCargo(this)
val transitionalSearch = UIWorldPortalSearch(this)
val transitionalListing = UIWorldPortalListing(this)
val transitionalCargo = UIWorldPortalCargo(this)
private val transitionPanel = UIItemHorizontalFadeSlide(
this,
(width - internalWidth) / 2,

View File

@@ -3,14 +3,36 @@ package net.torvald.terrarum.modulebasegame.ui
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.App
import net.torvald.terrarum.INGAME
import net.torvald.terrarum.gameitems.GameItem
import net.torvald.terrarum.modulebasegame.gameactors.FixtureInventory
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.ui.UICanvas
class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas() {
class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
override var width: Int = Toolkit.drawWidth
override var height: Int = App.scr.height
lateinit var chestInventory: FixtureInventory
lateinit var chestNameFun: () -> String
private val negotiator = object : InventoryTransactionNegotiator() {
override fun accept(player: FixtureInventory, fixture: FixtureInventory, item: GameItem, amount: Long) {
player.remove(item, amount)
fixture.add(item, amount)
}
override fun reject(fixture: FixtureInventory, player: FixtureInventory, item: GameItem, amount: Long) {
fixture.remove(item, amount)
player.add(item, amount)
}
}
override fun getNegotiator() = negotiator
override fun getFixtureInventory(): FixtureInventory = chestInventory
override fun getPlayerInventory(): FixtureInventory = INGAME.actorNowPlaying!!.inventory
override fun updateUI(delta: Float) {
}

View File

@@ -100,7 +100,7 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
}
}
private val navRemoCon = UIItemListNavBarVertical(full, hx + 6 + UIItemWorldCellsSimple.width, y + 7, listHeight, false)
private val navRemoCon = UIItemListNavBarVertical(full, hx + 6 + UIItemWorldCellsSimple.width, y + 7, listHeight + 2, false)
private val worldList = ArrayList<WorldInfo>()
data class WorldInfo(