mirror of
https://github.com/minetest-mods/i3.git
synced 2025-07-02 00:20:23 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1e9c3ce55a | |||
1627172cce | |||
bd356e4a40 | |||
f26c6af9c4 |
1
init.lua
1
init.lua
@ -20,6 +20,7 @@ local function lf(path)
|
||||
end
|
||||
|
||||
i3 = {
|
||||
version = 173,
|
||||
data = core.deserialize(storage:get_string"data") or {},
|
||||
|
||||
settings = {
|
||||
|
@ -95,6 +95,10 @@ local function inv_fields(player, data, fields)
|
||||
data.waypoint_see = nil
|
||||
data.bag_rename = nil
|
||||
|
||||
if data.filter == "" then
|
||||
data.enable_search = nil
|
||||
end
|
||||
|
||||
elseif fields.trash then
|
||||
data.show_settings = nil
|
||||
data.confirm_trash = true
|
||||
@ -309,7 +313,7 @@ end
|
||||
local function rcp_fields(player, data, fields)
|
||||
local sb_rcp, sb_usg = fields.scrbar_rcp, fields.scrbar_usg
|
||||
|
||||
if fields.filter and fields.filter == "" then
|
||||
if data.filter == "" then
|
||||
data.enable_search = nil
|
||||
end
|
||||
|
||||
|
14
src/gui.lua
14
src/gui.lua
@ -38,7 +38,7 @@ local function weird_desc(str)
|
||||
end
|
||||
|
||||
local function snip(str, limit)
|
||||
return #str > limit and fmt("%s...", sub(str, 1, limit - 3)) or str
|
||||
return fmt("%s...", sub(str, 1, limit - 3))
|
||||
end
|
||||
|
||||
local function get_desc(item)
|
||||
@ -175,11 +175,11 @@ local function get_award_list(data, fs, ctn_len, yextra, award_list, awards_unlo
|
||||
local desc_lim, _desc = 39
|
||||
local icon_size = 1.1
|
||||
|
||||
if #title > title_lim then
|
||||
if utf8_len(title) > title_lim then
|
||||
_title = snip(title, title_lim)
|
||||
end
|
||||
|
||||
if #desc > desc_lim then
|
||||
if utf8_len(desc) > desc_lim then
|
||||
_desc = snip(desc, desc_lim)
|
||||
end
|
||||
|
||||
@ -318,7 +318,7 @@ local function get_waypoint_fs(fs, data, player, yextra, ctn_len)
|
||||
|
||||
local waypoint_name, lim = v.name, 18
|
||||
|
||||
if #v.name > lim then
|
||||
if utf8_len(v.name) > lim then
|
||||
waypoint_name = snip(waypoint_name, lim)
|
||||
end
|
||||
|
||||
@ -998,7 +998,7 @@ local function get_grid_fs(fs, data, rcp, is_recipe)
|
||||
if is_group(name) then
|
||||
groups = group_cache and group_cache.groups or extract_groups(name)
|
||||
name = group_cache and (group_cache.stereotype or group_cache.items[1]) or
|
||||
groups_to_items(groups)[1]
|
||||
groups_to_items(groups)[1] or ""
|
||||
end
|
||||
|
||||
local label = groups and "\nG" or ""
|
||||
@ -1189,12 +1189,12 @@ local function get_header(fs, data)
|
||||
local Y1 = data.yoffset + 0.47
|
||||
local Y2 = Y1 + 0.5
|
||||
|
||||
if #desc > desc_lim then
|
||||
if utf8_len(desc) > desc_lim then
|
||||
tooltip(X, Y1 - 0.1, 5.7, 0.24, desc)
|
||||
desc = snip(desc, desc_lim)
|
||||
end
|
||||
|
||||
if #tech_name > name_lim then
|
||||
if utf8_len(tech_name) > name_lim then
|
||||
tooltip(X, Y2 - 0.1, 5.7, 0.24, tech_name)
|
||||
tech_name = snip(tech_name, name_lim)
|
||||
end
|
||||
|
Reference in New Issue
Block a user