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:
dingo
2026-03-16 07:25:20 -04:00
co-authored by Claude Happy
parent a3c670e9e6
commit 42a2834e03
9 changed files with 592 additions and 28 deletions
@@ -112,6 +112,26 @@ else
<label class="form-check-label" for="chkPublished">Published</label>
</div>
</div>
<div class="col-12"><h6 class="text-muted mt-2">3D Model</h6></div>
<div class="col-md-2">
<label class="form-label">Scale</label>
<input @bind="_card.ModelScale" type="number" step="0.01" min="0.01" class="form-control"
placeholder="1.0" />
<div class="form-text">Null = 1.0 (no change)</div>
</div>
<div class="col-md-3">
<label class="form-label">Tint Colour</label>
<div class="input-group">
<input @bind="_card.ModelTintColor" class="form-control" placeholder="#RRGGBB" />
@if (!string.IsNullOrWhiteSpace(_card.ModelTintColor))
{
<span class="input-group-text"
style="background:@_card.ModelTintColor; width:36px; border:1px solid #ced4da;"></span>
}
</div>
<div class="form-text">Multiplicative hex tint over the model. Null = white (no tint).</div>
</div>
</div>
}
@@ -283,6 +303,23 @@ else
</div>
<input @bind="asset.MimeType" class="form-control form-control-sm mb-2"
placeholder="MIME type (e.g. image/webp, model/gltf-binary)" />
@if (asset.AssetType == CardAssetType.Model3D)
{
<div class="row g-1 mb-2">
<div class="col">
<label class="form-label form-label-sm mb-0">Facing Direction</label>
<select @bind="asset.ModelFacingDirection" class="form-select form-select-sm">
<option value="">– Default (north) –</option>
<option value="north">North (–Z)</option>
<option value="south">South (+Z)</option>
<option value="east">East (+X)</option>
<option value="west">West (–X)</option>
</select>
</div>
</div>
<input @bind="asset.ModelTintMaskUrl" class="form-control form-control-sm mb-2"
placeholder="Tint mask URL (CDN, optional)" />
}
<div class="form-check mb-2">
<input @bind="asset.IsAiGenerated" type="checkbox"
class="form-check-input" id="ai_asset_@asset.Id" />