From 4cf900c779b0c3562d7c08318f1a69e1be08136c Mon Sep 17 00:00:00 2001 From: Gregor Parzefall <82708541+grorp@users.noreply.github.com> Date: Sat, 23 Sep 2023 18:20:23 +0200 Subject: [PATCH] Fix error when enabling texture packs (#13829) --- builtin/mainmenu/tab_content.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/builtin/mainmenu/tab_content.lua b/builtin/mainmenu/tab_content.lua index 7fcd8bf09..2a184cd2c 100644 --- a/builtin/mainmenu/tab_content.lua +++ b/builtin/mainmenu/tab_content.lua @@ -18,11 +18,7 @@ local packages_raw, packages -local function on_change(type) - if type ~= "ENTER" then - return - end - +local function update_packages() if not pkgmgr.global_mods then pkgmgr.refresh_globals() end @@ -48,7 +44,17 @@ local function on_change(type) is_equal, nil, {}) end +local function on_change(type) + if type == "ENTER" then + update_packages() + end +end + local function get_formspec(tabview, name, tabdata) + if not packages then + update_packages() + end + if not tabdata.selected_pkg then tabdata.selected_pkg = 1 end