Add hex grid to lobby rules editor; fix hex model/texture CDN loading

- rules_editor_dialog: add "Hexagon" to Board Shape picker and a Hex Sides
  spinner (3–10, default 5) so custom lobbies can configure hex boards
- game_screen _add_tile: has_model check now looks for Hex-shape CDN models
  (falls back to Square), so hex tiles get height variance when a Hex model is
  registered on the CDN instead of always using the flat placeholder height
- game_screen _try_load_tile_model: texture fallback now checks shape_key
  ("Hex") first, then falls back to "Square" — consistent with model loading

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-04-01 17:16:22 -04:00
co-authored by Claude Happy
parent f85894bd81
commit 1bd26f11be
2 changed files with 8 additions and 3 deletions
@@ -1200,7 +1200,9 @@ func _add_tile(x: int, y: int, affinity: String) -> void:
# Every tile gets a seeded RNG for deterministic variety.
# First roll: height (0.8-1.0 for model tiles, fixed 0.5 for placeholders).
# Second roll: vertical stagger (±0.15) so the board isn't completely flat.
var has_model : bool = not ContentCache.get_tile_model_url(affinity, "Square").is_empty()
var _shape_key_chk := "Hex" if _board_grid_type == "Hexagon" else "Square"
var has_model : bool = not ContentCache.get_tile_model_url(affinity, _shape_key_chk).is_empty() \
or (_board_grid_type == "Hexagon" and not ContentCache.get_tile_model_url(affinity, "Square").is_empty())
var rng := RandomNumberGenerator.new()
rng.seed = hash("%d_%d" % [x, y])
var h : float = rng.randf_range(0.8, 1.0) if has_model else 0.5
@@ -1263,7 +1265,9 @@ func _try_load_tile_model(body: StaticBody3D, affinity: String) -> void:
if model_url.is_empty():
# No 3D model — apply a 2D texture to the placeholder box and attach
# a stalagmite bottom so undecorated tiles still look coherent.
var tex_url := ContentCache.get_tile_texture_url(affinity, "Square")
var tex_url := ContentCache.get_tile_texture_url(affinity, shape_key)
if tex_url.is_empty() and _board_grid_type == "Hexagon":
tex_url = ContentCache.get_tile_texture_url(affinity, "Square")
if not tex_url.is_empty():
_apply_tile_texture(body, tex_url)
if want_bottom: