mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 18:14:06 +09:00
greater number of inventory cells
This commit is contained in:
@@ -30,8 +30,10 @@ class UIInventoryFull(
|
|||||||
override var width: Int = Terrarum.WIDTH
|
override var width: Int = Terrarum.WIDTH
|
||||||
override var height: Int = Terrarum.HEIGHT
|
override var height: Int = Terrarum.HEIGHT
|
||||||
|
|
||||||
val internalWidth: Int = 686
|
private val itemListToEquipViewGap = 24
|
||||||
val internalHeight: Int = 558 // grad_begin..grad_end..contents..grad_begin..grad_end
|
|
||||||
|
val internalWidth: Int = UIItemInventoryDynamicList.WIDTH + UIItemInventoryEquippedView.WIDTH + itemListToEquipViewGap
|
||||||
|
val internalHeight: Int = 166 + UIItemInventoryDynamicList.HEIGHT // grad_begin..grad_end..contents..grad_begin..grad_end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +64,7 @@ class UIInventoryFull(
|
|||||||
val categoryBar = UIItemInventoryCatBar(
|
val categoryBar = UIItemInventoryCatBar(
|
||||||
this,
|
this,
|
||||||
(Terrarum.WIDTH - catBarWidth) / 2,
|
(Terrarum.WIDTH - catBarWidth) / 2,
|
||||||
66 + (Terrarum.HEIGHT - internalHeight) / 2,
|
42 + (Terrarum.HEIGHT - internalHeight) / 2,
|
||||||
catBarWidth
|
catBarWidth
|
||||||
)
|
)
|
||||||
val catSelection: Int
|
val catSelection: Int
|
||||||
@@ -91,7 +93,7 @@ class UIInventoryFull(
|
|||||||
this,
|
this,
|
||||||
actor!!.inventory,
|
actor!!.inventory,
|
||||||
actor as ActorWBMovable,
|
actor as ActorWBMovable,
|
||||||
internalWidth - UIItemInventoryEquippedView.width + (Terrarum.WIDTH - internalWidth) / 2,
|
internalWidth - UIItemInventoryEquippedView.WIDTH + (Terrarum.WIDTH - internalWidth) / 2,
|
||||||
109 + (Terrarum.HEIGHT - internalHeight) / 2
|
109 + (Terrarum.HEIGHT - internalHeight) / 2
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -174,7 +176,7 @@ class UIInventoryFull(
|
|||||||
// control hints
|
// control hints
|
||||||
blendNormal(batch)
|
blendNormal(batch)
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
Terrarum.fontGame.draw(batch, listControlHelp, offsetX, offsetY + internalHeight)
|
Terrarum.fontGame.draw(batch, listControlHelp, offsetX, yEnd-20)
|
||||||
|
|
||||||
|
|
||||||
// encumbrance meter
|
// encumbrance meter
|
||||||
@@ -184,7 +186,7 @@ class UIInventoryFull(
|
|||||||
Terrarum.fontGame.draw(batch,
|
Terrarum.fontGame.draw(batch,
|
||||||
encumbranceText,
|
encumbranceText,
|
||||||
xEnd - 9 - Terrarum.fontGame.getWidth(encumbranceText) - weightBarWidth,
|
xEnd - 9 - Terrarum.fontGame.getWidth(encumbranceText) - weightBarWidth,
|
||||||
yEnd
|
yEnd-20
|
||||||
)
|
)
|
||||||
|
|
||||||
// encumbrance bar background
|
// encumbrance bar background
|
||||||
@@ -192,7 +194,7 @@ class UIInventoryFull(
|
|||||||
batch.color = Color(0xa0a0a0_ff.toInt())
|
batch.color = Color(0xa0a0a0_ff.toInt())
|
||||||
batch.fillRect(
|
batch.fillRect(
|
||||||
xEnd - 3 - weightBarWidth,
|
xEnd - 3 - weightBarWidth,
|
||||||
yEnd + 3f,
|
yEnd-20 + 3f,
|
||||||
weightBarWidth,
|
weightBarWidth,
|
||||||
controlHelpHeight - 6f
|
controlHelpHeight - 6f
|
||||||
)
|
)
|
||||||
@@ -201,7 +203,7 @@ class UIInventoryFull(
|
|||||||
batch.color = if (isEncumbered) Color(0xff0000_cc.toInt()) else Color(0x00ff00_cc.toInt())
|
batch.color = if (isEncumbered) Color(0xff0000_cc.toInt()) else Color(0x00ff00_cc.toInt())
|
||||||
batch.fillRect(
|
batch.fillRect(
|
||||||
xEnd - 3 - weightBarWidth,
|
xEnd - 3 - weightBarWidth,
|
||||||
yEnd + 3f,
|
yEnd-20 + 3f,
|
||||||
if (actor?.inventory?.capacityMode == CAPACITY_MODE_NO_ENCUMBER)
|
if (actor?.inventory?.capacityMode == CAPACITY_MODE_NO_ENCUMBER)
|
||||||
1f
|
1f
|
||||||
else // make sure 1px is always be seen
|
else // make sure 1px is always be seen
|
||||||
|
|||||||
@@ -74,13 +74,21 @@ class UIItemInventoryDynamicList(
|
|||||||
|
|
||||||
val defaultTextColour = Color(0xeaeaea_ff.toInt())
|
val defaultTextColour = Color(0xeaeaea_ff.toInt())
|
||||||
|
|
||||||
private val listGap = 8
|
companion object {
|
||||||
private val itemList = Array<UIItemInventoryCellBase>(7 * 2) {
|
const val listGap = 8
|
||||||
UIItemInventoryElem(
|
const val horizontalCells = 12
|
||||||
|
const val verticalCells = 8
|
||||||
|
val largeListWidth = (horizontalCells * UIItemInventoryElemSimple.height + (horizontalCells - 2) * listGap) / 2
|
||||||
|
|
||||||
|
val WIDTH = horizontalCells * UIItemInventoryElemSimple.height + (horizontalCells - 1) * listGap
|
||||||
|
val HEIGHT = verticalCells * UIItemInventoryElemSimple.height + (verticalCells - 1) * listGap
|
||||||
|
}
|
||||||
|
|
||||||
|
private val itemGrid = Array<UIItemInventoryCellBase>(horizontalCells * verticalCells) {
|
||||||
|
UIItemInventoryElemSimple(
|
||||||
parentUI = inventoryUI,
|
parentUI = inventoryUI,
|
||||||
posX = this.posX + (272 + listGap) * (it % 2),
|
posX = this.posX + (UIItemInventoryElemSimple.height + listGap) * (it % horizontalCells),
|
||||||
posY = this.posY + (UIItemInventoryElem.height + listGap) * (it / 2),
|
posY = this.posY + (UIItemInventoryElemSimple.height + listGap) * (it / horizontalCells),
|
||||||
width = 272,
|
|
||||||
item = null,
|
item = null,
|
||||||
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
|
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
|
||||||
itemImage = null,
|
itemImage = null,
|
||||||
@@ -92,11 +100,12 @@ class UIItemInventoryDynamicList(
|
|||||||
inactiveTextCol = defaultTextColour
|
inactiveTextCol = defaultTextColour
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
private val itemGrid = Array<UIItemInventoryCellBase>(7 * 10) {
|
private val itemList = Array<UIItemInventoryCellBase>(verticalCells * 2) {
|
||||||
UIItemInventoryElemSimple(
|
UIItemInventoryElem(
|
||||||
parentUI = inventoryUI,
|
parentUI = inventoryUI,
|
||||||
posX = this.posX + (UIItemInventoryElemSimple.height + listGap) * (it % 10),
|
posX = this.posX + (largeListWidth + listGap) * (it % 2),
|
||||||
posY = this.posY + (UIItemInventoryElemSimple.height + listGap) * (it / 10),
|
posY = this.posY + (UIItemInventoryElem.height + listGap) * (it / 2),
|
||||||
|
width = largeListWidth,
|
||||||
item = null,
|
item = null,
|
||||||
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
|
amount = UIItemInventoryElem.UNIQUE_ITEM_HAS_NO_AMOUNT,
|
||||||
itemImage = null,
|
itemImage = null,
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ class UIItemInventoryEquippedView(
|
|||||||
override var posY: Int
|
override var posY: Int
|
||||||
) : UIItem(parentUI) {
|
) : UIItem(parentUI) {
|
||||||
|
|
||||||
override val width = 104
|
override val width = WIDTH
|
||||||
override val height = 384
|
override val height = HEIGHT
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val width = 104
|
val WIDTH = 2 * UIItemInventoryElemSimple.height + UIItemInventoryDynamicList.listGap
|
||||||
val height = 384
|
val HEIGHT = UIItemInventoryDynamicList.HEIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
private val listGap = 8
|
private val listGap = 8
|
||||||
@@ -39,7 +39,7 @@ class UIItemInventoryEquippedView(
|
|||||||
|
|
||||||
val spriteViewBackCol: Color; get() = Color(0x404040_88.toInt())//Color(0xd4d4d4_ff.toInt())
|
val spriteViewBackCol: Color; get() = Color(0x404040_88.toInt())//Color(0xd4d4d4_ff.toInt())
|
||||||
|
|
||||||
private val itemGrid = Array<UIItemInventoryCellBase>(2 * 5) {
|
private val itemGrid = Array<UIItemInventoryCellBase>(2 * 6) {
|
||||||
UIItemInventoryElemSimple(
|
UIItemInventoryElemSimple(
|
||||||
parentUI = parentUI,
|
parentUI = parentUI,
|
||||||
posX = this.posX + (UIItemInventoryElemSimple.height + listGap) * ((it + 4) % 2),
|
posX = this.posX + (UIItemInventoryElemSimple.height + listGap) * ((it + 4) % 2),
|
||||||
|
|||||||
Reference in New Issue
Block a user