修正 UI 原型资源桥接枚举使用

生产校验与测试 fixture 改用 GameCreationAppAssetKind::UiDesign。

保留 ui-prototype 作为本地文件路径标识。
This commit is contained in:
2026-09-15 19:35:04 +08:00
parent d07ea186fa
commit a19319d815
@@ -11,6 +11,7 @@ use crate::{
};
use image::GenericImageView;
use serde::{Deserialize, Serialize};
use shared_contracts::game_creation_app::GameCreationAppAssetKind;
use std::fs;
use std::path::Path;
@@ -51,7 +52,7 @@ pub(crate) fn ensure_ui_design_resource_for_prototype(
.iter()
.find(|asset| asset.id == prototype_asset_id)
.ok_or_else(|| "UI 原型资产不存在".to_string())?;
if prototype.kind != "ui-prototype"
if prototype.kind != GameCreationAppAssetKind::UiDesign
|| !prototype
.media_type
.to_ascii_lowercase()
@@ -247,7 +248,7 @@ mod tests {
register_local_asset_entry(
directory.path(),
"assets/ui-prototype.png",
"ui-prototype",
"ui-design",
"image/png",
"canvas",
GameCreationAppAssetSource {
@@ -275,7 +276,7 @@ mod tests {
let source_id = manifest
.assets
.iter()
.find(|asset| asset.kind == "ui-prototype")
.find(|asset| asset.kind == GameCreationAppAssetKind::UiDesign)
.expect("source asset")
.id
.clone();