-- LearnWizard.lua |
-- OpenRDX |
-- |
local ww = RDXUI.Wizard:new(); |
|
--------------------------------------------- |
-- Pg 1: Welcome |
--------------------------------------------- |
ww:RegisterPage(1, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Welcome to RDX 8"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "This is the first time you are using RDX, this quick tutorial will help you to learn how to use RDX.\n\nYou can close this tutorial at any time.\nGo to the menu Settings to reopen this tutorial."); |
lbl:SetWidth(250); lbl:SetHeight(90); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
local chk_hideLW = VFLUI.Checkbox:new(page); chk_hideLW:Show(); |
chk_hideLW:SetHeight(20); chk_hideLW:SetWidth(200); |
chk_hideLW:SetPoint("TOPLEFT", lbl, "BOTTOMLEFT", 0, -20); |
chk_hideLW:SetText("Not show this guide at startup."); |
if RDXG and RDXG.hideLW then chk_hideLW:SetChecked(true); else chk_hideLW:SetChecked(); end |
|
function page:GetDescriptor() |
if RDXG then RDXG.hideLW = chk_hideLW:GetChecked(); end |
return {}; |
end |
|
page.Destroy = VFL.hook(function(s) |
chk_hideLW:Destroy(); |
end, page.Destroy); |
|
wizard:OnNext(function(wiz) wiz:SetPage(2); end); |
--wizard:Final(); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
return true; |
end; |
}); |
|
ww:RegisterPage(2, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "RDX Main Menu"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "You should see a small RDX icon in the center of the screen.\nYou can move it with the key shift.\n\n\nThe main menu is located on the top of your screen.\nSolo, Multi, UI, Repo, Settings\n\n\nMove your mouse on the main menu."); |
lbl:SetWidth(250); lbl:SetHeight(150); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
function page:GetDescriptor() |
return {}; |
end |
|
wizard:OnNext(function(wiz) wiz:SetPage(3); end); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
return true; |
end; |
}); |
|
ww:RegisterPage(3, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Customize the Main Menu"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "Click on the menu Settings and select RDX Settings."); |
lbl:SetWidth(250); lbl:SetHeight(90); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
function page:GetDescriptor() |
return {}; |
end |
|
wizard:OnNext(function(wiz) wiz:SetPage(4); end); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
--if not RDXPM.IsRDXManageOpen() then errs:AddError("Panel RDX Settings is not open."); end |
return not errs:HasError(); |
end; |
}); |
|
ww:RegisterPage(4, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Customize the Main Menu"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "You can disable the animation of the main menu, check the box Always show main panel\n\nYou can change the icon texture here. Click on the disk to save when finish."); |
lbl:SetWidth(250); lbl:SetHeight(90); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
function page:GetDescriptor() |
return {}; |
end |
|
wizard:OnNext(function(wiz) wiz:SetPage(5); end); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
--if RDXPM.IsRDXManageOpen() then errs:AddError("Panel RDX Settings is still open."); end |
return not errs:HasError(); |
end; |
}); |
|
ww:RegisterPage(5, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Hide Blizzard UI elements"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "Click on the menu UI and select Blizzard Frame Manager."); |
lbl:SetWidth(250); lbl:SetHeight(90); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
RDXG.learnNum = 5; |
|
function page:GetDescriptor() |
return {}; |
end |
|
wizard:OnNext(function(wiz) wiz:SetPage(6); end); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
--if not RDXDK.IsBlizzardManageOpen() then errs:AddError("Panel Blizzard UI Element is not open."); end |
return not errs:HasError(); |
end; |
}); |
|
ww:RegisterPage(6, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Hide Blizzard UI elements"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "Check all elements and click on the button save.\n\nYour UI will be reload and should be empty except the chatframe blizzard."); |
lbl:SetWidth(250); lbl:SetHeight(90); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
RDXG.learnNum = 6; |
|
function page:GetDescriptor() |
return {}; |
end |
|
wizard:OnNext(function(wiz) wiz:SetPage(7); end); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
--if RDXDK.IsBlizzardManageOpen() then errs:AddError("Panel Blizzard UI Element is still open."); end |
return not errs:HasError(); |
end; |
}); |
|
ww:RegisterPage(7, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Open windows on your UI"); |
|
local lbl = VFLUI.MakeLabel(nil, page, "Check all elements and click on the button disk to save your modifications.\n\nYour UI should be empty except the chatframe blizzard."); |
lbl:SetWidth(250); lbl:SetHeight(90); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
|
RDXG.learnNum = 7; |
|
function page:GetDescriptor() |
return {}; |
end |
|
wizard:OnNext(function(wiz) wiz:SetPage(8); end); |
|
return page; |
end; |
Verify = function(desc, wizard, errs) |
--if RDXDK.IsBlizzardManageOpen() then errs:AddError("Panel Blizzard UI Element is still open."); end |
return not errs:HasError(); |
end; |
}); |
|
|
-------------------- |
-- Page 20 (done) |
-------------------- |
ww:RegisterPage(20, { |
OpenPage = function(parent, wizard, desc) |
local page = RDXUI.GenerateStdWizardPage(parent, "Done!"); |
local lbl = VFLUI.MakeLabel(nil, page, "You have now entered all information necessary to create your window.\n\nIf you click OK, your window will be created and moved to the center of the screen.\n\nIf you choose Cancel, this process will be aborted and no changes will be made."); |
lbl:SetPoint("TOPLEFT", page, "TOPLEFT", 0, -20); |
lbl:SetWidth(250); lbl:SetHeight(110); lbl:SetJustifyV("TOP"); |
page:SetHeight(130); |
|
wizard:Final(); |
return page; |
end; |
Verify = function(desc, wizard, errs) |
return true; |
end |
}); |
|
|
function ww:OnOK() |
--VFL.print("OnOK"); |
end |
|
ww.title = "Learn RDX Wizard"; |
RDX.learnWizard = ww; |
|
function RDX.NewLearnWizard(num) |
RDX.learnWizard:SetDescriptor({}); |
RDX.learnWizard:Open(VFLDIALOG, num); |
end |
|