summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/chat.cpp23
-rw-r--r--src/actions/chat.h1
2 files changed, 22 insertions, 2 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index 3f54d0dc4..77991d038 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -33,11 +33,16 @@
#include "gui/windows/chatwindow.h"
+#include "net/charserverhandler.h"
#include "net/chathandler.h"
#include "net/guildhandler.h"
#include "net/partyhandler.h"
#include "net/serverfeatures.h"
+#include "resources/iteminfo.h"
+
+#include "resources/db/itemdb.h"
+
#include "utils/booleanoptions.h"
#include "utils/chatutils.h"
@@ -52,7 +57,7 @@ static void outString(ChatTab *const tab,
{
if (!tab)
{
- chatHandler->me(def, GENERAL_CHANNEL);
+ chatHandler->talk(def, GENERAL_CHANNEL);
return;
}
@@ -97,7 +102,7 @@ static void outString(ChatTab *const tab,
case ChatTabType::DEBUG:
case ChatTabType::BATTLE:
case ChatTabType::LANG:
- chatHandler->me(def, GENERAL_CHANNEL);
+ chatHandler->talk(def, GENERAL_CHANNEL);
break;
}
}
@@ -554,4 +559,18 @@ impHandler0(chatGuildTab)
return true;
}
+impHandler0(hat)
+{
+ if (!localPlayer)
+ return false;
+
+ const int sprite = localPlayer->getSpriteID(
+ charServerHandler->hatSprite());
+ const ItemInfo &info = ItemDB::get(sprite);
+ const std::string str = strprintf(_("equipped hat %s."),
+ info.getName().c_str());
+ outString(event.tab, str, str);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/chat.h b/src/actions/chat.h
index 9be293bb8..13906a57e 100644
--- a/src/actions/chat.h
+++ b/src/actions/chat.h
@@ -58,6 +58,7 @@ namespace Actions
decHandler(chatGmTab);
decHandler(chatPartyTab);
decHandler(chatGuildTab);
+ decHandler(hat);
} // namespace Actions
#undef decHandler