]> git.lizzy.rs Git - xdecor.git/commitdiff
Highlight hotbar on all formspecs
authorjp <jeanpatrick.guerrero@gmail.com>
Sat, 21 Nov 2015 15:03:04 +0000 (16:03 +0100)
committerjp <jeanpatrick.guerrero@gmail.com>
Sat, 21 Nov 2015 15:31:34 +0000 (16:31 +0100)
enchanting.lua
handlers/registration.lua
hive.lua
mailbox.lua
nodes.lua
worktable.lua

index f393f367c68f997cbbdb39fce7c5f0630b5aa367..2eb5f3af6efe89869b1d6c088e14445e8f6a3c39 100644 (file)
@@ -1,22 +1,23 @@
 local enchanting = {}
 screwdriver = screwdriver or {}
+local xbg = default.gui_slots..default.get_hotbar_bg(0.5,4.5)
 
 function enchanting.tools_fs()
-       return "size[9,8;]"..default.gui_slots..
-               "bgcolor[#080808BB;true]background[0,0;9,8;ench_ui.png]list[current_name;tool;0.9,2.9;1,1;]list[current_name;mese;2,2.9;1,1;]image[2,2.9;1,1;mese_layout.png]list[current_player;main;0.5,4.5;8,3;]"..
+       return "size[9,8;]"..xbg..
+               "bgcolor[#080808BB;true]background[0,0;9,8;ench_ui.png]list[context;tool;0.9,2.9;1,1;]list[context;mese;2,2.9;1,1;]image[2,2.9;1,1;mese_layout.png]list[current_player;main;0.5,4.5;8,3;]"..
                "image_button[3.9,0.9;4,0.9;bg_btn.png;fast;Efficiency]image_button[3.9,1.82;4,1.1;bg_btn.png;durable;Durability]"
 end
 
 function enchanting.swords_fs()
-       return "size[9,8;]"..default.gui_slots..
-               "bgcolor[#080808BB;true]background[0,0;9,8;ench_ui.png]list[current_name;tool;0.9,2.9;1,1;]list[current_name;mese;2,2.9;1,1;]image[2,2.9;1,1;mese_layout.png]list[current_player;main;0.5,4.5;8,3;]"..
+       return "size[9,8;]"..xbg..
+               "bgcolor[#080808BB;true]background[0,0;9,8;ench_ui.png]list[context;tool;0.9,2.9;1,1;]list[context;mese;2,2.9;1,1;]image[2,2.9;1,1;mese_layout.png]list[current_player;main;0.5,4.5;8,3;]"..
                "image_button[3.9,2.95;4,0.9;bg_btn.png;sharp;Sharpness]"
 end
 
 function enchanting.default_fs(pos)
        local meta = minetest.get_meta(pos)
-       local formspec = "size[9,8;]"..default.gui_slots..
-               "bgcolor[#080808BB;true]background[0,0;9,8;ench_ui.png]list[current_name;tool;0.9,2.9;1,1;]list[current_name;mese;2,2.9;1,1;]image[2,2.9;1,1;mese_layout.png]list[current_player;main;0.5,4.5;8,3;]"
+       local formspec = "size[9,8;]"..xbg..
+               "bgcolor[#080808BB;true]background[0,0;9,8;ench_ui.png]list[context;tool;0.9,2.9;1,1;]list[context;mese;2,2.9;1,1;]image[2,2.9;1,1;mese_layout.png]list[current_player;main;0.5,4.5;8,3;]"
 
        meta:set_string("formspec", formspec)
        meta:set_string("infotext", "Enchantment Table")
index 94f708b9bd9503a4b399334f40ae62044dffc5fd..bcc5c462c63640e678ff3adebfb85b4dc61e6437 100644 (file)
@@ -11,15 +11,18 @@ local default_inventory_size = 32
 local default_inventory_formspecs = {
        ["8"] = "size[8,6]"..xbg..
        "list[context;main;0,0;8,1;]"..
-       "list[current_player;main;0,2;8,4;]",
+       "list[current_player;main;0,2;8,4;]"..
+       default.get_hotbar_bg(0, 2),
 
        ["16"] = "size[8,7]"..xbg..
        "list[context;main;0,0;8,2;]"..
-       "list[current_player;main;0,3;8,4;]",
+       "list[current_player;main;0,3;8,4;]"..
+       default.get_hotbar_bg(0, 3),
 
        ["24"] = "size[8,8]"..xbg..
        "list[context;main;0,0;8,3;]"..
-       "list[current_player;main;0,4;8,4;]",
+       "list[current_player;main;0,4;8,4;]"..
+       default.get_hotbar_bg(0, 4),
 
        ["32"] = "size[8,9]"..xbg..
        "list[context;main;0,0.3;8,4;]"..
index 3e69acef86ba737fe4fb23131d86d19ba002d560..58f92f4b10803f18cb737c8b768d9c4789caac24 100644 (file)
--- a/hive.lua
+++ b/hive.lua
@@ -3,10 +3,10 @@ local hive = {}
 function hive.construct(pos)
        local meta = minetest.get_meta(pos)
        local inv = meta:get_inventory()
-       local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots
+       local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots..default.get_hotbar_bg(0,1.35)
 
        local formspec = "size[8,5;]"..xbg..
-               "label[1.35,0;Bees are making honey\nwith pollen around...]image[6,0;1,1;hive_bee.png]image[5,0;1,1;hive_layout.png]list[current_name;honey;5,0;1,1;]list[current_player;main;0,1.35;8,4;]"
+               "label[1.35,0;Bees are making honey\nwith pollen around...]image[6,0;1,1;hive_bee.png]image[5,0;1,1;hive_layout.png]list[context;honey;5,0;1,1;]list[current_player;main;0,1.35;8,4;]"
 
        meta:set_string("formspec", formspec)
        meta:set_string("infotext", "Artificial Hive")
index 846d86c0dc4afdf26636fd4ed0202440481ba4e3..37bec1f374ca3ae6e6e409c23352ac58e95ae26c 100644 (file)
@@ -1,6 +1,6 @@
 local mailbox = {}
 screwdriver = screwdriver or {}
-local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots
+local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots..default.get_hotbar_bg(0,5.25)
 
 xdecor.register("mailbox", {
        description = "Mailbox",
index babac1f18cbb1f1a0acf56712614befa980eefc6..e056d84a887e9c9e740aff1870a1bb561632c3b4 100644 (file)
--- a/nodes.lua
+++ b/nodes.lua
@@ -350,7 +350,7 @@ xdecor.register("enderchest", {
        on_rotate = screwdriver.rotate_simple,
        on_construct = function(pos)
                local meta = minetest.get_meta(pos)
-               local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots
+               local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots..default.get_hotbar_bg(0,5)
                meta:set_string("formspec", "size[8,9]"..xbg..
                                "list[current_player;enderchest;0,0;8,4;]"..
                                "list[current_player;main;0,5;8,4;]")
index 92c8334e867619ce80710cad64f3b43f3bdd91d6..2e494af264a52f5c31b233c28869127baa7f5fe6 100644 (file)
@@ -1,6 +1,6 @@
 local worktable = {}
 screwdriver = screwdriver or {}
-local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots
+local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots..default.get_hotbar_bg(0,3.25)
 
 local nodes = { -- Nodes allowed to be cut. Mod name = {node name}.
        default = {"wood", "junglewood", "pine_wood", "acacia_wood",
@@ -41,7 +41,8 @@ end
 
 function worktable.storage(pos)
        local inv = minetest.get_meta(pos):get_inventory()
-       local f = "size[8,7]"..xbg.."list[context;storage;0,0;8,2;]list[current_player;main;0,3.25;8,4;]"
+       local f = "size[8,7]"..xbg..
+               "list[context;storage;0,0;8,2;]list[current_player;main;0,3.25;8,4;]"
        inv:set_size("storage", 8*2)
        return f
 end
@@ -50,14 +51,14 @@ function worktable.construct(pos)
        local meta = minetest.get_meta(pos)
        local inv = meta:get_inventory()
 
+       local formspec = "size[8,7;]"..xbg..
+               "list[context;forms;4,0;4,3;]label[0.95,1.23;Cut]box[-0.05,1;2.05,0.9;#555555]image[3,1;1,1;gui_furnace_arrow_bg.png^[transformR270]label[0.95,2.23;Repair]box[-0.05,2;2.05,0.9;#555555]image[0,1;1,1;worktable_saw.png]image[0,2;1,1;worktable_anvil.png]image[3,2;1,1;hammer_layout.png]list[context;input;2,1;1,1;]list[context;tool;2,2;1,1;]list[context;hammer;3,2;1,1;]button[0,0;2,1;craft;Crafting]button[2,0;2,1;storage;Storage]list[current_player;main;0,3.25;8,4;]"
+
        inv:set_size("forms", 4*3)
        inv:set_size("input", 1)
        inv:set_size("tool", 1)
        inv:set_size("hammer", 1)
 
-       local formspec = "size[8,7;]"..xbg..
-               "list[context;forms;4,0;4,3;]label[0.95,1.23;Cut]box[-0.05,1;2.05,0.9;#555555]image[3,1;1,1;gui_furnace_arrow_bg.png^[transformR270]label[0.95,2.23;Repair]box[-0.05,2;2.05,0.9;#555555]image[0,1;1,1;worktable_saw.png]image[0,2;1,1;worktable_anvil.png]image[3,2;1,1;hammer_layout.png]list[current_name;input;2,1;1,1;]list[current_name;tool;2,2;1,1;]list[current_name;hammer;3,2;1,1;]button[0,0;2,1;craft;Crafting]button[2,0;2,1;storage;Storage]list[current_player;main;0,3.25;8,4;]"
-
        meta:set_string("formspec", formspec)
        meta:set_string("infotext", "Work Table")
 end