Add 3d_armor_light support
parent
999fd7925f
commit
3840b65a62
|
@ -25,6 +25,7 @@ Right-click the equipment examiner node & place an item into its inventory slot
|
|||
- [![wielded_light](https://img.shields.io/static/v1?label=ContentDB&message=wielded_light&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/bell07/wielded_light/)
|
||||
- [![workbench](https://img.shields.io/static/v1?label=GitHub&message=workbench&color=%23375a7f&logo=minetest)](https://github.com/AntumMT/mod-workbench)
|
||||
- [![xdecor](https://img.shields.io/static/v1?label=ContentDB&message=xdecor&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/jp/xdecor/)
|
||||
- [![3d_armor_light](https://img.shields.io/static/v1?label=ContentDB&message=3d_armor_light&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/AntumDeluge/3d_armor_light/)
|
||||
|
||||
#### Other Mod Support:
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ v1.6
|
|||
- xdecor (Git commit 0dbf92e)
|
||||
- wielded_light v2021-07-15
|
||||
- removed abandoned wlight support
|
||||
- added 3d_armor_light support
|
||||
|
||||
v1.5
|
||||
----
|
||||
|
|
26
formspec.lua
26
formspec.lua
|
@ -3,14 +3,17 @@ local S = core.get_translator(equip_exam.name)
|
|||
|
||||
|
||||
-- wielded_light support
|
||||
local function get_light_def(id)
|
||||
return
|
||||
end
|
||||
|
||||
local function get_light_def(id) end
|
||||
if core.global_exists("wielded_light") and wielded_light.get_light_def then
|
||||
get_light_def = wielded_light.get_light_def
|
||||
end
|
||||
|
||||
-- 3d_armor_light support
|
||||
local function is_lighted_armor(id) end
|
||||
if core.global_exists("armor_light") and armor_light.is_lighted then
|
||||
is_lighted_armor = armor_light.is_lighted
|
||||
end
|
||||
|
||||
-- workbench support
|
||||
local workbench_repairable
|
||||
if core.global_exists("workbench") and workbench.repairable then
|
||||
|
@ -346,12 +349,19 @@ local function get_item_specs(item, technical)
|
|||
|
||||
local light_level = get_light_def(id)
|
||||
if light_level and light_level > 0 then
|
||||
item_types.tool = true
|
||||
if not technical then
|
||||
table.insert(specs_tool, S("emits light: @1", S("yes")))
|
||||
local spec_list, type_list = specs_tool, tool_types
|
||||
if is_lighted_armor(id) then
|
||||
item_types.armor = true
|
||||
spec_list, type_list = specs_armor, armor_types
|
||||
else
|
||||
item_types.tool = true
|
||||
end
|
||||
|
||||
table.insert(specs_tool, format_spec(tool_types, "light level", light_level, technical))
|
||||
if not technical then
|
||||
table.insert(spec_list, S("emits light: @1", S("yes")))
|
||||
end
|
||||
|
||||
table.insert(spec_list, format_spec(type_list, "light level", light_level, technical))
|
||||
end
|
||||
|
||||
local colorable = groups.ud_param2_colorable ~= nil
|
||||
|
|
Loading…
Reference in New Issue