Removed abandoned wlight support
parent
b08e3db327
commit
999fd7925f
|
@ -22,7 +22,6 @@ Right-click the equipment examiner node & place an item into its inventory slot
|
|||
- Optional depends:
|
||||
- [![default](https://img.shields.io/static/v1?label=GitHub&message=default&color=%23375a7f&logo=github)](https://github.com/minetest/minetest_game/tree/master/mods/default) *(required for craft recipe)*
|
||||
- [![basic_materials](https://img.shields.io/static/v1?label=ContentDB&message=basic_materials&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/VanessaE/basic_materials/)
|
||||
- [![wlight](https://img.shields.io/static/v1?label=ContentDB&message=wlight&color=%23375a7f&logo=minetest)](https://content.minetest.net/packages/AntumDeluge/wlight/)
|
||||
- [![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/)
|
||||
|
|
1
TODO.txt
1
TODO.txt
|
@ -5,4 +5,3 @@ TODO:
|
|||
- show tooltip when text is longer than list width (or show in separate widget)
|
||||
- add food attributes
|
||||
- separate "emits light" values between nodes, tools, & armor
|
||||
- remove abandoned wlight support
|
||||
|
|
|
@ -5,6 +5,7 @@ v1.6
|
|||
- updated for API:
|
||||
- xdecor (Git commit 0dbf92e)
|
||||
- wielded_light v2021-07-15
|
||||
- removed abandoned wlight support
|
||||
|
||||
v1.5
|
||||
----
|
||||
|
|
42
formspec.lua
42
formspec.lua
|
@ -2,38 +2,6 @@
|
|||
local S = core.get_translator(equip_exam.name)
|
||||
|
||||
|
||||
-- START: wlight & wielded_light support
|
||||
|
||||
local light_items = {}
|
||||
|
||||
if core.global_exists("wlight") then
|
||||
local wlight_register_item_old = wlight.register_item
|
||||
local wlight_register_armor_old = wlight.register_armor
|
||||
|
||||
wlight.register_item = function(iname, radius)
|
||||
light_items[iname] = {radius=radius}
|
||||
|
||||
return wlight_register_item_old(iname, radius)
|
||||
end
|
||||
|
||||
wlight.register_armor = function(iname, radius, litem)
|
||||
light_items[iname] = {radius=radius}
|
||||
|
||||
return wlight_register_armor_old(iname, radius, litem)
|
||||
end
|
||||
|
||||
-- re-register torch & megatorch
|
||||
if core.registered_items["default:torch"] then
|
||||
wlight.register_item("default:torch")
|
||||
end
|
||||
|
||||
if core.registered_items["wlight:megatorch"] then
|
||||
wlight.register_item("wlight:megatorch", 10)
|
||||
end
|
||||
end
|
||||
|
||||
-- END: wlight & wielded_light support
|
||||
|
||||
-- wielded_light support
|
||||
local function get_light_def(id)
|
||||
return
|
||||
|
@ -377,15 +345,7 @@ local function get_item_specs(item, technical)
|
|||
end
|
||||
|
||||
local light_level = get_light_def(id)
|
||||
local emits_light = light_level and light_level > 0
|
||||
if not emits_light then
|
||||
emits_light = light_items[id]
|
||||
if emits_light then
|
||||
light_level = emits_light.radius
|
||||
end
|
||||
end
|
||||
|
||||
if emits_light and light_level then
|
||||
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")))
|
||||
|
|
Loading…
Reference in New Issue