From 2d6951cd0cc15f57272c8243dc6ca2708cb3fb19 Mon Sep 17 00:00:00 2001 From: R3R3R3 <24302636+R3R3R3@users.noreply.github.com> Date: Sat, 4 Apr 2020 17:41:50 -0400 Subject: [PATCH] Config value for disabling the cache load progress bar (#101) --- init.lua | 9 ++++++++- settingtypes.txt | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 0c85a06..e97cdb1 100644 --- a/init.lua +++ b/init.lua @@ -12,6 +12,11 @@ local toolrepair local progressive_mode = core.settings:get_bool("craftguide_progressive_mode") local sfinv_only = core.settings:get_bool("craftguide_sfinv_only") and rawget(_G, "sfinv") +local enable_cache_progress_bar = core.settings:get_bool("craftguide_enable_cache_progress_bar") + +if enable_cache_progress_bar == nil then + enable_cache_progress_bar = true +end local http = core.request_http_api() @@ -1494,7 +1499,9 @@ local function get_init_items() bar = bar .. (i <= percent / (100 / len) and full_char or empty_char) end - iop(fmt("[craftguide] Caching data %s %u%%\r", bar .. "]", percent)) + if enable_cache_progress_bar then + iop(fmt("[craftguide] Caching data %s %u%%\r", bar .. "]", percent)) + end if show_item(def) then if not fuel_cache[name] then diff --git a/settingtypes.txt b/settingtypes.txt index 14198ae..c087ecf 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -2,4 +2,7 @@ craftguide_progressive_mode (Progressive Mode) bool false # Integration in the default Minetest Game inventory. -craftguide_sfinv_only (Sfinv only) bool false \ No newline at end of file +craftguide_sfinv_only (Sfinv only) bool false + +# Display the cache-building progress bar in the server console. +craftguide_enable_cache_progress_bar (Enable console cache progress bar) bool true