undo/redo for editing/clearing a special item

This commit is contained in:
2025-06-12 14:59:02 -05:00
parent db74edfc8b
commit 9aa348e28d
7 changed files with 109 additions and 31 deletions

View File

@@ -1444,4 +1444,12 @@ bool cItem::operator==(const cItem& other) {
CHECK_EQ(other, rechargeable);
CHECK_EQ(other, desc);
return true;
}
bool cSpecItem::operator==(const cSpecItem& other) {
CHECK_EQ(other, flags);
CHECK_EQ(other, special);
CHECK_EQ(other, name);
CHECK_EQ(other, descr);
return true;
}

View File

@@ -99,6 +99,10 @@ public:
short special = -1;
std::string name;
std::string descr;
// For detecting actual changes to special items in the scenario editor
bool operator==(const cSpecItem& other);
bool operator!=(const cSpecItem& other) { return !(*this == other); }
};
#endif