1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-02-20 15:49:44 +00:00

dialog:: addBoolItem_action, addBoolItem_action_neg, addBoolItem_choice used when applicable

This commit is contained in:
Zeno Rogue
2019-05-03 12:11:40 +02:00
parent 6fcb42d9d7
commit 3da6090320
12 changed files with 50 additions and 79 deletions

View File

@@ -1087,10 +1087,15 @@ namespace dialog {
dialog::display();
}
void addBoolItem_action(const string& s, bool& b, char c) {
void addBoolItem_action(const string& s, bool& b, char c) {
dialog::addBoolItem(s, b, c);
dialog::add_action([&b] { b = !b; });
}
void addBoolItem_action_neg(const string& s, bool& b, char c) {
dialog::addBoolItem(s, !b, c);
dialog::add_action([&b] { b = !b; });
}
};
}