[nostalgia/core/studio] Cleanup

This commit is contained in:
2022-03-05 17:49:12 -06:00
parent f40c912365
commit b225d976f5
5 changed files with 10 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ TileSheetEditorImGui::TileSheetEditorImGui(Context *ctx, const ox::String &path)
const auto lastSlash = std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset();
m_itemName = m_itemPath.substr(lastSlash + 1);
undoStack()->changeTriggered.connect(this, &TileSheetEditorImGui::markUnsavedChanges);
m_subsheetEditor.inputSubmitted.connect(model(), &TileSheetEditorModel::updateActiveSubsheet);
m_subsheetEditor.inputSubmitted.connect(this, &TileSheetEditorImGui::updateActiveSubsheet);
}
ox::String TileSheetEditorImGui::itemName() const noexcept {
@@ -232,6 +232,10 @@ void TileSheetEditorImGui::drawPalettePicker() noexcept {
}
}
ox::Error TileSheetEditorImGui::updateActiveSubsheet(const ox::String &name, int cols, int rows) noexcept {
return model()->updateSubsheet(model()->activeSubSheetIdx(), name, cols, rows);
}
ox::Error TileSheetEditorImGui::markUnsavedChanges(int) noexcept {
setUnsavedChanges(true);
return OxError(0);