From c57e5c05585d989759726a8bf1182df0c5d5e307 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 28 Dec 2016 14:10:21 +0100 Subject: [PATCH] Add Inventory++ support --- README.md | 1 + init.lua | 11 ++++++++++- textures/inventory_plus_doc_inventory_plus.png | Bin 0 -> 722 bytes 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 textures/inventory_plus_doc_inventory_plus.png diff --git a/README.md b/README.md index fbb5c10..c5b5d97 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ To open the help, there are multiple ways: - If you use one of these mods, there's a help button in the inventory menu: - Unified Inventory [`unified_inventory`] - Simple Fast Inventory Buttons [`sfinv_buttons`] + - Inventory++ [`inventory_plus`] The help itself should be more or less self-explanatory. diff --git a/init.lua b/init.lua index 2c0e9b4..2868ea6 100644 --- a/init.lua +++ b/init.lua @@ -1147,6 +1147,11 @@ function doc.process_form(player,formname,fields) local formspec = doc.formspec_core(3)..doc.formspec_entry(cid, eid, playername) minetest.show_formspec(playername, "doc:entry", formspec) end + else + if fields["doc_inventory_plus"] and minetest.get_modpath("inventory_plus") then + doc.show_doc(playername) + return + end end end @@ -1209,6 +1214,11 @@ minetest.register_on_joinplayer(function(player) playerdata.stored_data.revealed_count[cid] = rc end end + + -- Add button for Inventory++ + if minetest.get_modpath("inventory_plus") ~= nil then + inventory_plus.register_button(player, "doc_inventory_plus", S("Help")) + end end) ---[[ Add buttons for inventory mods ]] @@ -1237,7 +1247,6 @@ if minetest.get_modpath("sfinv_buttons") ~= nil then end - minetest.register_privilege("help_reveal", { description = S("Allows you to reveal all hidden help entries with /help_reveal"), give_to_singleplayer = false diff --git a/textures/inventory_plus_doc_inventory_plus.png b/textures/inventory_plus_doc_inventory_plus.png new file mode 100644 index 0000000000000000000000000000000000000000..3df6195c7f6e0f317daf6962008c56f782904512 GIT binary patch literal 722 zcwPb00xkWCP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2jB}5 z5jY04NYAbS00L4;L_t(I%dL~qOH%<9#(#IaU2U6b<|gV~qf%4~Ey)%PjZrWNNstId zVUPX~(o?-jU_JO2>|r%XdfLlgs+UDpv_^``nyH&5ZDQNJyVE&$d$?)NpqDz2=lj0H z;XB_EI9hIx3Frq#0Ozl62=D;`f?oMBT{t2hLJ*!}Yl994G`DK~L=@&{AifByI!w^( z-YgV^DMjBG*U5-<$O13dnbH+Imo%L2Rfi1TN_4G6=s8k@+}TPqw5wG zHK(YotHU<_O;uoP1Lzll5jq@Lj1mA=_ia#1RM}e(>`~Se0O&*!0EXH z)L!T*!;-mz7A)|IK!ErnIeCkeLBed%%vAS^H1ypBptO@mUugg!r4-1?TUsh1pd;v& zQPp9lCt1mElTx%z^2x6(`KMU&Pf^IG55z0kZJ3_ikF=~MF&3G_+9DDS_onTgWQqc6 zb`$y28vu@V^^({XN&QHJe*)6U`vkp@{>w87|N7290hmSd@&JoXkpKVy07*qoM6N<$ Ef@YaF-v9sr literal 0 HcwPel00001 -- 2.11.4.GIT