[Quest API] Add HTML color tag method to Perl and Lua. (#1324)

* Add HTML color tag method to Perl and Lua.
- Add quest::gethexcolorcode(color_name) to Perl.
- Add eq.get_hex_color_code(color_name) to Lua.

Full color list here: https://pastebin.com/rUYKr1ye

* Convert to static and use strcasecmp over strcmp.

Co-authored-by: Chris Miles <akkadius1@gmail.com>
This commit is contained in:
Alex
2021-04-23 00:52:00 -04:00
committed by GitHub
parent c18562b150
commit 13a50f7806
4 changed files with 347 additions and 0 deletions
+5
View File
@@ -2322,6 +2322,10 @@ std::string lua_seconds_to_time(int duration) {
return quest_manager.secondstotime(duration);
}
std::string lua_get_hex_color_code(std::string color_name) {
return quest_manager.gethexcolorcode(color_name);
}
#define LuaCreateNPCParse(name, c_type, default_value) do { \
cur = table[#name]; \
if(luabind::type(cur) != LUA_TNIL) { \
@@ -2863,6 +2867,7 @@ luabind::scope lua_register_general() {
luabind::def("debug", (void(*)(std::string, int))&lua_debug),
luabind::def("log_combat", (void(*)(std::string))&lua_log_combat),
luabind::def("seconds_to_time", &lua_seconds_to_time),
luabind::def("get_hex_color_code", &lua_get_hex_color_code),
/**
* Expansions