fix triggers not serializing correctly
This commit is contained in:
@@ -16,7 +16,8 @@ void anm2_frame_serialize(Anm2Frame* frame, Anm2Type type, XMLDocument* document
|
|||||||
XMLDocument localDocument;
|
XMLDocument localDocument;
|
||||||
XMLDocument* useDocument = document ? document : &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)
|
if (type == ANM2_TRIGGERS)
|
||||||
{
|
{
|
||||||
|
@@ -1093,10 +1093,13 @@ static void _imgui_timeline(Imgui* self)
|
|||||||
|
|
||||||
if (ImGui::BeginDragDropTarget())
|
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 (ImGui::AcceptDragDropPayload(frameButton.drag_drop_get()))
|
||||||
if (swapReference != reference)
|
|
||||||
{
|
{
|
||||||
imgui_snapshot(self, IMGUI_ACTION_FRAME_SWAP);
|
imgui_snapshot(self, IMGUI_ACTION_FRAME_SWAP);
|
||||||
|
|
||||||
|
@@ -1319,6 +1319,8 @@ IMGUI_ITEM(IMGUI_LAYER_REMOVE,
|
|||||||
self.label = "Remove",
|
self.label = "Remove",
|
||||||
self.tooltip = "Removes the selected layer.\nThis will remove all layer animations that use this layer from all animations.",
|
self.tooltip = "Removes the selected layer.\nThis will remove all layer animations that use this layer from all animations.",
|
||||||
self.snapshotAction = "Remove Layer",
|
self.snapshotAction = "Remove Layer",
|
||||||
|
self.chord = ImGuiKey_Delete,
|
||||||
|
self.focusWindow = IMGUI_LAYERS.label,
|
||||||
self.rowCount = IMGUI_LAYERS_OPTIONS_ROW_COUNT
|
self.rowCount = IMGUI_LAYERS_OPTIONS_ROW_COUNT
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1349,6 +1351,8 @@ IMGUI_ITEM(IMGUI_NULL_REMOVE,
|
|||||||
self.label = "Remove",
|
self.label = "Remove",
|
||||||
self.tooltip = "Removes the selected null.\nThis will remove all null animations that use this null from all animations.",
|
self.tooltip = "Removes the selected null.\nThis will remove all null animations that use this null from all animations.",
|
||||||
self.snapshotAction = "Remove Null",
|
self.snapshotAction = "Remove Null",
|
||||||
|
self.chord = ImGuiKey_Delete,
|
||||||
|
self.focusWindow = IMGUI_NULLS.label,
|
||||||
self.rowCount = IMGUI_NULLS_OPTIONS_ROW_COUNT
|
self.rowCount = IMGUI_NULLS_OPTIONS_ROW_COUNT
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user