Feature: tile spacing gap + 2D placeholder textures
Visual changes (client): - 0.1 gap between all tiles (TILE_SPACING = 1.1) - Placeholder tiles (no 3D model) are now 0.5 height instead of random 0.8-1.0, making undecorated tiles visually distinct - Placeholder tiles load a 2D CDN texture via HTTP and apply it as the albedo on the BoxMesh (same affinity-per-shape lookup as 3D models) - Placeholder tiles also attach a stalagmite bottom model, matching the look of fully-decorated tiles Server: - TileModelBinding.TexturePublicUrl (nullable text) added to entity, migration 20260317000001_AddTileTexture applied to DB - TileModelDto extended with TexturePublicUrl - ContentGetTileModelsHandler includes TexturePublicUrl in response Admin (/content/tile-models): - New "Square Texture" and "Hex Texture" columns in the bindings table - Texture picker modal browses the CDN textures/ prefix and shows image thumbnails; select + assign writes TexturePublicUrl to the binding - Texture can be assigned without a 3D model (creates a binding row with empty model fields) ContentCache: - Caches texturePublicUrl alongside modelPublicUrl from tile_models response - New get_tile_texture_url(affinity, shape) → String accessor 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:
@@ -36,6 +36,9 @@ var _is_syncing: bool = false
|
||||
## "Affinity_Shape" (e.g. "Forest_Square") → CDN model URL string
|
||||
var _tile_models: Dictionary = {}
|
||||
|
||||
## "Affinity_Shape" → CDN texture URL string (2D texture for placeholder tiles)
|
||||
var _tile_textures: Dictionary = {}
|
||||
|
||||
## Array of CDN URL strings for tile bottom (stalagmite) models.
|
||||
var _tile_bottom_urls: Array = []
|
||||
|
||||
@@ -115,6 +118,11 @@ func get_tile_model_url(affinity: String, shape: String) -> String:
|
||||
return _tile_models.get(affinity + "_" + shape, "")
|
||||
|
||||
|
||||
## Return the CDN URL for a tile's 2D placeholder texture, or "" if not assigned.
|
||||
func get_tile_texture_url(affinity: String, shape: String) -> String:
|
||||
return _tile_textures.get(affinity + "_" + shape, "")
|
||||
|
||||
|
||||
## Returns a random active tile bottom (stalagmite) CDN URL, or "" if none configured.
|
||||
func get_random_tile_bottom_url() -> String:
|
||||
if _tile_bottom_urls.is_empty():
|
||||
@@ -193,13 +201,18 @@ func _on_tile_models(payload: Variant) -> void:
|
||||
var p := payload as Dictionary
|
||||
var bindings : Array = p.get("bindings", [])
|
||||
_tile_models.clear()
|
||||
_tile_textures.clear()
|
||||
for item in bindings:
|
||||
var d := item as Dictionary
|
||||
if d == null: continue
|
||||
var key := str(d.get("affinity", "")) + "_" + str(d.get("shape", ""))
|
||||
var url := str(d.get("modelPublicUrl", ""))
|
||||
if not key.is_empty() and not url.is_empty():
|
||||
_tile_models[key] = url
|
||||
if key.is_empty(): continue
|
||||
var model_url := str(d.get("modelPublicUrl", ""))
|
||||
if not model_url.is_empty():
|
||||
_tile_models[key] = model_url
|
||||
var tex_url := str(d.get("texturePublicUrl", ""))
|
||||
if not tex_url.is_empty() and tex_url != "null":
|
||||
_tile_textures[key] = tex_url
|
||||
_save_tile_models_to_disk()
|
||||
tile_models_ready.emit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user