From 19cd922396cf47830cfc24b22f83d21757e756f8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 23 Jan 2017 00:02:58 +0100 Subject: [PATCH] Creative: Add brewing category --- mods/craftingpack/crafting/creative.lua | 18 ++++++++++++++---- .../crafting/textures/fnt_brew.png | Bin 0 -> 410 bytes 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 mods/craftingpack/crafting/textures/fnt_brew.png diff --git a/mods/craftingpack/crafting/creative.lua b/mods/craftingpack/crafting/creative.lua index e3e5ce7d0..41e8fc26a 100644 --- a/mods/craftingpack/crafting/creative.lua +++ b/mods/craftingpack/crafting/creative.lua @@ -78,9 +78,12 @@ function set_inv(filter, player) if is_weapon(def) then table.insert(creative_list, name) end + elseif filter == "#brew" then + if def.groups.brewitem then + table.insert(creative_list, name) + end elseif filter == "#matr" then - -- TODO: Add separate brewing category - if def.groups.craftitem or def.groups.brewitem then + if def.groups.craftitem then table.insert(creative_list, name) end elseif filter == "#misc" then @@ -141,7 +144,7 @@ offset["food"] = "-0.29,8.12" offset["tools"] = "0.98,8.12" offset["combat"] = "2.23,8.12" offset["brew"] = "3.495,8.12" -offset["matr"] = offset["brew"]--"4.74,8.12" +offset["matr"] = "4.74,8.12" offset["inv"] = "8.99,8.12" hoch["blocks"] = "" @@ -242,7 +245,10 @@ crafting.set_creative_formspec = function(player, start_i, pagenum, show, page) "item_image_button[2.415,8.28;1,1;default:sword_gold;combat;]".. --combat tab(name, "combat") .. "tooltip[combat;Combat]".. - "item_image_button[3.693,8.28;1,1;default:stick;matr;]".. --brewing + "item_image_button[3.693,8.28;1,1;mcl_potions:glass_bottle;brew;]".. --brewing + tab(name, "brew") .. + "tooltip[brew;Brewing]".. + "item_image_button[4.938,8.28;1,1;default:stick;matr;]".. --materials tab(name, "matr") .. "tooltip[matr;Materials]".. "item_image_button[9.19,8.28;1,1;default:chest;inv;]".. --inventory @@ -308,6 +314,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) set_inv("#combat") page = "combat" end + if fields.brew then + set_inv("#brew") + page = "brew" + end if fields.matr then set_inv("#matr") page = "matr" diff --git a/mods/craftingpack/crafting/textures/fnt_brew.png b/mods/craftingpack/crafting/textures/fnt_brew.png new file mode 100644 index 0000000000000000000000000000000000000000..0e0cc0946e0d5f0ccf6fd4c073dcf1b48aafe727 GIT binary patch literal 410 zcmeAS@N?(olHy`uVBq!ia0y~yU~Fe#U@+%kV_;x-zPN2a0|NtNage(c!@6@aFBupZ z*pj^6T^Rl|FfcF}tJi#HU|`@Z@Q5sCV9-+rVaAH3_GJtV4D2PIzOL*K8O6jIjV4x4 zb6{X#l=5_O45_&F_O2sevw{F?K*k<{@AfS2t8O3D}eXl#4t;Ecp*)fO-WH=V^ zAXsnd9%be$QJanCm9N=f#Z>+wh>4+vnc)y)L!ITWXSru(9G){Y6fihgFgVOAIJa=C z`o&rHyV#9>{j8q9{OiBHUpx23Z>hWZlVL7M55q%-1NU$A+4tBzFZlXD+vN!uyc|7y?Tur#JgV#&;YQDvhpZl+#-pL9VF1U1k-r=j?6?@En{cFDW zasIxv_qV+o&Vg)cC}4P?lFlUd{9FcHITAR(jrqMsegDsls^1_{Pgg&ebxsLQ05z