From 0acd9a2ccb2f766de5237964a5da046148075d79 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 27 Oct 2016 19:42:47 +0200 Subject: [PATCH] Add icon overlay to shelf inventory slots --- mods/default/README.txt | 3 +++ mods/default/nodes.lua | 12 ++++++++++++ mods/default/textures/default_book_slot.png | Bin 0 -> 204 bytes mods/vessels/README.txt | 3 +++ mods/vessels/init.lua | 12 ++++++++++++ .../textures/vessels_glass_bottle_slot.png | Bin 0 -> 196 bytes 6 files changed, 30 insertions(+) create mode 100644 mods/default/textures/default_book_slot.png create mode 100644 mods/vessels/textures/vessels_glass_bottle_slot.png diff --git a/mods/default/README.txt b/mods/default/README.txt index 4536de9a..3e4f7734 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -139,6 +139,9 @@ BlockMen (CC BY-SA 3.0): bubble.png gui_*.png +Wuzzy (CC BY-SA 3.0): + default_book_slot.png (based on default_book.png) + sofar (CC BY-SA 3.0): default_book_written.png, based on default_book.png default_aspen_sapling diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 07e15952..65b9fb9e 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -1800,6 +1800,18 @@ local bookshelf_formspec = "listring[current_player;main]" .. default.get_hotbar_bg(0,2.85) +-- Inventory slots overlay +local bx, by = 0, 0.3 +for i = 1, 16 do + if i == 9 then + bx = 0 + by = by + 1 + end + bookshelf_formspec = bookshelf_formspec .. + "image["..bx..","..by..";1,1;default_book_slot.png]" + bx = bx + 1 +end + minetest.register_node("default:bookshelf", { description = "Bookshelf", tiles = {"default_wood.png", "default_wood.png", "default_wood.png", diff --git a/mods/default/textures/default_book_slot.png b/mods/default/textures/default_book_slot.png new file mode 100644 index 0000000000000000000000000000000000000000..20b4ef844b354736afec5779f60c57eb9724a889 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRt$P6UkCGKknQjEnx?oJHr&dIz4a@YcVLR^7# zLqo%)%$+JA>5?G7UYh7ML)4Eal|aXmSqp@E&}3=@xy91oi&PoEnP`z;AE4?`c1qz^gC m0h1F1JQ5z{BqTIzu`(Q*$nN{BWt}xpH-o3EpUXO@geCyKmoeD@ literal 0 HcmV?d00001 diff --git a/mods/vessels/README.txt b/mods/vessels/README.txt index b81d0e94..e9f01b84 100644 --- a/mods/vessels/README.txt +++ b/mods/vessels/README.txt @@ -17,3 +17,6 @@ The following textures were modified by Thomas-S (CC BY-SA 3.0): vessels_drinking_glass_inv.png vessels_glass_bottle.png vessels_steel_bottle.png + +The following texture was created by Wuzzy (CC BY-SA 3.0): + vessels_glass_bottle_slot.png (based on vessels_glass_bottle.png) diff --git a/mods/vessels/init.lua b/mods/vessels/init.lua index e56cc284..f0362568 100644 --- a/mods/vessels/init.lua +++ b/mods/vessels/init.lua @@ -13,6 +13,18 @@ local vessels_shelf_formspec = "listring[current_player;main]" .. default.get_hotbar_bg(0, 2.85) +-- Inventory slots overlay +local vx, vy = 0, 0.3 +for i = 1,16 do + if i == 9 then + vx = 0 + vy = vy + 1 + end + vessels_shelf_formspec = vessels_shelf_formspec .. + "image["..vx..","..vy..";1,1;vessels_glass_bottle_slot.png]" + vx = vx + 1 +end + minetest.register_node("vessels:shelf", { description = "Vessels Shelf", tiles = {"default_wood.png", "default_wood.png", "default_wood.png", diff --git a/mods/vessels/textures/vessels_glass_bottle_slot.png b/mods/vessels/textures/vessels_glass_bottle_slot.png new file mode 100644 index 0000000000000000000000000000000000000000..63cf7952f9b5d662ef92709481951b567d87c6a9 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;V{wqX6T`Z5GB1G~wg8_HS0LTc z&@d@;rwT~AB*-tA!Qt7BG!Q4r+uensgH_f8$l)yTh%9Dc;1&j9Muu5)B!GhKC7!;n z><_r41w|})3hqw?3Tb(|IEHXsPfl=P>fz;i!!I#|-@w4KL7;|0{k;OXk;vd$@?2>|sqD)0aR literal 0 HcmV?d00001