Ask if want to import Auto Run Scripts within the profile imported
This commit is contained in:
@@ -4027,19 +4027,35 @@ do
|
||||
icontexcoords = {1, 0, 0, 1},
|
||||
},
|
||||
|
||||
{--import profile
|
||||
type = "execute",
|
||||
func = function(self)
|
||||
_detalhes:ShowImportWindow("", function(profileString)
|
||||
--[=[
|
||||
function(profileString)
|
||||
if (type(profileString) ~= "string" or string.len(profileString) < 2) then
|
||||
return
|
||||
end
|
||||
|
||||
--prompt text panel returns what the user inserted in the text field in the first argument
|
||||
DF:ShowTextPromptPanel(Loc["STRING_OPTIONS_IMPORT_PROFILE_NAME"] .. ":", function(newProfileName)
|
||||
Details:ImportProfile (profileString, newProfileName)
|
||||
Details:ImportProfile (profileString, newProfileName, importAutoRunCode)
|
||||
end)
|
||||
end, Loc["STRING_OPTIONS_IMPORT_PROFILE_PASTE"])
|
||||
end
|
||||
--]=]
|
||||
|
||||
{--import profile
|
||||
type = "execute",
|
||||
func = function(self)
|
||||
local importConfirmationCallback = function(profileString)
|
||||
if (type(profileString) ~= "string" or string.len(profileString) < 2) then
|
||||
return
|
||||
end
|
||||
|
||||
--prompt text panel returns what the user inserted in the text field in the first argument
|
||||
local askForNewProfileName = function(newProfileName, importAutoRunCode)
|
||||
Details:ImportProfile(profileString, newProfileName, importAutoRunCode, true)
|
||||
end
|
||||
Details.ShowImportProfileConfirmation(Loc["STRING_OPTIONS_IMPORT_PROFILE_NAME"] .. ":", askForNewProfileName)
|
||||
end
|
||||
|
||||
Details:ShowImportWindow("", importConfirmationCallback, Loc["STRING_OPTIONS_IMPORT_PROFILE_PASTE"])
|
||||
end,
|
||||
name = Loc["STRING_OPTIONS_IMPORT_PROFILE"],
|
||||
icontexture = [[Interface\BUTTONS\UI-GuildButton-OfficerNote-Up]],
|
||||
|
||||
Reference in New Issue
Block a user