mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
Saving while autosaving will show appropriate message
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
"CONTEXT_PLACE_COORDINATE": "Coordinate",
|
||||
"CONTEXT_WORLD_COUNT": "Worlds: ",
|
||||
"CONTEXT_WORLD_NEW": "New World",
|
||||
"MENU_IO_WAITING_AUTOSAVE_TO_FINISH": "Waiting Autosave to finish...",
|
||||
"MENU_LABEL_DELETE_WORLD": "Delete World",
|
||||
"MENU_LABEL_MENU": "Menu",
|
||||
"MENU_LABEL_PREV_SAVES": "Previous Saves",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"CONTEXT_PLACE_COORDINATE": "좌표",
|
||||
"CONTEXT_WORLD_COUNT": "새계: ",
|
||||
"CONTEXT_WORLD_NEW": "새 세계",
|
||||
"MENU_IO_WAITING_AUTOSAVE_TO_FINISH": "자동 저장이 끝나기를 기다리는 중...",
|
||||
"MENU_LABEL_DELETE_WORLD": "새계 삭제",
|
||||
"MENU_LABEL_MENU": "메뉴",
|
||||
"MENU_LABEL_PREV_SAVES": "이전 세이브",
|
||||
|
||||
@@ -720,7 +720,6 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
}
|
||||
|
||||
private var updateAkku = 0f
|
||||
internal var autosaveTimer = 0f
|
||||
|
||||
override fun render(`_`: Float) {
|
||||
@@ -755,7 +754,9 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
/** UPDATE CODE GOES HERE */
|
||||
val dt = Gdx.graphics.deltaTime
|
||||
autosaveTimer += dt
|
||||
if (!uiAutosaveNotifier.isVisible) {
|
||||
autosaveTimer += dt
|
||||
}
|
||||
|
||||
gameUpdateGovernor.update(dt, App.UPDATE_RATE, updateGame, renderGame)
|
||||
|
||||
@@ -1261,8 +1262,10 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
// return to normal state
|
||||
uiAutosaveNotifier.setAsClose()
|
||||
autosaveTimer = 0f
|
||||
|
||||
debugTimers.put("Last Autosave Duration", System.nanoTime() - start)
|
||||
printdbg(this, "Last Autosave Duration: ${(System.nanoTime() - start) / 1000000000} s")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
import net.torvald.terrarum.INGAME
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.modulebasegame.serialise.WriteSavegame
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -33,7 +35,7 @@ class UIItemSaving(parentUI: UICanvas, initialX: Int, initialY: Int) : UIItem(pa
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// these things will not scroll along with the parent GUI!
|
||||
val t = Lang["MENU_IO_SAVING"]
|
||||
val t = if ((INGAME as TerrarumIngame).uiAutosaveNotifier.isVisible) Lang["MENU_IO_WAITING_AUTOSAVE_TO_FINISH"] else Lang["MENU_IO_SAVING"]
|
||||
val tlen = App.fontGame.getWidth(t)
|
||||
App.fontGame.draw(batch, t, (posX + (width - tlen) / 2).toFloat(), ((App.scr.height - circleSheet.tileH) / 2) - 40f)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user