Some UI improvements + fix bug with custom tabs

This commit is contained in:
Jean-Patrick Guerrero
2022-06-30 01:04:22 +02:00
parent c91f787cb2
commit b2c8447971
3 changed files with 28 additions and 14 deletions

View File

@ -77,6 +77,10 @@ local function toupper(str)
return str:gsub("%f[%w]%l", upper):gsub("_", " ")
end
local function utf8_len(str)
return #str:gsub("[\128-\191]", "") -- Arguably working duct-tape code
end
local function get_bag_description(data, stack)
local desc = translate(data.lang_code, stack:get_description())
desc = split(desc, "(")[1] or desc
@ -748,6 +752,7 @@ local _ = {
match = string.match,
gmatch = string.gmatch,
toupper = toupper,
utf8_len = utf8_len,
-- Table
maxn = table.maxn,