Ask if want to import Auto Run Scripts within the profile imported

This commit is contained in:
Tercio Jose
2022-12-31 16:41:55 -03:00
parent f9093a5476
commit 7c83f58794
2 changed files with 122 additions and 12 deletions
+22 -6
View File
@@ -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]],