diff --git a/streets_asphaltworkshop/init.lua b/streets_asphaltworkshop/init.lua index c454976..9b63416 100644 --- a/streets_asphaltworkshop/init.lua +++ b/streets_asphaltworkshop/init.lua @@ -91,6 +91,9 @@ function streets.workshop.update_formspec(pos) fs = fs .. "image[7,2;1,1;gui_furnace_arrow_bg.png^[lowpart:" .. meta:get_int("progress")*10 .. ":gui_furnace_arrow_fg.png^[transformR180]" fs = fs .. "list[context;output;7,3;1,1]" fs = fs .. "list[current_player;main;0.5,5;8,4]" + if minetest.setting_getbool("creative_mode") then + fs = fs .."label[2,4;CREATIVE MODE: Taking templates is enabled]" + end meta:set_string("formspec",fs) end @@ -157,7 +160,7 @@ local function on_construct(pos) end local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if listname == "output" or listname == "surface" or listname == "white_dye" or listname == "yellow_dye" then + if listname == "output" or listname == "surface" or listname == "white_dye" or listname == "yellow_dye" or (listname == "list" and minetest.setting_getbool("creative_mode")) then return stack:get_count() else return 0 @@ -188,7 +191,7 @@ local function on_metadata_inventory_take(pos, listname, index, stack, player) end local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if listname == "yellow_dye" or listname == "white_dye" then + if listname == "yellow_dye" or listname == "white_dye" or (listname == "list" and minetest.setting_getbool("creative_mode")) then return stack:get_count() elseif listname == "surface" and (stack:get_name() == "default:paper" or streets.surfaces.surfacetypes[stack:get_name()]) then return stack:get_count() diff --git a/streets_signworkshop/init.lua b/streets_signworkshop/init.lua index 7e6e7ab..932717c 100644 --- a/streets_signworkshop/init.lua +++ b/streets_signworkshop/init.lua @@ -105,6 +105,9 @@ function streets.signworkshop.update_formspec(pos) fs = fs .. "button[2.25,4;1,1;prevpage;<-]" fs = fs .. "button[5.25,4;1,1;nextpage;->]" fs = fs .. "label[3.75,4;"..string.format("Page %s of %s",page,maxpage).."]" + if minetest.setting_getbool("creative_mode") then + fs = fs .."label[0,3.5;CREATIVE MODE\nTaking templates\nis enabled]" + end end fs = fs .. "list[current_player;main;0.5,5;8,4]" meta:set_string("formspec",fs) @@ -177,7 +180,7 @@ local function on_construct(pos) end local function allow_metadata_inventory_take(pos, listname, index, stack, player) - if listname == "output" or listname == "surface" or listname == "dye" then + if listname == "output" or listname == "surface" or listname == "dye" or (listname == "list" and minetest.setting_getbool("creative_mode")) then return stack:get_count() else return 0 @@ -212,7 +215,7 @@ end local function allow_metadata_inventory_put(pos, listname, index, stack, player) if listname == "dye" and stack:get_name():sub(1,4) == "dye:" then return stack:get_count() - elseif listname == "surface" and stack:get_name() == "streets:sign_blank" then + elseif (listname == "surface" and stack:get_name() == "streets:sign_blank") or (listname == "list" and minetest.setting_getbool("creative_mode")) then return stack:get_count() else return 0