summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index a0b45982a..235016be0 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -1928,6 +1928,8 @@ void read_hud_element(lua_State *L, HudElement *elem)
elem->world_pos = lua_istable(L, -1) ? read_v3f(L, -1) : v3f();
lua_pop(L, 1);
+ elem->style = getintfield_default(L, 2, "style", 0);
+
/* check for known deprecated element usage */
if ((elem->type == HUD_ELEM_STATBAR) && (elem->size == v2s32()))
log_deprecated(L,"Deprecated usage of statbar without size!");
@@ -1982,6 +1984,9 @@ void push_hud_element(lua_State *L, HudElement *elem)
lua_pushstring(L, elem->text2.c_str());
lua_setfield(L, -2, "text2");
+
+ lua_pushinteger(L, elem->style);
+ lua_setfield(L, -2, "style");
}
HudElementStat read_hud_change(lua_State *L, HudElement *elem, void **value)
@@ -2050,6 +2055,10 @@ HudElementStat read_hud_change(lua_State *L, HudElement *elem, void **value)
elem->text2 = luaL_checkstring(L, 4);
*value = &elem->text2;
break;
+ case HUD_STAT_STYLE:
+ elem->style = luaL_checknumber(L, 4);
+ *value = &elem->style;
+ break;
}
return stat;
}