summaryrefslogtreecommitdiff
path: root/src/actions/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 12:04:45 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 12:04:45 +0300
commit1a9a7ece01b6633e1fe860cba03bfd0d895c172d (patch)
treeda2b92377903081be4746a2eb8ce5a879c334691 /src/actions/commands.cpp
parentae4062ed3c48706127c32efbc70cca0cc5ce19f8 (diff)
downloadmanaplus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.gz
manaplus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.bz2
manaplus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.xz
manaplus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.zip
Move chat command /imitation into actions.
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r--src/actions/commands.cpp14
1 files changed, 14 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