make formspec mouseover highlighting work again

This commit is contained in:
Vanessa Dannenberg 2021-03-04 10:18:33 -05:00
parent 1ad4366d9c
commit bd7531c021
18 changed files with 38 additions and 26 deletions

View File

@ -10,7 +10,7 @@ dreambuilder_theme_btn_color = #B0B0B0FF
dreambuilder_theme_editor_text_color = #000000FF
dreambuilder_theme_editor_bg_color = #F0F0F0FF
dreambuilder_theme_listcolor_slot_bg_normal = #FFFFFF30
dreambuilder_theme_listcolor_slot_bg_hover = #B0B0B0
dreambuilder_theme_listcolor_slot_bg_hover = #E0E0E0
dreambuilder_theme_listcolor_slot_border = #606060
dreambuilder_theme_tooltip_bgcolor = #A0A0A0
dreambuilder_theme_tooltip_fontcolor = #FFF

View File

@ -228,7 +228,7 @@ cat > /tmp/herefileA << 'EOF'
";border="..dreambuilder_theme.image_button_borders.."]"
EOF
echo ' "listcolors[#00000000;#00000000;#00000000;"..
echo ' "listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..' > /tmp/LISTCOLORS_HIDE_SLOTS
@ -371,9 +371,16 @@ sed -i '/size\[9,11;\]/ {
sed -i "0, /depends = /s//depends = dreambuilder_gui_theming, /" $workdir"/mods/technic/mod.conf"
sed -i 's/"listcolors\[#00000000;#00000000\]"/""/' $workdir"/mods/unified_inventory/internal.lua"
sed -i 's/"listcolors\[#00000000;#00000000\]"/""/' $workdir"/mods/unified_inventory/bags.lua"
sed -i 's/"listcolors\[#00000000;#00000000\]"/""/' $workdir"/mods/unified_inventory/register.lua"
sed -i '/local n = 4/ {
i \\tformspec[4]="style_type[image_button;bgcolor="..dreambuilder_theme.form_bgcolor.."]"
i \\tlocal n = 5
i \\tformspec[5]=
r /tmp/LISTCOLORS_HIDE_SLOTS
a \\t\t\t""
a \\tlocal n = 6
d
}' $workdir"/mods/unified_inventory/internal.lua"

View File

@ -16,7 +16,7 @@ local function get_chest_formspec(pos)
local formspec =
"size[8,9]" ..
"image[-0.39,-0.4;10.7,11.4;default_chest_inv_bg.png]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
default.gui_bg ..

View File

@ -13,7 +13,7 @@ local function active_formspec(fuel_percent, item_percent, pos, meta)
local formspec =
"size[8,8.5]"..
"image[-0.39,-0.4;10.7,10.9;default_furnace_inv_bg.png]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
default.gui_bg..
@ -50,7 +50,7 @@ end
local function inactive_formspec(pos, meta)
local formspec = "size[8,8.5]"..
"image[-0.39,-0.4;10.7,10.9;default_furnace_inv_bg.png]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
default.gui_bg..

View File

@ -32,7 +32,7 @@ minetest.register_craft({
local function make_reactor_formspec(meta)
local f = "size[8,9]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -20,7 +20,7 @@ local workshop_demand = {5000, 3500, 2000}
local workshop_formspec =
"size[8,9;]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -15,7 +15,7 @@ minetest.register_craft({
local machine_name = S("Fuel-Fired Alloy Furnace")
local formspec =
"size[8,9]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..
@ -129,7 +129,7 @@ minetest.register_abm({
technic.swap_node(pos, "technic:coal_alloy_furnace_active")
meta:set_string("formspec",
"size[8,9]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -146,7 +146,7 @@ local function make_constructor(mark, length)
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local formspec = "size[8,9;]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -56,7 +56,7 @@ local function set_injector_formspec(meta)
local is_stack = meta:get_string("mode") == "whole stacks"
meta:set_string("formspec",
"size[8,9;]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -162,7 +162,7 @@ function technic.register_battery_box(data)
local formspec =
"size[8,9]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -36,7 +36,7 @@ function technic.register_generator(data)
local generator_formspec =
"size[8,9;]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -51,7 +51,7 @@ function technic.register_base_machine(data)
local formspec =
"size[8,9;]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,4.93;10.03,4.65;technic_standard_inv.png]"..

View File

@ -100,7 +100,7 @@ local twosize_products = {
local cnc_formspec =
"size[9,11;]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"image[-0.1,6.92;10.03,4.65;technic_standard_inv.png]"..

View File

@ -20,7 +20,7 @@ unified_inventory.register_page("bags", {
"button[2,2.2;2,0.5;bag2;" .. F(S("Bag @1", 2)) .. "]",
"button[4,2.2;2,0.5;bag3;" .. F(S("Bag @1", 3)) .. "]",
"button[6,2.2;2,0.5;bag4;" .. F(S("Bag @1", 4)) .. "]",
"listcolors[#00000000;#00000000]",
"",
"list[detached:" .. F(player_name) .. "_bags;bag1;0.5,1.1;1,1;]",
"list[detached:" .. F(player_name) .. "_bags;bag2;2.5,1.1;1,1;]",
"list[detached:" .. F(player_name) .. "_bags;bag3;4.5,1.1;1,1;]",
@ -52,7 +52,7 @@ for bag_i = 1, 4 do
string.gsub(unified_inventory.standard_inv_bg, "YYY", "4.4"),
"image[7,0;1,1;" .. image .. "]",
"label[0,0;" .. F(S("Bag @1", bag_i)) .. "]",
"listcolors[#00000000;#00000000]",
"",
"list[current_player;bag" .. bag_i .. "contents;0,1.1;8,3;]",
"listring[current_name;bag" .. bag_i .. "contents]",
"listring[current_player;main]",

View File

@ -68,7 +68,12 @@ function unified_inventory.get_formspec(player, page)
unified_inventory.standard_background -- Background
}
formspec[4]="style_type[image_button;bgcolor="..dreambuilder_theme.form_bgcolor.."]"
local n = 5
formspec[5]=
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
""
local n = 6
if draw_lite_mode then
formspec[1] = "size[11,7.7]"
@ -130,7 +135,7 @@ function unified_inventory.get_formspec(player, page)
if fsdata.draw_inventory ~= false then
-- Player inventory
formspec[n] = "listcolors[#00000000;#00000000]"
formspec[n] = ""
formspec[n+1] = string.gsub(unified_inventory.standard_inv, "YYY", ui_peruser.formspec_y + 3.5)
n = n+2
end

View File

@ -173,7 +173,7 @@ unified_inventory.register_page("craft", {
local formspec = "background[2,"..formspecy..";6,3;ui_crafting_form.png]"
formspec = formspec..string.gsub(unified_inventory.standard_inv_bg, "YYY", (formspecy + 3.4))
formspec = formspec.."label[0,"..formheadery..";" ..F(S("Crafting")).."]"
formspec = formspec.."listcolors[#00000000;#00000000]"
formspec = formspec..""
formspec = formspec.."list[current_player;craftpreview;6,"..formspecy..";1,1;]"
formspec = formspec.."list[current_player;craft;2,"..formspecy..";3,3;]"
if unified_inventory.trash_enabled or unified_inventory.is_creative(player_name) or minetest.get_player_privs(player_name).give then
@ -270,7 +270,7 @@ unified_inventory.register_page("craftguide", {
local fs = {
string.gsub(unified_inventory.standard_inv_bg, "YYY", (formspecy + 3.4)),
"label[0,"..formheadery..";" .. F(S("Crafting Guide")) .. "]",
"listcolors[#00000000;#00000000]"
""
}
local item_name = unified_inventory.current_item[player_name]
if not item_name then

View File

@ -10,7 +10,7 @@ local S = minetest.get_translator("vessels")
local vessels_shelf_formspec =
"size[8,7;]" ..
"image[-0.39,-0.4;10.7,9.1;vessels_inv_bg.png]"..
"listcolors[#00000000;#00000000;#00000000;"..
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000;"..
dreambuilder_theme.tooltip_bgcolor..";"..
dreambuilder_theme.tooltip_fontcolor.."]"..
"list[context;vessels;0,0.3;8,2;]" ..

View File

@ -98,9 +98,9 @@ dreambuilder_theme_editor_bg_color (Dreambuilder theme, textarea background colo
# this color will be used for the slots.
dreambuilder_theme_listcolor_slot_bg_normal (Dreambuilder theme, inventory slot main color) string #FFFFFF30
# On forms that have inventory slots but which don't use background image,
# this color will be used when hovering the mouse over an inventory slot.
dreambuilder_theme_listcolor_slot_bg_hover (Dreambuilder theme, inventory slot mouseover color) string #B0B0B0
# On forms that have inventory slots, this color will be used when hovering
#the mouse over a slot.
dreambuilder_theme_listcolor_slot_bg_hover (Dreambuilder theme, inventory slot mouseover color) string #E0E0E0
# On forms that have inventory slots but which don't use background image,
# this color will be used for the slots' borders.