annotate lib/AceAddon-2.0/AceAddon-2.0.lua @ 26:261f0f6bd68a

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