remove unified-inv dependency / switch to mod.conf

This commit is contained in:
BuckarooBanzay 2021-06-17 13:11:13 +02:00 committed by Buckaroo Banzai
parent 51580dff14
commit 707250d749
4 changed files with 3 additions and 60 deletions

View File

@ -1,16 +0,0 @@
default
xp_redo?
more_chests?
mobs_redo?
mobs_animal?
mobs_monster?
mobs_horse?
mobs_xenomorph?
mobs_fish?
mobs_crocs?
mobs_jellyfish?
mobs_sharks?
mobs_turtles?
unified_inventory?
mesecons?

View File

@ -1,6 +1,5 @@
local has_xp_redo_mod = minetest.get_modpath("xp_redo")
local has_mobs_mod = minetest.get_modpath("mobs")
local has_unified_inv = minetest.get_modpath("unified_inventory")
local has_mesecons = minetest.get_modpath("mesecons")
local MP = minetest.get_modpath("missions")
@ -41,10 +40,6 @@ dofile(MP.."/hud.lua")
dofile(MP.."/block.lua")
dofile(MP.."/wand.lua")
if has_unified_inv then
dofile(MP.."/ui.lua")
end
-- executor
dofile(MP.."/executor.lua")
dofile(MP.."/executor.hud.lua")

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = missions
depends = default
optional_depends = xp_redo, more_chests, mobs_redo, mobs_animal, mobs_monster, mobs_horse, mobs_xenomorph, mobs_fish, mobs_crocs, mobs_jellyfish, mobs_sharks, mobs_turtles, unified_inventory, mesecons

39
ui.lua
View File

@ -1,39 +0,0 @@
unified_inventory.register_page("missions", {
get_formspec = function(player)
local mission = missions.get_current_mission(player)
local formspec = "background[0,4.5;8,4;ui_main_inventory.png]" ..
"label[1,0;Missions]";
if mission then
formspec = formspec ..
"label[1,1;" .. mission.name .. "]" ..
"button[1,2;4,1;abort_mission;Abort mission]";
else
formspec = formspec .. "label[1,2;No running mission]";
end
return {formspec=formspec}
end
})
unified_inventory.register_button("missions", {
type = "image",
image = "missions_block_preview.png",
tooltip = "Missions"
})
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "" then return end
if not player then return end
if fields.abort_mission then
local player_name = player:get_player_name()
missions.abort(player_name)
end
end)