annotate modules/FuBar_ReActionFu/lib/AceAddon-2.0/AceAddon-2.0.lua @ 28:21bcaf8215ff

- converted to Ace3 - rearranged file layout - configGUI menus not working right now
author Flick <flickerstreak@gmail.com>
date Mon, 17 Mar 2008 18:24:53 +0000
parents
children
rev   line source
flickerstreak@28 1 --[[
flickerstreak@28 2 Name: AceAddon-2.0
flickerstreak@28 3 Revision: $Rev: 46764 $
flickerstreak@28 4 Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team)
flickerstreak@28 5 Inspired By: Ace 1.x by Turan (turan@gryphon.com)
flickerstreak@28 6 Website: http://www.wowace.com/
flickerstreak@28 7 Documentation: http://www.wowace.com/wiki/AceAddon-2.0
flickerstreak@28 8 SVN: http://svn.wowace.com/wowace/trunk/Ace2/AceAddon-2.0
flickerstreak@28 9 Description: Base for all Ace addons to inherit from.
flickerstreak@28 10 Dependencies: AceLibrary, AceOO-2.0, AceEvent-2.0, (optional) AceConsole-2.0
flickerstreak@28 11 License: LGPL v2.1
flickerstreak@28 12 ]]
flickerstreak@28 13
flickerstreak@28 14 local MAJOR_VERSION = "AceAddon-2.0"
flickerstreak@28 15 local MINOR_VERSION = "$Revision: 46764 $"
flickerstreak@28 16
flickerstreak@28 17 -- This ensures the code is only executed if the libary doesn't already exist, or is a newer version
flickerstreak@28 18 if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary.") end
flickerstreak@28 19 if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end
flickerstreak@28 20
flickerstreak@28 21 if not AceLibrary:HasInstance("AceOO-2.0") then error(MAJOR_VERSION .. " requires AceOO-2.0.") end
flickerstreak@28 22
flickerstreak@28 23 local function safecall(func,...)
flickerstreak@28 24 local success, err = pcall(func,...)
flickerstreak@28 25 if not success then geterrorhandler()(err:find("%.lua:%d+:") and err or (debugstack():match("\n(.-: )in.-\n") or "") .. err) end
flickerstreak@28 26 end
flickerstreak@28 27 -- Localization
flickerstreak@28 28 local STANDBY, TITLE, NOTES, VERSION, AUTHOR, DATE, CATEGORY, EMAIL, CREDITS, WEBSITE, CATEGORIES, ABOUT, LICENSE, PRINT_ADDON_INFO, DONATE, DONATE_DESC, HOWTO_DONATE_WINDOWS, HOWTO_DONATE_MAC
flickerstreak@28 29 if GetLocale() == "deDE" then
flickerstreak@28 30 STANDBY = "|cffff5050(Standby)|r" -- capitalized
flickerstreak@28 31
flickerstreak@28 32 TITLE = "Titel"
flickerstreak@28 33 NOTES = "Anmerkung"
flickerstreak@28 34 VERSION = "Version"
flickerstreak@28 35 AUTHOR = "Autor"
flickerstreak@28 36 DATE = "Datum"
flickerstreak@28 37 CATEGORY = "Kategorie"
flickerstreak@28 38 EMAIL = "E-Mail"
flickerstreak@28 39 WEBSITE = "Webseite"
flickerstreak@28 40 CREDITS = "Credits" -- fix
flickerstreak@28 41 LICENSE = "License" -- fix
flickerstreak@28 42
flickerstreak@28 43 ABOUT = "Über"
flickerstreak@28 44 PRINT_ADDON_INFO = "Gibt Addondaten aus"
flickerstreak@28 45 DONATE = "Donate" -- fix
flickerstreak@28 46 DONATE_DESC = "Give a much-needed donation to the author of this addon." -- fix
flickerstreak@28 47 HOWTO_DONATE_WINDOWS = "Press Ctrl-A to select the link, then Ctrl-C to copy, then Alt-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 48 HOWTO_DONATE_MAC = "Press Cmd-A to select the link, then Cmd-C to copy, then Cmd-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 49
flickerstreak@28 50 CATEGORIES = {
flickerstreak@28 51 ["Action Bars"] = "Aktionsleisten",
flickerstreak@28 52 ["Auction"] = "Auktion",
flickerstreak@28 53 ["Audio"] = "Audio",
flickerstreak@28 54 ["Battlegrounds/PvP"] = "Schlachtfeld/PvP",
flickerstreak@28 55 ["Buffs"] = "Stärkungszauber",
flickerstreak@28 56 ["Chat/Communication"] = "Chat/Kommunikation",
flickerstreak@28 57 ["Druid"] = "Druide",
flickerstreak@28 58 ["Hunter"] = "Jäger",
flickerstreak@28 59 ["Mage"] = "Magier",
flickerstreak@28 60 ["Paladin"] = "Paladin",
flickerstreak@28 61 ["Priest"] = "Priester",
flickerstreak@28 62 ["Rogue"] = "Schurke",
flickerstreak@28 63 ["Shaman"] = "Schamane",
flickerstreak@28 64 ["Warlock"] = "Hexenmeister",
flickerstreak@28 65 ["Warrior"] = "Krieger",
flickerstreak@28 66 ["Healer"] = "Heiler",
flickerstreak@28 67 ["Tank"] = "Tank",
flickerstreak@28 68 ["Caster"] = "Zauberer",
flickerstreak@28 69 ["Combat"] = "Kampf",
flickerstreak@28 70 ["Compilations"] = "Zusammenstellungen",
flickerstreak@28 71 ["Data Export"] = "Datenexport",
flickerstreak@28 72 ["Development Tools"] = "Entwicklungs Tools",
flickerstreak@28 73 ["Guild"] = "Gilde",
flickerstreak@28 74 ["Frame Modification"] = "Frame Veränderungen",
flickerstreak@28 75 ["Interface Enhancements"] = "Interface Verbesserungen",
flickerstreak@28 76 ["Inventory"] = "Inventar",
flickerstreak@28 77 ["Library"] = "Bibliotheken",
flickerstreak@28 78 ["Map"] = "Karte",
flickerstreak@28 79 ["Mail"] = "Post",
flickerstreak@28 80 ["Miscellaneous"] = "Diverses",
flickerstreak@28 81 ["Quest"] = "Quest",
flickerstreak@28 82 ["Raid"] = "Schlachtzug",
flickerstreak@28 83 ["Tradeskill"] = "Beruf",
flickerstreak@28 84 ["UnitFrame"] = "Einheiten-Fenster",
flickerstreak@28 85 }
flickerstreak@28 86 elseif GetLocale() == "frFR" then
flickerstreak@28 87 STANDBY = "|cffff5050(attente)|r"
flickerstreak@28 88
flickerstreak@28 89 TITLE = "Titre"
flickerstreak@28 90 NOTES = "Notes"
flickerstreak@28 91 VERSION = "Version"
flickerstreak@28 92 AUTHOR = "Auteur"
flickerstreak@28 93 DATE = "Date"
flickerstreak@28 94 CATEGORY = "Catégorie"
flickerstreak@28 95 EMAIL = "E-mail"
flickerstreak@28 96 WEBSITE = "Site web"
flickerstreak@28 97 CREDITS = "Credits" -- fix
flickerstreak@28 98 LICENSE = "License" -- fix
flickerstreak@28 99
flickerstreak@28 100 ABOUT = "A propos"
flickerstreak@28 101 PRINT_ADDON_INFO = "Afficher les informations sur l'addon"
flickerstreak@28 102 DONATE = "Donate" -- fix
flickerstreak@28 103 DONATE_DESC = "Give a much-needed donation to the author of this addon." -- fix
flickerstreak@28 104 HOWTO_DONATE_WINDOWS = "Press Ctrl-A to select the link, then Ctrl-C to copy, then Alt-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 105 HOWTO_DONATE_MAC = "Press Cmd-A to select the link, then Cmd-C to copy, then Cmd-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 106
flickerstreak@28 107 CATEGORIES = {
flickerstreak@28 108 ["Action Bars"] = "Barres d'action",
flickerstreak@28 109 ["Auction"] = "Hôtel des ventes",
flickerstreak@28 110 ["Audio"] = "Audio",
flickerstreak@28 111 ["Battlegrounds/PvP"] = "Champs de bataille/JcJ",
flickerstreak@28 112 ["Buffs"] = "Buffs",
flickerstreak@28 113 ["Chat/Communication"] = "Chat/Communication",
flickerstreak@28 114 ["Druid"] = "Druide",
flickerstreak@28 115 ["Hunter"] = "Chasseur",
flickerstreak@28 116 ["Mage"] = "Mage",
flickerstreak@28 117 ["Paladin"] = "Paladin",
flickerstreak@28 118 ["Priest"] = "Prêtre",
flickerstreak@28 119 ["Rogue"] = "Voleur",
flickerstreak@28 120 ["Shaman"] = "Chaman",
flickerstreak@28 121 ["Warlock"] = "Démoniste",
flickerstreak@28 122 ["Warrior"] = "Guerrier",
flickerstreak@28 123 ["Healer"] = "Soigneur",
flickerstreak@28 124 ["Tank"] = "Tank",
flickerstreak@28 125 ["Caster"] = "Casteur",
flickerstreak@28 126 ["Combat"] = "Combat",
flickerstreak@28 127 ["Compilations"] = "Compilations",
flickerstreak@28 128 ["Data Export"] = "Exportation de données",
flickerstreak@28 129 ["Development Tools"] = "Outils de développement",
flickerstreak@28 130 ["Guild"] = "Guilde",
flickerstreak@28 131 ["Frame Modification"] = "Modification des fenêtres",
flickerstreak@28 132 ["Interface Enhancements"] = "Améliorations de l'interface",
flickerstreak@28 133 ["Inventory"] = "Inventaire",
flickerstreak@28 134 ["Library"] = "Bibliothèques",
flickerstreak@28 135 ["Map"] = "Carte",
flickerstreak@28 136 ["Mail"] = "Courrier",
flickerstreak@28 137 ["Miscellaneous"] = "Divers",
flickerstreak@28 138 ["Quest"] = "Quêtes",
flickerstreak@28 139 ["Raid"] = "Raid",
flickerstreak@28 140 ["Tradeskill"] = "Métiers",
flickerstreak@28 141 ["UnitFrame"] = "Fenêtres d'unité",
flickerstreak@28 142 }
flickerstreak@28 143 elseif GetLocale() == "koKR" then
flickerstreak@28 144 STANDBY = "|cffff5050(사용가능)|r"
flickerstreak@28 145
flickerstreak@28 146 TITLE = "제목"
flickerstreak@28 147 NOTES = "노트"
flickerstreak@28 148 VERSION = "버전"
flickerstreak@28 149 AUTHOR = "저작자"
flickerstreak@28 150 DATE = "날짜"
flickerstreak@28 151 CATEGORY = "분류"
flickerstreak@28 152 EMAIL = "전자 우편"
flickerstreak@28 153 WEBSITE = "웹 사이트"
flickerstreak@28 154 CREDITS = "공로자"
flickerstreak@28 155 LICENSE = "라이센스"
flickerstreak@28 156
flickerstreak@28 157 ABOUT = "정보"
flickerstreak@28 158 PRINT_ADDON_INFO = "애드온에 대한 정보를 출력합니다."
flickerstreak@28 159 DONATE = "기부"
flickerstreak@28 160 DONATE_DESC = "이 애드온의 저작자에게 기부를 합니다."
flickerstreak@28 161 HOWTO_DONATE_WINDOWS = "Ctrl-A를 눌려 링크를 선택후, Ctrl-C로 복사합니다. Alt-Tab 눌려 게임으로 부터 나간후 웹 브라우저를 엽니다. 복사된 링크를 주소 창에 붙여넣기 합니다."
flickerstreak@28 162 HOWTO_DONATE_MAC = "Cmd-A를 눌려 링크를 선택후, Cmd-C로 복사합니다. Cmd-Tab 눌려 게임으로 부터 나간후 웹 브라우저를 엽니다. 복사된 링크를 주소 창에 붙여넣기 합니다."
flickerstreak@28 163
flickerstreak@28 164 CATEGORIES = {
flickerstreak@28 165 ["Action Bars"] = "액션바",
flickerstreak@28 166 ["Auction"] = "경매",
flickerstreak@28 167 ["Audio"] = "음향",
flickerstreak@28 168 ["Battlegrounds/PvP"] = "전장/PvP",
flickerstreak@28 169 ["Buffs"] = "버프",
flickerstreak@28 170 ["Chat/Communication"] = "대화/의사소통",
flickerstreak@28 171 ["Druid"] = "드루이드",
flickerstreak@28 172 ["Hunter"] = "사냥꾼",
flickerstreak@28 173 ["Mage"] = "마법사",
flickerstreak@28 174 ["Paladin"] = "성기사",
flickerstreak@28 175 ["Priest"] = "사제",
flickerstreak@28 176 ["Rogue"] = "도적",
flickerstreak@28 177 ["Shaman"] = "주술사",
flickerstreak@28 178 ["Warlock"] = "흑마법사",
flickerstreak@28 179 ["Warrior"] = "전사",
flickerstreak@28 180 ["Healer"] = "힐러",
flickerstreak@28 181 ["Tank"] = "탱커",
flickerstreak@28 182 ["Caster"] = "캐스터",
flickerstreak@28 183 ["Combat"] = "전투",
flickerstreak@28 184 ["Compilations"] = "복합",
flickerstreak@28 185 ["Data Export"] = "자료 출력",
flickerstreak@28 186 ["Development Tools"] = "개발 도구",
flickerstreak@28 187 ["Guild"] = "길드",
flickerstreak@28 188 ["Frame Modification"] = "구조 변경",
flickerstreak@28 189 ["Interface Enhancements"] = "인터페이스 강화",
flickerstreak@28 190 ["Inventory"] = "인벤토리",
flickerstreak@28 191 ["Library"] = "라이브러리",
flickerstreak@28 192 ["Map"] = "지도",
flickerstreak@28 193 ["Mail"] = "우편",
flickerstreak@28 194 ["Miscellaneous"] = "기타",
flickerstreak@28 195 ["Quest"] = "퀘스트",
flickerstreak@28 196 ["Raid"] = "공격대",
flickerstreak@28 197 ["Tradeskill"] = "전문기술",
flickerstreak@28 198 ["UnitFrame"] = "유닛 프레임",
flickerstreak@28 199 }
flickerstreak@28 200 elseif GetLocale() == "zhTW" then
flickerstreak@28 201 STANDBY = "|cffff5050(待命)|r"
flickerstreak@28 202
flickerstreak@28 203 TITLE = "標題"
flickerstreak@28 204 NOTES = "註記"
flickerstreak@28 205 VERSION = "版本"
flickerstreak@28 206 AUTHOR = "作者"
flickerstreak@28 207 DATE = "日期"
flickerstreak@28 208 CATEGORY = "類別"
flickerstreak@28 209 EMAIL = "電子郵件"
flickerstreak@28 210 WEBSITE = "網站"
flickerstreak@28 211 CREDITS = "特別感謝"
flickerstreak@28 212 LICENSE = "版權"
flickerstreak@28 213
flickerstreak@28 214 ABOUT = "關於"
flickerstreak@28 215 PRINT_ADDON_INFO = "顯示插件資訊。"
flickerstreak@28 216 DONATE = "捐贈"
flickerstreak@28 217 DONATE_DESC = "捐贈金錢給插件作者。"
flickerstreak@28 218 HOWTO_DONATE_WINDOWS = "請按Ctrl-A選擇網站連結,Ctrl-C複製網址,Alt-Tab切換到電腦桌面,打開瀏覽器,在網址列貼上網址。"
flickerstreak@28 219 HOWTO_DONATE_MAC = "請按Cmd-A選擇網站連結,Cmd-C複製網址,Cmd-Tab切換到電腦桌面,打開瀏覽器,在網址列貼上網址。"
flickerstreak@28 220
flickerstreak@28 221 CATEGORIES = {
flickerstreak@28 222 ["Action Bars"] = "動作條",
flickerstreak@28 223 ["Auction"] = "拍賣",
flickerstreak@28 224 ["Audio"] = "音效",
flickerstreak@28 225 ["Battlegrounds/PvP"] = "戰場/PvP",
flickerstreak@28 226 ["Buffs"] = "增益",
flickerstreak@28 227 ["Chat/Communication"] = "聊天/通訊",
flickerstreak@28 228 ["Druid"] = "德魯伊",
flickerstreak@28 229 ["Hunter"] = "獵人",
flickerstreak@28 230 ["Mage"] = "法師",
flickerstreak@28 231 ["Paladin"] = "聖騎士",
flickerstreak@28 232 ["Priest"] = "牧師",
flickerstreak@28 233 ["Rogue"] = "盜賊",
flickerstreak@28 234 ["Shaman"] = "薩滿",
flickerstreak@28 235 ["Warlock"] = "術士",
flickerstreak@28 236 ["Warrior"] = "戰士",
flickerstreak@28 237 ["Healer"] = "治療者",
flickerstreak@28 238 ["Tank"] = "坦克",
flickerstreak@28 239 ["Caster"] = "施法者",
flickerstreak@28 240 ["Combat"] = "戰鬥",
flickerstreak@28 241 ["Compilations"] = "整合",
flickerstreak@28 242 ["Data Export"] = "資料匯出",
flickerstreak@28 243 ["Development Tools"] = "開發工具",
flickerstreak@28 244 ["Guild"] = "公會",
flickerstreak@28 245 ["Frame Modification"] = "框架修改",
flickerstreak@28 246 ["Interface Enhancements"] = "介面增強",
flickerstreak@28 247 ["Inventory"] = "庫存",
flickerstreak@28 248 ["Library"] = "程式庫",
flickerstreak@28 249 ["Map"] = "地圖",
flickerstreak@28 250 ["Mail"] = "郵件",
flickerstreak@28 251 ["Miscellaneous"] = "雜項",
flickerstreak@28 252 ["Quest"] = "任務",
flickerstreak@28 253 ["Raid"] = "團隊",
flickerstreak@28 254 ["Tradeskill"] = "交易技能",
flickerstreak@28 255 ["UnitFrame"] = "單位框架",
flickerstreak@28 256 }
flickerstreak@28 257 elseif GetLocale() == "zhCN" then
flickerstreak@28 258 STANDBY = "|cffff5050(暂挂)|r"
flickerstreak@28 259
flickerstreak@28 260 TITLE = "标题"
flickerstreak@28 261 NOTES = "附注"
flickerstreak@28 262 VERSION = "版本"
flickerstreak@28 263 AUTHOR = "作者"
flickerstreak@28 264 DATE = "日期"
flickerstreak@28 265 CATEGORY = "分类"
flickerstreak@28 266 EMAIL = "电子邮件"
flickerstreak@28 267 WEBSITE = "网站"
flickerstreak@28 268 CREDITS = "Credits" -- fix
flickerstreak@28 269 LICENSE = "License" -- fix
flickerstreak@28 270
flickerstreak@28 271 ABOUT = "关于"
flickerstreak@28 272 PRINT_ADDON_INFO = "印列出插件信息"
flickerstreak@28 273 DONATE = "Donate" -- fix
flickerstreak@28 274 DONATE_DESC = "Give a much-needed donation to the author of this addon." -- fix
flickerstreak@28 275 HOWTO_DONATE_WINDOWS = "Press Ctrl-A to select the link, then Ctrl-C to copy, then Alt-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 276 HOWTO_DONATE_MAC = "Press Cmd-A to select the link, then Cmd-C to copy, then Cmd-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 277
flickerstreak@28 278 CATEGORIES = {
flickerstreak@28 279 ["Action Bars"] = "动作条",
flickerstreak@28 280 ["Auction"] = "拍卖",
flickerstreak@28 281 ["Audio"] = "音频",
flickerstreak@28 282 ["Battlegrounds/PvP"] = "战场/PvP",
flickerstreak@28 283 ["Buffs"] = "增益魔法",
flickerstreak@28 284 ["Chat/Communication"] = "聊天/交流",
flickerstreak@28 285 ["Druid"] = "德鲁伊",
flickerstreak@28 286 ["Hunter"] = "猎人",
flickerstreak@28 287 ["Mage"] = "法师",
flickerstreak@28 288 ["Paladin"] = "圣骑士",
flickerstreak@28 289 ["Priest"] = "牧师",
flickerstreak@28 290 ["Rogue"] = "盗贼",
flickerstreak@28 291 ["Shaman"] = "萨满祭司",
flickerstreak@28 292 ["Warlock"] = "术士",
flickerstreak@28 293 ["Warrior"] = "战士",
flickerstreak@28 294 -- ["Healer"] = "治疗保障",
flickerstreak@28 295 -- ["Tank"] = "近战控制",
flickerstreak@28 296 -- ["Caster"] = "远程输出",
flickerstreak@28 297 ["Combat"] = "战斗",
flickerstreak@28 298 ["Compilations"] = "编译",
flickerstreak@28 299 ["Data Export"] = "数据导出",
flickerstreak@28 300 ["Development Tools"] = "开发工具",
flickerstreak@28 301 ["Guild"] = "公会",
flickerstreak@28 302 ["Frame Modification"] = "框架修改",
flickerstreak@28 303 ["Interface Enhancements"] = "界面增强",
flickerstreak@28 304 ["Inventory"] = "背包",
flickerstreak@28 305 ["Library"] = "库",
flickerstreak@28 306 ["Map"] = "地图",
flickerstreak@28 307 ["Mail"] = "邮件",
flickerstreak@28 308 ["Miscellaneous"] = "杂项",
flickerstreak@28 309 ["Quest"] = "任务",
flickerstreak@28 310 ["Raid"] = "团队",
flickerstreak@28 311 ["Tradeskill"] = "商业技能",
flickerstreak@28 312 ["UnitFrame"] = "头像框架",
flickerstreak@28 313 }
flickerstreak@28 314 elseif GetLocale() == "esES" then
flickerstreak@28 315 STANDBY = "|cffff5050(espera)|r"
flickerstreak@28 316
flickerstreak@28 317 TITLE = "Título"
flickerstreak@28 318 NOTES = "Notas"
flickerstreak@28 319 VERSION = "Versión"
flickerstreak@28 320 AUTHOR = "Autor"
flickerstreak@28 321 DATE = "Fecha"
flickerstreak@28 322 CATEGORY = "Categoría"
flickerstreak@28 323 EMAIL = "E-mail"
flickerstreak@28 324 WEBSITE = "Web"
flickerstreak@28 325 CREDITS = "Créditos"
flickerstreak@28 326 LICENSE = "License" -- fix
flickerstreak@28 327
flickerstreak@28 328 ABOUT = "Acerca de"
flickerstreak@28 329 PRINT_ADDON_INFO = "Muestra información acerca del accesorio."
flickerstreak@28 330 DONATE = "Donate" -- fix
flickerstreak@28 331 DONATE_DESC = "Give a much-needed donation to the author of this addon." -- fix
flickerstreak@28 332 HOWTO_DONATE_WINDOWS = "Press Ctrl-A to select the link, then Ctrl-C to copy, then Alt-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 333 HOWTO_DONATE_MAC = "Press Cmd-A to select the link, then Cmd-C to copy, then Cmd-Tab out of the game, open your favorite web browser, and paste the link into the address bar." -- fix
flickerstreak@28 334
flickerstreak@28 335 CATEGORIES = {
flickerstreak@28 336 ["Action Bars"] = "Barras de Acción",
flickerstreak@28 337 ["Auction"] = "Subasta",
flickerstreak@28 338 ["Audio"] = "Audio",
flickerstreak@28 339 ["Battlegrounds/PvP"] = "Campos de Batalla/JcJ",
flickerstreak@28 340 ["Buffs"] = "Buffs",
flickerstreak@28 341 ["Chat/Communication"] = "Chat/Comunicación",
flickerstreak@28 342 ["Druid"] = "Druida",
flickerstreak@28 343 ["Hunter"] = "Cazador",
flickerstreak@28 344 ["Mage"] = "Mago",
flickerstreak@28 345 ["Paladin"] = "Paladín",
flickerstreak@28 346 ["Priest"] = "Sacerdote",
flickerstreak@28 347 ["Rogue"] = "Pícaro",
flickerstreak@28 348 ["Shaman"] = "Chamán",
flickerstreak@28 349 ["Warlock"] = "Brujo",
flickerstreak@28 350 ["Warrior"] = "Guerrero",
flickerstreak@28 351 ["Healer"] = "Sanador",
flickerstreak@28 352 ["Tank"] = "Tanque",
flickerstreak@28 353 ["Caster"] = "Conjurador",
flickerstreak@28 354 ["Combat"] = "Combate",
flickerstreak@28 355 ["Compilations"] = "Compilaciones",
flickerstreak@28 356 ["Data Export"] = "Exportar Datos",
flickerstreak@28 357 ["Development Tools"] = "Herramientas de Desarrollo",
flickerstreak@28 358 ["Guild"] = "Hermandad",
flickerstreak@28 359 ["Frame Modification"] = "Modificación de Marcos",
flickerstreak@28 360 ["Interface Enhancements"] = "Mejoras de la Interfaz",
flickerstreak@28 361 ["Inventory"] = "Inventario",
flickerstreak@28 362 ["Library"] = "Biblioteca",
flickerstreak@28 363 ["Map"] = "Mapa",
flickerstreak@28 364 ["Mail"] = "Correo",
flickerstreak@28 365 ["Miscellaneous"] = "Misceláneo",
flickerstreak@28 366 ["Quest"] = "Misión",
flickerstreak@28 367 ["Raid"] = "Banda",
flickerstreak@28 368 ["Tradeskill"] = "Habilidad de Comercio",
flickerstreak@28 369 ["UnitFrame"] = "Marco de Unidades",
flickerstreak@28 370 }
flickerstreak@28 371 else -- enUS
flickerstreak@28 372 STANDBY = "|cffff5050(standby)|r"
flickerstreak@28 373
flickerstreak@28 374 TITLE = "Title"
flickerstreak@28 375 NOTES = "Notes"
flickerstreak@28 376 VERSION = "Version"
flickerstreak@28 377 AUTHOR = "Author"
flickerstreak@28 378 DATE = "Date"
flickerstreak@28 379 CATEGORY = "Category"
flickerstreak@28 380 EMAIL = "E-mail"
flickerstreak@28 381 WEBSITE = "Website"
flickerstreak@28 382 CREDITS = "Credits"
flickerstreak@28 383 LICENSE = "License"
flickerstreak@28 384
flickerstreak@28 385 ABOUT = "About"
flickerstreak@28 386 PRINT_ADDON_INFO = "Show information about the addon."
flickerstreak@28 387 DONATE = "Donate"
flickerstreak@28 388 DONATE_DESC = "Give a much-needed donation to the author of this addon."
flickerstreak@28 389 HOWTO_DONATE_WINDOWS = "Press Ctrl-A to select the link, then Ctrl-C to copy, then Alt-Tab out of the game, open your favorite web browser, and paste the link into the address bar."
flickerstreak@28 390 HOWTO_DONATE_MAC = "Press Cmd-A to select the link, then Cmd-C to copy, then Cmd-Tab out of the game, open your favorite web browser, and paste the link into the address bar."
flickerstreak@28 391
flickerstreak@28 392 CATEGORIES = {
flickerstreak@28 393 ["Action Bars"] = "Action Bars",
flickerstreak@28 394 ["Auction"] = "Auction",
flickerstreak@28 395 ["Audio"] = "Audio",
flickerstreak@28 396 ["Battlegrounds/PvP"] = "Battlegrounds/PvP",
flickerstreak@28 397 ["Buffs"] = "Buffs",
flickerstreak@28 398 ["Chat/Communication"] = "Chat/Communication",
flickerstreak@28 399 ["Druid"] = "Druid",
flickerstreak@28 400 ["Hunter"] = "Hunter",
flickerstreak@28 401 ["Mage"] = "Mage",
flickerstreak@28 402 ["Paladin"] = "Paladin",
flickerstreak@28 403 ["Priest"] = "Priest",
flickerstreak@28 404 ["Rogue"] = "Rogue",
flickerstreak@28 405 ["Shaman"] = "Shaman",
flickerstreak@28 406 ["Warlock"] = "Warlock",
flickerstreak@28 407 ["Warrior"] = "Warrior",
flickerstreak@28 408 ["Healer"] = "Healer",
flickerstreak@28 409 ["Tank"] = "Tank",
flickerstreak@28 410 ["Caster"] = "Caster",
flickerstreak@28 411 ["Combat"] = "Combat",
flickerstreak@28 412 ["Compilations"] = "Compilations",
flickerstreak@28 413 ["Data Export"] = "Data Export",
flickerstreak@28 414 ["Development Tools"] = "Development Tools",
flickerstreak@28 415 ["Guild"] = "Guild",
flickerstreak@28 416 ["Frame Modification"] = "Frame Modification",
flickerstreak@28 417 ["Interface Enhancements"] = "Interface Enhancements",
flickerstreak@28 418 ["Inventory"] = "Inventory",
flickerstreak@28 419 ["Library"] = "Library",
flickerstreak@28 420 ["Map"] = "Map",
flickerstreak@28 421 ["Mail"] = "Mail",
flickerstreak@28 422 ["Miscellaneous"] = "Miscellaneous",
flickerstreak@28 423 ["Quest"] = "Quest",
flickerstreak@28 424 ["Raid"] = "Raid",
flickerstreak@28 425 ["Tradeskill"] = "Tradeskill",
flickerstreak@28 426 ["UnitFrame"] = "UnitFrame",
flickerstreak@28 427 }
flickerstreak@28 428 end
flickerstreak@28 429
flickerstreak@28 430 setmetatable(CATEGORIES, { __index = function(self, key) -- case-insensitive
flickerstreak@28 431 local lowerKey = key:lower()
flickerstreak@28 432 for k,v in pairs(CATEGORIES) do
flickerstreak@28 433 if k:lower() == lowerKey then
flickerstreak@28 434 return v
flickerstreak@28 435 end
flickerstreak@28 436 end
flickerstreak@28 437 end })
flickerstreak@28 438
flickerstreak@28 439 -- Create the library object
flickerstreak@28 440
flickerstreak@28 441 local AceOO = AceLibrary("AceOO-2.0")
flickerstreak@28 442 local AceAddon = AceOO.Class()
flickerstreak@28 443 local AceEvent
flickerstreak@28 444 local AceConsole
flickerstreak@28 445 local AceModuleCore
flickerstreak@28 446
flickerstreak@28 447 function AceAddon:GetLocalizedCategory(name)
flickerstreak@28 448 self:argCheck(name, 2, "string")
flickerstreak@28 449 return CATEGORIES[name] or UNKNOWN
flickerstreak@28 450 end
flickerstreak@28 451
flickerstreak@28 452 function AceAddon:ToString()
flickerstreak@28 453 return "AceAddon"
flickerstreak@28 454 end
flickerstreak@28 455
flickerstreak@28 456 local function print(text)
flickerstreak@28 457 DEFAULT_CHAT_FRAME:AddMessage(text)
flickerstreak@28 458 end
flickerstreak@28 459
flickerstreak@28 460 function AceAddon:ADDON_LOADED(name)
flickerstreak@28 461 local unregister = true
flickerstreak@28 462 local initAddon = {}
flickerstreak@28 463 while #self.nextAddon > 0 do
flickerstreak@28 464 local addon = table.remove(self.nextAddon, 1)
flickerstreak@28 465 if addon.possibleNames[name] then
flickerstreak@28 466 table.insert(initAddon, addon)
flickerstreak@28 467 else
flickerstreak@28 468 unregister = nil
flickerstreak@28 469 table.insert(self.skipAddon, addon)
flickerstreak@28 470 end
flickerstreak@28 471 end
flickerstreak@28 472 self.nextAddon, self.skipAddon = self.skipAddon, self.nextAddon
flickerstreak@28 473 if unregister then
flickerstreak@28 474 AceAddon:UnregisterEvent("ADDON_LOADED")
flickerstreak@28 475 end
flickerstreak@28 476 while #initAddon > 0 do
flickerstreak@28 477 local addon = table.remove(initAddon, 1)
flickerstreak@28 478 table.insert(self.addons, addon)
flickerstreak@28 479 if not self.addons[name] then
flickerstreak@28 480 self.addons[name] = addon
flickerstreak@28 481 end
flickerstreak@28 482 addon.possibleNames = nil
flickerstreak@28 483 self:InitializeAddon(addon, name)
flickerstreak@28 484 end
flickerstreak@28 485 end
flickerstreak@28 486
flickerstreak@28 487 local function RegisterOnEnable(self)
flickerstreak@28 488 if DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.defaultLanguage then -- HACK
flickerstreak@28 489 AceAddon.playerLoginFired = true
flickerstreak@28 490 end
flickerstreak@28 491 if AceAddon.playerLoginFired then
flickerstreak@28 492 AceAddon.addonsStarted[self] = true
flickerstreak@28 493 if (type(self.IsActive) ~= "function" or self:IsActive()) and (not AceModuleCore or not AceModuleCore:IsModule(self) or AceModuleCore:IsModuleActive(self)) then
flickerstreak@28 494 AceAddon:ManualEnable(self)
flickerstreak@28 495 end
flickerstreak@28 496 else
flickerstreak@28 497 if not AceAddon.addonsToOnEnable then
flickerstreak@28 498 AceAddon.addonsToOnEnable = {}
flickerstreak@28 499 end
flickerstreak@28 500 table.insert(AceAddon.addonsToOnEnable, self)
flickerstreak@28 501 end
flickerstreak@28 502 end
flickerstreak@28 503
flickerstreak@28 504 function AceAddon:InitializeAddon(addon, name)
flickerstreak@28 505 if addon.name == nil then
flickerstreak@28 506 addon.name = name
flickerstreak@28 507 end
flickerstreak@28 508 if GetAddOnMetadata then
flickerstreak@28 509 -- TOC checks
flickerstreak@28 510 if addon.title == nil then
flickerstreak@28 511 addon.title = GetAddOnMetadata(name, "Title")
flickerstreak@28 512 end
flickerstreak@28 513 if type(addon.title) == "string" then
flickerstreak@28 514 local num = addon.title:find(" |cff7fff7f %-Ace2%-|r$")
flickerstreak@28 515 if num then
flickerstreak@28 516 addon.title = addon.title:sub(1, num - 1)
flickerstreak@28 517 end
flickerstreak@28 518 addon.title = addon.title:trim()
flickerstreak@28 519 end
flickerstreak@28 520 if addon.notes == nil then
flickerstreak@28 521 addon.notes = GetAddOnMetadata(name, "Notes")
flickerstreak@28 522 end
flickerstreak@28 523 if type(addon.notes) == "string" then
flickerstreak@28 524 addon.notes = addon.notes:trim()
flickerstreak@28 525 end
flickerstreak@28 526 if addon.version == nil then
flickerstreak@28 527 addon.version = GetAddOnMetadata(name, "Version")
flickerstreak@28 528 end
flickerstreak@28 529 if type(addon.version) == "string" then
flickerstreak@28 530 if addon.version:find("%$Revision: (%d+) %$") then
flickerstreak@28 531 addon.version = addon.version:gsub("%$Revision: (%d+) %$", "%1")
flickerstreak@28 532 elseif addon.version:find("%$Rev: (%d+) %$") then
flickerstreak@28 533 addon.version = addon.version:gsub("%$Rev: (%d+) %$", "%1")
flickerstreak@28 534 elseif addon.version:find("%$LastChangedRevision: (%d+) %$") then
flickerstreak@28 535 addon.version = addon.version:gsub("%$LastChangedRevision: (%d+) %$", "%1")
flickerstreak@28 536 end
flickerstreak@28 537 addon.version = addon.version:trim()
flickerstreak@28 538 end
flickerstreak@28 539 if addon.author == nil then
flickerstreak@28 540 addon.author = GetAddOnMetadata(name, "Author")
flickerstreak@28 541 end
flickerstreak@28 542 if type(addon.author) == "string" then
flickerstreak@28 543 addon.author = addon.author:trim()
flickerstreak@28 544 end
flickerstreak@28 545 if addon.credits == nil then
flickerstreak@28 546 addon.credits = GetAddOnMetadata(name, "X-Credits")
flickerstreak@28 547 end
flickerstreak@28 548 if type(addon.credits) == "string" then
flickerstreak@28 549 addon.credits = addon.credits:trim()
flickerstreak@28 550 end
flickerstreak@28 551 if addon.donate == nil then
flickerstreak@28 552 addon.donate = GetAddOnMetadata(name, "X-Donate")
flickerstreak@28 553 end
flickerstreak@28 554 if type(addon.donate) == "string" then
flickerstreak@28 555 addon.donate = addon.donate:trim()
flickerstreak@28 556 end
flickerstreak@28 557 if addon.date == nil then
flickerstreak@28 558 addon.date = GetAddOnMetadata(name, "X-Date") or GetAddOnMetadata(name, "X-ReleaseDate")
flickerstreak@28 559 end
flickerstreak@28 560 if type(addon.date) == "string" then
flickerstreak@28 561 if addon.date:find("%$Date: (.-) %$") then
flickerstreak@28 562 addon.date = addon.date:gsub("%$Date: (.-) %$", "%1")
flickerstreak@28 563 elseif addon.date:find("%$LastChangedDate: (.-) %$") then
flickerstreak@28 564 addon.date = addon.date:gsub("%$LastChangedDate: (.-) %$", "%1")
flickerstreak@28 565 end
flickerstreak@28 566 addon.date = addon.date:trim()
flickerstreak@28 567 end
flickerstreak@28 568
flickerstreak@28 569 if addon.category == nil then
flickerstreak@28 570 addon.category = GetAddOnMetadata(name, "X-Category")
flickerstreak@28 571 end
flickerstreak@28 572 if type(addon.category) == "string" then
flickerstreak@28 573 addon.category = addon.category:trim()
flickerstreak@28 574 end
flickerstreak@28 575 if addon.email == nil then
flickerstreak@28 576 addon.email = GetAddOnMetadata(name, "X-eMail") or GetAddOnMetadata(name, "X-Email")
flickerstreak@28 577 end
flickerstreak@28 578 if type(addon.email) == "string" then
flickerstreak@28 579 addon.email = addon.email:trim()
flickerstreak@28 580 end
flickerstreak@28 581 if addon.license == nil then
flickerstreak@28 582 addon.license = GetAddOnMetadata(name, "X-License")
flickerstreak@28 583 end
flickerstreak@28 584 if type(addon.license) == "string" then
flickerstreak@28 585 addon.license = addon.license:trim()
flickerstreak@28 586 end
flickerstreak@28 587 if addon.website == nil then
flickerstreak@28 588 addon.website = GetAddOnMetadata(name, "X-Website")
flickerstreak@28 589 end
flickerstreak@28 590 if type(addon.website) == "string" then
flickerstreak@28 591 addon.website = addon.website:trim()
flickerstreak@28 592 end
flickerstreak@28 593 end
flickerstreak@28 594 local current = addon.class
flickerstreak@28 595 while true do
flickerstreak@28 596 if current == AceOO.Class or not current then
flickerstreak@28 597 break
flickerstreak@28 598 end
flickerstreak@28 599 if current.mixins then
flickerstreak@28 600 for mixin in pairs(current.mixins) do
flickerstreak@28 601 if type(mixin.OnEmbedInitialize) == "function" then
flickerstreak@28 602 mixin:OnEmbedInitialize(addon, name)
flickerstreak@28 603 end
flickerstreak@28 604 end
flickerstreak@28 605 end
flickerstreak@28 606 current = current.super
flickerstreak@28 607 end
flickerstreak@28 608 local n = AceAddon.addonsToOnEnable and #AceAddon.addonsToOnEnable or 0
flickerstreak@28 609
flickerstreak@28 610 if type(addon.OnInitialize) == "function" then
flickerstreak@28 611 safecall(addon.OnInitialize, addon, name)
flickerstreak@28 612 end
flickerstreak@28 613 if AceEvent then
flickerstreak@28 614 AceEvent:TriggerEvent("Ace2_AddonInitialized", addon)
flickerstreak@28 615 end
flickerstreak@28 616 RegisterOnEnable(addon)
flickerstreak@28 617 local n2 = AceAddon.addonsToOnEnable and #AceAddon.addonsToOnEnable or 0
flickerstreak@28 618 if n2 - n > 1 then
flickerstreak@28 619 local mine = table.remove(AceAddon.addonsToOnEnable)
flickerstreak@28 620 table.insert(AceAddon.addonsToOnEnable, n+1, mine)
flickerstreak@28 621 end
flickerstreak@28 622 end
flickerstreak@28 623
flickerstreak@28 624 local aboutFrame
flickerstreak@28 625 local function createAboutFrame()
flickerstreak@28 626 aboutFrame = CreateFrame("Frame", "AceAddon20AboutFrame", UIParent, "DialogBoxFrame")
flickerstreak@28 627 aboutFrame:SetWidth(500)
flickerstreak@28 628 aboutFrame:SetHeight(400)
flickerstreak@28 629 aboutFrame:SetPoint("CENTER")
flickerstreak@28 630 aboutFrame:SetBackdrop({
flickerstreak@28 631 bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
flickerstreak@28 632 edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
flickerstreak@28 633 tile = true, tileSize = 16, edgeSize = 16,
flickerstreak@28 634 insets = { left = 5, right = 5, top = 5, bottom = 5 }
flickerstreak@28 635 })
flickerstreak@28 636 aboutFrame:SetBackdropColor(0,0,0,1)
flickerstreak@28 637
flickerstreak@28 638 local donateButton = CreateFrame("Button", "AceAddon20AboutFrameDonateButton", aboutFrame, "UIPanelButtonTemplate2")
flickerstreak@28 639 aboutFrame.donateButton = donateButton
flickerstreak@28 640 donateButton:SetPoint("BOTTOMRIGHT", -20, 20)
flickerstreak@28 641 _G.AceAddon20AboutFrameDonateButtonText:SetText(DONATE)
flickerstreak@28 642 donateButton:SetWidth(_G.AceAddon20AboutFrameDonateButtonText:GetWidth()+20)
flickerstreak@28 643 donateButton:SetScript("OnClick", function()
flickerstreak@28 644 aboutFrame.currentAddon:OpenDonationFrame()
flickerstreak@28 645 end)
flickerstreak@28 646
flickerstreak@28 647 local text = aboutFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlightLarge")
flickerstreak@28 648 aboutFrame.title = text
flickerstreak@28 649 text:SetPoint("TOP", 0, -5)
flickerstreak@28 650
flickerstreak@28 651 aboutFrame:Hide()
flickerstreak@28 652
flickerstreak@28 653 aboutFrame.lefts = {}
flickerstreak@28 654 aboutFrame.rights = {}
flickerstreak@28 655 aboutFrame.textLefts = {}
flickerstreak@28 656 aboutFrame.textRights = {}
flickerstreak@28 657 function aboutFrame:Clear()
flickerstreak@28 658 self.title:SetText("")
flickerstreak@28 659 for i = 1, #self.lefts do
flickerstreak@28 660 self.lefts[i] = nil
flickerstreak@28 661 self.rights[i] = nil
flickerstreak@28 662 end
flickerstreak@28 663 end
flickerstreak@28 664
flickerstreak@28 665 function aboutFrame:AddLine(left, right)
flickerstreak@28 666 aboutFrame.lefts[#aboutFrame.lefts+1] = left
flickerstreak@28 667 aboutFrame.rights[#aboutFrame.rights+1] = right
flickerstreak@28 668 end
flickerstreak@28 669
flickerstreak@28 670 local aboutFrame_Show = aboutFrame.Show
flickerstreak@28 671 function aboutFrame:Show(...)
flickerstreak@28 672 local maxLeftWidth = 0
flickerstreak@28 673 local maxRightWidth = 0
flickerstreak@28 674 local textHeight = 0
flickerstreak@28 675 for i = 1, #self.lefts do
flickerstreak@28 676 if not self.textLefts[i] then
flickerstreak@28 677 local left = aboutFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
flickerstreak@28 678 self.textLefts[i] = left
flickerstreak@28 679 local right = aboutFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
flickerstreak@28 680 self.textRights[i] = right
flickerstreak@28 681 if i == 1 then
flickerstreak@28 682 left:SetPoint("TOPRIGHT", aboutFrame, "TOPLEFT", 75, -35)
flickerstreak@28 683 else
flickerstreak@28 684 left:SetPoint("TOPRIGHT", self.textLefts[i-1], "BOTTOMRIGHT", 0, -5)
flickerstreak@28 685 end
flickerstreak@28 686 right:SetPoint("LEFT", left, "RIGHT", 5, 0)
flickerstreak@28 687 end
flickerstreak@28 688 self.textLefts[i]:SetText(self.lefts[i] .. ":")
flickerstreak@28 689 self.textRights[i]:SetText(self.rights[i])
flickerstreak@28 690 local leftWidth = self.textLefts[i]:GetWidth()
flickerstreak@28 691 local rightWidth = self.textRights[i]:GetWidth()
flickerstreak@28 692 textHeight = self.textLefts[i]:GetHeight()
flickerstreak@28 693 if maxLeftWidth < leftWidth then
flickerstreak@28 694 maxLeftWidth = leftWidth
flickerstreak@28 695 end
flickerstreak@28 696 if maxRightWidth < rightWidth then
flickerstreak@28 697 maxRightWidth = rightWidth
flickerstreak@28 698 end
flickerstreak@28 699 end
flickerstreak@28 700 for i = #self.lefts+1, #self.textLefts do
flickerstreak@28 701 self.textLefts[i]:SetText('')
flickerstreak@28 702 self.textRights[i]:SetText('')
flickerstreak@28 703 end
flickerstreak@28 704 aboutFrame:SetWidth(75 + maxRightWidth + 20)
flickerstreak@28 705 aboutFrame:SetHeight(#self.lefts * (textHeight + 5) + 100)
flickerstreak@28 706
flickerstreak@28 707 aboutFrame_Show(self, ...)
flickerstreak@28 708 end
flickerstreak@28 709 aboutFrame:Hide()
flickerstreak@28 710
flickerstreak@28 711 createAboutFrame = nil
flickerstreak@28 712 end
flickerstreak@28 713 local donateFrame
flickerstreak@28 714
flickerstreak@28 715 local function unobfuscateEmail(email)
flickerstreak@28 716 return email:gsub(" AT ", "@"):gsub(" DOT ", ".")
flickerstreak@28 717 end
flickerstreak@28 718
flickerstreak@28 719 local function isGoodVariable(var)
flickerstreak@28 720 return type(var) == "string" or type(var) == "number"
flickerstreak@28 721 end
flickerstreak@28 722 function AceAddon.prototype:PrintAddonInfo()
flickerstreak@28 723 if createAboutFrame then
flickerstreak@28 724 createAboutFrame()
flickerstreak@28 725 end
flickerstreak@28 726 aboutFrame:Clear()
flickerstreak@28 727 local x
flickerstreak@28 728 if isGoodVariable(self.title) then
flickerstreak@28 729 x = tostring(self.title)
flickerstreak@28 730 elseif isGoodVariable(self.name) then
flickerstreak@28 731 x = tostring(self.name)
flickerstreak@28 732 else
flickerstreak@28 733 x = "<" .. tostring(self.class) .. " instance>"
flickerstreak@28 734 end
flickerstreak@28 735 if type(self.IsActive) == "function" then
flickerstreak@28 736 if not self:IsActive() then
flickerstreak@28 737 x = x .. " " .. STANDBY
flickerstreak@28 738 end
flickerstreak@28 739 end
flickerstreak@28 740 aboutFrame.title:SetText(x)
flickerstreak@28 741
flickerstreak@28 742 if isGoodVariable(self.version) then
flickerstreak@28 743 aboutFrame:AddLine(VERSION, tostring(self.version))
flickerstreak@28 744 end
flickerstreak@28 745 if isGoodVariable(self.notes) then
flickerstreak@28 746 aboutFrame:AddLine(NOTES, tostring(self.notes))
flickerstreak@28 747 end
flickerstreak@28 748 if isGoodVariable(self.author) then
flickerstreak@28 749 aboutFrame:AddLine(AUTHOR, tostring(self.author))
flickerstreak@28 750 end
flickerstreak@28 751 if isGoodVariable(self.credits) then
flickerstreak@28 752 aboutFrame:AddLine(CREDITS, tostring(self.credits))
flickerstreak@28 753 end
flickerstreak@28 754 if isGoodVariable(self.date) then
flickerstreak@28 755 aboutFrame:AddLine(DATE, tostring(self.date))
flickerstreak@28 756 end
flickerstreak@28 757 if self.category then
flickerstreak@28 758 local category = CATEGORIES[self.category]
flickerstreak@28 759 if category then
flickerstreak@28 760 aboutFrame:AddLine(CATEGORY, tostring(self.category))
flickerstreak@28 761 end
flickerstreak@28 762 end
flickerstreak@28 763 if isGoodVariable(self.email) then
flickerstreak@28 764 aboutFrame:AddLine(EMAIL, unobfuscateEmail(tostring(self.email)))
flickerstreak@28 765 end
flickerstreak@28 766 if isGoodVariable(self.website) then
flickerstreak@28 767 aboutFrame:AddLine(WEBSITE, tostring(self.website))
flickerstreak@28 768 end
flickerstreak@28 769 if isGoodVariable(self.license) then
flickerstreak@28 770 aboutFrame:AddLine(LICENSE, tostring(self.license))
flickerstreak@28 771 end
flickerstreak@28 772
flickerstreak@28 773 if donateFrame and donateFrame:IsShown() then
flickerstreak@28 774 donateFrame:Hide()
flickerstreak@28 775 end
flickerstreak@28 776
flickerstreak@28 777 aboutFrame.currentAddon = self
flickerstreak@28 778
flickerstreak@28 779 aboutFrame:Show()
flickerstreak@28 780
flickerstreak@28 781 if self.donate then
flickerstreak@28 782 aboutFrame.donateButton:Show()
flickerstreak@28 783 else
flickerstreak@28 784 aboutFrame.donateButton:Hide()
flickerstreak@28 785 end
flickerstreak@28 786 end
flickerstreak@28 787
flickerstreak@28 788 local function createDonateFrame()
flickerstreak@28 789 donateFrame = CreateFrame("Frame", "AceAddon20Frame", UIParent, "DialogBoxFrame")
flickerstreak@28 790
flickerstreak@28 791 donateFrame:SetWidth(500)
flickerstreak@28 792 donateFrame:SetHeight(200)
flickerstreak@28 793 donateFrame:SetPoint("CENTER")
flickerstreak@28 794 donateFrame:SetBackdrop({
flickerstreak@28 795 bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
flickerstreak@28 796 edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
flickerstreak@28 797 tile = true, tileSize = 16, edgeSize = 16,
flickerstreak@28 798 insets = { left = 5, right = 5, top = 5, bottom = 5 }
flickerstreak@28 799 })
flickerstreak@28 800 donateFrame:SetBackdropColor(0,0,0,1)
flickerstreak@28 801
flickerstreak@28 802 local text = donateFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlightLarge")
flickerstreak@28 803 text:SetPoint("TOP", 0, -5)
flickerstreak@28 804 text:SetText(DONATE)
flickerstreak@28 805
flickerstreak@28 806 local howto = donateFrame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
flickerstreak@28 807 howto:SetPoint("TOP", text, "BOTTOM", 0, -5)
flickerstreak@28 808 howto:SetPoint("LEFT", 16, 0)
flickerstreak@28 809 howto:SetPoint("RIGHT", -16, 0)
flickerstreak@28 810 if not IsMacClient() then
flickerstreak@28 811 -- Windows or Linux
flickerstreak@28 812 howto:SetText(HOWTO_DONATE_WINDOWS)
flickerstreak@28 813 else
flickerstreak@28 814 howto:SetText(HOWTO_DONATE_MAC)
flickerstreak@28 815 end
flickerstreak@28 816
flickerstreak@28 817 local scrollFrame = CreateFrame("ScrollFrame", "AceAddon20FrameScrollFrame", donateFrame, "UIPanelScrollFrameTemplate")
flickerstreak@28 818 scrollFrame:SetToplevel(true)
flickerstreak@28 819 scrollFrame:SetPoint("TOP", -10, -76)
flickerstreak@28 820 scrollFrame:SetWidth(455)
flickerstreak@28 821 scrollFrame:SetHeight(70)
flickerstreak@28 822 howto:SetPoint("BOTTOM", scrollFrame, "TOP")
flickerstreak@28 823
flickerstreak@28 824 local editBox = CreateFrame("EditBox", nil, scrollFrame)
flickerstreak@28 825 donateFrame.editBox = editBox
flickerstreak@28 826 scrollFrame:SetScrollChild(editBox)
flickerstreak@28 827 editBox:SetFontObject(ChatFontNormal)
flickerstreak@28 828 editBox:SetMultiLine(true)
flickerstreak@28 829 editBox:SetMaxLetters(99999)
flickerstreak@28 830 editBox:SetWidth(450)
flickerstreak@28 831 editBox:SetHeight(54)
flickerstreak@28 832 editBox:SetPoint("BOTTOM", 5, 0)
flickerstreak@28 833 editBox:SetJustifyH("LEFT")
flickerstreak@28 834 editBox:SetJustifyV("TOP")
flickerstreak@28 835 editBox:SetAutoFocus(false)
flickerstreak@28 836 editBox:SetScript("OnTextChanged", function(this)
flickerstreak@28 837 if this:GetText() ~= this.text then
flickerstreak@28 838 this:SetText(this.text)
flickerstreak@28 839 end
flickerstreak@28 840 end)
flickerstreak@28 841 editBox:SetScript("OnEscapePressed", function(this)
flickerstreak@28 842 this:ClearFocus()
flickerstreak@28 843 end)
flickerstreak@28 844 createDonateFrame = nil
flickerstreak@28 845 end
flickerstreak@28 846
flickerstreak@28 847 local function fix(char)
flickerstreak@28 848 return ("%%%02x"):format(char:byte())
flickerstreak@28 849 end
flickerstreak@28 850
flickerstreak@28 851 local function urlencode(text)
flickerstreak@28 852 return text:gsub("[^0-9A-Za-z]", fix)
flickerstreak@28 853 end
flickerstreak@28 854
flickerstreak@28 855 function AceAddon.prototype:OpenDonationFrame()
flickerstreak@28 856 if createDonateFrame then
flickerstreak@28 857 createDonateFrame()
flickerstreak@28 858 end
flickerstreak@28 859 local donate = self.donate
flickerstreak@28 860 if type(donate) ~= "string" then
flickerstreak@28 861 donate = "Wowace"
flickerstreak@28 862 end
flickerstreak@28 863 local style, data = (":"):split(donate, 2)
flickerstreak@28 864 style = style:lower()
flickerstreak@28 865 if style ~= "website" and style ~= "paypal" then
flickerstreak@28 866 style = "wowace"
flickerstreak@28 867 end
flickerstreak@28 868 if style == "wowace" then
flickerstreak@28 869 donateFrame.editBox.text = "http://www.wowace.com/wiki/Donations"
flickerstreak@28 870 elseif style == "website" then
flickerstreak@28 871 donateFrame.editBox.text = data
flickerstreak@28 872 else -- PayPal
flickerstreak@28 873 local text = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" .. urlencode(unobfuscateEmail(data))
flickerstreak@28 874 local name
flickerstreak@28 875 if type(self.title) == "string" then
flickerstreak@28 876 name = self.title
flickerstreak@28 877 elseif type(self.name) == "string" then
flickerstreak@28 878 name = self.name
flickerstreak@28 879 end
flickerstreak@28 880 if name then
flickerstreak@28 881 name = name:gsub("|c%x%x%x%x%x%x%x%x", ""):gsub("|r", "")
flickerstreak@28 882 text = text .. "&item_name=" .. urlencode(name)
flickerstreak@28 883 end
flickerstreak@28 884 donateFrame.editBox.text = text
flickerstreak@28 885 end
flickerstreak@28 886 donateFrame.editBox:SetText(donateFrame.editBox.text)
flickerstreak@28 887
flickerstreak@28 888 if aboutFrame and aboutFrame:IsShown() then
flickerstreak@28 889 aboutFrame:Hide()
flickerstreak@28 890 end
flickerstreak@28 891
flickerstreak@28 892 donateFrame:Show()
flickerstreak@28 893
flickerstreak@28 894 donateFrame.editBox:SetFocus()
flickerstreak@28 895 end
flickerstreak@28 896
flickerstreak@28 897 local options
flickerstreak@28 898 function AceAddon:GetAceOptionsDataTable(target)
flickerstreak@28 899 return {
flickerstreak@28 900 about = {
flickerstreak@28 901 name = ABOUT,
flickerstreak@28 902 desc = PRINT_ADDON_INFO,
flickerstreak@28 903 type = "execute",
flickerstreak@28 904 func = "PrintAddonInfo",
flickerstreak@28 905 order = -1,
flickerstreak@28 906 },
flickerstreak@28 907 donate = {
flickerstreak@28 908 name = DONATE,
flickerstreak@28 909 desc = DONATE_DESC,
flickerstreak@28 910 type = "execute",
flickerstreak@28 911 func = "OpenDonationFrame",
flickerstreak@28 912 order = -1,
flickerstreak@28 913 hidden = function()
flickerstreak@28 914 return not target.donate
flickerstreak@28 915 end
flickerstreak@28 916 }
flickerstreak@28 917 }
flickerstreak@28 918 end
flickerstreak@28 919
flickerstreak@28 920 function AceAddon:PLAYER_LOGIN()
flickerstreak@28 921 self.playerLoginFired = true
flickerstreak@28 922 if self.addonsToOnEnable then
flickerstreak@28 923 while #self.addonsToOnEnable > 0 do
flickerstreak@28 924 local addon = table.remove(self.addonsToOnEnable, 1)
flickerstreak@28 925 self.addonsStarted[addon] = true
flickerstreak@28 926 if (type(addon.IsActive) ~= "function" or addon:IsActive()) and (not AceModuleCore or not AceModuleCore:IsModule(addon) or AceModuleCore:IsModuleActive(addon)) then
flickerstreak@28 927 AceAddon:ManualEnable(addon)
flickerstreak@28 928 end
flickerstreak@28 929 end
flickerstreak@28 930 self.addonsToOnEnable = nil
flickerstreak@28 931 end
flickerstreak@28 932 end
flickerstreak@28 933
flickerstreak@28 934 function AceAddon.prototype:Inject(t)
flickerstreak@28 935 AceAddon:argCheck(t, 2, "table")
flickerstreak@28 936 for k,v in pairs(t) do
flickerstreak@28 937 self[k] = v
flickerstreak@28 938 end
flickerstreak@28 939 end
flickerstreak@28 940
flickerstreak@28 941 function AceAddon.prototype:init()
flickerstreak@28 942 if not AceEvent then
flickerstreak@28 943 error(MAJOR_VERSION .. " requires AceEvent-2.0", 4)
flickerstreak@28 944 end
flickerstreak@28 945 AceAddon.super.prototype.init(self)
flickerstreak@28 946
flickerstreak@28 947 self.super = self.class.prototype
flickerstreak@28 948
flickerstreak@28 949 AceAddon:RegisterEvent("ADDON_LOADED", "ADDON_LOADED")
flickerstreak@28 950 local names = {}
flickerstreak@28 951 for i = 1, GetNumAddOns() do
flickerstreak@28 952 if IsAddOnLoaded(i) then names[GetAddOnInfo(i)] = true end
flickerstreak@28 953 end
flickerstreak@28 954 self.possibleNames = names
flickerstreak@28 955 table.insert(AceAddon.nextAddon, self)
flickerstreak@28 956 end
flickerstreak@28 957
flickerstreak@28 958 function AceAddon.prototype:ToString()
flickerstreak@28 959 local x
flickerstreak@28 960 if type(self.title) == "string" then
flickerstreak@28 961 x = self.title
flickerstreak@28 962 elseif type(self.name) == "string" then
flickerstreak@28 963 x = self.name
flickerstreak@28 964 else
flickerstreak@28 965 x = "<" .. tostring(self.class) .. " instance>"
flickerstreak@28 966 end
flickerstreak@28 967 if (type(self.IsActive) == "function" and not self:IsActive()) or (AceModuleCore and AceModuleCore:IsModule(addon) and AceModuleCore:IsModuleActive(addon)) then
flickerstreak@28 968 x = x .. " " .. STANDBY
flickerstreak@28 969 end
flickerstreak@28 970 return x
flickerstreak@28 971 end
flickerstreak@28 972
flickerstreak@28 973 AceAddon.new = function(self, ...)
flickerstreak@28 974 local class = AceAddon:pcall(AceOO.Classpool, self, ...)
flickerstreak@28 975 return class:new()
flickerstreak@28 976 end
flickerstreak@28 977
flickerstreak@28 978 function AceAddon:ManualEnable(addon)
flickerstreak@28 979 AceAddon:argCheck(addon, 2, "table")
flickerstreak@28 980 local first = nil
flickerstreak@28 981 if AceOO.inherits(addon, "AceAddon-2.0") then
flickerstreak@28 982 if AceAddon.addonsEnabled and not AceAddon.addonsEnabled[addon] then
flickerstreak@28 983 first = true
flickerstreak@28 984 AceAddon.addonsEnabled[addon] = true
flickerstreak@28 985 end
flickerstreak@28 986 end
flickerstreak@28 987 local current = addon.class
flickerstreak@28 988 while current and current ~= AceOO.Class do
flickerstreak@28 989 if current.mixins then
flickerstreak@28 990 for mixin in pairs(current.mixins) do
flickerstreak@28 991 if type(mixin.OnEmbedEnable) == "function" then
flickerstreak@28 992 safecall(mixin.OnEmbedEnable, mixin, addon, first)
flickerstreak@28 993 end
flickerstreak@28 994 end
flickerstreak@28 995 end
flickerstreak@28 996 current = current.super
flickerstreak@28 997 end
flickerstreak@28 998 if type(addon.OnEnable) == "function" then
flickerstreak@28 999 safecall(addon.OnEnable, addon, first)
flickerstreak@28 1000 end
flickerstreak@28 1001 if AceEvent then
flickerstreak@28 1002 AceEvent:TriggerEvent("Ace2_AddonEnabled", addon, first)
flickerstreak@28 1003 end
flickerstreak@28 1004 end
flickerstreak@28 1005
flickerstreak@28 1006 function AceAddon:ManualDisable(addon)
flickerstreak@28 1007 AceAddon:argCheck(addon, 2, "table")
flickerstreak@28 1008 local current = addon.class
flickerstreak@28 1009 while current and current ~= AceOO.Class do
flickerstreak@28 1010 if current.mixins then
flickerstreak@28 1011 for mixin in pairs(current.mixins) do
flickerstreak@28 1012 if type(mixin.OnEmbedDisable) == "function" then
flickerstreak@28 1013 safecall(mixin.OnEmbedDisable, mixin, addon)
flickerstreak@28 1014 end
flickerstreak@28 1015 end
flickerstreak@28 1016 end
flickerstreak@28 1017 current = current.super
flickerstreak@28 1018 end
flickerstreak@28 1019 if type(module.OnDisable) == "function" then
flickerstreak@28 1020 safecall(module.OnDisable, addon)
flickerstreak@28 1021 end
flickerstreak@28 1022 if AceEvent then
flickerstreak@28 1023 AceEvent:TriggerEvent("Ace2_AddonDisabled", addon)
flickerstreak@28 1024 end
flickerstreak@28 1025 end
flickerstreak@28 1026
flickerstreak@28 1027 local function external(self, major, instance)
flickerstreak@28 1028 if major == "AceEvent-2.0" then
flickerstreak@28 1029 AceEvent = instance
flickerstreak@28 1030
flickerstreak@28 1031 AceEvent:embed(self)
flickerstreak@28 1032
flickerstreak@28 1033 self:RegisterEvent("PLAYER_LOGIN", "PLAYER_LOGIN", true)
flickerstreak@28 1034 elseif major == "AceConsole-2.0" then
flickerstreak@28 1035 AceConsole = instance
flickerstreak@28 1036
flickerstreak@28 1037 local slashCommands = { "/ace2" }
flickerstreak@28 1038 local _,_,_,enabled,loadable = GetAddOnInfo("Ace")
flickerstreak@28 1039 if not enabled or not loadable then
flickerstreak@28 1040 table.insert(slashCommands, "/ace")
flickerstreak@28 1041 end
flickerstreak@28 1042 local function listAddon(addon, depth)
flickerstreak@28 1043 if not depth then
flickerstreak@28 1044 depth = 0
flickerstreak@28 1045 end
flickerstreak@28 1046
flickerstreak@28 1047 local s = (" "):rep(depth) .. " - " .. tostring(addon)
flickerstreak@28 1048 if rawget(addon, 'version') then
flickerstreak@28 1049 s = s .. " - |cffffff7f" .. tostring(addon.version) .. "|r"
flickerstreak@28 1050 end
flickerstreak@28 1051 if rawget(addon, 'slashCommand') then
flickerstreak@28 1052 s = s .. " |cffffff7f(" .. tostring(addon.slashCommand) .. ")|r"
flickerstreak@28 1053 end
flickerstreak@28 1054 print(s)
flickerstreak@28 1055 if type(rawget(addon, 'modules')) == "table" then
flickerstreak@28 1056 local i = 0
flickerstreak@28 1057 for k,v in pairs(addon.modules) do
flickerstreak@28 1058 i = i + 1
flickerstreak@28 1059 if i == 6 then
flickerstreak@28 1060 print((" "):rep(depth + 1) .. " - more...")
flickerstreak@28 1061 break
flickerstreak@28 1062 else
flickerstreak@28 1063 listAddon(v, depth + 1)
flickerstreak@28 1064 end
flickerstreak@28 1065 end
flickerstreak@28 1066 end
flickerstreak@28 1067 end
flickerstreak@28 1068 local function listNormalAddon(i)
flickerstreak@28 1069 local name,_,_,enabled,loadable = GetAddOnInfo(i)
flickerstreak@28 1070 if not loadable then
flickerstreak@28 1071 enabled = false
flickerstreak@28 1072 end
flickerstreak@28 1073 if self.addons[name] then
flickerstreak@28 1074 listAddon(self.addons[name])
flickerstreak@28 1075 else
flickerstreak@28 1076 local s = " - " .. tostring(GetAddOnMetadata(i, "Title") or name)
flickerstreak@28 1077 local version = GetAddOnMetadata(i, "Version")
flickerstreak@28 1078 if version then
flickerstreak@28 1079 if version:find("%$Revision: (%d+) %$") then
flickerstreak@28 1080 version = version:gsub("%$Revision: (%d+) %$", "%1")
flickerstreak@28 1081 elseif version:find("%$Rev: (%d+) %$") then
flickerstreak@28 1082 version = version:gsub("%$Rev: (%d+) %$", "%1")
flickerstreak@28 1083 elseif version:find("%$LastChangedRevision: (%d+) %$") then
flickerstreak@28 1084 version = version:gsub("%$LastChangedRevision: (%d+) %$", "%1")
flickerstreak@28 1085 end
flickerstreak@28 1086 s = s .. " - |cffffff7f" .. version .. "|r"
flickerstreak@28 1087 end
flickerstreak@28 1088 if not enabled then
flickerstreak@28 1089 s = s .. " |cffff0000(disabled)|r"
flickerstreak@28 1090 end
flickerstreak@28 1091 if IsAddOnLoadOnDemand(i) then
flickerstreak@28 1092 s = s .. " |cff00ff00[LoD]|r"
flickerstreak@28 1093 end
flickerstreak@28 1094 print(s)
flickerstreak@28 1095 end
flickerstreak@28 1096 end
flickerstreak@28 1097 local function mySort(alpha, bravo)
flickerstreak@28 1098 return tostring(alpha) < tostring(bravo)
flickerstreak@28 1099 end
flickerstreak@28 1100 AceConsole.RegisterChatCommand(self, slashCommands, {
flickerstreak@28 1101 desc = "AddOn development framework",
flickerstreak@28 1102 name = "Ace2",
flickerstreak@28 1103 type = "group",
flickerstreak@28 1104 args = {
flickerstreak@28 1105 about = {
flickerstreak@28 1106 desc = "Get information about Ace2",
flickerstreak@28 1107 name = "About",
flickerstreak@28 1108 type = "execute",
flickerstreak@28 1109 func = function()
flickerstreak@28 1110 print("|cffffff7fAce2|r - |cffffff7f2.0." .. MINOR_VERSION:gsub("%$Revision: (%d+) %$", "%1") .. "|r - AddOn development framework")
flickerstreak@28 1111 print(" - |cffffff7f" .. AUTHOR .. ":|r Ace Development Team")
flickerstreak@28 1112 print(" - |cffffff7f" .. WEBSITE .. ":|r http://www.wowace.com/")
flickerstreak@28 1113 end
flickerstreak@28 1114 },
flickerstreak@28 1115 list = {
flickerstreak@28 1116 desc = "List addons",
flickerstreak@28 1117 name = "List",
flickerstreak@28 1118 type = "group",
flickerstreak@28 1119 args = {
flickerstreak@28 1120 ace2 = {
flickerstreak@28 1121 desc = "List addons using Ace2",
flickerstreak@28 1122 name = "Ace2",
flickerstreak@28 1123 type = "execute",
flickerstreak@28 1124 func = function()
flickerstreak@28 1125 print("|cffffff7fAddon list:|r")
flickerstreak@28 1126 table.sort(self.addons, mySort)
flickerstreak@28 1127 for _,v in ipairs(self.addons) do
flickerstreak@28 1128 listAddon(v)
flickerstreak@28 1129 end
flickerstreak@28 1130 end
flickerstreak@28 1131 },
flickerstreak@28 1132 all = {
flickerstreak@28 1133 desc = "List all addons",
flickerstreak@28 1134 name = "All",
flickerstreak@28 1135 type = "execute",
flickerstreak@28 1136 func = function()
flickerstreak@28 1137 print("|cffffff7fAddon list:|r")
flickerstreak@28 1138 local count = GetNumAddOns()
flickerstreak@28 1139 for i = 1, count do
flickerstreak@28 1140 listNormalAddon(i)
flickerstreak@28 1141 end
flickerstreak@28 1142 end
flickerstreak@28 1143 },
flickerstreak@28 1144 enabled = {
flickerstreak@28 1145 desc = "List all enabled addons",
flickerstreak@28 1146 name = "Enabled",
flickerstreak@28 1147 type = "execute",
flickerstreak@28 1148 func = function()
flickerstreak@28 1149 print("|cffffff7fAddon list:|r")
flickerstreak@28 1150 local count = GetNumAddOns()
flickerstreak@28 1151 for i = 1, count do
flickerstreak@28 1152 local _,_,_,enabled,loadable = GetAddOnInfo(i)
flickerstreak@28 1153 if enabled and loadable then
flickerstreak@28 1154 listNormalAddon(i)
flickerstreak@28 1155 end
flickerstreak@28 1156 end
flickerstreak@28 1157 end
flickerstreak@28 1158 },
flickerstreak@28 1159 disabled = {
flickerstreak@28 1160 desc = "List all disabled addons",
flickerstreak@28 1161 name = "Disabled",
flickerstreak@28 1162 type = "execute",
flickerstreak@28 1163 func = function()
flickerstreak@28 1164 print("|cffffff7fAddon list:|r")
flickerstreak@28 1165 local count = GetNumAddOns()
flickerstreak@28 1166 for i = 1, count do
flickerstreak@28 1167 local _,_,_,enabled,loadable = GetAddOnInfo(i)
flickerstreak@28 1168 if not enabled or not loadable then
flickerstreak@28 1169 listNormalAddon(i)
flickerstreak@28 1170 end
flickerstreak@28 1171 end
flickerstreak@28 1172 end
flickerstreak@28 1173 },
flickerstreak@28 1174 lod = {
flickerstreak@28 1175 desc = "List all LoadOnDemand addons",
flickerstreak@28 1176 name = "LoadOnDemand",
flickerstreak@28 1177 type = "execute",
flickerstreak@28 1178 func = function()
flickerstreak@28 1179 print("|cffffff7fAddon list:|r")
flickerstreak@28 1180 local count = GetNumAddOns()
flickerstreak@28 1181 for i = 1, count do
flickerstreak@28 1182 if IsAddOnLoadOnDemand(i) then
flickerstreak@28 1183 listNormalAddon(i)
flickerstreak@28 1184 end
flickerstreak@28 1185 end
flickerstreak@28 1186 end
flickerstreak@28 1187 },
flickerstreak@28 1188 ace1 = {
flickerstreak@28 1189 desc = "List all addons using Ace1",
flickerstreak@28 1190 name = "Ace 1.x",
flickerstreak@28 1191 type = "execute",
flickerstreak@28 1192 func = function()
flickerstreak@28 1193 print("|cffffff7fAddon list:|r")
flickerstreak@28 1194 local count = GetNumAddOns()
flickerstreak@28 1195 for i = 1, count do
flickerstreak@28 1196 local dep1, dep2, dep3, dep4 = GetAddOnDependencies(i)
flickerstreak@28 1197 if dep1 == "Ace" or dep2 == "Ace" or dep3 == "Ace" or dep4 == "Ace" then
flickerstreak@28 1198 listNormalAddon(i)
flickerstreak@28 1199 end
flickerstreak@28 1200 end
flickerstreak@28 1201 end
flickerstreak@28 1202 },
flickerstreak@28 1203 libs = {
flickerstreak@28 1204 desc = "List all libraries using AceLibrary",
flickerstreak@28 1205 name = "Libraries",
flickerstreak@28 1206 type = "execute",
flickerstreak@28 1207 func = function()
flickerstreak@28 1208 if type(AceLibrary) == "table" and type(AceLibrary.libs) == "table" then
flickerstreak@28 1209 print("|cffffff7fLibrary list:|r")
flickerstreak@28 1210 for name, data in pairs(AceLibrary.libs) do
flickerstreak@28 1211 local s
flickerstreak@28 1212 if data.minor then
flickerstreak@28 1213 s = " - " .. tostring(name) .. "." .. tostring(data.minor)
flickerstreak@28 1214 else
flickerstreak@28 1215 s = " - " .. tostring(name)
flickerstreak@28 1216 end
flickerstreak@28 1217 if rawget(AceLibrary(name), 'slashCommand') then
flickerstreak@28 1218 s = s .. " |cffffff7f(" .. tostring(AceLibrary(name).slashCommand) .. "|cffffff7f)"
flickerstreak@28 1219 end
flickerstreak@28 1220 print(s)
flickerstreak@28 1221 end
flickerstreak@28 1222 end
flickerstreak@28 1223 end
flickerstreak@28 1224 },
flickerstreak@28 1225 search = {
flickerstreak@28 1226 desc = "Search by name",
flickerstreak@28 1227 name = "Search",
flickerstreak@28 1228 type = "text",
flickerstreak@28 1229 usage = "<keyword>",
flickerstreak@28 1230 input = true,
flickerstreak@28 1231 get = false,
flickerstreak@28 1232 set = function(...)
flickerstreak@28 1233 local arg = { ... }
flickerstreak@28 1234 for i,v in ipairs(arg) do
flickerstreak@28 1235 arg[i] = v:gsub('%*', '.*'):gsub('%%', '%%%%'):lower()
flickerstreak@28 1236 end
flickerstreak@28 1237 local count = GetNumAddOns()
flickerstreak@28 1238 for i = 1, count do
flickerstreak@28 1239 local name = GetAddOnInfo(i)
flickerstreak@28 1240 local good = true
flickerstreak@28 1241 for _,v in ipairs(arg) do
flickerstreak@28 1242 if not name:lower():find(v) then
flickerstreak@28 1243 good = false
flickerstreak@28 1244 break
flickerstreak@28 1245 end
flickerstreak@28 1246 end
flickerstreak@28 1247 if good then
flickerstreak@28 1248 listNormalAddon(i)
flickerstreak@28 1249 end
flickerstreak@28 1250 end
flickerstreak@28 1251 end
flickerstreak@28 1252 }
flickerstreak@28 1253 },
flickerstreak@28 1254 },
flickerstreak@28 1255 enable = {
flickerstreak@28 1256 desc = "Enable addon(s).",
flickerstreak@28 1257 name = "Enable",
flickerstreak@28 1258 type = "text",
flickerstreak@28 1259 usage = "<addon 1> <addon 2> ...",
flickerstreak@28 1260 get = false,
flickerstreak@28 1261 input = true,
flickerstreak@28 1262 set = function(...)
flickerstreak@28 1263 for i = 1, select("#", ...) do
flickerstreak@28 1264 local addon = select(i, ...)
flickerstreak@28 1265 local name, title, _, enabled, _, reason = GetAddOnInfo(addon)
flickerstreak@28 1266 if reason == "MISSING" then
flickerstreak@28 1267 print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon))
flickerstreak@28 1268 elseif not enabled then
flickerstreak@28 1269 EnableAddOn(addon)
flickerstreak@28 1270 print(("|cffffff7fAce2:|r %s is now enabled."):format(addon or name))
flickerstreak@28 1271 else
flickerstreak@28 1272 print(("|cffffff7fAce2:|r %s is already enabled."):format(addon or name))
flickerstreak@28 1273 end
flickerstreak@28 1274 end
flickerstreak@28 1275 end,
flickerstreak@28 1276 },
flickerstreak@28 1277 disable = {
flickerstreak@28 1278 desc = "Disable addon(s).",
flickerstreak@28 1279 name = "Disable",
flickerstreak@28 1280 type = "text",
flickerstreak@28 1281 usage = "<addon 1> <addon 2> ...",
flickerstreak@28 1282 get = false,
flickerstreak@28 1283 input = true,
flickerstreak@28 1284 set = function(...)
flickerstreak@28 1285 for i = 1, select("#", ...) do
flickerstreak@28 1286 local addon = select(i, ...)
flickerstreak@28 1287 local name, title, _, enabled, _, reason = GetAddOnInfo(addon)
flickerstreak@28 1288 if reason == "MISSING" then
flickerstreak@28 1289 print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon))
flickerstreak@28 1290 elseif enabled then
flickerstreak@28 1291 DisableAddOn(addon)
flickerstreak@28 1292 print(("|cffffff7fAce2:|r %s is now disabled."):format(addon or name))
flickerstreak@28 1293 else
flickerstreak@28 1294 print(("|cffffff7fAce2:|r %s is already disabled."):format(addon or name))
flickerstreak@28 1295 end
flickerstreak@28 1296 end
flickerstreak@28 1297 end,
flickerstreak@28 1298 },
flickerstreak@28 1299 load = {
flickerstreak@28 1300 desc = "Load addon(s).",
flickerstreak@28 1301 name = "Load",
flickerstreak@28 1302 type = "text",
flickerstreak@28 1303 usage = "<addon 1> <addon 2> ...",
flickerstreak@28 1304 get = false,
flickerstreak@28 1305 input = true,
flickerstreak@28 1306 set = function(...)
flickerstreak@28 1307 for i = 1, select("#", ...) do
flickerstreak@28 1308 local addon = select(i, ...)
flickerstreak@28 1309 local name, title, _, _, loadable, reason = GetAddOnInfo(addon)
flickerstreak@28 1310 if reason == "MISSING" then
flickerstreak@28 1311 print(("|cffffff7fAce2:|r AddOn %q does not exist."):format(addon))
flickerstreak@28 1312 elseif not loadable then
flickerstreak@28 1313 print(("|cffffff7fAce2:|r AddOn %q is not loadable. Reason: %s."):format(addon, reason))
flickerstreak@28 1314 else
flickerstreak@28 1315 LoadAddOn(addon)
flickerstreak@28 1316 print(("|cffffff7fAce2:|r %s is now loaded."):format(addon or name))
flickerstreak@28 1317 end
flickerstreak@28 1318 end
flickerstreak@28 1319 end
flickerstreak@28 1320 },
flickerstreak@28 1321 info = {
flickerstreak@28 1322 desc = "Display information",
flickerstreak@28 1323 name = "Information",
flickerstreak@28 1324 type = "execute",
flickerstreak@28 1325 func = function()
flickerstreak@28 1326 local mem, threshold = gcinfo()
flickerstreak@28 1327 print((" - |cffffff7fMemory usage [|r%.3f MiB|cffffff7f]|r"):format(mem / 1024))
flickerstreak@28 1328 if threshold then
flickerstreak@28 1329 print((" - |cffffff7fThreshold [|r%.3f MiB|cffffff7f]|r"):format(threshold / 1024))
flickerstreak@28 1330 end
flickerstreak@28 1331 print((" - |cffffff7fFramerate [|r%.0f fps|cffffff7f]|r"):format(GetFramerate()))
flickerstreak@28 1332 local bandwidthIn, bandwidthOut, latency = GetNetStats()
flickerstreak@28 1333 bandwidthIn, bandwidthOut = floor(bandwidthIn * 1024), floor(bandwidthOut * 1024)
flickerstreak@28 1334 print((" - |cffffff7fLatency [|r%.0f ms|cffffff7f]|r"):format(latency))
flickerstreak@28 1335 print((" - |cffffff7fBandwidth in [|r%.0f B/s|cffffff7f]|r"):format(bandwidthIn))
flickerstreak@28 1336 print((" - |cffffff7fBandwidth out [|r%.0f B/s|cffffff7f]|r"):format(bandwidthOut))
flickerstreak@28 1337 print((" - |cffffff7fTotal addons [|r%d|cffffff7f]|r"):format(GetNumAddOns()))
flickerstreak@28 1338 print((" - |cffffff7fAce2 addons [|r%d|cffffff7f]|r"):format(#self.addons))
flickerstreak@28 1339 local ace = 0
flickerstreak@28 1340 local enabled = 0
flickerstreak@28 1341 local disabled = 0
flickerstreak@28 1342 local lod = 0
flickerstreak@28 1343 for i = 1, GetNumAddOns() do
flickerstreak@28 1344 local dep1, dep2, dep3, dep4 = GetAddOnDependencies(i)
flickerstreak@28 1345 if dep1 == "Ace" or dep2 == "Ace" or dep3 == "Ace" or dep4 == "Ace" then
flickerstreak@28 1346 ace = ace + 1
flickerstreak@28 1347 end
flickerstreak@28 1348 if IsAddOnLoadOnDemand(i) then
flickerstreak@28 1349 lod = lod + 1
flickerstreak@28 1350 end
flickerstreak@28 1351 local isActive, loadable = select(4, GetAddOnInfo(i))
flickerstreak@28 1352 if not isActive or not loadable then
flickerstreak@28 1353 disabled = disabled + 1
flickerstreak@28 1354 else
flickerstreak@28 1355 enabled = enabled + 1
flickerstreak@28 1356 end
flickerstreak@28 1357 end
flickerstreak@28 1358 print((" - |cffffff7fAce 1.x addons [|r%d|cffffff7f]|r"):format(ace))
flickerstreak@28 1359 print((" - |cffffff7fLoadOnDemand addons [|r%d|cffffff7f]|r"):format(lod))
flickerstreak@28 1360 print((" - |cffffff7fenabled addons [|r%d|cffffff7f]|r"):format(enabled))
flickerstreak@28 1361 print((" - |cffffff7fdisabled addons [|r%d|cffffff7f]|r"):format(disabled))
flickerstreak@28 1362 local libs = 0
flickerstreak@28 1363 if type(AceLibrary) == "table" and type(AceLibrary.libs) == "table" then
flickerstreak@28 1364 for _ in pairs(AceLibrary.libs) do
flickerstreak@28 1365 libs = libs + 1
flickerstreak@28 1366 end
flickerstreak@28 1367 end
flickerstreak@28 1368 print((" - |cffffff7fAceLibrary instances [|r%d|cffffff7f]|r"):format(libs))
flickerstreak@28 1369 end
flickerstreak@28 1370 }
flickerstreak@28 1371 }
flickerstreak@28 1372 })
flickerstreak@28 1373 elseif major == "AceModuleCore-2.0" then
flickerstreak@28 1374 AceModuleCore = instance
flickerstreak@28 1375 end
flickerstreak@28 1376 end
flickerstreak@28 1377
flickerstreak@28 1378 local function activate(self, oldLib, oldDeactivate)
flickerstreak@28 1379 AceAddon = self
flickerstreak@28 1380
flickerstreak@28 1381 self.playerLoginFired = oldLib and oldLib.playerLoginFired or DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.defaultLanguage
flickerstreak@28 1382 self.addonsToOnEnable = oldLib and oldLib.addonsToOnEnable
flickerstreak@28 1383 self.addons = oldLib and oldLib.addons or {}
flickerstreak@28 1384 self.nextAddon = oldLib and oldLib.nextAddon or {}
flickerstreak@28 1385 self.skipAddon = oldLib and oldLib.skipAddon or {}
flickerstreak@28 1386 self.addonsStarted = oldLib and oldLib.addonsStarted or {}
flickerstreak@28 1387 self.addonsEnabled = oldLib and oldLib.addonsEnabled or {}
flickerstreak@28 1388
flickerstreak@28 1389 if oldDeactivate then
flickerstreak@28 1390 oldDeactivate(oldLib)
flickerstreak@28 1391 end
flickerstreak@28 1392 end
flickerstreak@28 1393
flickerstreak@28 1394 AceLibrary:Register(AceAddon, MAJOR_VERSION, MINOR_VERSION, activate, nil, external)