mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
labels for inventory side buttons
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
"GAME_ACTION_QUICKSEL": "Quick Select",
|
||||
"GAME_ACTION_SELECT_SLOT": "Select Slot",
|
||||
"GAME_ACTION_TELEPORT": "Teleport",
|
||||
"GAME_CRAFTABLE_ITEMS": "Craftable Items",
|
||||
"GAME_CRAFTABLE_ITEMS": "Recipes",
|
||||
"GAME_CRAFTING": "Crafting",
|
||||
"GAME_INVENTORY_BLOCKS": "Blocks",
|
||||
"GAME_INVENTORY_FAVORITES": "Favorites",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"GAME_ACTION_QUICKSEL": "빠른 선택",
|
||||
"GAME_ACTION_SELECT_SLOT": "슬롯 선택",
|
||||
"GAME_ACTION_TELEPORT": "텔레포트하기",
|
||||
"GAME_CRAFTABLE_ITEMS": "제작 가능한 아이템",
|
||||
"GAME_CRAFTABLE_ITEMS": "제작 레시피",
|
||||
"GAME_CRAFTING": "제작",
|
||||
"GAME_INVENTORY_BLOCKS": "블록",
|
||||
"GAME_INVENTORY_FAVORITES": "즐겨찾기",
|
||||
|
||||
@@ -482,7 +482,7 @@ class UICraftingWorkbench(val inventoryUI: UIInventoryFull?, val parentContainer
|
||||
batch.color = Color.WHITE
|
||||
|
||||
// text label for two inventory grids
|
||||
val craftingLabel = Lang["GAME_CRAFTING"]
|
||||
val craftingLabel = Lang["GAME_CRAFTABLE_ITEMS"]
|
||||
val ingredientsLabel = Lang["GAME_INVENTORY_INGREDIENTS"]
|
||||
|
||||
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["GAME_GENRE_MISC"] },
|
||||
),
|
||||
superLabels = listOf(
|
||||
{ Lang["GAME_CRAFTING"] },
|
||||
{ Lang["GAME_INVENTORY"] },
|
||||
{ Lang["MENU_LABEL_MENU"] }
|
||||
)
|
||||
|
||||
) { i -> if (!panelTransitionLocked) requestTransition(i) }
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ class UIItemCatBar(
|
||||
private val catArrangement: IntArray,
|
||||
internal val catIconsMeaning: List<Array<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
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
@@ -286,7 +287,28 @@ class UIItemCatBar(
|
||||
// label
|
||||
batch.color = Color.WHITE
|
||||
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
|
||||
catIconsLabels: List<() -> String>,
|
||||
|
||||
superLabels: List<() -> String> = listOf({ "" }, { "" }, { "" }),
|
||||
|
||||
) : UITemplate(parent) {
|
||||
|
||||
val catBar = UIItemCatBar(
|
||||
@@ -30,7 +32,7 @@ class UITemplateCatBar(
|
||||
UIInventoryFull.internalWidth,
|
||||
UIInventoryFull.catBarWidth,
|
||||
showSidebuttons,
|
||||
catIcons, catArrangement, catIconsMeaning, catIconsLabels
|
||||
catIcons, catArrangement, catIconsMeaning, catIconsLabels, superLabels
|
||||
)
|
||||
|
||||
override fun getUIitems(): List<UIItem> {
|
||||
|
||||
Reference in New Issue
Block a user