1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-17 11:38:05 +00:00

Warnings when hitting an ally. Better warnings

This commit is contained in:
Zeno Rogue
2018-12-14 13:26:17 +01:00
parent 4370a18763
commit f22ec08f86
3 changed files with 141 additions and 75 deletions

View File

@@ -80,11 +80,14 @@ namespace dialog {
map<int, reaction_t> key_actions;
void add_action(reaction_t action) {
int& key = lastItem().key;
void add_key_action(int key, const reaction_t& action) {
while(key_actions.count(key)) key++;
key_actions[key] = action;
}
void add_action(const reaction_t& action) {
add_key_action(lastItem().key, action);
}
void handler(int sym, int uni) {
dialog::handleNavigation(sym, uni);