From 2f8de7c924047344f914d20dd7aad9681fa0d800 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Thu, 30 Jun 2016 11:28:35 -0400 Subject: [PATCH] Update texture, UI --- init.lua | 35 ++++++++++++++++++------------- textures/shop_shop_front.png | Bin 0 -> 771 bytes textures/shop_shop_side.png | Bin 0 -> 575 bytes textures/shop_shop_topbottom.png | Bin 0 -> 534 bytes 4 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 textures/shop_shop_front.png create mode 100644 textures/shop_shop_side.png create mode 100644 textures/shop_shop_topbottom.png diff --git a/init.lua b/init.lua index 0c155b5..84a85a2 100644 --- a/init.lua +++ b/init.lua @@ -6,13 +6,14 @@ local function get_register_formspec(pos) default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "label[2.1,0;Sell]" .. - "label[5.15,0;For]" .. - "button[0,1.5;1.75,1;stock;Stock]" .. - "button[6.25,1.5;1.75,1;register;Register]" .. - "button[3.5,1.25;1,1;ok;OK]" .. - "list[nodemeta:" .. spos .. ";sell;2,0.5;1,1;]" .. - "list[nodemeta:" .. spos .. ";buy;5,0.5;1,1;]" .. + "label[0,1;Sell]" .. + "label[3,1;For]" .. + "button[0,0;2,1;stock;Stock]" .. + "button[3,0;2,1;register;Register]" .. + "button_exit[7,0;1,1;exit;X]" .. + "button[7,1;1,1;ok;OK]" .. + "list[nodemeta:" .. spos .. ";sell;1,1;1,1;]" .. + "list[nodemeta:" .. spos .. ";buy;4,1;1,1;]" .. "list[current_player;main;0,2.75;8,4;]" return formspec end @@ -42,12 +43,12 @@ minetest.register_privilege("shop_admin", "Shop administration and maintainence" minetest.register_node("shop:shop", { description = "Shop", tiles = { - "default_wood.png^shop_coin.png", - "default_wood.png", - "default_wood.png^shop_coin.png", - "default_wood.png^shop_coin.png", - "default_wood.png^shop_coin.png", - "default_wood.png^shop_coin.png" + "shop_shop_topbottom.png", + "shop_shop_topbottom.png", + "shop_shop_side.png", + "shop_shop_side.png", + "shop_shop_side.png", + "shop_shop_front.png", }, groups = {choppy = 3, oddly_breakable_by_hand = 1}, paramtype2 = "facedir", @@ -84,8 +85,12 @@ minetest.register_node("shop:shop", { minetest.show_formspec(player, "shop:shop", formspec_register) end elseif fields.stock then - minetest.show_formspec(player, "shop:shop", formspec_stock) - return + if player ~= owner and (not minetest.check_player_privs(player, "shop_admin")) then + minetest.chat_send_player(player, "Only the shop owner can open the stock.") + return + else + minetest.show_formspec(player, "shop:shop", formspec_stock) + end elseif fields.ok then if inv:is_empty("sell") or inv:is_empty("buy") or diff --git a/textures/shop_shop_front.png b/textures/shop_shop_front.png new file mode 100644 index 0000000000000000000000000000000000000000..48354a665956005cac42cfe271d76a2a21136016 GIT binary patch literal 771 zcmV+e1N{7nP)uQa1!uIRsWY1Xel(S2_e(I|Nxf1X?`=Ts{P0LIj0v z5QT0Mc6N4^c@&s>44i!roPH0Re-W339HE05poA2kgc+BJ8>XI-p`oF|rx(DiD8a8N ztE;QWu^zLlp3t-(xUi$qx+CSd1nIa5*SsRuz8%=TBEYz-+P@>%z#-_r2g16o;=>x= z#4hN^3G2oV!NI}q#}wqr9_7d?>&O}E${Xy<59rDz>&q7J%Ngy=9P-N{?9UbN&K&B` zG49YH>(M0f&?E5C9p}<8?b0Ce(I4;8CGOM_@zNmm(v`P?=4-81*!C;Z(m*Votf;U)UtF8kg!`rtJ8;w}8*H}>T(+}zy#<2>En z-TUV|{N_Xa=sWxCJN@lD<>lq?@9&ozVTu3%010qNS#tmY3ljhU3ljkVnw%H_000Mc zNliru;07KJI|S5MVg&#I0T4+0b!u8zoTvK z(>2!G)7{zS0B0hfIG(Hy_PVFG7z-niRHpPi=WcgZXE$T-j0bWR%{`tCPt1=m@90rk z0=phd=U)AbGwXZ$X}~7|<};~y_U`Cln}wNjLP7c{r!PWG)f8C^Xg-9NbSxNDydIBN zRs*s^K{WIrW6G*`TGmt+5$aP!M>9n`3Is(b{sT_eJPM>2dQJcU002ovPDHLkV1mQ~ BZ-)Q? literal 0 HcmV?d00001 diff --git a/textures/shop_shop_side.png b/textures/shop_shop_side.png new file mode 100644 index 0000000000000000000000000000000000000000..687fa302c17866a530d6341411e4a167548e9371 GIT binary patch literal 575 zcmV-F0>J%=P)&6c5#}w?#59`Yo z@5>qN&lT^^9Q4g0@X;Od(I4*A5%JO>_0uHr)gbiMBJ|ZJ^VcEu)+hJaC-vAZ_1Y!) z*)I0mDfina_S-J^+c5UsEcx6t_}wn|-zWUtF81Li`rj`5-ZlE*H22~y{NgwE zH2vc|{N_Xa=sW%GJDG1$MF0Q*32;bRa{vGf6951U69E94oEQKA00(qQO+^Rb1|AMO zJ7O_UH~;_u@kvBMR2b6@&dFkeFcd)1$6&xmI?t`OGNqvk7zK84l);>dL%%cLwDmaa1PT_vs!qe{q9i7buh)xw|IfctH+-WBnJ@j3T?DA>P^Od}qI zo*Vk%4B<)&#=PldGIayr^(dIC8g|~-^wSLk9vg!c(Hhf1Y7jIX{0Df|B*Lgv96ta6 N002ovPDHLkV1ntQ0*L?s literal 0 HcmV?d00001 diff --git a/textures/shop_shop_topbottom.png b/textures/shop_shop_topbottom.png new file mode 100644 index 0000000000000000000000000000000000000000..fe9438a80dd96bbedf843b4724791d6c8744713f GIT binary patch literal 534 zcmV+x0_pvUP)H2vc|`{y+L=0p7GJN@lDM8>~l00009a7bBm000XU000XU z0RWnu7ytkO2XskIMF-#p9uEOIs8pI-0002#Nkl4Cz@`U2Bm36lRZIMe=oORH)ZBgy2)(I$4_Zb00wUsD;x=!XX_t+i|MOUQJ zwaL1YaULR&vYuuUr&W3J#TVCsT#~k(S$fUcN1r$r?0O+vCGs>5`^Y<4fL&c?O&Ldw zhur<7VExWAJ##;BoxlrD2(MBw=Gw=j?f9PKQZQBj?A&+z%?W%S8(<;g{)OTW4T9zY YAN8#swt1Br8vp