Skip to content

Commit

Permalink
Fix rename modpack button not working, fixes #1019
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Nov 23, 2013
1 parent fb150e0 commit 374e68d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions builtin/modmgr.lua
Expand Up @@ -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:") .. "]"..
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 374e68d

Please sign in to comment.