summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-01 04:14:07 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-01 04:14:07 +0000
commit6de70cf88cbd8413f6a691524cf60f7f5b337281 (patch)
treebe7688daad1fa1c1a5d334bcd3b3ac207c34fa2f /src
parentf46ab0d6f9bcb08567b11dc1690da11e325b5897 (diff)
downloadhercules-6de70cf88cbd8413f6a691524cf60f7f5b337281.tar.gz
hercules-6de70cf88cbd8413f6a691524cf60f7f5b337281.tar.bz2
hercules-6de70cf88cbd8413f6a691524cf60f7f5b337281.tar.xz
hercules-6de70cf88cbd8413f6a691524cf60f7f5b337281.zip
- Changed the column spacing in @go (town list) and @job (jobname list) so it lines up for Arial font, instead of fixed-width fonts.
- Follow up to r15907, made atcommand_help_string() convert alias to real command name before looking up in help.txt - Moved the list of jobs to help.txt and converted @job to utilize atcommand_help_string(). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16729 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c352a729c..b334d7542 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -173,16 +173,19 @@ void do_final_msg(void)
* @param name the name of the command to retrieve help information for
* @return the string associated with the command, or NULL
*/
-static const char* atcommand_help_string(const char* name)
+static const char* atcommand_help_string(const char* command)
{
const char* str = NULL;
config_setting_t* info;
- if( *name == atcommand_symbol || *name == charcommand_symbol )
+ if( *command == atcommand_symbol || *command == charcommand_symbol )
{// remove the prefix symbol for the raw name of the command
- name ++;
+ command ++;
}
+ // convert alias to the real command name
+ command = atcommand_checkalias(command);
+
// attept to find the first default help command
info = config_lookup(&atcommand_config, "help");
@@ -191,7 +194,7 @@ static const char* atcommand_help_string(const char* name)
return NULL;
}
- if( !config_setting_lookup_string( info, name, &str ) )
+ if( !config_setting_lookup_string( info, command, &str ) )
{// failed to find the matching help string
return NULL;
}
@@ -991,6 +994,7 @@ ACMD_FUNC(jobchange)
{
//FIXME: redundancy, potentially wrong code, should use job_name() or similar instead of hardcoding the table [ultramage]
int job = 0, upper = 0;
+ const char* text;
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%d %d", &job, &upper) < 1)
@@ -1137,13 +1141,9 @@ ACMD_FUNC(jobchange)
}
}
- // TODO: convert this to use atcommand_help_string()
if (!found) {
- int i;
- for (i = 922; i <= 966; ++i)
- clif_displaymessage(fd, msg_txt(i));
- clif_displaymessage(fd, msg_txt(967)); // ---- Modes And Others ----
- clif_displaymessage(fd, msg_txt(968)); // 22 Wedding 26 Christmas 27 Summer 4048 Star Gladiator (Union)
+ text = atcommand_help_string(command);
+ if (text) clif_displaymessage(fd, text);
return -1;
}
}
@@ -1163,12 +1163,8 @@ ACMD_FUNC(jobchange)
return -1;
}
} else {
- // TODO: convert this to use atcommand_help_string()
- int i;
- for (i = 922; i <= 966; ++i)
- clif_displaymessage(fd, msg_txt(i));
- clif_displaymessage(fd, msg_txt(967)); // ---- Modes And Others ----
- clif_displaymessage(fd, msg_txt(968)); // 22 Wedding 26 Christmas 27 Summer 4048 Star Gladiator (Union)
+ text = atcommand_help_string(command);
+ if (text) clif_displaymessage(fd, text);
return -1;
}