mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
preliminary gui thing for teleportation
This commit is contained in:
@@ -14,7 +14,6 @@ import net.torvald.terrarum.itemproperties.CraftingCodex
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureInventory
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.InventoryPair
|
||||
import net.torvald.terrarum.modulebasegame.ui.*
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryItemGrid.Companion.listGap
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -387,7 +386,7 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
||||
}
|
||||
}
|
||||
|
||||
buttonCraft.isActive = itemCraftable
|
||||
buttonCraft.isEnabled = itemCraftable
|
||||
}
|
||||
|
||||
// reset whatever player has selected to null and bring UI to its initial state
|
||||
|
||||
@@ -50,7 +50,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
defaultSelection = null
|
||||
)
|
||||
private val areYouSureMainMenuButtons = UIItemTextButtonList(
|
||||
this, DEFAULT_LINE_HEIGHT, arrayOf("MENU_LABEL_QUIT_CONFIRM", "MENU_LABEL_QUIT", "MENU_LABEL_CANCEL"),
|
||||
this, DEFAULT_LINE_HEIGHT, arrayOf("MENU_LABEL_QUIT_CONFIRM", "MENU_LABEL_UNSAVED_PROGRESSES_WILL_BE_LOST", "MENU_LABEL_QUIT", "MENU_LABEL_CANCEL"),
|
||||
(width - gameMenuListWidth) / 2,
|
||||
INVENTORY_CELLS_OFFSET_Y() + (INVENTORY_CELLS_UI_HEIGHT - (DEFAULT_LINE_HEIGHT * 3)) / 2,
|
||||
gameMenuListWidth, DEFAULT_LINE_HEIGHT * 3,
|
||||
@@ -60,7 +60,12 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
highlightBackCol = Color(0),
|
||||
inactiveCol = Color.WHITE,
|
||||
defaultSelection = null
|
||||
)
|
||||
).also {
|
||||
listOf(it.buttons[0], it.buttons[1]).forEach {
|
||||
it.skipUpdate = true
|
||||
it.isActive = false
|
||||
}
|
||||
}
|
||||
/*private val areYouSureQuitButtons = UIItemTextButtonList(
|
||||
this, DEFAULT_LINE_HEIGHT, arrayOf("MENU_LABEL_DESKTOP_QUESTION", "MENU_LABEL_DESKTOP", "MENU_LABEL_CANCEL"),
|
||||
(width - gameMenuListWidth) / 2,
|
||||
@@ -155,11 +160,11 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
}
|
||||
areYouSureMainMenuButtons.selectionChangeListener = { _, new ->
|
||||
when (new) {
|
||||
1 -> {
|
||||
2 -> {
|
||||
areYouSureMainMenuButtons.deselect()
|
||||
App.setScreen(TitleScreen(App.batch))
|
||||
}
|
||||
2 -> {
|
||||
3 -> {
|
||||
screen = 0; areYouSureMainMenuButtons.deselect()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,9 +136,9 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
||||
}
|
||||
|
||||
private fun disableListEditButtons() {
|
||||
buttonRename.isActive = false
|
||||
buttonDelete.isActive = false
|
||||
buttonTeleport.isActive = false
|
||||
buttonRename.isEnabled = false
|
||||
buttonDelete.isEnabled = false
|
||||
buttonTeleport.isEnabled = false
|
||||
currentWorldSelected = false
|
||||
}
|
||||
|
||||
@@ -147,9 +147,9 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
||||
|
||||
if (info == null) disableListEditButtons()
|
||||
else {
|
||||
buttonRename.isActive = true
|
||||
buttonDelete.isActive = info.uuid != INGAME.world.worldIndex
|
||||
buttonTeleport.isActive = info.uuid != INGAME.world.worldIndex
|
||||
buttonRename.isEnabled = true
|
||||
buttonDelete.isEnabled = info.uuid != INGAME.world.worldIndex
|
||||
buttonTeleport.isEnabled = info.uuid != INGAME.world.worldIndex
|
||||
currentWorldSelected = info.uuid == INGAME.world.worldIndex
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user