Skip to content

Commit 374e68d

Browse files
committedNov 23, 2013
Fix rename modpack button not working, fixes #1019
1 parent fb150e0 commit 374e68d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎builtin/modmgr.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ end
318318
--------------------------------------------------------------------------------
319319
function modmgr.dialog_rename_modpack()
320320

321-
local mod = filterlist.get_list(modmgr.modlist)[modmgr.selected_mod]
321+
local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod]
322322

323323
local retval =
324324
"label[1.75,1;".. fgettext("Rename Modpack:") .. "]"..
@@ -672,10 +672,13 @@ end
672672
function modmgr.handle_rename_modpack_buttons(fields)
673673

674674
if fields["dlg_rename_modpack_confirm"] ~= nil then
675-
local mod = filterlist.get_list(modmgr.modlist)[modmgr.selected_mod]
675+
local mod = filterlist.get_list(modmgr.global_mods)[modmgr.selected_mod]
676676
local oldpath = engine.get_modpath() .. DIR_DELIM .. mod.name
677677
local targetpath = engine.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"]
678678
engine.copy_dir(oldpath,targetpath,false)
679+
modmgr.refresh_globals()
680+
modmgr.selected_mod = filterlist.get_current_index(modmgr.global_mods,
681+
filterlist.raw_index_by_uid(modmgr.global_mods, fields["te_modpack_name"]))
679682
end
680683

681684
return {

0 commit comments

Comments
 (0)
Please sign in to comment.