remove unified-inv dependency / switch to mod.conf
This commit is contained in:
parent
51580dff14
commit
707250d749
16
depends.txt
16
depends.txt
@ -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?
|
||||
|
5
init.lua
5
init.lua
@ -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
3
mod.conf
Normal 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
39
ui.lua
@ -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)
|
Loading…
x
Reference in New Issue
Block a user