summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-23 20:34:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-23 20:34:25 +0300
commit051b5fc10eaec4f4aec1de8e79f2feae60f0e084 (patch)
tree16d14e76fa3654b99646fcf95bd91252429a05e8 /src/actions
parent0bda5a9018bb8a8b0511e86d6b0790a5b5127e42 (diff)
downloadmv-051b5fc10eaec4f4aec1de8e79f2feae60f0e084.tar.gz
mv-051b5fc10eaec4f4aec1de8e79f2feae60f0e084.tar.bz2
mv-051b5fc10eaec4f4aec1de8e79f2feae60f0e084.tar.xz
mv-051b5fc10eaec4f4aec1de8e79f2feae60f0e084.zip
Move chat command /where into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp13
-rw-r--r--src/actions/actions.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 9273de8ab..6a8ba0d5a 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -522,4 +522,17 @@ impHandler0(ipcToggle)
return true;
}
+impHandler(where)
+{
+ ChatTab *const tab = event.tab != nullptr ? event.tab : debugChatTab;
+ if (!tab)
+ return false;
+ std::ostringstream where;
+ where << Game::instance()->getCurrentMapName() << ", coordinates: "
+ << ((localPlayer->getPixelX() - mapTileSize / 2) / mapTileSize)
+ << ", " << ((localPlayer->getPixelY() - mapTileSize) / mapTileSize);
+ tab->chatLog(where.str(), ChatMsgType::BY_SERVER);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 44812e826..21085ea48 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -55,6 +55,7 @@ namespace Actions
decHandler(showWindows);
decHandler(openTrade);
decHandler(ipcToggle);
+ decHandler(where);
} // namespace Actions
#undef decHandler