diff --git a/src/nostalgia/core/studio/tilesheeteditormodel.cpp b/src/nostalgia/core/studio/tilesheeteditormodel.cpp index 48f29d15..85c8e32d 100644 --- a/src/nostalgia/core/studio/tilesheeteditormodel.cpp +++ b/src/nostalgia/core/studio/tilesheeteditormodel.cpp @@ -16,8 +16,7 @@ TileSheetEditorModel::TileSheetEditorModel(Context *ctx, const ox::String &path) oxRequireT(img, readObj(ctx, path.c_str())); m_img = *img; oxThrowError(readObj(ctx, m_img.defaultPalette).moveTo(&m_pal)); - m_undoStack.undoTriggered.connect(this, &TileSheetEditorModel::markUpdated); - m_undoStack.redoTriggered.connect(this, &TileSheetEditorModel::markUpdated); + m_undoStack.changeTriggered.connect(this, &TileSheetEditorModel::markUpdated); } void TileSheetEditorModel::cut() { @@ -58,8 +57,8 @@ void TileSheetEditorModel::ackUpdate() noexcept { } ox::Error TileSheetEditorModel::saveFile() noexcept { - oxRequire(buff, ox::writeClaw(&m_img)); - oxReturnError(m_ctx->rom->write(m_path.c_str(), buff.data(), buff.size())); + auto sctx = applicationData(m_ctx); + oxReturnError(sctx->project->writeObj(m_path, &m_img)); return m_ctx->assetManager.setAsset(m_path, m_img).error; } @@ -101,4 +100,4 @@ void TileSheetEditorModel::pushCommand(studio::UndoCommand *cmd) noexcept { m_updated = true; } -} \ No newline at end of file +}