From f09db9098c575229bb3287e716f2110b22de7010 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Thu, 30 Sep 2021 20:28:20 +0800 Subject: [PATCH] [WIP] rename style variables. --- mods/HUD/mcl_formspec/init.lua | 9 +++++---- mods/HUD/mcl_inventory/init.lua | 4 ++-- mods/ITEMS/mcl_chests/init.lua | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mods/HUD/mcl_formspec/init.lua b/mods/HUD/mcl_formspec/init.lua index 0b655289a..90a0bd1bf 100644 --- a/mods/HUD/mcl_formspec/init.lua +++ b/mods/HUD/mcl_formspec/init.lua @@ -11,8 +11,8 @@ mcl_formspec.padding = 0.375 -------------------------------------------------------------------------------- mcl_formspec.label_color = "#313131" mcl_formspec.label_size = tonumber(minetest.settings:get("mcl_label_font_size")) or 24 -mcl_formspec.style_label = string.format("style_type[label;font_size=%f]", mcl_formspec.label_size) -mcl_formspec.style_label_reset = "style_type[label;font=;font_size=;noclip=]" +mcl_formspec.label_style = string.format("style_type[label;font_size=%f]", mcl_formspec.label_size) +mcl_formspec.label_style_reset = "style_type[label;font=;font_size=;noclip=]" function mcl_formspec.get_itemslot_bg(x, y, w, h) local out = "" @@ -56,8 +56,7 @@ function mcl_formspec.itemslot_unit(n, border, spacing, factor) end mcl_formspec.itemslot_iu = mcl_formspec.itemslot_unit() -- itemslot unit -mcl_formspec.style_list_reset = "style_type[list;noclip=;size=;spacing=]" -function mcl_formspec.get_style_list(border, spacing) +function mcl_formspec.get_itemslot_style(border, spacing) local border = border or mcl_formspec.itemslot_border_size local spacing = spacing or mcl_formspec.itemslot_spacing_size return table.concat{ @@ -66,6 +65,8 @@ function mcl_formspec.get_style_list(border, spacing) "]", } end +mcl_formspec.itemslot_style_reset = "style_type[list;noclip=;size=;spacing=]" +mcl_formspec.itemslot_style = mcl_formspec.get_itemslot_style() local function create_itemslot_bg(i, j, x, y, iu, bu, factor) local img_x = x + i * iu - bu diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index 4cc1999d5..527cba46f 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -206,8 +206,8 @@ local function set_inventory(player, armor_change_only) local form = table.concat({ "formspec_version[4]", "size[", 2 * padding + 9 * iu - 2 * bu, ",", 4 * padding + 8 * iu - 2 * bu, "]", - mcl_formspec.style_label, - mcl_formspec.get_style_list(), + mcl_formspec.label_style, + mcl_formspec.itemslot_style, armor_slots_formspec, ppreview_formspec, diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index d7d40ac37..3976e4d6f 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -487,7 +487,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile table.concat({ "formspec_version[4]", "size[11.75,10.425]", - mcl_formspec.style_label, + mcl_formspec.label_size, "label[0.375,0.375;"..F(C(mcl_formspec.label_color, name)).."]", @@ -647,7 +647,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile table.concat({ "formspec_version[4]", "size[11.75,14.15]", - mcl_formspec.style_label, + mcl_formspec.label_style, "label[0.375,0.375;"..F(C(mcl_formspec.label_color, name)).."]", @@ -806,7 +806,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile table.concat({ "formspec_version[4]", "size[11.75,14.15]", - mcl_formspec.style_label, + mcl_formspec.label_style, "label[0.375,0.375;"..F(C(mcl_formspec.label_color, name)).."]", @@ -1167,7 +1167,7 @@ local function formspec_shulker_box(name) return table.concat({ "formspec_version[4]", "size[11.75,10.425]", - mcl_formspec.style_label, + mcl_formspec.label_style, "label[0.375,0.375;"..F(C(mcl_formspec.label_color, name)).."]",