undo/redo for edit/clear quest

This commit is contained in:
2025-06-12 15:17:08 -05:00
parent 9aa348e28d
commit 71629e45bd
8 changed files with 108 additions and 18 deletions

15
src/scenario/quest.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "quest.hpp"
bool cQuest::operator==(const cQuest& other) {
CHECK_EQ(other, deadline_is_relative);
CHECK_EQ(other, auto_start);
CHECK_EQ(other, deadline);
CHECK_EQ(other, event);
CHECK_EQ(other, xp);
CHECK_EQ(other, gold);
CHECK_EQ(other, bank1);
CHECK_EQ(other, bank2);
CHECK_EQ(other, name);
CHECK_EQ(other, descr);
return true;
}

View File

@@ -21,6 +21,10 @@ public:
short bank1 = -1, bank2 = -1; // which job bank(s) this quest is in; -1 for none
std::string name;
std::string descr;
// For detecting actual changes to quests in the scenario editor
bool operator==(const cQuest& other);
bool operator!=(const cQuest& other) { return !(*this == other); }
};
class cJob {