Remove built-in stop and done events
Events are plain again: no built-in names offered, locked or listed in the Events window, and the game's copy of a trigger keeps its first event. The list rows' rename lock and event_id_resolve go with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f01e8065d
commit
4141c53681
12 files changed
+21
-112
No files matched your search
+5
-10
@@ -30,8 +30,8 @@ A Rebirth document is different: it saves the game's copy, followed by the exten
|
|||||||
</Layers>
|
</Layers>
|
||||||
<Nulls>…</Nulls>
|
<Nulls>…</Nulls>
|
||||||
<Events>
|
<Events>
|
||||||
<Event Id="0" Name="stop"/>
|
<Event Id="0" Name="shoot"/>
|
||||||
<Event Id="1" Name="shoot"/>
|
<Event Id="1" Name="done"/>
|
||||||
</Events>
|
</Events>
|
||||||
<Sounds>…</Sounds>
|
<Sounds>…</Sounds>
|
||||||
<Libraries>
|
<Libraries>
|
||||||
@@ -60,11 +60,6 @@ A Rebirth document is different: it saves the game's copy, followed by the exten
|
|||||||
- **Instance name:** the layer's `Name` is the name code should use for the instance.
|
- **Instance name:** the layer's `Name` is the name code should use for the instance.
|
||||||
- **No self-nesting:** an animation never plays inside itself, even through other animations. That draw is skipped.
|
- **No self-nesting:** an animation never plays inside itself, even through other animations. That draw is skipped.
|
||||||
|
|
||||||
**Events**
|
|
||||||
- Event names are free, but `stop` and `done` are built in.
|
|
||||||
- The editor offers them and locks them from renaming. It gives them no behaviour of its own; what they do is up to the runtime.
|
|
||||||
- The game's copy of a Rebirth document leaves them out of triggers.
|
|
||||||
|
|
||||||
## Animations
|
## Animations
|
||||||
```xml
|
```xml
|
||||||
<Animations DefaultAnimation="Walk">
|
<Animations DefaultAnimation="Walk">
|
||||||
@@ -79,8 +74,8 @@ A Rebirth document is different: it saves the game's copy, followed by the exten
|
|||||||
</LayerAnimations>
|
</LayerAnimations>
|
||||||
<NullAnimations>…</NullAnimations>
|
<NullAnimations>…</NullAnimations>
|
||||||
<Triggers>
|
<Triggers>
|
||||||
<Trigger EventId="1" AtFrame="12"><Sound Id="0"/></Trigger>
|
<Trigger EventId="0" AtFrame="12"><Sound Id="0"/></Trigger>
|
||||||
<Trigger EventId="0" AtFrame="23"><Event Id="2"/></Trigger>
|
<Trigger EventId="0" AtFrame="23"><Event Id="1"/></Trigger>
|
||||||
</Triggers>
|
</Triggers>
|
||||||
</Animation>
|
</Animation>
|
||||||
</Animations>
|
</Animations>
|
||||||
@@ -162,6 +157,6 @@ world = Root · GroupRoot · ( position + Flip · Rotate · Skew · |scale| · (
|
|||||||
A Rebirth document's game copy keeps only what the game reads:
|
A Rebirth document's game copy keeps only what the game reads:
|
||||||
- **Animation layers** are flattened into plain layers, one per layer the child draws, named `layer/childLayer`. Their frames are baked one per frame and skew is dropped. A library's spritesheets are added with paths relative to the document.
|
- **Animation layers** are flattened into plain layers, one per layer the child draws, named `layer/childLayer`. Their frames are baked one per frame and skew is dropped. A library's spritesheets are added with paths relative to the document.
|
||||||
- **Children's trigger events** join the animation's triggers, matched by name.
|
- **Children's trigger events** join the animation's triggers, matched by name.
|
||||||
- **Triggers** keep one event each: the first that isn't built in.
|
- **Triggers** keep one event each: the first.
|
||||||
- **Dropped attributes:** markers, depth, skew, alpha offset, blur, shaders, extra events, trigger sounds and libraries.
|
- **Dropped attributes:** markers, depth, skew, alpha offset, blur, shaders, extra events, trigger sounds and libraries.
|
||||||
- **SVG spritesheets** are offered for conversion to PNGs before saving.
|
- **SVG spritesheets** are offered for conversion to PNGs before saving.
|
||||||
+1
-11
@@ -903,17 +903,7 @@ namespace anm2ed
|
|||||||
if (kind == SelectionKind::SPRITESHEETS) add(content.spritesheets, path_label_get(FORMAT_SPRITESHEET));
|
if (kind == SelectionKind::SPRITESHEETS) add(content.spritesheets, path_label_get(FORMAT_SPRITESHEET));
|
||||||
if (kind == SelectionKind::SOUNDS) add(content.sounds, path_label_get(FORMAT_SOUND));
|
if (kind == SelectionKind::SOUNDS) add(content.sounds, path_label_get(FORMAT_SOUND));
|
||||||
if (kind == SelectionKind::LIBRARIES) add(content.libraries, path_label_get(FORMAT_SOUND));
|
if (kind == SelectionKind::LIBRARIES) add(content.libraries, path_label_get(FORMAT_SOUND));
|
||||||
if (kind == SelectionKind::EVENTS)
|
if (kind == SelectionKind::EVENTS) add(content.events, name_get);
|
||||||
{
|
|
||||||
add(content.events, name_get);
|
|
||||||
// An extended document offers the built-in events it doesn't have yet.
|
|
||||||
for (int i = 0; model.isExtendedFormat && i < (int)std::size(model::EVENT_BUILT_INS); ++i)
|
|
||||||
if (std::ranges::find(content.events, model::EVENT_BUILT_INS[i], &model::Event::name) == content.events.end())
|
|
||||||
{
|
|
||||||
choices.ids.push_back(model::EVENT_BUILT_IN_ID_FIRST - i);
|
|
||||||
choices.labels.emplace_back(model::EVENT_BUILT_INS[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (kind == SelectionKind::SHADERS) add(content.shaders, name_get);
|
if (kind == SelectionKind::SHADERS) add(content.shaders, name_get);
|
||||||
if (kind == SelectionKind::REGIONS)
|
if (kind == SelectionKind::REGIONS)
|
||||||
if (auto spritesheet = model.layer_spritesheet_get(layerId)) add(spritesheet->regions, name_get);
|
if (auto spritesheet = model.layer_spritesheet_get(layerId)) add(spritesheet->regions, name_get);
|
||||||
|
|||||||
@@ -22,18 +22,6 @@ namespace anm2ed::edit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// An event id from a choice: a built-in event not yet in the file is added (or found by name) first.
|
|
||||||
int event_id_resolve(Model& model, int id)
|
|
||||||
{
|
|
||||||
auto index = EVENT_BUILT_IN_ID_FIRST - id;
|
|
||||||
if (index < 0 || index >= (int)std::size(EVENT_BUILT_INS)) return id;
|
|
||||||
auto& events = model.content.events;
|
|
||||||
std::string name(EVENT_BUILT_INS[index]);
|
|
||||||
auto event = std::ranges::find(events, name, &Event::name);
|
|
||||||
if (event != events.end()) return event->id;
|
|
||||||
return events.emplace_back(Event{.id = item_next_id_get(events), .name = name}).id;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_region_matched(const Region& region, const Frame& frame)
|
bool is_region_matched(const Region& region, const Frame& frame)
|
||||||
{
|
{
|
||||||
return glm::ivec2(region.crop) == glm::ivec2(frame.crop) && glm::ivec2(region.size) == glm::ivec2(frame.size) &&
|
return glm::ivec2(region.crop) == glm::ivec2(frame.crop) && glm::ivec2(region.size) == glm::ivec2(frame.size) &&
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ namespace anm2ed::edit
|
|||||||
std::optional<resource::Image> spritesheet_pack(model::Model&, int, const resource::Image&, int);
|
std::optional<resource::Image> spritesheet_pack(model::Model&, int, const resource::Image&, int);
|
||||||
std::optional<resource::Image> spritesheets_merge(model::Model&, const std::set<int>&, const ImageGet&, bool, bool,
|
std::optional<resource::Image> spritesheets_merge(model::Model&, const std::set<int>&, const ImageGet&, bool, bool,
|
||||||
bool, Origin);
|
bool, Origin);
|
||||||
int event_id_resolve(model::Model&, int);
|
|
||||||
|
|
||||||
// Where a spritesheet path of a document (this one, or a library) points, from this document.
|
// Where a spritesheet path of a document (this one, or a library) points, from this document.
|
||||||
using SpritesheetPathGet = std::function<std::filesystem::path(const model::Model&, const std::filesystem::path&)>;
|
using SpritesheetPathGet = std::function<std::filesystem::path(const model::Model&, const std::filesystem::path&)>;
|
||||||
|
|||||||
@@ -161,14 +161,10 @@ namespace anm2ed::imgui
|
|||||||
ImGui::PushID(i);
|
ImGui::PushID(i);
|
||||||
if (combo_id_mapped("##Choice", &id, choices.ids, choices.labels) && frame)
|
if (combo_id_mapped("##Choice", &id, choices.ids, choices.labels) && frame)
|
||||||
frame_edit(edit_state::COMPLETE, setEdit,
|
frame_edit(edit_state::COMPLETE, setEdit,
|
||||||
[index = (std::size_t)i, id, member](Document& document, model::Frame& frame,
|
[index = (std::size_t)i, id, member](Document&, model::Frame& frame, model::Track*,
|
||||||
model::Track*, const Reference&)
|
const Reference&)
|
||||||
{
|
{
|
||||||
auto& ids = frame.*member;
|
if (index < (frame.*member).size()) (frame.*member)[index] = id;
|
||||||
if (index >= ids.size()) return;
|
|
||||||
ids[index] = member == &model::Frame::eventIds
|
|
||||||
? edit::event_id_resolve(document.model, id)
|
|
||||||
: id;
|
|
||||||
});
|
});
|
||||||
ImGui::SetItemTooltip("%s", localize.get(tooltip));
|
ImGui::SetItemTooltip("%s", localize.get(tooltip));
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "util/imgui/input.hpp"
|
#include "util/imgui/input.hpp"
|
||||||
#include "util/imgui/layout.hpp"
|
#include "util/imgui/layout.hpp"
|
||||||
|
|
||||||
using namespace anm2ed::resource;
|
|
||||||
using namespace anm2ed::types;
|
using namespace anm2ed::types;
|
||||||
|
|
||||||
namespace anm2ed::imgui
|
namespace anm2ed::imgui
|
||||||
@@ -250,10 +249,9 @@ namespace anm2ed::imgui
|
|||||||
if (ImGui::Begin(localize.get(LABEL_EVENTS_WINDOW), &settings.windowIsEvents))
|
if (ImGui::Begin(localize.get(LABEL_EVENTS_WINDOW), &settings.windowIsEvents))
|
||||||
{
|
{
|
||||||
auto selection = document.selected_ids_get(SelectionKind::EVENTS);
|
auto selection = document.selected_ids_get(SelectionKind::EVENTS);
|
||||||
auto is_built_in = [&](int id) { return model::is_event_built_in(model::item_get(events, id)->name); };
|
|
||||||
Actions actions{};
|
Actions actions{};
|
||||||
actions.add(
|
actions.add(
|
||||||
ACTION_RENAME, [=]() { return selection.size() == 1 && !is_built_in(*selection.begin()); },
|
ACTION_RENAME, [selection]() { return selection.size() == 1; },
|
||||||
[&state, selection]() { state.newId = *selection.begin(); });
|
[&state, selection]() { state.newId = *selection.begin(); });
|
||||||
actions.add(
|
actions.add(
|
||||||
ACTION_ADD, {},
|
ACTION_ADD, {},
|
||||||
@@ -299,31 +297,10 @@ namespace anm2ed::imgui
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
.is_locked = is_built_in,
|
.tooltip_draw = [&](int id)
|
||||||
.font_get = [&](int id) { return is_built_in(id) ? font::ITALICS : font::REGULAR; },
|
{ item_tooltip_draw(resources, model::item_get(events, id)->name, id); }};
|
||||||
.tooltip_draw =
|
|
||||||
[&](int id)
|
|
||||||
{
|
|
||||||
item_tooltip_draw(resources, model::item_get(events, id)->name, id);
|
|
||||||
if (is_built_in(id)) ImGui::TextUnformatted(localize.get(TOOLTIP_EVENT_BUILT_IN));
|
|
||||||
}};
|
|
||||||
// Built-in events come first; an extended document lists the ones it doesn't have yet above them.
|
|
||||||
auto ids = item_ids_get(events);
|
|
||||||
std::ranges::stable_partition(ids, is_built_in);
|
|
||||||
list_panel_draw(panel, actions, {{ACTION_ADD, ACTION_REMOVE_UNUSED}},
|
list_panel_draw(panel, actions, {{ACTION_ADD, ACTION_REMOVE_UNUSED}},
|
||||||
[&]()
|
[&]() { content_list_draw(panel, SelectionKind::EVENTS, item_ids_get(events), rows); });
|
||||||
{
|
|
||||||
ImGui::PushFont(resources.fonts[font::ITALICS].get(), font::SIZE);
|
|
||||||
for (auto name : model::EVENT_BUILT_INS)
|
|
||||||
if (document.model.isExtendedFormat &&
|
|
||||||
std::ranges::find(events, name, &model::Event::name) == events.end())
|
|
||||||
{
|
|
||||||
ImGui::TextDisabled("%s", std::string(name).c_str());
|
|
||||||
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_EVENT_BUILT_IN));
|
|
||||||
}
|
|
||||||
ImGui::PopFont();
|
|
||||||
content_list_draw(panel, SelectionKind::EVENTS, ids, rows);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ namespace anm2ed::imgui
|
|||||||
if (arrowKey == key) ImGui::SetKeyboardFocusHere();
|
if (arrowKey == key) ImGui::SetKeyboardFocusHere();
|
||||||
|
|
||||||
bool isActivated{};
|
bool isActivated{};
|
||||||
if (rows.rename && !(rows.is_locked && rows.is_locked(key)))
|
if (rows.rename)
|
||||||
{
|
{
|
||||||
if (state.newId == key)
|
if (state.newId == key)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ namespace anm2ed::imgui
|
|||||||
std::function<std::string(int)> label_get{};
|
std::function<std::string(int)> label_get{};
|
||||||
std::function<std::string(int)> name_get{};
|
std::function<std::string(int)> name_get{};
|
||||||
std::function<void(int, const std::string&)> rename{};
|
std::function<void(int, const std::string&)> rename{};
|
||||||
std::function<bool(int)> is_locked{};
|
|
||||||
std::function<bool(int)> is_invalid{};
|
std::function<bool(int)> is_invalid{};
|
||||||
std::function<resource::font::Type(int)> font_get{};
|
std::function<resource::font::Type(int)> font_get{};
|
||||||
std::function<void(int)> tooltip_draw{};
|
std::function<void(int)> tooltip_draw{};
|
||||||
|
|||||||
@@ -291,13 +291,6 @@ namespace anm2ed::model
|
|||||||
bool operator==(const Animations&) const = default;
|
bool operator==(const Animations&) const = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Events the editor knows by name: shown locked in Events, and added to a file when a trigger first uses one. A
|
|
||||||
// choice of one not yet in the file has id EVENT_BUILT_IN_ID_FIRST - its index.
|
|
||||||
inline constexpr std::string_view EVENT_BUILT_INS[] = {"stop", "done"};
|
|
||||||
inline constexpr int EVENT_BUILT_IN_ID_FIRST = -2;
|
|
||||||
|
|
||||||
inline bool is_event_built_in(std::string_view name) { return std::ranges::contains(EVENT_BUILT_INS, name); }
|
|
||||||
|
|
||||||
// Content item lookup by file id (layers, nulls, events, sounds, spritesheets, shaders, regions).
|
// Content item lookup by file id (layers, nulls, events, sounds, spritesheets, shaders, regions).
|
||||||
template <class Items> auto item_get(Items& items, int id) -> decltype(&items.front())
|
template <class Items> auto item_get(Items& items, int id) -> decltype(&items.front())
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-19
@@ -1124,21 +1124,12 @@ namespace anm2ed::model
|
|||||||
if (type == ItemType::TRIGGER)
|
if (type == ItemType::TRIGGER)
|
||||||
{
|
{
|
||||||
sink.open(tag_get(ElementType::TRIGGER));
|
sink.open(tag_get(ElementType::TRIGGER));
|
||||||
// The game's copy (one event per trigger) keeps the first event that isn't built in.
|
if (!frame.eventIds.empty()) sink.attribute("EventId", frame.eventIds.front());
|
||||||
auto eventIds = frame.eventIds;
|
|
||||||
if (!writer.is(SERIALIZE_EXTENSIONS) && writer.model)
|
|
||||||
std::erase_if(eventIds,
|
|
||||||
[&](int id)
|
|
||||||
{
|
|
||||||
auto event = item_get(writer.model->content.events, id);
|
|
||||||
return event && is_event_built_in(event->name);
|
|
||||||
});
|
|
||||||
if (!eventIds.empty()) sink.attribute("EventId", eventIds.front());
|
|
||||||
sink.attribute("AtFrame", frame.atFrame);
|
sink.attribute("AtFrame", frame.atFrame);
|
||||||
extras_write(sink, frame.extras);
|
extras_write(sink, frame.extras);
|
||||||
Children children{sink, frame.extras};
|
Children children{sink, frame.extras};
|
||||||
if (writer.is(SERIALIZE_EXTENSIONS))
|
if (writer.is(SERIALIZE_EXTENSIONS))
|
||||||
for (auto eventId : eventIds | std::views::drop(1))
|
for (auto eventId : frame.eventIds | std::views::drop(1))
|
||||||
{
|
{
|
||||||
children.add();
|
children.add();
|
||||||
sink.open(tag_get(ElementType::EVENT_ELEMENT));
|
sink.open(tag_get(ElementType::EVENT_ELEMENT));
|
||||||
@@ -1403,14 +1394,7 @@ namespace anm2ed::model
|
|||||||
issues.depthFrames += track.type == ItemType::LAYER && frame.depth != 0;
|
issues.depthFrames += track.type == ItemType::LAYER && frame.depth != 0;
|
||||||
issues.alphaOffsetFrames += math::float_to_uint8(frame.colorOffset.a) != 0;
|
issues.alphaOffsetFrames += math::float_to_uint8(frame.colorOffset.a) != 0;
|
||||||
issues.blurFrames += track.type == ItemType::LAYER && frame.blur != 0.0f;
|
issues.blurFrames += track.type == ItemType::LAYER && frame.blur != 0.0f;
|
||||||
// Built-in events are left out of the game's copy on purpose; only further custom ones are lost.
|
issues.extraEvents += track.type == ItemType::TRIGGER ? std::max((int)frame.eventIds.size() - 1, 0) : 0;
|
||||||
auto customEvents = std::ranges::count_if(frame.eventIds,
|
|
||||||
[&](int id)
|
|
||||||
{
|
|
||||||
auto event = item_get(model.content.events, id);
|
|
||||||
return !event || !is_event_built_in(event->name);
|
|
||||||
});
|
|
||||||
issues.extraEvents += track.type == ItemType::TRIGGER ? std::max((int)customEvents - 1, 0) : 0;
|
|
||||||
issues.triggerSounds += track.type == ItemType::TRIGGER &&
|
issues.triggerSounds += track.type == ItemType::TRIGGER &&
|
||||||
std::ranges::any_of(frame.soundIds, [](int id) { return id != -1; });
|
std::ranges::any_of(frame.soundIds, [](int id) { return id != -1; });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -587,7 +587,6 @@ namespace anm2ed
|
|||||||
X(TOOLTIP_DEPTH, "Draw this layer this many layers above (or, negative, below) its place in the timeline, for this frame.\n(Editor only; the game always uses the timeline's order.)", "Dibuja esta capa tantas capas por encima (o, en negativo, por debajo) de su lugar en la línea de tiempo, durante este Frame.\n(Solo en el editor; el juego siempre usa el orden de la línea de tiempo.)", "Рисовать этот слой на столько слоёв выше (или, если отрицательно, ниже) его места на таймлайне в этом кадре.\n(Только в редакторе; игра всегда использует порядок таймлайна.)", "在此帧中,将此图层绘制在其时间轴位置之上(负数则之下)若干层。\n(仅限编辑器;游戏始终使用时间轴顺序。)", "이 프레임 동안 이 레이어를 타임라인 위치보다 지정한 수만큼 위(음수면 아래)에 그립니다.\n(편집기 전용이며, 게임은 항상 타임라인 순서를 사용합니다.)") \
|
X(TOOLTIP_DEPTH, "Draw this layer this many layers above (or, negative, below) its place in the timeline, for this frame.\n(Editor only; the game always uses the timeline's order.)", "Dibuja esta capa tantas capas por encima (o, en negativo, por debajo) de su lugar en la línea de tiempo, durante este Frame.\n(Solo en el editor; el juego siempre usa el orden de la línea de tiempo.)", "Рисовать этот слой на столько слоёв выше (или, если отрицательно, ниже) его места на таймлайне в этом кадре.\n(Только в редакторе; игра всегда использует порядок таймлайна.)", "在此帧中,将此图层绘制在其时间轴位置之上(负数则之下)若干层。\n(仅限编辑器;游戏始终使用时间轴顺序。)", "이 프레임 동안 이 레이어를 타임라인 위치보다 지정한 수만큼 위(음수면 아래)에 그립니다.\n(편집기 전용이며, 게임은 항상 타임라인 순서를 사용합니다.)") \
|
||||||
X(TOOLTIP_DETACHABLE_WINDOWS, "Windows can be dragged outside the main window into their own windows.\n(Not available on Wayland.)", "Las ventanas pueden arrastrarse fuera de la ventana principal a sus propias ventanas.\n(No disponible en Wayland.)", "Окна можно вытаскивать за пределы главного окна в отдельные окна.\n(Недоступно в Wayland.)", "可以将窗口拖出主窗口,成为独立的窗口。\n(Wayland 下不可用。)", "창을 메인 창 밖으로 끌어내 별도의 창으로 만들 수 있습니다.\n(Wayland에서는 사용할 수 없습니다.)") \
|
X(TOOLTIP_DETACHABLE_WINDOWS, "Windows can be dragged outside the main window into their own windows.\n(Not available on Wayland.)", "Las ventanas pueden arrastrarse fuera de la ventana principal a sus propias ventanas.\n(No disponible en Wayland.)", "Окна можно вытаскивать за пределы главного окна в отдельные окна.\n(Недоступно в Wayland.)", "可以将窗口拖出主窗口,成为独立的窗口。\n(Wayland 下不可用。)", "창을 메인 창 밖으로 끌어내 별도의 창으로 만들 수 있습니다.\n(Wayland에서는 사용할 수 없습니다.)") \
|
||||||
X(TOOLTIP_DOCUMENT_EXTENDED_FORMAT, "Save this document in the extended Anm2Ed format alone, instead of as a Rebirth document with the editor's copy inside.\nThe extended format is NOT compatible with The Binding of Isaac: Rebirth!", "Guarda este documento solo en el formato extendido de Anm2Ed, en vez de como documento de Rebirth con la copia del editor dentro.\n¡El formato extendido NO es compatible con The Binding of Isaac: Rebirth!", "Сохранять этот документ только в расширенном формате Anm2Ed, а не как документ Rebirth с копией редактора внутри.\nРасширенный формат НЕ совместим с The Binding of Isaac: Rebirth!", "仅以 Anm2Ed 扩展格式保存此文档,而不是保存为内含编辑器副本的 Rebirth 文档。\n扩展格式与 The Binding of Isaac: Rebirth 不兼容!", "이 문서를 편집기 사본이 들어 있는 Rebirth 문서 대신 Anm2Ed 확장 형식으로만 저장합니다.\n확장 형식은 The Binding of Isaac: Rebirth와 호환되지 않습니다!") \
|
X(TOOLTIP_DOCUMENT_EXTENDED_FORMAT, "Save this document in the extended Anm2Ed format alone, instead of as a Rebirth document with the editor's copy inside.\nThe extended format is NOT compatible with The Binding of Isaac: Rebirth!", "Guarda este documento solo en el formato extendido de Anm2Ed, en vez de como documento de Rebirth con la copia del editor dentro.\n¡El formato extendido NO es compatible con The Binding of Isaac: Rebirth!", "Сохранять этот документ только в расширенном формате Anm2Ed, а не как документ Rebirth с копией редактора внутри.\nРасширенный формат НЕ совместим с The Binding of Isaac: Rebirth!", "仅以 Anm2Ed 扩展格式保存此文档,而不是保存为内含编辑器副本的 Rebirth 文档。\n扩展格式与 The Binding of Isaac: Rebirth 不兼容!", "이 문서를 편집기 사본이 들어 있는 Rebirth 문서 대신 Anm2Ed 확장 형식으로만 저장합니다.\n확장 형식은 The Binding of Isaac: Rebirth와 호환되지 않습니다!") \
|
||||||
X(TOOLTIP_EVENT_BUILT_IN, "A built-in event: it can't be renamed, and is added to the file when a trigger first uses it.", "Un evento integrado: no se puede renombrar y se añade al archivo cuando un trigger lo usa por primera vez.", "Встроенное событие: его нельзя переименовать; оно добавляется в файл, когда триггер впервые его использует.", "内置事件:不能重命名,当触发器首次使用时添加到文件中。", "내장 이벤트: 이름을 바꿀 수 없으며 트리거가 처음 사용할 때 파일에 추가됩니다.") \
|
|
||||||
X(TOOLTIP_ISAAC_COMPATIBILITY_WARNING, "Before saving, list anything the game doesn't support and what will happen to it.", "Antes de guardar, muestra lo que el juego no soporta y lo que pasará con ello.", "Перед сохранением показывать всё, что игра не поддерживает, и что с этим произойдёт.", "保存前列出游戏不支持的内容及其处理方式。", "저장하기 전에 게임이 지원하지 않는 항목과 그 처리 방식을 알려줍니다.") \
|
X(TOOLTIP_ISAAC_COMPATIBILITY_WARNING, "Before saving, list anything the game doesn't support and what will happen to it.", "Antes de guardar, muestra lo que el juego no soporta y lo que pasará con ello.", "Перед сохранением показывать всё, что игра не поддерживает, и что с этим произойдёт.", "保存前列出游戏不支持的内容及其处理方式。", "저장하기 전에 게임이 지원하지 않는 항목과 그 처리 방식을 알려줍니다.") \
|
||||||
X(TOOLTIP_LAYER_ANIMATION, "The animation this layer plays.", "La animación que reproduce esta capa.", "Анимация, которую проигрывает этот слой.", "此图层播放的动画。", "이 레이어가 재생하는 애니메이션.") \
|
X(TOOLTIP_LAYER_ANIMATION, "The animation this layer plays.", "La animación que reproduce esta capa.", "Анимация, которую проигрывает этот слой.", "此图层播放的动画。", "이 레이어가 재생하는 애니메이션.") \
|
||||||
X(TOOLTIP_LAYER_ANIMATION_MISSING, "This layer's animation isn't in its file; it draws nothing.", "La animación de esta capa no está en su archivo; no dibuja nada.", "Анимации этого слоя нет в её файле; слой ничего не рисует.", "此图层的动画不在其文件中;它不会绘制任何内容。", "이 레이어의 애니메이션이 파일에 없어 아무것도 그리지 않습니다.") \
|
X(TOOLTIP_LAYER_ANIMATION_MISSING, "This layer's animation isn't in its file; it draws nothing.", "La animación de esta capa no está en su archivo; no dibuja nada.", "Анимации этого слоя нет в её файле; слой ничего не рисует.", "此图层的动画不在其文件中;它不会绘制任何内容。", "이 레이어의 애니메이션이 파일에 없어 아무것도 그리지 않습니다.") \
|
||||||
|
|||||||
+4
-15
@@ -438,25 +438,14 @@ TEST_CASE("skew reads from the old Shear attributes too")
|
|||||||
CHECK(frames[0].extras.attributes.empty());
|
CHECK(frames[0].extras.attributes.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("a trigger fires several events; built-in events join a file when first used")
|
TEST_CASE("a trigger fires several events; the game's copy keeps the first")
|
||||||
{
|
{
|
||||||
auto model = fixture_load("02_items.anm2");
|
auto model = fixture_load("02_items.anm2");
|
||||||
auto stopId = edit::event_id_resolve(model, model::EVENT_BUILT_IN_ID_FIRST);
|
model.frame_edit({0, TRIGGER, -1, 0})->eventIds = {1, 0};
|
||||||
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);
|
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(text).frame_get({0, TRIGGER, -1, 0})->eventIds == std::vector{1, 0});
|
||||||
CHECK(model_load(game_document_get(text)).frame_get({0, TRIGGER, -1, 0})->eventIds == std::vector{0});
|
CHECK(model_load(game_document_get(text)).frame_get({0, TRIGGER, -1, 0})->eventIds == std::vector{1});
|
||||||
CHECK(model::isaac_issues_get(model).extraEvents == 1);
|
CHECK(model::isaac_issues_get(model).extraEvents == 1);
|
||||||
|
|
||||||
// The game's copy skips built-in events for the first custom one.
|
|
||||||
model.frame_edit({0, TRIGGER, -1, 0})->eventIds = {stopId, 1};
|
|
||||||
CHECK(model_load(game_document_get(model::model_to_string(model))).frame_get({0, TRIGGER, -1, 0})->eventIds ==
|
|
||||||
std::vector{1});
|
|
||||||
CHECK(model::isaac_issues_get(model).extraEvents == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("SVG spritesheets pack and merge into SVGs")
|
TEST_CASE("SVG spritesheets pack and merge into SVGs")
|
||||||
|
|||||||
Reference in new issue
Block a user