From 60bdfa34fb08798d1af7db9c5fba5585074cd1f0 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 4 Jul 2022 05:10:31 +0200 Subject: [PATCH] Cleaner bg + slot textures --- src/gui.lua | 6 +++--- src/styles.lua | 10 ++++++---- textures/i3_bg_full.png | Bin 1400 -> 2031 bytes textures/i3_slot.png | Bin 3741 -> 2424 bytes 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui.lua b/src/gui.lua index 85e74ee..c9a3b77 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -1324,7 +1324,7 @@ local function get_items_fs(fs, data, player, full_height) local ipp = rows * lines local size = 0.85 - bg9(data.inv_width + 0.1, 0, 7.9, full_height, PNG.bg_full, 10) + bg9(data.inv_width + 0.1, 0, 7.9, full_height, PNG.bg_full) if data.enable_search then fs("set_focus[filter]", @@ -1447,7 +1447,7 @@ local function get_panels(fs, data, player) data.yoffset += panels[i - 1].height + 0.1 end - bg9(data.inv_width + 0.1, data.yoffset, 7.9, panel.height, PNG.bg_full, 10) + bg9(data.inv_width + 0.1, data.yoffset, 7.9, panel.height, PNG.bg_full) local is_recipe, is_usage = panel.name == "recipes", panel.name == "usages" panel.func(fs, data, player, panel, is_recipe, is_usage) @@ -1564,7 +1564,7 @@ local function make_fs(player, data) fs(fmt("formspec_version[%u]size[%f,%f]no_prepend[]bgcolor[#0000]", i3.settings.min_fs_version, data.inv_width + 8, full_height), styles) - bg9(0, 0, data.inv_width, full_height, PNG.bg_full, 10) + bg9(0, 0, data.inv_width, full_height, PNG.bg_full) local tab = i3.tabs[data.tab] diff --git a/src/styles.lua b/src/styles.lua index 0ded16b..918b0b7 100644 --- a/src/styles.lua +++ b/src/styles.lua @@ -1,3 +1,5 @@ +local fmt = string.format + local PNG = { blank = "i3_blank.png", bg = "i3_bg.png", @@ -23,7 +25,7 @@ local PNG = { sign = "i3_sign.png", cancel = "i3_cancel.png", export = "i3_export.png", - slot = "i3_slot.png", + slot = "i3_slot.png^\\[resize:128x128", tab = "i3_tab.png", tab_small = "i3_tab_small.png", tab_top = "i3_tab.png^\\[transformFY", @@ -74,7 +76,7 @@ local styles = string.format([[ style_type[label,field;font_size=16] style_type[button;border=false;content_offset=0] style_type[image_button,item_image_button,checkbox,dropdown;border=false;sound=i3_click] - style_type[item_image_button;bgimg_hovered=%s] + style_type[item_image_button;bgimg_hovered=%s;bgimg_middle=9;padding=-9] style[;sound=] style[nofav;sound=i3_cannot] @@ -111,10 +113,10 @@ local fs_elements = { tooltip = "tooltip[%f,%f;%f,%f;%s]", button = "button[%f,%f;%f,%f;%s;%s]", checkbox = "checkbox[%f,%f;%s;%s;%s]", - slot = "image[%f,%f;%f,%f;i3_slot.png]", + slot = "image[%f,%f;%f,%f;" .. fmt("%s;9]", PNG.slot), item_image = "item_image[%f,%f;%f,%f;%s]", hypertext = "hypertext[%f,%f;%f,%f;%s;%s]", - bg9 = "background9[%f,%f;%f,%f;%s;false;%u]", + bg9 = "background9[%f,%f;%f,%f;%s;false;12]", scrollbar = "scrollbar[%f,%f;%f,%f;%s;%s;%u]", model = "model[%f,%f;%f,%f;%s;%s;%s;%s;%s;%s;%s]", image_button = "image_button[%f,%f;%f,%f;%s;%s;%s]", diff --git a/textures/i3_bg_full.png b/textures/i3_bg_full.png index 5760d54270029f58244b8f067da056dfb13f6584..9f86d727590126684fe6b14093805239b684b7a1 100644 GIT binary patch literal 2031 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&zE~)R&4YzZe+Uw|TlahE&{od*@*8AqN46 zi@AqGf3!^v)++FPcc8T3+rg_ldO{{h9-SD#67jI5{Jxhz*MgX5M)C%FPankC*|i(A zn&v#@W~i{fy>E4KI{(wF!vAgBjyfYwK;FkI+UWKJ;R zV8}Q%g>i!v3xi4OS%!k@c!rGAVLXfsx0D$e9Kb$e5MW?v0J2yZ7!-gMBLf2mAt@4- zgMtof2{EQ4DMz>oVFW^qpgTb(u{0=>>OCX}41jxyj|L=n0t1Dp(7+bg0t{{7)QwHf z0hl822R(_=fv|)E_mUZ*3P8`06`>9c62P3#z(6=O5Z*&rhE0qplMqG_rM!UwmWfGJ zjtCTl5eP8?@elPKV*&?*0?+|uhA*L1h9e9qa4)$T27hkA;Z9H(j@*LCPm*D_BZEWm zHlBv73JeQ0v)K-$2ryijqRE_K0IHt?J{^(oPGoQpp7yEw(ZLL0)zz}`&b*2wGZBUr zw_^UytJuUHeweXA>uKNnQ+tK=zbG*O3*y-s z4p=_rlRv%s`KRLf4SOO3?ipUlZDxF6oBMm+xw*D7Z@=enx9C^<(rc{>Osx!_u6{1- HoD!M<{OsO2 literal 1400 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|7#LXXJzX3_DsH{Ky)n1NfT1n0 z|AFp}2TMXCj|XoM2;RUF9FW>{W0I~Q6Jxw&+()q=-M>@baIfz_U!atxIeU}pZ>9%= z(|+BapT*5*T`1OX7~RY9p&~o?P^v>)j+q35b#d;IL%93Kl!Z3H4(1a8Y2CJn)6K1SE z#_(X-rJe|;pdL0x5bFX{&>1(z2Z!$L+Q@t2fvXrp{oXyR*8UKkASS3T$k68}cX*rR z?}nWBE-`DEH*B-+-@CbC%k{{W|NM_E*KJ6zT{SC<`B9|$KE~eqN-q7bf5N~LmBG{1 K&t;ucLK6UK9^*X# diff --git a/textures/i3_slot.png b/textures/i3_slot.png index f4a7706bb48818e379c69d11f7a6a85da90265f8..ed144ec3a86430666479d5ce628871abc4ee9ebf 100644 GIT binary patch literal 2424 zcmdT_e@s(X6h5!NC=>>nI$E27wJ`D@-IJVlA7l51A|k zGq3~?&bjw| z?>pbk=CJqJ+0bnOz>f89$a??;JR|^>f-gql-5CJuKvqalr11V&Z`eWCeXFy6_agRU zx6k$|gGl6r^Ndr(BQmvF@L66DV>s=&uZi0`bnQ|`M8^2;)(Xv$vf}TgJPEIqSHLUg zNi}(z*CD!(Bj~BoUP)J|)q zWs09JZz7Yiak*+!^4rx@oaSje{u)SP*swg>yUX5}BHIc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