firstrun: simplify question dialog

This commit is contained in:
shagu
2017-04-19 23:36:05 +02:00
parent f4866ae7a8
commit dbc0765b0b
2 changed files with 35 additions and 15 deletions
+12 -5
View File
@@ -24,6 +24,7 @@ pfUI:RegisterModule("firstrun", function ()
"This will enable settings that can be found in the Interface section of your client.\n"..
"Options like Buff Durations, Instant Quest Text, Auto Selfcast and others will be set.\n")
local all_yes = false
function pfUI.firstrun:NextStep()
if pfUI_init and next(pfUI_init) == nil then
local yes = function()
@@ -34,15 +35,16 @@ pfUI:RegisterModule("firstrun", function ()
local no = function()
this:GetParent():Hide()
pfUI_init["welcome"] = true
all_yes = true
pfUI.firstrun:NextStep()
end
CreateQuestionDialog("Welcome to |cff33ffccpf|cffffffffUI|r!\n\n"..
"I'm the first run wizzard that will guide you through some basic configuration.\n"..
"You'll now be prompted for several questions. To get a default installation,\n"..
"you might want to click \"Yes\" everywhere. A few settings are client settings\n"..
"(e.g chat questions) so if you don't want to lose your chat configurations, you\n"..
"should be careful with your choices.\n\n"..
"Visit |cff33ffcchttp://shagu.org|r to check for the latest version.", yes, no)
"If you're lazy, feel free to hit the \"Use Defaults\" button. If you whish to run this\n"..
"dialog again, go to the settings and hit the \"Reset Firstrun\" button.\n\n"..
"Visit |cff33ffcchttp://shagu.org|r to check for the latest version.", { "Customize", yes } , { "Use Defaults", no })
return
end
@@ -64,6 +66,11 @@ pfUI:RegisterModule("firstrun", function ()
pfUI.firstrun:NextStep()
end
if all_yes == true then
yes()
return
end
if step.cmpnt and step.cmpnt == "edit" then
CreateQuestionDialog(step.descr, yes, no, true)
else