From 1db3b079c6600b6adbc1ab78bd1727f7978fe042 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 6 Jun 2018 14:39:16 +0200 Subject: [PATCH] Add disabled trade image --- .../mobs_mc_trading_formspec_disabled.png | Bin 0 -> 256 bytes mods/ENTITIES/mobs_mc/villager.lua | 7 ++++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 mods/ENTITIES/mobs_mc/textures/mobs_mc_trading_formspec_disabled.png diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_trading_formspec_disabled.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_trading_formspec_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..3516b8bd2167a2c1e3138cdcb80201728a90e017 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0y~yU@!+^MrH;EhDo9htPBhcYymzYt_%ze2c@JcT-_uY z7#J8!g8YIR9G=}sV_;xd;pyTSQo)$?Ac29Al}*wh_CNyrvU-Cn%^Jt-dHzc`n0&Tx z`^D@q>o0%vUuK1~|C=5EF)vUvGGyT3Xu7c~w(wNoAuoabyHCD3KAV01W2NZD94|R! zt?$+Cel|~PtI?*I`P1j+XcaM-q1)NvyG8)9yRimHgpR{g;2Y{pIJ! z|2wK(_j5}8&uR5vL*l=N)&E^#|8@1htLJ}3?|)tYIm7PkYsP7U*?0Hw9o)viz`)?? L>gTe~DWM4fo#1Bz literal 0 HcmV?d00001 diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 4711b96f..07cc1fa1 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -387,11 +387,16 @@ local set_trade = function(self, player, inv, concrete_tradenum) end -local function show_trade_formspec(playername, trader) +local function show_trade_formspec(playername, trader, is_disabled) local profession = professions[trader._profession].name + local disabled = "" + if is_disabled then + disabled = "image[4.3,2.52;1,1;mobs_mc_trading_formspec_disabled.png]" + end local formspec = "size[9,8.75]".. "background[-0.19,-0.25;9.41,9.49;mobs_mc_trading_formspec_bg.png]".. + disabled.. mcl_vars.inventory_header.. "label[4,0;"..minetest.formspec_escape(profession).."]" .."list[current_player;main;0,4.5;9,3;9]"