Several events per trigger, built-in stop and done events

A trigger holds a list of events (Frame Properties lists them like sounds);
the first stays its EventId, the rest are <Event Id> children in the
editor's copy, and the Isaac warning counts the dropped ones. In extended
documents, stop and done are offered as built-in events: listed in italics
at the top of Events, locked from renaming, and added to the file when a
trigger first uses one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 17:35:11 -04:00
1 parent 4375844c84
commit b31a28ebe9
19 files changed
+195 -101

No files matched your search

+15
View File
@@ -437,3 +437,18 @@ TEST_CASE("skew reads from the old Shear attributes too")
CHECK(frames[1].skew.x == 7);
CHECK(frames[0].extras.attributes.empty());
}
TEST_CASE("a trigger fires several events; built-in events join a file when first used")
{
auto model = fixture_load("02_items.anm2");
auto stopId = edit::event_id_resolve(model, model::EVENT_BUILT_IN_ID_FIRST);
CHECK(model::item_get(model.content.events, stopId)->name == "stop");
CHECK(edit::event_id_resolve(model, model::EVENT_BUILT_IN_ID_FIRST) == stopId);
CHECK(edit::event_id_resolve(model, 1) == 1);
model.frame_edit({0, TRIGGER, -1, 0})->eventIds = {0, stopId, 1};
auto text = model::model_to_string(model);
CHECK(model_load(text).frame_get({0, TRIGGER, -1, 0})->eventIds == std::vector{0, stopId, 1});
CHECK(model_load(game_document_get(text)).frame_get({0, TRIGGER, -1, 0})->eventIds == std::vector{0});
CHECK(model::isaac_issues_get(model).extraEvents == 2);
}