forked from VoxeLibre/VoxeLibre
Merge branch 'master' into totem_particles
This commit is contained in:
commit
0795862c5c
|
@ -0,0 +1,2 @@
|
||||||
|
# Text Editor TMP Files
|
||||||
|
*.swp
|
|
@ -121,8 +121,52 @@ pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:enderman"
|
||||||
pumpkin_face_base_def._mcl_armor_element = "head"
|
pumpkin_face_base_def._mcl_armor_element = "head"
|
||||||
pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png"
|
pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png"
|
||||||
pumpkin_face_base_def._mcl_armor_preview = "mcl_farming_pumpkin_face_preview.png"
|
pumpkin_face_base_def._mcl_armor_preview = "mcl_farming_pumpkin_face_preview.png"
|
||||||
|
|
||||||
if minetest.get_modpath("mcl_armor") then
|
if minetest.get_modpath("mcl_armor") then
|
||||||
|
local pumpkin_hud = {}
|
||||||
|
local function add_pumpkin_hud(player)
|
||||||
|
pumpkin_hud[player] = {
|
||||||
|
pumpkin_blur = player:hud_add({
|
||||||
|
hud_elem_type = "image",
|
||||||
|
position = {x = 0.5, y = 0.5},
|
||||||
|
scale = {x = -100, y = -100},
|
||||||
|
text = "mcl_farming_pumpkin_hud.png",
|
||||||
|
z_index = -200
|
||||||
|
}),
|
||||||
|
--this is a fake crosshair, because hotbar and crosshair doesn't support z_index
|
||||||
|
--TODO: remove this and add correct z_index values
|
||||||
|
fake_crosshair = player:hud_add({
|
||||||
|
hud_elem_type = "image",
|
||||||
|
position = {x = 0.5, y = 0.5},
|
||||||
|
scale = {x = 1, y = 1},
|
||||||
|
text = "crosshair.png",
|
||||||
|
z_index = -100
|
||||||
|
})
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local function remove_pumpkin_hud(player)
|
||||||
|
if pumpkin_hud[player] then
|
||||||
|
player:hud_remove(pumpkin_hud[player].pumpkin_blur)
|
||||||
|
player:hud_remove(pumpkin_hud[player].fake_crosshair)
|
||||||
|
pumpkin_hud[player] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
pumpkin_face_base_def.on_secondary_use = mcl_armor.equip_on_use
|
pumpkin_face_base_def.on_secondary_use = mcl_armor.equip_on_use
|
||||||
|
pumpkin_face_base_def._on_equip = add_pumpkin_hud
|
||||||
|
pumpkin_face_base_def._on_unequip = remove_pumpkin_hud
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
if player:get_inventory():get_stack("armor", 2):get_name() == "mcl_farming:pumpkin_face" then
|
||||||
|
add_pumpkin_hud(player)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minetest.register_on_dieplayer(function(player)
|
||||||
|
remove_pumpkin_hud(player)
|
||||||
|
end)
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
pumpkin_hud[player] = nil
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register stem growth
|
-- Register stem growth
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Loading…
Reference in New Issue