From 325d6f30be8dfb4bdd07a7cfbb143b3d4523b3ae Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 25 Sep 2022 15:37:32 +0200 Subject: [PATCH] :rocket: Greatly improve Progressive Mode look --- init.lua | 9 ++++-- settingtypes.txt | 3 -- sounds/i3_achievement.ogg | Bin 0 -> 23557 bytes src/api.lua | 6 ++-- src/callbacks.lua | 12 +++++++- src/common.lua | 2 +- src/fields.lua | 6 ++-- src/gui.lua | 61 ++++++++++++++++++++++++++----------- src/hud.lua | 4 +-- src/progressive.lua | 18 ++++++++--- src/styles.lua | 2 +- textures/i3_book.png | Bin 262 -> 0 bytes textures/i3_cube.png | Bin 0 -> 404 bytes textures/i3_heart_grey.png | Bin 147 -> 0 bytes 14 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 sounds/i3_achievement.ogg delete mode 100644 textures/i3_book.png create mode 100644 textures/i3_cube.png delete mode 100644 textures/i3_heart_grey.png diff --git a/init.lua b/init.lua index cf84bd0..091ccb0 100644 --- a/init.lua +++ b/init.lua @@ -36,9 +36,8 @@ i3 = { hud_speed = 1, hud_timer_max = 1.5, - damage_enabled = core.settings:get_bool"enable_damage", + damage_enabled = core.settings:get_bool"enable_damage", progressive_mode = core.settings:get_bool"i3_progressive_mode", - item_compression = core.settings:get_bool("i3_item_compression", true), }, categories = { @@ -52,6 +51,7 @@ i3 = { saves = { -- Metadata to save bag = true, home = true, + collapse = true, font_size = true, hide_tabs = true, waypoints = true, @@ -61,6 +61,11 @@ i3 = { legacy_inventory = true, }, + default_enabled = { + collapse = true, + inv_compress = true, + }, + files = { api = lf"/src/api.lua", bags = lf"/src/bags.lua", diff --git a/settingtypes.txt b/settingtypes.txt index 1a45de6..a97f54a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1,5 +1,2 @@ # The progressive mode shows recipes you can craft from items you ever had in your inventory. i3_progressive_mode (Learn crafting recipes progressively) bool false - -# Regroup the items of the same type in the item list. -i3_item_compression (Regroup items of the same type) bool true diff --git a/sounds/i3_achievement.ogg b/sounds/i3_achievement.ogg new file mode 100644 index 0000000000000000000000000000000000000000..df38d5bc3dbb153373ec29e6f061fc05e1994071 GIT binary patch literal 23557 zcmc$`cU)8V`T+c#EJ6sFK!AW~!%hGZ5H;ZFVG0Nc0a=0#ONOHX1ZVAGLqLj%2#Vf- zAVc&5YKx<7*i(v%+xCZ>sq-Pe{He=R2Rh4(n1gpke{IhNVj+?9ab`kVmgWbVI!^NippGQwzT1d(nvwr~X+~=9q&oVw=z0I| z|K-(4e?N^Y-i=CAq&lw4Oc8BKONf}8T;wluadL5TTJGd363dd4vJ=y`rHFjC<)meP zylrdpw(Szl5(M-899EuQ5d@F`LQkF@^K@c``-q`=xk;nSb4)V4z;nv{gq2r``_R&1 zVd9z#NlMSr+^Nd-pc&9)78#Q1zvx+g)(K(cM8>QLTTetO6B*jp*s5@QR+U-d{Qj<9 zrbN>(SFlEz(IUiFlNq*JHLb1AUsPpIx?$_7s92VHW~t_`Fhws@M>ETiX1*7inah`c zG5x;ZT<5uua?SK}t!>WFjIz#XX2DCd_rHl;lMJB}K-C~tJ{0TmOuIQS0>C3P1Zxfm z)^?eVU$xR@>qavX7{JDUenm}w%I2twO=-t%b~lQTG}@i&P8;iX81H^@(Q$6LA3#W` zU{E2@nj4n{z?O@ZC!`gRqpF&tk82eabJ)nl3@mPgdXjyz-kj|IhdPWkmpx zCr%R5|3(4Z+|DAVpKO-r$PP`V@;lVcF`{SzLzT5NTdlc}H zs07lI++i!Wc|n4});r^*2wP9AqQ-X3TCu;)=Xv(j?-{>(>9dk^DcuCf~b}99NV4?fI>7H{;@NW&hvbb4RBbKvg_O zsN>tOqREdlhnz|RctD+yDj)eFJ}RuEt8CJ0Qg+p}>^jm~x^S)wA_k#`FRF14ZC24W zC)19%Xpr6Bt~}Y+-kyHsWZM7xo7P}{3P2lR!ElDznhdky49%(LAS|MT2*4}U%qP=f zxXN`cp7FZ(H*aG@mt}`VZv7hx*hTXi&RU7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`X!tlXQiJ>q^`*Q zEw98i>s_=X{X2}>&+HUB%>L)rAlSgH;yZQ$U?)gU!o@%g7=*(j*{UN(>74Sl?o68nAT_BFh%UZ(o zG+wfq(Tax+;sg7IE_msOh`fuchZk`~0(H;Zlc1a4zumzEj88w9h|`GS5D#{{stLNL zzxYfIN7h{}jQ1pTxW6baBP?s4tpy`$no8q~@wW{3hQ_NBOS}>&oq_lo;2pyz_#(r3 zm=Bi;|M=qaVler0HcfmjPM$HbL9P1Ud*m^2+nZl~A_U2ckhk3lS;cLkLh;(-LW*Ev zS9$0Lt(|j2ep~aPvhYzVKYWe;FF9iljLW*M%f>U*F;0v<)AzyG?{Gxbm#WG3)32(H Wgm&c1-=c>=@%qJVe;ogt=YIh@sSFqZ literal 0 HcmV?d00001 diff --git a/src/api.lua b/src/api.lua index bf8b0dc..fb8ba00 100644 --- a/src/api.lua +++ b/src/api.lua @@ -3,7 +3,7 @@ local make_fs, get_inventory_fs = i3.files.gui() IMPORT("gmatch", "split") IMPORT("S", "err", "fmt", "reg_items") -IMPORT("sorter", "sort_inventory") +IMPORT("sorter", "sort_inventory", "play_sound") IMPORT("sort", "concat", "copy", "insert", "remove") IMPORT("true_str", "true_table", "is_str", "is_func", "is_table", "clean_name") @@ -323,8 +323,10 @@ function i3.hud_notif(name, msg, img) data.show_hud = true data.hud_msg = msg + play_sound(name, "i3_achievement", 1.0) + if img then - data.hud_img = fmt("%s^[resize:16x16", img) + data.hud_img = fmt("%s^[resize:64x64", img) end end diff --git a/src/callbacks.lua b/src/callbacks.lua index 166d6f6..7015f22 100644 --- a/src/callbacks.lua +++ b/src/callbacks.lua @@ -203,6 +203,17 @@ local function init_data(player, info) local name = player:get_player_name() i3.data[name] = i3.data[name] or {} local data = i3.data[name] + local default = {} + + for k in pairs(i3.default_enabled) do + default[k] = data[k] + + if data[k] == nil then + default[k] = true + end + + data[k] = default[k] + end data.player_name = name data.filter = "" @@ -215,7 +226,6 @@ local function init_data(player, info) data.ignore_hotbar = false data.auto_sorting = false data.reverse_sorting = false - data.inv_compress = true data.crafting_counts = {} data.sort = 1 data.tab = 1 diff --git a/src/common.lua b/src/common.lua index 43c31f8..806dcf9 100644 --- a/src/common.lua +++ b/src/common.lua @@ -328,7 +328,7 @@ local function apply_recipe_filters(recipes, player) end local function compression_active(data) - return i3.settings.item_compression and not next(i3.recipe_filters) and data.filter == "" + return data.collapse and not next(i3.recipe_filters) and data.filter == "" end local function compressible(item, data) diff --git a/src/fields.lua b/src/fields.lua index 65405cc..b007d95 100644 --- a/src/fields.lua +++ b/src/fields.lua @@ -2,12 +2,12 @@ local set_fs = i3.set_fs IMPORT("min", "max", "vec_round") IMPORT("reg_items", "reg_aliases") -IMPORT("S", "random", "translate", "ItemStack") IMPORT("sort", "copy", "insert", "remove", "indexof") +IMPORT("S", "random", "translate", "compressible", "ItemStack") IMPORT("fmt", "find", "match", "sub", "lower", "split", "toupper") +IMPORT("valid_item", "get_stack", "craft_stack", "clean_name", "check_privs", "safe_teleport") IMPORT("msg", "is_fav", "pos_to_str", "str_to_pos", "add_hud_waypoint", "play_sound", "reset_data") IMPORT("search", "sort_inventory", "sort_by_category", "get_recipes", "get_detached_inv", "update_inv_size") -IMPORT("valid_item", "get_stack", "craft_stack", "clean_name", "compressible", "check_privs", "safe_teleport") local function inv_fields(player, data, fields) local name = data.player_name @@ -40,6 +40,8 @@ local function inv_fields(player, data, fields) if str == "legacy_inventory" then update_inv_size(player, data) + elseif str == "collapse" then + search(data) end elseif sub(field, 1, 8) == "setting_" then diff --git a/src/gui.lua b/src/gui.lua index 9e79b3f..fde898f 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -12,8 +12,8 @@ IMPORT("find", "match", "sub", "upper") IMPORT("clr", "ESC", "msg", "check_privs") IMPORT("compression_active", "compressible") IMPORT("min", "max", "floor", "ceil", "round") -IMPORT("reg_items", "reg_tools", "reg_entities") IMPORT("true_str", "is_fav", "is_num", "str_to_pos") +IMPORT("reg_items", "reg_nodes", "reg_tools", "reg_entities") IMPORT("get_bag_description", "get_detached_inv", "get_recipes") IMPORT("S", "ES", "translate", "ItemStack", "toupper", "utf8_len") IMPORT("maxn", "sort", "concat", "copy", "insert", "remove", "unpack") @@ -435,7 +435,7 @@ local function get_container(fs, data, player, yoffset, ctn_len, award_list, awa for i = 1, 10 do image(heart_x + ((i - 1) * (heart_size + 0.1)), heart_h, - heart_size, heart_size, PNG.heart_grey) + heart_size, heart_size, PNG.heart .. "^[colorize:#232428") end for i = 1, hearts do @@ -583,7 +583,8 @@ local function show_settings(fs, data) image_button(6.17, 10.75, 1, 0.5, "", "confirm_trash_no", "No") elseif data.show_settings then - image(2.2, 9, 6, 2.35, PNG.bg_content) + fs"container[-0.06,0]" + image(2.2, 9, 6.1, 2.35, PNG.bg_content) local show_home = data.show_setting == "home" local show_style = data.show_setting == "style" @@ -606,9 +607,9 @@ local function show_settings(fs, data) local X = 2.5 button(X, 9.1, 1.6, 0.55, "setting_home", "Home") - button(X + 1.6, 9.1, 1.6, 0.55, "setting_style", "Style") - button(X + 3.2, 9.1, 1.6, 0.55, "setting_sorting", "Sorting") - image_button(X + 5, 9.2, 0.25, 0.25, PNG.cancel_hover .. "^\\[brighten", "close_settings", "") + button(X + 1.7, 9.1, 1.6, 0.55, "setting_style", "Style") + button(X + 3.38, 9.1, 1.6, 0.55, "setting_sorting", "Sorting") + image_button(X + 5.12, 9.2, 0.25, 0.25, PNG.cancel_hover .. "^\\[brighten", "close_settings", "") if show_home then local coords, c, str = {"X", "Y", "Z"}, 0, ES"No home set" @@ -622,20 +623,24 @@ local function show_settings(fs, data) end) end - hypertext(2.1, 9.9, 6, 0.6, "home_pos", fmt("
%s
", str)) - image_button(4.2, 10.4, 1.8, 0.7, "", "set_home", "Set home") + hypertext(2.2, 9.9, 6, 0.6, "home_pos", fmt("
%s
", str)) + image_button(4.3, 10.4, 1.8, 0.7, "", "set_home", "Set home") elseif show_style then checkbox(2.6, 9.95, "cb_hide_tabs", "Hide tabs", tostring(data.hide_tabs)) checkbox(2.6, 10.4, "cb_legacy_inventory", "Legacy inventory", tostring(data.legacy_inventory)) checkbox(2.6, 10.85, "cb_wielditem_hud", "HUD description", tostring(data.wielditem_hud)) + if not next(i3.recipe_filters) then + checkbox(5.3, 10.85, "cb_collapse", "Collapse inventory", tostring(data.collapse)) + end + local sign = (data.font_size > 0 and "+") or (data.font_size > 0 and "-") or "" label(5.3, 9.95, ES"Font size" .. fmt(": %s", sign .. data.font_size)) local range = 5 fs("scrollbaroptions[min=-%u;max=%u;smallstep=1;largestep=1;thumbsize=2]", range, range) - fs("scrollbar[5.3,10.25;2.45,0.3;horizontal;sb_font_size;%d]", data.font_size) + fs("scrollbar[5.3,10.2;2.45,0.3;horizontal;sb_font_size;%d]", data.font_size) fs("tooltip[cb_hide_tabs;%s;#707070;#fff]", ES"Enable this option to change the style of the right panel") @@ -643,12 +648,14 @@ local function show_settings(fs, data) ES"Enable this option to set the classic inventory size in Minetest") fs("tooltip[cb_wielditem_hud;%s;#707070;#fff]", ES"Enable this option to show the wielded item description in your HUD") + fs("tooltip[cb_collapse;%s;#707070;#fff]", + ES"Enable this option to collapse certain items in your inventory") elseif show_sorting then checkbox(2.6, 9.95, "cb_inv_compress", "Compression", tostring(data.inv_compress)) checkbox(2.6, 10.4, "cb_reverse_sorting", "Reverse mode", tostring(data.reverse_sorting)) checkbox(2.6, 10.85, "cb_ignore_hotbar", "Ignore hotbar", tostring(data.ignore_hotbar)) - checkbox(5.4, 9.95, "cb_auto_sorting", "Automation", tostring(data.auto_sorting)) + checkbox(5.3, 9.95, "cb_auto_sorting", "Automation", tostring(data.auto_sorting)) local methods = {} @@ -657,13 +664,13 @@ local function show_settings(fs, data) insert(methods, name) end - label(5.4, 10.4, ES"Sorting method:") - fs("dropdown[%f,%f;2.4,0.5;dd_sorting_method;%s;%u;true]", - 5.4, 10.6, concat(methods, ","), data.sort) + label(5.3, 10.4, ES"Sorting method:") + fs("dropdown[%f,%f;2.6,0.5;dd_sorting_method;%s;%u;true]", + 5.3, 10.6, concat(methods, ","), data.sort) local desc = i3.sorting_methods[data.sort].description if desc then - tooltip(5.4, 10.6, 2.4, 0.5, ESC(desc)) + tooltip(5.3, 10.6, 2.4, 0.5, ESC(desc)) end fs("tooltip[cb_inv_compress;%s;#707070;#fff]", @@ -675,6 +682,8 @@ local function show_settings(fs, data) fs("tooltip[cb_auto_sorting;%s;#707070;#fff]", ES"Enable this option to sort your inventory automatically") end + + fs"container_end[]" end end @@ -1356,7 +1365,7 @@ local function hide_items(player, data) data.items = new end - if not core.is_creative_enabled(data.player_name) then + if not core.is_creative_enabled(data.player_name) and not next(i3.recipe_filters) then local new = {} for i = 1, #data.items do @@ -1509,7 +1518,24 @@ local function get_items_fs(fs, data, player, full_height) local Y = round((i % ipp - X) / rows + 1, 0) Y -= (Y * 0.085) + 0.92 - insert(fs, fmt("item_image_button", X, Y, size, size, name, item, "")) + local item_btn = fmt("item_image_button", X, Y, size, size, name, item, "") + + if next(i3.recipe_filters) then + if data.items_progress[item] then + insert(fs, item_btn) + else + local col = "^\\[colorize:#232428^\\[opacity:245" + local img = reg_items[item].inventory_image .. col + + if reg_nodes[item] then + img = PNG.cube .. col + end + + insert(fs, fmt("image", X, Y, size, size, img)) + end + else + insert(fs, item_btn) + end if compressible(item, data) then local expand = data.expand == name @@ -1652,10 +1678,9 @@ local function make_fs(player, data) __call = function(t, ...) local args = {...} - if select("#", ...) > 1 then + if #args > 1 then local arg1 = args[1] local elem = fs_elements[arg1] - insert(t, fmt(elem or arg1, select(2, ...))) else insert(t, concat(args)) diff --git a/src/hud.lua b/src/hud.lua index 9044351..e790851 100644 --- a/src/hud.lua +++ b/src/hud.lua @@ -26,7 +26,7 @@ local function init_hud(player) hud_elem_type = "image", position = {x = 0.79, y = 1.02}, alignment = {x = 1, y = 1}, - scale = {x = 4, y = 4}, + scale = {x = 1, y = 1}, text = "", z_index = 0xDEAD, }, @@ -59,7 +59,7 @@ local function show_hud(player, data) -- 2 calls for the notification's back and forth. local hud_info_bg = player:hud_get(data.hud.bg) - local dt = 0.016 + local dt = 0.025 if hud_info_bg.position.y <= 0.9 then data.show_hud = false diff --git a/src/progressive.lua b/src/progressive.lua index e206107..1797aa1 100644 --- a/src/progressive.lua +++ b/src/progressive.lua @@ -2,11 +2,12 @@ local set_fs = i3.set_fs local hud_notif = i3.hud_notif local POLL_FREQ = 0.25 +IMPORT("reg_items", "reg_nodes") IMPORT("fmt", "search", "table_merge", "array_diff") IMPORT("is_group", "extract_groups", "item_has_groups", "apply_recipe_filters") local function get_filtered_items(player, data) - local items, known, c = {}, 0, 0 + local items, known = {}, 0 for i = 1, #i3.init_items do local item = i3.init_items[i] @@ -17,8 +18,7 @@ local function get_filtered_items(player, data) usages = #apply_recipe_filters(usages or {}, player) if recipes > 0 or usages > 0 then - c++ - items[c] = item + items[item] = true known += recipes + usages end end @@ -133,10 +133,18 @@ local function poll_new_items(player, data, join) if data.discovered > 0 then local msg = fmt("%u new recipe%s unlocked!", data.discovered, data.discovered > 1 and "s" or "") - hud_notif(data.player_name, msg, "i3_book.png") + local last_discovered = diff[1] + local img = reg_items[last_discovered].inventory_image + + if reg_nodes[last_discovered] then + local id = core.get_content_id(last_discovered) + img = i3.cubes[id] or img + end + + hud_notif(data.player_name, msg, img) end - data.items_raw = items + data.items_progress = items data.itab = 1 search(data) diff --git a/src/styles.lua b/src/styles.lua index b6c549f..6ad18f5 100644 --- a/src/styles.lua +++ b/src/styles.lua @@ -12,7 +12,6 @@ local PNG = { search = "i3_search.png", heart = "i3_heart.png", heart_half = "i3_heart_half.png", - heart_grey = "i3_heart_grey.png", prev = "i3_next.png^\\[transformFX", next = "i3_next.png", arrow = "i3_arrow.png", @@ -54,6 +53,7 @@ local PNG = { all = "i3_all.png", node = "i3_node.png", item = "i3_item.png", + cube = "i3_cube.png", cancel_hover = "i3_cancel.png^\\[brighten", search_hover = "i3_search.png^\\[brighten", diff --git a/textures/i3_book.png b/textures/i3_book.png deleted file mode 100644 index 9332b368648d6cbbe9204ca3df53401c1eda5d39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmV+h0r~!kP)WXNmso3cAiMG-%l?(Bbm zcAA)3(nO8S{{tM-U8MKtW!>?z&|-Z_%Blm{Xuh@nWK}2xRRTzs`JCO2Zx2)jD9oqp zEjLTR1Zi~!F`%40oNaPZa}G@Ac5iCwaUTJqH-{i4V+QgA@XVo<3?y12W76P~XQs!L z^xeO}R=MDTsOc%$1#rMcq^(oy&7s)^NSfgB%-rN!fTRh$UIb{OFOo8NDdr}1i~s-t M07*qoM6N<$f;XaU9RL6T diff --git a/textures/i3_cube.png b/textures/i3_cube.png new file mode 100644 index 0000000000000000000000000000000000000000..3f3d27a73c13a20281b5d0cf53f28e2f73f87dbf GIT binary patch literal 404 zcmV;F0c-w=P)w@(glkm zOi+jO`!)&AJLh)yz3-=do=aEmUg;B_CqqW|N&0~@WjR2J3jkVdx(5{T`I&Q8-2w7= z^!XiwPa%E40>`}bS3YQxPY;lz!7KlzhsV5qz$|s188t67n6n3%qQ(Q`=8-xx$pKj^ zbcmaP8k6w>6YO$L(%exc8waq(6}Hl*G9KXj#@S4ZjnM!_d<^L%;$9BEE=Arrn=$w- zM+4Sq^NE|>Qwjr4ahcmNpy?FQQGfyzpa2CZKmiI+fC3bt00k&O0b#)K64v(b*QF{N z2-ub@sh-%AtLeJz%N3Px9LZI+J-lIkak^!7pA)8~>UzT&IjONR3tl yH_r8J2LU^B!)3&cb2r^~IglK$4`tW$#LpMPDgjszyWEKY0000>$j+0wnXI=SKjkC{Gv15RPcwGL1Diy(^vXc=_?tOLIc2d{x8cyBE)noP6-n%Xf)I6Ps_| wKD}i7