Clean up UI, work on tutorial
This commit is contained in:
1 parent
cfbd29d5b1
commit
619de45221
79 files changed
+5122
-316
No files matched your search
@@ -15,6 +15,7 @@ namespace ZL {
|
||||
[&itemId](const Item& item) { return item.id == itemId; });
|
||||
if (it != items.end()) {
|
||||
std::cout << "Item removed from inventory: " << it->name << std::endl;
|
||||
if (onItemRemoved) onItemRemoved(itemId);
|
||||
items.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -31,8 +31,9 @@ namespace ZL {
|
||||
void clear() { items.clear(); }
|
||||
size_t getCount() const { return items.size(); }
|
||||
|
||||
// Called whenever an item is added; receives the item id.
|
||||
// Called whenever an item is added/removed; receives the item id.
|
||||
std::function<void(const std::string&)> onItemAdded;
|
||||
std::function<void(const std::string&)> onItemRemoved;
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
Reference in new issue
Block a user