Warming border added

This commit is contained in:
Kirill
2026-09-28 22:32:52 +03:00
parent 15ee7833ed
commit 2f0a3ee8d4
7 changed files with 46 additions and 2 deletions
+10
View File
@@ -45,6 +45,16 @@ static func density_display(density: float) -> Dictionary:
return {"mode": "DensityCrunch", "position": clampf((density - 0.9) * 10.0, 0.0, 1.0)}
return {"mode": "Density", "position": clampf(log(density * 1.0e5) / log(9.0e4), 0.0, 1.0)}
## Unity ApocalypseCheck thresholds and WarningUI colors; visual warning only.
static func density_warning_color(density: float) -> Color:
if density >= 1.0: return Color.html("00c0ffff")
if density >= 0.97: return Color.html("20b0dfbf")
if density >= 0.9: return Color.html("40a0c07f")
if density <= 1.0e-7: return Color.html("ff0000ff")
if density <= 1.0e-6: return Color.html("df2020bf")
if density <= 1.0e-5: return Color.html("c040407f")
return Color(0.0, 0.0, 0.0, 0.0)
## Integrate the population present at the start of the simulation interval.
## Thresholds use whole event counts; no per-year loop at high speeds.
static func advance(previous: Dictionary, target: Dictionary, rules: Dictionary, years: float) -> void: