mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-23 03:13:44 +01:00
Improve loading bar
This commit is contained in:
parent
189a3ff971
commit
63769603c4
6
init.lua
6
init.lua
@ -1473,17 +1473,17 @@ local function get_init_items()
|
|||||||
last_str = str
|
last_str = str
|
||||||
end
|
end
|
||||||
|
|
||||||
local full_char, empty_char = "▰", "▱"
|
local full_char, empty_char = "#", " "
|
||||||
|
|
||||||
for name, def in pairs(reg_items) do
|
for name, def in pairs(reg_items) do
|
||||||
ic = ic + 1
|
ic = ic + 1
|
||||||
local percent, bar, len = (ic * 100) / it, "", 20
|
local percent, bar, len = (ic * 100) / it, "[", 20
|
||||||
|
|
||||||
for i = 1, len do
|
for i = 1, len do
|
||||||
bar = bar .. (i <= percent / (100 / len) and full_char or empty_char)
|
bar = bar .. (i <= percent / (100 / len) and full_char or empty_char)
|
||||||
end
|
end
|
||||||
|
|
||||||
iop(fmt("[craftguide] Caching data %s %u%%\r", bar, percent))
|
iop(fmt("[craftguide] Caching data %s %u%%\r", bar .. "]", percent))
|
||||||
|
|
||||||
if show_item(def) then
|
if show_item(def) then
|
||||||
if not fuel_cache[name] then
|
if not fuel_cache[name] then
|
||||||
|
Loading…
Reference in New Issue
Block a user