Add Use Spot Overlay and Target Capture Bar functionality

- Introduced `StageUseTargetCaptureBar` class for managing user interactions with props and their use spots.
- Implemented UI elements including buttons for changing props and canceling actions.
- Added `PropUseSpotData` class for validation and serialization of prop use spots.
- Created tests for validating use spot data migration, serialization, and rule matching.
- Ensured proper handling of edge cases in use spot data, including unique IDs and finite positions.
This commit is contained in:
2026-10-13 11:23:44 -04:00
parent 235c6aa6a6
commit d8b1b1164b
42 changed files with 3847 additions and 50 deletions
+342
View File
@@ -0,0 +1,342 @@
{
"version": "1.3",
"scene_name": "Untitled",
"camera": {
"position": {
"x": -312.75048828125,
"y": -243.914947509766
},
"zoom": 0.885780572891235
},
"objects": [
{
"file_id": "terrain_1",
"type": "terrain",
"position": {
"x": -960.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_2",
"type": "terrain",
"position": {
"x": -768.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_3",
"type": "terrain",
"position": {
"x": -576.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_4",
"type": "terrain",
"position": {
"x": -384.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_5",
"type": "terrain",
"position": {
"x": -192.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_6",
"type": "terrain",
"position": {
"x": 0.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_7",
"type": "terrain",
"position": {
"x": 192.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_8",
"type": "terrain",
"position": {
"x": 384.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_9",
"type": "terrain",
"position": {
"x": 576.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_10",
"type": "terrain",
"position": {
"x": 768.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_11",
"type": "terrain",
"position": {
"x": 960.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_12",
"type": "terrain",
"position": {
"x": 1152.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "terrain_13",
"type": "terrain",
"position": {
"x": 1344.0,
"y": 160.0
},
"rotation": 0.0,
"asset_id": "ground",
"scale": {
"x": 1.0,
"y": 1.0
}
},
{
"file_id": "stickman_1",
"type": "stickman",
"position": {
"x": -756.0,
"y": -241.0
},
"rotation": 0.0,
"stk_path": "res://content/stickmen/break.stk",
"facing_profile": "FORWARD",
"action_queue": [
{
"type": "use_prop",
"target_prop_id": "prop_20906175_2821870920_1",
"target_spot_id": "spot_1"
}
]
},
{
"file_id": "prop_1",
"type": "prop",
"position": {
"x": -144.0,
"y": -732.0
},
"rotation": 0.993539273629036,
"asset_id": "res://content/props/championship_belt.prop",
"stage_object_id": "prop_20906175_2821870920_1",
"roles": {
"depth": "behind",
"start_motion": "still",
"holds_other_props": false,
"blocks_stickmen": false,
"can_pick_up": true,
"released_blocks_stickmen": true,
"released_bumps_other_props": true,
"legacy_draw_order": false
},
"use_spots": [
{
"id": "spot_1",
"number": 1,
"name": "Button",
"position": {
"x": -179.254028320313,
"y": -63.7373542785645
}
},
{
"id": "spot_2",
"number": 2,
"name": "Lever",
"position": {
"x": 182.606811523438,
"y": -29.3857421875
}
}
],
"next_use_spot_number": 5,
"scale": {
"x": 0.999997615814209,
"y": 0.999997615814209
},
"material_preset": 4
},
{
"file_id": "prop_2",
"type": "prop",
"position": {
"x": -1008.0,
"y": -408.0
},
"rotation": 0.0,
"asset_id": "res://content/props/baseball.prop",
"stage_object_id": "prop_109116485_2472952225_1",
"roles": {
"depth": "behind",
"start_motion": "still",
"holds_other_props": false,
"blocks_stickmen": false,
"can_pick_up": true,
"released_blocks_stickmen": true,
"released_bumps_other_props": true,
"legacy_draw_order": false
},
"use_spots": [],
"next_use_spot_number": 1,
"scale": {
"x": 1.0,
"y": 1.0
},
"material_preset": 2
}
],
"event_rules": [
{
"id": 0,
"trigger": {
"type": "prop_used",
"source_id": "stickman_1",
"target_id": null,
"params": {
"target_prop_id": "prop_20906175_2821870920_1",
"spot_scope": "specific",
"target_spot_id": "spot_1"
}
},
"actions": [
{
"type": "speak",
"target_id": "stickman_1",
"params": {
"text": "I pushed it!",
"duration": 1.6,
"stop_current": false,
"keep_acting": true,
"arrangement": "together",
"bubble_layout": "stack",
"connect_bubbles": false,
"reveal": "instant",
"pop_in": false,
"duration_mode": "just_enough",
"bubbles": [
{
"text": "I pushed it!",
"visual": {
"bubble_style": "talk",
"font_preset": "comic",
"size_preset": "medium",
"color": "#202020",
"effect": "none",
"reveal": "instant",
"pop_in": false,
"word_styles": []
}
}
]
}
}
]
}
],
"metadata": {
"created_unix": 1791684250,
"modified_unix": 1791849418.99,
"autosave": false,
"source_path": ""
}
}