forked from nalc/awards
Fix bugs when mod is run outside of Minetest Game (#34)
This commit is contained in:
parent
ae01ea01dd
commit
43da09620e
6
api.lua
6
api.lua
@ -463,9 +463,13 @@ function awards.show_to(name, to, sid, text)
|
|||||||
if sid == nil or sid < 1 then
|
if sid == nil or sid < 1 then
|
||||||
sid = 1
|
sid = 1
|
||||||
end
|
end
|
||||||
|
local deco = ""
|
||||||
|
if minetest.global_exists("default") then
|
||||||
|
deco = default.gui_bg .. default.gui_bg_img
|
||||||
|
end
|
||||||
-- Show formspec to user
|
-- Show formspec to user
|
||||||
minetest.show_formspec(to,"awards:awards",
|
minetest.show_formspec(to,"awards:awards",
|
||||||
"size[11,5]" .. default.gui_bg .. default.gui_bg_img ..
|
"size[11,5]" .. deco ..
|
||||||
awards.getFormspec(name, to, sid))
|
awards.getFormspec(name, to, sid))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
22
init.lua
22
init.lua
@ -70,16 +70,18 @@ end
|
|||||||
|
|
||||||
-- This award can't be part of Unified Inventory, it would make a circular dependency
|
-- This award can't be part of Unified Inventory, it would make a circular dependency
|
||||||
if minetest.get_modpath("unified_inventory") then
|
if minetest.get_modpath("unified_inventory") then
|
||||||
awards.register_achievement("awards_ui_bags", {
|
if minetest.get_all_craft_recipes("unified_inventory:bag_large") ~= nil then
|
||||||
title = S("Backpacker"),
|
awards.register_achievement("awards_ui_bags", {
|
||||||
description = S("Craft 4 large bags."),
|
title = S("Backpacker"),
|
||||||
icon = "awards_ui_bags.png",
|
description = S("Craft 4 large bags."),
|
||||||
trigger = {
|
icon = "awards_ui_bags.png",
|
||||||
type = "craft",
|
trigger = {
|
||||||
item = "unified_inventory:bag_large",
|
type = "craft",
|
||||||
target = 4
|
item = "unified_inventory:bag_large",
|
||||||
}
|
target = 4
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("fire") then
|
if minetest.get_modpath("fire") then
|
||||||
|
Loading…
Reference in New Issue
Block a user