vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function ParchmentAddChapterFrame_OnShow() |
2 | -- Tooltips |
||
3 | ParchmentAddChapterFrame_AllRealms.tooltip = "The Chapter is viewable regardless of what realm you're on"; |
||
4 | ParchmentAddChapterFrame_ThisRealm.tooltip = "The Chapter is set to your current realm"; |
||
5 | |||
6 | -- Text |
||
7 | --getglobal(ParchmentAddChapterFrame_NewChapter:GetName().."Text"):SetText("|cffcc0000Chapter Name|r"); |
||
8 | getglobal(ParchmentAddChapterFrame_AllRealms:GetName().."Text"):SetText("All Realms"); |
||
9 | getglobal(ParchmentAddChapterFrame_ThisRealm:GetName().."Text"):SetText("This Realm"); |
||
10 | ParchmentAddChapterFrameTitle:SetText("Add a Chapter"); |
||
11 | ParchmentAddChapterFrameInfo:SetText("Just type in the name of the new Chapter below. The option 'All Realms' indicates it will be seen from any realm, or 'This Realm' for it to be a realm based Chapter. |cffffff00NOTE:|r Use only single words for Chapter names"); |
||
12 | |||
13 | -- Checkbox defaults to false |
||
14 | ParchmentAddChapterFrame_AllRealms:SetChecked(false); |
||
15 | ParchmentAddChapterFrame_ThisRealm:SetChecked(false); |
||
16 | ParchmentAddChapterFrame_NewChapter:SetText(""); |
||
17 | end |
||
18 | |||
19 | function ParchmentAddChapterOption_OnClick() |
||
20 | local checked = this:GetChecked(); |
||
21 | |||
22 | if(ParchmentAddChapterFrame_AllRealms:GetChecked()) then |
||
23 | ParchmentAddChapterFrame_ThisRealm:Disable(); |
||
24 | elseif(ParchmentAddChapterFrame_ThisRealm:GetChecked()) then |
||
25 | ParchmentAddChapterFrame_AllRealms:Disable(); |
||
26 | else |
||
27 | ParchmentAddChapterFrame_ThisRealm:Enable(); |
||
28 | ParchmentAddChapterFrame_AllRealms:Enable(); |
||
29 | end |
||
30 | |||
31 | if(not checked) then |
||
32 | PlaySound("igMainMenuOptionCheckBoxOff"); |
||
33 | else |
||
34 | PlaySound("igMainMenuOptionCheckBoxOn"); |
||
35 | end |
||
36 | end |
||
37 | |||
38 | function ParchmentAddChapter() |
||
39 | local action = ""; |
||
40 | |||
41 | if(ParchmentAddChapterFrame_AllRealms:GetChecked()) then |
||
42 | action = "add all " .. ParchmentAddChapterFrame_NewChapter:GetText(); |
||
43 | else |
||
44 | action = "add realm " .. ParchmentAddChapterFrame_NewChapter:GetText(); |
||
45 | end |
||
46 | |||
47 | Parchment_SlashCommandHandler(action); |
||
48 | |||
49 | if(ParchmentFrame:IsVisible()) then |
||
50 | ParchmentTab_OnClick(1) |
||
51 | end |
||
52 | end |