worldgen estimation change; common worldgen variables moved to Worldgen.kt

This commit is contained in:
minjaesong
2023-10-31 15:18:51 +09:00
parent 706f5ac507
commit cbbe5d3e34
7 changed files with 32 additions and 37 deletions

View File

@@ -300,10 +300,12 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
App.fontGame.draw(batch, Lang["CONTEXT_GENERATOR_SEED"], drawX - 4, drawY + sizeSelY + inputLineY2)
val (wx, wy) = TerrarumIngame.NEW_WORLD_SIZE[sizeSelector.selection]
val etaMin = Worldgen.getEstimationSec(wx, wy).div(60f).roundToInt().coerceAtLeast(1)
val etaSec = Worldgen.getEstimationSec(wx, wy)
val etaMin = etaSec.div(60f).roundToInt().coerceAtLeast(1)
val etaText = Lang.getAndUseTemplate("CONTEXT_ESTIMATED_MINUTES_PLURAL", true, etaMin)
val etaTextPrint = etaText + (if (App.IS_DEVELOPMENT_BUILD) " ($etaSec s)" else "")
Toolkit.drawTextCentered(batch, App.fontGame, etaText, width, drawX, drawY + sizeSelY + inputLineY3)
Toolkit.drawTextCentered(batch, App.fontGame, etaTextPrint, width, drawX, drawY + sizeSelY + inputLineY3)
}
else if (mode == 1) {
// code input labels

View File

@@ -195,10 +195,12 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
App.fontGame.draw(batch, Lang["CONTEXT_PLACE_COORDINATE"], drawX - 4, drawY + sizeSelY + inputLineY2)
val (wx, wy) = TerrarumIngame.NEW_WORLD_SIZE[sizeSelector.selection]
val etaMin = Worldgen.getEstimationSec(wx, wy).div(60f).roundToInt().coerceAtLeast(1)
val etaSec = Worldgen.getEstimationSec(wx, wy)
val etaMin = etaSec.div(60f).roundToInt().coerceAtLeast(1)
val etaText = Lang.getAndUseTemplate("CONTEXT_ESTIMATED_MINUTES_PLURAL", true, etaMin)
val etaTextPrint = etaText + (if (App.IS_DEVELOPMENT_BUILD) " ($etaSec s)" else "")
Toolkit.drawTextCentered(batch, App.fontGame, etaText, width, drawX, drawY + sizeSelY + inputLineY3)
Toolkit.drawTextCentered(batch, App.fontGame, etaTextPrint, width, drawX, drawY + sizeSelY + inputLineY3)
// memory gauge
val chunksUsed = full.chunksUsed