fix triggers not serializing correctly

This commit is contained in:
2025-09-12 18:39:09 -04:00
parent f8fb3df8d4
commit 3da8928d13
3 changed files with 12 additions and 4 deletions

View File

@@ -16,7 +16,8 @@ void anm2_frame_serialize(Anm2Frame* frame, Anm2Type type, XMLDocument* document
XMLDocument localDocument;
XMLDocument* useDocument = document ? document : &localDocument;
XMLElement* element = useDocument->NewElement(ANM2_ELEMENT_STRINGS[ANM2_ELEMENT_FRAME]);
XMLElement* element = type == ANM2_TRIGGERS ? useDocument->NewElement(ANM2_ELEMENT_STRINGS[ANM2_ELEMENT_TRIGGERS]) :
useDocument->NewElement(ANM2_ELEMENT_STRINGS[ANM2_ELEMENT_FRAME]);
if (type == ANM2_TRIGGERS)
{

View File

@@ -1093,10 +1093,13 @@ static void _imgui_timeline(Imgui* self)
if (ImGui::BeginDragDropTarget())
{
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(frameButton.drag_drop_get()))
Anm2Reference swapReference;
if (const ImGuiPayload* payload = ImGui::GetDragDropPayload())
swapReference = *(Anm2Reference*)payload->Data;
if (swapReference != reference && reference.itemType == swapReference.itemType)
{
Anm2Reference swapReference = *(Anm2Reference*)payload->Data;
if (swapReference != reference)
if (ImGui::AcceptDragDropPayload(frameButton.drag_drop_get()))
{
imgui_snapshot(self, IMGUI_ACTION_FRAME_SWAP);

View File

@@ -1319,6 +1319,8 @@ IMGUI_ITEM(IMGUI_LAYER_REMOVE,
self.label = "Remove",
self.tooltip = "Removes the selected layer.\nThis will remove all layer animations that use this layer from all animations.",
self.snapshotAction = "Remove Layer",
self.chord = ImGuiKey_Delete,
self.focusWindow = IMGUI_LAYERS.label,
self.rowCount = IMGUI_LAYERS_OPTIONS_ROW_COUNT
);
@@ -1349,6 +1351,8 @@ IMGUI_ITEM(IMGUI_NULL_REMOVE,
self.label = "Remove",
self.tooltip = "Removes the selected null.\nThis will remove all null animations that use this null from all animations.",
self.snapshotAction = "Remove Null",
self.chord = ImGuiKey_Delete,
self.focusWindow = IMGUI_NULLS.label,
self.rowCount = IMGUI_NULLS_OPTIONS_ROW_COUNT
);