mirror of
https://github.com/tacigar/maidroid.git
synced 2025-01-10 16:20:19 +01:00
[ADD] Add wield_item slot
This commit is contained in:
parent
16befd53f2
commit
a261693f9b
@ -226,6 +226,8 @@ function maidroid.register_maidroid(product_name, def)
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
elseif listname == "core" and maidroid.is_core(stack:get_name()) then
|
elseif listname == "core" and maidroid.is_core(stack:get_name()) then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
|
elseif listname == "wield_item" then
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
return 0
|
return 0
|
||||||
end,
|
end,
|
||||||
@ -239,9 +241,17 @@ function maidroid.register_maidroid(product_name, def)
|
|||||||
update_infotext(self)
|
update_infotext(self)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
allow_take = function(inv, listname, index, stack, player)
|
||||||
|
if listname == "wield_item" then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return stack:get_count()
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
inventory:set_size("main", 16)
|
inventory:set_size("main", 16)
|
||||||
inventory:set_size("core", 1)
|
inventory:set_size("core", 1)
|
||||||
|
inventory:set_size("wield_item", 1)
|
||||||
|
|
||||||
return inventory
|
return inventory
|
||||||
end
|
end
|
||||||
@ -260,6 +270,8 @@ function maidroid.register_maidroid(product_name, def)
|
|||||||
.. "list[current_player;main;0,6.2;8,3;8]"
|
.. "list[current_player;main;0,6.2;8,3;8]"
|
||||||
.. "button[7,0.25;1,0.875;apply_name;Apply]"
|
.. "button[7,0.25;1,0.875;apply_name;Apply]"
|
||||||
.. "field[4.5,0.5;2.75,1;name;name;" .. nametag .. "]"
|
.. "field[4.5,0.5;2.75,1;name;name;" .. nametag .. "]"
|
||||||
|
.. "label[5.5,1;wield]"
|
||||||
|
.. "list[detached:"..self.inventory_name..";wield_item;5.5,1.5;1,1;]"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- on_activate is a callback function that is called when the object is created or recreated.
|
-- on_activate is a callback function that is called when the object is created or recreated.
|
||||||
|
Loading…
Reference in New Issue
Block a user