Timeline: cut, copy and paste one frame property
In the frames context menu, Cut/Copy/Paste each open onto Frame (the whole frame, as Ctrl+X/C/V) or Property, which lists the properties the frame type has. Copying a property copies the focused (or first selected) frame; pasting sets just that property on the selected frames, and is disabled when a target lacks it or what it refers to (region on the target's spritesheet, shader, event, sounds). Cutting resets it to the default. Actions gained submenus; edit::frames_property_set does the work (tested). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8fb28ef30a
commit
97be81b5c1
11 files changed
+306
-9
No files matched your search
@@ -325,3 +325,26 @@ TEST_CASE("isaac_issues_get counts what the game's copy changes")
|
||||
CHECK(shaders.shearFrames > 0);
|
||||
CHECK(model::isaac_issues_get(fixture_load("02_items.anm2")).triggerSounds > 0);
|
||||
}
|
||||
|
||||
TEST_CASE("frames_property_set copies one property to the frames that have it")
|
||||
{
|
||||
auto model = fixture_load("02_items.anm2");
|
||||
model::Frame source{.crop = {7, 8}, .position = {3, 4}};
|
||||
Reference layer{0, LAYER, 0, 0};
|
||||
Reference null{0, NULL_, 0, 0};
|
||||
REQUIRE(model.frame_get(layer));
|
||||
REQUIRE(model.frame_get(null));
|
||||
auto nullCrop = model.frame_get(null)->crop;
|
||||
|
||||
edit::frames_property_set(model, {layer, null}, edit::FrameProperty::POSITION, source);
|
||||
CHECK(model.frame_get(layer)->position == glm::vec2(3, 4));
|
||||
CHECK(model.frame_get(null)->position == glm::vec2(3, 4));
|
||||
|
||||
edit::frames_property_set(model, {layer, null}, edit::FrameProperty::CROP, source);
|
||||
CHECK(model.frame_get(layer)->crop == glm::vec2(7, 8));
|
||||
CHECK(model.frame_get(null)->crop == nullCrop);
|
||||
|
||||
CHECK_FALSE(edit::is_frame_property_valid(edit::FrameProperty::EVENT, ItemType::LAYER));
|
||||
CHECK(edit::is_frame_property_valid(edit::FrameProperty::SOUNDS, ItemType::TRIGGER));
|
||||
CHECK_FALSE(edit::is_frame_property_valid(edit::FrameProperty::POSITION, ItemType::TRIGGER));
|
||||
}
|
||||
Reference in new issue
Block a user