From 9d118aebb0c06390a2b110d7b2b4134bce2a2dab Mon Sep 17 00:00:00 2001 From: minjaesong Date: Tue, 29 Aug 2023 15:39:24 +0900 Subject: [PATCH] todo weather example --- .../basegame/weathers/WeatherGeneric2.json | 28 +++++++++++++++++++ .../terrarum/ui/BasicDebugInfoWindow.kt | 12 ++++---- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 assets/mods/basegame/weathers/WeatherGeneric2.json diff --git a/assets/mods/basegame/weathers/WeatherGeneric2.json b/assets/mods/basegame/weathers/WeatherGeneric2.json new file mode 100644 index 000000000..3182c7de4 --- /dev/null +++ b/assets/mods/basegame/weathers/WeatherGeneric2.json @@ -0,0 +1,28 @@ +{ + "skyboxGradColourMap": "generic_skybox.tga", + "daylightClut": "clut_daylight.tga", + "classification": "generic", + "cloudChance": 1600, + "cloudGamma": [0.48, 2.4], + "cloudGammaVariance": [0.1, 0.1], + "windSpeed": 0.25, + "windSpeedVariance": 1.0, + "clouds": { + "cumulonimbus": { + "filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.02, + "baseScale": 2.0, "scaleVariance": 0.3333333, + "altLow": 80, "altHigh": 120 + }, + "cumulus": { + "filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 0.05, + "baseScale": 1.0, "scaleVariance": 0.6, + "altLow": 80, "altHigh": 800 + }, + "altocumulus": { + "filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 1.0, + "baseScale": 0.5, "scaleVariance": 0.1, + "altLow": 1600, "altHigh": 2400 + } + }, + "__comment__": "Make a texture for altocumulus so that this weather can be realised with less than 1000 sprites" +} \ No newline at end of file diff --git a/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt b/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt index 78ba1318d..a668e091c 100644 --- a/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt +++ b/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt @@ -39,11 +39,8 @@ class BasicDebugInfoWindow : UICanvas() { private var xdelta = 0.0 private var ydelta = 0.0 - private val ingame: IngameInstance? - get() = Terrarum.ingame - - private val world: GameWorld? - get() = Terrarum.ingame?.world + private var ingame: IngameInstance? = null + private var world: GameWorld? = null private val icons = TextureRegionPack(Gdx.files.internal("assets/graphics/gui/debug_window_symbols.tga"), 21, 26) private val back = Texture(Gdx.files.internal("assets/graphics/gui/debug_window_background.tga")) @@ -69,6 +66,11 @@ class BasicDebugInfoWindow : UICanvas() { private var showTimers = false + override fun show() { + ingame = Terrarum.ingame + world = ingame?.world + } + override fun updateUI(delta: Float) { val player = ingame?.actorNowPlaying val hitbox = player?.hitbox