Highlight hotbar on all formspecs
This commit is contained in:
parent
507d4cdff1
commit
4c13a9f2f3
@ -1,22 +1,23 @@
|
|||||||
local enchanting = {}
|
local enchanting = {}
|
||||||
screwdriver = screwdriver or {}
|
screwdriver = screwdriver or {}
|
||||||
|
local xbg = default.gui_slots..default.get_hotbar_bg(0.5,4.5)
|
||||||
|
|
||||||
function enchanting.tools_fs()
|
function enchanting.tools_fs()
|
||||||
return "size[9,8;]"..default.gui_slots..
|
return "size[9,8;]"..xbg..
|
||||||
"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;]"..
|
"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]"
|
"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
|
end
|
||||||
|
|
||||||
function enchanting.swords_fs()
|
function enchanting.swords_fs()
|
||||||
return "size[9,8;]"..default.gui_slots..
|
return "size[9,8;]"..xbg..
|
||||||
"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;]"..
|
"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]"
|
"image_button[3.9,2.95;4,0.9;bg_btn.png;sharp;Sharpness]"
|
||||||
end
|
end
|
||||||
|
|
||||||
function enchanting.default_fs(pos)
|
function enchanting.default_fs(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local formspec = "size[9,8;]"..default.gui_slots..
|
local formspec = "size[9,8;]"..xbg..
|
||||||
"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;]"
|
"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("formspec", formspec)
|
||||||
meta:set_string("infotext", "Enchantment Table")
|
meta:set_string("infotext", "Enchantment Table")
|
||||||
|
@ -11,15 +11,18 @@ local default_inventory_size = 32
|
|||||||
local default_inventory_formspecs = {
|
local default_inventory_formspecs = {
|
||||||
["8"] = "size[8,6]"..xbg..
|
["8"] = "size[8,6]"..xbg..
|
||||||
"list[context;main;0,0;8,1;]"..
|
"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..
|
["16"] = "size[8,7]"..xbg..
|
||||||
"list[context;main;0,0;8,2;]"..
|
"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..
|
["24"] = "size[8,8]"..xbg..
|
||||||
"list[context;main;0,0;8,3;]"..
|
"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..
|
["32"] = "size[8,9]"..xbg..
|
||||||
"list[context;main;0,0.3;8,4;]"..
|
"list[context;main;0,0.3;8,4;]"..
|
||||||
|
4
hive.lua
4
hive.lua
@ -3,10 +3,10 @@ local hive = {}
|
|||||||
function hive.construct(pos)
|
function hive.construct(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
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..
|
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("formspec", formspec)
|
||||||
meta:set_string("infotext", "Artificial Hive")
|
meta:set_string("infotext", "Artificial Hive")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local mailbox = {}
|
local mailbox = {}
|
||||||
screwdriver = screwdriver or {}
|
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", {
|
xdecor.register("mailbox", {
|
||||||
description = "Mailbox",
|
description = "Mailbox",
|
||||||
|
@ -350,7 +350,7 @@ xdecor.register("enderchest", {
|
|||||||
on_rotate = screwdriver.rotate_simple,
|
on_rotate = screwdriver.rotate_simple,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(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..
|
meta:set_string("formspec", "size[8,9]"..xbg..
|
||||||
"list[current_player;enderchest;0,0;8,4;]"..
|
"list[current_player;enderchest;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
local worktable = {}
|
local worktable = {}
|
||||||
screwdriver = screwdriver or {}
|
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}.
|
local nodes = { -- Nodes allowed to be cut. Mod name = {node name}.
|
||||||
default = {"wood", "junglewood", "pine_wood", "acacia_wood",
|
default = {"wood", "junglewood", "pine_wood", "acacia_wood",
|
||||||
@ -41,7 +41,8 @@ end
|
|||||||
|
|
||||||
function worktable.storage(pos)
|
function worktable.storage(pos)
|
||||||
local inv = minetest.get_meta(pos):get_inventory()
|
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)
|
inv:set_size("storage", 8*2)
|
||||||
return f
|
return f
|
||||||
end
|
end
|
||||||
@ -50,14 +51,14 @@ function worktable.construct(pos)
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
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("forms", 4*3)
|
||||||
inv:set_size("input", 1)
|
inv:set_size("input", 1)
|
||||||
inv:set_size("tool", 1)
|
inv:set_size("tool", 1)
|
||||||
inv:set_size("hammer", 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("formspec", formspec)
|
||||||
meta:set_string("infotext", "Work Table")
|
meta:set_string("infotext", "Work Table")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user