1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Minimap: Add new HUD flag for minimap radar mode

Flag default is true to not change default behaviour.
The existing minimap HUD flag remains the master control for minimap.
This commit is contained in:
paramat 2017-08-18 16:43:31 +01:00 committed by paramat
parent a3441638c6
commit 7657fe7a50
6 changed files with 33 additions and 17 deletions

View file

@ -60,12 +60,13 @@ struct EnumString es_HudElementStat[] =
struct EnumString es_HudBuiltinElement[] =
{
{HUD_FLAG_HOTBAR_VISIBLE, "hotbar"},
{HUD_FLAG_HEALTHBAR_VISIBLE, "healthbar"},
{HUD_FLAG_CROSSHAIR_VISIBLE, "crosshair"},
{HUD_FLAG_WIELDITEM_VISIBLE, "wielditem"},
{HUD_FLAG_BREATHBAR_VISIBLE, "breathbar"},
{HUD_FLAG_MINIMAP_VISIBLE, "minimap"},
{HUD_FLAG_HOTBAR_VISIBLE, "hotbar"},
{HUD_FLAG_HEALTHBAR_VISIBLE, "healthbar"},
{HUD_FLAG_CROSSHAIR_VISIBLE, "crosshair"},
{HUD_FLAG_WIELDITEM_VISIBLE, "wielditem"},
{HUD_FLAG_BREATHBAR_VISIBLE, "breathbar"},
{HUD_FLAG_MINIMAP_VISIBLE, "minimap"},
{HUD_FLAG_MINIMAP_RADAR_VISIBLE, "minimap_radar"},
{0, NULL},
};
@ -1569,6 +1570,8 @@ int ObjectRef::l_hud_get_flags(lua_State *L)
lua_setfield(L, -2, "breathbar");
lua_pushboolean(L, player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE);
lua_setfield(L, -2, "minimap");
lua_pushboolean(L, player->hud_flags & HUD_FLAG_MINIMAP_RADAR_VISIBLE);
lua_setfield(L, -2, "minimap_radar");
return 1;
}