Feature: model config UI + move scale/tint to CardDefinition
Reorganised model3D config into two logical levels:
Card-level (CardDefinition — "this card's visual identity"):
ModelScale float? — uniform scale multiplier
ModelTintColor string? — multiplicative hex tint e.g. "#FF8800"
Asset-level (CardAsset — "properties of this mesh file"):
ModelFacingDirection string? — GLB export facing ("north" default)
ModelTintMaskUrl string? — CDN URL for per-texel tint mask
Admin UI (CardEditor.razor):
Basic tab: new "3D Model" row with Scale (number) + Tint Colour
(text + live swatch preview).
Assets tab: Model3D asset cards now show Facing Direction dropdown
and Tint Mask URL input.
Server:
ContentMessages: ModelScale/ModelTintColor moved to CardDefinitionDto;
CardAssetDto retains only ModelFacingDirection + ModelTintMaskUrl.
ContentDtoMapper updated accordingly.
Client (game_screen.gd):
modelScale + modelTintColor now read from the definition dict;
modelFacingDirection stays on the asset dict.
DB: migration MoveModelScaleTintToCard applied to pg-forge-01/SOR.
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:
@@ -674,10 +674,11 @@ func _add_unit_mesh(unit: Dictionary, team_color: Color, is_enemy: bool = false)
|
||||
if model_url.is_empty():
|
||||
return
|
||||
|
||||
# Read per-model config from the asset.
|
||||
var facing_dir : String = str(model_asset.get("modelFacingDirection", "north"))
|
||||
var model_scale : float = float(model_asset.get("modelScale", 1.0))
|
||||
var tint_str : String = str(model_asset.get("modelTintColor", ""))
|
||||
# Asset-level config (model-file specific).
|
||||
var facing_dir : String = str(model_asset.get("modelFacingDirection", "north"))
|
||||
# Card-level config (visual identity of this card, not the shared mesh file).
|
||||
var model_scale : float = float(def.get("modelScale", 1.0))
|
||||
var tint_str : String = str(def.get("modelTintColor", ""))
|
||||
var model_tint : Color = Color.WHITE
|
||||
if not tint_str.is_empty() and tint_str != "null":
|
||||
model_tint = Color(tint_str)
|
||||
|
||||
Reference in New Issue
Block a user