new world via teleporter wip

This commit is contained in:
minjaesong
2023-07-02 18:54:04 +09:00
parent afb7dff5d2
commit 9c396e7b8d
7 changed files with 136 additions and 15 deletions

View File

@@ -105,11 +105,19 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
full.unlockTransition()
}
val saveTime_t = App.getTIME_T()
val onSuccessful = {
// return to normal state
System.gc()
screen = 0
full.handler.unlockToggle()
full.unlockTransition()
(INGAME as TerrarumIngame).autosaveTimer = 0f
}
/*val saveTime_t = App.getTIME_T()
val playerSavefile = getPlayerSaveFiledesc(INGAME.playerSavefileName)
val worldSavefile = getWorldSaveFiledesc(INGAME.worldSavefileName)
INGAME.makeSavegameBackupCopy(playerSavefile)
WriteSavegame(saveTime_t, WriteSavegame.SaveMode.PLAYER, INGAME.playerDisk, playerSavefile, INGAME as TerrarumIngame, false, onError) {
@@ -123,13 +131,12 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
}
// return to normal state
System.gc()
screen = 0
full.handler.unlockToggle()
full.unlockTransition()
(INGAME as TerrarumIngame).autosaveTimer = 0f
onSuccessful()
}
}
}*/
INGAME.saveTheGame(onSuccessful, onError)
}
1 -> {

View File

@@ -7,11 +7,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion
import net.torvald.random.HQRNG
import net.torvald.random.XXHash64
import net.torvald.terrarum.App
import net.torvald.terrarum.*
import net.torvald.terrarum.App.printdbg
import net.torvald.terrarum.ModMgr
import net.torvald.terrarum.Second
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulebasegame.TerrarumIngame
import net.torvald.terrarum.modulebasegame.TerrarumIngame.Companion.NEW_WORLD_SIZE
@@ -91,6 +88,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
private val backButton = UIItemTextButton(this, "MENU_LABEL_BACK", drawX + (width/2 - goButtonWidth) / 2, drawY + height - 24, goButtonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true)
private val goButton = UIItemTextButton(this, "MENU_LABEL_CONFIRM_BUTTON", drawX + width/2 + (width/2 - goButtonWidth) / 2, drawY + height - 24, goButtonWidth, true, alignment = UIItemTextButton.Companion.Alignment.CENTRE, hasBorder = true)
init {
goButton.clickOnceListener = { _, _ ->