diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 12:04:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 12:04:45 +0300 |
commit | 1a9a7ece01b6633e1fe860cba03bfd0d895c172d (patch) | |
tree | da2b92377903081be4746a2eb8ce5a879c334691 /src/actions | |
parent | ae4062ed3c48706127c32efbc70cca0cc5ce19f8 (diff) | |
download | ManaVerse-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.gz ManaVerse-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.bz2 ManaVerse-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.xz ManaVerse-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.zip |
Move chat command /imitation into actions.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/commands.cpp | 14 | ||||
-rw-r--r-- | src/actions/commands.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 29e7e740c..29414b18d 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -409,4 +409,18 @@ impHandler(navigate) return true; } +impHandler(imitation) +{ + if (!localPlayer) + return false; + + if (!event.args.empty()) + localPlayer->setImitate(event.args); + else if (event.tab && event.tab->getType() == ChatTabType::WHISPER) + localPlayer->setImitate(static_cast<WhisperTab*>(event.tab)->getNick()); + else + localPlayer->setImitate(""); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index f5f4b4a5e..fbee9e125 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -47,6 +47,7 @@ namespace Actions decHandler(pseudoAway); decHandler(follow); decHandler(navigate); + decHandler(imitation); } // namespace Actions #undef decHandler |