summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-24 11:56:53 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-24 11:56:53 -0700
commita2dc72e6f957f8e44713eaedd93fd32b69f360fa (patch)
tree03f6c43b36f67ec1c7dbec4f8e6abdcd9490572c /src/map
parent65ad442a3d8e370a590ec44b2c82f5af902f8d01 (diff)
downloadtmwa-a2dc72e6f957f8e44713eaedd93fd32b69f360fa.tar.gz
tmwa-a2dc72e6f957f8e44713eaedd93fd32b69f360fa.tar.bz2
tmwa-a2dc72e6f957f8e44713eaedd93fd32b69f360fa.tar.xz
tmwa-a2dc72e6f957f8e44713eaedd93fd32b69f360fa.zip
Show level of GM commands in @help
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 403520e..c8826f7 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -357,6 +357,19 @@ int atcommand_config_read(ZString cfgName)
/// @ command processing functions
static
+void atc_do_help(const int fd, const char *cmd, const AtCommandInfo& info)
+{
+ auto msg = STRPRINTF("\u2007\u2007%d: @%s %s", info.level, cmd, info.args);
+ // manually padding because *space*
+ size_t ll = 1;
+ if (info.level >= 10)
+ ++ll;
+ if (info.level >= 100)
+ ++ll;
+ clif_displaymessage(fd, msg.xslice_t((ll - 1) * 3));
+}
+
+static
ATCE atcommand_help(const int fd, dumb_ptr<map_session_data>,
ZString message)
{
@@ -386,7 +399,7 @@ ATCE atcommand_help(const int fd, dumb_ptr<map_session_data>,
{
const char *cmd = &*pair.first.begin();
const AtCommandInfo& info = pair.second;
- clif_displaymessage(fd, STRPRINTF("@%s %s", cmd, info.args));
+ atc_do_help(fd, cmd, info);
}
return ATCE::OKAY;
}
@@ -405,7 +418,7 @@ ATCE atcommand_help(const int fd, dumb_ptr<map_session_data>,
const char *cmd = &*pair.first.begin();
const AtCommandInfo& info = pair.second;
if (low <= info.level && info.level < high)
- clif_displaymessage(fd, STRPRINTF("@%s %s", cmd, info.args));
+ atc_do_help(fd, cmd, info);
}
return ATCE::OKAY;
}