diff options
-rw-r--r-- | doc/script_commands.txt | 6 | ||||
-rw-r--r-- | src/map/script.c | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index d14393a8a..72f86024e 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -9172,6 +9172,12 @@ currently used font is used, default interface font is used again. --------------------------------------- +*getfont() + +This command return the player's current font. +if no player is attached it would always return a 0, which is also the default font. + +---------------------------------------' *showdigit(<value>{, <type>}) Displays given numeric 'value' in large digital clock font on top of the diff --git a/src/map/script.c b/src/map/script.c index 8658b7ab5..64b794ba0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -22744,6 +22744,19 @@ static BUILDIN(setfont) return true; } +static BUILDIN(getfont) +{ + struct map_session_data *sd = script->rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return true; + } + + script_pushint(st, sd->status.font); + return true; +} + static int buildin_mobuseskill_sub(struct block_list *bl, va_list ap) { struct mob_data *md = NULL; @@ -26356,6 +26369,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(mercenary_set_faith,"ii"), BUILDIN_DEF(readbook,"ii"), BUILDIN_DEF(setfont,"i"), + BUILDIN_DEF(getfont, ""), BUILDIN_DEF(areamobuseskill,"siiiiviiiii"), BUILDIN_DEF(progressbar,"si"), BUILDIN_DEF(progressbar_unit,"si?"), |