From 051b5fc10eaec4f4aec1de8e79f2feae60f0e084 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Aug 2014 20:34:25 +0300 Subject: Move chat command /where into actions. --- src/actions/actions.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/actions/actions.cpp') 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 -- cgit v1.2.3-70-g09d2