vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --Register Slash Commands--------------------------------------------------------------------------------------- |
2 | ---------------------------------------------------------------------------------------------------------------- |
||
3 | function aftt_slashCommands() |
||
4 | SlashCmdList["AF_ToolTip"] = aftt_commandResponse; |
||
5 | SLASH_AF_ToolTip1 = "/aftt"; |
||
6 | SLASH_AF_ToolTip2 = "/aftooltip"; |
||
7 | |||
8 | SlashCmdList["AF_ToolTipX"] = aftt_commandResponseX; |
||
9 | SLASH_AF_ToolTipX1 = "/afttx"; |
||
10 | |||
11 | SlashCmdList["AF_ToolTipY"] = aftt_commandResponseY; |
||
12 | SLASH_AF_ToolTipY1 = "/aftty"; |
||
13 | end |
||
14 | |||
15 | |||
16 | |||
17 | |||
18 | |||
19 | |||
20 | --Command Events------------------------------------------------------------------------------------------------ |
||
21 | ---------------------------------------------------------------------------------------------------------------- |
||
22 | function aftt_commandResponse(msg) |
||
23 | |||
24 | |||
25 | |||
26 | --Position: Follow Mouse----------------------------------- |
||
27 | ----------------------------------------------------------- |
||
28 | if (msg == "mouse") then |
||
29 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
30 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_followingmouse); |
||
31 | if (AF_ToolTip[aftt_localUser]["AnchorSmart"] == 1) then |
||
32 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_smart .. ": off"); |
||
33 | AF_ToolTip[aftt_localUser]["AnchorSmart"] = 0; |
||
34 | end |
||
35 | |||
36 | |||
37 | |||
38 | --Position: Top Row---------------------------------------- |
||
39 | ----------------------------------------------------------- |
||
40 | elseif (msg == "topleft") then |
||
41 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
42 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
43 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_topleft); |
||
44 | elseif (msg == "top") then |
||
45 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
46 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
47 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_top); |
||
48 | elseif (msg == "topright") then |
||
49 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
50 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
51 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_topright); |
||
52 | |||
53 | |||
54 | --Position: Center Row------------------------------------- |
||
55 | ----------------------------------------------------------- |
||
56 | elseif (msg == "left") then |
||
57 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
58 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
59 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_left); |
||
60 | elseif (msg == "center") then |
||
61 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
62 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
63 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_center); |
||
64 | elseif (msg == "right") then |
||
65 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
66 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
67 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_right); |
||
68 | |||
69 | |||
70 | |||
71 | --Position: Bottom Row------------------------------------- |
||
72 | ----------------------------------------------------------- |
||
73 | elseif (msg == "bottomleft") then |
||
74 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
75 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
76 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_bottomleft); |
||
77 | elseif (msg == "bottom") then |
||
78 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
79 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
80 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_bottom); |
||
81 | elseif (msg == "bottomright") then |
||
82 | AF_ToolTip[aftt_localUser]["Anchor"] = msg; |
||
83 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
84 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_bottomright); |
||
85 | |||
86 | |||
87 | |||
88 | --Clear Positioning---------------------------------------- |
||
89 | ----------------------------------------------------------- |
||
90 | elseif (msg == "clear") then |
||
91 | AF_ToolTip[aftt_localUser]["Anchor"] = "none"; |
||
92 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
93 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: " .. aftt_translate_position .. ": " .. aftt_translate_cleared); |
||
94 | |||
95 | |||
96 | |||
97 | --Toggle Fade Out------------------------------------------ |
||
98 | ----------------------------------------------------------- |
||
99 | elseif (msg == "fade") then |
||
100 | if (AF_ToolTip[aftt_localUser]["Fade"] == 1) then |
||
101 | AF_ToolTip[aftt_localUser]["Fade"] = 0; |
||
102 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Fade: Hide"); |
||
103 | else |
||
104 | AF_ToolTip[aftt_localUser]["Fade"] = 1; |
||
105 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Fade: Show"); |
||
106 | end |
||
107 | |||
108 | |||
109 | |||
110 | --Toggle PvP----------------------------------------------- |
||
111 | ----------------------------------------------------------- |
||
112 | elseif (msg == "pvp") then |
||
113 | if (AF_ToolTip[aftt_localUser]["PvP"] == 1) then |
||
114 | AF_ToolTip[aftt_localUser]["PvP"] = 0; |
||
115 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: PvP: Hide"); |
||
116 | else |
||
117 | AF_ToolTip[aftt_localUser]["PvP"] = 1; |
||
118 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: PvP: Show"); |
||
119 | end |
||
120 | |||
121 | |||
122 | |||
123 | --Toggle Guild--------------------------------------------- |
||
124 | ----------------------------------------------------------- |
||
125 | elseif (msg == "guild") then |
||
126 | --0, hide -> toggles to show |
||
127 | --1, show -> toggles to showbottom |
||
128 | --2, showbottom -> toggles to hide |
||
129 | if (AF_ToolTip[aftt_localUser]["Guild"] == 0 or AF_ToolTip[aftt_localUser]["Guild"] == nil) then |
||
130 | AF_ToolTip[aftt_localUser]["Guild"] = 1; |
||
131 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Guild: Show"); |
||
132 | elseif (AF_ToolTip[aftt_localUser]["Guild"] == 1) then |
||
133 | AF_ToolTip[aftt_localUser]["Guild"] = 2; |
||
134 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Guild: Show Bottom"); |
||
135 | elseif (AF_ToolTip[aftt_localUser]["Guild"] == 2) then |
||
136 | AF_ToolTip[aftt_localUser]["Guild"] = 0; |
||
137 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Guild: Hide"); |
||
138 | end |
||
139 | |||
140 | |||
141 | --Toggle Reaction------------------------------------------ |
||
142 | ----------------------------------------------------------- |
||
143 | elseif (msg == "reaction") then |
||
144 | if (AF_ToolTip[aftt_localUser]["ReactionText"] == 1) then |
||
145 | AF_ToolTip[aftt_localUser]["ReactionText"] = 0; |
||
146 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Reaction: Hide"); |
||
147 | else |
||
148 | AF_ToolTip[aftt_localUser]["ReactionText"] = 1; |
||
149 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Reaction: Show"); |
||
150 | end |
||
151 | |||
152 | |||
153 | --Toggle Tapped-------------------------------------------- |
||
154 | ----------------------------------------------------------- |
||
155 | elseif (msg == "tapped") then |
||
156 | if (AF_ToolTip[aftt_localUser]["Tapped"] == 1) then |
||
157 | AF_ToolTip[aftt_localUser]["Tapped"] = 0; |
||
158 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Tapped: Hide"); |
||
159 | else |
||
160 | AF_ToolTip[aftt_localUser]["Tapped"] = 1; |
||
161 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Tapped: Show"); |
||
162 | end |
||
163 | |||
164 | |||
165 | |||
166 | --Help----------------------------------------------------- |
||
167 | ----------------------------------------------------------- |
||
168 | elseif (msg == "help") then |
||
169 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt"); |
||
170 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt mouse"); |
||
171 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt topleft"); |
||
172 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt top"); |
||
173 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt topright"); |
||
174 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt left"); |
||
175 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt center"); |
||
176 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt right"); |
||
177 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt bottomleft"); |
||
178 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt bottom"); |
||
179 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt bottomright"); |
||
180 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt clear"); |
||
181 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/afttx <" .. aftt_translate_number .. ">"); |
||
182 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftty <" .. aftt_translate_number .. ">"); |
||
183 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt fade"); |
||
184 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt pvp"); |
||
185 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt guild"); |
||
186 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt reaction"); |
||
187 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r/aftt tapped"); |
||
188 | |||
189 | |||
190 | |||
191 | --Toggle Frames-------------------------------------------- |
||
192 | ----------------------------------------------------------- |
||
193 | elseif (msg == "") then |
||
194 | aftt_toggleFrames(); |
||
195 | |||
196 | |||
197 | --Unknown Command------------------------------------------ |
||
198 | ----------------------------------------------------------- |
||
199 | else |
||
200 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|r" .. aftt_translate_unknowncommand .. ": " .. msg); |
||
201 | end |
||
202 | |||
203 | |||
204 | |||
205 | end |
||
206 | |||
207 | |||
208 | |||
209 | |||
210 | |||
211 | |||
212 | --Push X Events------------------------------------------------------------------------------------------------- |
||
213 | ---------------------------------------------------------------------------------------------------------------- |
||
214 | function aftt_commandResponseX(msg) |
||
215 | local msg = tonumber(msg); |
||
216 | AF_ToolTip[aftt_localUser]["PositionX"] = msg; |
||
217 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
218 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: X: " .. AF_ToolTip[aftt_localUser]["PositionX"]); |
||
219 | end |
||
220 | |||
221 | |||
222 | |||
223 | |||
224 | |||
225 | |||
226 | --Push Y Events------------------------------------------------------------------------------------------------- |
||
227 | ---------------------------------------------------------------------------------------------------------------- |
||
228 | function aftt_commandResponseY(msg) |
||
229 | local msg = tonumber(msg); |
||
230 | AF_ToolTip[aftt_localUser]["PositionY"] = msg; |
||
231 | GameTooltip_SetDefaultAnchor = aftt_GameTooltip_SetDefaultAnchor; |
||
232 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00<AF>|rToolTip: Y: " .. AF_ToolTip[aftt_localUser]["PositionY"]); |
||
233 | end |