[nostalgia/core/studio] Add support for TileSheetEditor unsaved changes status
This commit is contained in:
parent
bc9b896d3d
commit
9b1275e704
@ -17,6 +17,7 @@ TileSheetEditorImGui::TileSheetEditorImGui(Context *ctx, const ox::String &path)
|
|||||||
m_itemPath = path;
|
m_itemPath = path;
|
||||||
const auto lastSlash = std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset();
|
const auto lastSlash = std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset();
|
||||||
m_itemName = m_itemPath.substr(lastSlash + 1);
|
m_itemName = m_itemPath.substr(lastSlash + 1);
|
||||||
|
undoStack()->changeTriggered.connect(this, &TileSheetEditorImGui::markUnsavedChanges);
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::String TileSheetEditorImGui::itemName() const noexcept {
|
ox::String TileSheetEditorImGui::itemName() const noexcept {
|
||||||
@ -142,4 +143,10 @@ void TileSheetEditorImGui::drawPalettePicker() noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ox::Error TileSheetEditorImGui::markUnsavedChanges() noexcept {
|
||||||
|
oxDebug("markUnsavedChanges");
|
||||||
|
setUnsavedChanges(true);
|
||||||
|
return OxError(0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -69,16 +69,12 @@ class TileSheetEditorImGui: public studio::Editor {
|
|||||||
|
|
||||||
void drawPalettePicker() noexcept;
|
void drawPalettePicker() noexcept;
|
||||||
|
|
||||||
// slots
|
|
||||||
public:
|
|
||||||
ox::Error colorSelected() noexcept;
|
|
||||||
|
|
||||||
ox::Error setColorTable() noexcept;
|
|
||||||
|
|
||||||
// slots
|
// slots
|
||||||
private:
|
private:
|
||||||
ox::Error updateAfterClicked() noexcept;
|
ox::Error updateAfterClicked() noexcept;
|
||||||
|
|
||||||
|
ox::Error markUnsavedChanges() noexcept;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
public:
|
public:
|
||||||
TileSheetEditorModel(Context *ctx, const ox::String &path);
|
TileSheetEditorModel(Context *ctx, const ox::String &path);
|
||||||
|
|
||||||
~TileSheetEditorModel() = default;
|
~TileSheetEditorModel() override = default;
|
||||||
|
|
||||||
void cut();
|
void cut();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user