mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
labels for inventory side buttons
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
"GAME_ACTION_QUICKSEL": "Quick Select",
|
"GAME_ACTION_QUICKSEL": "Quick Select",
|
||||||
"GAME_ACTION_SELECT_SLOT": "Select Slot",
|
"GAME_ACTION_SELECT_SLOT": "Select Slot",
|
||||||
"GAME_ACTION_TELEPORT": "Teleport",
|
"GAME_ACTION_TELEPORT": "Teleport",
|
||||||
"GAME_CRAFTABLE_ITEMS": "Craftable Items",
|
"GAME_CRAFTABLE_ITEMS": "Recipes",
|
||||||
"GAME_CRAFTING": "Crafting",
|
"GAME_CRAFTING": "Crafting",
|
||||||
"GAME_INVENTORY_BLOCKS": "Blocks",
|
"GAME_INVENTORY_BLOCKS": "Blocks",
|
||||||
"GAME_INVENTORY_FAVORITES": "Favorites",
|
"GAME_INVENTORY_FAVORITES": "Favorites",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"GAME_ACTION_QUICKSEL": "빠른 선택",
|
"GAME_ACTION_QUICKSEL": "빠른 선택",
|
||||||
"GAME_ACTION_SELECT_SLOT": "슬롯 선택",
|
"GAME_ACTION_SELECT_SLOT": "슬롯 선택",
|
||||||
"GAME_ACTION_TELEPORT": "텔레포트하기",
|
"GAME_ACTION_TELEPORT": "텔레포트하기",
|
||||||
"GAME_CRAFTABLE_ITEMS": "제작 가능한 아이템",
|
"GAME_CRAFTABLE_ITEMS": "제작 레시피",
|
||||||
"GAME_CRAFTING": "제작",
|
"GAME_CRAFTING": "제작",
|
||||||
"GAME_INVENTORY_BLOCKS": "블록",
|
"GAME_INVENTORY_BLOCKS": "블록",
|
||||||
"GAME_INVENTORY_FAVORITES": "즐겨찾기",
|
"GAME_INVENTORY_FAVORITES": "즐겨찾기",
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ class UICraftingWorkbench(val inventoryUI: UIInventoryFull?, val parentContainer
|
|||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
// text label for two inventory grids
|
// text label for two inventory grids
|
||||||
val craftingLabel = Lang["GAME_CRAFTING"]
|
val craftingLabel = Lang["GAME_CRAFTABLE_ITEMS"]
|
||||||
val ingredientsLabel = Lang["GAME_INVENTORY_INGREDIENTS"]
|
val ingredientsLabel = Lang["GAME_INVENTORY_INGREDIENTS"]
|
||||||
|
|
||||||
App.fontGame.draw(batch, craftingLabel, thisOffsetX + (cellsWidth - App.fontGame.getWidth(craftingLabel)) / 2, thisOffsetY - INVENTORY_NAME_TEXT_GAP)
|
App.fontGame.draw(batch, craftingLabel, thisOffsetX + (cellsWidth - App.fontGame.getWidth(craftingLabel)) / 2, thisOffsetY - INVENTORY_NAME_TEXT_GAP)
|
||||||
|
|||||||
@@ -241,6 +241,11 @@ class UIInventoryFull(
|
|||||||
{ Lang["CONTEXT_ITEM_MAGIC"] },
|
{ Lang["CONTEXT_ITEM_MAGIC"] },
|
||||||
{ Lang["GAME_GENRE_MISC"] },
|
{ Lang["GAME_GENRE_MISC"] },
|
||||||
),
|
),
|
||||||
|
superLabels = listOf(
|
||||||
|
{ Lang["GAME_CRAFTING"] },
|
||||||
|
{ Lang["GAME_INVENTORY"] },
|
||||||
|
{ Lang["MENU_LABEL_MENU"] }
|
||||||
|
)
|
||||||
|
|
||||||
) { i -> if (!panelTransitionLocked) requestTransition(i) }
|
) { i -> if (!panelTransitionLocked) requestTransition(i) }
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class UIItemCatBar(
|
|||||||
private val catArrangement: IntArray,
|
private val catArrangement: IntArray,
|
||||||
internal val catIconsMeaning: List<Array<String>>,
|
internal val catIconsMeaning: List<Array<String>>,
|
||||||
internal val catIconsLabels: List<() -> String>,
|
internal val catIconsLabels: List<() -> String>,
|
||||||
|
internal val superLabels: List<() -> String> = listOf({ "" }, { "" }, { "" }), // ["Crafting", "Inventory", "Menu"]
|
||||||
|
|
||||||
val panelTransitionReqFun: (Int) -> Unit = {} // for side buttons; for the selection change, override selectionChangeListener
|
val panelTransitionReqFun: (Int) -> Unit = {} // for side buttons; for the selection change, override selectionChangeListener
|
||||||
) : UIItem(parentUI, initialX, initialY) {
|
) : UIItem(parentUI, initialX, initialY) {
|
||||||
@@ -286,7 +287,28 @@ class UIItemCatBar(
|
|||||||
// label
|
// label
|
||||||
batch.color = Color.WHITE
|
batch.color = Color.WHITE
|
||||||
catIconsLabels[selectedIndex]().let {
|
catIconsLabels[selectedIndex]().let {
|
||||||
App.fontGame.draw(batch, it, posX + ((width - App.fontGame.getWidth(it)) / 2), posY + highlighterYPos + 4)
|
App.fontGame.draw(batch, it, posX + ((width - App.fontGame.getWidth(it)) / 2), posY + highlighterYPos + 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// generic label
|
||||||
|
batch.color = Color.WHITE
|
||||||
|
superLabels[1]().let {
|
||||||
|
App.fontGame.draw(batch, it, posX + ((width - App.fontGame.getWidth(it)) / 2), posY + highlighterYPos + 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// label under sidebuttons
|
||||||
|
if (showSideButtons) {
|
||||||
|
batch.color = Color.WHITE
|
||||||
|
|
||||||
|
superLabels[0]().let {
|
||||||
|
Toolkit.drawTextCentered(batch, App.fontGame, it, sideButtons[0].width, sideButtons[0].posX, posY + highlighterYPos + 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
superLabels[2]().let {
|
||||||
|
Toolkit.drawTextCentered(batch, App.fontGame, it, sideButtons[3].width, sideButtons[3].posX, posY + highlighterYPos + 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ class UITemplateCatBar(
|
|||||||
catIconsMeaning: List<Array<String>>, // sortedBy: catArrangement
|
catIconsMeaning: List<Array<String>>, // sortedBy: catArrangement
|
||||||
catIconsLabels: List<() -> String>,
|
catIconsLabels: List<() -> String>,
|
||||||
|
|
||||||
|
superLabels: List<() -> String> = listOf({ "" }, { "" }, { "" }),
|
||||||
|
|
||||||
) : UITemplate(parent) {
|
) : UITemplate(parent) {
|
||||||
|
|
||||||
val catBar = UIItemCatBar(
|
val catBar = UIItemCatBar(
|
||||||
@@ -30,7 +32,7 @@ class UITemplateCatBar(
|
|||||||
UIInventoryFull.internalWidth,
|
UIInventoryFull.internalWidth,
|
||||||
UIInventoryFull.catBarWidth,
|
UIInventoryFull.catBarWidth,
|
||||||
showSidebuttons,
|
showSidebuttons,
|
||||||
catIcons, catArrangement, catIconsMeaning, catIconsLabels
|
catIcons, catArrangement, catIconsMeaning, catIconsLabels, superLabels
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun getUIitems(): List<UIItem> {
|
override fun getUIitems(): List<UIItem> {
|
||||||
|
|||||||
Reference in New Issue
Block a user