mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-14 15:46:06 +09:00
font update; ui remocon fix; save doc elaboration
UI RemoCon fix: RemoCon will no longer widen to the screen width when being used
This commit is contained in:
@@ -174,7 +174,11 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
data class GameSaveData(
|
||||
val world: GameWorldExtension,
|
||||
val historicalFigureIDBucket: ArrayList<Int>,
|
||||
val realGamePlayer: IngamePlayer
|
||||
val realGamePlayer: IngamePlayer,
|
||||
val rogueseed: Long,
|
||||
val rogueiter: Int,
|
||||
val weatherseed: Long,
|
||||
val weatheriter: Int
|
||||
)
|
||||
|
||||
data class NewWorldParameters(
|
||||
@@ -203,6 +207,10 @@ open class Ingame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
addNewActor(playableActor)
|
||||
|
||||
|
||||
// set the randomisers right
|
||||
RoguelikeRandomiser.loadFromSave(gameSaveData.rogueseed, gameSaveData.rogueiter)
|
||||
WeatherMixer.loadFromSave(gameSaveData.weatherseed, gameSaveData.weatheriter)
|
||||
|
||||
|
||||
//initGame()
|
||||
}
|
||||
|
||||
29
src/net/torvald/terrarum/modulebasegame/RNGConsumer.kt
Normal file
29
src/net/torvald/terrarum/modulebasegame/RNGConsumer.kt
Normal file
@@ -0,0 +1,29 @@
|
||||
package net.torvald.terrarum.modulebasegame
|
||||
|
||||
import java.util.*
|
||||
|
||||
internal interface RNGConsumer {
|
||||
|
||||
val RNG: Random
|
||||
var seed: Long
|
||||
var iterations: Int
|
||||
|
||||
fun loadFromSave(seed: Long, iterations: Int) {
|
||||
this.seed = seed
|
||||
this.iterations = iterations
|
||||
|
||||
repeat(iterations, { RNG.nextInt() })
|
||||
}
|
||||
|
||||
private fun incIterations() {
|
||||
iterations++
|
||||
|
||||
if (iterations < 0) iterations = 0
|
||||
}
|
||||
|
||||
fun getRandomLong(): Long {
|
||||
iterations++
|
||||
return RNG.nextLong()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ object ExportLayerData : ConsoleCommand {
|
||||
|
||||
WriteLayerData(saveDirectoryName)
|
||||
|
||||
Echo("Layer data exported to $saveDirectoryName/${WriteLayerData.META_FILENAME}")
|
||||
Echo("Layer data exported to $saveDirectoryName/${WriteLayerData.LAYERS_FILENAME}")
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
|
||||
@@ -7,6 +7,11 @@ package net.torvald.terrarum.modulebasegame.gameactors
|
||||
*
|
||||
* NOTE: all canonical NPCs are must be HistoricalFigure!! (double excl mark, bitch)
|
||||
*
|
||||
* This interface is just a marker. Actual historical information must be contained as the Actor Value with:
|
||||
*
|
||||
* "__borntime" // time_t
|
||||
* "__deadtime" // time_t
|
||||
*
|
||||
* Created by minjaesong on 2016-10-10.
|
||||
*/
|
||||
interface HistoricalFigure {
|
||||
|
||||
@@ -23,7 +23,9 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode<String>) : UICanvas() {
|
||||
private var remoConTray: UIRemoConElement // this remocon is dynamically generated
|
||||
private var currentRemoConContents = treeRepresentation
|
||||
|
||||
override var width = remoConWidth
|
||||
override var width: Int
|
||||
get() = remoConWidth // somehow NOT making this constant causes a weird issue
|
||||
set(value) {} // where the remocon widens to screen width
|
||||
override var height: Int
|
||||
get() = remoConTray.height
|
||||
set(value) {}
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemTextButtonList
|
||||
|
||||
class UITitleRemoConLanguage(val superMenu: UICanvas) : UICanvas() {
|
||||
class UITitleLanguage : UICanvas() {
|
||||
|
||||
val menuLabels = arrayOf(
|
||||
"MENU_LABEL_RETURN"
|
||||
@@ -59,6 +59,7 @@ class UITitleRemoConLanguage(val superMenu: UICanvas) : UICanvas() {
|
||||
|
||||
override fun updateUI(delta: Float) {
|
||||
textArea.update(delta)
|
||||
println("should be printing indefinitely")
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
@@ -62,7 +62,7 @@ import net.torvald.terrarum.ui.UIItemTextButtonList
|
||||
|
||||
|
||||
private val remoConCredits = UITitleRemoConCredits(this)
|
||||
private val remoConLanguage = UITitleRemoConLanguage(this)
|
||||
private val remoConLanguage = UITitleLanguage(this)
|
||||
private val remoConModules = UITitleModules(this)
|
||||
|
||||
init {
|
||||
|
||||
@@ -6,10 +6,12 @@ import java.util.*
|
||||
|
||||
object UITitleRemoConYaml {
|
||||
|
||||
// YAML indent with a space, separate label and class with " : " verbatim!
|
||||
// YAML indent with a space, separate label and class with " : " (\x20\x3A\x20)
|
||||
|
||||
val menus = """
|
||||
- MENU_MODE_SINGLEPLAYER
|
||||
- MENU_MODE_SINGLEPLAYER : net.torvald.terrarum.modulebasegame.ui.UITitleCharactersList
|
||||
- CONTEXT_CHARACTER_NEW
|
||||
- CONTEXT_CHARACTER_DELETE
|
||||
- MENU_LABEL_RETURN
|
||||
- MENU_MODE_MULTIPLAYER
|
||||
- MENU_LABEL_RETURN
|
||||
@@ -20,7 +22,7 @@ object UITitleRemoConYaml {
|
||||
- MENU_LABEL_RETURN
|
||||
- MENU_MODULES : net.torvald.terrarum.modulebasegame.ui.UITitleModules
|
||||
- MENU_LABEL_RETURN
|
||||
- MENU_LABEL_LANGUAGE
|
||||
- MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage
|
||||
- MENU_LABEL_RETURN
|
||||
- MENU_LABEL_CREDITS : net.torvald.terrarum.modulebasegame.ui.UITitleCredits
|
||||
- MENU_LABEL_CREDITS : net.torvald.terrarum.modulebasegame.ui.UITitleCredits
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ParticleMegaRain
|
||||
import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.RNGConsumer
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.WorldTime
|
||||
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
|
||||
@@ -31,7 +32,13 @@ import java.util.*
|
||||
*
|
||||
* Created by minjaesong on 2016-07-11.
|
||||
*/
|
||||
internal object WeatherMixer {
|
||||
internal object WeatherMixer : RNGConsumer {
|
||||
|
||||
override val RNG = HQRNG()
|
||||
override var seed = 0L
|
||||
override var iterations = 0
|
||||
|
||||
|
||||
var weatherList: HashMap<String, ArrayList<BaseModularWeather>>
|
||||
|
||||
var currentWeather: BaseModularWeather
|
||||
|
||||
@@ -4,12 +4,13 @@ import com.badlogic.gdx.graphics.Color
|
||||
import net.torvald.dataclass.IntArrayStack
|
||||
import net.torvald.colourutil.Col4096
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.modulebasegame.RNGConsumer
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-02-23.
|
||||
*/
|
||||
object RoguelikeRandomiser {
|
||||
object RoguelikeRandomiser : RNGConsumer {
|
||||
|
||||
val POTION_PRIMARY_COLSET = intArrayOf(15, 15, 7, 7, 0, 0)
|
||||
|
||||
@@ -18,8 +19,8 @@ object RoguelikeRandomiser {
|
||||
|
||||
val coloursTaken: ArrayList<Col4096> = ArrayList()
|
||||
|
||||
var seed: Long = 0
|
||||
private val random: Random = HQRNG()
|
||||
override val RNG = HQRNG()
|
||||
override var seed = 0L
|
||||
|
||||
private val POTION_HEAL_TIER1 = 0x00
|
||||
private val POTION_HEAL_TIRE2 = 0x01
|
||||
@@ -28,7 +29,7 @@ object RoguelikeRandomiser {
|
||||
|
||||
private val POTION_BERSERK_TIER1 = 0x20
|
||||
|
||||
|
||||
override var iterations = 0
|
||||
|
||||
fun setupColours() {
|
||||
|
||||
@@ -59,6 +60,8 @@ object RoguelikeRandomiser {
|
||||
val a = ar[index];
|
||||
ar[index] = ar[i];
|
||||
ar[i] = a;
|
||||
|
||||
iterations++
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import net.torvald.terrarum.LoadScreen
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.blockproperties.BlockCodex
|
||||
import net.torvald.terrarum.concurrent.ThreadParallel
|
||||
import net.torvald.terrarum.modulebasegame.RNGConsumer
|
||||
import net.torvald.terrarum.roundInt
|
||||
import java.util.*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user