Skip to content

Commit

Permalink
Make hud_get return aligment, offset and size. (#7006)
Browse files Browse the repository at this point in the history
* Make hud_get return aligment and offset.

* Return size aswell.
  • Loading branch information
lisacvuk authored and nerzhul committed Feb 4, 2018
1 parent 735fc2a commit 4f5090f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/script/common/c_content.cpp
Expand Up @@ -1865,6 +1865,15 @@ void push_hud_element(lua_State *L, HudElement *elem)
lua_pushnumber(L, elem->dir);
lua_setfield(L, -2, "direction");

push_v2f(L, elem->offset);
lua_setfield(L, -2, "offset");

push_v2f(L, elem->align);
lua_setfield(L, -2, "alignment");

push_v2s32(L, elem->size);
lua_setfield(L, -2, "size");

// Deprecated, only for compatibility's sake
lua_pushnumber(L, elem->dir);
lua_setfield(L, -2, "dir");
Expand Down

0 comments on commit 4f5090f

Please sign in to comment.