mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Move values the mainmenu caches to dedicated files (#14433)
This commit is contained in:
parent
bb6782ca58
commit
6c6e48f006
16 changed files with 142 additions and 132 deletions
|
@ -15,15 +15,30 @@
|
|||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
---- IMPORTANT ----
|
||||
-- This whole file can be removed after a while.
|
||||
-- It was only directly useful for upgrades from 5.7.0 to 5.8.0, but
|
||||
-- maybe some odd fellow directly upgrades from 5.6.1 to 5.9.0 in the future...
|
||||
-- see <https://github.com/minetest/minetest/pull/13850> in case it's not obvious
|
||||
---- ----
|
||||
|
||||
local SETTING_NAME = "no_mtg_notification"
|
||||
|
||||
function check_reinstall_mtg()
|
||||
if core.settings:get_bool("no_mtg_notification") then
|
||||
-- used to be in minetest.conf
|
||||
if core.settings:get_bool(SETTING_NAME) then
|
||||
cache_settings:set_bool(SETTING_NAME, true)
|
||||
core.settings:remove(SETTING_NAME)
|
||||
end
|
||||
|
||||
if cache_settings:get_bool(SETTING_NAME) then
|
||||
return
|
||||
end
|
||||
|
||||
local games = core.get_games()
|
||||
for _, game in ipairs(games) do
|
||||
if game.id == "minetest" then
|
||||
core.settings:set_bool("no_mtg_notification", true)
|
||||
cache_settings:set_bool(SETTING_NAME, true)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
@ -37,7 +52,7 @@ function check_reinstall_mtg()
|
|||
end
|
||||
end
|
||||
if not mtg_world_found then
|
||||
core.settings:set_bool("no_mtg_notification", true)
|
||||
cache_settings:set_bool(SETTING_NAME, true)
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -87,7 +102,7 @@ local function buttonhandler(this, fields)
|
|||
end
|
||||
|
||||
if fields.dismiss then
|
||||
core.settings:set_bool("no_mtg_notification", true)
|
||||
cache_settings:set_bool("no_mtg_notification", true)
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue