UIItemInventoryElemWide: removed temporary equippedslot marker: is unnecessary as we've already got UIItemInventoryEquippedView

This commit is contained in:
minjaesong
2021-09-20 17:10:10 +09:00
parent a532f4601b
commit c63b31e964
5 changed files with 12 additions and 17 deletions

View File

@@ -152,7 +152,7 @@ internal class UIStorageChest : UICanvas(
this,
catBar,
{ INGAME.actorNowPlaying!!.inventory }, // literally a player's inventory
INVENTORY_CELLS_OFFSET_X - halfSlotOffset + (listGap + UIItemInventoryElem.height) * 7,
INVENTORY_CELLS_OFFSET_X - halfSlotOffset + (listGap + UIItemInventoryElemWide.height) * 7,
INVENTORY_CELLS_OFFSET_Y,
6, CELLS_VRT,
drawScrollOnRightside = true,

View File

@@ -4,10 +4,7 @@ import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.*
import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gameitem.GameItem
import net.torvald.terrarum.itemproperties.ItemCodex
import net.torvald.terrarum.modulebasegame.gameactors.ActorInventory
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_BLACK
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_BLACK_ACTIVE
import net.torvald.terrarum.modulebasegame.ui.UIInventoryFull.Companion.itemListHeight
@@ -58,7 +55,7 @@ class UIItemInventoryEquippedView(
initialX = this.posX + (UIItemInventoryElemSimple.height + listGap) * ((it + 4) % 2),
initialY = this.posY + (UIItemInventoryElemSimple.height + listGap) * ((it + 4) / 2),
item = null,
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
amount = UIItemInventoryElemWide.UNIQUE_ITEM_HAS_NO_AMOUNT,
itemImage = null,
mouseoverBackCol = Color(CELLCOLOUR_BLACK_ACTIVE),
mouseoverBackBlendMode = BlendMode.SCREEN,

View File

@@ -177,7 +177,7 @@ class UIItemInventoryItemGrid(
initialX = this.posX + (UIItemInventoryElemSimple.height + listGap) * (it % horizontalCells),
initialY = this.posY + (UIItemInventoryElemSimple.height + listGap) * (it / horizontalCells),
item = null,
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
amount = UIItemInventoryElemWide.UNIQUE_ITEM_HAS_NO_AMOUNT,
itemImage = null,
mouseoverBackCol = Color(CELLCOLOUR_BLACK_ACTIVE),
mouseoverBackBlendMode = BlendMode.SCREEN,
@@ -194,13 +194,13 @@ class UIItemInventoryItemGrid(
private val actualItemCellWidth = (listGap + UIItemInventoryElemSimple.height) * horizontalCells - listGap // in pixels
private val largeListWidth = ((listGap + actualItemCellWidth) / itemListColumnCount) - (itemListColumnCount - 1).coerceAtLeast(1) * listGap
private val itemList = Array<UIItemInventoryCellBase>(verticalCells * itemListColumnCount) {
UIItemInventoryElem(
UIItemInventoryElemWide(
parentUI = inventoryUI,
initialX = this.posX + (largeListWidth + listGap) * (it % itemListColumnCount),
initialY = this.posY + (UIItemInventoryElem.height + listGap) * (it / itemListColumnCount),
initialY = this.posY + (UIItemInventoryElemWide.height + listGap) * (it / itemListColumnCount),
width = largeListWidth,
item = null,
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
amount = UIItemInventoryElemWide.UNIQUE_ITEM_HAS_NO_AMOUNT,
itemImage = null,
mouseoverBackCol = Color(CELLCOLOUR_BLACK_ACTIVE),
mouseoverBackBlendMode = BlendMode.SCREEN,
@@ -228,7 +228,7 @@ class UIItemInventoryItemGrid(
posX - LIST_TO_CONTROL_GAP - catBar.catIcons.tileW + 2
private fun getIconPosY(index: Int) =
posY - 2 + (4 + UIItemInventoryElem.height - catBar.catIcons.tileH) * index
posY - 2 + (4 + UIItemInventoryElemWide.height - catBar.catIcons.tileH) * index
/** Long/compact mode buttons */
internal val gridModeButtons = Array<UIItemImageButton>(2) { index ->