From dabdb65631b7915ba79ea91c3f79d72381b0691e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 19 Aug 2016 20:28:01 +0300 Subject: Add chat command guildnotice for set guild notice message. --- src/actions/chat.cpp | 15 +++++++++++++++ src/actions/chat.h | 1 + src/dyetool/actions/chat.cpp | 1 + src/enums/input/inputaction.h | 1 + src/input/inputactionmap.h | 6 ++++++ 5 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index a3fcef632..a8a7ac827 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -646,4 +646,19 @@ impHandler(chatClipboard) return false; } +impHandler(guildNotice) +{ + if (!localPlayer) + return false; + const std::string args = event.args; + const std::string str1 = args.substr(0, 60); + std::string str2(""); + if (args.size() > 60) + str2 = args.substr(60); + const Guild *const guild = localPlayer->getGuild(); + if (guild) + guildHandler->changeNotice(guild->getId(), str1, str2); + return true; +} + } // namespace Actions diff --git a/src/actions/chat.h b/src/actions/chat.h index 158de5580..b90b97173 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -60,6 +60,7 @@ namespace Actions decHandler(chatGuildTab); decHandler(hat); decHandler(chatClipboard); + decHandler(guildNotice); } // namespace Actions #undef decHandler diff --git a/src/dyetool/actions/chat.cpp b/src/dyetool/actions/chat.cpp index 9d54e2771..1e14e75d7 100644 --- a/src/dyetool/actions/chat.cpp +++ b/src/dyetool/actions/chat.cpp @@ -60,5 +60,6 @@ impHandlerVoid(chatPartyTab) impHandlerVoid(chatGuildTab) impHandlerVoid(hat) impHandlerVoid(chatClipboard) +impHandlerVoid(guildNotice) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index 27b0974f9..4bf981256 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -680,6 +680,7 @@ enumStart(InputAction) SET_SKILL_OFFSET_X, SET_SKILL_OFFSET_Y, LEAVE_GUILD, + GUILD_NOTICE, TOTAL } enumEnd(InputAction); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index bff086cd3..31c2240eb 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5570,6 +5570,12 @@ static const InputActionData inputActionData "leaveguild|guildleave", UseArgs_false, Protected_true}, + {"keyGuildNotice", + defaultAction(&Actions::guildNotice), + InputCondition::INGAME, + "notice|guildnotice", + UseArgs_true, + Protected_true}, }; #undef defaultAction -- cgit v1.2.3-60-g2f50