aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSfan5 <sfan5@live.de>2013-11-23 18:47:54 +0100
committerSfan5 <sfan5@live.de>2013-11-23 19:06:35 +0100
commit374e68d205cac28df7321020feb348511932ac30 (patch)
treea60be6361eb07acb35d9e32ffd682422185340d3
parentfb150e05043022ff2bb96ea892a31c632f130aca (diff)
downloadminetest-374e68d205cac28df7321020feb348511932ac30.tar.gz
minetest-374e68d205cac28df7321020feb348511932ac30.tar.bz2
minetest-374e68d205cac28df7321020feb348511932ac30.zip
Fix rename modpack button not working, fixes #1019
-rw-r--r--builtin/modmgr.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/modmgr.lua b/builtin/modmgr.lua
index 7b50f0882..7eb324b61 100644
--- a/builtin/modmgr.lua
+++ b/builtin/modmgr.lua
@@ -318,7 +318,7 @@ end
--------------------------------------------------------------------------------
function modmgr.dialog_rename_modpack()
- local mod = filterlist.get_list(modmgr.modlist)[modmgr.selected_mod]
+ local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod]
local retval =
"label[1.75,1;".. fgettext("Rename Modpack:") .. "]"..
@@ -672,10 +672,13 @@ end
function modmgr.handle_rename_modpack_buttons(fields)
if fields["dlg_rename_modpack_confirm"] ~= nil then
- local mod = filterlist.get_list(modmgr.modlist)[modmgr.selected_mod]
+ local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod]
local oldpath = engine.get_modpath() .. DIR_DELIM .. mod.name
local targetpath = engine.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"]
engine.copy_dir(oldpath,targetpath,false)
+ modmgr.refresh_globals()
+ modmgr.selected_mod = filterlist.get_current_index(modmgr.global_mods,
+ filterlist.raw_index_by_uid(modmgr.global_mods, fields["te_modpack_name"]))
end
return {