mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 22:01:52 +09:00
damaged savegame is handled by the management scr
This commit is contained in:
@@ -80,7 +80,8 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
||||
}
|
||||
else if (!full.loadables.saveAvaliable()) {
|
||||
// show save is damaged and cannot be loaded
|
||||
full.queueUpDamagedSaveScr()
|
||||
// full.queueUpDamagedSaveScr()
|
||||
full.queueUpManageScr() // management screen will take care of damaged saves
|
||||
full.takeAutosaveSelectorDown()
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -36,23 +36,32 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
private val buttonRowY = drawY + 480 - buttonHeight
|
||||
private val buttonRowY2 = buttonRowY - buttonHeight - buttonGap
|
||||
|
||||
private val mainGoButton = UIItemTextButton(this, "MENU_IO_LOAD_GAME", buttonX1third, buttonRowY2, buttonWidth * 3 + buttonGap * 2, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
private val mainGoButton = UIItemTextButton(this, "MENU_IO_LOAD_GAME", buttonX1third, buttonRowY, buttonWidth * 3 + buttonGap * 2, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
|
||||
}
|
||||
private val mainReturnButton = UIItemTextButton(this, "MENU_LABEL_RETURN", buttonX1third, buttonRowY, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
private val mainNoGoButton = UIItemTextButton(this, "ERROR_SAVE_CORRUPTED", buttonX1third, buttonRowY, buttonWidth * 3 + buttonGap * 2, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
it.isEnabled = false
|
||||
}
|
||||
private val mainReturnButton = UIItemTextButton(this, "MENU_LABEL_BACK", buttonX1third, buttonRowY2, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
it.clickOnceListener = { _,_ ->
|
||||
full.changePanelTo(0)
|
||||
}
|
||||
}
|
||||
private val mainRenameButton = UIItemTextButton(this, "MENU_LABEL_RENAME", buttonXcentre, buttonRowY, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
|
||||
private val mainRenameButton = UIItemTextButton(this, "MENU_LABEL_RENAME", buttonXcentre, buttonRowY2, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
it.clickOnceListener = { _,_ ->
|
||||
mode = MODE_RENAME
|
||||
}
|
||||
}
|
||||
private val mainDeleteButton = UIItemTextButton(this, "CONTEXT_CHARACTER_DELETE", buttonX3third, buttonRowY, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true, inactiveCol = Toolkit.Theme.COL_RED, activeCol = Toolkit.Theme.COL_REDD).also {
|
||||
|
||||
private val mainDeleteButton = UIItemTextButton(this, "CONTEXT_CHARACTER_DELETE", buttonX3third, buttonRowY2, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true, inactiveCol = Toolkit.Theme.COL_RED, activeCol = Toolkit.Theme.COL_REDD).also {
|
||||
it.clickOnceListener = { _,_ ->
|
||||
mode = MODE_DELETE
|
||||
}
|
||||
}
|
||||
|
||||
private val confirmCancelButton = UIItemTextButton(this, "MENU_LABEL_CANCEL", buttonXleft, buttonRowY, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true).also {
|
||||
it.clickOnceListener = { _,_ -> full.remoCon.openUI(UILoadSavegame(full.remoCon)) }
|
||||
it.clickOnceListener = { _,_ ->
|
||||
mode = MODE_INIT
|
||||
}
|
||||
}
|
||||
private val confirmDeleteButton = UIItemTextButton(this, "MENU_LABEL_DELETE", buttonXright, buttonRowY, buttonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true, inactiveCol = Toolkit.Theme.COL_RED, activeCol = Toolkit.Theme.COL_REDD).also {
|
||||
it.clickOnceListener = { _,_ ->
|
||||
@@ -70,9 +79,13 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
|
||||
private var mode = 0
|
||||
|
||||
private var mainButtons = listOf(mainGoButton, mainReturnButton, mainRenameButton, mainDeleteButton)
|
||||
private var mainButtons0 = listOf(mainGoButton, mainReturnButton, mainRenameButton, mainDeleteButton)
|
||||
private var mainButtons1 = listOf(mainNoGoButton, mainReturnButton, mainRenameButton, mainDeleteButton)
|
||||
private var delButtons = listOf(confirmCancelButton, confirmDeleteButton)
|
||||
|
||||
private val mainButtons: List<UIItemTextButton>
|
||||
get() = if (full.loadables.saveAvaliable()) mainButtons0 else mainButtons1
|
||||
|
||||
private val MODE_INIT = 0
|
||||
private val MODE_DELETE = 16 // are you sure?
|
||||
private val MODE_RENAME = 32 // show rename dialogue
|
||||
|
||||
@@ -95,7 +95,7 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
private val transitionalAutosave = UILoadAutosave(this)
|
||||
private val transitionalManage = UILoadManage(this)
|
||||
private val transitionalNewCharacter = UINewCharacter(remoCon)
|
||||
private val transitionalSaveDamaged = UILoadSaveDamaged(this)
|
||||
// private val transitionalSaveDamaged = UILoadSaveDamaged(this)
|
||||
private val transitionPanel = UIItemHorizontalFadeSlide(
|
||||
this,
|
||||
(width - internalWidth) / 2,
|
||||
@@ -104,13 +104,13 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
App.scr.height,
|
||||
0f,
|
||||
listOf(transitionalListing),
|
||||
listOf(transitionalManage, transitionalNewCharacter, transitionalSaveDamaged),
|
||||
listOf(transitionalManage, transitionalNewCharacter),
|
||||
listOf(NullUI, transitionalAutosave)
|
||||
)
|
||||
|
||||
internal fun queueUpManageScr() { transitionPanel.setCentreUIto(0) }
|
||||
internal fun queueUpNewCharScr() { transitionPanel.setCentreUIto(1) }
|
||||
internal fun queueUpDamagedSaveScr() { transitionPanel.setCentreUIto(2) }
|
||||
// internal fun queueUpDamagedSaveScr() { transitionPanel.setCentreUIto(2) }
|
||||
|
||||
internal fun bringAutosaveSelectorUp() { transitionPanel.setRightUIto(1) }
|
||||
internal fun takeAutosaveSelectorDown() { transitionPanel.setRightUIto(0) }
|
||||
|
||||
Reference in New Issue
Block a user