Extend square-hole creation flow with visual asset timeout guard
This commit is contained in:
@@ -12,6 +12,9 @@ pub const SQUARE_HOLE_MAX_SHAPE_COUNT: u32 = 24;
|
||||
pub const SQUARE_HOLE_MIN_DIFFICULTY: u32 = 1;
|
||||
pub const SQUARE_HOLE_MAX_DIFFICULTY: u32 = 10;
|
||||
pub const SQUARE_HOLE_DEFAULT_DURATION_LIMIT_MS: u64 = 60_000;
|
||||
pub const SQUARE_HOLE_MIN_SHAPE_OPTION_COUNT: usize = 6;
|
||||
pub const SQUARE_HOLE_MIN_HOLE_OPTION_COUNT: usize = 3;
|
||||
pub const SQUARE_HOLE_MAX_HOLE_OPTION_COUNT: usize = 6;
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
@@ -55,6 +58,37 @@ pub struct SquareHoleCreatorConfig {
|
||||
pub twist_rule: String,
|
||||
pub shape_count: u32,
|
||||
pub difficulty: u32,
|
||||
#[serde(default)]
|
||||
pub shape_options: Vec<SquareHoleShapeOption>,
|
||||
#[serde(default)]
|
||||
pub hole_options: Vec<SquareHoleHoleOption>,
|
||||
#[serde(default)]
|
||||
pub background_prompt: String,
|
||||
#[serde(default)]
|
||||
pub cover_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub background_image_src: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct SquareHoleShapeOption {
|
||||
pub option_id: String,
|
||||
pub shape_kind: String,
|
||||
pub label: String,
|
||||
pub image_prompt: String,
|
||||
#[serde(default)]
|
||||
pub image_src: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct SquareHoleHoleOption {
|
||||
pub hole_id: String,
|
||||
pub hole_kind: String,
|
||||
pub label: String,
|
||||
#[serde(default)]
|
||||
pub bonus: bool,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
@@ -66,6 +100,16 @@ pub struct SquareHoleResultDraft {
|
||||
pub twist_rule: String,
|
||||
pub summary: String,
|
||||
pub tags: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub cover_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub background_prompt: String,
|
||||
#[serde(default)]
|
||||
pub background_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub shape_options: Vec<SquareHoleShapeOption>,
|
||||
#[serde(default)]
|
||||
pub hole_options: Vec<SquareHoleHoleOption>,
|
||||
pub shape_count: u32,
|
||||
pub difficulty: u32,
|
||||
pub publish_ready: bool,
|
||||
@@ -85,6 +129,10 @@ pub struct SquareHoleWorkProfile {
|
||||
pub summary: String,
|
||||
pub tags: Vec<String>,
|
||||
pub cover_image_src: Option<String>,
|
||||
pub background_prompt: String,
|
||||
pub background_image_src: Option<String>,
|
||||
pub shape_options: Vec<SquareHoleShapeOption>,
|
||||
pub hole_options: Vec<SquareHoleHoleOption>,
|
||||
pub shape_count: u32,
|
||||
pub difficulty: u32,
|
||||
pub publication_status: SquareHolePublicationStatus,
|
||||
@@ -100,6 +148,8 @@ pub struct SquareHoleShapeSnapshot {
|
||||
pub shape_kind: String,
|
||||
pub label: String,
|
||||
pub color: String,
|
||||
#[serde(default)]
|
||||
pub image_src: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
@@ -110,6 +160,8 @@ pub struct SquareHoleHoleSnapshot {
|
||||
pub label: String,
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
#[serde(default)]
|
||||
pub bonus: bool,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
@@ -137,6 +189,10 @@ pub struct SquareHoleRunSnapshot {
|
||||
pub best_combo: u32,
|
||||
pub score: u32,
|
||||
pub rule_label: String,
|
||||
#[serde(default)]
|
||||
pub background_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub shape_options: Vec<SquareHoleShapeOption>,
|
||||
pub current_shape: Option<SquareHoleShapeSnapshot>,
|
||||
pub holes: Vec<SquareHoleHoleSnapshot>,
|
||||
pub last_feedback: Option<SquareHoleDropFeedback>,
|
||||
|
||||
Reference in New Issue
Block a user