Added Buddies to Damage Meter UI

This commit is contained in:
GreenComfyTea
2023-01-02 11:46:10 +02:00
parent 592defcd99
commit 575b46c70d
20 changed files with 949 additions and 517 deletions

View File

@@ -39,7 +39,7 @@ function unicode_helpers.map(s, f, no_subs)
for b, e in s:gmatch("()" .. pattern .. "()") do
i = i + 1;
local c = e - b;
f(i, c, b)
f(i, c, b);
end
else
for b, c in s:gmatch("()(" .. pattern .. ")") do
@@ -51,6 +51,34 @@ end
-- THE REST
-- returns the number of characters in a UTF-8 string
function unicode_helpers.len(s)
-- count the number of non-continuing bytes
return select(2, s:gsub('[^\128-\193]', ''));
end
-- replace all utf8 chars with mapping
function unicode_helpers.replace(s, map)
return s:gsub(pattern, map);
end
-- reverse a utf8 string
function unicode_helpers.reverse(s)
-- reverse the individual greater-than-single-byte characters
s = s:gsub(pattern,function (c)
return #c > 1 and c:reverse()
end);
return s:reverse();
end
-- strip non-ascii characters from a utf8 string
function unicode_helpers.strip(s)
return s:gsub(pattern, function(c)
return #c > 1 and '';
end);
end
-- generator for the above -- to iterate over all utf8 chars
function unicode_helpers.chars(s, no_subs)
return coroutine.wrap(function()