mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 04:24:05 +09:00
control help for crafting menu
This commit is contained in:
@@ -4,6 +4,8 @@ import com.badlogic.gdx.graphics.Camera
|
|||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||||
import net.torvald.terrarum.*
|
import net.torvald.terrarum.*
|
||||||
|
import net.torvald.terrarum.App.gamepadLabelLEFTRIGHT
|
||||||
|
import net.torvald.terrarum.App.gamepadLabelStart
|
||||||
import net.torvald.terrarum.UIItemInventoryCatBar.Companion.CAT_ALL
|
import net.torvald.terrarum.UIItemInventoryCatBar.Companion.CAT_ALL
|
||||||
import net.torvald.terrarum.gameitems.GameItem
|
import net.torvald.terrarum.gameitems.GameItem
|
||||||
import net.torvald.terrarum.itemproperties.CraftingCodex
|
import net.torvald.terrarum.itemproperties.CraftingCodex
|
||||||
@@ -14,6 +16,7 @@ import net.torvald.terrarum.ui.Toolkit
|
|||||||
import net.torvald.terrarum.ui.UICanvas
|
import net.torvald.terrarum.ui.UICanvas
|
||||||
import net.torvald.terrarum.ui.UIItemSpinner
|
import net.torvald.terrarum.ui.UIItemSpinner
|
||||||
import net.torvald.terrarum.ui.UIItemTextButton
|
import net.torvald.terrarum.ui.UIItemTextButton
|
||||||
|
import net.torvald.unicode.getKeycapPC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This UI has inventory, but it's just there to display all craftable items and should not be serialised.
|
* This UI has inventory, but it's just there to display all craftable items and should not be serialised.
|
||||||
@@ -67,6 +70,14 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
|||||||
|
|
||||||
private val catAll = arrayOf(CAT_ALL)
|
private val catAll = arrayOf(CAT_ALL)
|
||||||
|
|
||||||
|
private val controlHelp: String
|
||||||
|
get() = if (App.environment == RunningEnvironment.PC)
|
||||||
|
"${getKeycapPC(App.getConfigInt("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}"
|
||||||
|
else
|
||||||
|
"$gamepadLabelStart ${Lang["GAME_ACTION_CLOSE"]}\u3000" +
|
||||||
|
"$gamepadLabelLEFTRIGHT ${Lang["GAME_OBJECTIVE_MULTIPLIER"]}\u3000" +
|
||||||
|
"${App.gamepadLabelWest} ${Lang["GAME_ACTION_CRAFT"]}"
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val craftButtonsY = thisOffsetY + 23 + (UIItemInventoryElemWide.height + listGap) * (UIInventoryFull.CELLS_VRT - 1)
|
val craftButtonsY = thisOffsetY + 23 + (UIItemInventoryElemWide.height + listGap) * (UIInventoryFull.CELLS_VRT - 1)
|
||||||
val buttonWidth = (UIItemInventoryElemWide.height + listGap) * 3 - listGap - 2
|
val buttonWidth = (UIItemInventoryElemWide.height + listGap) * 3 - listGap - 2
|
||||||
@@ -289,7 +300,7 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
|||||||
// control hints
|
// control hints
|
||||||
val controlHintXPos = thisOffsetX.toFloat()
|
val controlHintXPos = thisOffsetX.toFloat()
|
||||||
blendNormal(batch)
|
blendNormal(batch)
|
||||||
App.fontGame.draw(batch, full.listControlHelp, controlHintXPos, full.yEnd - 20)
|
App.fontGame.draw(batch, controlHelp, controlHintXPos, full.yEnd - 20)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user