落地方洞挑战图片与运行态交互
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
kdletters
2026-05-06 12:51:28 +08:00
parent 60b667a9d1
commit d06107f2c6
51 changed files with 2590 additions and 989 deletions

View File

@@ -32,13 +32,14 @@ pub fn build_creator_config(
shape_count: u32,
difficulty: u32,
) -> Result<SquareHoleCreatorConfig, SquareHoleError> {
let hole_options = normalize_hole_options(Vec::new(), theme_text);
Ok(SquareHoleCreatorConfig {
theme_text: normalize_theme_text(theme_text)?,
twist_rule: normalize_required_string(twist_rule).ok_or(SquareHoleError::MissingText)?,
shape_count: validate_shape_count(shape_count)?,
difficulty: validate_difficulty(difficulty)?,
shape_options: normalize_shape_options(Vec::new(), theme_text),
hole_options: normalize_hole_options(Vec::new()),
shape_options: normalize_shape_options(Vec::new(), theme_text, hole_options.as_slice()),
hole_options,
background_prompt: format!("{theme_text}主题的竖屏游戏背景,舞台中央有多个形状洞口"),
cover_image_src: None,
background_image_src: None,
@@ -98,36 +99,3 @@ pub fn validate_publish_requirements(draft: &SquareHoleResultDraft) -> Vec<Strin
}
blockers
}
#[deprecated(note = "请使用 compile_result_draft(profile_id, &config)")]
pub fn build_result_draft(
profile_id: String,
theme_text: String,
twist_rule: String,
shape_count: u32,
difficulty: u32,
) -> SquareHoleResultDraft {
let game_name = format!("{theme_text}方洞挑战");
let summary = format!(
"{theme_text}主题,{} 个形状,难度 {},规则:{twist_rule}",
shape_count, difficulty
);
let blockers = Vec::new();
SquareHoleResultDraft {
profile_id,
game_name,
theme_text: theme_text.clone(),
twist_rule,
summary,
tags: build_default_tags("方洞挑战"),
cover_image_src: None,
background_prompt: format!("{theme_text}主题的竖屏游戏背景,舞台中央有多个形状洞口"),
background_image_src: None,
shape_options: normalize_shape_options(Vec::new(), &theme_text),
hole_options: normalize_hole_options(Vec::new()),
shape_count,
difficulty,
publish_ready: true,
blockers,
}
}