Merge pull request #91 from ForbiddenJ/master

Make trash configurable but preserve default functionality
This commit is contained in:
Vanessa Ezekowitz 2017-03-01 18:20:15 -05:00 committed by GitHub
commit cff06ab167
5 changed files with 17 additions and 4 deletions

@ -51,8 +51,11 @@ for i = 1, 4 do
elseif slots == 24 then elseif slots == 24 then
formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_bags_lg_form.png]" formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_bags_lg_form.png]"
end end
formspec = (formspec.."background[6.06,0;0.92,0.92;ui_bags_trash.png]" local player_name = player:get_player_name() -- For if statement.
.."list[detached:trash;main;6,0.1;1,1;]") if unified_inventory.trash_enabled or unified_inventory.is_creative(player_name) or minetest.get_player_privs(player_name).give then
formspec = (formspec.."background[6.06,0;0.92,0.92;ui_bags_trash.png]"
.."list[detached:trash;main;6,0.1;1,1;]")
end
return {formspec=formspec} return {formspec=formspec}
end, end,
}) })

@ -46,6 +46,9 @@ unified_inventory = {
-- "Lite" mode -- "Lite" mode
lite_mode = minetest.setting_getbool("unified_inventory_lite"), lite_mode = minetest.setting_getbool("unified_inventory_lite"),
-- Trash enabled
trash_enabled = (minetest.setting_getbool("unified_inventory_trash") ~= false),
pagecols = 8, pagecols = 8,
pagerows = 10, pagerows = 10,
page_y = 0, page_y = 0,

@ -175,8 +175,11 @@ unified_inventory.register_page("craft", {
formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."listcolors[#00000000;#00000000]"
formspec = formspec.."list[current_player;craftpreview;6,"..formspecy..";1,1;]" formspec = formspec.."list[current_player;craftpreview;6,"..formspecy..";1,1;]"
formspec = formspec.."list[current_player;craft;2,"..formspecy..";3,3;]" formspec = formspec.."list[current_player;craft;2,"..formspecy..";3,3;]"
formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. F("Trash:") .. "]" if unified_inventory.trash_enabled or unified_inventory.is_creative(player_name) or minetest.get_player_privs(player_name).give then
formspec = formspec.."list[detached:trash;main;7,"..(formspecy + 2)..";1,1;]" formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. F("Trash:") .. "]"
formspec = formspec.."background[7,"..(formspecy + 2)..";1,1;ui_single_slot.png]"
formspec = formspec.."list[detached:trash;main;7,"..(formspecy + 2)..";1,1;]"
end
formspec = formspec.."listring[current_name;craft]" formspec = formspec.."listring[current_name;craft]"
formspec = formspec.."listring[current_player;main]" formspec = formspec.."listring[current_player;main]"
if unified_inventory.is_creative(player_name) then if unified_inventory.is_creative(player_name) then

@ -5,3 +5,7 @@ unified_inventory_lite (Lite mode) bool false
#If enabled, bags will be made available which can be used to extend #If enabled, bags will be made available which can be used to extend
#inventory storage size. #inventory storage size.
unified_inventory_bags (Enable bags) bool true unified_inventory_bags (Enable bags) bool true
#If enabled, the trash slot can be used by those without both creative
#and the give privilege.
unified_inventory_trash (Enable trash) bool true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB