Show faction name in HUD
This commit is contained in:
parent
8d4a9ac877
commit
d324d534c3
|
@ -289,7 +289,7 @@ minetest.register_chatcommand("area_open", {
|
|||
if areas.factions_available then
|
||||
minetest.register_chatcommand("area_faction_open", {
|
||||
params = "<ID>",
|
||||
description = "Toggle an area open/closed for members in your faction."
|
||||
description = "Toggle an area open/closed for members in your faction.",
|
||||
func = function(name, param)
|
||||
local id = tonumber(param)
|
||||
if not id then
|
||||
|
|
5
hud.lua
5
hud.lua
|
@ -21,10 +21,13 @@ minetest.register_globalstep(function(dtime)
|
|||
local areaStrings = {}
|
||||
|
||||
for id, area in pairs(areas:getAreasAtPos(pos)) do
|
||||
if area.faction_open and (areas.faction_available == false or factions.get_player_faction(area.owner) == nil) then
|
||||
area.faction_open = false
|
||||
end
|
||||
table.insert(areaStrings, ("%s [%u] (%s%s%s)")
|
||||
:format(area.name, id, area.owner,
|
||||
area.open and ":open" or "",
|
||||
area.faction_open and ":faction" or ""))
|
||||
area.faction_open and ":"..factions.get_player_faction(area.owner) or ""))
|
||||
end
|
||||
|
||||
for i, area in pairs(areas:getExternalHudEntries(pos)) do
|
||||
|
|
Loading…
Reference in New Issue