refactor(@projects/@magic-civilization): 🎨 route city/world_gen_lab proofs to biome_colors single source (p2-87 phase 1d)
Delete the hardcoded TERRAIN_COLORS dict copies in city_proof.gd and world_gen_lab_proof.gd; both now call DataLoader.get_biome_color(tile.biome_id) (both load the theme, so the source is populated). Verified: city_proof renders correct biome colours (ocean/forest/plains/mountains/volcano), no magenta. Remaining phase-1d copies: climate_proof (also draws a colour legend off the dict) + improvement_proof / world_map_proof (don't load_theme — would need a theme-load added first). Tracked in p2-87. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9dabf0941b
commit
b6573bcb30
2 changed files with 6 additions and 46 deletions
|
|
@ -21,28 +21,8 @@ const WATER_BIOMES: Dictionary = {
|
|||
"ocean": true, "deep_ocean": true, "coast": true, "inland_sea": true, "lake": true,
|
||||
}
|
||||
|
||||
const TERRAIN_COLORS: Dictionary = {
|
||||
"ocean": Color(0.05, 0.10, 0.35),
|
||||
"deep_ocean": Color(0.02, 0.05, 0.25),
|
||||
"coast": Color(0.25, 0.45, 0.75),
|
||||
"lake": Color(0.15, 0.65, 0.75),
|
||||
"inland_sea": Color(0.10, 0.30, 0.60),
|
||||
"grassland": Color(0.30, 0.65, 0.20),
|
||||
"plains": Color(0.60, 0.70, 0.25),
|
||||
"forest": Color(0.10, 0.40, 0.10),
|
||||
"jungle": Color(0.20, 0.70, 0.15),
|
||||
"boreal_forest": Color(0.15, 0.40, 0.35),
|
||||
"enchanted_forest": Color(0.30, 0.55, 0.60),
|
||||
"desert": Color(0.85, 0.75, 0.40),
|
||||
"tundra": Color(0.70, 0.75, 0.72),
|
||||
"snow": Color(0.92, 0.94, 0.96),
|
||||
"ice": Color(0.80, 0.88, 0.95),
|
||||
"mountains": Color(0.45, 0.42, 0.40),
|
||||
"hills": Color(0.55, 0.45, 0.30),
|
||||
"swamp": Color(0.30, 0.35, 0.15),
|
||||
"volcano": Color(0.75, 0.15, 0.10),
|
||||
"land": Color(0.50, 0.50, 0.30),
|
||||
}
|
||||
## Biome colour comes from the single source (biome_colors.json) via
|
||||
## DataLoader.get_biome_color() — no local palette copy (p2-87).
|
||||
|
||||
var _game_map: RefCounted = null
|
||||
var _player: RefCounted = null
|
||||
|
|
@ -203,7 +183,7 @@ func _draw_map_panel(px: float) -> void:
|
|||
if offset.x & 1:
|
||||
y += CELL_H * 0.5
|
||||
|
||||
var base: Color = TERRAIN_COLORS.get(tile.biome_id, Color(0.5, 0.0, 0.5))
|
||||
var base: Color = DataLoader.get_biome_color(tile.biome_id)
|
||||
draw_rect(Rect2(x, y, CELL_W - 1, CELL_H - 1), base)
|
||||
|
||||
if pos in owned:
|
||||
|
|
|
|||
|
|
@ -12,28 +12,8 @@ const CELL_H: int = 10
|
|||
const MARGIN: Vector2i = Vector2i(20, 40)
|
||||
const OUTPUT_DIR: String = "user://screenshots/world_gen_lab"
|
||||
|
||||
const TERRAIN_COLORS: Dictionary = {
|
||||
"ocean": Color(0.05, 0.10, 0.35),
|
||||
"deep_ocean": Color(0.02, 0.05, 0.25),
|
||||
"coast": Color(0.25, 0.45, 0.75),
|
||||
"lake": Color(0.15, 0.65, 0.75),
|
||||
"inland_sea": Color(0.10, 0.30, 0.60),
|
||||
"grassland": Color(0.30, 0.65, 0.20),
|
||||
"plains": Color(0.60, 0.70, 0.25),
|
||||
"forest": Color(0.10, 0.40, 0.10),
|
||||
"jungle": Color(0.20, 0.70, 0.15),
|
||||
"boreal_forest": Color(0.15, 0.40, 0.35),
|
||||
"enchanted_forest": Color(0.30, 0.55, 0.60),
|
||||
"desert": Color(0.85, 0.75, 0.40),
|
||||
"tundra": Color(0.70, 0.75, 0.72),
|
||||
"snow": Color(0.92, 0.94, 0.96),
|
||||
"ice": Color(0.80, 0.88, 0.95),
|
||||
"mountains": Color(0.45, 0.42, 0.40),
|
||||
"hills": Color(0.55, 0.45, 0.30),
|
||||
"swamp": Color(0.30, 0.35, 0.15),
|
||||
"volcano": Color(0.75, 0.15, 0.10),
|
||||
"land": Color(0.50, 0.50, 0.30),
|
||||
}
|
||||
## Biome colour comes from the single source (biome_colors.json) via
|
||||
## DataLoader.get_biome_color() — no local palette copy (p2-87).
|
||||
|
||||
var _game_map: RefCounted = null
|
||||
var _captured: bool = false
|
||||
|
|
@ -108,7 +88,7 @@ func _draw() -> void:
|
|||
if offset.x & 1:
|
||||
y += CELL_H * 0.5
|
||||
draw_rect(Rect2(x, y, CELL_W - 1, CELL_H - 1),
|
||||
TERRAIN_COLORS.get(tile.biome_id, Color(0.5, 0.0, 0.5)))
|
||||
DataLoader.get_biome_color(tile.biome_id))
|
||||
if not tile.river_edges.is_empty():
|
||||
draw_rect(Rect2(x + CELL_W * 0.3, y + CELL_H * 0.3, 2, 2),
|
||||
Color(0.3, 0.6, 1.0))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue