Fix some bugs
- HUD healthbars should no longer be off - renaming and re-colouring your party should no longer rename everyone's nametag to the leader'smaster
parent
fac8eaebdf
commit
77b35edd2d
37
init.lua
37
init.lua
|
@ -535,6 +535,7 @@ minetest.register_chatcommand("p", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if party.check_tag(name, param2) == true then
|
if party.check_tag(name, param2) == true then
|
||||||
|
party.send_notice(name, "Party name selected already exists. Please choose another one.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- if not, apply rename
|
-- if not, apply rename
|
||||||
|
@ -550,9 +551,9 @@ minetest.register_chatcommand("p", {
|
||||||
local names = players:get_player_name()
|
local names = players:get_player_name()
|
||||||
local csquad = mod_storage:get_string(names.."_squad")
|
local csquad = mod_storage:get_string(names.."_squad")
|
||||||
if mod_storage:get_string(names.."_party") == cparty and csquad == "" then
|
if mod_storage:get_string(names.."_party") == cparty and csquad == "" then
|
||||||
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..param2.."]").." "..name})
|
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..param2.."]").." "..names})
|
||||||
elseif mod_storage:get_string(names.."_party") == cparty and csquad ~= "" then
|
elseif mod_storage:get_string(names.."_party") == cparty and csquad ~= "" then
|
||||||
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..param2.."-"..csquad.."]").." "..name})
|
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..param2.."-"..csquad.."]").." "..names})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -573,9 +574,9 @@ minetest.register_chatcommand("p", {
|
||||||
local names = players:get_player_name()
|
local names = players:get_player_name()
|
||||||
local csquad = mod_storage:get_string(names.."_squad")
|
local csquad = mod_storage:get_string(names.."_squad")
|
||||||
if mod_storage:get_string(names.."_party") == cparty and csquad == "" then
|
if mod_storage:get_string(names.."_party") == cparty and csquad == "" then
|
||||||
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..cparty_l.."]").." "..name})
|
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..cparty_l.."]").." "..names})
|
||||||
elseif mod_storage:get_string(names.."_party") == cparty and csquad ~= "" then
|
elseif mod_storage:get_string(names.."_party") == cparty and csquad ~= "" then
|
||||||
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..cparty_l.."-"..csquad.."]").." "..name})
|
players:set_nametag_attributes({text = minetest.colorize(tcolour, "["..cparty_l.."-"..csquad.."]").." "..names})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -664,6 +665,34 @@ minetest.register_chatcommand("p", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
elseif param1 == "diplo" then
|
||||||
|
-- check if player is in party
|
||||||
|
-- if so send list of allies
|
||||||
|
-- send list of enemies
|
||||||
|
if param2 ~= nil and param3 ~= nil then
|
||||||
|
-- check if player is leader
|
||||||
|
if party.check(name, 3) == true then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- check if party actually exists
|
||||||
|
if party.check_tag(name, param2) ~= true then
|
||||||
|
party.send_notice(name, "Party does not exist! Case sensitive!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------
|
||||||
|
if param3 == "ally" then
|
||||||
|
|
||||||
|
elseif param3 == "war" then
|
||||||
|
|
||||||
|
elseif param3 == "neutral" then
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- /p kick
|
-- /p kick
|
||||||
elseif param1 == "kick" and param2 ~= nil then
|
elseif param1 == "kick" and param2 ~= nil then
|
||||||
if party.check(name, 2) == true then
|
if party.check(name, 2) == true then
|
||||||
|
|
16
squad.lua
16
squad.lua
|
@ -65,8 +65,8 @@ squad.load_hud_self = function(name)
|
||||||
text = "party_heart_background.png",
|
text = "party_heart_background.png",
|
||||||
number = 0,
|
number = 0,
|
||||||
size = {x=22, y=22},
|
size = {x=22, y=22},
|
||||||
position = { x = 0.01, y = 0.8 },
|
position = { x = 0.01, y = 0.87 + (i*-0.07) },
|
||||||
offset = { x = 0, y = 50 + (i*-50) },
|
offset = { x = 0, y = 0 },
|
||||||
direction = 0,
|
direction = 0,
|
||||||
})
|
})
|
||||||
ids_hp[name.."_"..cparty.."_hp_"..csquad.."_"..i] = player:hud_add({
|
ids_hp[name.."_"..cparty.."_hp_"..csquad.."_"..i] = player:hud_add({
|
||||||
|
@ -74,29 +74,29 @@ squad.load_hud_self = function(name)
|
||||||
text = "party_heart.png",
|
text = "party_heart.png",
|
||||||
number = 0,
|
number = 0,
|
||||||
size = {x=22, y=22},
|
size = {x=22, y=22},
|
||||||
position = { x = 0.01, y = 0.8 },
|
position = { x = 0.01, y = 0.87 + (i*-0.07) },
|
||||||
offset = { x = 0, y = 50 + (i*-50) },
|
offset = { x = 0, y = 0 },
|
||||||
direction = 0,
|
direction = 0,
|
||||||
})
|
})
|
||||||
ids_hptag[name.."_"..cparty.."_hptag_"..csquad.."_"..i] = player:hud_add({
|
ids_hptag[name.."_"..cparty.."_hptag_"..csquad.."_"..i] = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = { x = 0.01 , y = 0.8 },
|
position = { x = 0.01 , y = 0.87 + (i*-0.07) },
|
||||||
alignment = 0,
|
alignment = 0,
|
||||||
name = "text",
|
name = "text",
|
||||||
number = 0xFFFFFF,
|
number = 0xFFFFFF,
|
||||||
text = "",
|
text = "",
|
||||||
alignment = {x=1,y=0},
|
alignment = {x=1,y=0},
|
||||||
offset = { x = 5, y = 46.5 + (i*-37.5) },
|
offset = { x = 5, y = 9 },
|
||||||
})
|
})
|
||||||
ids_tag[name.."_"..cparty.."_tag_"..csquad.."_"..i] = player:hud_add({
|
ids_tag[name.."_"..cparty.."_tag_"..csquad.."_"..i] = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = { x = 0.01 , y = 0.8 },
|
position = { x = 0.01 , y = 0.87 + (i*-0.07) },
|
||||||
alignment = 0,
|
alignment = 0,
|
||||||
name = "text",
|
name = "text",
|
||||||
number = 0x00FF00,
|
number = 0x00FF00,
|
||||||
text = "",
|
text = "",
|
||||||
alignment = {x=1,y=0},
|
alignment = {x=1,y=0},
|
||||||
offset = { x = 0, y = 29.5 + (i*-37.5) },
|
offset = { x = 0, y = -8 },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue