Highlight hotbar on all formspecs

master
jp 2015-11-21 16:03:04 +01:00
parent 507d4cdff1
commit 4c13a9f2f3
6 changed files with 23 additions and 18 deletions

View 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")

View 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;]"..

View File

@ -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")

View 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",

View File

@ -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;]")

View 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