From 60e21627e14e40f7d596c514b8c005ea2589a01f Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 8 Aug 2022 22:09:39 +0200 Subject: [PATCH] Some tweaks --- src/caches.lua | 1 - src/callbacks.lua | 3 ++- src/fields.lua | 1 - src/gui.lua | 2 ++ src/styles.lua | 4 +++- textures/i3_search_outline_trim.png | Bin 0 -> 4912 bytes 6 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 textures/i3_search_outline_trim.png diff --git a/src/caches.lua b/src/caches.lua index 954893d..078dacd 100644 --- a/src/caches.lua +++ b/src/caches.lua @@ -56,7 +56,6 @@ local function cache_groups(group, groups) if c > 1 then sprite = sprite:gsub("WxH", px .. "x" .. px * c) - i3.groups[group].sprite = sprite i3.groups[group].count = c end diff --git a/src/callbacks.lua b/src/callbacks.lua index 47b5c6c..c85bb5e 100644 --- a/src/callbacks.lua +++ b/src/callbacks.lua @@ -119,7 +119,8 @@ if core.global_exists"armor" then if check_group(def, group) and i ~= j then armor_inv:set_stack("armor", i, armor_inv:get_stack("armor", j)) armor_inv:set_stack("armor", j, stack) - return play_sound(name, "i3_cannot", 0.8) + + return play_sound(player:get_player_name(), "i3_cannot", 0.8) end end end diff --git a/src/fields.lua b/src/fields.lua index 999dbb0..7038eea 100644 --- a/src/fields.lua +++ b/src/fields.lua @@ -323,7 +323,6 @@ local function rcp_fields(player, data, fields) elseif fields.enable_search then data.enable_search = true - return set_fs(player) elseif fields.filter and (fields.key_enter_field == "filter" or fields.search) then if fields.filter == "" then diff --git a/src/gui.lua b/src/gui.lua index 7f640ee..d74e93a 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -1351,6 +1351,8 @@ local function get_items_fs(fs, data, player, full_height) "style[filter;font_size=18;textcolor=#ccc]", fmt("field[%f,0.2;3.35,0.6;filter;;%s]", data.inv_width + 0.85, ESC(data.filter)), "field_close_on_enter[filter;false]") + + image(data.inv_width + 0.85, 0.75, 4, 0.01, PNG.search_outline_trim .. "^[opacity:100") else fs"style_type[label;font=italic;font_size=18]" label(data.inv_width + 0.9, 0.49, clr("#aaa", ES"Search...")) diff --git a/src/styles.lua b/src/styles.lua index 0d34018..18e1fc8 100644 --- a/src/styles.lua +++ b/src/styles.lua @@ -47,6 +47,7 @@ local PNG = { no_result = "i3_no_result.png", find_more = "i3_find_more.png", search_outline = "i3_search_outline.png", + search_outline_trim = "i3_search_outline_trim.png", cancel_hover = "i3_cancel.png^\\[brighten", search_hover = "i3_search.png^\\[brighten", @@ -85,6 +86,7 @@ local styles = string.format([[ style[pagenum,no_item,no_rcp;font=bold;font_size=18] style[search;fgimg=%s;content_offset=0] style[enable_search:hovered;bgimg=%s] + style[enable_search:pressed;bgimg=%s^[opacity:178] style[exit;fgimg=%s;fgimg_hovered=%s;content_offset=0] style[cancel;fgimg=%s;fgimg_hovered=%s;content_offset=0] style[prev_page,prev_recipe,prev_usage,prev_sort,prev_skin;fgimg=%s;fgimg_hovered=%s] @@ -102,7 +104,7 @@ local styles = string.format([[ ]], PNG.slot, PNG.search_hover, -PNG.search_outline, +PNG.search_outline, PNG.search_outline, PNG.exit, PNG.exit_hover, PNG.cancel, PNG.cancel_hover, PNG.prev, PNG.prev_hover, diff --git a/textures/i3_search_outline_trim.png b/textures/i3_search_outline_trim.png new file mode 100644 index 0000000000000000000000000000000000000000..7dd1a8bfaf957e4dc43f431ce32e67311a1e099a GIT binary patch literal 4912 zcmeHKX;f3!77idn5fBkj5irE5DoJieNF+ri0ip&FqM(9!b8`b%$iPhk0gEDt1Jntn zAmxbzl%YkOD&mYtEzSapC>E=zR4t$)@Km%X0TtKlAJ=;QXI668x##Tt?Y+PAoxO6_ z2m1S3SvXn{2m~vkA3umdFp33ZWAmZlx!33EN-%Cq6o+bp;CP}6SIV#$l&DEip+r=N z$p{49t-`FunQl|e*R+J!xVajQ2;11W?qKS|w{LP6h(ffd8n6xGt>PKqFspleu2{a? zd3B=G?%blhx-?t$#W1Mz2?edt)ZA&8XneY+4j+{-u-vjU`}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