vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- MinMaxScale |
2 | local function MinMaxScale(arg) |
||
3 | arg = tonumber(arg) |
||
4 | if (arg < 0.5) then |
||
5 | arg = 0.5 |
||
6 | elseif (arg > XPerlConfig.MaximumScale) then |
||
7 | arg = XPerlConfig.MaximumScale |
||
8 | end |
||
9 | return arg |
||
10 | end |
||
11 | |||
12 | -- XPerl_SlashHandler |
||
13 | local function XPerl_SlashHandler(msg) |
||
14 | local args = {} |
||
15 | local BLU = "|c000000FF" |
||
16 | local CYN = "|c0000A0A0" |
||
17 | local RED = "|c00FF0000" |
||
18 | local GRN = "|c0000FF00" |
||
19 | local YELLOW = "|c00FFFF00" |
||
20 | local CLR = "|r" |
||
21 | |||
22 | for value in string.gfind(msg, "[^ ]+") do |
||
23 | tinsert(args, string.lower(value)) |
||
24 | end |
||
25 | if (args[1]=="") then |
||
26 | XPerl_OptionsMenu_Frame:Show() |
||
27 | return |
||
28 | end |
||
29 | |||
30 | local enable = 0 |
||
31 | if (args[2]) then |
||
32 | if (args[2] == "on" or args[2] == "show" or args[2] == "true" or args[2] == "1") then |
||
33 | enable = 1 |
||
34 | end |
||
35 | end |
||
36 | |||
37 | local SimpleOptions = { |
||
38 | ["playerportrait"] = "ShowPlayerPortrait", |
||
39 | ["portrait3d"] = "ShowPlayerPortrait3D", |
||
40 | ["counters"] = "TargetCounters", |
||
41 | ["combatflash"] = "CombatFlash", |
||
42 | ["fadeframes"] = "PerlFadeFrames", |
||
43 | ["highlight"] = "HighlightSelection", |
||
44 | ["counthealersonly"] = "TargetCountersSelf", |
||
45 | ["enemycounters"] = "TargetCountersEnemy", |
||
46 | ["playerlevel"] = "ShowPlayerLevel=enable;", |
||
47 | ["playerclass"] = "ShowPlayerClassIcon", |
||
48 | ["targetportrait"] = "ShowTargetPortrait", |
||
49 | ["targetmobtype"] = "ShowTargetMobType", |
||
50 | ["targetlevel"] = "ShowTargetLevel", |
||
51 | ["targetmana"] = "ShowTargetMana", |
||
52 | ["targetelite"] = "ShowTargetElite", |
||
53 | ["targetclass"] = "ShowTargetClassIcon", |
||
54 | ["hitindicator"] = "CombatHitIndicator", |
||
55 | ["partylevel"] = "ShowPartyLevel", |
||
56 | ["partyicon"] = "ShowPartyClassIcon", |
||
57 | ["partyvalues"] = "ShowPartyValues", |
||
58 | ["partypercent"] = "ShowPartyPercent", |
||
59 | ["partynames"] = "ShowPartyNames", |
||
60 | ["partytarget"] = "ShowPartyTarget", |
||
61 | ["partybuffs"] = "PartyBuffs", |
||
62 | ["partydebuffs"] = "PartyDebuffs", |
||
63 | ["classcolours"] = "ClassColouredNames", |
||
64 | ["classcolors"] = "ClassColouredNames", |
||
65 | ["petlevel"] = "ShowPetLevel", |
||
66 | ["pethappiness"] = "PetHappiness", |
||
67 | ["playerxp"] = "ShowPlayerXPBar", |
||
68 | ["playerrank"] = "ShowPlayerPVPRank", |
||
69 | ["targetrank"] = "ShowTargetPVPRank", |
||
70 | ["arcanebar"] = "ArcaneBar", |
||
71 | ["oldcastbar"] = "OldCastBar", |
||
72 | ["partyinraid"] = "ShowPartyRaid", |
||
73 | ["targettarget"] = "ShowTargetTarget", |
||
74 | ["targethistory"] = "TargetTargetHistory", |
||
75 | ["petxp"] = "ShowPetXP", |
||
76 | ["targettargetbuffs"] = "TargetTargetBuffs", |
||
77 | ["target30yard"] = "Show30YardSymbol", |
||
78 | ["casttime"] = "CastTime", |
||
79 | ["partynumber"] = "ShowPartyNumber", |
||
80 | ["raidpercent"] = "ShowRaidPercents", |
||
81 | ["group1"] = "ShowGroup1", |
||
82 | ["group2"] = "ShowGroup2", |
||
83 | ["group3"] = "ShowGroup3", |
||
84 | ["group4"] = "ShowGroup4", |
||
85 | ["group5"] = "ShowGroup5", |
||
86 | ["group6"] = "ShowGroup6", |
||
87 | ["group7"] = "ShowGroup7", |
||
88 | ["group8"] = "ShowGroup8", |
||
89 | ["group9"] = "ShowGroup9", |
||
90 | ["minimapbutton"] = "MinimapButtonShown" |
||
91 | } |
||
92 | |||
93 | local foundSimple = SimpleOptions[args[1]] |
||
94 | |||
95 | if (foundSimple) then |
||
96 | XPerlConfig[foundSimple] = enable |
||
97 | else |
||
98 | if (args[1] == nil or args[1] == "menu" or args[1] == "options") then |
||
99 | XPerl_UnlockFrames() |
||
100 | |||
101 | elseif (args[1]=="lock") then |
||
102 | XPerlLocked = 1 |
||
103 | if (XPerl_RaidTitles) then |
||
104 | XPerl_RaidTitles() |
||
105 | end |
||
106 | |||
107 | elseif (args[1]=="unlock") then |
||
108 | XPerlLocked = 0 |
||
109 | if (XPerl_RaidTitles) then |
||
110 | XPerl_RaidShowAllTitles() |
||
111 | end |
||
112 | |||
113 | elseif (args[1]=="usecptext") then |
||
114 | XPerlConfig.UseCPMeter=0 |
||
115 | elseif (args[1]=="usecpmeter") then |
||
116 | XPerlConfig.UseCPMeter=1 |
||
117 | elseif (args[1]=="nobartextures") then |
||
118 | XPerlConfig.BarTextures=0 |
||
119 | elseif (args[1]=="bartextures") then |
||
120 | XPerlConfig.BarTextures=1 |
||
121 | |||
122 | elseif (args[1]=="settexttrans") then |
||
123 | XPerlConfig.TextTransparency = tonumber(args[2]) |
||
124 | elseif (args[1]=="settrans") then |
||
125 | XPerlConfig.Transparency = tonumber(args[2]) |
||
126 | |||
127 | elseif (args[1]=="setplayerscale") then |
||
128 | XPerlConfig.Scale_PlayerFrame = MinMaxScale(args[2]) |
||
129 | elseif (args[1]=="setpetscale") then |
||
130 | XPerlConfig.Scale_PetFrame = MinMaxScale(args[2]) |
||
131 | elseif (args[1]=="setpartyscale") then |
||
132 | XPerlConfig.Scale_PartyFrame = MinMaxScale(args[2]) |
||
133 | elseif (args[1]=="setpartypetscale") then |
||
134 | XPerlConfig.Scale_PartyPets = MinMaxScale(args[2]) |
||
135 | elseif (args[1]=="settargetscale") then |
||
136 | XPerlConfig.Scale_TargetFrame = MinMaxScale(args[2]) |
||
137 | elseif (args[1]=="settargettargetscale") then |
||
138 | XPerlConfig.Scale_TargetTargetFrame = MinMaxScale(args[2]) |
||
139 | |||
140 | elseif (args[1]=="partydebuffs" and args[2]=="below") then |
||
141 | XPerlConfig.PartyDebuffsBelow=1 |
||
142 | elseif (args[1]=="partydebuffs" and args[2]=="right") then |
||
143 | XPerlConfig.PartyDebuffsBelow=0 |
||
144 | |||
145 | elseif (args[1]=="raidbyclass") then |
||
146 | XPerlConfig.SortRaidByClass=1 |
||
147 | elseif (args[1]=="raidbygroup") then |
||
148 | XPerlConfig.SortRaidByClass=0 |
||
149 | |||
150 | elseif (args[1]=="raid") then |
||
151 | XPerlConfig.ShowRaid = enable |
||
152 | for i = 1,10 do |
||
153 | XPerlConfig["ShowRaid"..i] = enable |
||
154 | end |
||
155 | |||
156 | elseif (args[1]=="setraidscale") then |
||
157 | XPerlConfig.Scale_Raid = MinMaxScale(args[2]) |
||
158 | |||
159 | elseif (args[1]=="backcolor" or args[1]=="bordercolor" or args[1]=="backcolour" or args[1]=="bordercolour") then |
||
160 | local r = tonumber(args[2]) |
||
161 | local g = tonumber(args[3]) |
||
162 | local b = tonumber(args[4]) |
||
163 | |||
164 | if (r >= 0 and r <= 1) then |
||
165 | if (g >= 0 and g <= 1) then |
||
166 | if (b >= 0 and b <= 1) then |
||
167 | if (args[1]=="backcolor" or args[1]=="backcolour") then |
||
168 | XPerlConfig.BackColour.r = r |
||
169 | XPerlConfig.BackColour.g = g |
||
170 | XPerlConfig.BackColour.b = b |
||
171 | else |
||
172 | XPerlConfig.BorderColour.r = r |
||
173 | XPerlConfig.BorderColour.g = g |
||
174 | XPerlConfig.BorderColour.b = b |
||
175 | end |
||
176 | end |
||
177 | end |
||
178 | end |
||
179 | |||
180 | elseif (args[1]=="simpleframes" or args[1]=="complexframes") then |
||
181 | if (args[1]=="simpleframes") then |
||
182 | enable = 0 |
||
183 | else |
||
184 | enable = 1 |
||
185 | end |
||
186 | |||
187 | XPerlConfig.ShowPlayerPortrait = enable |
||
188 | XPerlConfig.ShowPlayerLevel = enable |
||
189 | XPerlConfig.ShowPlayerClassIcon = enable |
||
190 | XPerlConfig.ShowTargetClassIcon = enable |
||
191 | XPerlConfig.ShowTargetPortrait = enable |
||
192 | XPerlConfig.ShowTargetMobType = enable |
||
193 | XPerlConfig.ShowTargetLevel = enable |
||
194 | XPerlConfig.ShowTargetElite = enable |
||
195 | XPerlConfig.ShowPartyLevel = enable |
||
196 | XPerlConfig.ShowPartyClassIcon = enable |
||
197 | XPerlConfig.ShowPartyPercent = enable |
||
198 | XPerlConfig.ShowPetLevel = enable |
||
199 | XPerlConfig.PetHappiness = enable |
||
200 | |||
201 | elseif (args[1] == "basichelp" or args[1] == "help") then |
||
202 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."lock"..CLR.." /xperl "..CYN.."unlock"..CLR.." /xperl "..CYN.."menu") |
||
203 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."simpleframes"..CLR.." /xperl "..CYN.."complexframes") |
||
204 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."showhidehelp"..CLR.." /xperl "..CYN.."settexttrans "..YELLOW.."#") |
||
205 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."settrans "..YELLOW.."#"..CLR.." /xperl "..CYN.."settargetscale "..YELLOW.."#") |
||
206 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."setpartyscale "..YELLOW.."#"..CLR.." /xperl "..CYN.."setplayerscale "..YELLOW.."#") |
||
207 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."setpetscale "..YELLOW.."#"..CLR.." /xperl "..CYN.."settargettargetscale "..YELLOW.."#") |
||
208 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."usecptext"..CLR.." /xperl "..CYN.."bartextures"..CLR.." /xperl "..CYN.."usecpmeter") |
||
209 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."nobartextures"..CLR.." /xperl "..CYN.."castparty "..YELLOW.."on/off") |
||
210 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."targettarget "..YELLOW.."on"..CLR.." /xperl "..CYN.."targethistory "..YELLOW.."on/off") |
||
211 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."portrait3d "..YELLOW.."hide/show"..CLR.." /xperl "..CYN.."counters "..YELLOW.."on/off") |
||
212 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."enemycounters "..YELLOW.."on/off"..CLR.." /xperl "..CYN.."counthealersonly "..YELLOW.."on/off") |
||
213 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."combatflash "..YELLOW.."on/off") |
||
214 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."partynumber "..YELLOW.."on/off"..CLR.." /xperl "..CYN.."targettargetbuffs "..YELLOW.."on/off") |
||
215 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."backcolor "..RED.."r "..GRN.."g "..BLU.."b"..CLR.." /xperl "..CYN.."bordercolor "..RED.."r "..GRN.."g "..BLU.."b") |
||
216 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."hitindicator "..YELLOW.."on/off"..CLR.." /xperl "..CYN.."partybuffs "..YELLOW.."on/off") |
||
217 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."partydebuffs "..YELLOW.."on/off"..CLR.." /xperl "..CYN.."minimapbutton "..YELLOW.."on/off") |
||
218 | DEFAULT_CHAT_FRAME:AddMessage("/xperl "..CYN.."highlight "..YELLOW.."on/off"..CLR.." /xperl "..CYN.."fadeframes "..YELLOW.."on/off") |
||
219 | |||
220 | elseif (args[1]=="showhidehelp") then |
||
221 | DEFAULT_CHAT_FRAME:AddMessage("Use /xperl target show/hide") |
||
222 | DEFAULT_CHAT_FRAME:AddMessage("For example, to hide the player level, use") |
||
223 | DEFAULT_CHAT_FRAME:AddMessage("/xperl playerlevel hide --make sure your only space is directly after 'perl'.") |
||
224 | DEFAULT_CHAT_FRAME:AddMessage("Valid Targets:") |
||
225 | DEFAULT_CHAT_FRAME:AddMessage("playerportrait "..CYN.."targetportrait"..CLR.." partyicon") |
||
226 | DEFAULT_CHAT_FRAME:AddMessage(CYN.."playerlevel"..CLR.." targetlevel "..CYN.."partylevel"..CLR.." petlevel") |
||
227 | DEFAULT_CHAT_FRAME:AddMessage("playerclass "..CYN.."targetmobtype"..CLR.." partypercent "..CYN.."partyvalues") |
||
228 | DEFAULT_CHAT_FRAME:AddMessage(CYN.."playerxp"..CLR.." targetmana "..CYN.."partyinraid"..CLR.." castparty") |
||
229 | DEFAULT_CHAT_FRAME:AddMessage("playerrank "..CYN.."targetrank"..CLR.." partynames "..CYN.."blizzardplayer") |
||
230 | DEFAULT_CHAT_FRAME:AddMessage(CYN.."targetclass"..CLR.." targetelite "..CYN.."arcanebar"..CLR.." oldcastbar") |
||
231 | DEFAULT_CHAT_FRAME:AddMessage("partytarget "..CYN.."petxp"..CLR.." pethappiness") |
||
232 | DEFAULT_CHAT_FRAME:AddMessage("Note that /xperl simpleframes or complexframes may override these settings.") |
||
233 | else |
||
234 | DEFAULT_CHAT_FRAME:AddMessage("Unknown command, type /xperl "..CYN.."help") |
||
235 | end |
||
236 | end |
||
237 | |||
238 | XPerl_OptionActions() |
||
239 | end |
||
240 | |||
241 | -- XPerl_SlashOnLoad |
||
242 | function XPerl_SlashOnLoad() |
||
243 | SlashCmdList["XPERL"] = XPerl_SlashHandler |
||
244 | SLASH_XPERL1 = "/xperl" |
||
245 | XPerl_SlashOnLoad = nil |
||
246 | end |