Advertisement
Guest User

Untitled

a guest
Nov 20th, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 382.79 KB | None | 0 0
  1. local GlobalAddonName, ExRT = ...
  2.  
  3. local GetTime, IsEncounterInProgress, RAID_CLASS_COLORS, GetInstanceInfo, GetSpellCharges = GetTime, IsEncounterInProgress, RAID_CLASS_COLORS, GetInstanceInfo, GetSpellCharges
  4. local string_gsub, wipe, tonumber, pairs, ipairs, string_trim, format, floor, ceil, abs, type, sort = string.gsub, table.wipe, tonumber, pairs, ipairs, string.trim, format, floor, ceil, abs, type, sort
  5. local UnitIsDeadOrGhost, UnitIsConnected, UnitName, UnitCreatureFamily, UnitIsDead, UnitIsGhost, UnitGUID, UnitInRange = UnitIsDeadOrGhost, UnitIsConnected, UnitName, UnitCreatureFamily, UnitIsDead, UnitIsGhost, UnitGUID, UnitInRange
  6.  
  7. local RaidInCombat, ClassColorNum, GetDifficultyForCooldownReset, DelUnitNameServer, NumberInRange = ExRT.F.RaidInCombat, ExRT.F.classColorNum, ExRT.F.GetDifficultyForCooldownReset, ExRT.F.delUnitNameServer, ExRT.F.NumberInRange
  8. local GetEncounterTime, UnitCombatlogname, GetUnitInfoByUnitFlag, ScheduleTimer, CancelTimer, GetRaidDiffMaxGroup, round, table_wipe2, dtime = ExRT.F.GetEncounterTime, ExRT.F.UnitCombatlogname, ExRT.F.GetUnitInfoByUnitFlag, ExRT.F.ScheduleTimer, ExRT.F.CancelTimer, ExRT.F.GetRaidDiffMaxGroup, ExRT.F.Round, ExRT.F.table_wipe, ExRT.F.dtime
  9.  
  10. local VExRT, VExRT_CDE = nil
  11.  
  12. local module = ExRT.mod:New("ExCD2",ExRT.L.cd2)
  13. local ELib,L = ExRT.lib,ExRT.L
  14.  
  15. module._C = {}
  16. module.db.spellDB = {
  17. {31821, "PALADIN", nil, {31821, 180, 6}, nil, nil, }, --Владение аурами
  18. {204150,"PALADIN", nil, nil, {204150,300, 6}, nil, }, --Эгида Света
  19. {62618, "PRIEST", nil, {62618, 180, 10}, nil, nil, }, --Слово силы: Барьер
  20. {98008, "SHAMAN", nil, nil, nil, {98008, 180, 6}, }, --Тотем духовной связи
  21. {97462, "WARRIOR", nil, {97462, 180, 10}, {97462, 180, 10}, nil, }, --Ободряющий клич
  22. {31842, "PALADIN", nil, {31842, 120, 20}, nil, nil, }, --Гнев карателя
  23. {64843, "PRIEST", nil, nil, {64843, 180, 8}, nil, }, --Божественный гимн
  24. {108280,"SHAMAN", nil, nil, nil, {108280,180, 10}, }, --Тотем целительного прилива
  25. {740, "DRUID", nil, nil, nil, nil,{740,180, 8}, }, --Спокойствие
  26. {115310,"MONK", nil, nil, nil, {115310,180, 0}, }, --Восстановление сил
  27. {15286, "PRIEST", nil, nil, nil, {15286, 180, 15}, }, --Объятия вампира
  28. {196718,"DEMONHUNTER", nil, {196718,180, 8}, nil, }, --Мрак
  29. {207399,"SHAMAN", nil, nil, nil, {207399,300, 30}, }, --Тотем защиты Предков
  30.  
  31. {102342,"DRUID", nil, nil, nil, nil,{102342,90, 12}, }, --Железная кора
  32. {47788, "PRIEST", nil, nil, {47788, 240, 10}, nil, }, --Оберегающий дух
  33. {33206, "PRIEST", nil, {33206, 240, 8}, nil, nil, }, --Подавление боли
  34. {6940, "PALADIN", nil, {6940, 150, 0}, {6940, 150, 0}, nil, }, --Жертвенное благословление
  35. {633, "PALADIN", {633, 600, 0}, nil, nil, nil, }, --Возложение рук
  36. {116849,"MONK", nil, nil, nil, {116849,180, 12}, }, --Исцеляющий кокон
  37. {207810,"DEMONHUNTER", nil, nil, {207810,120, 15}, }, --Узы Пустоты
  38. {1022, "PALADIN", {1022, 300, 10}, nil, nil, nil, }, --Благословение защиты
  39. {204018,"PALADIN", nil, nil, {204018,180, 10}, nil, }, --Благословение защиты от заклинаний
  40. {1044, "PALADIN", {1044, 25, 8}, nil, nil, nil, }, --Благословенная свобода
  41. {73325, "PRIEST", nil, {73325, 90, 0}, {73325, 90, 0}, nil, }, --Духовное рвение
  42.  
  43. {106898,"DRUID", nil, nil, {77764, 120, 8}, {77761, 120, 8},nil, }, --Тревожный рев
  44. {192077,"SHAMAN", {192077,120, 15}, nil, nil, nil, }, --Тотем ветряного порыва
  45.  
  46. {187614,"NO", {187614,120, 15}, nil, nil, nil, }, --Legendary DD
  47. {187612,"NO", {187612,120, 15}, nil, nil, nil, }, --Legendary Heal
  48. {187613,"NO", {187613,120, 15}, nil, nil, nil, }, --Legendary Tank
  49.  
  50. {161642,"NO", {161642,0, 0}, nil, nil, nil, }, --Resurrecting [Raid Combat Res]
  51. {20484, "DRUID", {20484, 600, 0}, nil, nil, nil,nil, }, --Возрождение
  52. {20707, "WARLOCK", {20707, 600, 0}, nil, nil, nil, }, --Камень души
  53. {61999, "DEATHKNIGHT", {61999, 600, 0}, nil, nil, nil, }, --Воскрешение союзника
  54. {20608, "SHAMAN", {21169, 1800, 0}, nil, nil, nil, }, --Реинкарнация
  55.  
  56. {46968, "WARRIOR", {46968, 40, 0}, nil, nil, nil, }, --Ударная волна
  57. {119381,"MONK", {119381,45, 5}, nil, nil, nil, }, --Круговой удар ногой
  58. {179057,"DEMONHUNTER", nil, {179057,60, 5}, nil, }, --Кольцо Хаоса
  59. {192058,"SHAMAN", {192058,45, 2}, nil, nil, nil, }, --Тотем выброса тока
  60.  
  61. {32375, "PRIEST", {32375, 15, 0}, nil, nil, nil, }, --Массовое рассеивание
  62. {64901, "PRIEST", nil, nil, {64901, 360, 10}, nil, }, --Символ надежды
  63. {29166, "DRUID", nil, {29166, 180, 10}, nil, nil,{29166,180, 10}, }, --Озарение
  64.  
  65. {108199,"DEATHKNIGHT", nil, {108199,180, 0}, nil, nil, }, --Хватка Кровожада
  66. {49576, "DEATHKNIGHT", nil, {49576, 15, 0}, {49576, 25, 0}, {49576, 25, 0}, }, --Хватка смерти
  67. {2825, "SHAMAN", {2825, 300, 40}, nil, nil, nil, }, --Жажда крови
  68. {80353, "MAGE", {80353, 300, 40}, nil, nil, nil, }, --Искажение времени
  69. --{id, class, all specs, spec1, spec2={spellid,cd,duration},spec3,spec4 }, --name
  70. }
  71.  
  72.  
  73. module.db.Cmirror = module._C
  74. module.db.dbCountDef = #module.db.spellDB
  75. module.db.findspecspells = {
  76. [224968] = 62, [30451] = 62, [7268] = 62,
  77. [194466] = 63, [133] = 63, [11366] = 63,
  78. [214634] = 64, [116] = 64, [30455] = 64,
  79.  
  80. [200652] = 65, [20473] = 65, [82326] = 65,
  81. [209202] = 66, [53600] = 66, [31935] = 66,
  82. [205273] = 70, [85256] = 70, [53385] = 70,
  83.  
  84. [209577] = 71, [12294] = 71, [167105] = 71,
  85. [205546] = 72, [23881] = 72, [184367] = 72,
  86. [203524] = 73, [20243] = 73, [23922] = 73,
  87.  
  88. [202767] = 102, [78674] = 102, [190984] = 102,
  89. [210722] = 103, [52610] = 103, --[1822] = 103,
  90. [200851] = 104, [33917] = 104, [22842] = 104,
  91. [208253] = 105, [188550] = 105, [48438] = 105,
  92.  
  93. [205223] = 250, [206930] = 250, [50842] = 250,
  94. [190778] = 251, [49143] = 251, [49184] = 251,
  95. [220143] = 252, [47541] = 252, [63560] = 252,
  96.  
  97. [207068] = 253, [193455] = 253, [34026] = 253,
  98. [204147] = 254, [19434] = 254, [185901] = 254,
  99. [203415] = 255, [190928] = 255, [186270] = 255,
  100.  
  101. [207946] = 256, [200829] = 256, [47666] = 256,
  102. [139] = 257, [33076] = 257,
  103. [205065] = 258, [8092] = 258, [34914] = 258,
  104.  
  105. [192759] = 259, [1329] = 259, [1943] = 259,
  106. [202665] = 260, [2098] = 260, [193315] = 260,
  107. [209782] = 261, [196819] = 261, [53] = 261,
  108.  
  109. [205495] = 262, [188196] = 262, [188389] = 262,
  110. [204945] = 263, [17364] = 263, [60103] = 263,
  111. [207778] = 264, [61295] = 264, [1064] = 264,
  112.  
  113. [216698] = 265, [30108] = 265, [980] = 265,
  114. [211714] = 266, [603] = 266, [105174] = 266,
  115. [196586] = 267, [29722] = 267, [116858] = 267,
  116.  
  117. [214326] = 268, [205523] = 268, [121253] = 268,
  118. [205320] = 269, [113656] = 269, --[100780] = 269,
  119. [205406] = 270, [115151] = 270, [116670] = 270,
  120.  
  121. [201467] = 577, [162243] = 577, [198013] = 577,
  122. [207407] = 581, [203782] = 581, [228477] = 581,
  123. }
  124. module.db.classNames = ExRT.GDB.ClassList
  125.  
  126. module.db.specByClass = {}
  127. for class,classData in pairs(ExRT.GDB.ClassSpecializationList) do
  128. local newData = {0}
  129. for i=1,#classData do
  130. newData[#newData + 1] = classData[i]
  131. end
  132. module.db.specByClass[class] = newData
  133. end
  134.  
  135. module.db.specIcons = ExRT.GDB.ClassSpecializationIcons
  136. module.db.specInDBase = {
  137. [253] = 4, [254] = 5, [255] = 6,
  138. [71] = 4, [72] = 5, [73] = 6,
  139. [65] = 4, [66] = 5, [70] = 6,
  140. [62] = 4, [63] = 5, [64] = 6,
  141. [256] = 4, [257] = 5, [258] = 6,
  142. [265] = 4, [266] = 5, [267] = 6,
  143. [250] = 4, [251] = 5, [252] = 6,
  144. [259] = 4, [260] = 5, [261] = 6,
  145. [102] = 4, [103] = 5, [104] = 6, [105] = 7,
  146. [268] = 4, [269] = 5, [270] = 6,
  147. [262] = 4, [263] = 5, [264] = 6,
  148. [577] = 4, [581] = 5,
  149. [0] = 3,
  150. }
  151.  
  152. do
  153. local specList = {
  154. [62] = "MAGEDPS1", --Arcane
  155. [63] = "MAGEDPS2", --Fire
  156. [64] = "MAGEDPS3", --Frost
  157. [65] = "PALADINHEAL",
  158. [66] = "PALADINTANK",
  159. [70] = "PALADINDPS",
  160. [71] = "WARRIORDPS1", --Arms
  161. [72] = "WARRIORDPS2", --Fury
  162. [73] = "WARRIORTANK",
  163. [102] = "DRUIDDPS1", --Owl
  164. [103] = "DRUIDDPS2", --Cat
  165. [104] = "DRUIDTANK",
  166. [105] = "DRUIDHEAL",
  167. [250] = "DEATHKNIGHTTANK",
  168. [251] = "DEATHKNIGHTDPS1", --Frost
  169. [252] = "DEATHKNIGHTDPS2", --Unholy
  170. [253] = "HUNTERDPS1", --BM
  171. [254] = "HUNTERDPS2", --MM
  172. [255] = "HUNTERDPS3", --Survival
  173. [256] = "PRIESTHEAL1", --Disc
  174. [257] = "PRIESTHEAL2", --Holy
  175. [258] = "PRIESTDPS",
  176. [259] = "ROGUEDPS1", --Assassination
  177. [260] = "ROGUEDPS2", --Combat
  178. [261] = "ROGUEDPS3", --Subtlety
  179. [262] = "SHAMANDPS1", --Elemental
  180. [263] = "SHAMANDPS2", --Enhancement
  181. [264] = "SHAMANHEAL",
  182. [265] = "WARLOCKDPS1", --Affliction
  183. [266] = "WARLOCKDPS2", --Demonology
  184. [267] = "WARLOCKDPS3", --Destruction
  185. [268] = "MONKTANK",
  186. [269] = "MONKDPS",
  187. [270] = "MONKHEAL",
  188. [577] = "DEMONHUNTERDPS",
  189. [581] = "DEMONHUNTERTANK",
  190. [0] = "NO",
  191. }
  192. module.db.specInLocalizate = setmetatable({},{__index = function (t,k)
  193. if tonumber(k) then
  194. return specList[k]
  195. else
  196. for i,val in pairs(specList) do
  197. if val == k then
  198. return i
  199. end
  200. end
  201. end
  202. end})
  203. end
  204.  
  205. module.db.historyUsage = {}
  206.  
  207. module.db.testMode = nil
  208. module.db.isEncounter = nil
  209.  
  210. local cdsNav_wipe,cdsNav_set = nil
  211. do
  212. local cdsNavData = {}
  213. local nilData = {}
  214. module.db.cdsNav = setmetatable({}, {
  215. __index = function (t,k)
  216. return cdsNavData[k] or nilData
  217. end
  218. })
  219. function cdsNav_wipe()
  220. wipe(cdsNavData)
  221. end
  222. function cdsNav_set(playerName,spellID,pos)
  223. local e = cdsNavData[playerName]
  224. if not e then
  225. e = {}
  226. cdsNavData[playerName] = e
  227. end
  228. e[spellID] = pos
  229. end
  230. end
  231.  
  232. do
  233. local sessionData = {}
  234. local nilData = {}
  235. module.db.session_gGUIDs = setmetatable({}, {
  236. __index = function (t,k)
  237. return sessionData[k] or nilData
  238. end,
  239. __newindex = function (t,k,v)
  240. local e = sessionData[k]
  241. if not e then
  242. e = {}
  243. sessionData[k] = e
  244. end
  245. if v > 0 then
  246. e[v] = true
  247. else
  248. e[-v] = nil
  249. end
  250. end
  251. })
  252. module.db.session_gGUIDs_DEBUG = sessionData
  253. end
  254.  
  255. module.db.session_Pets = {}
  256. module.db.session_PetOwner = {}
  257.  
  258. module.db.spell_isTalent = {
  259. [7384]=1, [46968]=1, [107570]=1, [772]=1, [107574]=1, [197690]=1, [207982]=1, [152277]=1,
  260. [46968]=1, [107570]=1, [107574]=1, [12292]=1, [46924]=1, [118000]=1,
  261. [46968]=1, [107570]=1, [202168]=1, [107574]=1, [228920]=1,
  262.  
  263. [223306]=1, [114158]=1, [205656]=1, [214202]=1, [20066]=1, [115750]=1, [105809]=1, [114165]=1, [156910]=1, [200025]=1,
  264. [204019]=1, [204035]=1, [20066]=1, [115750]=1, [204018]=1, [204013]=1, [213652]=1, [204150]=1, [152262]=1,
  265. [213757]=1, [205228]=1, [217020]=1, [20066]=1, [115750]=1, [202270]=1, [198034]=1, [205191]=1, [210191]=1, [205656]=1, [224668]=1, [210220]=1,
  266.  
  267. [217200]=1, [53209]=1, [109248]=1, [19386]=1, [19577]=1, [131894]=1, [120360]=1, [194386]=1, [201430]=1,
  268. [194599]=1, [212431]=1, [206817]=1, [109248]=1, [19386]=1, [199483]=1, [131894]=1, [120360]=1, [194386]=1, [214579]=1, [198670]=1,
  269. [200163]=1, [206505]=1, [194277]=1, [192488]=1, [191241]=1, [200108]=1, [199483]=1, [212436]=1, [194855]=1, [201078]=1,
  270.  
  271. [16511]=1, [200806]=1, [137619]=1, [152150]=1,
  272. [195457]=1, [199743]=1, [185767]=1, [51690]=1, [137619]=1, [152150]=1,
  273. [137619]=1, [152150]=1,
  274.  
  275. [214621]=1, [121536]=1, [204263]=1, [123040]=1, [10060]=1, [110744]=1, [120517]=1,
  276. [121536]=1, [214121]=1, [19236]=1, [204263]=1, [64901]=1, [110744]=1, [120517]=1, [200183]=1, [204883]=1,
  277. [205351]=1, [205369]=1, [10060]=1, [205385]=1, [200174]=1, [193223]=1,
  278.  
  279. [206931]=1, [221699]=1, [219809]=1, [194679]=1, [194844]=1, [206977]=1,
  280. [57330]=1, [207127]=1, [207167]=1, [207256]=1, [152279]=1, [194913]=1,
  281. [194918]=1, [108194]=1, [207319]=1, [207349]=1, [152280]=1, [130736]=1,
  282.  
  283. [192063]=1, [108281]=1, [192077]=1, [192058]=1, [51485]=1, [196932]=1, [117014]=1, [210714]=1, [16166]=1, [192249]=1, [114050]=1, [192222]=1,
  284. [201898]=1, [201897]=1, [215864]=1, [196884]=1, [192077]=1, [192058]=1, [51485]=1, [196932]=1, [197214]=1, [114051]=1, [188089]=1,
  285. [73685]=1, [192063]=1, [192077]=1, [192058]=1, [51485]=1, [196932]=1, [108281]=1, [207399]=1, [198838]=1, [157153]=1, [114052]=1, [197995]=1,
  286.  
  287. [205022]=1, [205025]=1, [212653]=1, [55342]=1, [116011]=1, [157980]=1, [205032]=1, [108839]=1, [113724]=1, [153626]=1,
  288. [212653]=1, [55342]=1, [116011]=1, [157981]=1, [205029]=1, [108839]=1, [113724]=1, [44457]=1, [198929]=1, [153561]=1,
  289. [205021]=1, [212653]=1, [55342]=1, [116011]=1, [157997]=1, [205030]=1, [108839]=1, [113724]=1, [153595]=1,
  290.  
  291. [48181]=1, [6789]=1, [5484]=1, [196098]=1, [48018]=1, [108416]=1, [108503]=1, [205179]=1,
  292. [205181]=1, [6789]=1, [30283]=1, [196098]=1, [48018]=1, [108416]=1, [205180]=1,
  293. [152108]=1, [6789]=1, [30283]=1, [196098]=1, [48018]=1, [108416]=1, [108501]=1, [196447]=1,
  294.  
  295. [123986]=1, [115098]=1, [115008]=1, [116841]=1, [115399]=1, [116844]=1, [115315]=1, [119381]=1, [122281]=1, [122783]=1, [122278]=1, [116847]=1, [132578]=1,
  296. [123986]=1, [124081]=1, [197945]=1, [115008]=1, [116841]=1, [116844]=1, [198898]=1, [119381]=1, [122281]=1, [122783]=1, [122278]=1, [196725]=1, [198664]=1, [115313]=1, [197908]=1,
  297. [123986]=1, [115098]=1, [115008]=1, [116841]=1, [115288]=1, [116844]=1, [119381]=1, [122281]=1, [122783]=1, [122278]=1, [116847]=1, [123904]=1, [152175]=1, [152173]=1,
  298.  
  299. [205636]=1, [202425]=1, [108238]=1, [102280]=1, [102401]=1, [5211]=1, [102359]=1, [132469]=1, [102560]=1, [202359]=1, [202360]=1, [202770]=1,
  300. [108238]=1, [102280]=1, [102401]=1, [5211]=1, [102359]=1, [132469]=1, [102543]=1, [202060]=1, [202028]=1,
  301. [155835]=1, [102280]=1, [102401]=1, [5211]=1, [102359]=1, [132469]=1, [102558]=1, [204066]=1,
  302. [102351]=1, [108238]=1, [102280]=1, [102401]=1, [5211]=1, [102359]=1, [132469]=1, [33891]=1, [197721]=1,
  303.  
  304. [213241]=1, [196555]=1, [211881]=1, [206491]=1, [211048]=1, [211053]=1,
  305. [213241]=1, [211881]=1, [212084]=1, [207810]=1, [227225]=1, [202138]=1,
  306.  
  307. --Other & items
  308. [67826]=1,
  309. }
  310.  
  311. module.db.spell_talentsList = {
  312. --2:08 16.07.2016 Build 22231 [Pre-patch Beta]
  313. ["WARRIOR"] = {
  314. [71] = {
  315. 202297,7384,202161,
  316. 46968,107570,103827,
  317. 202316,772,107574,
  318. 29838,202163,197690,
  319. 215550,202593,207982,
  320. 227266,215538,202612,
  321. 152278,203179,152277,
  322. },
  323. [72] = {
  324. 215556,202296,215568,
  325. 46968,107570,103827,
  326. 215569,206320,107574,
  327. 202224,202163,208154,
  328. 206315,215571,202922,
  329. 12292,206313,215573,
  330. 46924,202751,118000,
  331. },
  332. [73] = {
  333. 46968,107570,103828,
  334. 202168,205484,223657,
  335. 202288,122509,107574,
  336. 223662,202163,203201,
  337. 202560,202561,202095,
  338. 202572,202603,202743,
  339. 152278,203177,228920,
  340. },
  341. },
  342. ["PALADIN"] = {
  343. [65] = {
  344. 223306,114158,196926,
  345. 230332,114154,214202,
  346. 198054,20066,115750,
  347. 183425,183416,183415,
  348. 197646,105809,114165,
  349. 196923,53376,183778,
  350. 156910,197446,200025,
  351. },
  352. [66] = {
  353. 152261,204019,203785,
  354. 203776,204035,204023,
  355. 198054,20066,115750,
  356. 204018,230332,203797,
  357. 213652,204139,204077,
  358. 204150,183778,204054,
  359. 204074,152262,203791,
  360. },
  361. [70] = {
  362. 198038,213757,205228,
  363. 203316,217020,218178,
  364. 198054,20066,115750,
  365. 202271,202270,198034,
  366. 215661,205191,210191,
  367. 213313,230332,202273,
  368. 223817,224668,210220,
  369. },
  370. },
  371. ["HUNTER"] = {
  372. [253] = {
  373. 204308,194397,193532,
  374. 199530,217200,53209,
  375. 109215,199523,199921,
  376. 199528,194306,130392,
  377. 109248,19386,19577,
  378. 131894,120360,194386,
  379. 201430,199532,191384,
  380. },
  381. [254] = {
  382. 155228,193533,53238,
  383. 194595,194599,199527,
  384. 109215,199523,199921,
  385. 212431,206817,213423,
  386. 109248,19386,199483,
  387. 131894,120360,194386,
  388. 214579,198670,199522,
  389. },
  390. [255] = {
  391. 204315,200163,201082,
  392. 206505,201075,201078,
  393. 109215,199523,199921,
  394. 194277,199518,162488,
  395. 191241,200108,199483,
  396. 212436,194855,87935,
  397. 194407,199543,191384,
  398. },
  399. },
  400. ["ROGUE"] = {
  401. [259] = {
  402. 196864,193640,16511,
  403. 14062,108208,108209,
  404. 193531,114015,14983,
  405. 108211,79008,31230,
  406. 196861,131511,154904,
  407. 200802,193539,200806,
  408. 152152,137619,152150,
  409. },
  410. [260] = {
  411. 196937,200733,196938,
  412. 195457,196924,196922,
  413. 193531,114015,14983,
  414. 193546,79008,31230,
  415. 199743,131511,108216,
  416. 185767,193539,51690,
  417. 5171,137619,152150,
  418. },
  419. [261] = {
  420. 31223,193537,200758,
  421. 14062,108208,108209,
  422. 193531,114015,14983,
  423. 200759,79008,31230,
  424. 196951,131511,200778,
  425. 196979,193539,206237,
  426. 196976,137619,152150,
  427. },
  428. },
  429. ["PRIEST"] = {
  430. [256] = {
  431. 200347,193134,214621,
  432. 121536,64129,193063,
  433. 204263,196704,205367,
  434. 129250,197045,123040,
  435. 197419,10060,109142,
  436. 152118,110744,120517,
  437. 204197,200309,204065,
  438. },
  439. [257] = {
  440. 200128,200153,193155,
  441. 121536,214121,19236,
  442. 204263,200199,196707,
  443. 196985,200209,64901,
  444. 109186,32546,197034,
  445. 197031,110744,120517,
  446. 200183,193157,204883,
  447. },
  448. [258] = {
  449. 109142,193195,205351,
  450. 193173,64129,193063,
  451. 205369,196704,205367,
  452. 199849,199853,205371,
  453. 199855,155271,162452,
  454. 10060,205385,200174,
  455. 193225,73510,193223,
  456. },
  457. },
  458. ["DEATHKNIGHT"] = {
  459. [250] = {
  460. 195679,221536,206931,
  461. 194662,212744,211078,
  462. 219786,221699,205727,
  463. 206940,205723,219809,
  464. 206970,206960,219779,
  465. 206967,194679,206974,
  466. 194844,206977,114556,
  467. },
  468. [251] = {
  469. 207057,194878,207061,
  470. 207060,194909,57330,
  471. 207126,207127,207142,
  472. 207161,207167,207170,
  473. 207188,207200,212765,
  474. 207230,207104,194912,
  475. 207256,152279,194913,
  476. },
  477. [252] = {
  478. 194916,207264,207269,
  479. 207317,194917,194918,
  480. 207289,207305,207311,
  481. 207313,108194,207316,
  482. 207321,207319,212763,
  483. 198943,207346,207272,
  484. 207349,152280,130736,
  485. },
  486. },
  487. ["SHAMAN"] = {
  488. [262] = {
  489. 201909,170374,210643,
  490. 192063,108281,192077,
  491. 192058,51485,196932,
  492. 117014,192087,108283,
  493. 192235,117013,210714,
  494. 16166,192249,210707,
  495. 114050,210689,192222,
  496. },
  497. [263] = {
  498. 201898,201900,201897,
  499. 215864,196884,192077,
  500. 192058,51485,196932,
  501. 192106,192087,210853,
  502. 192234,210727,210731,
  503. 192246,197211,197214,
  504. 114051,197992,188089,
  505. },
  506. [264] = {
  507. 200071,73685,200072,
  508. 192063,192088,192077,
  509. 192058,51485,196932,
  510. 197464,108281,200076,
  511. 207399,198838,207401,
  512. 197467,157153,108283,
  513. 114052,197995,157154,
  514. },
  515. },
  516. ["MAGE"] = {
  517. [62] = {
  518. 205022,205025,205035,
  519. 212653,86949,11958,
  520. 55342,116011,1463,
  521. 157980,205032,205028,
  522. 108839,113724,205036,
  523. 114923,157976,205039,
  524. 155147,198923,153626,
  525. },
  526. [63] = {
  527. 205020,205023,205026,
  528. 212653,86949,11958,
  529. 55342,116011,1463,
  530. 157981,205029,205033,
  531. 108839,113724,205036,
  532. 44457,157976,205037,
  533. 155148,198929,153561,
  534. },
  535. [64] = {
  536. 205021,205024,205027,
  537. 212653,86949,11958,
  538. 55342,116011,1463,
  539. 157997,205030,56377,
  540. 108839,113724,205036,
  541. 112948,157976,205038,
  542. 155149,199786,153595,
  543. },
  544. },
  545. ["WARLOCK"] = {
  546. [265] = {
  547. 48181,196102,198590,
  548. 196105,196103,196104,
  549. 219272,6789,5484,
  550. 63106,196226,196098,
  551. 48018,111400,108416,
  552. 152107,108501,108503,
  553. 205178,205179,215941,
  554. },
  555. [266] = {
  556. 196269,205181,205145,
  557. 196270,196272,196277,
  558. 219272,6789,30283,
  559. 196283,196605,196098,
  560. 48018,111400,108416,
  561. 152107,108501,171975,
  562. 205180,157695,215941,
  563. },
  564. [267] = {
  565. 196406,205184,17877,
  566. 205148,152108,196104,
  567. 219272,6789,30283,
  568. 196412,196408,196098,
  569. 48018,111400,108416,
  570. 152107,108501,108503,
  571. 196410,196447,215941,
  572. },
  573. },
  574. ["MONK"] = {
  575. [268] = {
  576. 123986,196607,115098,
  577. 115008,116841,115173,
  578. 196721,115399,196719,
  579. 116844,115315,119381,
  580. 122281,122783,122278,
  581. 116847,132578,196730,
  582. 196738,196736,196737,
  583. },
  584. [269] = {
  585. 123986,196607,115098,
  586. 115008,116841,115173,
  587. 115288,115396,121817,
  588. 116844,196722,119381,
  589. 122281,122783,122278,
  590. 116847,123904,196740,
  591. 196743,152175,152173,
  592. },
  593. [270] = {
  594. 123986,124081,197945,
  595. 115008,116841,115173,
  596. 197915,210802,197900,
  597. 116844,198898,119381,
  598. 122281,122783,122278,
  599. 196725,198664,115313,
  600. 197908,197895,210804,
  601. },
  602. },
  603. ["DRUID"] = {
  604. [102] = {
  605. 205636,202425,202345,
  606. 108238,102280,102401,
  607. 202157,197491,197492,
  608. 5211,102359,132469,
  609. 114107,102560,202347,
  610. 202342,202359,202360,
  611. 202770,202354,202430,
  612. },
  613. [103] = {
  614. 202021,202022,155580,
  615. 108238,102280,102401,
  616. 197488,217615,197492,
  617. 5211,102359,132469,
  618. 158476,102543,52610,
  619. 202031,202032,202060,
  620. 202028,155672,155577,
  621. },
  622. [104] = {
  623. 203953,155835,203962,
  624. 204012,102280,102401,
  625. 197488,202155,197492,
  626. 5211,102359,132469,
  627. 158477,102558,203964,
  628. 203974,155578,203965,
  629. 204053,204066,80313,
  630. },
  631. [105] = {
  632. 200383,102351,207383,
  633. 108238,102280,102401,
  634. 197632,197490,197491,
  635. 5211,102359,132469,
  636. 158478,33891,200390,
  637. 207385,197073,155675,
  638. 155577,197061,197721,
  639. },
  640. },
  641. ["DEMONHUNTER"] = {
  642. [577] = {
  643. 192939,206475,203550,
  644. 203551,203555,206478,
  645. 213241,206416,206473,
  646. 196555,205411,204909,
  647. 206476,211881,206491,
  648. 203556,206477,193897,
  649. 211048,211053,213410,
  650. },
  651. [581] = {
  652. 207550,207548,209400,
  653. 207697,227174,207739,
  654. 213241,227322,211881,
  655. 218612,209795,217996,
  656. 207666,202138,209281,
  657. 212084,203753,218679,
  658. 209258,207810,227225,
  659. },
  660. },
  661. }
  662. module.db.spell_glyphsList = {}
  663. module.db.spell_charge_fix = { --Спелы с зарядами
  664. [100]=103827,
  665. [12294]=202593,
  666. [2565]=1,
  667. [198304]=1,
  668. [35395]=1,
  669. [214202]=1,
  670. [53595]=1,
  671. [53600]=1,
  672. [210191]=1,
  673. [214579]=1,
  674. [190928]=1,
  675. [200163]=1,
  676. [185313]=1,
  677. [121536]=1,
  678. [32379]=1,
  679. [50842]=1,
  680. [221699]=1,
  681. [194679]=1,
  682. [51505]=108283,
  683. [5394]=108283,
  684. [212653]=1,
  685. [45438]=11958,
  686. [116011]=1,
  687. [122]=205036,
  688. [108853]=1,
  689. [205181]=1,
  690. [17962]=1,
  691. [109132]=1,
  692. [115308]=1,
  693. [119582]=1,
  694. [122281]=1,
  695. [197945]=1,
  696. [61336]=1,
  697. [202028]=1,
  698. [22842]=1,
  699. [18562]=200383,
  700. [195072]=1,
  701. [203720]=1,
  702. [189110]=1,
  703. [190784]=230332,
  704. [215206]=1,
  705. }
  706.  
  707. module.db.spell_durationByTalent_fix = { --Изменение длительности талантом\глифом вид: [спелл] = {spellid глифа\таланта, изменение времени (-10;10;*0.5;*1.5)}
  708. [52174] = {202163,3},
  709. [167105] = {202612,16},
  710. [31842] = {53376,"*1.5"},
  711. [781] = {109215,8},
  712. [186257] = {199921,3},
  713. [190925] = {109215,8},
  714. [212552] = {219779,"*1.5"},
  715. [48707] = {210852,"*2",207321,5},
  716. [80240] = {196410,12},
  717. [202137] = {209281,-1,207666,2},
  718. [204596] = {209281,-1,207666,2},
  719. [207684] = {209281,-1},
  720. [202138] = {209281,-1,207666,2},
  721. [6544] = {209483,4},
  722. [1160] = {188651,"*1.5"},
  723. [31281] = {200311,2},
  724. [498] = {200407,4},
  725. [1022] = {206338,"*1.5"},
  726. [1044] = {206338,"*1.5"},
  727. [6940] = {206338,"*1.5"},
  728. [204018] = {206338,"*1.5"},
  729. [26573] = {209218,{1,2,3,4,5,6}},
  730. [205273] = {179546,6},
  731. [31884] = {186945,{2.5,5,7.5,10,12.5,15}},
  732. [224668] = {186945,{2.5,5,7.5,10,12.5,15}},
  733. [193530] = {197038,{1,2,3,4,5,6}},
  734. [121471] = {197386,{3,6,10,13,16,20}},
  735. [47536] = {197727,{1,2,3,4,5,6}},
  736. [49028] = {192514,{2,4,6,8,10,12}},
  737. [63560] = {208598,{2,4,6,8,10,12}},
  738. [5394] = {210604,"*1.2"},
  739. [108280] = {210604,"*1.2"},
  740. [98008] = {210604,"*1.2"},
  741. [12042] = {187264,{1,2,3,4,5,6}},
  742. [61336] = {210557,{1,2,3,4,5,6}},
  743. [22812] = {200399,{0.5,1,1.5,2,2.5,3}},
  744. [192081] = {200399,{0.5,1,1.5,2,2.5,3}},
  745. [192083] = {200399,{0.5,1,1.5,2,2.5,3}},
  746. [204021] = {212894,2},
  747. }
  748.  
  749. module.db.spell_cdByTalent_fix = { --Изменение кд талантом\глифом вид: [спелл] = {spellid глифа\таланта, изменение времени (-60;60);spellid2,time2;spellid3,time3;...}
  750. [100] = {103827,-3},
  751. [52174] = {202163,-15},
  752. [642] = {114154,"*0.7",213313,"*0.5"},
  753. [498] = {114154,"*0.7"},
  754. [633] = {200326,{-54.5,-100,-138.5,-171.5,-200,-225},114154,"*0.7",206380,"*0.4"},
  755. [20473] = {53376,"*0.5"},
  756. [190784] = {204139,"*0.5"},
  757. [35395] = {203316,-1},
  758. [187698] = {199518,"*0.5",203752,"*0.8"},
  759. [191433] = {199518,"*0.5",203752,"*0.8"},
  760. [187650] = {199518,"*0.85",203752,"*0.8"},
  761. [8122] = {196704,-30},
  762. [108199] = {206970,-60},
  763. [212552] = {212763,-15},
  764. [79206] = {192088,-60},
  765. [80240] = {196410,-20},
  766. [109132] = {115173,-5},
  767. [115308] = {196721,-3},
  768. [119582] = {196721,-3},
  769. [77761] = {204012,"*0.5"},
  770. [22812] = {200402,{-3,-6,-9,-12,-15,-18},203965,"*0.67"},
  771. [61336] = {203965,"*0.67"},
  772. [18562] = {200383,-5},
  773. [740] = {197073,-60},
  774. [102342] = {197061,-30},
  775. [198793] = {203551,-10},
  776. [179057] = {206477,"*0.67"},
  777. [189110] = {207550,-5},
  778. [202137] = {209281,"*0.8"},
  779. [204596] = {209281,"*0.8"},
  780. [207684] = {209281,"*0.8"},
  781. [202138] = {209281,"*0.8"},
  782. [1719] = {200870,-10},
  783. [6544] = {203230,{-2,-4,-6,-8,-10,-12}},
  784. [1022] = {200298,{-15,-30,-45,-60,-75,-90},186994,{-30,-60,-90,-120,-150,-180}},
  785. [1044] = {200298,{-1.25,-2.5,-3.75,-5,-6.25,-7.5}},
  786. [6940] = {200298,{-7.5,-15,-22.5,-30,-37.5,-45},209285,-60},
  787. [31850] = {209220,{-10,-20,-30,-40,-50,-60}},
  788. [184662] = {184778,{-10,-20,-30,-40,-50,-60}},
  789. [186257] = {197343,-60,225092,-20,206332,"*0.5"},
  790. [186387] = {190567,{-1.5,-3,-4.5,-6,-7.5,-9}},
  791. [193526] = {190462,{-10,-20,-30,-40,-50,-60}},
  792. [186289] = {225092,-20,206332,"*0.5"},
  793. [186265] = {225092,-20,206332,"*0.5"},
  794. [162488] = {203752,"*0.8"},
  795. [194277] = {203752,"*0.8"},
  796. [193530] = {206332,"*0.5"},
  797. [31224] = {192323,{-3,-6,-10,-13,-16,-20}},
  798. [79140] = {192349,{-10,-20,-30,-40,-50,-60}},
  799. [2983] = {192345,{-3,-6,-10,-13,-16,-20}},
  800. [13750] = {202907,{-10,-18,-25,-33,-40,-48}},
  801. [33206] = {197713,{-10,-20,-30,-40,-50,-60}},
  802. [34861] = {196429,{-3,-6,-10,-13,-16,-20}},
  803. [47585] = {193642,{-10,-20,-30,-40,-50,-60}},
  804. [20608] = {207357,-600},
  805. [21169] = {207357,-600},
  806. [195676] = {187301,{-2,-4,-6,-8,-10,-12}},
  807. [104773] = {211131,{-10,-20,-30,-40,-50,60},215223,-30},
  808. [191427] = {201460,{-20,-40,-60,-80,-100,-120}},
  809.  
  810. [34433] = {186980,-160},
  811. [200174] = {186980,-40},
  812. [12975] = {185796,"*0.5"},
  813. }
  814.  
  815. module.db.tierSetsSpells = { --[specID.tierID.tierMark] = {2P Bonus Spell ID, 4P Bonus Spell ID}
  816. [5181] = {186980,nil}, --> Priest T18
  817. [2181] = {185581,nil}, --> Paladin T18
  818. [1181] = {185796,185799}, --> Warrior T18
  819. [4181] = {nil,186279}, --> Rouge T18
  820. }
  821. module.db.tierSetsList = { -- [itemID] = specID.tierID.tierMark
  822. [124155] = 5181, [124161] = 5181, [124166] = 5181, [124172] = 5181, [124178] = 5181,
  823. [124319] = 1181, [124329] = 1181, [124334] = 1181, [124340] = 1181, [124346] = 1181,
  824. [124318] = 2181, [124328] = 2181, [124333] = 2181, [124339] = 2181, [124345] = 2181,
  825. [124248] = 4181, [124257] = 4181, [124263] = 4181, [124269] = 4181, [124274] = 4181,
  826. }
  827.  
  828. module.db.spell_talentReplaceOther = { --Спелы, показ которых нужно убрать при наличии таланта (талант заменяет эти спелы) [spellID] = [talent Spell ID]
  829. [227847]=152277,
  830. [34428]=202168,
  831. [53695]=204035,
  832. [86659]=204018,
  833. [184092]=213652,
  834. [35395]=217020,
  835. [184575]={202270,198034},
  836. [31884]=224668,
  837. [187650]=162488,
  838. [187698]=194277,
  839. [187650]=162488,
  840. [195645]=200108,
  841. [187708]=212436,
  842. [2094]=199743,
  843. [34433]={123040,200174},
  844. [8122]=205369,
  845. [47568]=207127,
  846. [43265]=152280,
  847. [51514]=196932,
  848. [198067]=192249,
  849. [1953]=212653,
  850. [31687]=205024,
  851. [109132]=115008,
  852. [137639]=152173,
  853. [194223]=102560,
  854. [106951]=102543,
  855. [198589]={196555,205411},
  856. [1022]=204018,
  857. }
  858.  
  859. module.db.spell_aura_list = { --Спелы, время действия которых отменять при отмене бафа [buff_sid] = spellID
  860. [23920]=23920,
  861. [147833]=198304,
  862. [184662]=184662,
  863. [31850]=31850,
  864. [152262]=152262,
  865. [199483]=199483,
  866. [47788]=47788,
  867. [48707]=48707,
  868. [207319]=207319,
  869. [198839]=198838,
  870. [207495]=207399,
  871. [110960]=110959,
  872. [45438]=45438,
  873. [11426]=11426,
  874. [12051]=12051,
  875. [108839]=108839,
  876. [108416]=108416,
  877. [122278]=122278,
  878. [116849]=116849,
  879. [122470]=122470,
  880. [227225]=227225,
  881. [214366]=214366,
  882. [214423]=214423,
  883. [215670]=215670,
  884. }
  885. module.db.spell_speed_list = { --Спелы, которым менять время действия на основании спелхасты
  886. [740]=true,
  887. [64843]=true,
  888. [12051]=true,
  889. [113656]=true,
  890. }
  891. module.db.spell_afterCombatReset = { --Принудительный сброс кд после боя с боссом (для спелов с кд менее 5 мин., 3мин после 6.1)
  892. [161642]=true,
  893.  
  894. [31884]=true,
  895. [12042]=true,
  896. }
  897. module.db.spell_afterCombatNotReset = { --Запрещать сброс кд после боя с боссом (для петов, например; для спелов с кд 5 и более мин., для анха)
  898. [90355]=true,
  899. [126393]=true,
  900. [53478]=true,
  901. [55709]=true,
  902. [20608]=true,
  903. [21169]=true,
  904. [159931]=true,
  905. [159956]=true,
  906.  
  907. --[26297]=true, --Fixed in 7.0?
  908. [67826]=true,
  909.  
  910. [199740]=true,
  911. }
  912. module.db.spell_reduceCdByHaste = { --Заклинания, кд которых уменьшается хастой
  913. [20473]=true,
  914. [845]=true,
  915. [12294]=true,
  916. [23881]=true,
  917. [23922]=true,
  918. [2565]=true,
  919. [6572]=true,
  920. [6343]=true,
  921. [26573]=true,
  922. [85222]=true,
  923. [20271]=true,
  924. [35395]=true,
  925. [53595]=true,
  926. [184092]=true,
  927. [31935]=true,
  928. [53600]=true,
  929. [204019]=true,
  930. [213652]=true,
  931. [184575]=true,
  932. [205228]=true,
  933. [213757]=true,
  934. [217020]=true,
  935. [202270]=true,
  936. [198034]=true,
  937. [34026]=true,
  938. [217200]=true,
  939. [53209]=true,
  940. [194386]=true,
  941. [120679]=true,
  942. [214579]=true,
  943. [200163]=true,
  944. [212436]=true,
  945. [202800]=true,
  946. [190928]=true,
  947. [17]=true,
  948. [129250]=true,
  949. [204883]=true,
  950. [33076]=true,
  951. [8092]=true,
  952. [228260]=true,
  953. [50842]=true,
  954. [194913]=true,
  955. [207317]=true,
  956. [201897]=true,
  957. [187874]=true,
  958. [17364]=true,
  959. [193796]=true,
  960. [44425]=true,
  961. [198929]=true,
  962. [44457]=true,
  963. [108853]=true,
  964. [196447]=true,
  965. [17962]=true,
  966. [115308]=true,
  967. [119582]=true,
  968. [121253]=true,
  969. [116847]=true,
  970. [100784]=true,
  971. [107428]=true,
  972. [196725]=true,
  973. [152175]=true,
  974. [113656]=true,
  975. [202028]=true,
  976. [22842]=true,
  977. [6807]=true,
  978. [33917]=true,
  979. [188499]=true,
  980. [213241]=true,
  981. [203720]=true,
  982. [178740]=true,
  983. }
  984. module.db.spell_resetOtherSpells = { --Заклинания, которые откатывают другие заклинания
  985. [191427]={{198013,193897},{179057,193897},{198589,193897}},
  986. [187827]={{202137,210867},{204596,210867},{207684,210867},{202138,210867}},
  987. }
  988. module.db.spell_sharingCD = { --Заклинания, которые запускают кд на другие заклинания [spellID] = {[otherSpellID] = CD}
  989. [90633] = {[90632]=120,[90631]=120},
  990. [90632] = {[90633]=120,[90631]=120},
  991. [90631] = {[90632]=120,[90633]=120},
  992. }
  993.  
  994. module.db.spell_runningSameSpell = {} --Схожие заклинания
  995.  
  996. do
  997. local sameSpellsData = {
  998. {121093,59545,59543,59548,59542,59544,59547,28880}, --DraeneiRacial
  999. {69041,69070}, --Goblin Racial
  1000. {28730,69179,129597,80483,155145,25046,50613,202719}, --Belf Racial
  1001. {106898,77764,77761}, --Stampeding Roar
  1002. {187611,187614,187615}, --Legendary Ring
  1003. {51514,211015,210873,211010,211004}, --Hex
  1004. {202767,202771,202768}, --New moon [Balance Druid artifact]
  1005. {115308,119582}, --Brewmaster brew
  1006. {90633,90628},{90632,90626},{90631,89479}, --Guild Battle Standard
  1007. }
  1008. for i=1,#sameSpellsData do
  1009. local list = sameSpellsData[i]
  1010. for j=1,#list do
  1011. module.db.spell_runningSameSpell[ list[j] ] = list
  1012. end
  1013. end
  1014. end
  1015.  
  1016. module.db.spell_reduceCdCast = { --Заклинания, применение которых уменьшает время восстановления других заклинаний
  1017. [1680]={{1719,152278},-2.5},
  1018. [163201]={{1719,152278},-1},
  1019. [1464]={{1719,152278},-2},
  1020. [1715]={{1719,152278},-1},
  1021. [845]={{1719,152278},-1},
  1022. [12294]={{1719,152278},-2},
  1023. [7384]={{1719,152278},-1},
  1024. [772]={{1719,152278},-1.5},
  1025. [207982]={{1719,152278},-1.5},
  1026.  
  1027. [2565]={{1719,152278},-1,{12975,152278},-1,{871,152278},-1},
  1028. [204488]={{1719,152278},-3,{12975,152278},-3,{871,152278},-3},
  1029. [190456]={{1719,152278},-6,{12975,152278},-6,{871,152278},-6},
  1030. [202168]={{1719,152278},-6,{12975,152278},-6,{871,152278},-6},
  1031.  
  1032. [35395]={{20473,196926},-1.5,{85222,196926},-1.5},
  1033. [20271]={{853,198054,-70},-10},
  1034. [53600]={{184092,204074},-3,{213652,204074},-3,{31884,204074},-3},
  1035. [85256]={{853,198054,70},-8},
  1036. [53385]={{853,198054,70},-8},
  1037. [213757]={{853,198054,70},-8},
  1038. [215661]={{853,198054,70},-8},
  1039. [210191]={{853,198054,70},-8},
  1040. [202273]={{853,198054,70},-8},
  1041.  
  1042. [2061]={2050,-6,{2050,196985},-2,{2050,200183,nil,200183},-12,{2050,196985,nil,200183},-4},
  1043. [2060]={2050,-6,{2050,196985},-2,{2050,200183,nil,200183},-12,{2050,196985,nil,200183},-4},
  1044. [596]={34861,-6,{34861,196985},-2,{34861,200183,nil,200183},-12,{34861,196985,nil,200183},-4},
  1045. [585]={88625,-6,{88625,196985},-2,{88625,200183,nil,200183},-12,{88625,196985,nil,200183},-4},
  1046. [32546]={2050,-3,34861,-3},
  1047. [33076]={{34861,197034},-6},
  1048.  
  1049. [196819]={{1856,186279},-5},
  1050. [195452]={{1856,186279},-5},
  1051.  
  1052. [49998]={{55233,205723},-7.5},
  1053.  
  1054. [47541]={{63560,198943},-5},
  1055.  
  1056. [195676]={1953,-15},
  1057.  
  1058. [107428]={{116680,210804},-30,{137639,209256},-2.2},
  1059.  
  1060. [23922]={{871,215057},-4},
  1061. [185358]={{193526,206889},-1.1},
  1062. [198670]={{193526,206889},-1.1},
  1063. [19434]={{193526,206889},-1.1},
  1064. [186387]={{193526,206889},-1.1},
  1065. [120679]={{34026,212278},-3.1},
  1066. [185311]={{79140,208895},-0.6},
  1067. [51723]={{79140,208895},-0.7},
  1068. [703]={{79140,208895},-0.9},
  1069. [1725]={{79140,208895},-0.6},
  1070. [32645]={{79140,208895},-0.7},
  1071. [185565]={{79140,208895},-0.8},
  1072. [6770]={{79140,208895},-0.7},
  1073. [192759]={{79140,208895},-0.7},
  1074. [1833]={{79140,208895},-0.8},
  1075. [1329]={{79140,208895},-1.1},
  1076. [1943]={{79140,208895},-0.5},
  1077. [408]={{79140,208895},-0.5},
  1078. [1966]={{79140,208895},-0.4},
  1079. [16511]={{79140,208895},-0.6},
  1080. [152150]={{79140,208895},-0.5},
  1081. [17]={{33206,214576},-4},
  1082. [206930]={{55233,208706},-2},
  1083. [51505]={{198067,191512},-2},
  1084. [113656]={{137639,209256},-3.3},
  1085. [100784]={{137639,209256},-1.1},
  1086. [115151]={{115310,206902},-2.1},
  1087. [78674]={{102560,208199},-5,{194223,208199},-5},
  1088. [191034]={{102560,208199},-7.5,{194223,208199},-7.5},
  1089. }
  1090. module.db.spell_increaseDurationCast = { --Заклинания, продляющие время действия
  1091. [23922]={{2565,203177},1.5},
  1092.  
  1093. [49184]={{196770,194912},0.5},
  1094. [45524]={{196770,194912},0.5},
  1095. [3714]={{196770,194912},0.5},
  1096. [111673]={{196770,194912},0.5},
  1097. [49020]={{196770,194912},1},
  1098. [194913]={{196770,194912},0.5},
  1099.  
  1100. [5143]={{12042,155147},2},
  1101. [30455]={{12472,155149},2},
  1102.  
  1103. [195452]={{121471,208892},1.5},
  1104. [196819]={{121471,208892},1.5},
  1105. [408]={{121471,208892},1.5},
  1106. }
  1107. module.db.spell_dispellsFix = {}
  1108. module.db.spell_dispellsList = { --Заклинания-диспелы (мгновенно откатываются, если ничего не диспелят)
  1109. [4987] = true,
  1110. [527] = true,
  1111. [51886] = true,
  1112. [77130] = true,
  1113. [475] = true,
  1114. [115450] = true,
  1115. [2782] = true,
  1116. [88423] = true,
  1117. [213644] = true,
  1118. }
  1119.  
  1120. module.db.spell_startCDbyAuraFade = { --Заклинания, кд которых запускается только при спадении ауры
  1121. [205025]=true,
  1122. [5215]=true,
  1123. [202425]=true,
  1124. }
  1125. module.db.spell_startCDbyAuraApplied = { --Заклинания, кд которых запускается только при наложении ауры (вида [aura_spellID] = CD_spellID)
  1126. [117679]=33891,
  1127. }
  1128. module.db.spell_startCDbyAuraApplied_fix = {}
  1129. for _,spellID in pairs(module.db.spell_startCDbyAuraApplied) do module.db.spell_startCDbyAuraApplied_fix[spellID] = true end
  1130.  
  1131. module.db.spell_reduceCdByAuraFade = { --Заклинания, кд которых уменьшается при спадении ауры до окончания времени действия. !Важно обязательное время действия для таких заклинаний
  1132. [47788]={{47788,200209},-150},
  1133. }
  1134. module.db.spell_battleRes = { --Заклинания-воскрешения [WOD]
  1135. [20484]=true,
  1136. [20707]=true,
  1137. [61999]=true,
  1138. --[126393]=true,
  1139. [161642]=true,
  1140. --[159931]=true,
  1141. --[159956]=true,
  1142. }
  1143. module.db.isResurectDisabled = nil
  1144.  
  1145. module.db.spell_isRacial = { --Расовые заклинания
  1146. [68992]="Worgen",
  1147. [20589]="Gnome",
  1148. [20594]="Dwarf",
  1149. [121093]="Draenei",
  1150. [59545]="Draenei",
  1151. [59543]="Draenei",
  1152. [59548]="Draenei",
  1153. [59542]="Draenei",
  1154. [59544]="Draenei",
  1155. [59547]="Draenei",
  1156. [28880]="Draenei",
  1157. [58984]="NightElf",
  1158. [107079]="Pandaren",
  1159. [59752]="Human",
  1160. [69041]="Goblin",
  1161. [69070]="Goblin",
  1162. [69046]="Goblin",
  1163. [7744]="Undead",
  1164. [20577]="Undead",
  1165. [20572]="Orc",
  1166. [33697]="Orc",
  1167. [33702]="Orc",
  1168. [20549]="Tauren",
  1169. [26297]="Troll",
  1170. [28730]="BloodElf",
  1171. [69179]="BloodElf",
  1172. [129597]="BloodElf",
  1173. [80483]="BloodElf",
  1174. [155145]="BloodElf",
  1175. [25046]="BloodElf",
  1176. [50613]="BloodElf",
  1177. [202719]="BloodElf",
  1178. }
  1179.  
  1180. module.db.def_col = { --Стандартные положения в колонках
  1181. ["161642;1"]=2,
  1182. ["97462;2"]=1,
  1183. ["97462;3"]=1,
  1184. ["46968;1"]=1,
  1185. ["1022;1"]=2,
  1186. ["204018;3"]=2,
  1187. ["204013;3"]=2,
  1188. ["1044;1"]=2,
  1189. ["31821;2"]=1,
  1190. ["633;1"]=2,
  1191. ["31842;2"]=1,
  1192. ["6940;2"]=2,
  1193. ["6940;3"]=2,
  1194. ["204150;3"]=1,
  1195. ["64843;3"]=1,
  1196. ["73325;2"]=2,
  1197. ["73325;3"]=2,
  1198. ["32375;1"]=1,
  1199. ["47788;3"]=2,
  1200. ["15286;4"]=1,
  1201. ["33206;2"]=2,
  1202. ["64901;3"]=1,
  1203. ["62618;2"]=1,
  1204. ["61999;1"]=2,
  1205. ["108199;2"]=1,
  1206. ["49576;2"]=3,
  1207. ["49576;3"]=3,
  1208. ["49576;4"]=3,
  1209. ["2825;1"]=3,
  1210. ["114052;4"]=1,
  1211. ["20608;1"]=2,
  1212. ["192077;1"]=1,
  1213. ["98008;4"]=1,
  1214. ["207399;4"]=1,
  1215. ["108280;4"]=1,
  1216. ["80353;1"]=3,
  1217. ["20707;1"]=2,
  1218. ["115310;4"]=1,
  1219. ["116849;4"]=2,
  1220. ["119381;1"]=1,
  1221. ["20484;1"]=2,
  1222. ["102342;5"]=2,
  1223. ["29166;2"]=2,
  1224. ["29166;5"]=2,
  1225. ["740;5"]=1,
  1226. ["106898;3"]=1,
  1227. ["106898;4"]=1,
  1228. ["179057;1"]=1,
  1229. ["196718;1"]=1,
  1230. ["207810;3"]=2,
  1231. }
  1232.  
  1233. module.db.petsAbilities = { --> PetTypes = HUNTERS[ Tenacity [1], Cunning = [2], Ferocity[3] ]
  1234. [0] = {},
  1235. [L.creatureNames["Basilisk"]] = {1, {159733,45}, },
  1236. [L.creatureNames["Bat"]] = {2, },
  1237. [L.creatureNames["Bear"]] = {1, {50256,10}, },
  1238. [L.creatureNames["Beetle"]] = {1, {90339,60,12}, },
  1239. [L.creatureNames["Bird of Prey"]] = {2, },
  1240. [L.creatureNames["Boar"]] = {1, },
  1241. [L.creatureNames["Carrion Bird"]] = {3, {24423,6}, },
  1242. [L.creatureNames["Cat"]] = {3, {24450,10}, {93435,45}, },
  1243. [L.creatureNames["Chimaera"]] = {2, {54644,10}, },
  1244. [L.creatureNames["Core Hound"]] = {3, {90355,360,40}, },
  1245. [L.creatureNames["Crab"]] = {1, {159926,60,12}, },
  1246. [L.creatureNames["Crane"]] = {2, {159931,600}, },
  1247. [L.creatureNames["Crocolisk"]] = {1, {50433,10}, },
  1248. [L.creatureNames["Devilsaur"]] = {3, {159953,60}, {54680,8}, },
  1249. [L.creatureNames["Direhorn"]] = {1, {137798,30}, },
  1250. [L.creatureNames["Dog"]] = {3, },
  1251. [L.creatureNames["Dragonhawk"]] = {2, },
  1252. [L.creatureNames["Fox"]] = {3, {160011,120}, },
  1253. [L.creatureNames["Goat"]] = {3, },
  1254. [L.creatureNames["Gorilla"]] = {1, },
  1255. [L.creatureNames["Hyena"]] = {3, {128432,90}, },
  1256. [L.creatureNames["Monkey"]] = {2, {160044,120}, },
  1257. [L.creatureNames["Moth"]] = {3, {159956,600}, },
  1258. [L.creatureNames["Nether Ray"]] = {2, {90355,360,40}, },
  1259. [L.creatureNames["Porcupine"]] = {1, },
  1260. [L.creatureNames["Quilen"]] = {3, {126393,600}, },
  1261. [L.creatureNames["Raptor"]] = {3, {160052,45}, },
  1262. [L.creatureNames["Ravager"]] = {2, },
  1263. ["Clefthoof"] = {1, }, -- Clefthoof[WOD] = Rhino
  1264. [L.creatureNames["Scorpid"]] = {1, {160060,6}, },
  1265. [L.creatureNames["Serpent"]] = {2, {128433,90}, },
  1266. [L.creatureNames["Shale Spider"]] = {1, {160063,60,12}, },
  1267. [L.creatureNames["Silithid"]] = {2, {160065,10}, },
  1268. [L.creatureNames["Spider"]] = {2, {160067,10}, },
  1269. [L.creatureNames["Spirit Beast"]] = {3, {90328,10}, {90361,30}, },
  1270. [L.creatureNames["Sporebat"]] = {2, },
  1271. [L.creatureNames["Tallstrider"]] = {3, {160073,45}, },
  1272. [L.creatureNames["Turtle"]] = {1, {26064,60,12}, },
  1273. [L.creatureNames["Warp Stalker"]] = {1, {35346,15}, },
  1274. [L.creatureNames["Wasp"]] = {3, },
  1275. [L.creatureNames["Water Strider"]] = {2, },
  1276. [L.creatureNames["Wind Serpent"]] = {2, },
  1277. [L.creatureNames["Wolf"]] = {3, {24604,45}, },
  1278. [L.creatureNames["Worm"]] = {1, {93433,14}, },
  1279. [1] = {0, {53478,360,20}, {61685,25}, {63900,10}, },
  1280. [2] = {0, {53490,180,12}, {61684,32,16}, {53480,60,12}, },
  1281. [3] = {0, {61684,32,16}, {55709,480}, },
  1282. [L.creatureNames["Ghoul"]] = {0, {91837,45,10}, {91802,30}, {91797,60}, },
  1283. [L.creatureNames["Felguard"]] = {0, {89751,45,6}, {89766,30}, {30151,15}, },
  1284. [L.creatureNames["Felhunter"]] = {0, {19647,24}, {19505,15}, },
  1285. [L.creatureNames["Fel Imp"]] = {0, {115276,30}, },
  1286. [L.creatureNames["Imp"]] = {0, {89808,10}, {119899,30,12}, {89792,20}, },
  1287. [L.creatureNames["Observer"]] = {0, {115781,24}, {115284,15}, },
  1288. [L.creatureNames["Shivarra"]] = {0, {115770,25}, {115268,30}, },
  1289. [L.creatureNames["Succubus"]] = {0, {6360,25}, {6358,30}, },
  1290. [L.creatureNames["Voidlord"]] = {0, {115236,10} },
  1291. [L.creatureNames["Voidwalker"]] = {0, {17735,10}, {17767,120,20}, {115232,10}, },
  1292. [L.creatureNames["Wrathguard"]] = {0, {115831,45,6}, },
  1293. [L.creatureNames["Water Elemental"]] = {0, {135029,25,4}, {33395,25}, },
  1294. }
  1295. module.db.spell_isPetAbility = {}
  1296. do
  1297. for petName,petData in pairs(module.db.petsAbilities) do
  1298. for i=2,#petData do
  1299. module.db.spell_isPetAbility[petData[i][1]] = petName
  1300. end
  1301. end
  1302. end
  1303.  
  1304. module.db.itemsToSpells = { -- Тринкеты вида [item ID] = spellID
  1305. [113931] = 176878,
  1306. [113969] = 176874,
  1307. [118876] = 177597, --Coin
  1308. [118878] = 177594, --Couplend
  1309. [118880] = 177592, --Candle
  1310. [118882] = 177189, --Kyanos
  1311. [118884] = 176460, --Kyb
  1312. [113905] = 176873, --Tank BRF
  1313. [113834] = 176876,
  1314. [113835] = 176875, --Shard of nothing
  1315. [113842] = 176879,
  1316. [110002] = 165531,
  1317. [110003] = 165543,
  1318. [110008] = 165535,
  1319. [110012] = 165532,
  1320. [110013] = 165543,
  1321. [110017] = 165534,
  1322. [110018] = 165535,
  1323. [114488] = 176883,
  1324. [114489] = 176882,
  1325. [114490] = 176884,
  1326. [114491] = 176881,
  1327. [114492] = 176885,
  1328. [109997] = 165485,
  1329. [109998] = 165542,
  1330. [110007] = 165532,
  1331. [124224] = 184270, --Mirror of the Blademaster
  1332. [124232] = 183929, --Intuition's Gift
  1333. [133598] = 201414,
  1334. [133585] = 201371,
  1335.  
  1336. [137105] = 206338,
  1337. [137059] = 206380,
  1338. [137017] = 207628,
  1339. [137089] = 215176,
  1340. [137054] = 215057,
  1341. [137101] = 206332,
  1342. [137033] = 206889,
  1343. [137227] = 212278,
  1344. [137100] = 208892,
  1345. [137030] = 208895,
  1346. [132436] = 214576,
  1347. [132367] = 208706,
  1348. [132376] = 210852,
  1349. [137058] = 210604,
  1350. [137097] = 209256,
  1351. [137027] = 224489,
  1352. [137096] = 206902,
  1353. [137039] = 208199,
  1354. [137061] = 215149,
  1355. [137071] = 210867,
  1356. [138949] = 210970,
  1357.  
  1358. [64402] = 90633,
  1359. [64401] = 90632,
  1360. [64400] = 90631,
  1361.  
  1362. [133642] = 215956,
  1363. [137541] = 215648,
  1364. [137539] = 214962,
  1365. [137538] = 215936,
  1366. [137537] = 215658,
  1367. [137486] = 214980,
  1368. [137462] = 215206,
  1369. [137440] = 214584,
  1370. [137433] = 215467,
  1371. [137369] = 214971,
  1372. [137344] = 214423,
  1373. [137338] = 214366,
  1374. [137329] = 215670,
  1375. [133647] = 214203,
  1376. [133646] = 214198,
  1377. [139322] = 221837,
  1378. [139333] = 221992,
  1379. [139327] = 221695,
  1380. [139326] = 222046,
  1381. [139320] = 221803,
  1382. }
  1383. module.db.itemsArtifacts = { -- Artifacts & First trait
  1384. [127857] = 224968,
  1385. [128820] = 194466,
  1386. [128862] = 214634,
  1387.  
  1388. [128823] = 200652,
  1389. [128866] = 209202,
  1390. [120978] = 205273,
  1391.  
  1392. [128910] = 209577,
  1393. [128908] = 205546,
  1394. [128289] = 203524,
  1395.  
  1396. [128858] = 202767,
  1397. [128860] = 210722,
  1398. [128821] = 200851,
  1399. [128306] = 208253,
  1400.  
  1401. [128402] = 205223,
  1402. [128292] = 189186,
  1403. [128403] = 220143,
  1404.  
  1405. [128861] = 207068,
  1406. [128826] = 204147,
  1407. [128808] = 203415,
  1408.  
  1409. [128868] = 207946,
  1410. [128825] = 196684,
  1411. [128827] = 205065,
  1412.  
  1413. [128870] = 192759,
  1414. [128872] = 202665,
  1415. [128476] = 209782,
  1416.  
  1417. [128935] = 205495,
  1418. [128819] = 204945,
  1419. [128911] = 207778,
  1420.  
  1421. [128942] = 216698,
  1422. [128943] = 211714,
  1423. [128941] = 196586,
  1424.  
  1425. [128938] = 214326,
  1426. [128940] = 205320,
  1427. [128937] = 205406,
  1428.  
  1429. [127829] = 201467,
  1430. [128832] = 207407,
  1431. }
  1432.  
  1433. do
  1434. for itemID,spellID in pairs(module.db.itemsArtifacts) do
  1435. module.db.itemsToSpells[itemID] = spellID
  1436. end
  1437. for itemID,spellID in pairs(module.db.itemsToSpells) do
  1438. module.db.spell_isTalent[spellID] = true
  1439. end
  1440. end
  1441. ExRT.F.table_add2(module.db.itemsToSpells,{
  1442. [124634] = 187614, --Legendary Ring
  1443. [124636] = 187615, --Legendary Ring
  1444. [124635] = 187611, --Legendary Ring
  1445. [124637] = 187613, --Legendary Ring
  1446. [124638] = 187612, --Legendary Ring
  1447. })
  1448.  
  1449. module.db.differentIcons = { --Другие иконки заклинаниям
  1450. [176875]="Interface\\Icons\\Inv_misc_trinket6oOG_Isoceles1",
  1451. [176873]="Interface\\Icons\\Inv_misc_trinket6oIH_orb4",
  1452. [184270]="Interface\\Icons\\spell_nature_mirrorimage",
  1453. [183929]="Interface\\Icons\\spell_mage_presenceofmind",
  1454. [187614]="Interface\\Icons\\inv_60legendary_ring1c",
  1455. [187613]="Interface\\Icons\\inv_60legendary_ring1b",
  1456. [187612]="Interface\\Icons\\inv_60legendary_ring1a",
  1457.  
  1458. [90633] = "Interface\\Icons\\inv_guild_standard_horde_c",
  1459. [90632] = "Interface\\Icons\\inv_guild_standard_horde_b",
  1460. [90631] = "Interface\\Icons\\inv_guild_standard_horde_a",
  1461. }
  1462.  
  1463. module.db.artifactAllSpells = {
  1464. 209483, 200870, 203230, 188651,
  1465. 200311, 200326, 200407, 200298, 209285, 209218, 209220, 186994, 179546, 184778, 186945,
  1466. 197038, 197343, 190567, 190462, 225092, 203752,
  1467. 192323, 192349, 192345, 202907, 197386,
  1468. 197727, 197713, 196429, 193642,
  1469. 192514, 208598,
  1470. 191512, 207357,
  1471. 187264, 187301, 195345,
  1472. 211131, 215223,
  1473. 210557, 200399, 200402,
  1474. 201460, 212894,
  1475. }
  1476.  
  1477.  
  1478. local isLegendaryRingInRaid_DD = nil
  1479. local isLegendaryRingInRaid_Tank = nil
  1480. local isLegendaryRingInRaid_Heal = nil
  1481.  
  1482. module.db.playerName = nil
  1483.  
  1484. module.db.plugin = {}
  1485.  
  1486. module.db.notAClass = { r = 0.8, g = 0.8, b = 0.8, colorStr = "ffcccccc" }
  1487.  
  1488. local colorSetupFrameColorsNames = {"Default","Active","Cooldown"}
  1489. local colorSetupFrameColorsObjectsNames = {"Text","Background","TimeLine"}
  1490. local globalGUIDs = nil
  1491.  
  1492. module.db.maxLinesInCol = 100
  1493. module.db.maxColumns = 10
  1494.  
  1495. module.db.colsDefaults = {
  1496. iconSize = 16,
  1497. iconGray = true,
  1498. iconPosition = 1,
  1499. textureFile = ExRT.F.barImg,
  1500. textureBorderSize = 0,
  1501. fontSize = 12,
  1502. fontName = ExRT.F.defFont,
  1503. frameLines = 15,
  1504. frameAlpha = 100,
  1505. frameScale = 100,
  1506. frameWidth = 130,
  1507. frameColumns = 1,
  1508. frameBetweenLines = 0,
  1509. frameBlackBack = 0,
  1510. methodsStyleAnimation = 1,
  1511. methodsTimeLineAnimation = 1,
  1512. methodsSortingRules = 1,
  1513. methodsAlphaNotInRangeNum = 90,
  1514.  
  1515. textureBorderColorR = 0, textureBorderColorG = 0, textureBorderColorB = 0, textureBorderColorA = 1,
  1516.  
  1517. textureColorTextDefaultR = 1, textureColorTextDefaultG = 1, textureColorTextDefaultB = 1,
  1518. textureColorTextActiveR = 1, textureColorTextActiveG = 1, textureColorTextActiveB = 1,
  1519. textureColorTextCooldownR = 1, textureColorTextCooldownG = 1, textureColorTextCooldownB = 1,
  1520.  
  1521. textureColorBackgroundDefaultR = 0, textureColorBackgroundDefaultG = 1, textureColorBackgroundDefaultB = 0,
  1522. textureColorBackgroundActiveR = 0, textureColorBackgroundActiveG = 1, textureColorBackgroundActiveB = 0,
  1523. textureColorBackgroundCooldownR = 1, textureColorBackgroundCooldownG = 0, textureColorBackgroundCooldownB = 0,
  1524.  
  1525. textureColorTimeLineDefaultR = 0, textureColorTimeLineDefaultG = 1, textureColorTimeLineDefaultB = 0,
  1526. textureColorTimeLineActiveR = 0, textureColorTimeLineActiveG = 1, textureColorTimeLineActiveB = 0,
  1527. textureColorTimeLineCooldownR = 1, textureColorTimeLineCooldownG = 0, textureColorTimeLineCooldownB = 0,
  1528.  
  1529. textureAlphaBackground = 0.3,
  1530. textureAlphaTimeLine = 0.8,
  1531. textureAlphaCooldown = 1,
  1532.  
  1533. textureSmoothAnimationDuration = 50,
  1534.  
  1535. textTemplateLeft = "%name%",
  1536. textTemplateRight = "%time%",
  1537. textTemplateCenter = "",
  1538.  
  1539. blacklistText = "",
  1540. whitelistText = "",
  1541. }
  1542.  
  1543. module.db.colsInit = {
  1544. iconGeneral = true,
  1545. textureGeneral = true,
  1546. methodsGeneral = true,
  1547. frameGeneral = true,
  1548. fontGeneral = true,
  1549. textGeneral = true,
  1550. blacklistGeneral = true,
  1551. visibilityGeneral = true,
  1552.  
  1553. iconGray = true,
  1554. textureAnimation = true,
  1555.  
  1556. fontOutline = true,
  1557. fontShadow = false,
  1558.  
  1559. --textureSmoothAnimation = true,
  1560. }
  1561.  
  1562. module.db.status_UnitsToCheck = {}
  1563. module.db.status_UnitIsDead = {}
  1564. module.db.status_UnitIsDisconnected = {}
  1565. module.db.status_UnitIsOutOfRange = {}
  1566.  
  1567. -- Local functions vaules; other upvaules
  1568.  
  1569. local UpdateAllData,SortAllData = nil
  1570. local SaveCDtoVar = nil
  1571. local CLEUstartCD = nil
  1572. local RaidResurrectSpecialCheck,RaidResurrectSpecialText,RaidResurrectSpecialStatus = nil
  1573.  
  1574. local L_Offline,L_Dead = L.cd2StatusOffline, L.cd2StatusDead
  1575. local _C, _db, _mainFrame = module._C, module.db
  1576.  
  1577. local status_UnitsToCheck,status_UnitIsDead,status_UnitIsDisconnected,status_UnitIsOutOfRange = module.db.status_UnitsToCheck,module.db.status_UnitIsDead,module.db.status_UnitIsDisconnected,module.db.status_UnitIsOutOfRange
  1578.  
  1579. do
  1580. local frame = CreateFrame("Frame",nil,UIParent)
  1581. module.frame = frame
  1582. frame:SetPoint("CENTER",UIParent, "CENTER", 0, 0)
  1583. frame:EnableMouse(true)
  1584. frame:SetMovable(true)
  1585. frame:RegisterForDrag("LeftButton")
  1586. frame:SetScript("OnDragStart", function(self)
  1587. if self:IsMovable() then
  1588. self:StartMoving()
  1589. end
  1590. end)
  1591. frame:SetScript("OnDragStop", function(self)
  1592. self:StopMovingOrSizing()
  1593. VExRT.ExCD2.Left = self:GetLeft()
  1594. VExRT.ExCD2.Top = self:GetTop()
  1595. end)
  1596. frame.texture = frame:CreateTexture(nil, "BACKGROUND")
  1597. frame.texture:SetColorTexture(0,0,0,0.3)
  1598. frame.texture:SetAllPoints()
  1599. module:RegisterHideOnPetBattle(frame)
  1600.  
  1601. frame.colFrame = {}
  1602.  
  1603. --upvaule
  1604. _mainFrame = frame
  1605. end
  1606.  
  1607. local function BarUpdateText(self)
  1608. local barParent = self.parent
  1609.  
  1610. local textLeft = barParent.textTemplateLeft
  1611. local textRight = barParent.textTemplateRight
  1612. local textCenter = barParent.textTemplateCenter
  1613.  
  1614. local barData = self.data
  1615.  
  1616. local time = (self.curr_end or 0) - GetTime() + 1
  1617.  
  1618. if barData.specialTimer then
  1619. local newTime = barData.specialTimer()
  1620. time = newTime and newTime+1 or time
  1621. end
  1622.  
  1623. local name = barData.name
  1624. local spellName = barData.spellName
  1625.  
  1626. local longtime,shorttime = nil
  1627.  
  1628. if time > 3600 then
  1629. longtime = "1+hour"
  1630. shorttime = "1+hour"
  1631. elseif time < 1 then
  1632. longtime = ""
  1633. shorttime = ""
  1634. else
  1635. longtime = format("%1.1d:%2.2d",time/60,time%60)
  1636. if time < 11 then
  1637. shorttime = format("%.01f",time - 1)
  1638. elseif time < 60 then
  1639. shorttime = format("%d",time)
  1640. else
  1641. shorttime = longtime
  1642. end
  1643. end
  1644.  
  1645. if barData.specialAddText then
  1646. name = name .. (barData.specialAddText() or "")
  1647. end
  1648.  
  1649. local name_time = time > 0.999 and longtime or name
  1650. local name_stime = time > 0.999 and shorttime or name
  1651. local offStatus = self.disStatus or ""
  1652. local chargesCount = self.curr_charges and "("..self.curr_charges..")" or ""
  1653.  
  1654. textLeft = string_gsub(textLeft,"%%time%%",longtime)
  1655. textLeft = string_gsub(textLeft,"%%stime%%",shorttime)
  1656. textLeft = string_gsub(textLeft,"%%name%%",name)
  1657. textLeft = string_gsub(textLeft,"%%name_time%%",name_time)
  1658. textLeft = string_gsub(textLeft,"%%name_stime%%",name_stime)
  1659. textLeft = string_gsub(textLeft,"%%spell%%",spellName)
  1660. textLeft = string_gsub(textLeft,"%%status%%",offStatus)
  1661. textLeft = string_gsub(textLeft,"%%charge%%",chargesCount)
  1662. textRight = string_gsub(textRight,"%%time%%",longtime)
  1663. textRight = string_gsub(textRight,"%%stime%%",shorttime)
  1664. textRight = string_gsub(textRight,"%%name%%",name)
  1665. textRight = string_gsub(textRight,"%%name_time%%",name_time)
  1666. textRight = string_gsub(textRight,"%%name_stime%%",name_stime)
  1667. textRight = string_gsub(textRight,"%%spell%%",spellName)
  1668. textRight = string_gsub(textRight,"%%status%%",offStatus)
  1669. textRight = string_gsub(textRight,"%%charge%%",chargesCount)
  1670. textCenter = string_gsub(textCenter,"%%time%%",longtime)
  1671. textCenter = string_gsub(textCenter,"%%stime%%",shorttime)
  1672. textCenter = string_gsub(textCenter,"%%name%%",name)
  1673. textCenter = string_gsub(textCenter,"%%name_time%%",name_time)
  1674. textCenter = string_gsub(textCenter,"%%name_stime%%",name_stime)
  1675. textCenter = string_gsub(textCenter,"%%spell%%",spellName)
  1676. textCenter = string_gsub(textCenter,"%%status%%",offStatus)
  1677. textCenter = string_gsub(textCenter,"%%charge%%",chargesCount)
  1678.  
  1679. self.textLeft:SetText(string_trim(textLeft))
  1680. self.textRight:SetText(string_trim(textRight))
  1681. self.textCenter:SetText(string_trim(textCenter))
  1682. end
  1683.  
  1684. local function BarAnimation(self)
  1685. local bar = self.bar
  1686. local t = GetTime()
  1687.  
  1688. if t > bar.curr_end then
  1689. bar:Stop()
  1690. else
  1691. local width = (t - bar.curr_start) / bar.curr_dur
  1692. if width > 1 then
  1693. width = 1
  1694. elseif width < 0 then
  1695. width = 0
  1696. end
  1697. bar.timeline:SetShown(width ~= 0)
  1698. bar.timeline:SetWidth(width * bar.timeline.width)
  1699.  
  1700. bar.spark:SetPoint("CENTER",bar.statusbar,"LEFT", (t-bar.curr_start) / bar.curr_dur * bar.timeline.width,0)
  1701. end
  1702. self.c = self.c + 1
  1703. if self.c > 3 then
  1704. self.c = 0
  1705.  
  1706. bar:UpdateText()
  1707. end
  1708. end
  1709.  
  1710. local function BarAnimation_Reverse(self)
  1711. local bar = self.bar
  1712. local t = GetTime()
  1713.  
  1714. if t > bar.curr_end then
  1715. bar:Stop()
  1716. else
  1717. local width = (bar.curr_end - t) / bar.curr_dur
  1718. if width > 1 then
  1719. width = 1
  1720. elseif width < 0 then
  1721. width = 0
  1722. end
  1723. bar.timeline:SetShown(width ~= 0)
  1724. bar.timeline:SetWidth(width * bar.timeline.width)
  1725.  
  1726. bar.spark:SetPoint("CENTER",bar.statusbar,"LEFT", (bar.curr_dur - (t-bar.curr_start)) / bar.curr_dur * bar.timeline.width,0)
  1727. end
  1728. self.c = self.c + 1
  1729. if self.c > 3 then
  1730. self.c = 0
  1731.  
  1732. bar:UpdateText()
  1733. end
  1734. end
  1735.  
  1736. local function BarAnimation_NoAnimation(self)
  1737. local bar = self.bar
  1738. local t = GetTime()
  1739.  
  1740. if t > bar.curr_end then
  1741. bar:Stop()
  1742. end
  1743. self.c = self.c + 1
  1744. if self.c > 3 then
  1745. self.c = 0
  1746.  
  1747. bar:UpdateText()
  1748. end
  1749. end
  1750.  
  1751. local function StopBar(self)
  1752. self.anim:Stop()
  1753. self.spark:Hide()
  1754. self:UpdateStatus()
  1755. if VExRT.ExCD2.SortByAvailability then
  1756. SortAllData()
  1757. end
  1758. UpdateAllData()
  1759. end
  1760.  
  1761. local function UpdateBar(self)
  1762. local data = self.data
  1763. if not data then
  1764. self:Hide()
  1765. return
  1766. end
  1767. if not self:IsVisible() then
  1768. self:Show()
  1769. end
  1770. local parent = self.parent
  1771.  
  1772. self.iconTexture:SetTexture(data.icon)
  1773. self:UpdateText()
  1774. if parent.optionIconName then
  1775. self.textIcon:SetText(data.name)
  1776. end
  1777. end
  1778.  
  1779. local function BarStateAnimation(self)
  1780. local bar = self.bar
  1781. local progress = self:GetProgress()
  1782. local b = bar.curr_anim_b
  1783. if b then
  1784. bar.background:SetVertexColor(b.r + bar.curr_anim_b_r*progress,b.g + bar.curr_anim_b_g*progress,b.b + bar.curr_anim_b_b*progress,bar.curr_anim_b_a)
  1785. end
  1786. local l = bar.curr_anim_l
  1787. if l then
  1788. bar.timeline:SetVertexColor(l.r + bar.curr_anim_l_r*progress,l.g + bar.curr_anim_l_g*progress,l.b + bar.curr_anim_l_b*progress,bar.curr_anim_l_af+bar.curr_anim_l_a*progress)
  1789. end
  1790. local t = bar.curr_anim_t
  1791. if t then
  1792. bar.textLeft:SetTextColor(t.r + bar.curr_anim_t_r*progress,t.g + bar.curr_anim_t_g*progress,t.b + bar.curr_anim_t_b*progress)
  1793. bar.textRight:SetTextColor(t.r + bar.curr_anim_t_r*progress,t.g + bar.curr_anim_t_g*progress,t.b + bar.curr_anim_t_b*progress)
  1794. bar.textCenter:SetTextColor(t.r + bar.curr_anim_t_r*progress,t.g + bar.curr_anim_t_g*progress,t.b + bar.curr_anim_t_b*progress)
  1795. bar.textIcon:SetTextColor(t.r + bar.curr_anim_t_r*progress,t.g + bar.curr_anim_t_g*progress,t.b + bar.curr_anim_t_b*progress)
  1796. end
  1797. end
  1798. local function BarStateAnimationFinished(self)
  1799. self.bar.afterAnimFix = true
  1800. self.bar:UpdateStatus()
  1801. end
  1802.  
  1803. local function UpdateBarStatus(self,isTitle)
  1804. local data = self.data
  1805. if not data then
  1806. return
  1807. end
  1808. if self.isTitle then
  1809. self:UpdateStyle()
  1810. self.isTitle = nil
  1811. end
  1812. if data.specialUpdateData then --For templates
  1813. data.specialUpdateData(data)
  1814. end
  1815. local parent = self.parent
  1816. local currTime = GetTime()
  1817. local lastUse = data.lastUse
  1818.  
  1819. local active = lastUse + data.duration
  1820. local cooldown = lastUse + data.cd
  1821.  
  1822. if parent.methodsDisableActive then
  1823. active = 0
  1824. end
  1825.  
  1826. local isActive = (active - currTime) > 0
  1827. local isCooldown = (cooldown - currTime) > 0
  1828. local t = (isActive and active) or (isCooldown and cooldown)
  1829.  
  1830. local isDisabled = data.disabled
  1831. if isDisabled then
  1832. isCooldown = true
  1833. end
  1834. if data.specialStatus then
  1835. local var1,var2,var3 = data.specialStatus()
  1836. if var2 then
  1837. if var1 then
  1838. isCooldown = true
  1839. lastUse = var2
  1840. t = var2 + var3
  1841. else
  1842. isCooldown = false
  1843. t = nil
  1844. end
  1845. end
  1846. end
  1847.  
  1848. self.curr_charges = nil
  1849.  
  1850. local isCharge = nil
  1851. if data.isCharge then
  1852. if data.charge then
  1853. if data.charge <= currTime and (data.charge+data.cd) > currTime then
  1854. isCharge = true
  1855.  
  1856. isCooldown = false
  1857.  
  1858. self.curr_charges = 1
  1859. elseif data.charge > currTime and not isActive then
  1860. lastUse = data.charge - data.cd
  1861. t = data.charge
  1862.  
  1863. isCooldown = true
  1864.  
  1865. self.curr_charges = 0
  1866. end
  1867. else
  1868. self.curr_charges = 2
  1869. end
  1870. end
  1871.  
  1872. if isCharge and not isActive then
  1873. self.curr_start = data.charge
  1874. self.curr_end = data.charge+data.cd
  1875. self.curr_dur = data.cd
  1876.  
  1877. if parent.optionTimeLineAnimation == 1 then
  1878. self.timeline:SetShown(false)
  1879. else
  1880. self.timeline:SetShown(true)
  1881. self.timeline:SetWidth(self.timeline.width)
  1882. end
  1883. self.timeline.SetWidth = self.timeline.IsShown --Do I really want this shit?
  1884. self.timeline.SetShown = self.timeline.IsShown
  1885. self.spark:Show()
  1886. self.anim:Play()
  1887. elseif t then
  1888. self.curr_start = lastUse
  1889. self.curr_end = t
  1890. self.curr_dur = t - lastUse
  1891.  
  1892. self.timeline.SetWidth = self.timeline._SetWidth
  1893. self.timeline.SetShown = self.timeline._SetShown
  1894.  
  1895. self.spark:Show()
  1896. self.anim:Play()
  1897. else
  1898. self.curr_start = 0
  1899. self.curr_end = 1
  1900. self.curr_dur = 1
  1901.  
  1902. self.timeline.SetWidth = self.timeline._SetWidth
  1903. self.timeline.SetShown = self.timeline._SetShown
  1904.  
  1905. self.spark:Hide()
  1906. self.anim:Stop()
  1907.  
  1908. if isDisabled then
  1909. self.timeline:Hide()
  1910. else
  1911. if parent.optionTimeLineAnimation == 1 then
  1912. self.timeline:Hide()
  1913. else
  1914. self.timeline:SetWidth(self.timeline.width)
  1915. self.timeline:Show()
  1916. end
  1917. end
  1918. end
  1919.  
  1920. local doStandartColors = true
  1921. if parent.optionSmoothAnimation and not self.afterAnimFix then
  1922. doStandartColors = false
  1923. if not parent.optionClassColorBackground then
  1924. local ctFrom, ctTo = nil
  1925. if isActive then
  1926. ctTo = parent.optionColorBackgroundActive
  1927. elseif isCooldown then
  1928. ctTo = parent.optionColorBackgroundCooldown
  1929. else
  1930. ctTo = parent.optionColorBackgroundDefault
  1931. end
  1932.  
  1933. if self.curr_anim_state == 1 then
  1934. ctFrom = parent.optionColorBackgroundActive
  1935. elseif self.curr_anim_state == 2 then
  1936. ctFrom = parent.optionColorBackgroundCooldown
  1937. else
  1938. ctFrom = parent.optionColorBackgroundDefault
  1939. end
  1940.  
  1941. self.curr_anim_b = ctFrom
  1942. self.curr_anim_b_r = ctTo.r - ctFrom.r
  1943. self.curr_anim_b_g = ctTo.g - ctFrom.g
  1944. self.curr_anim_b_b = ctTo.b - ctFrom.b
  1945. self.curr_anim_b_a = parent.optionAlphaBackground
  1946. else
  1947. self.curr_anim_b = nil
  1948. local colorTable = data.classColor
  1949. self.background:SetVertexColor(colorTable.r,colorTable.g,colorTable.b,parent.optionAlphaBackground)
  1950. end
  1951. if not parent.optionClassColorTimeLine then
  1952. local ctFrom, ctTo = nil
  1953. if isActive then
  1954. ctTo = parent.optionColorTimeLineActive
  1955. elseif isCooldown then
  1956. ctTo = parent.optionColorTimeLineCooldown
  1957. else
  1958. ctTo = parent.optionColorTimeLineDefault
  1959. end
  1960.  
  1961. if self.curr_anim_state == 1 then
  1962. ctFrom = parent.optionColorTimeLineActive
  1963. self.curr_anim_l_af = 1
  1964. self.curr_anim_l_a = parent.optionAlphaTimeLine - 1
  1965. elseif self.curr_anim_state == 2 then
  1966. ctFrom = parent.optionColorTimeLineCooldown
  1967. self.curr_anim_l_af = 1
  1968. self.curr_anim_l_a = parent.optionAlphaTimeLine - 1
  1969. else
  1970. ctFrom = parent.optionColorTimeLineDefault
  1971. self.curr_anim_l_af = 0
  1972. self.curr_anim_l_a = parent.optionAlphaTimeLine
  1973. end
  1974. if not parent.optionAnimation then
  1975. self.curr_anim_l_af = 0
  1976. self.curr_anim_l_a = 0
  1977. end
  1978.  
  1979. self.curr_anim_l = ctFrom
  1980. self.curr_anim_l_r = ctTo.r - ctFrom.r
  1981. self.curr_anim_l_g = ctTo.g - ctFrom.g
  1982. self.curr_anim_l_b = ctTo.b - ctFrom.b
  1983. else
  1984. self.curr_anim_l = data.classColor
  1985. if self.curr_anim_state == 1 then
  1986. self.curr_anim_l_af = 1
  1987. self.curr_anim_l_a = parent.optionAlphaTimeLine - 1
  1988. elseif self.curr_anim_state == 2 then
  1989. self.curr_anim_l_af = 1
  1990. self.curr_anim_l_a = parent.optionAlphaTimeLine - 1
  1991. else
  1992. self.curr_anim_l_af = 0
  1993. self.curr_anim_l_a = parent.optionAlphaTimeLine
  1994. end
  1995. if not parent.optionAnimation then
  1996. self.curr_anim_l_af = 0
  1997. self.curr_anim_l_a = 0
  1998. end
  1999. self.curr_anim_l_r = 0
  2000. self.curr_anim_l_g = 0
  2001. self.curr_anim_l_b = 0
  2002. end
  2003. if not parent.optionClassColorText then
  2004. local ctFrom, ctTo = nil
  2005. if isActive then
  2006. ctTo = parent.optionColorTextActive
  2007. elseif isCooldown then
  2008. ctTo = parent.optionColorTextCooldown
  2009. else
  2010. ctTo = parent.optionColorTextDefault
  2011. end
  2012.  
  2013. if self.curr_anim_state == 1 then
  2014. ctFrom = parent.optionColorTextActive
  2015. elseif self.curr_anim_state == 2 then
  2016. ctFrom = parent.optionColorTextCooldown
  2017. else
  2018. ctFrom = parent.optionColorTextDefault
  2019. end
  2020.  
  2021. self.curr_anim_t = ctFrom
  2022. self.curr_anim_t_r = ctTo.r - ctFrom.r
  2023. self.curr_anim_t_g = ctTo.g - ctFrom.g
  2024. self.curr_anim_t_b = ctTo.b - ctFrom.b
  2025. else
  2026. self.curr_anim_t = nil
  2027. local colorTable = data.classColor
  2028. self.textLeft:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2029. self.textRight:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2030. self.textCenter:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2031. self.textIcon:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2032. end
  2033.  
  2034. if isActive and self.curr_anim_state ~= 1 then
  2035. self.curr_anim_state = 1
  2036. self.anim_state:Stop()
  2037. self.anim_state:Play()
  2038. elseif isCooldown and self.curr_anim_state ~= 2 then
  2039. self.curr_anim_state = 2
  2040. self.anim_state:Stop()
  2041. self.anim_state:Play()
  2042. elseif not isCooldown and not isActive and self.curr_anim_state then
  2043. self.curr_anim_state = nil
  2044. self.anim_state:Stop()
  2045. self.anim_state:Play()
  2046. else
  2047. doStandartColors = true
  2048. end
  2049. end
  2050. if doStandartColors then
  2051. local colorTable = nil
  2052. if parent.optionClassColorBackground then
  2053. colorTable = data.classColor
  2054. else
  2055. if isActive then
  2056. colorTable = parent.optionColorBackgroundActive
  2057. elseif isCooldown then
  2058. colorTable = parent.optionColorBackgroundCooldown
  2059. else
  2060. colorTable = parent.optionColorBackgroundDefault
  2061. end
  2062. end
  2063. self.background:SetVertexColor(colorTable.r,colorTable.g,colorTable.b,parent.optionAlphaBackground)
  2064.  
  2065. if parent.optionClassColorTimeLine then
  2066. colorTable = data.classColor
  2067. else
  2068. if isActive then
  2069. colorTable = parent.optionColorTimeLineActive
  2070. elseif isCooldown then
  2071. colorTable = parent.optionColorTimeLineCooldown
  2072. else
  2073. colorTable = parent.optionColorTimeLineDefault
  2074. end
  2075. end
  2076. self.timeline:SetVertexColor(colorTable.r,colorTable.g,colorTable.b,parent.optionAlphaTimeLine)
  2077.  
  2078. if parent.optionClassColorText then
  2079. colorTable = data.classColor
  2080. else
  2081. if isActive then
  2082. colorTable = parent.optionColorTextActive
  2083. elseif isCooldown then
  2084. colorTable = parent.optionColorTextCooldown
  2085. else
  2086. colorTable = parent.optionColorTextDefault
  2087. end
  2088. end
  2089. self.textLeft:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2090. self.textRight:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2091. self.textCenter:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2092. self.textIcon:SetTextColor(colorTable.r,colorTable.g,colorTable.b)
  2093. end
  2094. self.afterAnimFix = nil
  2095.  
  2096. if parent.optionGray then
  2097. if isCooldown and not isActive then
  2098. self.iconTexture:SetDesaturated(true)
  2099. else
  2100. self.iconTexture:SetDesaturated(nil)
  2101. end
  2102. end
  2103.  
  2104. if parent.optionCooldown then
  2105. -- BIG NOTE:
  2106. -- Cooldown widget is currently bugged
  2107. -- You can set time ( CD_end_time - Now_time ) only for number that is bigger than UI session (ie after reloadUI UI session timer will be 0)
  2108. -- No way for fix :(
  2109.  
  2110. if isActive then
  2111. self.cooldown:Show()
  2112. self.cooldown:SetReverse(true)
  2113. self.cooldown:SetCooldown(self.curr_start,self.curr_end-self.curr_start)
  2114. elseif isCooldown then
  2115. self.cooldown:Show()
  2116. self.cooldown:SetReverse(false)
  2117. if isDisabled then
  2118. self.cooldown:SetCooldown(currTime,0)
  2119. else
  2120. self.cooldown:SetCooldown(self.curr_start,self.curr_dur)
  2121. end
  2122. else
  2123. self.cooldown:Hide()
  2124. end
  2125. end
  2126.  
  2127. local alpha = 1
  2128. if parent.methodsAlphaNotInRange then
  2129. if data.outofrange then
  2130. alpha = parent.methodsAlphaNotInRangeNum
  2131. self:SetAlpha(alpha)
  2132. else
  2133. self:SetAlpha(1)
  2134. end
  2135. end
  2136.  
  2137. if (parent.optionAlphaCooldown or 1) < 1 then
  2138. if isCooldown and not isActive then
  2139. self:SetAlpha(parent.optionAlphaCooldown)
  2140. else
  2141. self:SetAlpha(alpha)
  2142. end
  2143. end
  2144.  
  2145. if isDisabled == 2 then
  2146. self.disStatus = L_Offline
  2147. elseif isDisabled == 1 then
  2148. self.disStatus = L_Dead
  2149. else
  2150. self.disStatus = nil
  2151. end
  2152.  
  2153. self:UpdateText()
  2154. end
  2155.  
  2156. local function BarCreateTitle(self)
  2157. local parent = self.parent
  2158.  
  2159. local height = parent.iconSize or 24
  2160.  
  2161. self.statusbar:ClearAllPoints() self.statusbar:SetHeight(height)
  2162. self.icon:ClearAllPoints() self.icon:SetSize(height,height)
  2163.  
  2164. self.textLeft:SetText("")
  2165. self.textRight:SetText("")
  2166. self.textCenter:SetText("")
  2167. self.textIcon:SetText("")
  2168.  
  2169. if parent.optionIconPosition == 2 then
  2170. self.icon:Show()
  2171. self.statusbar:SetPoint("LEFT",self,0,0)
  2172. self.statusbar:SetPoint("RIGHT",self,-height,0)
  2173. self.icon:SetPoint("RIGHT",self,0,0)
  2174.  
  2175. self.textRight:SetPoint("LEFT",self,0,0)
  2176.  
  2177. self.textRight:SetTextColor(1,1,1)
  2178. self.textRight:SetText(self.data.spellName)
  2179. elseif parent.optionIconPosition == 1 then
  2180. self.icon:Show()
  2181. self.statusbar:SetPoint("LEFT",self,height,0)
  2182. self.statusbar:SetPoint("RIGHT",self,0,0)
  2183. self.icon:SetPoint("LEFT",self,0,0)
  2184.  
  2185. self.textLeft:SetTextColor(1,1,1)
  2186. self.textLeft:SetText(self.data.spellName)
  2187. end
  2188.  
  2189. self.curr_start = 0
  2190. self.curr_end = 1
  2191. self.curr_dur = 1
  2192.  
  2193. self.spark:Hide()
  2194. self.anim:Stop()
  2195.  
  2196. self.timeline:Hide()
  2197.  
  2198. self.background:SetVertexColor(0,0,0,parent.optionAlphaTimeLine)
  2199.  
  2200. self.iconTexture:SetTexture(self.data.icon)
  2201. self.cooldown:Hide()
  2202.  
  2203. self:SetAlpha(1)
  2204. self:Show()
  2205.  
  2206. self.isTitle = true
  2207. end
  2208.  
  2209. local function LineIconOnHover(self)
  2210. local parent = self:GetParent()
  2211. if not parent.data then return end
  2212. GameTooltip:SetOwner(self, "ANCHOR_LEFT")
  2213. GameTooltip:SetHyperlink("spell:"..parent.data.db[1])
  2214. GameTooltip:Show()
  2215. end
  2216. local function LineIconOnClick(self)
  2217. local parent = self:GetParent()
  2218. if not parent.data then return end
  2219. if parent.data.specialClick then
  2220. parent.data.specialClick(parent.data)
  2221. return
  2222. end
  2223. local time = parent.data.lastUse + parent.data.cd - GetTime()
  2224. if time < 0 then return end
  2225. local text = parent.data.name.." - "..parent.data.spellName..": "..format("%1.1d:%2.2d",time/60,time%60)
  2226. local chat_type = ExRT.F.chatType(true)
  2227. SendChatMessage(text,chat_type)
  2228. end
  2229.  
  2230. local function UpdateBarStyle(self)
  2231. local parent = self.parent
  2232.  
  2233. local width = parent.barWidth or 100
  2234. local height = parent.iconSize or 24
  2235.  
  2236. self:SetSize(width,height)
  2237.  
  2238. self.textLeft:ClearAllPoints() self.textLeft:SetSize(0,height)
  2239. self.textRight:ClearAllPoints() self.textRight:SetSize(0,height)
  2240. self.textCenter:ClearAllPoints()self.textCenter:SetSize(0,height)
  2241. self.textIcon:SetSize(height,height)
  2242. self.icon:ClearAllPoints() self.icon:SetSize(height,height)
  2243. self.statusbar:ClearAllPoints() self.statusbar:SetHeight(height)
  2244. self.spark:SetSize(10,height+10)
  2245. self.cooldown:SetSize(height,height)
  2246.  
  2247. local iconSize = height
  2248. if parent.optionIconPosition == 3 or parent.optionIconTitles then
  2249. self.icon:Hide()
  2250. self.statusbar:SetPoint("LEFT",self,0,0)
  2251. self.statusbar:SetPoint("RIGHT",self,0,0)
  2252. iconSize = 0
  2253. elseif parent.optionIconPosition == 2 then
  2254. self.icon:Show()
  2255. self.statusbar:SetPoint("LEFT",self,0,0)
  2256. self.statusbar:SetPoint("RIGHT",self,-height,0)
  2257. self.icon:SetPoint("RIGHT",self,0,0)
  2258. else
  2259. self.icon:Show()
  2260. self.statusbar:SetPoint("LEFT",self,height,0)
  2261. self.statusbar:SetPoint("RIGHT",self,0,0)
  2262. self.icon:SetPoint("LEFT",self,0,0)
  2263. end
  2264.  
  2265. self.timeline.width = width - iconSize
  2266. self.timeline:SetSize(width - iconSize,height)
  2267.  
  2268. if parent.optionIconHideBlizzardEdges then
  2269. self.iconTexture:SetTexCoord(.1,.9,.1,.9)
  2270. else
  2271. self.iconTexture:SetTexCoord(0,1,0,1)
  2272. end
  2273.  
  2274. if parent.optionHideSpark then
  2275. self.spark:SetTexture("")
  2276. else
  2277. self.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
  2278. end
  2279.  
  2280. local fontOutlineFix = parent.fontOutline and 3 or 0
  2281. if parent.textTemplateLeft:find("time%%") then
  2282. self.textLeft:SetPoint("LEFT",self.statusbar,1,0)
  2283. self.textRight:SetPoint("RIGHT",self.statusbar,-1+fontOutlineFix,0)
  2284. self.textRight:SetPoint("LEFT",self.textLeft,"RIGHT",0,0)
  2285. else
  2286. self.textRight:SetPoint("RIGHT",self.statusbar,-1+fontOutlineFix,0)
  2287. self.textLeft:SetPoint("LEFT",self.statusbar,1,0)
  2288. self.textLeft:SetPoint("RIGHT",self.textRight,"LEFT",0,0)
  2289. end
  2290.  
  2291. self.textCenter:SetPoint("LEFT",self.statusbar,0,0)
  2292. self.textCenter:SetPoint("RIGHT",self.statusbar,0,0)
  2293.  
  2294. self.barWidth = width
  2295.  
  2296. local textureFile = parent.textureFile or module.db.colsDefaults.textureFile
  2297. local isValidTexture = self.background:SetTexture(textureFile)
  2298. if not isValidTexture then
  2299. textureFile = module.db.colsDefaults.textureFile
  2300. self.background:SetTexture(textureFile)
  2301. end
  2302. self.timeline:SetTexture(textureFile)
  2303.  
  2304. local isValidFont = nil
  2305.  
  2306. isValidFont = self.textLeft:SetFont(parent.fontLeftName,parent.fontLeftSize,parent.fontLeftOutline and "OUTLINE") if not isValidFont then self.textLeft:SetFont(module.db.colsDefaults.fontName,parent.fontLeftSize,parent.fontLeftOutline and "OUTLINE") end
  2307. isValidFont = self.textRight:SetFont(parent.fontRightName,parent.fontRightSize,parent.fontRightOutline and "OUTLINE") if not isValidFont then self.textRight:SetFont(module.db.colsDefaults.fontName,parent.fontRightSize,parent.fontRightOutline and "OUTLINE") end
  2308. isValidFont = self.textCenter:SetFont(parent.fontCenterName,parent.fontCenterSize,parent.fontCenterOutline and "OUTLINE")if not isValidFont then self.textCenter:SetFont(module.db.colsDefaults.fontName,parent.fontCenterSize,parent.fontCenterOutline and "OUTLINE") end
  2309. isValidFont = self.textIcon:SetFont(parent.fontIconName,parent.fontIconSize,parent.fontIconOutline and "OUTLINE") if not isValidFont then self.textIcon:SetFont(module.db.colsDefaults.fontName,parent.fontIconSize,parent.fontIconOutline and "OUTLINE") end
  2310.  
  2311. local fontOffset = 0
  2312. fontOffset = parent.fontLeftShadow and 1 or 0 self.textLeft:SetShadowOffset(1*fontOffset,-1*fontOffset)
  2313. fontOffset = parent.fontRightShadow and 1 or 0 self.textRight:SetShadowOffset(1*fontOffset,-1*fontOffset)
  2314. fontOffset = parent.fontCenterShadow and 1 or 0 self.textCenter:SetShadowOffset(1*fontOffset,-1*fontOffset)
  2315. fontOffset = parent.fontIconShadow and 1 or 0 self.textIcon:SetShadowOffset(1*fontOffset,-1*fontOffset)
  2316.  
  2317. self.iconTexture:SetDesaturated(nil)
  2318.  
  2319. self:SetAlpha(1)
  2320.  
  2321. self.cooldown:Hide()
  2322.  
  2323. self.textIcon:SetText("")
  2324.  
  2325. if parent.optionAnimation then
  2326. if parent.optionStyleAnimation == 1 then
  2327. self.anim:SetScript("OnLoop",BarAnimation_Reverse)
  2328. else
  2329. self.anim:SetScript("OnLoop",BarAnimation)
  2330. end
  2331. else
  2332. self.anim:SetScript("OnLoop",BarAnimation_NoAnimation)
  2333. self.spark:SetTexture("")
  2334. self.timeline:Hide()
  2335. end
  2336.  
  2337. if parent.methodsIconTooltip then
  2338. self.icon:SetScript("OnEnter",LineIconOnHover)
  2339. self.icon:SetScript("OnLeave",GameTooltip_Hide)
  2340. else
  2341. self.icon:SetScript("OnEnter",nil)
  2342. self.icon:SetScript("OnLeave",nil)
  2343. end
  2344.  
  2345. if parent.methodsLineClick then
  2346. self.clickFrame:SetScript("OnClick",LineIconOnClick)
  2347. self.clickFrame:Show()
  2348. else
  2349. self.clickFrame:SetScript("OnClick",nil)
  2350. self.clickFrame:Hide()
  2351. end
  2352.  
  2353. local borderSize = parent.textureBorderSize
  2354. if borderSize == 0 then
  2355. self.border.top:Hide()
  2356. self.border.bottom:Hide()
  2357. self.border.left:Hide()
  2358. self.border.right:Hide()
  2359. else
  2360. self.border.top:ClearAllPoints()
  2361. self.border.bottom:ClearAllPoints()
  2362. self.border.left:ClearAllPoints()
  2363. self.border.right:ClearAllPoints()
  2364.  
  2365. self.border.top:SetPoint("TOPLEFT",self,"TOPLEFT",-borderSize,borderSize)
  2366. self.border.top:SetPoint("BOTTOMRIGHT",self,"TOPRIGHT",borderSize,0)
  2367.  
  2368. self.border.bottom:SetPoint("BOTTOMLEFT",self,"BOTTOMLEFT",-borderSize,-borderSize)
  2369. self.border.bottom:SetPoint("TOPRIGHT",self,"BOTTOMRIGHT",borderSize,0)
  2370.  
  2371. self.border.left:SetPoint("TOPLEFT",self,"TOPLEFT",-borderSize,0)
  2372. self.border.left:SetPoint("BOTTOMRIGHT",self,"BOTTOMLEFT",0,0)
  2373.  
  2374. self.border.right:SetPoint("TOPLEFT",self,"TOPRIGHT",0,0)
  2375. self.border.right:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",borderSize,0)
  2376.  
  2377. self.border.top:SetColorTexture(parent.textureBorderColorR,parent.textureBorderColorG,parent.textureBorderColorB,parent.textureBorderColorA)
  2378. self.border.bottom:SetColorTexture(parent.textureBorderColorR,parent.textureBorderColorG,parent.textureBorderColorB,parent.textureBorderColorA)
  2379. self.border.left:SetColorTexture(parent.textureBorderColorR,parent.textureBorderColorG,parent.textureBorderColorB,parent.textureBorderColorA)
  2380. self.border.right:SetColorTexture(parent.textureBorderColorR,parent.textureBorderColorG,parent.textureBorderColorB,parent.textureBorderColorA)
  2381.  
  2382. self.border.top:Show()
  2383. self.border.bottom:Show()
  2384. self.border.left:Show()
  2385. self.border.right:Show()
  2386. end
  2387.  
  2388. self.anim_state.timer:SetDuration(parent.optionSmoothAnimationDuration)
  2389.  
  2390. if module.db.plugin and type(module.db.plugin.UpdateBarStyle)=="function" then
  2391. module.db.plugin.UpdateBarStyle(self)
  2392. end
  2393. end
  2394.  
  2395. local function CreateBar(parent)
  2396. local self = CreateFrame("Frame",nil,parent)
  2397.  
  2398. self.parent = parent
  2399.  
  2400. local statusbar = CreateFrame("StatusBar", nil, self)
  2401. statusbar:SetPoint("TOPRIGHT")
  2402. statusbar:SetPoint("BOTTOMLEFT")
  2403. self.statusbar = statusbar
  2404.  
  2405. local timeline = statusbar:CreateTexture(nil, "BACKGROUND")
  2406. timeline:SetPoint("LEFT")
  2407. timeline._SetWidth = timeline.SetWidth
  2408. timeline._SetShown = timeline.SetShown
  2409. self.timeline = timeline
  2410.  
  2411. local spark = statusbar:CreateTexture(nil, "BACKGROUND", nil, 3)
  2412. spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
  2413. spark:SetBlendMode("ADD")
  2414. spark:SetPoint("CENTER",statusbar,"RIGHT", 0,0)
  2415. spark:SetAlpha(0.5)
  2416. spark:Hide()
  2417. self.spark = spark
  2418.  
  2419. local anim = self:CreateAnimationGroup()
  2420. anim:SetLooping("REPEAT")
  2421. anim.c = 0
  2422. anim.timer = anim:CreateAnimation()
  2423. anim.timer:SetDuration(0.04)
  2424. anim:SetScript("OnLoop",BarAnimation)
  2425. anim.bar = self
  2426. self.anim = anim
  2427.  
  2428. local anim_state = self:CreateAnimationGroup()
  2429. anim_state.timer = anim_state:CreateAnimation()
  2430. anim_state.timer:SetDuration(0.5)
  2431. anim_state:SetScript("OnUpdate",BarStateAnimation)
  2432. anim_state:SetScript("OnFinished",BarStateAnimationFinished)
  2433. anim_state.bar = self
  2434. self.anim_state = anim_state
  2435.  
  2436. local icon = CreateFrame("Frame",nil,self)
  2437. icon:SetPoint("TOPLEFT", 0, 0)
  2438. local iconTexture = icon:CreateTexture(nil, "BACKGROUND")
  2439. iconTexture:SetAllPoints()
  2440. self.icon = icon
  2441. self.iconTexture = iconTexture
  2442.  
  2443. local cooldown = CreateFrame("Cooldown", nil, icon, "CooldownFrameTemplate")
  2444. cooldown:SetDrawEdge(false)
  2445. --cooldown:SetAllPoints()
  2446. cooldown:SetPoint("CENTER")
  2447. self.cooldown = cooldown
  2448.  
  2449. local background = self:CreateTexture(nil, "BACKGROUND", nil, -7)
  2450. background:SetAllPoints()
  2451. self.background = background
  2452.  
  2453. self.textLeft = ELib:Text(self.statusbar,nil,nil,"GameFontNormal"):Size(0,0):Point(1,0):Color()
  2454. self.textRight = ELib:Text(self.statusbar,nil,nil,"GameFontNormal"):Size(40,0):Point("TOPRIGHT",1,0):Right():Color()
  2455. self.textCenter = ELib:Text(self.statusbar,nil,nil,"GameFontNormal"):Size(0,0):Point(0,0):Center():Color()
  2456. self.textIcon = ELib:Text(icon,nil,nil,"GameFontNormal"):Size(0,0):Point(0,0):Center():Bottom():Color()
  2457.  
  2458. --[[
  2459. self.textLeft = self.statusbar:CreateFontString(nil,"ARTWORK")
  2460. self.textLeft:SetJustifyH("LEFT")
  2461. self.textLeft:SetJustifyV("MIDDLE")
  2462. self.textLeft:SetSize(0,0)
  2463. self.textLeft:SetPoint("TOPLEFT",1,0)
  2464. self.textLeft:SetFont(ExRT.F.defFont,12)
  2465. self.textLeft:SetTextColor(1,1,1,1)
  2466.  
  2467. self.textRight = self.statusbar:CreateFontString(nil,"ARTWORK")
  2468. self.textRight:SetJustifyH("RIGHT")
  2469. self.textRight:SetJustifyV("MIDDLE")
  2470. self.textRight:SetSize(40,0)
  2471. self.textRight:SetPoint("TOPRIGHT",1,0)
  2472. self.textRight:SetFont(ExRT.F.defFont,12)
  2473. self.textRight:SetTextColor(1,1,1,1)
  2474.  
  2475. self.textCenter = self.statusbar:CreateFontString(nil,"ARTWORK")
  2476. self.textCenter:SetJustifyH("CENTER")
  2477. self.textCenter:SetJustifyV("MIDDLE")
  2478. self.textCenter:SetSize(0,0)
  2479. self.textCenter:SetPoint("TOPLEFT",1,0)
  2480. self.textCenter:SetFont(ExRT.F.defFont,12)
  2481. self.textCenter:SetTextColor(1,1,1,1)
  2482.  
  2483. self.textIcon = icon:CreateFontString(nil,"ARTWORK")
  2484. self.textIcon:SetJustifyH("CENTER")
  2485. self.textIcon:SetJustifyV("BOTTOM")
  2486. self.textIcon:SetSize(0,0)
  2487. self.textIcon:SetPoint("TOPLEFT",1,0)
  2488. self.textIcon:SetFont(ExRT.F.defFont,12)
  2489. self.textIcon:SetTextColor(1,1,1,1)
  2490. ]]
  2491.  
  2492. --6.1 multilinetext fix
  2493. self.textLeft:SetMaxLines(1)
  2494. self.textRight:SetMaxLines(1)
  2495. self.textCenter:SetMaxLines(1)
  2496.  
  2497. self.border = {}
  2498. self.border.top = self:CreateTexture(nil, "BACKGROUND")
  2499. self.border.bottom = self:CreateTexture(nil, "BACKGROUND")
  2500. self.border.left = self:CreateTexture(nil, "BACKGROUND")
  2501. self.border.right = self:CreateTexture(nil, "BACKGROUND")
  2502.  
  2503. self.clickFrame = CreateFrame("Button",nil,self)
  2504. self.clickFrame:SetAllPoints()
  2505. self.clickFrame:Hide()
  2506.  
  2507. self.Stop = StopBar
  2508. self.Update = UpdateBar
  2509. self.UpdateStyle = UpdateBarStyle
  2510. self.UpdateText = BarUpdateText
  2511. self.UpdateStatus = UpdateBarStatus
  2512. self.CreateTitle = BarCreateTitle
  2513.  
  2514. return self
  2515. end
  2516.  
  2517. for i=1,module.db.maxColumns do
  2518. local columnFrame = CreateFrame("Frame",nil,module.frame)
  2519. module.frame.colFrame[i] = columnFrame
  2520. columnFrame:EnableMouse(false)
  2521. columnFrame:SetMovable(false)
  2522. columnFrame:RegisterForDrag("LeftButton")
  2523. columnFrame:SetScript("OnDragStart", function(self)
  2524. if self:IsMovable() then
  2525. self:StartMoving()
  2526. end
  2527. end)
  2528. columnFrame:SetScript("OnDragStop", function(self)
  2529. self:StopMovingOrSizing()
  2530. VExRT.ExCD2.colSet[i].posX = self:GetLeft()
  2531. VExRT.ExCD2.colSet[i].posY = self:GetTop()
  2532. end)
  2533. columnFrame.texture = columnFrame:CreateTexture(nil, "BACKGROUND")
  2534. columnFrame.texture:SetColorTexture(0,0,0,0)
  2535. columnFrame.texture:SetAllPoints()
  2536.  
  2537. columnFrame.lockTexture = columnFrame:CreateTexture(nil, "BACKGROUND")
  2538. columnFrame.lockTexture:SetColorTexture(0,0,0,0)
  2539. columnFrame.lockTexture:SetAllPoints()
  2540.  
  2541. columnFrame.lines = {}
  2542.  
  2543. columnFrame.BlackList = {}
  2544.  
  2545. module:RegisterHideOnPetBattle(columnFrame)
  2546. end
  2547.  
  2548. do
  2549. local isInCombat = false
  2550. local isInEncounter = false
  2551. function module:updateCombatVisibility()
  2552. local _, zoneType = GetInstanceInfo()
  2553. local inRaid = IsInRaid()
  2554. for i=1,module.db.maxColumns do
  2555. local columnFrame = module.frame.colFrame[i]
  2556.  
  2557. local state = columnFrame.optionIsEnabled
  2558.  
  2559. if not columnFrame.methodsOnlyInCombat then
  2560.  
  2561. elseif isInCombat and columnFrame.optionIsEnabled then
  2562. state = state and true
  2563. elseif not isInCombat then
  2564. state = false
  2565. end
  2566.  
  2567. if zoneType == "arena" then
  2568. if not columnFrame.visibilityArena then
  2569. state = false
  2570. end
  2571. elseif zoneType == "party" then
  2572. if not columnFrame.visibility5ppl then
  2573. state = false
  2574. end
  2575. elseif zoneType == "pvp" then
  2576. if not columnFrame.visibilityBG then
  2577. state = false
  2578. end
  2579. elseif zoneType == "raid" then
  2580. if not columnFrame.visibilityRaid then
  2581. state = false
  2582. end
  2583. elseif zoneType == "scenario" then
  2584. if not columnFrame.visibility3ppl then
  2585. state = false
  2586. end
  2587. else
  2588. if not columnFrame.visibilityWorld then
  2589. state = false
  2590. end
  2591. end
  2592.  
  2593. if (columnFrame.visibilityPartyType == 2 and not inRaid) or (columnFrame.visibilityPartyType == 1 and inRaid) then
  2594. state = false
  2595. end
  2596.  
  2597. columnFrame:SetShown(state)
  2598. end
  2599. if not VExRT.ExCD2.SplitOpt then
  2600. if VExRT.ExCD2.colSet[module.db.maxColumns+1].methodsOnlyInCombat then
  2601. if isInCombat then
  2602. module.frame:Show()
  2603. else
  2604. module.frame:Hide()
  2605. end
  2606. elseif module.frame.IsEnabled then
  2607. module.frame:Show()
  2608. end
  2609. end
  2610. end
  2611. function module:toggleCombatVisibility(currState,callType)
  2612. local isInstance, instanceType = IsInInstance()
  2613. if instanceType == "arena" or instanceType == "pvp" then
  2614. currState = true
  2615. elseif instanceType == "raid" or instanceType == "party" then
  2616. if callType == 1 then
  2617. isInEncounter = currState
  2618. elseif callType == 2 then
  2619. currState = currState or isInEncounter
  2620. end
  2621. elseif callType == 1 then
  2622. return --ignore encounters not in raid/party
  2623. end
  2624. isInCombat = currState
  2625. module:updateCombatVisibility()
  2626. end
  2627. end
  2628.  
  2629. do
  2630. local lastSaving = GetTime() - 15
  2631. function SaveCDtoVar(overwrite)
  2632. local currTime = GetTime()
  2633. if ((currTime - lastSaving) < 30 and not overwrite) or module.db.testMode then
  2634. return
  2635. end
  2636. wipe(VExRT.ExCD2.Save)
  2637. for i=1,#_C do
  2638. local unitSpellData = _C[i]
  2639. if unitSpellData.lastUse + unitSpellData.cd - currTime > 0 then
  2640. VExRT.ExCD2.Save[ (unitSpellData.fullName or "?")..(unitSpellData.db[1] or 0) ] = {unitSpellData.lastUse,unitSpellData.cd}
  2641. else
  2642. VExRT.ExCD2.Save[ (unitSpellData.fullName or "?")..(unitSpellData.db[1] or 0) ] = nil
  2643. end
  2644. end
  2645. end
  2646. end
  2647.  
  2648. local function AfterCombatResetFunction(isArena)
  2649. for i=1,#_C do
  2650. local unitSpellData = _C[i]
  2651. local uSpecID = module.db.specInDBase[globalGUIDs[unitSpellData.fullName] or 0]
  2652. if not unitSpellData.db[uSpecID] and unitSpellData.db[3] then
  2653. uSpecID = 3
  2654. end
  2655.  
  2656. if (unitSpellData.cd > 0 and (module.db.spell_afterCombatReset[unitSpellData.db[1]] or (unitSpellData.db[uSpecID] and unitSpellData.db[uSpecID][2] >= (isArena and 0 or 180) or unitSpellData.cd >= (isArena and 0 or 180)))) and (not module.db.spell_afterCombatNotReset[unitSpellData.db[1]] or isArena) then
  2657. unitSpellData.lastUse = 0
  2658. unitSpellData.charge = nil
  2659.  
  2660. if unitSpellData.bar and unitSpellData.bar.data == unitSpellData then
  2661. unitSpellData.bar:UpdateStatus()
  2662. end
  2663. end
  2664. end
  2665. SaveCDtoVar(true)
  2666. end
  2667.  
  2668. local function TestMode(h)
  2669. if not h then
  2670. for i=1,#_C do
  2671. local data = _C[i]
  2672. local uSpecID = module.db.specInDBase[VExRT.ExCD2.gnGUIDs[data.fullName] or 0]
  2673. if not data.db[uSpecID] then
  2674. uSpecID = 3
  2675. end
  2676. if data.db[uSpecID] then
  2677. if fastrandom(0,100) < 80 then
  2678. data.cd = data.db[uSpecID][2]
  2679. data.lastUse = GetTime() - fastrandom(0,data.db[uSpecID][2]) - fastrandom()
  2680. data.duration = data.db[uSpecID][3]
  2681. end
  2682. end
  2683. end
  2684. else
  2685. for i=1,#_C do
  2686. local data = _C[i]
  2687. data.lastUse = 0
  2688. data.duration = 0
  2689. end
  2690. end
  2691. UpdateAllData()
  2692. SortAllData()
  2693. end
  2694.  
  2695.  
  2696. do
  2697. local inColsCount = {}
  2698.  
  2699. --Upvaules
  2700. local maxColumns = _db.maxColumns
  2701. local maxLinesInCol = _db.maxLinesInCol
  2702. local specInDBase = _db.specInDBase
  2703. local spell_isTalent = _db.spell_isTalent
  2704. local session_gGUIDs = _db.session_gGUIDs
  2705. local spell_isPetAbility = _db.spell_isPetAbility
  2706. local session_Pets = _db.session_Pets
  2707. local petsAbilities = _db.petsAbilities
  2708. local spell_talentReplaceOther = _db.spell_talentReplaceOther
  2709. local spell_charge_fix = _db.spell_charge_fix
  2710. local def_col = _db.def_col
  2711. local columnsTable = _mainFrame.colFrame
  2712.  
  2713. local playerName = ExRT.SDB.charName
  2714.  
  2715. local saveDataTimer = 0
  2716. local lastBattleResChargesStatus = nil
  2717.  
  2718. local function sort_a(a,b) return (a.sort or 0) < (b.sort or 0) end
  2719. local function sort_b(a,b) if a.sorting == b.sorting then return (a.sort or 0) < (b.sort or 0) else return (a.sorting or 0) < (b.sorting or 0) end end
  2720. --local function sort_b(a,b) return (a.sorting or 0) < (b.sorting or 0) end
  2721. local function sort_ar(a,b) return (a.sort or 0) > (b.sort or 0) end
  2722. local function sort_br(a,b) if a.sorting == b.sorting then return (a.sort or 0) > (b.sort or 0) else return (a.sorting or 0) > (b.sorting or 0) end end
  2723.  
  2724. local oneSpellPerCol = {} for i=1,maxColumns do oneSpellPerCol[i]={} end
  2725. local reviewID = 0
  2726.  
  2727. function SortAllData()
  2728. local SortByAvailability = VExRT.ExCD2.SortByAvailability
  2729. if SortByAvailability then
  2730. local currTime = GetTime()
  2731. local SortByAvailabilityActiveToTop = VExRT.ExCD2.SortByAvailabilityActiveToTop
  2732. for i=1,#_C do
  2733. local data = _C[i]
  2734. local cd = data.lastUse + data.cd - currTime
  2735.  
  2736. local charge = data.charge
  2737. if data.isCharge and charge then
  2738. if charge <= currTime and (charge+data.cd) > currTime then
  2739. cd = -1
  2740. elseif charge > currTime then
  2741. cd = charge - currTime
  2742. end
  2743. end
  2744.  
  2745. if data.disabled then
  2746. cd = cd > 0 and cd or 49999
  2747. end
  2748. if cd > 0 then
  2749. cd = cd + 50000
  2750. end
  2751.  
  2752. local dur = 0
  2753. if SortByAvailabilityActiveToTop then
  2754. dur = data.lastUse + data.duration - currTime
  2755. if dur < 0 then
  2756. dur = 0
  2757. end
  2758. end
  2759. data.sorting = dur > 0 and dur or cd > 0 and cd or 0
  2760.  
  2761. local columnFrame = columnsTable[data.column]
  2762. if columnFrame.methodsNewSpellNewLine then
  2763. data.sorting = (data.sort2 or data.db[1]) * 100000 + data.sorting
  2764. end
  2765. end
  2766. if not VExRT.ExCD2.ReverseSorting then
  2767. sort(_C,sort_b)
  2768. else
  2769. sort(_C,sort_br)
  2770. end
  2771. else
  2772. if not VExRT.ExCD2.ReverseSorting then
  2773. sort(_C,sort_a)
  2774. else
  2775. sort(_C,sort_ar)
  2776. end
  2777. end
  2778. end
  2779.  
  2780. local function TalentReplaceOtherCheck(spellID,name)
  2781. local spellData = spell_talentReplaceOther[spellID]
  2782. if type(spellData) == 'number' then
  2783. return session_gGUIDs[name][spellData]
  2784. else
  2785. for i=1,#spellData do
  2786. if session_gGUIDs[name][ spellData[i] ] then
  2787. return true
  2788. end
  2789. end
  2790. end
  2791. return false
  2792. end
  2793.  
  2794. function UpdateAllData()
  2795. reviewID = reviewID + 1
  2796. --print('UpdateAllData',GetTime())
  2797. local isTestMode = _db.testMode
  2798. local CDECol = VExRT.ExCD2.CDECol
  2799. local currTime = GetTime()
  2800. for i=1,#_C do
  2801. local data = _C[i]
  2802. local db = data.db
  2803. local name = data.fullName
  2804. local spellID = db[1]
  2805.  
  2806. local specID = globalGUIDs[name] or 0
  2807. local unitSpecID = specInDBase[specID] or 3
  2808.  
  2809. if isTestMode or (VExRT_CDE[spellID] and
  2810. (db[unitSpecID] or (not db[unitSpecID] and db[3])) and
  2811. (not spell_isTalent[spellID] or session_gGUIDs[name][spellID]) and
  2812. (not spell_isPetAbility[spellID] or session_Pets[name] == spell_isPetAbility[spellID] or (session_Pets[name] and petsAbilities[ session_Pets[name] ] and petsAbilities[ session_Pets[name] ][1] == spell_isPetAbility[spellID])) and
  2813. (not spell_talentReplaceOther[spellID] or not TalentReplaceOtherCheck(spellID,name)) and
  2814. (not data.specialCheck or data.specialCheck(data,currTime))
  2815. ) then
  2816. data.vis = true
  2817.  
  2818. local col = 1
  2819. if db[unitSpecID] then
  2820. col = VExRT.ExCD2.CDECol[db[unitSpecID][1]..";"..(unitSpecID-2)] or def_col[db[unitSpecID][1]..";"..(unitSpecID-2)] or 1
  2821. elseif db[3] then
  2822. col = VExRT.ExCD2.CDECol[db[3][1]..";1"] or def_col[db[3][1]..";1"] or 1
  2823. end
  2824. data.column = col
  2825.  
  2826. local isCharge = spell_charge_fix[ spellID ]
  2827. if isCharge then
  2828. if session_gGUIDs[data.fullName][isCharge] then
  2829. data.isCharge = true
  2830. isCharge = true
  2831. else
  2832. data.isCharge = nil
  2833. isCharge = nil
  2834. end
  2835. end
  2836.  
  2837. local columnFrame = columnsTable[col]
  2838.  
  2839. local isOnCD = not isCharge and (data.lastUse + data.cd) > currTime
  2840.  
  2841. if columnFrame.optionShownOnCD and not ((isCharge and data.charge and data.charge > currTime) or isOnCD) then
  2842. data.vis = nil
  2843. end
  2844. if columnFrame.methodsHideOwnSpells and data.fullName == playerName then
  2845. data.vis = nil
  2846. end
  2847.  
  2848. local whiteList = columnFrame.WhiteList
  2849. if whiteList then
  2850. if not whiteList[data.loweredName] then
  2851. data.vis = nil
  2852. end
  2853. else
  2854. local blackList = columnFrame.BlackList
  2855. if blackList[data.loweredName] or (blackList[spellID] and blackList[spellID][data.loweredName]) then
  2856. data.vis = nil
  2857. end
  2858. end
  2859.  
  2860. local prevDisabledStatus = data.disabled
  2861. local isDead = status_UnitIsDead[ name ]
  2862. local isOffline = status_UnitIsDisconnected[ name ]
  2863. if isDead or isOffline then
  2864. data.disabled = isOffline and 2 or 1
  2865. else
  2866. data.disabled = nil
  2867. end
  2868.  
  2869. local prevOutOfRange = data.outofrange
  2870. if status_UnitIsOutOfRange[ name ] then
  2871. data.outofrange = true
  2872. else
  2873. data.outofrange = nil
  2874. end
  2875.  
  2876. if columnFrame.methodsOneSpellPerCol and data.vis then
  2877. local oneSpellPerColCurr = oneSpellPerCol[col][spellID]
  2878. if not oneSpellPerColCurr then
  2879. oneSpellPerColCurr = {}
  2880. oneSpellPerCol[col][spellID] = oneSpellPerColCurr
  2881. end
  2882. local isOnCD = isOnCD or data.disabled
  2883. if oneSpellPerColCurr[1] ~= reviewID then
  2884. oneSpellPerColCurr[1] = reviewID
  2885. oneSpellPerColCurr[2] = data
  2886. oneSpellPerColCurr[3] = isOnCD
  2887. elseif oneSpellPerColCurr[3] and not isOnCD then
  2888. oneSpellPerColCurr[2].vis = nil
  2889. oneSpellPerColCurr[1] = reviewID
  2890. oneSpellPerColCurr[2] = data
  2891. oneSpellPerColCurr[3] = isOnCD
  2892. elseif data.disabled then
  2893. data.vis = nil
  2894. elseif oneSpellPerColCurr[3] and isOnCD then
  2895. local prevData = oneSpellPerColCurr[2]
  2896. if (prevData.lastUse + prevData.cd) > (data.lastUse + data.cd) then
  2897. prevData.vis = nil
  2898. oneSpellPerColCurr[1] = reviewID
  2899. oneSpellPerColCurr[2] = data
  2900. oneSpellPerColCurr[3] = isOnCD
  2901. else
  2902. data.vis = nil
  2903. end
  2904. else
  2905. data.vis = nil
  2906. end
  2907. end
  2908.  
  2909. local bar = data.bar
  2910. if bar and bar.data == data and (data.disabled ~= prevDisabledStatus or data.outofrange ~= prevOutOfRange) then
  2911. data.bar:UpdateStatus()
  2912. end
  2913.  
  2914. else
  2915. data.vis = nil
  2916. end
  2917. end
  2918. end
  2919.  
  2920. local statusTimer1,statusTimer2 = 0,0
  2921.  
  2922. function module:timer(elapsed)
  2923. local forceUpdateAllData,forceSortAllData = false,false
  2924.  
  2925. if not _db.isEncounter and IsEncounterInProgress() then
  2926. _db.isEncounter = true
  2927. local _,_,difficulty = GetInstanceInfo()
  2928. if difficulty == 14 or difficulty == 15 or difficulty == 16 or difficulty == 17 or difficulty == 7 then
  2929. _db.isResurectDisabled = true
  2930. end
  2931. module:toggleCombatVisibility(true,1)
  2932. elseif _db.isEncounter and not IsEncounterInProgress() then
  2933. _db.isEncounter = nil
  2934. _db.isResurectDisabled = nil
  2935. if GetDifficultyForCooldownReset() then
  2936. AfterCombatResetFunction()
  2937. forceUpdateAllData = true
  2938. forceSortAllData = true
  2939. end
  2940. module:toggleCombatVisibility(false,1)
  2941. end
  2942.  
  2943.  
  2944. ---------> Check status
  2945. statusTimer2 = statusTimer2 + elapsed
  2946. if statusTimer2 > 0.25 then
  2947. statusTimer2 = 0
  2948. statusTimer1 = statusTimer1 + 1
  2949. local doOtherChecks = statusTimer1 > 1
  2950. for i=1,#status_UnitsToCheck do
  2951. local unit = status_UnitsToCheck[i]
  2952. local inRange,isRange = UnitInRange(unit)
  2953. local outOfRange = isRange and not inRange
  2954. if status_UnitIsOutOfRange[ unit ] ~= outOfRange then
  2955. forceUpdateAllData = true
  2956. end
  2957. status_UnitIsOutOfRange[ unit ] = outOfRange
  2958. if doOtherChecks then
  2959. local isDead = UnitIsDeadOrGhost(unit)
  2960. if isDead ~= status_UnitIsDead[ unit ] then
  2961. forceUpdateAllData = true
  2962. forceSortAllData = true
  2963. end
  2964. status_UnitIsDead[ unit ] = isDead
  2965.  
  2966. local isOffline = not UnitIsConnected(unit)
  2967. if isOffline ~= status_UnitIsDisconnected[ unit ] then
  2968. forceUpdateAllData = true
  2969. forceSortAllData = true
  2970. end
  2971. status_UnitIsDisconnected[ unit ] = not UnitIsConnected(unit)
  2972. end
  2973. end
  2974. if doOtherChecks then
  2975. statusTimer1 = 0
  2976.  
  2977. local charges,_,started,duration = GetSpellCharges(20484)
  2978. if charges ~= lastBattleResChargesStatus then
  2979. local charge = nil
  2980. if charges then
  2981. if charges > 0 then
  2982. charge = started
  2983. started = 0
  2984. end
  2985. else
  2986. started = 0
  2987. duration = 0
  2988. charge = nil
  2989. end
  2990. for i=1,#_C do
  2991. local data = _C[i]
  2992. if module.db.spell_battleRes[ data.db[1] ] then
  2993. data.lastUse = started
  2994. data.cd = duration
  2995. data.charge = charge
  2996.  
  2997. local bar = data.bar
  2998. if bar and bar.data == data then
  2999. bar:UpdateStatus()
  3000. end
  3001. end
  3002. end
  3003. forceUpdateAllData = true
  3004. forceSortAllData = true
  3005.  
  3006. if charges and lastBattleResChargesStatus and charges < lastBattleResChargesStatus then --Add resurrect to history
  3007. module.db.historyUsage[#module.db.historyUsage + 1] = {time(),20484,"*",GetEncounterTime()}
  3008. end
  3009. end
  3010. lastBattleResChargesStatus = charges
  3011. end
  3012. end
  3013. if forceUpdateAllData then
  3014. UpdateAllData()
  3015. end
  3016. if forceSortAllData then
  3017. SortAllData()
  3018. end
  3019.  
  3020. for i=1,maxColumns do
  3021. inColsCount[i] = 0
  3022. columnsTable[i].lastSpell = nil
  3023. end
  3024. for i=1,#_C do
  3025. local data = _C[i]
  3026. if data.vis then
  3027. local col = data.column
  3028. local numberInCol = inColsCount[col] + 1
  3029. local spellID = data.db[1]
  3030.  
  3031. local barParent = columnsTable[col]
  3032. if barParent.methodsNewSpellNewLine and barParent.lastSpell ~= spellID then
  3033. local fix = 0
  3034. for j=numberInCol,maxLinesInCol do
  3035. local bar_now = barParent.lines[numberInCol + fix]
  3036. if bar_now then
  3037. if bar_now.IsNewLine then
  3038. break
  3039. else
  3040. if bar_now.data then
  3041. bar_now.data = nil
  3042. bar_now:Update()
  3043. end
  3044. fix = fix + 1
  3045. end
  3046. end
  3047. end
  3048. numberInCol = numberInCol + fix
  3049. end
  3050. if barParent.optionIconTitles and barParent.lastSpell ~= spellID then
  3051. local bar = barParent.lines[numberInCol]
  3052. if bar and (bar.data ~= data or not bar.isTitle) then
  3053. bar.data = data
  3054. bar:CreateTitle()
  3055. end
  3056. numberInCol = numberInCol + 1
  3057. end
  3058. if barParent.methodsNewSpellNewLine and barParent.optionIconTitles and barParent.frameColumns > 1 and barParent.lastSpell == spellID then
  3059. local bar_now = barParent.lines[numberInCol]
  3060. if bar_now and bar_now.IsNewLine then
  3061. if bar_now.data then
  3062. bar_now.data = nil
  3063. bar_now:Update()
  3064. end
  3065. numberInCol = numberInCol + 1
  3066. end
  3067. end
  3068.  
  3069. barParent.lastSpell = spellID
  3070.  
  3071. inColsCount[col] = numberInCol
  3072. local bar = barParent.lines[numberInCol]
  3073. if bar and bar.data ~= data then
  3074. bar.data = data
  3075.  
  3076. data.bar = bar
  3077.  
  3078. bar:Update()
  3079. bar:UpdateStatus()
  3080. end
  3081. end
  3082. end
  3083.  
  3084. for i=1,maxColumns do
  3085. local col = columnsTable[i]
  3086. if col.IsColumnEnabled then
  3087. local y = col.optionLinesMax
  3088. if inColsCount[i] > y then
  3089. inColsCount[i] = y
  3090. end
  3091. local start = inColsCount[i]
  3092. for j=start+1,col.NumberLastLinesActive do
  3093. local bar = col.lines[j]
  3094. if bar and bar.data then
  3095. bar.data = nil
  3096. bar:Update()
  3097. end
  3098. end
  3099. col.NumberLastLinesActive = start
  3100. end
  3101. end
  3102.  
  3103. saveDataTimer = saveDataTimer + elapsed
  3104. if saveDataTimer > 2 then
  3105. saveDataTimer = 0
  3106. SaveCDtoVar()
  3107. end
  3108. end
  3109. end
  3110.  
  3111. local function GetNumGroupMembersFix()
  3112. local n = GetNumGroupMembers() or 0
  3113. if module.db.testMode then
  3114. return 20
  3115. elseif n == 0 and VExRT.ExCD2.NoRaid then
  3116. return 1
  3117. else
  3118. return n
  3119. end
  3120. end
  3121.  
  3122. local function GetRaidRosterInfoFix(j)
  3123. local name, rank, subgroup, level, class, classFileName, zone, online, isDead, role, isML = GetRaidRosterInfo(j)
  3124. if j == 1 and not name and VExRT.ExCD2.NoRaid then
  3125. name = UnitName("player")
  3126. class,classFileName = UnitClass("player")
  3127. local _,race = UnitRace("player")
  3128. level = UnitLevel("player")
  3129. isDead = UnitIsDeadOrGhost("player")
  3130. return name,1,classFileName,level,race,true,isDead
  3131. elseif not module.db.testMode then
  3132. local _,race = UnitRace(name or "?")
  3133. return name,subgroup,classFileName,level,race,online,isDead
  3134. elseif module.db.testMode then
  3135. if name then
  3136. local _,race = UnitRace(name)
  3137. return name,subgroup,classFileName,level,race,online,isDead
  3138. end
  3139. local i = math.random(1,11)
  3140.  
  3141. local namesList = {}
  3142. for unitName, specID in pairs(VExRT.ExCD2.gnGUIDs) do
  3143. namesList[#namesList+1] = {unitName}
  3144. for className, classSpecs in pairs(module.db.specByClass) do
  3145. if ExRT.F.table_find(module.db.classNames,className) then --prevent error at version without DH class
  3146. for spec_i=1,#classSpecs do
  3147. if classSpecs[spec_i] == specID then
  3148. namesList[#namesList][2] = className
  3149. end
  3150. end
  3151. end
  3152. end
  3153. end
  3154. if #namesList == 0 or #namesList < 25 then
  3155. name = L.classLocalizate[module.db.classNames[i]]..tostring(j)
  3156. classFileName = module.db.classNames[i]
  3157. else
  3158. i = math.random(1,#namesList)
  3159. name = namesList[i][1]
  3160. classFileName = namesList[i][2]
  3161. end
  3162.  
  3163. return name,1,classFileName,100,nil,true,false
  3164. end
  3165. end
  3166.  
  3167. local function UpdateLegendaryRingState()
  3168. isLegendaryRingInRaid_DD = nil
  3169. isLegendaryRingInRaid_Tank = nil
  3170. isLegendaryRingInRaid_Heal = nil
  3171.  
  3172. local session_gGUIDs = module.db.session_gGUIDs
  3173.  
  3174. local roster = {}
  3175. for i=1,#_C do
  3176. roster[ _C[i].name ] = true
  3177. end
  3178. for name,_ in pairs(roster) do
  3179. if session_gGUIDs[name][187614] or session_gGUIDs[name][187615] or session_gGUIDs[name][187611] then
  3180. isLegendaryRingInRaid_DD = true
  3181. elseif session_gGUIDs[name][187613] then
  3182. isLegendaryRingInRaid_Tank = true
  3183. elseif session_gGUIDs[name][187612] then
  3184. isLegendaryRingInRaid_Heal = true
  3185. end
  3186. end
  3187. end
  3188.  
  3189. function RaidResurrectSpecialCheck()
  3190. local _,_,difficulty = GetInstanceInfo()
  3191. if difficulty == 14 or difficulty == 15 or difficulty == 16 or difficulty == 7 or difficulty == 17 then
  3192. return true
  3193. end
  3194. end
  3195. function RaidResurrectSpecialText()
  3196. local charges, maxCharges, started, duration = GetSpellCharges(20484)
  3197. if (charges or 0) > 1 then
  3198. return " ("..charges..")"
  3199. end
  3200. end
  3201. function RaidResurrectSpecialStatus()
  3202. local charges, maxCharges, started, duration = GetSpellCharges(20484)
  3203. if charges then
  3204. if charges > 0 then
  3205. return false,started,duration
  3206. else
  3207. return true,started,duration
  3208. end
  3209. end
  3210. end
  3211.  
  3212. local LegendaryRingSpecialCheck_DD,LegendaryRingSpecialCheck_Tank,LegendaryRingSpecialCheck_Heal
  3213.  
  3214. function LegendaryRingSpecialCheck_DD() return isLegendaryRingInRaid_DD end
  3215. function LegendaryRingSpecialCheck_Tank() return isLegendaryRingInRaid_Tank end
  3216. function LegendaryRingSpecialCheck_Heal() return isLegendaryRingInRaid_Heal end
  3217.  
  3218. local function UpdateRoster()
  3219. wipe(status_UnitsToCheck)
  3220. wipe(status_UnitIsDead)
  3221. wipe(status_UnitIsDisconnected)
  3222. wipe(status_UnitIsOutOfRange)
  3223.  
  3224. local n = GetNumGroupMembersFix()
  3225. if n > 0 then
  3226. local priorCounter = 0
  3227. local priorNamesToNumber = {}
  3228. if not module.db.testMode then
  3229. for j=1,n do
  3230. local name = GetRaidRosterInfoFix(j)
  3231. if name then
  3232. priorNamesToNumber[#priorNamesToNumber + 1] = name
  3233. end
  3234. end
  3235. sort(priorNamesToNumber)
  3236. end
  3237.  
  3238. local classColorsTable = type(CUSTOM_CLASS_COLORS)=="table" and CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS
  3239.  
  3240. for i=1,#_C do _C[i].sort = nil end
  3241. local gMax = GetRaidDiffMaxGroup()
  3242. local isInRaid = IsInRaid()
  3243. for j=1,n do
  3244. local name,subgroup,class,level,race,online,isDead = GetRaidRosterInfoFix(j)
  3245. if name and subgroup <= gMax then
  3246. for i,spellData in ipairs(module.db.spellDB) do
  3247. local SpellID = spellData[1]
  3248. local AddThisSpell = true
  3249. if level < 100 then
  3250. local spellLevel = GetSpellLevelLearned(SpellID)
  3251. if level < (spellLevel or 0) then
  3252. AddThisSpell = false
  3253. end
  3254. end
  3255. if module.db.spell_isRacial[ SpellID ] and race ~= module.db.spell_isRacial[ SpellID ] then
  3256. AddThisSpell = false
  3257. end
  3258. if not GetSpellInfo(SpellID) then --non exist, removed spells
  3259. AddThisSpell = false
  3260. end
  3261. if AddThisSpell and (spellData[2] == class or spellData[2] == "ALL") then
  3262. if not ExRT.F.table_find(status_UnitsToCheck,name) then
  3263. status_UnitsToCheck[#status_UnitsToCheck + 1] = name
  3264.  
  3265. status_UnitIsDead[ name ] = isDead
  3266. status_UnitIsDisconnected[ name ] = not online
  3267.  
  3268. local inRange,isRange = UnitInRange(name)
  3269. status_UnitIsOutOfRange[ name ] = isRange and not inRange
  3270. end
  3271. --if SpellID == 1719 then
  3272. module:AddCLEUSpellDamage(SpellID)
  3273. --end
  3274.  
  3275. local alreadyInCds = nil
  3276. priorCounter = priorCounter + 1
  3277.  
  3278. local spellColumn = 1
  3279. local _specID = globalGUIDs[name] or 0
  3280. local uSpecID = _db.specInDBase[_specID] or 3
  3281. if spellData[uSpecID] then
  3282. spellColumn = VExRT.ExCD2.CDECol[spellData[uSpecID][1]..";"..(uSpecID-2)] or _db.def_col[spellData[uSpecID][1]..";"..(uSpecID-2)] or 1
  3283. elseif spellData[3] then
  3284. spellColumn = VExRT.ExCD2.CDECol[spellData[3][1]..";1"] or _db.def_col[spellData[3][1]..";1"] or 1
  3285. end
  3286. local getSpellColumn = _mainFrame.colFrame[spellColumn]
  3287. local prior = nil
  3288. --[[
  3289. 1: 00AABBBBBBCCDDDD
  3290. 2: 00AACCBBBBBBDDDD
  3291. 3: AAEEBBBBBBCCDDDD
  3292. 4: AAEECCBBBBBBDDDD
  3293. 5: 00CCAABBBBBBDDDD
  3294. 6: EEAACCBBBBBBDDDD
  3295.  
  3296. A - priority
  3297. B - spell ID
  3298. C - name
  3299. D - priority counter
  3300. E - classID
  3301. ]]
  3302. if not getSpellColumn or getSpellColumn.methodsSortingRules == 1 then
  3303. prior = (VExRT.ExCD2.Priority[SpellID] or 15) * 1000000000000 + (SpellID or 0) * 1000000 + (ExRT.F.table_find(priorNamesToNumber,name) or 0) * 10000 + priorCounter
  3304. elseif getSpellColumn.methodsSortingRules == 2 then
  3305. prior = (VExRT.ExCD2.Priority[SpellID] or 15) * 1000000000000 + (ExRT.F.table_find(priorNamesToNumber,name) or 0) * 10000000000 + (SpellID or 0) * 10000 + priorCounter
  3306. elseif getSpellColumn.methodsSortingRules == 3 then
  3307. prior = (VExRT.ExCD2.Priority[SpellID] or 15) * 100000000000000 + (ExRT.F.table_find(module.db.classNames,class) or 0) * 1000000000000 + (SpellID or 0) * 1000000 + (ExRT.F.table_find(priorNamesToNumber,name) or 0) * 10000 + priorCounter
  3308. elseif getSpellColumn.methodsSortingRules == 4 then
  3309. prior = (VExRT.ExCD2.Priority[SpellID] or 15) * 100000000000000 + (ExRT.F.table_find(module.db.classNames,class) or 0) * 1000000000000 + (ExRT.F.table_find(priorNamesToNumber,name) or 0) * 10000000000 + (SpellID or 0) * 10000 + priorCounter
  3310. elseif getSpellColumn.methodsSortingRules == 5 then
  3311. prior = (ExRT.F.table_find(priorNamesToNumber,name) or 0) * 1000000000000 + (VExRT.ExCD2.Priority[SpellID] or 15) * 10000000000 + (SpellID or 0) * 10000 + priorCounter
  3312. elseif getSpellColumn.methodsSortingRules == 6 then
  3313. prior = (ExRT.F.table_find(module.db.classNames,class) or 0) * 100000000000000 + (VExRT.ExCD2.Priority[SpellID] or 15) * 1000000000000 + (ExRT.F.table_find(priorNamesToNumber,name) or 0) * 10000000000 + (SpellID or 0) * 10000 + priorCounter
  3314. end
  3315. local secondPrior = (VExRT.ExCD2.Priority[SpellID] or 15) * 1000000 + (SpellID or 0) --used in columns with option 'new spell - new line'
  3316.  
  3317. local sName = format("%s%d",name or "?",SpellID or 0)
  3318. local lastUse,nowCd = 0,0
  3319. if VExRT.ExCD2.Save[sName] and NumberInRange(VExRT.ExCD2.Save[sName][1] + VExRT.ExCD2.Save[sName][2] - GetTime(),0,2000,false,true) then
  3320. lastUse,nowCd = VExRT.ExCD2.Save[sName][1],VExRT.ExCD2.Save[sName][2]
  3321. end
  3322.  
  3323. local spellName,_,spellTexture = GetSpellInfo(SpellID)
  3324. spellTexture = spellTexture or "Interface\\Icons\\INV_MISC_QUESTIONMARK"
  3325. spellName = spellName or "unk"
  3326. local shownName = DelUnitNameServer(name)
  3327.  
  3328. if module.db.differentIcons[SpellID] then
  3329. spellTexture = module.db.differentIcons[SpellID]
  3330. end
  3331.  
  3332. for l=3,7 do
  3333. if spellData[l] then
  3334. local h = module.db.cdsNav[name][spellData[l][1]]
  3335. if h then
  3336. h.db = spellData
  3337. if lastUse ~= 0 and nowCd ~= 0 and h.lastUse == 0 and h.cd == 0 then
  3338. h.cd = nowCd
  3339. h.lastUse = lastUse
  3340. end
  3341. h.sort = prior
  3342. h.sort2 = secondPrior
  3343. h.spellName = spellName
  3344. h.icon = spellTexture
  3345. h.column = spellColumn
  3346.  
  3347. alreadyInCds = true
  3348. end
  3349. end
  3350. end
  3351.  
  3352. if not alreadyInCds then
  3353. _C [#_C + 1] = {
  3354. name = shownName,
  3355. fullName = name,
  3356. loweredName = shownName:lower(),
  3357. icon = spellTexture,
  3358. spellName = spellName,
  3359. db = spellData,
  3360. lastUse = lastUse,
  3361. cd = nowCd,
  3362. duration = 0,
  3363. classColor = classColorsTable[class] or module.db.notAClass,
  3364. sort = prior,
  3365. sort2 = secondPrior,
  3366. column = spellColumn,
  3367. }
  3368. end
  3369. end
  3370. end
  3371. module.db.session_gGUIDs[name] = 1
  3372. if isInRaid then
  3373. module.main:UNIT_PET("raid"..j)
  3374. end
  3375. end
  3376. end
  3377.  
  3378. --WOD Raid resurrect
  3379. do
  3380. local findResSpell = ExRT.F.table_find(module.db.spellDB,161642,1)
  3381. if findResSpell then
  3382. local spellData = module.db.spellDB[findResSpell]
  3383. local h = module.db.cdsNav["*"][spellData[3][1]]
  3384. local prior = 0
  3385.  
  3386. priorCounter = priorCounter + 1
  3387.  
  3388. local spellColumn = VExRT.ExCD2.CDECol["161642;1"] or _db.def_col["161642;1"] or 1
  3389. local getSpellColumn = _mainFrame.colFrame[spellColumn]
  3390. if not getSpellColumn or getSpellColumn.methodsSortingRules == 1 then
  3391. prior = (VExRT.ExCD2.Priority[161642] or 15) * 1000000000000 + 161642 * 1000000 + priorCounter
  3392. elseif getSpellColumn.methodsSortingRules == 2 then
  3393. prior = (VExRT.ExCD2.Priority[161642] or 15) * 1000000000000 + 161642 * 10000 + priorCounter
  3394. elseif getSpellColumn.methodsSortingRules == 3 then
  3395. prior = (VExRT.ExCD2.Priority[161642] or 15) * 100000000000000 + 161642 * 1000000 + priorCounter
  3396. elseif getSpellColumn.methodsSortingRules == 4 then
  3397. prior = (VExRT.ExCD2.Priority[161642] or 15) * 100000000000000 + 161642 * 10000 + priorCounter
  3398. elseif getSpellColumn.methodsSortingRules == 5 then
  3399. prior = (VExRT.ExCD2.Priority[161642] or 15) * 10000000000 + 161642 * 10000 + priorCounter
  3400. elseif getSpellColumn.methodsSortingRules == 6 then
  3401. prior = (VExRT.ExCD2.Priority[161642] or 15) * 1000000000000 + 161642 * 10000 + priorCounter
  3402. end
  3403. local secondPrior = (VExRT.ExCD2.Priority[161642] or 15) * 1000000 + (161642 or 0)
  3404.  
  3405. if not h then
  3406. local spellName,_,spellTexture = GetSpellInfo(spellData[1])
  3407. _C [#_C + 1] = {
  3408. name = L.cd2Resurrect,
  3409. fullName = "*",
  3410. loweredName = "*",
  3411. icon = spellTexture,
  3412. spellName = spellName or "unk",
  3413. db = spellData,
  3414. lastUse = 0,
  3415. cd = 0,
  3416. duration = 0,
  3417. classColor = module.db.notAClass,
  3418. sort = prior,
  3419. sort2 = secondPrior,
  3420. column = spellColumn,
  3421. specialCheck = RaidResurrectSpecialCheck,
  3422. specialAddText = RaidResurrectSpecialText,
  3423. specialStatus = RaidResurrectSpecialStatus,
  3424. }
  3425. else
  3426. h.sort = prior
  3427. h.sort2 = secondPrior
  3428. h.column = spellColumn
  3429. end
  3430. module.db.session_gGUIDs["*"] = 1
  3431. end
  3432. end
  3433. --WOD Legendary Ring
  3434. do
  3435. local RingSpellID = 187614
  3436. local findRingSpell = ExRT.F.table_find(module.db.spellDB,RingSpellID,1)
  3437. if findRingSpell then
  3438. local spellData = module.db.spellDB[findRingSpell]
  3439. local h = module.db.cdsNav["*"][RingSpellID]
  3440. local prior = 0
  3441. priorCounter = priorCounter + 1
  3442. local spellColumn = VExRT.ExCD2.CDECol[RingSpellID..";1"] or _db.def_col[RingSpellID..";1"] or 1
  3443. local getSpellColumn = _mainFrame.colFrame[spellColumn]
  3444. if not getSpellColumn or getSpellColumn.methodsSortingRules == 1 then
  3445. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 1000000 + priorCounter
  3446. elseif getSpellColumn.methodsSortingRules == 2 then
  3447. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 10000 + priorCounter
  3448. elseif getSpellColumn.methodsSortingRules == 3 then
  3449. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 100000000000000 + RingSpellID * 1000000 + priorCounter
  3450. elseif getSpellColumn.methodsSortingRules == 4 then
  3451. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 100000000000000 + RingSpellID * 10000 + priorCounter
  3452. elseif getSpellColumn.methodsSortingRules == 5 then
  3453. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 10000000000 + RingSpellID * 10000 + priorCounter
  3454. elseif getSpellColumn.methodsSortingRules == 6 then
  3455. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 10000 + priorCounter
  3456. end
  3457. local secondPrior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000 + (RingSpellID or 0)
  3458.  
  3459. if not h then
  3460. local spellName,_,spellTexture = GetSpellInfo(RingSpellID)
  3461. if module.db.differentIcons[RingSpellID] then
  3462. spellTexture = module.db.differentIcons[RingSpellID]
  3463. end
  3464. _C [#_C + 1] = {
  3465. name = "Legendary DD",
  3466. fullName = "*",
  3467. loweredName = "*",
  3468. icon = spellTexture,
  3469. spellName = spellName or "unk",
  3470. db = spellData,
  3471. lastUse = 0,
  3472. cd = 0,
  3473. duration = 0,
  3474. classColor = module.db.notAClass,
  3475. sort = prior,
  3476. sort2 = secondPrior,
  3477. column = spellColumn,
  3478. specialCheck = LegendaryRingSpecialCheck_DD,
  3479. }
  3480. else
  3481. h.sort = prior
  3482. h.sort2 = secondPrior
  3483. h.column = spellColumn
  3484. end
  3485. module.db.session_gGUIDs["*"] = 1
  3486. end
  3487.  
  3488. local RingSpellID = 187613
  3489. local findRingSpell = ExRT.F.table_find(module.db.spellDB,RingSpellID,1)
  3490. if findRingSpell then
  3491. local spellData = module.db.spellDB[findRingSpell]
  3492. local h = module.db.cdsNav["*"][RingSpellID]
  3493. local prior = 0
  3494. priorCounter = priorCounter + 1
  3495. local spellColumn = VExRT.ExCD2.CDECol[RingSpellID..";1"] or _db.def_col[RingSpellID..";1"] or 1
  3496. local getSpellColumn = _mainFrame.colFrame[spellColumn]
  3497. if not getSpellColumn or getSpellColumn.methodsSortingRules == 1 then
  3498. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 1000000 + priorCounter
  3499. elseif getSpellColumn.methodsSortingRules == 2 then
  3500. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 10000 + priorCounter
  3501. elseif getSpellColumn.methodsSortingRules == 3 then
  3502. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 100000000000000 + RingSpellID * 1000000 + priorCounter
  3503. elseif getSpellColumn.methodsSortingRules == 4 then
  3504. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 100000000000000 + RingSpellID * 10000 + priorCounter
  3505. elseif getSpellColumn.methodsSortingRules == 5 then
  3506. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 10000000000 + RingSpellID * 10000 + priorCounter
  3507. elseif getSpellColumn.methodsSortingRules == 6 then
  3508. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 10000 + priorCounter
  3509. end
  3510. local secondPrior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000 + (RingSpellID or 0)
  3511.  
  3512. if not h then
  3513. local spellName,_,spellTexture = GetSpellInfo(RingSpellID)
  3514. if module.db.differentIcons[RingSpellID] then
  3515. spellTexture = module.db.differentIcons[RingSpellID]
  3516. end
  3517. _C [#_C + 1] = {
  3518. name = "Legendary Tank",
  3519. fullName = "*",
  3520. loweredName = "*",
  3521. icon = spellTexture,
  3522. spellName = spellName or "unk",
  3523. db = spellData,
  3524. lastUse = 0,
  3525. cd = 0,
  3526. duration = 0,
  3527. classColor = module.db.notAClass,
  3528. sort = prior,
  3529. sort2 = secondPrior,
  3530. column = spellColumn,
  3531. specialCheck = LegendaryRingSpecialCheck_Tank,
  3532. }
  3533. else
  3534. h.sort = prior
  3535. h.sort2 = secondPrior
  3536. h.column = spellColumn
  3537. end
  3538. module.db.session_gGUIDs["*"] = 1
  3539. end
  3540.  
  3541. local RingSpellID = 187612
  3542. local findRingSpell = ExRT.F.table_find(module.db.spellDB,RingSpellID,1)
  3543. if findRingSpell then
  3544. local spellData = module.db.spellDB[findRingSpell]
  3545. local h = module.db.cdsNav["*"][RingSpellID]
  3546. local prior = 0
  3547. priorCounter = priorCounter + 1
  3548. local spellColumn = VExRT.ExCD2.CDECol[RingSpellID..";1"] or _db.def_col[RingSpellID..";1"] or 1
  3549. local getSpellColumn = _mainFrame.colFrame[spellColumn]
  3550. if not getSpellColumn or getSpellColumn.methodsSortingRules == 1 then
  3551. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 1000000 + priorCounter
  3552. elseif getSpellColumn.methodsSortingRules == 2 then
  3553. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 10000 + priorCounter
  3554. elseif getSpellColumn.methodsSortingRules == 3 then
  3555. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 100000000000000 + RingSpellID * 1000000 + priorCounter
  3556. elseif getSpellColumn.methodsSortingRules == 4 then
  3557. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 100000000000000 + RingSpellID * 10000 + priorCounter
  3558. elseif getSpellColumn.methodsSortingRules == 5 then
  3559. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 10000000000 + RingSpellID * 10000 + priorCounter
  3560. elseif getSpellColumn.methodsSortingRules == 6 then
  3561. prior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000000000 + RingSpellID * 10000 + priorCounter
  3562. end
  3563. local secondPrior = (VExRT.ExCD2.Priority[RingSpellID] or 15) * 1000000 + (RingSpellID or 0)
  3564.  
  3565. if not h then
  3566. local spellName,_,spellTexture = GetSpellInfo(RingSpellID)
  3567. if module.db.differentIcons[RingSpellID] then
  3568. spellTexture = module.db.differentIcons[RingSpellID]
  3569. end
  3570. _C [#_C + 1] = {
  3571. name = "Legendary Heal",
  3572. fullName = "*",
  3573. loweredName = "*",
  3574. icon = spellTexture,
  3575. spellName = spellName or "unk",
  3576. db = spellData,
  3577. lastUse = 0,
  3578. cd = 0,
  3579. duration = 0,
  3580. classColor = module.db.notAClass,
  3581. sort = prior,
  3582. sort2 = secondPrior,
  3583. column = spellColumn,
  3584. specialCheck = LegendaryRingSpecialCheck_Heal,
  3585. }
  3586. else
  3587. h.sort = prior
  3588. h.sort2 = secondPrior
  3589. h.column = spellColumn
  3590. end
  3591. module.db.session_gGUIDs["*"] = 1
  3592. end
  3593. end
  3594.  
  3595.  
  3596. cdsNav_wipe()
  3597.  
  3598. local pluginFunc = module.db.plugin and type(module.db.plugin.UpdateRoster)=="function" and module.db.plugin.UpdateRoster
  3599.  
  3600. local j = 0
  3601. for i=1,#_C do
  3602. j = j + 1
  3603. local line = _C[j]
  3604. if not line then
  3605. break
  3606. elseif not line.sort then
  3607. tremove(_C,j)
  3608. j = j - 1
  3609. else
  3610. for l=3,7 do
  3611. if line.db[l] then
  3612. cdsNav_set(line.fullName,line.db[l][1],line)
  3613. end
  3614. end
  3615. if pluginFunc then
  3616. pluginFunc(line)
  3617. end
  3618. end
  3619. end
  3620. else
  3621. wipe(_C)
  3622. cdsNav_wipe()
  3623. end
  3624. if module.db.testMode then
  3625. TestMode()
  3626.  
  3627. local offline = status_UnitsToCheck[fastrandom(1,#status_UnitsToCheck)]
  3628. local dead = status_UnitsToCheck[fastrandom(1,#status_UnitsToCheck)]
  3629.  
  3630. status_UnitIsDead[dead] = true
  3631. status_UnitIsDisconnected[offline] = true
  3632.  
  3633. for j=#status_UnitsToCheck,1,-1 do
  3634. if not UnitName(status_UnitsToCheck[j]) then
  3635. tremove(status_UnitsToCheck, j)
  3636. end
  3637. end
  3638. end
  3639. UpdateLegendaryRingState()
  3640. UpdateAllData()
  3641. SortAllData()
  3642. end
  3643.  
  3644. local GetArtifactTraitsKnown
  3645. do
  3646. local function DispellSchedule(data)
  3647. if not module.db.spell_dispellsFix[ data.fullName ] then
  3648. data.cd = 0
  3649. end
  3650. module.db.spell_dispellsFix[ data.fullName ] = nil
  3651. end
  3652. function CLEUstartCD(i)
  3653. local currTime = GetTime()
  3654. local data = nil
  3655. if type(i) == "table" then
  3656. data = i
  3657. else
  3658. data = _C[i]
  3659. end
  3660. local fullName = data.fullName
  3661.  
  3662. local uSpecID = module.db.specInDBase[globalGUIDs[fullName] or 0]
  3663. if not data.db[uSpecID] and not data.db[3] then
  3664. return
  3665. elseif not data.db[uSpecID] then
  3666. uSpecID = 3
  3667. end
  3668. local spellID = data.db[uSpecID][1]
  3669. --WOD Battle Res
  3670. do
  3671. if _db.spell_battleRes[spellID] and _db.isResurectDisabled then
  3672. return
  3673. end
  3674. end
  3675.  
  3676. data.cd = data.db[uSpecID][2]
  3677. data.duration = data.db[uSpecID][3]
  3678.  
  3679. --Talents / Glyphs
  3680. local durationTable = module.db.spell_durationByTalent_fix[spellID]
  3681. if durationTable then
  3682. for j=1,#durationTable,2 do
  3683. if module.db.session_gGUIDs[fullName][ durationTable[j] ] then
  3684. local timeReduce = durationTable[j+1]
  3685. if type(timeReduce) == 'table' then
  3686. local traits = GetArtifactTraitsKnown(fullName,durationTable[j])
  3687. if traits > 0 then
  3688. data.duration = data.duration + timeReduce[traits]
  3689. end
  3690. elseif tonumber(timeReduce) then
  3691. data.duration = data.duration + timeReduce
  3692. else
  3693. local timeFix = tonumber( string.sub( timeReduce, 2 ) )
  3694. data.duration = data.duration * timeFix
  3695. end
  3696. end
  3697. end
  3698. end
  3699. local cdTable = module.db.spell_cdByTalent_fix[spellID]
  3700. if cdTable then
  3701. for j=1,#cdTable,2 do
  3702. if module.db.session_gGUIDs[fullName][ cdTable[j] ] then
  3703. local timeReduce = cdTable[j+1]
  3704. if type(timeReduce) == 'table' then
  3705. local traits = GetArtifactTraitsKnown(fullName,cdTable[j])
  3706. if traits > 0 then
  3707. data.cd = data.cd + timeReduce[traits]
  3708. end
  3709. elseif tonumber(timeReduce) then
  3710. data.cd = data.cd + timeReduce
  3711. else
  3712. local timeFix = tonumber( string.sub( timeReduce, 2 ) )
  3713. data.cd = data.cd * timeFix
  3714. end
  3715. end
  3716. end
  3717. end
  3718. --Charges
  3719. local isCharge = module.db.spell_charge_fix[ data.db[1] ]
  3720. if isCharge and (data.lastUse+data.cd) >= currTime then
  3721. data.charge = (data.charge or data.lastUse) + data.cd
  3722. data.lastUse = currTime
  3723. module.db.session_gGUIDs[fullName] = isCharge
  3724. elseif isCharge and module.db.session_gGUIDs[fullName][isCharge] then
  3725. data.charge = currTime
  3726. data.lastUse = currTime
  3727. else
  3728. data.lastUse = currTime
  3729. end
  3730. --Haste/Readiness
  3731. if module.db.spell_speed_list[spellID] then
  3732. data.duration = data.duration / (1 + (UnitSpellHaste(fullName) or 0) /100)
  3733. end
  3734. if module.db.spell_reduceCdByHaste[spellID] then
  3735. data.cd = data.cd / (1 + (UnitSpellHaste(fullName) or 0) /100)
  3736. end
  3737. --Dispels
  3738. if module.db.spell_dispellsList[spellID] then
  3739. ScheduleTimer(DispellSchedule, 0.5, data)
  3740. end
  3741. -- Fixes
  3742. if data.cd > 45000 then data.cd = 45000 end
  3743. if data.duration > 45000 then data.duration = 45000 end
  3744.  
  3745. if data.bar and data.bar.data == data then
  3746. data.bar:UpdateStatus()
  3747. end
  3748.  
  3749. UpdateAllData()
  3750. SortAllData()
  3751.  
  3752. module.db.historyUsage[#module.db.historyUsage + 1] = {time(),data.db[uSpecID][1],fullName,GetEncounterTime()}
  3753. end
  3754. end
  3755.  
  3756. function module:Enable()
  3757. VExRT.ExCD2.enabled = true
  3758. if not VExRT.ExCD2.SplitOpt then
  3759. module.frame:Show()
  3760. module:ReloadAllSplits()
  3761. else
  3762. module:ReloadAllSplits()
  3763. end
  3764.  
  3765. module.frame.IsEnabled = true
  3766.  
  3767. module:RegisterSlash()
  3768. module:RegisterTimer()
  3769. module:RegisterEvents('SCENARIO_UPDATE','GROUP_ROSTER_UPDATE','COMBAT_LOG_EVENT_UNFILTERED','UNIT_PET','PLAYER_LOGOUT','ZONE_CHANGED_NEW_AREA','CHALLENGE_MODE_RESET','PLAYER_REGEN_DISABLED','PLAYER_REGEN_ENABLED')
  3770.  
  3771. UpdateRoster()
  3772. end
  3773.  
  3774. function module:Disable()
  3775. VExRT.ExCD2.enabled = nil
  3776. if not VExRT.ExCD2.SplitOpt then
  3777. module.frame:Hide()
  3778. else
  3779. for i=1,module.db.maxColumns do
  3780. module.frame.colFrame[i]:Hide()
  3781. end
  3782. end
  3783.  
  3784. module.frame.IsEnabled = false
  3785.  
  3786. module:UnregisterSlash()
  3787. module:UnregisterTimer()
  3788. module:UnregisterEvents('SCENARIO_UPDATE','GROUP_ROSTER_UPDATE','COMBAT_LOG_EVENT_UNFILTERED','UNIT_PET','PLAYER_LOGOUT','ZONE_CHANGED_NEW_AREA','CHALLENGE_MODE_RESET','PLAYER_REGEN_DISABLED','PLAYER_REGEN_ENABLED')
  3789. end
  3790.  
  3791. function module.main:ADDON_LOADED()
  3792. VExRT = _G.VExRT
  3793. VExRT.ExCD2 = VExRT.ExCD2 or {NoRaid = true}
  3794.  
  3795. if VExRT.Addon.Version < 2126 then
  3796. if VExRT.ExCD2.colSet then
  3797. for i=1,module.db.maxColumns+1 do
  3798. if VExRT.ExCD2.colSet[i] and not VExRT.ExCD2.colSet[i].fontOutline then
  3799. VExRT.ExCD2.colSet[i].fontShadow = true
  3800. end
  3801. end
  3802. end
  3803. end
  3804. if VExRT.Addon.Version < 2302 then
  3805. if VExRT.ExCD2.colSet then
  3806. for i=1,module.db.maxColumns+1 do
  3807. if VExRT.ExCD2.colSet[i] then
  3808. VExRT.ExCD2.colSet[i].textGeneral = true
  3809. end
  3810. end
  3811. end
  3812. end
  3813. if VExRT.Addon.Version < 3247 then
  3814. if VExRT.ExCD2.colSet then
  3815. for i=1,module.db.maxColumns+1 do
  3816. if VExRT.ExCD2.colSet[i] then
  3817. VExRT.ExCD2.colSet[i].blacklistGeneral = true
  3818. end
  3819. end
  3820. end
  3821. end
  3822. if VExRT.Addon.Version < 3755 then
  3823. if VExRT.ExCD2.colSet then
  3824. for i=1,module.db.maxColumns+1 do
  3825. if VExRT.ExCD2.colSet[i] then
  3826. VExRT.ExCD2.colSet[i].visibilityGeneral = true
  3827. end
  3828. end
  3829. end
  3830. end
  3831.  
  3832. if VExRT.ExCD2.Left and VExRT.ExCD2.Top then
  3833. module.frame:ClearAllPoints()
  3834. module.frame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT.ExCD2.Left,VExRT.ExCD2.Top)
  3835. end
  3836.  
  3837. VExRT.ExCD2.CDE = VExRT.ExCD2.CDE or {}
  3838. VExRT.ExCD2.CDECol = VExRT.ExCD2.CDECol or {}
  3839. if UnitFactionGroup("player") == "Alliance" then --> BL Faction Fix
  3840. for i,spellData in ipairs(module.db.spellDB) do
  3841. if spellData[1] == 2825 then
  3842. spellData[1] = 32182
  3843. spellData[3][1] = 32182
  3844. break
  3845. end
  3846. end
  3847. end
  3848. VExRT_CDE = VExRT.ExCD2.CDE
  3849.  
  3850. if not VExRT.ExCD2.colSet then
  3851. VExRT.ExCD2.colSet = {}
  3852. for i=1,module.db.maxColumns+1 do
  3853. VExRT.ExCD2.colSet[i] = {}
  3854. for optName,optVal in pairs(module.db.colsInit) do
  3855. VExRT.ExCD2.colSet[i][optName] = optVal
  3856. end
  3857. if i <= 3 then
  3858. VExRT.ExCD2.colSet[i].enabled = true
  3859. end
  3860. end
  3861. end
  3862. for i=1,module.db.maxColumns+1 do
  3863. VExRT.ExCD2.colSet[i] = VExRT.ExCD2.colSet[i] or {}
  3864. end
  3865.  
  3866. VExRT.ExCD2.default_userCD = VExRT.ExCD2.default_userCD or {}
  3867. VExRT.ExCD2.default_userDuration = VExRT.ExCD2.default_userDuration or {}
  3868. do
  3869. for spellID,spellData in pairs(VExRT.ExCD2.default_userCD) do
  3870. for i=1,#module.db.spellDB do
  3871. if module.db.spellDB[i][1] == spellID then
  3872. for j=1,5 do
  3873. if spellData[j] and module.db.spellDB[i][2+j] then
  3874. if spellData[j] == module.db.spellDB[i][2+j][2] then
  3875. spellData[j] = nil
  3876. else
  3877. module.db.spellDB[i][2+j][2] = spellData[j]
  3878. end
  3879. end
  3880. end
  3881. end
  3882. end
  3883. end
  3884.  
  3885. for spellID,spellData in pairs(VExRT.ExCD2.default_userDuration) do
  3886. for i=1,#module.db.spellDB do
  3887. if module.db.spellDB[i][1] == spellID then
  3888. for j=1,5 do
  3889. if spellData[j] and module.db.spellDB[i][2+j] then
  3890. if spellData[j] == module.db.spellDB[i][2+j][3] then
  3891. spellData[j] = nil
  3892. else
  3893. module.db.spellDB[i][2+j][3] = spellData[j]
  3894. end
  3895. end
  3896. end
  3897. end
  3898. end
  3899. end
  3900. end
  3901.  
  3902. VExRT.ExCD2.userDB = VExRT.ExCD2.userDB or {}
  3903. for i=1,#VExRT.ExCD2.userDB do
  3904. module.db.spellDB[i+module.db.dbCountDef] = VExRT.ExCD2.userDB[i]
  3905. end
  3906.  
  3907. VExRT.ExCD2.Priority = VExRT.ExCD2.Priority or {}
  3908.  
  3909. VExRT.ExCD2.gnGUIDs = VExRT.ExCD2.gnGUIDs or {}
  3910. if VExRT.ExCD2.gnGUIDs and ExRT.F.table_len(VExRT.ExCD2.gnGUIDs) > 500 then
  3911. wipe(VExRT.ExCD2.gnGUIDs)
  3912. end
  3913. globalGUIDs = VExRT.ExCD2.gnGUIDs
  3914.  
  3915. if VExRT.ExCD2.lock then
  3916. module.frame.texture:SetColorTexture(0, 0, 0, 0)
  3917. module.frame:EnableMouse(false)
  3918. ExRT.lib.AddShadowComment(module.frame,1)
  3919. else
  3920. module.frame.texture:SetColorTexture(0, 0, 0, 0.3)
  3921. module.frame:EnableMouse(true)
  3922. ExRT.lib.AddShadowComment(module.frame,nil,L.cd2)
  3923. end
  3924.  
  3925. module:SplitExCD2Window()
  3926. --module:ReloadAllSplits()
  3927.  
  3928. VExRT.ExCD2.Save = VExRT.ExCD2.Save or {}
  3929.  
  3930. if not VExRT.ExCD2.enabled then
  3931. if not VExRT.ExCD2.SplitOpt then
  3932. module.frame:Hide()
  3933. else
  3934. for i=1,module.db.maxColumns do
  3935. module.frame.colFrame[i]:Hide()
  3936. end
  3937. end
  3938. else
  3939. module:Enable()
  3940. ScheduleTimer(UpdateRoster,10)
  3941. ScheduleTimer(module.ReloadAllSplits,10)
  3942. module:RegisterEvents('PLAYER_ENTERING_WORLD')
  3943. end
  3944.  
  3945. module.db.playerName = ExRT.SDB.charName
  3946. end
  3947.  
  3948. function module.main:PLAYER_ENTERING_WORLD()
  3949. UpdateRoster()
  3950.  
  3951. module:UnregisterEvents('PLAYER_ENTERING_WORLD')
  3952. end
  3953.  
  3954. function module.main:PLAYER_LOGOUT()
  3955. SaveCDtoVar(true)
  3956. end
  3957.  
  3958. function module.main:SCENARIO_UPDATE()
  3959. AfterCombatResetFunction()
  3960. UpdateAllData()
  3961. SortAllData()
  3962. end
  3963. module.main.CHALLENGE_MODE_RESET = module.main.SCENARIO_UPDATE
  3964.  
  3965. function module.main:PLAYER_REGEN_DISABLED()
  3966. module:toggleCombatVisibility(true,2)
  3967. end
  3968. function module.main:PLAYER_REGEN_ENABLED()
  3969. module:toggleCombatVisibility(false,2)
  3970. end
  3971.  
  3972.  
  3973. do
  3974. local scheduledUpdateRoster = nil
  3975. local function funcScheduledUpdate()
  3976. scheduledUpdateRoster = nil
  3977. UpdateRoster()
  3978. module:updateCombatVisibility()
  3979. end
  3980. function module.main:GROUP_ROSTER_UPDATE()
  3981. if not scheduledUpdateRoster then
  3982. scheduledUpdateRoster = ScheduleTimer(funcScheduledUpdate,2)
  3983. end
  3984. end
  3985. end
  3986.  
  3987. do
  3988. local scheduledUpdateRoster = nil
  3989. local function funcScheduledUpdate()
  3990. scheduledUpdateRoster = nil
  3991. UpdateRoster()
  3992. end
  3993.  
  3994. local scheduledVisibility = nil
  3995. local function funcScheduledVisibility()
  3996. scheduledVisibility = nil
  3997. module:updateCombatVisibility()
  3998. end
  3999.  
  4000. function module.main:ZONE_CHANGED_NEW_AREA()
  4001. if select(2, IsInInstance()) == "arena" then
  4002. AfterCombatResetFunction(true)
  4003. UpdateAllData()
  4004. SortAllData()
  4005. end
  4006. if not scheduledUpdateRoster then
  4007. scheduledVisibility = ScheduleTimer(funcScheduledVisibility,2)
  4008. end
  4009. if not scheduledUpdateRoster then
  4010. scheduledUpdateRoster = ScheduleTimer(funcScheduledUpdate,10)
  4011. end
  4012. end
  4013. end
  4014.  
  4015. function module.main:UNIT_PET(arg)
  4016. local name = UnitCombatlogname(arg)
  4017. if name then
  4018. local forceUpdateAllData = nil
  4019. local petNow = UnitCreatureFamily(arg.."pet")
  4020. if petNow ~= _db.session_Pets[name] then
  4021. _db.session_Pets[name] = UnitCreatureFamily(arg.."pet")
  4022. forceUpdateAllData = true
  4023. end
  4024. if _db.session_Pets[name] then
  4025. _db.session_PetOwner[UnitGUID(arg.."pet")] = name
  4026. end
  4027. if forceUpdateAllData then
  4028. UpdateAllData()
  4029. end
  4030. end
  4031. end
  4032.  
  4033. do
  4034. local eventsView = nil
  4035. --upvaules
  4036. local spell_startCDbyAuraApplied = _db.spell_startCDbyAuraApplied
  4037. local spell_reduceCdByAuraFade = _db.spell_reduceCdByAuraFade
  4038. local spell_aura_list = _db.spell_aura_list
  4039. local spell_startCDbyAuraFade = _db.spell_startCDbyAuraFade
  4040. local spell_startCDbyAuraApplied_fix = _db.spell_startCDbyAuraApplied_fix
  4041. local spell_isPetAbility = _db.spell_isPetAbility
  4042. local spell_isTalent = _db.spell_isTalent
  4043. local spell_resetOtherSpells = _db.spell_resetOtherSpells
  4044. local spell_sharingCD = _db.spell_sharingCD
  4045. local spell_reduceCdCast = _db.spell_reduceCdCast
  4046. local spell_increaseDurationCast = _db.spell_increaseDurationCast
  4047. local spell_runningSameSpell = _db.spell_runningSameSpell
  4048. local spell_dispellsList = _db.spell_dispellsList
  4049.  
  4050. local findspecspells = _db.findspecspells
  4051.  
  4052. local session_gGUIDs = _db.session_gGUIDs
  4053. local session_PetOwner = _db.session_PetOwner
  4054. local CDList = _db.cdsNav
  4055.  
  4056. function module.main:COMBAT_LOG_EVENT_UNFILTERED(_,_,event,_,sourceGUID,sourceName,sourceFlags,_,destGUID,destName,destFlags,_,spellID,_,_,_,_,_,_,_,_,critical)
  4057. --dtime()
  4058. local func = eventsView[event]
  4059. if func then
  4060. func(self,sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID,critical)
  4061. end
  4062. --dtime(ExRT.Debug,'ExCD2',event)
  4063. end
  4064. function module.main:SPELL_AURA_APPLIED(sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID)
  4065. if sourceName then
  4066. local CDspellID = spell_startCDbyAuraApplied[spellID]
  4067. if CDspellID then
  4068. local line = CDList[sourceName][CDspellID]
  4069. if line then
  4070. CLEUstartCD(line)
  4071. end
  4072. end
  4073. end
  4074. end
  4075. function module.main:SPELL_AURA_REMOVED(sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID)
  4076. if not sourceName then
  4077. return
  4078. end
  4079. local forceSortAllData = false
  4080.  
  4081. local modifData = spell_reduceCdByAuraFade[spellID]
  4082. if modifData then
  4083. local CDspellID = modifData[1]
  4084. if type(CDspellID) ~= "table" then
  4085. local line = CDList[sourceName][CDspellID]
  4086. if line and (GetTime() - line.lastUse - line.duration) > -0.5 then
  4087. line.cd = line.cd + modifData[2]
  4088. if line.bar and line.bar.data == line then
  4089. line.bar:UpdateStatus()
  4090. end
  4091. forceSortAllData = true
  4092. end
  4093. else
  4094. if session_gGUIDs[sourceName][ CDspellID[2] ] then
  4095. local line = CDList[sourceName][ CDspellID[1] ]
  4096. if line and (GetTime() - line.lastUse - line.duration) > -0.5 then
  4097. line.cd = line.cd + modifData[2]
  4098. if line.bar and line.bar.data == line then
  4099. line.bar:UpdateStatus()
  4100. end
  4101. forceSortAllData = true
  4102. end
  4103. end
  4104. end
  4105. end
  4106.  
  4107. local CDspellID = spell_aura_list[spellID]
  4108. if CDspellID then
  4109. local line = CDList[sourceName][ CDspellID ]
  4110. if line then
  4111. line.duration = 0
  4112. if line.bar and line.bar.data == line then
  4113. line.bar:UpdateStatus()
  4114. end
  4115. forceSortAllData = true
  4116. end
  4117. end
  4118.  
  4119. if spell_startCDbyAuraFade[spellID] then
  4120. local line = CDList[sourceName][spellID]
  4121. if line then
  4122. CLEUstartCD(line)
  4123. end
  4124. end
  4125.  
  4126. if spellID == 195181 then
  4127. local line = CDList[sourceName][221699]
  4128. if line then
  4129. line.lastUse = line.lastUse - 1
  4130. if line.charge then
  4131. line.charge = line.charge - 1
  4132. end
  4133. if line.bar and line.bar.data == line then
  4134. line.bar:UpdateStatus()
  4135. end
  4136. UpdateAllData()
  4137. SortAllData()
  4138. end
  4139. elseif spellID == 206005 then --Xavius: Dream Simulacrum
  4140. for i=1,#_C do
  4141. local unitSpellData = _C[i]
  4142. if unitSpellData.fullName == destName then
  4143. unitSpellData.cd = 0
  4144. unitSpellData.duration = 0
  4145.  
  4146. if unitSpellData.bar and unitSpellData.bar.data == unitSpellData then
  4147. unitSpellData.bar:UpdateStatus()
  4148. end
  4149. end
  4150. end
  4151. end
  4152.  
  4153. if forceSortAllData then
  4154. SortAllData()
  4155. end
  4156. end
  4157. function module.main:SPELL_AURA_REMOVED_DOSE(sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID)
  4158. if not sourceName then
  4159. return
  4160. end
  4161. if spellID == 195181 then
  4162. local line = CDList[sourceName][221699]
  4163. if line then
  4164. line.lastUse = line.lastUse - 1
  4165. if line.charge then
  4166. line.charge = line.charge - 1
  4167. end
  4168. if line.bar and line.bar.data == line then
  4169. line.bar:UpdateStatus()
  4170. end
  4171. UpdateAllData()
  4172. SortAllData()
  4173. end
  4174. end
  4175. end
  4176. function module.main:SPELL_CAST_SUCCESS(sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID)
  4177. if not sourceName then
  4178. return
  4179. end
  4180. local forceSortAllData,forceUpdateAllData = nil
  4181.  
  4182. if spell_isPetAbility[spellID] then
  4183. sourceName = session_PetOwner[sourceGUID] or sourceName
  4184. end
  4185.  
  4186. if spellID == 187614 or spellID == 187615 or spellID == 187611 or spellID == 187613 or spellID == 187612 then
  4187. if not UnitName(sourceName) then --Not in Raid or Party
  4188. return
  4189. end
  4190. if not session_gGUIDs[sourceName][spellID] then
  4191. session_gGUIDs[sourceName] = spellID
  4192. UpdateLegendaryRingState()
  4193. end
  4194. sourceName = "*"
  4195. end
  4196.  
  4197. local findSpecSpell = findspecspells[spellID]
  4198. if findSpecSpell and (GetUnitInfoByUnitFlag(sourceFlags,4) % 8) > 0 then
  4199. if globalGUIDs[sourceName] ~= findSpecSpell then
  4200. forceUpdateAllData = true
  4201. end
  4202. globalGUIDs[sourceName] = findSpecSpell
  4203. end
  4204.  
  4205. if spell_startCDbyAuraFade[spellID] or spell_startCDbyAuraApplied_fix[spellID] then
  4206. if forceUpdateAllData then UpdateAllData() end
  4207. return
  4208. end
  4209.  
  4210. local line = CDList[sourceName][spellID]
  4211. if line then
  4212. CLEUstartCD(line)
  4213. end
  4214.  
  4215. if spell_isTalent[spellID] then
  4216. if not session_gGUIDs[sourceName][spellID] then
  4217. forceUpdateAllData = true
  4218. end
  4219. session_gGUIDs[sourceName] = spellID
  4220. end
  4221.  
  4222. local modifData = spell_resetOtherSpells[spellID]
  4223. if modifData then
  4224. for i=1,#modifData do
  4225. local resetSpellID = modifData[i]
  4226. if type(resetSpellID)~='table' or session_gGUIDs[sourceName][ resetSpellID[2] ] then
  4227. resetSpellID = type(resetSpellID)=='table' and resetSpellID[1] or resetSpellID
  4228. local line = CDList[sourceName][ resetSpellID ]
  4229. if line then
  4230. line.cd = 0
  4231. if line.bar and line.bar.data == line then
  4232. line.bar:UpdateStatus()
  4233. end
  4234. forceUpdateAllData = true
  4235. forceSortAllData = true
  4236. end
  4237. end
  4238. end
  4239. end
  4240.  
  4241. local modifData = spell_sharingCD[spellID]
  4242. if modifData then
  4243. local nowTime = GetTime()
  4244. for sharingSpellID,timeCD in pairs(modifData) do
  4245. local line = CDList[sourceName][sharingSpellID]
  4246. if line then
  4247. local cd_timer_now = line.lastUse + line.cd - nowTime
  4248. if (cd_timer_now > 0 and cd_timer_now < timeCD) or (nowTime - line.lastUse) > line.cd then
  4249. line.cd = timeCD
  4250. line.lastUse = nowTime
  4251. line.duration = 0
  4252. if line.bar and line.bar.data == line then
  4253. line.bar:UpdateStatus()
  4254. end
  4255. forceUpdateAllData = true
  4256. forceSortAllData = true
  4257. end
  4258. end
  4259. end
  4260. end
  4261.  
  4262. local modifData = spell_reduceCdCast[spellID]
  4263. if modifData then
  4264. for i=1,#modifData,2 do
  4265. local reduceSpellID = modifData[i]
  4266. if type(reduceSpellID) ~= "table" then
  4267. local line = CDList[sourceName][reduceSpellID]
  4268. if line then
  4269. line.cd = line.cd + modifData[i+1]
  4270. if line.cd < 0 then
  4271. line.cd = 0
  4272. end
  4273. if line.bar and line.bar.data == line then
  4274. line.bar:UpdateStatus()
  4275. end
  4276. forceUpdateAllData = true
  4277. forceSortAllData = true
  4278. end
  4279. else
  4280. local specReduceCD = reduceSpellID[3]
  4281. local effectOnlyDuringBuffActive = reduceSpellID[4]
  4282. if session_gGUIDs[sourceName][ reduceSpellID[2] ] and (not specReduceCD or (specReduceCD < 0 and globalGUIDs[sourceName] ~= specReduceCD or globalGUIDs[sourceName] == specReduceCD)) and (not effectOnlyDuringBuffActive or UnitAura(sourceName,GetSpellInfo(effectOnlyDuringBuffActive),nil,"HELPFUL")) then
  4283. local line = CDList[sourceName][ reduceSpellID[1] ]
  4284. if line then
  4285. line.cd = line.cd + modifData[i+1]
  4286. if line.cd < 0 then
  4287. line.cd = 0
  4288. end
  4289. if line.bar and line.bar.data == line then
  4290. line.bar:UpdateStatus()
  4291. end
  4292. forceUpdateAllData = true
  4293. forceSortAllData = true
  4294. end
  4295. end
  4296. end
  4297. end
  4298. end
  4299.  
  4300. local modifData = spell_increaseDurationCast[spellID]
  4301. if modifData then
  4302. for i=1,#modifData,2 do
  4303. local increaseSpellID = modifData[i]
  4304. if type(increaseSpellID) ~= "table" then
  4305. local line = CDList[sourceName][increaseSpellID]
  4306. if line and (GetTime() - line.lastUse) < line.duration then
  4307. line.duration = line.duration + modifData[i+1]
  4308. if line.duration < 0 then
  4309. line.duration = 0
  4310. end
  4311. if line.bar and line.bar.data == line then
  4312. line.bar:UpdateStatus()
  4313. end
  4314. forceUpdateAllData = true
  4315. forceSortAllData = true
  4316. end
  4317. else
  4318. if session_gGUIDs[sourceName][ increaseSpellID[2] ] then
  4319. local line = CDList[sourceName][ increaseSpellID[1] ]
  4320. if line and (GetTime() - line.lastUse) < line.duration then
  4321. line.duration = line.duration + modifData[i+1]
  4322. if line.duration < 0 then
  4323. line.duration = 0
  4324. end
  4325. if line.bar and line.bar.data == line then
  4326. line.bar:UpdateStatus()
  4327. end
  4328. forceUpdateAllData = true
  4329. forceSortAllData = true
  4330. end
  4331. end
  4332. end
  4333. end
  4334. end
  4335.  
  4336. local modifData = spell_runningSameSpell[spellID]
  4337. if modifData then
  4338. for i=1,#modifData do
  4339. local sameSpellID = modifData[i]
  4340. if sameSpellID ~= spellID then
  4341. local line = CDList[sourceName][ sameSpellID ]
  4342. if line then
  4343. CLEUstartCD(line)
  4344. end
  4345. end
  4346. end
  4347. end
  4348.  
  4349. if forceUpdateAllData then
  4350. UpdateAllData()
  4351. end
  4352. if forceSortAllData then
  4353. SortAllData()
  4354. end
  4355. end
  4356. function module.main:SPELL_DISPEL(sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID)
  4357. if spell_dispellsList[spellID] and sourceName then
  4358. _db.spell_dispellsFix[ sourceName ] = true
  4359. end
  4360. end
  4361.  
  4362. local spellDamage_trackedSpells = {
  4363. [46968] = true,
  4364. [100130] = true,
  4365. [11366] = true,
  4366. [133] = true,
  4367. [108853] = true,
  4368. [222024] = true,
  4369. [66198] = true,
  4370. [222026] = true,
  4371. [66196] = true,
  4372. [31935] = true,
  4373. [6343] = true,
  4374. [116] = true,
  4375. [115181] = true,
  4376. [198013] = true,
  4377. [178740] = true,
  4378. }
  4379. local spellDamage_trackedSpells_Register = {
  4380. [46968] = true,
  4381. [100130] = true,
  4382. [190319] = true,
  4383. [51271] = true,
  4384. [86659] = true,
  4385. [1160] = true,
  4386. [12472] = true,
  4387. [115203] = true,
  4388. [198013] = true,
  4389. [204021] = true,
  4390. }
  4391. local spell46968_var = {}
  4392. local spell115181_var = {0,0}
  4393. function module.main:SPELL_DAMAGE(sourceGUID,sourceName,sourceFlags,destGUID,destName,destFlags,spellID,critical)
  4394. if not spellDamage_trackedSpells[spellID] or not sourceName then
  4395. return
  4396. elseif spellID == 100130 and critical and session_gGUIDs[sourceName][185799] then
  4397. local line = CDList[sourceName][1719]
  4398. if line then
  4399. line.cd = line.cd - 10
  4400. if line.cd < 0 then
  4401. line.cd = 0
  4402. end
  4403. if line.bar and line.bar.data == line then
  4404. line.bar:UpdateStatus()
  4405. end
  4406. UpdateAllData()
  4407. SortAllData()
  4408. end
  4409. elseif spellID == 46968 then
  4410. local sourceData = spell46968_var[sourceName]
  4411. if not sourceData then
  4412. sourceData = {0,0}
  4413. spell46968_var[sourceName] = sourceData
  4414. end
  4415. local t=GetTime()
  4416. if (t - sourceData[1]) > 2 then
  4417. sourceData[1] = t
  4418. sourceData[2] = 0
  4419. end
  4420. sourceData[2] = sourceData[2] + 1
  4421. if sourceData[2] == 3 then
  4422. local line = CDList[sourceName][46968]
  4423. if line then
  4424. line.cd = line.cd - 20
  4425. if line.cd < 0 then
  4426. line.cd = 0
  4427. end
  4428. if line.bar and line.bar.data == line then
  4429. line.bar:UpdateStatus()
  4430. end
  4431. UpdateAllData()
  4432. SortAllData()
  4433. end
  4434. end
  4435. elseif (spellID == 11366 or spellID == 133 or spellID == 108853) and critical and session_gGUIDs[sourceName][155148] then
  4436. local line = CDList[sourceName][190319]
  4437. if line then
  4438. line.cd = line.cd - 1
  4439. if line.cd < 0 then
  4440. line.cd = 0
  4441. end
  4442. if line.bar and line.bar.data == line then
  4443. line.bar:UpdateStatus()
  4444. end
  4445. UpdateAllData()
  4446. SortAllData()
  4447. end
  4448. elseif (spellID == 222024 or spellID == 66198 or spellID == 222026 or spellID == 66196) and critical and session_gGUIDs[sourceName][207126] then
  4449. local line = CDList[sourceName][51271]
  4450. if line then
  4451. line.cd = line.cd - 1
  4452. if line.cd < 0 then
  4453. line.cd = 0
  4454. end
  4455. if line.bar and line.bar.data == line then
  4456. line.bar:UpdateStatus()
  4457. end
  4458. UpdateAllData()
  4459. SortAllData()
  4460. end
  4461. elseif spellID == 31935 and session_gGUIDs[sourceName][207628] then
  4462. local line = CDList[sourceName][86659]
  4463. if line then
  4464. line.cd = line.cd - 3
  4465. if line.cd < 0 then
  4466. line.cd = 0
  4467. end
  4468. if line.bar and line.bar.data == line then
  4469. line.bar:UpdateStatus()
  4470. end
  4471. UpdateAllData()
  4472. SortAllData()
  4473. end
  4474. elseif spellID == 6343 and session_gGUIDs[sourceName][215176] then
  4475. local line = CDList[sourceName][1160]
  4476. if line then
  4477. line.cd = line.cd - 1
  4478. if line.cd < 0 then
  4479. line.cd = 0
  4480. end
  4481. if line.bar and line.bar.data == line then
  4482. line.bar:UpdateStatus()
  4483. end
  4484. UpdateAllData()
  4485. SortAllData()
  4486. end
  4487. elseif spellID == 116 and critical and session_gGUIDs[sourceName][195345] then
  4488. local traits = GetArtifactTraitsKnown(sourceName, 195345)
  4489. if traits > 0 then
  4490. local line = CDList[sourceName][12472]
  4491. if line then
  4492. line.cd = line.cd - (traits * 0.5)
  4493. if line.cd < 0 then
  4494. line.cd = 0
  4495. end
  4496. if line.bar and line.bar.data == line then
  4497. line.bar:UpdateStatus()
  4498. end
  4499. UpdateAllData()
  4500. SortAllData()
  4501. end
  4502. end
  4503. elseif spellID == 115181 and session_gGUIDs[sourceName][224489] then
  4504. local line = CDList[sourceName][115203]
  4505. if line then
  4506. local t = GetTime()
  4507. if (t - spell115181_var[2]) > 1.5 then
  4508. spell115181_var[1] = 0
  4509. spell115181_var[2] = t
  4510. end
  4511. spell115181_var[1] = spell115181_var[1] + 1
  4512. if spell115181_var[1] > 4 then
  4513. return
  4514. end
  4515.  
  4516. line.cd = line.cd - 1
  4517. if line.cd < 0 then
  4518. line.cd = 0
  4519. end
  4520. if line.bar and line.bar.data == line then
  4521. line.bar:UpdateStatus()
  4522. end
  4523. UpdateAllData()
  4524. SortAllData()
  4525. end
  4526. elseif spellID == 198013 and critical and session_gGUIDs[sourceName][215149] then
  4527. local line = CDList[sourceName][198013]
  4528. if line then
  4529. line.cd = line.cd - 0.1
  4530. if line.cd < 0 then
  4531. line.cd = 0
  4532. end
  4533. if line.bar and line.bar.data == line then
  4534. line.bar:UpdateStatus()
  4535. end
  4536. UpdateAllData()
  4537. SortAllData()
  4538. end
  4539. elseif spellID == 178740 and session_gGUIDs[sourceName][210970] then
  4540. local line = CDList[sourceName][204021]
  4541. if line then
  4542. line.cd = line.cd - 2
  4543. if line.cd < 0 then
  4544. line.cd = 0
  4545. end
  4546. if line.bar and line.bar.data == line then
  4547. line.bar:UpdateStatus()
  4548. end
  4549. UpdateAllData()
  4550. SortAllData()
  4551. end
  4552. end
  4553. end
  4554.  
  4555.  
  4556. eventsView = {
  4557. SPELL_AURA_REMOVED=module.main.SPELL_AURA_REMOVED,
  4558. SPELL_AURA_REMOVED_DOSE=module.main.SPELL_AURA_REMOVED_DOSE,
  4559. SPELL_AURA_APPLIED=module.main.SPELL_AURA_APPLIED,
  4560. SPELL_CAST_SUCCESS=module.main.SPELL_CAST_SUCCESS,
  4561. SPELL_DISPEL=module.main.SPELL_DISPEL,
  4562. --SPELL_DAMAGE=module.main.SPELL_DAMAGE,
  4563. }
  4564.  
  4565. local isSpellDamageAdded = nil
  4566. function module:AddCLEUSpellDamage(spellID)
  4567. if isSpellDamageAdded or not spellDamage_trackedSpells_Register[spellID] then
  4568. return
  4569. end
  4570. eventsView.SPELL_DAMAGE = module.main.SPELL_DAMAGE
  4571. isSpellDamageAdded = true
  4572. end
  4573. end
  4574.  
  4575. function module.options:Load()
  4576. self:CreateTilte()
  4577.  
  4578. loadstring(module.db.AllClassSpellsInText)()
  4579. module.db.AllClassSpellsInText = nil
  4580.  
  4581. local SPELL_LINE_HEIGHT = 32
  4582. local SPELL_PER_PAGE = 17
  4583. local SPELL_PAGE_HEIGHT = 528
  4584.  
  4585. self.decorationLine = CreateFrame("Frame",nil,self)
  4586. self.decorationLine.texture = self.decorationLine:CreateTexture(nil, "BACKGROUND", nil, -5)
  4587. self.decorationLine:SetPoint("TOPLEFT",self,-8,-25)
  4588. self.decorationLine:SetPoint("BOTTOMRIGHT",self,"TOPRIGHT",8,-45)
  4589. self.decorationLine.texture:SetAllPoints()
  4590. self.decorationLine.texture:SetColorTexture(1,1,1,1)
  4591. self.decorationLine.texture:SetGradientAlpha("VERTICAL",.24,.25,.30,1,.27,.28,.33,1)
  4592.  
  4593. self.chkEnable = ELib:Check(self,L.senable,VExRT.ExCD2.enabled):Point(560,-26):Size(18,18):OnClick(function(self)
  4594. if self:GetChecked() then
  4595. module:Enable()
  4596. else
  4597. module:Disable()
  4598. end
  4599. end)
  4600.  
  4601. self.chkLock = ELib:Check(self,L.cd2fix,VExRT.ExCD2.lock):Point(430,-26):Size(18,18):OnClick(function(self)
  4602. if self:GetChecked() then
  4603. VExRT.ExCD2.lock = true
  4604. ExRT.F.LockMove(module.frame,nil,module.frame.texture)
  4605. ExRT.lib.AddShadowComment(module.frame,1)
  4606. if VExRT.ExCD2.SplitOpt then
  4607. for i=1,module.db.maxColumns do
  4608. ExRT.F.LockMove(module.frame.colFrame[i],nil,module.frame.colFrame[i].lockTexture)
  4609. ExRT.lib.AddShadowComment(module.frame.colFrame[i],1)
  4610. end
  4611. end
  4612. else
  4613. VExRT.ExCD2.lock = nil
  4614. ExRT.F.LockMove(module.frame,true,module.frame.texture)
  4615. ExRT.lib.AddShadowComment(module.frame,nil,L.cd2)
  4616. if VExRT.ExCD2.SplitOpt then
  4617. for i=1,module.db.maxColumns do
  4618. ExRT.F.LockMove(module.frame.colFrame[i],true,module.frame.colFrame[i].lockTexture)
  4619. ExRT.lib.AddShadowComment(module.frame.colFrame[i],nil,L.cd2,i,72,"OUTLINE")
  4620. end
  4621. end
  4622. end
  4623. end)
  4624.  
  4625. self.tab = ELib:Tabs(self,0,L.cd2Spells,L.cd2Appearance,L.cd2History):Point(0,-45):Size(660,570):SetTo(1)
  4626. self.tab:SetBackdropBorderColor(0,0,0,0)
  4627. self.tab:SetBackdropColor(0,0,0,0)
  4628.  
  4629. local function fastSetupFrameListClick(self,spellsList)
  4630. for k=1,#spellsList do
  4631. local bool = nil
  4632. for j=1,#module.db.spellDB do
  4633. if module.db.spellDB[j][1] == spellsList[k] then
  4634. bool = true
  4635. break
  4636. end
  4637. end
  4638. if not bool then
  4639. for class,classData in pairs(module.db.allClassSpells) do
  4640. for j=1,#classData do
  4641. if classData[j][1] == spellsList[k] then
  4642. module.options:addNewSpell(class,classData[j],true)
  4643. bool = true
  4644. break
  4645. end
  4646. end
  4647. if bool then
  4648. break
  4649. end
  4650. end
  4651. end
  4652. end
  4653. for j=1,#spellsList do
  4654. VExRT.ExCD2.CDE[ spellsList[j] ] = true
  4655. end
  4656. UpdateRoster()
  4657. module.options:ReloadSpellsPage()
  4658. ELib:DropDownClose()
  4659. end
  4660. local function fastSetupFrameListEnter(self,tooltip)
  4661. ELib.Tooltip.Show(self,"ANCHOR_LEFT",unpack(tooltip))
  4662. end
  4663. local function fastSetupFrameListLeave(self)
  4664. ELib.Tooltip:Hide()
  4665. end
  4666. local function fastSetupFrameListClick2(self)
  4667. local list = {
  4668. {L.cd2fastSetupTitle1,{31821,204150,62618,98008,97462,31842,64843,108280,740,115310,196718,207399}}, --Raid Save
  4669. {L.cd2fastSetupTitle2,{102342,47788,33206,6940,633,116849,207810,1022,204018}}, --Direct Save
  4670. {L.cd2fastSetupTitle3,{20484,20707,61999,20608,161642}}, --Battle Res
  4671. {L.cd2fastSetupTitle4,{6552,96231,147362,1766,15487,47528,47476,57994,2139,116705,106839,19647,91802,115781,78675,183752,}}, --Kicks
  4672. {L.cd2fastSetupTitle5,{114192,355,62124,56222,49576,115546,6795,185245,}}, --Taunts
  4673. {L.cd2fastSetupTitle6,{4987,32375,527,51886,115450,2782,475,115276,89808}}, --Dispels
  4674. }
  4675. for i=1,#list do
  4676. local tooltip = {list[i][1]..":"}
  4677. for j=1,#list[i][2] do
  4678. local spellName,_,spellTexture = GetSpellInfo(list[i][2][j])
  4679. if spellName then
  4680. tooltip[#tooltip + 1] = "|T"..spellTexture..":0|t |cffffffff"..spellName.."|r"
  4681. end
  4682. end
  4683. self.List[i] = {
  4684. text = list[i][1],
  4685. arg1 = list[i][2],
  4686. func = fastSetupFrameListClick,
  4687. hoverFunc = fastSetupFrameListEnter,
  4688. leaveFunc = fastSetupFrameListLeave,
  4689. hoverArg = tooltip,
  4690. justifyH = "CENTER",
  4691. }
  4692. end
  4693. self.OnClick = nil
  4694. end
  4695. self.fastSetupFrame = ELib:ListButton(self.tab.tabs[1],L.cd2fastSetupTitle..":",200,6):Size(18,18):Point("TOPRIGHT",-15,-9):Left():OnClick(fastSetupFrameListClick2)
  4696. self.fastSetupFrame.text:FontSize(11):Color(GameFontNormal:GetTextColor())
  4697.  
  4698. self.borderList = CreateFrame("Frame",nil,self.tab.tabs[1])
  4699. self.borderList:SetSize(650,SPELL_PAGE_HEIGHT)
  4700. self.borderList:SetPoint("TOP", 0, -38)
  4701. ELib:Border(self.borderList,2,.24,.25,.30,1)
  4702.  
  4703. local function SyncUserDB()
  4704. table.wipe(VExRT.ExCD2.userDB)
  4705. local j = 1
  4706. for i=module.db.dbCountDef+1,#module.db.spellDB do
  4707. VExRT.ExCD2.userDB[j] = module.db.spellDB[i]
  4708. j = j + 1
  4709. end
  4710. end
  4711.  
  4712. local function CheckToNil(self)
  4713. self.chk:SetChecked(nil)
  4714. VExRT.ExCD2.CDE[self.sid] = nil
  4715. UpdateRoster()
  4716. end
  4717.  
  4718. function module.options:ReloadSpellsPage()
  4719. local page = module.options
  4720. local scrollBarValue = page.ScrollBar:GetValue()
  4721. page.spellsListScrollFrame:SetVerticalScroll(scrollBarValue % SPELL_LINE_HEIGHT)
  4722.  
  4723. local pos = floor(scrollBarValue / SPELL_LINE_HEIGHT) + 1
  4724. page.butSpellsAdd:Hide()
  4725. page.butSpellsFrame:Hide()
  4726. local lineNum,lastLine = 0
  4727. for i=pos,pos+SPELL_PER_PAGE+1 do
  4728. lineNum = lineNum + 1
  4729. if not module.db.spellDB[i] then
  4730. for j=lineNum,#page.spellsList do
  4731. page.spellsList[j]:Hide()
  4732. end
  4733. page.butSpellsAdd:ClearAllPoints()
  4734. page.butSpellsAdd:SetPoint("TOPLEFT",lastLine,"BOTTOMLEFT",5,-5)
  4735. page.butSpellsAdd:Show()
  4736. page.butSpellsFrame:ClearAllPoints()
  4737. page.butSpellsFrame:SetPoint("TOPLEFT",lastLine,"BOTTOMLEFT",317,-5)
  4738. page.butSpellsFrame:Show()
  4739. break
  4740. end
  4741. local spellData = module.db.spellDB[i]
  4742. local SpellID = spellData[1]
  4743. local line = module.options.spellsList[lineNum]
  4744. lastLine = line
  4745.  
  4746. line.chk:SetChecked(VExRT.ExCD2.CDE[SpellID])
  4747. local SpellName,_,SpellTexture = GetSpellInfo(SpellID)
  4748. if module.db.differentIcons[ SpellID ] then
  4749. SpellTexture = module.db.differentIcons[SpellID]
  4750. end
  4751. if SpellID == 187614 then SpellName = "Legendary DD" end
  4752. if SpellID == 187612 then SpellName = "Legendary Heal" end
  4753. if SpellID == 187613 then SpellName = "Legendary Tank" end
  4754.  
  4755. line.sid = SpellID
  4756. line.tid = i
  4757. line.icon:SetTexture(SpellTexture or "Interface\\Icons\\INV_MISC_QUESTIONMARK")
  4758. line.spellName:SetFormattedText("|cffffffff|Hspell:%d|h%s|h|r",SpellID, SpellName or "?")
  4759. line.class:SetText(L.classLocalizate[ spellData[2] ] or "?")
  4760. local cR,cG,cB = ExRT.F.classColorNum(spellData[2])
  4761. line.class:SetTextColor(cR,cG,cB,1)
  4762.  
  4763. line.backClassColorR = cR
  4764. line.backClassColorG = cG
  4765. line.backClassColorB = cB
  4766.  
  4767. if not SpellName and spellData.user then
  4768. line.chk:Disable()
  4769. line.chk:SetAlpha(0.5)
  4770. else
  4771. line.chk:Enable()
  4772. line.chk:SetAlpha(1)
  4773. end
  4774.  
  4775. line:Show()
  4776.  
  4777. ExRT.lib.ShowOrHide(line.tooltipFrame,not spellData.user)
  4778. ExRT.lib.ShowOrHide(line.spellName,not spellData.user)
  4779. ExRT.lib.ShowOrHide(line.class,not spellData.user)
  4780. ExRT.lib.ShowOrHide(line.userSpellName,spellData.user)
  4781. ExRT.lib.ShowOrHide(line.userClass,spellData.user)
  4782. ExRT.lib.ShowOrHide(line.userRemove,spellData.user)
  4783.  
  4784. line.dropDownPriority:SetText(format("%d",VExRT.ExCD2.Priority[SpellID] or 15))
  4785.  
  4786. if spellData.user then
  4787. line.userSpellName:SetText(SpellID or "")
  4788.  
  4789. line.userClass:SetText("|c"..ExRT.F.classColor(spellData[2])..L.classLocalizate[ spellData[2] ])
  4790.  
  4791. line.isUserSpell = true
  4792. else
  4793. line.isUserSpell = nil
  4794. end
  4795.  
  4796. if SpellID == 161642 then
  4797. line.additionalTooltip = L.cd2ResurrectTooltip
  4798. else
  4799. line.additionalTooltip = nil
  4800. end
  4801. end
  4802. GameTooltip_Hide()
  4803. ELib.Tooltip:HideAdd()
  4804. page.ScrollBar:UpdateButtons()
  4805. end
  4806.  
  4807. self.ScrollBar = ELib:ScrollBar(self.borderList):Size(16,0):Point("TOPRIGHT",-3,-3):Point("BOTTOMRIGHT",-3,3):ClickRange(32):Range(0,20):SetTo(0):OnChange(module.options.ReloadSpellsPage)
  4808.  
  4809. function self.ScrollBar:UpdateRange()
  4810. self:SetMinMaxValues(0,max((#module.db.spellDB+1)*SPELL_LINE_HEIGHT-SPELL_PAGE_HEIGHT,0))
  4811. end
  4812.  
  4813. self:SetScript("OnMouseWheel", function(self, delta)
  4814. delta = -delta
  4815. local current = module.options.ScrollBar:GetValue()
  4816. local min_,max_ = module.options.ScrollBar:GetMinMaxValues()
  4817. current = current + (delta * SPELL_LINE_HEIGHT)
  4818. if current > max_ then
  4819. current = max_
  4820. elseif current < min_ then
  4821. current = min_
  4822. end
  4823. module.options.ScrollBar:SetValue(current)
  4824. end)
  4825.  
  4826. local function SpellsListChkOnClick(self)
  4827. if self:GetChecked() then
  4828. VExRT.ExCD2.CDE[self:GetParent().sid] = true
  4829. else
  4830. VExRT.ExCD2.CDE[self:GetParent().sid] = nil
  4831. end
  4832. UpdateRoster()
  4833. end
  4834. local function SpellsListOnUpdate(self)
  4835. if MouseIsOver(self) and not ExRT.lib.ScrollDropDown.DropDownList[1]:IsShown() and not module.options.spellsModifyFrame:IsShown() then
  4836. self.backClassColor:SetGradientAlpha("HORIZONTAL", self.backClassColorR, self.backClassColorG, self.backClassColorB, 0.8, self.backClassColorR, self.backClassColorG, self.backClassColorB, 0)
  4837. else
  4838. self.backClassColor:SetGradientAlpha("HORIZONTAL", self.backClassColorR, self.backClassColorG, self.backClassColorB, 0.4, self.backClassColorR, self.backClassColorG, self.backClassColorB, 0)
  4839. end
  4840. end
  4841. local function SpellsListTooltipFrameOnEnter(self)
  4842. ELib.Tooltip.Link(self,self:GetParent().spellName:GetText())
  4843. if self:GetParent().additionalTooltip then
  4844. ELib.Tooltip:Add(nil,{self:GetParent().additionalTooltip})
  4845. end
  4846. end
  4847. local function SpellsListTooltipFrameOnLeave()
  4848. GameTooltip_Hide()
  4849. ELib.Tooltip:HideAdd()
  4850. end
  4851. local SpellsListDropDownPriorityDataList = {}
  4852. local function SpellsListDropDownPrioritySelectFunc(self,arg)
  4853. local list = self:GetParent().parent
  4854. list:SetText(arg)
  4855. VExRT.ExCD2.Priority[list:GetParent().sid] = arg
  4856. ELib:DropDownClose()
  4857. UpdateRoster()
  4858. end
  4859. for i=1,30 do
  4860. SpellsListDropDownPriorityDataList[i] = {text=i,justifyH="CENTER",arg1=i,func=SpellsListDropDownPrioritySelectFunc}
  4861. end
  4862. local function SpellsListDropDownPriorityOnEnter(self)
  4863. ELib.Tooltip.Show(self,"ANCHOR_LEFT",L.cd2Priority,{L.cd2PriorityTooltip,1,1,1,true})
  4864. end
  4865. local function SpellsListButtonModifyOnClick(self)
  4866. local spellsModifyFrame = module.options.spellsModifyFrame
  4867. spellsModifyFrame:Hide()
  4868. local parent = self:GetParent()
  4869. spellsModifyFrame.sid = parent.sid
  4870. spellsModifyFrame.tid = parent.tid
  4871. spellsModifyFrame.class = module.db.spellDB[parent.tid][2]
  4872. spellsModifyFrame:ShowClick("TOPRIGHT")
  4873. end
  4874. local function SpellsListUserSpellNameOnTextChanged(self,isUser)
  4875. if not isUser then
  4876. return
  4877. end
  4878. local tmp = nil
  4879. local spellID = tonumber(self:GetText())
  4880. local parentLine = self:GetParent()
  4881. if spellID then
  4882. for j=1,#module.db.spellDB do
  4883. if module.db.spellDB[j][1] == spellID and j ~= parentLine.tid then
  4884. parentLine.chk:Disable()
  4885. parentLine.chk:SetAlpha(0.5)
  4886. return
  4887. end
  4888. end
  4889. end
  4890.  
  4891. CheckToNil(parentLine)
  4892. if not spellID then
  4893. parentLine.chk:Disable()
  4894. parentLine.chk:SetAlpha(0.5)
  4895. return
  4896. end
  4897. local spellName,_,spellTexture = GetSpellInfo(spellID)
  4898. parentLine.sid = spellID
  4899. parentLine.icon:SetTexture(spellTexture or "Interface\\Icons\\INV_MISC_QUESTIONMARK")
  4900. if not spellName then
  4901. parentLine.chk:Disable()
  4902. parentLine.chk:SetAlpha(0.5)
  4903. else
  4904. parentLine.chk:Enable()
  4905. parentLine.chk:SetAlpha(1)
  4906. end
  4907. module.db.spellDB[parentLine.tid][1] = spellID
  4908. SyncUserDB()
  4909. end
  4910. local function SpellsListUserSpellNameOnEnter(self)
  4911. local spellID = tonumber(self:GetText())
  4912. if spellID then
  4913. local spellName = GetSpellInfo(spellID)
  4914. if spellName then
  4915. ELib.Tooltip.Link(self,format("|Hspell:%d|hspell|h",spellID))
  4916. else
  4917. ELib.Tooltip.Std(self)
  4918. end
  4919. else
  4920. ELib.Tooltip.Std(self)
  4921. end
  4922. end
  4923.  
  4924. local SpellsListClassDropDownList = {}
  4925. local function SpellsListUserClassDropDownClick(self,classNum,isAll)
  4926. local parent = self:GetParent().parent
  4927. local parentLine = parent:GetParent()
  4928. local class = isAll and "ALL" or module.db.classNames[classNum]
  4929. CheckToNil(parentLine)
  4930. ELib:DropDownClose()
  4931. parent:SetText("|c"..ExRT.F.classColor(class)..L.classLocalizate[ class ])
  4932. module.db.spellDB[parentLine.tid][2] = class
  4933. local cR,cG,cB = ExRT.F.classColorNum(class)
  4934. parentLine.backClassColorR = cR
  4935. parentLine.backClassColorG = cG
  4936. parentLine.backClassColorB = cB
  4937. SyncUserDB()
  4938. end
  4939. for i=1,#module.db.classNames do
  4940. SpellsListClassDropDownList[#SpellsListClassDropDownList + 1] = {
  4941. text = "|c"..ExRT.F.classColor(module.db.classNames[i])..L.classLocalizate[ module.db.classNames[i] ],
  4942. justifyH = "CENTER",
  4943. arg1 = i,
  4944. func = SpellsListUserClassDropDownClick,
  4945. }
  4946. end
  4947. SpellsListClassDropDownList[#SpellsListClassDropDownList + 1] = {
  4948. text = "|c"..ExRT.F.classColor("ALL")..L.classLocalizate[ "ALL" ],
  4949. justifyH = "CENTER",
  4950. arg1 = 0,
  4951. arg2 = true,
  4952. func = SpellsListUserClassDropDownClick,
  4953. }
  4954.  
  4955. local function SpellsListUserRemoveOnClick(self)
  4956. local parentLine = self:GetParent()
  4957. VExRT.ExCD2.CDE[parentLine.sid] = nil
  4958.  
  4959. for j=3,7 do
  4960. if type(module.db.spellDB[parentLine.tid][j])=="table" then
  4961. VExRT.ExCD2.CDECol[module.db.spellDB[parentLine.tid][j][1]..";"..(j-2)] = nil
  4962. end
  4963. end
  4964.  
  4965. for j = parentLine.tid + 1,#module.db.spellDB do
  4966. module.db.spellDB[j-1] = module.db.spellDB[j]
  4967. end
  4968. module.db.spellDB[#module.db.spellDB] = nil
  4969.  
  4970. local current = module.options.ScrollBar:GetValue()
  4971. local min_,max_ = module.options.ScrollBar:GetMinMaxValues()
  4972. module.options.ScrollBar:UpdateRange()
  4973.  
  4974. local newVal = current == max_ and max(current-SPELL_LINE_HEIGHT,1) or current
  4975. if newVal ~= current then
  4976. module.options.ScrollBar:SetValue(newVal)
  4977. else
  4978. module.options.ReloadSpellsPage()
  4979. end
  4980.  
  4981. SyncUserDB()
  4982. UpdateRoster()
  4983.  
  4984. module.options:CleanUPVariables()
  4985. end
  4986.  
  4987. self.spellsListScrollFrame = CreateFrame("ScrollFrame", nil, self.borderList)
  4988. self.spellsListScrollFrame:SetPoint("TOPLEFT")
  4989. self.spellsListScrollFrame:SetPoint("BOTTOMRIGHT")
  4990.  
  4991. self.spellsListScrollFrameContent = CreateFrame("Frame", nil, self.spellsListScrollFrame)
  4992. self.spellsListScrollFrameContent:SetPoint("TOPLEFT",0,0)
  4993. self.spellsListScrollFrameContent:SetSize(self.spellsListScrollFrame:GetSize())
  4994. self.spellsListScrollFrame:SetScrollChild(self.spellsListScrollFrameContent)
  4995.  
  4996. self.spellsList = {}
  4997. for i=1,(SPELL_PER_PAGE+2) do
  4998. local line = CreateFrame("Frame",nil,self.spellsListScrollFrameContent)
  4999. self.spellsList[i] = line
  5000. line:SetPoint("TOPLEFT",0,-(i-1)*SPELL_LINE_HEIGHT)
  5001. line:SetPoint("RIGHT",-100,0)
  5002. line:SetHeight(SPELL_LINE_HEIGHT)
  5003.  
  5004. line.chk = ELib:Check(line):Point("LEFT",10,0):OnClick(SpellsListChkOnClick)
  5005. line.chk._i = i
  5006.  
  5007. line.backClassColor = line:CreateTexture(nil, "BACKGROUND")
  5008. line.backClassColor:SetPoint("LEFT",0,0)
  5009. line.backClassColor:SetSize(250,SPELL_LINE_HEIGHT)
  5010. line.backClassColor:SetColorTexture(1, 1, 1, 1)
  5011. line.backClassColorR = 0
  5012. line.backClassColorG = 0
  5013. line.backClassColorB = 0
  5014.  
  5015. line:SetScript("OnUpdate",SpellsListOnUpdate)
  5016.  
  5017. line.icon = line:CreateTexture(nil, "ARTWORK")
  5018. line.icon:SetSize(28,28)
  5019. line.icon:SetPoint("LEFT", 35, 0)
  5020. line.icon:SetTexCoord(.1,.9,.1,.9)
  5021. ELib:Border(line.icon,1,.12,.13,.15,1)
  5022.  
  5023. line.tooltipFrame = CreateFrame("Frame",nil,line)
  5024. line.tooltipFrame:SetSize(150,SPELL_LINE_HEIGHT)
  5025. line.tooltipFrame:SetPoint("LEFT", 70, 0)
  5026. line.tooltipFrame._i = i
  5027. line.tooltipFrame:SetScript("OnEnter", SpellsListTooltipFrameOnEnter)
  5028. line.tooltipFrame:SetScript("OnLeave", SpellsListTooltipFrameOnLeave)
  5029.  
  5030. line.spellName = ELib:Text(line):Size(155,SPELL_LINE_HEIGHT):Point("LEFT",70,0):Font(ExRT.F.defFont,12):Shadow()
  5031.  
  5032. line.class = ELib:Text(line):Size(180,SPELL_LINE_HEIGHT):Point("LEFT",235,0):Font(ExRT.F.defFont,14):Shadow()
  5033.  
  5034. line.dropDownPriority = ELib:DropDown(line,100,15):Size(80):Point("LEFT",375,0)
  5035. line.dropDownPriority._i = i
  5036. line.dropDownPriority.List = SpellsListDropDownPriorityDataList
  5037. line.dropDownPriority:SetScript("OnEnter",SpellsListDropDownPriorityOnEnter)
  5038. line.dropDownPriority:SetScript("OnLeave",ELib.Tooltip.Hide)
  5039.  
  5040. line.buttonModify = ELib:Button(line,L.cd2ButtonModify):Size(130,20):Point("LEFT",465,0):OnClick(SpellsListButtonModifyOnClick)
  5041. line.buttonModify._i = i
  5042.  
  5043. line.userSpellName = ELib:Edit(line,6,true):Size(145,20):Point("LEFT",70,0):Tooltip(L.cd2SpellID):OnChange(SpellsListUserSpellNameOnTextChanged)
  5044. line.userSpellName._i = i
  5045. line.userSpellName:SetScript("OnEnter",SpellsListUserSpellNameOnEnter)
  5046. line.userSpellName:SetScript("OnLeave",ELib.Tooltip.Hide)
  5047.  
  5048. line.userClass = ELib:DropDown(line,130,12):Size(140):Point("LEFT",225,0):SetText(L.cd2Class)
  5049. line.userClass._i = i
  5050. line.userClass.List = SpellsListClassDropDownList
  5051.  
  5052. line.userRemove = ELib:Button(line,"","UIPanelCloseButton"):Size(18,18):Point("LEFT",600,0):OnClick(SpellsListUserRemoveOnClick)
  5053. line.userRemove.tooltipText = L.cd2RemoveButton
  5054. line.userRemove._i = i
  5055. line.userRemove:SetScript("OnEnter",ELib.Tooltip.Std)
  5056. line.userRemove:SetScript("OnLeave",ELib.Tooltip.Hide)
  5057.  
  5058. line.userClass:Hide()
  5059. line.userRemove:Hide()
  5060. end
  5061.  
  5062. self.butSpellsAdd = ELib:Button(self.spellsListScrollFrameContent,L.cd2AddSpell):Size(305,20):Point(5,-3-SPELL_PER_PAGE*SPELL_LINE_HEIGHT):OnClick(function(self)
  5063. module.options:addNewSpell(module.db.classNames[math.random(1,#module.db.classNames)])
  5064. module.options:CleanUPVariables()
  5065. end)
  5066. self.butSpellsAdd:Hide()
  5067.  
  5068. self.butSpellsFrame = ELib:Button(self.spellsListScrollFrameContent,L.cd2AddSpellFromList):Size(305,20):Point(317,-3-SPELL_PER_PAGE*SPELL_LINE_HEIGHT):OnClick(function(self)
  5069. module.options.addSpellFrame:Show()
  5070. end)
  5071. self.butSpellsFrame:Hide()
  5072.  
  5073. self.spellsModifyFrame = ELib:Popup():Size(560,180)
  5074. self.spellsModifyFrame.isDefaultSpell = nil
  5075.  
  5076. self.spellsModifyFrame.OnShow = function(self)
  5077. if not self.class or not self.sid or not self.tid then
  5078. self:Hide()
  5079. return
  5080. end
  5081. self:SetFrameLevel(120)
  5082.  
  5083. local titleName,_,titleTexture = GetSpellInfo(self.sid)
  5084. self.title:SetFormattedText("%s%s",titleTexture and "|T"..titleTexture..":16|t " or "",titleName or L.cd2TextSpell.." #"..self.sid)
  5085.  
  5086. local spellData = module.db.spellDB[self.tid]
  5087.  
  5088. local specByClassTable = module.db.specByClass[self.class] or {0}
  5089. local specsCount = #specByClassTable
  5090. for i=1,specsCount do
  5091. local specID = specByClassTable[i]
  5092. local icon = ""
  5093. if module.db.specIcons[specID] then
  5094. icon = "|T".. module.db.specIcons[specID] ..":20|t"
  5095. else
  5096. icon = ExRT.F.classIconInText(self.class,20) or ""
  5097. end
  5098. local line = module.options.spellsModifyFrame.el[i]
  5099.  
  5100. line.spec:SetText(icon.." |c"..ExRT.F.classColor(self.class)..L.specLocalizate[module.db.specInLocalizate[specID]])
  5101. line:Show()
  5102.  
  5103. if spellData[i+2] then
  5104. line.cd:SetText(spellData[i+2][2])
  5105. line.dur:SetText(spellData[i+2][3])
  5106. line.spellID:SetText(spellData[i+2][1])
  5107.  
  5108. line.col:SetText( VExRT.ExCD2.CDECol[spellData[i+2][1]..";"..i] or module.db.def_col[spellData[i+2][1]..";"..i] or 1)
  5109.  
  5110. line.add:Hide()
  5111. line.col:Show()
  5112. line.dur:Show()
  5113. line.spellID:Show()
  5114. line.cd:Show()
  5115. line.remove:Show()
  5116. else
  5117. line.add:Show()
  5118. line.col:Hide()
  5119. line.dur:Hide()
  5120. line.spellID:Hide()
  5121. line.cd:Hide()
  5122. line.remove:Hide()
  5123. end
  5124.  
  5125. if not spellData.user then
  5126. line.spellID:Disable()
  5127. line.remove:Disable()
  5128. line.add:Hide()
  5129. else
  5130. line.spellID:Enable()
  5131. line.remove:Enable()
  5132. end
  5133. end
  5134. for i=specsCount+1,5 do
  5135. self.el[i]:Hide()
  5136. end
  5137. if not spellData.user then
  5138. self.isDefaultSpell = true
  5139. else
  5140. self.isDefaultSpell = nil
  5141. end
  5142. self:SetHeight(30+32*specsCount)
  5143. end
  5144.  
  5145. self.spellsModifyFrame.el = {}
  5146. for i=1,5 do
  5147. local line = CreateFrame("Frame",nil,self.spellsModifyFrame)
  5148. self.spellsModifyFrame.el[i] = line
  5149. line:SetPoint("TOPLEFT",15,-20-(i-1)*32)
  5150. line:SetSize(self.spellsModifyFrame:GetWidth(),30)
  5151.  
  5152. line.spec = ELib:Text(line):Size(160,30):Point(0,0):Font(ExRT.F.defFont,14):Shadow()
  5153.  
  5154. line.spellID = ELib:Edit(line,6,true):Size(140,20):Point("LEFT",180,0):Tooltip(L.cd2SpellID):OnChange(function(self,isUser)
  5155. local spellID = tonumber(self:GetText())
  5156. if not spellID or not isUser then
  5157. return
  5158. end
  5159. local spellName = GetSpellInfo(spellID)
  5160. local modFrame = self:GetParent():GetParent()
  5161.  
  5162. local c = VExRT.ExCD2.CDECol[module.db.spellDB[modFrame.tid][i+2][1]..";"..i]
  5163. local tmp = nil
  5164. for N1=1,#module.db.spellDB do
  5165. for N2=3,7 do
  5166. if module.db.spellDB[N1][N2] and module.db.spellDB[N1][N2] and module.db.spellDB[N1][N2][1] == module.db.spellDB[modFrame.tid][i+2][1] and not (modFrame.tid == N1 and (i+2) == N2) then
  5167. tmp = true
  5168. end
  5169. end
  5170. end
  5171. if not tmp then
  5172. VExRT.ExCD2.CDECol[module.db.spellDB[modFrame.tid][i+2][1]..";"..i] = nil
  5173. end
  5174. module.db.spellDB[modFrame.tid][i+2][1] = spellID
  5175. if not VExRT.ExCD2.CDECol[spellID..";"..i] and not module.db.def_col[spellID..";"..i] then
  5176. VExRT.ExCD2.CDECol[spellID..";"..i] = c
  5177. else
  5178. modFrame.el[i].col:SetText( VExRT.ExCD2.CDECol[spellID..";"..i] or module.db.def_col[spellID..";"..i])
  5179. end
  5180. end)
  5181. line.spellID:SetScript("OnEnter",function(self)
  5182. local spellID = tonumber(self:GetText())
  5183. if spellID then
  5184. local spellName = GetSpellInfo(spellID)
  5185. if spellName then
  5186. local link = format("|Hspell:%d|hspell|h",spellID)
  5187. ELib.Tooltip.Link(self,link)
  5188. else
  5189. ELib.Tooltip.Std(self)
  5190. end
  5191. else
  5192. ELib.Tooltip.Std(self)
  5193. end
  5194. end)
  5195. line.spellID:SetScript("OnLeave",function(self)
  5196. ELib.Tooltip:Hide()
  5197. end)
  5198.  
  5199. line.col = ELib:DropDown(line,100,10):Size(70):Point("LEFT",330,0):Tooltip(L.cd2ColNum)
  5200. local function SpellsModifyFrameColSet(self,arg)
  5201. module.options.spellsModifyFrame.el[i].col:SetText(arg)
  5202. ELib:DropDownClose()
  5203. VExRT.ExCD2.CDECol[module.db.spellDB[module.options.spellsModifyFrame.tid][i+2][1]..";"..i] = tonumber(arg)
  5204. UpdateRoster()
  5205. end
  5206. for j=1,10 do
  5207. line.col.List[j] = {
  5208. text=j,
  5209. justifyH="CENTER",
  5210. arg1=j,
  5211. func=SpellsModifyFrameColSet,
  5212. }
  5213. end
  5214.  
  5215.  
  5216. line.cd = ELib:Edit(line,6,true):Size(50,20):Point("LEFT",410,0):Tooltip(L.cd2EditBoxCDTooltip):OnChange(function(self,isUser)
  5217. if not isUser then
  5218. return
  5219. end
  5220. local cd_num = tonumber(self:GetText())
  5221. if not cd_num then
  5222. return
  5223. end
  5224. local modFrame = self:GetParent():GetParent()
  5225. module.db.spellDB[modFrame.tid][i+2][2] = cd_num
  5226. if modFrame.isDefaultSpell then
  5227. local spellID = module.db.spellDB[modFrame.tid][1]
  5228. VExRT.ExCD2.default_userCD[spellID] = VExRT.ExCD2.default_userCD[spellID] or {}
  5229. VExRT.ExCD2.default_userCD[spellID][i] = cd_num
  5230. end
  5231. end)
  5232.  
  5233. line.dur = ELib:Edit(line,6,true):Size(50,20):Point("LEFT",470,0):Tooltip(L.cd2EditBoxDurationTooltip):OnChange(function(self,isUser)
  5234. if not isUser then
  5235. return
  5236. end
  5237. local duration = tonumber(self:GetText())
  5238. if not duration then
  5239. return
  5240. end
  5241. local modFrame = self:GetParent():GetParent()
  5242. module.db.spellDB[modFrame.tid][i+2][3] = duration
  5243. if modFrame.isDefaultSpell then
  5244. local spellID = module.db.spellDB[modFrame.tid][1]
  5245. VExRT.ExCD2.default_userDuration[spellID] = VExRT.ExCD2.default_userDuration[spellID] or {}
  5246. VExRT.ExCD2.default_userDuration[spellID][i] = duration
  5247. end
  5248. end)
  5249. line.dur:SetTextColor(0.5,1,0.5,1)
  5250.  
  5251. line.remove = ELib:Button(line,"","UIPanelCloseButton"):Size(18,18):Point("LEFT",520,0):OnClick(function(self)
  5252. local parentLine = self:GetParent()
  5253. parentLine.add:Show()
  5254. parentLine.col:Hide()
  5255. parentLine.dur:Hide()
  5256. parentLine.spellID:Hide()
  5257. parentLine.cd:Hide()
  5258. parentLine.remove:Hide()
  5259.  
  5260. module.db.spellDB[parentLine:GetParent().tid][i+2] = nil
  5261. end)
  5262. line.remove.tooltipText = L.cd2RemoveButton
  5263. line.remove:SetScript("OnEnter",ELib.Tooltip.Std)
  5264. line.remove:SetScript("OnLeave",ELib.Tooltip.Hide)
  5265.  
  5266. line.add = ELib:Button(line,0,1):Size(400,24):Point(140,-4):OnClick(function(self)
  5267. local parentLine = self:GetParent()
  5268. local modFrame = parentLine:GetParent()
  5269. self:Hide()
  5270. parentLine.col:Show()
  5271. parentLine.dur:Show()
  5272. parentLine.spellID:Show()
  5273. parentLine.cd:Show()
  5274. parentLine.remove:Show()
  5275.  
  5276. parentLine.spellID:SetText(modFrame.sid)
  5277.  
  5278. module.db.spellDB[modFrame.tid][i+2] = {modFrame.sid,0,0}
  5279.  
  5280. parentLine.cd:SetText(0)
  5281. parentLine.dur:SetText(0)
  5282. parentLine.col:SetText(VExRT.ExCD2.CDECol[module.db.spellDB[modFrame.tid][i+2][1]..";"..i] or 1)
  5283. end)
  5284. line.add.html = ELib:Text(line.add,L.cd2TextAdd):Point(0,0):Point("BOTTOMRIGHT",0,0):Center():Color()
  5285. ExRT.lib.CreateHoverHighlight(line.add)
  5286. line.add.hl:SetVertexColor(1,1,1,0.5)
  5287. line.add:SetScript("OnEnter", function(self) self.hl:Show() end)
  5288. line.add:SetScript("OnLeave", function(self) self.hl:Hide() end)
  5289. end
  5290.  
  5291. self.addSpellFrame = ELib:Popup(L.cd2AddSpellFrameName):Size(550,422+10)
  5292.  
  5293. self.addSpellFrame.backClassColor = self.addSpellFrame:CreateTexture(nil, "BORDER",nil,0)
  5294. self.addSpellFrame.backClassColor:SetPoint("TOP",0,-20)
  5295. self.addSpellFrame.backClassColor:SetSize(550,40)
  5296. self.addSpellFrame.backClassColor:SetColorTexture( 1, 1, 1, 1)
  5297. self.addSpellFrame.backClassColor:Hide()
  5298.  
  5299. self.addSpellFrame.backClassColorBottom = self.addSpellFrame:CreateTexture(nil, "BORDER",nil,0)
  5300. self.addSpellFrame.backClassColorBottom:SetPoint("BOTTOM",0,0)
  5301. self.addSpellFrame.backClassColorBottom:SetSize(550,15)
  5302. self.addSpellFrame.backClassColorBottom:SetColorTexture( 1, 1, 1, 1)
  5303. self.addSpellFrame.backClassColorBottom:Hide()
  5304.  
  5305. self.addSpellFrame.sortedClasses = {}
  5306.  
  5307. self.addSpellFrame.dropDown = ELib:DropDown(self.addSpellFrame,200,10):Size(210):Point("TOPRIGHT",-5,-25)
  5308. function self.addSpellFrame.dropDown:SetValue(newValue)
  5309. local addSpellFrame = module.options.addSpellFrame
  5310. addSpellFrame.dropDown:SetText("|c"..ExRT.F.classColor(newValue)..(L.classLocalizate[newValue] or newValue == "RACIAL" and L.cd2Racial or newValue == "ITEMS" and L.cd2Items or "Unk"))
  5311. ELib:DropDownClose()
  5312. if not addSpellFrame.sortedClasses[newValue] then
  5313. for i=1,#module.db.allClassSpells[newValue] do
  5314. local spellName = GetSpellInfo(module.db.allClassSpells[newValue][i][1])
  5315. module.db.allClassSpells[newValue][i].spellName = spellName or tostring(module.db.allClassSpells[newValue][i][1])
  5316. end
  5317. sort(module.db.allClassSpells[newValue],function(a,b) return a.spellName < b.spellName end)
  5318. addSpellFrame.sortedClasses[newValue] = true
  5319. end
  5320.  
  5321. for i=1,#module.db.allClassSpells[newValue] do
  5322. if i <= addSpellFrame.buttonsMax then
  5323. local SpellID = module.db.allClassSpells[newValue][i][1]
  5324. local spellName, _, spellTexture = GetSpellInfo(SpellID)
  5325. if module.db.differentIcons[ SpellID ] then
  5326. spellTexture = module.db.differentIcons[SpellID]
  5327. end
  5328. local buttonFrame = module.options.addSpellFrame.buttons[i]
  5329.  
  5330. buttonFrame.icon:SetTexture(spellTexture or "Interface\\Icons\\INV_MISC_QUESTIONMARK")
  5331. buttonFrame.text:SetText(spellName or "?")
  5332. buttonFrame.spellID = SpellID
  5333. buttonFrame.spellLink = GetSpellLink(SpellID)
  5334. buttonFrame.colNum = module.db.allClassSpells[newValue][i][2]
  5335.  
  5336. buttonFrame.line = module.db.allClassSpells[newValue][i]
  5337.  
  5338. if newValue == "PET" then
  5339. buttonFrame.text:SetText("|c"..ExRT.F.classColor(module.db.allClassSpells[newValue][i][3])..L.classLocalizate[module.db.allClassSpells[newValue][i][3]].."|r "..(spellName or "?"))
  5340. end
  5341.  
  5342. buttonFrame.disabled = nil
  5343. for j=1,#module.db.spellDB do
  5344. if module.db.spellDB[j][1] == SpellID then
  5345. buttonFrame.icon:SetDesaturated(true)
  5346. buttonFrame.text:SetTextColor(0.5,0.5,0.5,1)
  5347. buttonFrame.disabled = true
  5348. break
  5349. end
  5350. end
  5351. if not buttonFrame.disabled then
  5352. buttonFrame.icon:SetDesaturated(nil)
  5353. buttonFrame.text:SetTextColor(1,1,1,1)
  5354. end
  5355.  
  5356. buttonFrame:Show()
  5357. end
  5358. end
  5359. for i=#module.db.allClassSpells[newValue]+1,addSpellFrame.buttonsMax do
  5360. addSpellFrame.buttons[i]:Hide()
  5361. end
  5362. addSpellFrame.class = newValue
  5363.  
  5364. local cR,cG,cB = ExRT.F.classColorNum(newValue)
  5365. addSpellFrame.backClassColor:SetGradientAlpha("VERTICAL", cR,cG,cB, 0, cR,cG,cB, 0.5)
  5366. addSpellFrame.backClassColor:Show()
  5367. addSpellFrame.backClassColorBottom:SetGradientAlpha("VERTICAL", cR,cG,cB, 0.5, cR,cG,cB, 0)
  5368. addSpellFrame.backClassColorBottom:Show()
  5369. end
  5370. for i=1,#module.db.classNames do
  5371. local class = module.db.classNames[i]
  5372. self.addSpellFrame.dropDown.List[#self.addSpellFrame.dropDown.List + 1] = {
  5373. text = "|c"..ExRT.F.classColor(class)..L.classLocalizate[class],
  5374. justifyH = "CENTER",
  5375. func = self.addSpellFrame.dropDown.SetValue,
  5376. arg1 = class,
  5377. }
  5378. end
  5379. for i,noClassData in ipairs({{"PET",L.classLocalizate["PET"]},{"RACIAL",L.cd2Racial},{"ITEMS",L.cd2Items}}) do
  5380. self.addSpellFrame.dropDown.List[#self.addSpellFrame.dropDown.List + 1] = {
  5381. text = "|c"..ExRT.F.classColor(noClassData[1])..noClassData[2],
  5382. justifyH = "CENTER",
  5383. func = self.addSpellFrame.dropDown.SetValue,
  5384. arg1 = noClassData[1],
  5385. }
  5386. end
  5387. self.addSpellFrame.dropDown.Lines = #self.addSpellFrame.dropDown.List
  5388.  
  5389. local function AddSpellFrameButtonsOnEnter(self)
  5390. self:SetBackdropBorderColor(1,1,1,0.5)
  5391. GameTooltip:SetOwner(self, "ANCHOR_LEFT")
  5392.  
  5393. local isItem,isArtifact = nil
  5394. for itemID,spellID in pairs(module.db.itemsToSpells) do
  5395. if spellID == self.line[1] then
  5396. if module.db.itemsArtifacts[itemID] then
  5397. isArtifact = itemID
  5398. else
  5399. isItem = itemID
  5400. end
  5401. break
  5402. end
  5403. end
  5404.  
  5405. if not isItem then
  5406. GameTooltip:SetHyperlink(self.spellLink)
  5407. else
  5408. local _,itemLink = GetItemInfo(isItem)
  5409. GameTooltip:SetHyperlink(itemLink or self.spellLink)
  5410. end
  5411. GameTooltip:AddLine(" ")
  5412.  
  5413. local className = module.options.addSpellFrame.class
  5414. if module.db.specByClass[className] then
  5415. for i=1,#module.db.specByClass[className] do
  5416. if self.line[2+i] then
  5417. local icon = ""
  5418. if module.db.specIcons[module.db.specByClass[className][i]] then
  5419. icon = "|T".. module.db.specIcons[module.db.specByClass[className][i]] ..":20|t"
  5420. else
  5421. icon = ExRT.F.classIconInText(className,20) or ""
  5422. end
  5423. GameTooltip:AddLine(icon.." |c"..ExRT.F.classColor(className)..L.specLocalizate[module.db.specInLocalizate[module.db.specByClass[className][i]]].. ":|r|cffffffff "..L.cd2AddSpellFrameCDText.." "..format("%d:%02d",self.line[i+2][2]/60,self.line[i+2][2]%60).. (self.line[i+2][3] > 0 and ", "..L.cd2AddSpellFrameDurationText.." "..self.line[i+2][3] or ""))
  5424. end
  5425. end
  5426. elseif className == "PET" then
  5427. for petName,petData in pairs(module.db.petsAbilities) do
  5428. for j=2,#petData do
  5429. if petData[j][1] == self.line[1] then
  5430. local petNameInTooltip = petName
  5431. if tonumber(petNameInTooltip) then
  5432. petNameInTooltip = L.creatureNames[tonumber(petNameInTooltip)]
  5433. end
  5434. GameTooltip:AddLine((ExRT.F.classIconInText(self.line[3],20) or "").." |c"..ExRT.F.classColor(self.line[3])..petNameInTooltip.. ":|r|cffffffff "..L.cd2AddSpellFrameCDText.." "..format("%d:%02d",petData[j][2]/60,petData[j][2]%60).. (petData[j][3] and ", "..L.cd2AddSpellFrameDurationText.." "..petData[j][3] or ""))
  5435. break
  5436. end
  5437. end
  5438. end
  5439. else
  5440. GameTooltip:AddLine("|cffffffff"..L.cd2AddSpellFrameCDText.." "..self.line[3][2].. (self.line[3][3] > 0 and ", "..L.cd2AddSpellFrameDurationText.." "..self.line[3][3] or ""))
  5441. end
  5442. if isArtifact then
  5443. GameTooltip:AddLine(ARTIFACT_POWER)
  5444. end
  5445. GameTooltip:AddLine("|cffffffff"..L.cd2AddSpellFrameColumnText..": ".. self.colNum .."|r")
  5446. if module.db.spell_isTalent[self.line[1]] and not className == "ITEMS" then
  5447. GameTooltip:AddLine("|cffffffff"..L.cd2AddSpellFrameTalent.."|r")
  5448. end
  5449. if module.db.spell_durationByTalent_fix[self.line[1]] then
  5450. GameTooltip:AddLine("|cffaaffaa"..L.cd2AddSpellFrameDuration..":|r")
  5451. for j=1,#module.db.spell_durationByTalent_fix[self.line[1]],2 do
  5452. local sname = GetSpellInfo(module.db.spell_durationByTalent_fix[self.line[1]][j]) or "???"
  5453. local cd = module.db.spell_durationByTalent_fix[self.line[1]][j+1]
  5454. if type(cd) == 'table' then
  5455. cd = strjoin(",",unpack(cd))
  5456. elseif not tonumber(cd) then
  5457. cd = tonumber(string.sub(cd,2))
  5458. if cd < 1 then
  5459. cd = "-"..( (1-cd)*100 ).."%"
  5460. else
  5461. cd = "+"..( (cd-1)*100 ).."%"
  5462. end
  5463. end
  5464. GameTooltip:AddLine("|cffffffff - "..sname .." (".. (tonumber(cd) and cd > 0 and "+" or "").. cd ..")|r")
  5465.  
  5466. ELib.Tooltip:Add("spell:"..module.db.spell_durationByTalent_fix[self.line[1]][j])
  5467. end
  5468.  
  5469. end
  5470. do
  5471. local cdByTalent_fix = nil
  5472. local readiness_lines = {}
  5473. if module.db.spell_cdByTalent_fix[self.line[1]] then
  5474. cdByTalent_fix = true
  5475. for j=1,#module.db.spell_cdByTalent_fix[self.line[1]],2 do
  5476. local sname = GetSpellInfo(module.db.spell_cdByTalent_fix[self.line[1]][j]) or "???"
  5477. local cd = module.db.spell_cdByTalent_fix[self.line[1]][j+1]
  5478. if type(cd) == 'table' then
  5479. cd = strjoin(",",unpack(cd))
  5480. elseif not tonumber(cd) then
  5481. cd = tonumber(string.sub(cd,2))
  5482. if cd < 1 then
  5483. cd = "-"..( (1-cd)*100 ).."%"
  5484. else
  5485. cd = "+"..( (cd-1)*100 ).."%"
  5486. end
  5487. end
  5488. table.insert(readiness_lines,"|cffffffff - "..sname .." (".. (tonumber(cd) and cd > 0 and "+" or "").. cd ..")|r")
  5489.  
  5490. ELib.Tooltip:Add("spell:"..module.db.spell_cdByTalent_fix[self.line[1]][j])
  5491. end
  5492. end
  5493. if cdByTalent_fix then
  5494. GameTooltip:AddLine("|cffffaaaa"..L.cd2AddSpellFrameCDChange..": |r")
  5495. for j=1,#readiness_lines do
  5496. GameTooltip:AddLine(readiness_lines[j])
  5497. end
  5498. end
  5499. end
  5500. if module.db.spell_charge_fix[self.line[1]] then
  5501. if module.db.spell_charge_fix[self.line[1]] == 1 then
  5502. GameTooltip:AddLine("|cffffffaa"..L.cd2AddSpellFrameCharge.."|r")
  5503. else
  5504. GameTooltip:AddLine("|cffffffaa"..L.cd2AddSpellFrameChargeChange..":|r")
  5505. local sname = GetSpellInfo(module.db.spell_charge_fix[self.line[1]]) or "???"
  5506. GameTooltip:AddLine("|cffffffff - "..sname .."|r")
  5507. end
  5508. end
  5509. do
  5510. for auraID,sID in pairs(module.db.spell_aura_list) do
  5511. if sID == self.line[1] then
  5512. local sname = GetSpellInfo(auraID) or "???"
  5513. GameTooltip:AddLine("|cffaaffaa"..L.cd2AddSpellFrameDurationLost..":|r")
  5514. GameTooltip:AddLine("|cffffffff - \""..sname.."\"|r")
  5515. end
  5516. end
  5517. end
  5518. if module.db.spell_sharingCD[self.line[1]] then
  5519. GameTooltip:AddLine("|cffffffaa"..L.cd2AddSpellFrameSharing..": |r")
  5520. for otherID,otherCD in pairs(module.db.spell_sharingCD[self.line[1]]) do
  5521. local sname = GetSpellInfo(otherID) or "???"
  5522. GameTooltip:AddLine("|cffffffff - "..sname .." (".. otherCD ..")|r")
  5523. end
  5524. end
  5525. if module.db.spell_dispellsList[self.line[1]] then
  5526. GameTooltip:AddLine("|cffffffaa"..L.cd2AddSpellFrameDispel.."|r")
  5527. end
  5528. if module.db.spell_talentReplaceOther[self.line[1]] then
  5529. local spellID = module.db.spell_talentReplaceOther[self.line[1]]
  5530. local sname
  5531. if type(spellID)=='table' then
  5532. for i=1,#spellID do
  5533. local sname = GetSpellInfo(spellID[i]) or "???"
  5534. GameTooltip:AddLine("|cffffaaaa"..L.cd2AddSpellFrameReplace .." ".. sname .."|r")
  5535. end
  5536. else
  5537. local sname = GetSpellInfo(spellID) or "???"
  5538. GameTooltip:AddLine("|cffffaaaa"..L.cd2AddSpellFrameReplace .." ".. sname .."|r")
  5539. end
  5540. end
  5541. GameTooltip:Show()
  5542. end
  5543. local function AddSpellFrameButtonsOnLeave(self)
  5544. self:SetBackdropBorderColor(1,1,1,0)
  5545. GameTooltip_Hide()
  5546. ELib.Tooltip:HideAdd()
  5547. end
  5548. local function AddSpellFrameButtonsOnClick(self)
  5549. if not self.disabled then
  5550. local class = module.options.addSpellFrame.class
  5551. module.options:addNewSpell((class == "RACIAL" or class == "ITEMS") and "ALL" or class,self.line)
  5552. module.options.addSpellFrame:Hide()
  5553. end
  5554. end
  5555.  
  5556. self.addSpellFrame.buttonsMax = 0
  5557. for classNum=1,#module.db.classNames do
  5558. local now = #module.db.allClassSpells[ module.db.classNames[classNum] ]
  5559. self.addSpellFrame.buttonsMax = max(self.addSpellFrame.buttonsMax,now)
  5560. end
  5561. self.addSpellFrame.buttonsMax = max(self.addSpellFrame.buttonsMax,#module.db.allClassSpells["PET"])
  5562. self.addSpellFrame:SetHeight( 82 + 35 * ceil( self.addSpellFrame.buttonsMax / 4 ) )
  5563.  
  5564. self.addSpellFrame.buttons = {}
  5565. for i=1,self.addSpellFrame.buttonsMax do
  5566. local buttonFrame = CreateFrame("Button",nil,self.addSpellFrame)
  5567. self.addSpellFrame.buttons[i] = buttonFrame
  5568. buttonFrame:SetPoint("TOPLEFT",(i-1)%4 * 130 + 15,-floor((i-1)/4) * 35 - 60)
  5569. buttonFrame:SetSize(130,35)
  5570. buttonFrame:SetBackdrop({edgeFile = ExRT.F.defBorder, edgeSize = 8})
  5571. buttonFrame:SetBackdropBorderColor(1,1,1,0)
  5572.  
  5573. buttonFrame:SetScript("OnEnter",AddSpellFrameButtonsOnEnter)
  5574. buttonFrame:SetScript("OnLeave",AddSpellFrameButtonsOnLeave)
  5575.  
  5576. buttonFrame:SetScript("OnClick",AddSpellFrameButtonsOnClick)
  5577.  
  5578. buttonFrame.icon = buttonFrame:CreateTexture(nil, "BACKGROUND")
  5579. buttonFrame.icon:SetSize(24,24)
  5580. buttonFrame.icon:SetPoint("TOPLEFT",5,-5)
  5581.  
  5582. buttonFrame.text = ELib:Text(buttonFrame,"",12):Size(99,31):Point(33,-2):Color():Shadow()
  5583. end
  5584.  
  5585. function module.options:addNewSpell(class,line,doNotScroll)
  5586. local sbmin,sbmax = module.options.ScrollBar:GetMinMaxValues()
  5587. --module.options.ScrollBar:SetMinMaxValues(sbmin,sbmax+1)
  5588. if line then
  5589. if class ~= "PET" then
  5590. module.db.spellDB[#module.db.spellDB+1] = {line[1],class,line[3],line[4],line[5],line[6],line[7],user=true}
  5591. for j=3,7 do
  5592. if line[j] and not VExRT.ExCD2.CDECol[ line[j][1] .. ";" .. (j-2) ] then
  5593. VExRT.ExCD2.CDECol[ line[j][1] .. ";" .. (j-2) ] = line[2]
  5594. end
  5595. end
  5596. else
  5597. local cd,dur = 0,0
  5598. for petName,petData in pairs(module.db.petsAbilities) do
  5599. for j=2,#petData do
  5600. if petData[j][1] == line[1] then
  5601. cd = petData[j][2]
  5602. dur = petData[j][3] or 0
  5603. break
  5604. end
  5605. end
  5606. end
  5607. module.db.spellDB[#module.db.spellDB+1] = {line[1],line[3],{line[1],cd,dur},user=true}
  5608. if not VExRT.ExCD2.CDECol[ line[1] .. ";1" ] then
  5609. VExRT.ExCD2.CDECol[ line[1] .. ";1" ] = line[2]
  5610. end
  5611. end
  5612. else
  5613. module.db.spellDB[#module.db.spellDB+1] = {0,class,user=true}
  5614. end
  5615. module.options.ScrollBar:UpdateRange()
  5616. if not doNotScroll then
  5617. module.options.ScrollBar:SetValue(sbmax+31)
  5618. end
  5619. SyncUserDB()
  5620. UpdateRoster()
  5621. end
  5622.  
  5623. self.addSpellFrame.OnShow = function (self)
  5624. self.dropDown:SetValue(self.class or "WARRIOR")
  5625. end
  5626.  
  5627. self.tab.tabs[1].decorationLine = CreateFrame("Frame",nil,self.tab.tabs[1])
  5628. self.tab.tabs[1].decorationLine.texture = self.tab.tabs[1].decorationLine:CreateTexture(nil, "BACKGROUND")
  5629. self.tab.tabs[1].decorationLine:SetPoint("TOPLEFT",self.tab.tabs[1],-8,-8)
  5630. self.tab.tabs[1].decorationLine:SetPoint("BOTTOMRIGHT",self.tab.tabs[1],"TOPRIGHT",8,-28)
  5631. self.tab.tabs[1].decorationLine.texture:SetAllPoints()
  5632. self.tab.tabs[1].decorationLine.texture:SetColorTexture(1,1,1,1)
  5633. self.tab.tabs[1].decorationLine.texture:SetGradientAlpha("VERTICAL",.24,.25,.30,1,.27,.28,.33,1)
  5634.  
  5635. self.tab1tab = ELib:Tabs(self.tab.tabs[1],0,L.cd2Spells,L.cd2Columns):Size(600,100):Point(0,0)
  5636. self.tab1tab:SetBackdrop({})
  5637. local function SetFirstTabFrame(self)
  5638. if self._i == 1 then
  5639. module.options.borderList:Show()
  5640. module.options.colsSpells:Hide()
  5641. else
  5642. module.options.borderList:Hide()
  5643. module.options.colsSpells:Show()
  5644. end
  5645. end
  5646. for i=1,2 do
  5647. local frame = self.tab1tab.tabs[i].button
  5648. frame:ClearAllPoints()
  5649. if i == 1 then
  5650. frame:SetPoint("TOPLEFT",self.tab.tabs[1],"TOPLEFT",10,-4)
  5651. else
  5652. frame:SetPoint("LEFT", self.tab1tab.tabs[1].button, "RIGHT", 0, 0)
  5653. end
  5654. frame._i = i
  5655. frame.additionalFunc = SetFirstTabFrame
  5656. end
  5657.  
  5658. self.colsSpells = CreateFrame("Frame",nil,self.tab.tabs[1])
  5659. self.colsSpells:SetSize(650,SPELL_PAGE_HEIGHT)
  5660. self.colsSpells:SetPoint("TOP", 0, -38)
  5661. ELib:Border(self.colsSpells,2,.24,.25,.30,1)
  5662. self.colsSpells:Hide()
  5663.  
  5664. self.colsSpells.ScrollFrame = CreateFrame("ScrollFrame", nil, self.colsSpells)
  5665. self.colsSpells.ScrollFrame:SetPoint("TOPLEFT")
  5666. self.colsSpells.ScrollFrame:SetPoint("BOTTOMRIGHT")
  5667.  
  5668. self.colsSpells.C = CreateFrame("Frame", nil, self.colsSpells)
  5669. self.colsSpells.C:SetSize(650,SPELL_PAGE_HEIGHT+50)
  5670. self.colsSpells.ScrollFrame:SetScrollChild(self.colsSpells.C)
  5671.  
  5672. local function ColsSpellsUpdate()
  5673. local val = self.colsSpells.ScrollBar:GetValue()
  5674. self.colsSpells.ScrollBar:UpdateButtons()
  5675. module.options.colsSpells.ScrollFrame:SetVerticalScroll( val % 24 )
  5676. val = floor( val / 24 ) + 1
  5677. local line = 0
  5678. local count = 0
  5679. for i=1,#module.db.spellDB do
  5680. local spellData = module.db.spellDB[i]
  5681. local spellID = spellData[1]
  5682. if VExRT_CDE[ spellID ] then
  5683. local class = spellData[2]
  5684. local specsCount = module.db.specByClass[class] and #module.db.specByClass[class] or 1
  5685.  
  5686. for j=3,3+specsCount do
  5687. if spellData[j] then
  5688. count = count + 1
  5689. if count >= val then
  5690. line = line + 1
  5691. if line > #self.colsSpells.lines then
  5692. return
  5693. end
  5694. local lineFrame = self.colsSpells.lines[line]
  5695. lineFrame:Show()
  5696.  
  5697. local spellName,_,spellTexture = GetSpellInfo(spellID)
  5698. lineFrame.icon:SetTexture(spellTexture)
  5699. lineFrame.spellName:SetText(spellName)
  5700. lineFrame.link = "spell:"..(spellData[j][1] or spellID)
  5701.  
  5702. if j == 3 then
  5703. lineFrame.iconSpec:Hide()
  5704. else
  5705. lineFrame.iconSpec:Show()
  5706. lineFrame.iconSpec:SetTexture( module.db.specIcons[ module.db.specByClass[class][j - 2] ] or "" )
  5707. end
  5708.  
  5709. if CLASS_ICON_TCOORDS[class] then
  5710. lineFrame.iconClass:SetTexture("Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES")
  5711. lineFrame.iconClass:SetTexCoord(unpack(CLASS_ICON_TCOORDS[class]))
  5712. else
  5713. lineFrame.iconClass:SetTexture("")
  5714. end
  5715.  
  5716. for k=1,10 do
  5717. lineFrame.chk[k]:SetChecked(false)
  5718. end
  5719. local checked = VExRT.ExCD2.CDECol[spellData[j][1]..";"..(j-2)] or module.db.def_col[spellData[j][1]..";"..(j-2)] or 1
  5720. lineFrame.chk[checked]:SetChecked(true)
  5721.  
  5722. lineFrame.spellID = spellData[j][1]
  5723. lineFrame.specNum = j-2
  5724. end
  5725. end
  5726. end
  5727. end
  5728. end
  5729. for i=line+1,#self.colsSpells.lines do
  5730. self.colsSpells.lines[i]:Hide()
  5731. end
  5732. end
  5733. self.colsSpells:SetScript("OnShow",function(self)
  5734. local count = 0
  5735. for i=1,#module.db.spellDB do
  5736. local spellData = module.db.spellDB[i]
  5737. if VExRT_CDE[ spellData[1] ] then
  5738. local class = spellData[2]
  5739. local specsCount = module.db.specByClass[class] and #module.db.specByClass[class] or 1
  5740. for j=3,3+specsCount do
  5741. if spellData[j] then
  5742. count = count + 1
  5743. end
  5744. end
  5745. end
  5746. end
  5747.  
  5748. self.ScrollBar:SetMinMaxValues(0,max(0,(count+0.2)*24-SPELL_PAGE_HEIGHT))
  5749. ColsSpellsUpdate()
  5750. end)
  5751. self.colsSpells:SetScript("OnMouseWheel", function(self, delta)
  5752. delta = -delta
  5753. local current = module.options.colsSpells.ScrollBar:GetValue()
  5754. local min_,max_ = module.options.colsSpells.ScrollBar:GetMinMaxValues()
  5755. current = current + delta * 24
  5756. if current > max_ then
  5757. current = max_
  5758. elseif current < min_ then
  5759. current = min_
  5760. end
  5761. module.options.colsSpells.ScrollBar:SetValue(current)
  5762. end)
  5763.  
  5764. self.colsSpells.ScrollBar = ELib:ScrollBar(self.colsSpells):Size(16,0):Point("TOPRIGHT",-3,-3):Point("BOTTOMRIGHT",-3,3):Range(0,SPELL_PAGE_HEIGHT):SetTo(0):OnChange(ColsSpellsUpdate)
  5765. self.colsSpells.ScrollBar.slider:SetObeyStepOnDrag(true)
  5766.  
  5767. self.colsSpells.lines = {}
  5768. local function ColsSpellsSpellTooltipOnEnter(self)
  5769. ELib.Tooltip.Link(self,self:GetParent().link)
  5770. end
  5771. local function ColsSpellsSpellCheckboxClick(self)
  5772. for j=1,10 do
  5773. if j ~= self._i then
  5774. self.array[j]:SetChecked(false)
  5775. end
  5776. end
  5777. if not self:GetChecked() then
  5778. self:SetChecked(true)
  5779. end
  5780. VExRT.ExCD2.CDECol[self.main.spellID..";"..self.main.specNum] = self._i
  5781.  
  5782. UpdateRoster()
  5783. end
  5784. for i=1,23 do
  5785. local frame = CreateFrame("Frame",nil,self.colsSpells.C)
  5786. self.colsSpells.lines[i] = frame
  5787. frame:SetPoint("TOPLEFT",5,-3-(i-1)*24)
  5788. frame:SetSize(577,24)
  5789.  
  5790. frame.icon = frame:CreateTexture(nil, "ARTWORK")
  5791. frame.icon:SetSize(22,22)
  5792. frame.icon:SetPoint("TOPLEFT", 2, 0)
  5793. frame.icon:SetTexCoord(.1,.9,.1,.9)
  5794. ELib:Border(frame.icon,1,.12,.13,.15,1)
  5795.  
  5796. frame.tooltipFrame = CreateFrame("Frame",nil,frame)
  5797. frame.tooltipFrame:SetSize(150,24)
  5798. frame.tooltipFrame:SetPoint("TOPLEFT", 30, 0)
  5799. frame.tooltipFrame:SetScript("OnEnter", ColsSpellsSpellTooltipOnEnter)
  5800. frame.tooltipFrame:SetScript("OnLeave", GameTooltip_Hide)
  5801.  
  5802. frame.spellName = ELib:Text(frame):Size(156,24):Point(29,0):Font(ExRT.F.defFont,11):Shadow():Color()
  5803.  
  5804. frame.iconClass = frame:CreateTexture(nil, "ARTWORK")
  5805. frame.iconClass:SetSize(18,18)
  5806. frame.iconClass:SetPoint("TOPLEFT", 180, -3)
  5807.  
  5808. frame.iconSpec = frame:CreateTexture(nil, "ARTWORK")
  5809. frame.iconSpec:SetSize(18,18)
  5810. frame.iconSpec:SetPoint("TOPLEFT", 200, -3)
  5811.  
  5812. frame.chk = {}
  5813. for j=1,10 do
  5814. frame.chk[j] = ELib:Check(frame):Point("LEFT",240 + (j-1) * 25,0):Tooltip(j):OnClick(ColsSpellsSpellCheckboxClick)
  5815. frame.chk[j].array = frame.chk
  5816. frame.chk[j]._i = j
  5817. frame.chk[j].main = frame
  5818. end
  5819. end
  5820.  
  5821. module.options.ScrollBar:UpdateRange()
  5822. module.options:ReloadSpellsPage()
  5823.  
  5824.  
  5825. --> OPTIONS TAB2: Customize
  5826. self.optColHeader = ELib:Text(self.tab.tabs[2],L.cd2ColSet):Size(560,20):Point(15,-8)
  5827.  
  5828. function self:selectColumnTab()
  5829. local i = self and self.colID or module.options.optColTabs.selected
  5830. module.options.optColTabs.selected = i
  5831. module.options.optColTabs:UpdateTabs()
  5832.  
  5833. local isGeneralTab = i == (module.db.maxColumns + 1)
  5834.  
  5835. if isGeneralTab then
  5836. VExRT.ExCD2.colSet[i].frameGeneral = nil
  5837. VExRT.ExCD2.colSet[i].iconGeneral = nil
  5838. VExRT.ExCD2.colSet[i].textureGeneral = nil
  5839. VExRT.ExCD2.colSet[i].fontGeneral = nil
  5840. VExRT.ExCD2.colSet[i].textGeneral = nil
  5841. VExRT.ExCD2.colSet[i].methodsGeneral = nil
  5842. end
  5843.  
  5844. module.options.optColSet.chkEnable:SetChecked(VExRT.ExCD2.colSet[i].enabled)
  5845. module.options.optColSet.chkGeneral:SetChecked(VExRT.ExCD2.colSet[i].frameGeneral)
  5846.  
  5847. module.options.optColSet.sliderLinesNum:SetValue(VExRT.ExCD2.colSet[i].frameLines or module.db.colsDefaults.frameLines)
  5848. module.options.optColSet.sliderAlpha:SetValue(VExRT.ExCD2.colSet[i].frameAlpha or module.db.colsDefaults.frameAlpha)
  5849. module.options.optColSet.sliderScale:SetValue(VExRT.ExCD2.colSet[i].frameScale or module.db.colsDefaults.frameScale)
  5850. module.options.optColSet.sliderWidth:SetValue(VExRT.ExCD2.colSet[i].frameWidth or module.db.colsDefaults.frameWidth)
  5851. module.options.optColSet.sliderColsInCol:SetValue(VExRT.ExCD2.colSet[i].frameColumns or module.db.colsDefaults.frameColumns)
  5852. module.options.optColSet.sliderBetweenLines:SetValue(VExRT.ExCD2.colSet[i].frameBetweenLines or module.db.colsDefaults.frameBetweenLines)
  5853. module.options.optColSet.sliderBlackBack:SetValue(VExRT.ExCD2.colSet[i].frameBlackBack or module.db.colsDefaults.frameBlackBack)
  5854.  
  5855. module.options.optColSet.chkGeneral:doAlphas()
  5856.  
  5857. module.options.optColSet.sliderHeight:SetValue(VExRT.ExCD2.colSet[i].iconSize or module.db.colsDefaults.iconSize)
  5858. module.options.optColSet.chkGray:SetChecked(VExRT.ExCD2.colSet[i].iconGray)
  5859. module.options.optColSet.chkCooldown:SetChecked(VExRT.ExCD2.colSet[i].methodsCooldown)
  5860. module.options.optColSet.chkShowTitles:SetChecked(VExRT.ExCD2.colSet[i].iconTitles)
  5861. module.options.optColSet.chkHideBlizzardEdges:SetChecked(VExRT.ExCD2.colSet[i].iconHideBlizzardEdges)
  5862. module.options.optColSet.chkGeneralIcons:SetChecked(VExRT.ExCD2.colSet[i].iconGeneral)
  5863. do
  5864. local defIconPos = VExRT.ExCD2.colSet[i].iconPosition or module.db.colsDefaults.iconPosition
  5865. module.options.optColSet.dropDownIconPos:SetText( module.options.optColSet.dropDownIconPos.PosNames[defIconPos])
  5866. end
  5867.  
  5868. module.options.optColSet.chkGeneralIcons:doAlphas()
  5869.  
  5870. do
  5871. local texturePos = nil
  5872. for j=1,#ExRT.F.textureList do
  5873. if ExRT.F.textureList[j] == (VExRT.ExCD2.colSet[i].textureFile or ExRT.F.barImg) then
  5874. texturePos = j
  5875. break
  5876. end
  5877. end
  5878. if not texturePos and VExRT.ExCD2.colSet[i].textureFile then
  5879. texturePos = select(3,string.find(VExRT.ExCD2.colSet[i].textureFile,"\\([^\\]*)$"))
  5880. end
  5881. texturePos = texturePos or "Standart"
  5882. module.options.optColSet.dropDownTexture:SetText(L.cd2OtherSetTexture.." ["..texturePos.."]")
  5883. end
  5884. module.options.optColSet.colorPickerBorder.color:SetColorTexture(VExRT.ExCD2.colSet[i].textureBorderColorR or module.db.colsDefaults.textureBorderColorR,VExRT.ExCD2.colSet[i].textureBorderColorG or module.db.colsDefaults.textureBorderColorG,VExRT.ExCD2.colSet[i].textureBorderColorB or module.db.colsDefaults.textureBorderColorB, VExRT.ExCD2.colSet[i].textureBorderColorA or module.db.colsDefaults.textureBorderColorA)
  5885. module.options.optColSet.sliderBorderSize:SetValue(VExRT.ExCD2.colSet[i].textureBorderSize or module.db.colsDefaults.textureBorderSize)
  5886. module.options.optColSet.chkAnimation:SetChecked(VExRT.ExCD2.colSet[i].textureAnimation)
  5887. module.options.optColSet.chkHideSpark:SetChecked(VExRT.ExCD2.colSet[i].textureHideSpark)
  5888. module.options.optColSet.chkSmoothAnimation:SetChecked(VExRT.ExCD2.colSet[i].textureSmoothAnimation)
  5889. module.options.optColSet.sliderSmoothAnimationDuration:SetValue(VExRT.ExCD2.colSet[i].textureSmoothAnimationDuration or module.db.colsDefaults.textureSmoothAnimationDuration)
  5890. module.options.optColSet.chkGeneralColorize:SetChecked(VExRT.ExCD2.colSet[i].textureGeneral)
  5891.  
  5892. module.options.optColSet.chkGeneralColorize:doAlphas()
  5893.  
  5894. do
  5895. local FontNameForDropDown = select(3,string.find(VExRT.ExCD2.colSet[i].fontName or module.db.colsDefaults.fontName,"\\([^\\]*)$"))
  5896. module.options.optColSet.dropDownFont:SetText( (FontNameForDropDown or VExRT.ExCD2.colSet[i].fontName or module.db.colsDefaults.fontName or "?") )
  5897. end
  5898. module.options.optColSet.sliderFont:SetValue(VExRT.ExCD2.colSet[i].fontSize or module.db.colsDefaults.fontSize)
  5899. module.options.optColSet.chkFontOutline:SetChecked(VExRT.ExCD2.colSet[i].fontOutline)
  5900. module.options.optColSet.chkFontShadow:SetChecked(VExRT.ExCD2.colSet[i].fontShadow)
  5901. do
  5902. module.options.optColSet.chkFontOtherAvailable:SetChecked(VExRT.ExCD2.colSet[i].fontOtherAvailable)
  5903. module.options.fontOtherAvailable(VExRT.ExCD2.colSet[i].fontOtherAvailable)
  5904. if VExRT.ExCD2.colSet[i].fontOtherAvailable then
  5905. module.options.optColSet.nowFont = "fontLeft"
  5906. else
  5907. module.options.optColSet.nowFont = "font"
  5908. end
  5909. module.options.optColSet.fontsTab.selectFunc(module.options.optColSet.fontsTab.tabs[1].button)
  5910. end
  5911. module.options.optColSet.chkGeneralFont:SetChecked(VExRT.ExCD2.colSet[i].fontGeneral)
  5912.  
  5913. module.options.optColSet.chkGeneralFont:doAlphas()
  5914.  
  5915. module.options.optColSet.textLeftTemEdit:SetText(VExRT.ExCD2.colSet[i].textTemplateLeft or module.db.colsDefaults.textTemplateLeft)
  5916. module.options.optColSet.textRightTemEdit:SetText(VExRT.ExCD2.colSet[i].textTemplateRight or module.db.colsDefaults.textTemplateRight)
  5917. module.options.optColSet.textCenterTemEdit:SetText(VExRT.ExCD2.colSet[i].textTemplateCenter or module.db.colsDefaults.textTemplateCenter)
  5918. module.options.optColSet.chkIconName:SetChecked(VExRT.ExCD2.colSet[i].textIconName)
  5919. module.options.optColSet.chkGeneralText:SetChecked(VExRT.ExCD2.colSet[i].textGeneral)
  5920.  
  5921. module.options.optColSet.chkGeneralText:doAlphas()
  5922.  
  5923. module.options.optColSet.chkShowOnlyOnCD:SetChecked(VExRT.ExCD2.colSet[i].methodsShownOnCD)
  5924. module.options.optColSet.chkBotToTop:SetChecked(VExRT.ExCD2.colSet[i].frameAnchorBottom)
  5925. module.options.optColSet.chkGeneralMethods:SetChecked(VExRT.ExCD2.colSet[i].methodsGeneral)
  5926. do
  5927. local defStyleAnimation = VExRT.ExCD2.colSet[i].methodsStyleAnimation or module.db.colsDefaults.methodsStyleAnimation
  5928. module.options.optColSet.dropDownStyleAnimation:SetText( module.options.optColSet.dropDownStyleAnimation.Styles[defStyleAnimation])
  5929. local defTimeLineAnimation = VExRT.ExCD2.colSet[i].methodsTimeLineAnimation or module.db.colsDefaults.methodsTimeLineAnimation
  5930. module.options.optColSet.dropDownTimeLineAnimation:SetText(module.options.optColSet.dropDownTimeLineAnimation.Styles[defTimeLineAnimation])
  5931.  
  5932. local defSortingRules = VExRT.ExCD2.colSet[i].methodsSortingRules or module.db.colsDefaults.methodsSortingRules
  5933. module.options.optColSet.dropDownSortingRules:SetText(module.options.optColSet.dropDownSortingRules.Rules[defSortingRules])
  5934. end
  5935. module.options.optColSet.chkIconTooltip:SetChecked(VExRT.ExCD2.colSet[i].methodsIconTooltip)
  5936. module.options.optColSet.chkLineClick:SetChecked(VExRT.ExCD2.colSet[i].methodsLineClick)
  5937. module.options.optColSet.chkNewSpellNewLine:SetChecked(VExRT.ExCD2.colSet[i].methodsNewSpellNewLine)
  5938. module.options.optColSet.chkHideOwnSpells:SetChecked(VExRT.ExCD2.colSet[i].methodsHideOwnSpells)
  5939. module.options.optColSet.chkAlphaNotInRange:SetChecked(VExRT.ExCD2.colSet[i].methodsAlphaNotInRange)
  5940. module.options.optColSet.sliderAlphaNotInRange:SetValue(VExRT.ExCD2.colSet[i].methodsAlphaNotInRangeNum or module.db.colsDefaults.methodsAlphaNotInRangeNum)
  5941. module.options.optColSet.chkDisableActive:SetChecked(VExRT.ExCD2.colSet[i].methodsDisableActive)
  5942. module.options.optColSet.chkOneSpellPerCol:SetChecked(VExRT.ExCD2.colSet[i].methodsOneSpellPerCol)
  5943. module.options.optColSet.chkOnlyInCombat:SetChecked(VExRT.ExCD2.colSet[i].methodsOnlyInCombat)
  5944.  
  5945. module.options.optColSet.chkGeneralMethods:doAlphas()
  5946.  
  5947. module.options.optColSet.blacklistEditBox.EditBox:SetText(VExRT.ExCD2.colSet[i].blacklistText or module.db.colsDefaults.blacklistText)
  5948. module.options.optColSet.whitelistEditBox.EditBox:SetText(VExRT.ExCD2.colSet[i].whitelistText or module.db.colsDefaults.whitelistText)
  5949. module.options.optColSet.chkGeneralBlackList:SetChecked(VExRT.ExCD2.colSet[i].blacklistGeneral)
  5950.  
  5951. module.options.optColSet.chkGeneralBlackList:doAlphas()
  5952.  
  5953. module.options.optColSet.chkVisibilityPartyTypeAlways:SetChecked(not VExRT.ExCD2.colSet[i].visibilityPartyType)
  5954. module.options.optColSet.chkVisibilityPartyTypeParty:SetChecked(VExRT.ExCD2.colSet[i].visibilityPartyType == 1)
  5955. module.options.optColSet.chkVisibilityPartyTypeRaid:SetChecked(VExRT.ExCD2.colSet[i].visibilityPartyType == 2)
  5956. module.options.optColSet.chkVisibilityZoneArena:SetChecked(not VExRT.ExCD2.colSet[i].visibilityDisableArena)
  5957. module.options.optColSet.chkVisibilityZoneBG:SetChecked(not VExRT.ExCD2.colSet[i].visibilityDisableBG)
  5958. module.options.optColSet.chkVisibilityZoneScenario:SetChecked(not VExRT.ExCD2.colSet[i].visibilityDisable3ppl)
  5959. module.options.optColSet.chkVisibilityZone5ppl:SetChecked(not VExRT.ExCD2.colSet[i].visibilityDisable5ppl)
  5960. module.options.optColSet.chkVisibilityZoneRaid:SetChecked(not VExRT.ExCD2.colSet[i].visibilityDisableRaid)
  5961. module.options.optColSet.chkVisibilityZoneOutdoor:SetChecked(not VExRT.ExCD2.colSet[i].visibilityDisableWorld)
  5962. module.options.optColSet.chkGeneralVisibility:SetChecked(VExRT.ExCD2.colSet[i].visibilityGeneral)
  5963.  
  5964. module.options.optColSet.chkGeneralVisibility:doAlphas()
  5965.  
  5966. ExRT.lib.ShowOrHide(module.options.optColSet.chkEnable,not isGeneralTab)
  5967. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneral,not isGeneralTab)
  5968.  
  5969. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralIcons,not isGeneralTab)
  5970. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralColorize,not isGeneralTab)
  5971. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralFont,not isGeneralTab)
  5972. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralText,not isGeneralTab)
  5973. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralMethods,not isGeneralTab)
  5974. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralVisibility,not isGeneralTab)
  5975. ExRT.lib.ShowOrHide(module.options.optColSet.chkGeneralBlackList,not isGeneralTab)
  5976.  
  5977. ExRT.lib.ShowOrHide(module.options.optColSet.chkSortByAvailability,isGeneralTab)
  5978. ExRT.lib.ShowOrHide(module.options.optColSet.chkSortByAvailability_activeToTop,isGeneralTab)
  5979. ExRT.lib.ShowOrHide(module.options.optColSet.chkReverseSorting,isGeneralTab)
  5980.  
  5981. module.options.showColorFrame(module.options.colorSetupFrame)
  5982.  
  5983. if self then
  5984. module.options.optColSet.templateRestore:Hide()
  5985. end
  5986. end
  5987.  
  5988. self.optColSet = {}
  5989. do
  5990. local tmpArr = {}
  5991. for i=1,module.db.maxColumns do
  5992. tmpArr[i] = tostring(i)
  5993. end
  5994. tmpArr[module.db.maxColumns+1] = L.cd2GeneralSet
  5995. self.optColTabs = ELib:Tabs(self.tab.tabs[2],0,unpack(tmpArr)):Size(660,417):Point(0,-48):SetTo(module.db.maxColumns+1)
  5996. end
  5997. for i=1,module.db.maxColumns+1 do
  5998. self.optColTabs.tabs[i].button.colID = i
  5999. self.optColTabs.tabs[i].button:SetScript("OnClick", self.selectColumnTab)
  6000. end
  6001.  
  6002. self.optColTabs:SetBackdropBorderColor(0,0,0,0)
  6003. self.optColTabs:SetBackdropColor(0,0,0,0)
  6004.  
  6005. self.tab.tabs[2].decorationLine = CreateFrame("Frame",nil,self.tab.tabs[2])
  6006. self.tab.tabs[2].decorationLine.texture = self.tab.tabs[2].decorationLine:CreateTexture(nil, "BACKGROUND")
  6007. self.tab.tabs[2].decorationLine:SetPoint("TOPLEFT",self.tab.tabs[2],-8,-28)
  6008. self.tab.tabs[2].decorationLine:SetPoint("BOTTOMRIGHT",self.tab.tabs[2],"TOPRIGHT",8,-48)
  6009. self.tab.tabs[2].decorationLine.texture:SetAllPoints()
  6010. self.tab.tabs[2].decorationLine.texture:SetColorTexture(1,1,1,1)
  6011. self.tab.tabs[2].decorationLine.texture:SetGradientAlpha("VERTICAL",.24,.25,.30,1,.27,.28,.33,1)
  6012.  
  6013.  
  6014. self.optColSet.superTabFrame = ExRT.lib:ScrollTabsFrame(self.optColTabs,L.cd2OtherSetTabNameGeneral,L.cd2OtherSetTabNameIcons,L.cd2OtherSetTabNameColors,L.cd2OtherSetTabNameFont,L.cd2OtherSetTabNameText,L.cd2OtherSetTabNameOther,L.cd2OtherSetTabNameVisibility,L.cd2OtherSetTabNameBlackList,L.cd2OtherSetTabNameTemplate):Size(660,450):Point("TOP",0,-10)
  6015.  
  6016. self.optColSet.chkEnable = ELib:Check(self.optColSet.superTabFrame.tab[1],"|cff00ff00 >>>"..L.senable.."<<<"):Point(10,-10):OnClick(function(self)
  6017. if self:GetChecked() then
  6018. VExRT.ExCD2.colSet[module.options.optColTabs.selected].enabled = true
  6019. else
  6020. VExRT.ExCD2.colSet[module.options.optColTabs.selected].enabled = nil
  6021. end
  6022. module:ReloadAllSplits()
  6023. end)
  6024.  
  6025. self.optColSet.chkGeneral = ELib:Check(self.optColSet.superTabFrame.tab[1],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6026. if self:GetChecked() then
  6027. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameGeneral = true
  6028. else
  6029. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameGeneral = nil
  6030. end
  6031. module:ReloadAllSplits()
  6032. self:doAlphas()
  6033. end)
  6034. function self.optColSet.chkGeneral:doAlphas()
  6035. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.sliderLinesNum,module.options.optColSet.sliderAlpha,module.options.optColSet.sliderScale,module.options.optColSet.sliderWidth,module.options.optColSet.sliderColsInCol,module.options.optColSet.sliderBetweenLines,module.options.optColSet.sliderBlackBack,module.options.optColSet.butToCenter)
  6036. end
  6037.  
  6038. self.optColSet.sliderLinesNum = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2lines):Size(400):Point("TOP",0,-50):Range(1,module.db.maxLinesInCol):OnChange(function(self,event)
  6039. event = event - event%1
  6040. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameLines = event
  6041. self.tooltipText = event
  6042. self:tooltipReload(self)
  6043. module:ReloadAllSplits()
  6044. end)
  6045.  
  6046. self.optColSet.sliderWidth = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2width):Size(400):Point("TOP",0,-85):Range(1,400):OnChange(function(self,event)
  6047. event = event - event%1
  6048. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameWidth = event
  6049. self.tooltipText = event
  6050. self:tooltipReload(self)
  6051. module:ReloadAllSplits()
  6052. end)
  6053.  
  6054. self.optColSet.sliderAlpha = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2alpha):Size(400):Point("TOP",0,-120):Range(0,100):OnChange(function(self,event)
  6055. event = event - event%1
  6056. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameAlpha = event
  6057. self.tooltipText = event
  6058. self:tooltipReload(self)
  6059. module:ReloadAllSplits()
  6060. end)
  6061.  
  6062. self.optColSet.sliderScale = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2scale):Size(400):Point("TOP",0,-155):Range(5,200):OnChange(function(self,event)
  6063. event = event - event%1
  6064. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameScale = event
  6065. self.tooltipText = event
  6066. self:tooltipReload(self)
  6067. module:ReloadAllSplits("ScaleFix")
  6068. end)
  6069.  
  6070. self.optColSet.sliderColsInCol = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2ColSetColsInCol):Size(400):Point("TOP",0,-190):Range(1,module.db.maxLinesInCol):OnChange(function(self,event)
  6071. event = event - event%1
  6072. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameColumns = event
  6073. self.tooltipText = event
  6074. self:tooltipReload(self)
  6075. module:ReloadAllSplits()
  6076. end)
  6077.  
  6078. self.optColSet.sliderBetweenLines = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2ColSetBetweenLines):Size(400):Point("TOP",0,-225):Range(0,20):OnChange(function(self,event)
  6079. event = event - event%1
  6080. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameBetweenLines = event
  6081. self.tooltipText = event
  6082. self:tooltipReload(self)
  6083. module:ReloadAllSplits()
  6084. end)
  6085.  
  6086. self.optColSet.sliderBlackBack = ELib:Slider(self.optColSet.superTabFrame.tab[1],L.cd2BlackBack):Size(400):Point("TOP",0,-260):Range(0,100):OnChange(function(self,event)
  6087. event = event - event%1
  6088. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameBlackBack = event
  6089. self.tooltipText = event
  6090. self:tooltipReload(self)
  6091. module:ReloadAllSplits()
  6092. end)
  6093.  
  6094. self.optColSet.butToCenter = ELib:Button(self.optColSet.superTabFrame.tab[1],L.cd2ColSetResetPos):Size(200,20):Point("TOP",0,-295):OnClick(function(self)
  6095. if (module.db.maxColumns + 1) == module.options.optColTabs.selected then
  6096. module.frame:ClearAllPoints()
  6097. module.frame:SetPoint("CENTER",UIParent,"CENTER",0,0)
  6098. else
  6099. module.frame.colFrame[module.options.optColTabs.selected]:ClearAllPoints()
  6100. module.frame.colFrame[module.options.optColTabs.selected]:SetPoint("CENTER",UIParent,"CENTER",0,0)
  6101. end
  6102. end)
  6103.  
  6104. --> Icon and height options
  6105.  
  6106. self.optColSet.sliderHeight = ELib:Slider(self.optColSet.superTabFrame.tab[2],L.cd2OtherSetIconSize):Size(400):Point("TOP",0,-50):Range(6,128):OnChange(function(self,event)
  6107. event = event - event%1
  6108. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconSize = event
  6109. module:ReloadAllSplits()
  6110. self.tooltipText = event
  6111. self:tooltipReload(self)
  6112. end)
  6113.  
  6114. self.optColSet.chkGray = ELib:Check(self.optColSet.superTabFrame.tab[2],L.cd2graytooltip):Point(10,-110):OnClick(function(self)
  6115. if self:GetChecked() then
  6116. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconGray = true
  6117. else
  6118. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconGray = nil
  6119. end
  6120. module:ReloadAllSplits()
  6121. end)
  6122.  
  6123. self.optColSet.textIconPos = ELib:Text(self.optColSet.superTabFrame.tab[2],L.cd2OtherSetIconPosition..":"):Size(200,20):Point(10,-85)
  6124. self.optColSet.dropDownIconPos = ELib:DropDown(self.optColSet.superTabFrame.tab[2],190,3):Size(200):Point(180,-85)
  6125. self.optColSet.dropDownIconPos.PosNames = {L.cd2OtherSetIconPositionLeft,L.cd2OtherSetIconPositionRight,L.cd2OtherSetIconPositionNo}
  6126. for i=1,#self.optColSet.dropDownIconPos.PosNames do
  6127. self.optColSet.dropDownIconPos.List[i] = {
  6128. text = self.optColSet.dropDownIconPos.PosNames[i],
  6129. arg1 = i,
  6130. func = function (self,arg)
  6131. ELib:DropDownClose()
  6132. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconPosition = arg
  6133. module:ReloadAllSplits()
  6134. module.options.optColSet.dropDownIconPos:SetText(module.options.optColSet.dropDownIconPos.PosNames[arg])
  6135. end,
  6136. }
  6137. end
  6138.  
  6139. self.optColSet.chkCooldown = ELib:Check(self.optColSet.superTabFrame.tab[2],L.cd2ColSetMethodCooldown):Point(10,-135):OnClick(function(self)
  6140. if self:GetChecked() then
  6141. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsCooldown = true
  6142. else
  6143. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsCooldown = nil
  6144. end
  6145. module:ReloadAllSplits()
  6146. end)
  6147.  
  6148. self.optColSet.chkShowTitles = ELib:Check(self.optColSet.superTabFrame.tab[2],L.cd2ColSetShowTitles):Point(10,-160):OnClick(function(self)
  6149. if self:GetChecked() then
  6150. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconTitles = true
  6151. else
  6152. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconTitles = nil
  6153. end
  6154. module:ReloadAllSplits()
  6155. end)
  6156.  
  6157. self.optColSet.chkHideBlizzardEdges = ELib:Check(self.optColSet.superTabFrame.tab[2],L.cd2ColSetIconHideBlizzardEdges):Point(10,-185):OnClick(function(self)
  6158. if self:GetChecked() then
  6159. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconHideBlizzardEdges = true
  6160. else
  6161. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconHideBlizzardEdges = nil
  6162. end
  6163. module:ReloadAllSplits()
  6164. end)
  6165.  
  6166. self.optColSet.chkGeneralIcons = ELib:Check(self.optColSet.superTabFrame.tab[2],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6167. if self:GetChecked() then
  6168. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconGeneral = true
  6169. else
  6170. VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconGeneral = nil
  6171. end
  6172. module:ReloadAllSplits()
  6173. self:doAlphas()
  6174. end)
  6175. function self.optColSet.chkGeneralIcons:doAlphas()
  6176. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].iconGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.chkGray,module.options.optColSet.sliderHeight,module.options.optColSet.dropDownIconPos,module.options.optColSet.chkCooldown,module.options.optColSet.chkShowTitles,module.options.optColSet.chkHideBlizzardEdges)
  6177. end
  6178.  
  6179. --> Texture and colors Options
  6180.  
  6181. local function dropDownTextureButtonClick(self,arg,name)
  6182. ELib:DropDownClose()
  6183. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureFile = arg
  6184. module:ReloadAllSplits()
  6185. module.options.optColSet.dropDownTexture:SetText(L.cd2OtherSetTexture.." ["..name.."]")
  6186. end
  6187.  
  6188. self.optColSet.textDDTexture = ELib:Text(self.optColSet.superTabFrame.tab[3],L.cd2OtherSetTexture..":"):Size(200,20):Point(10,-35)
  6189. self.optColSet.dropDownTexture = ELib:DropDown(self.optColSet.superTabFrame.tab[3],200,15):Size(200):Point(180,-35)
  6190. for i=1,#ExRT.F.textureList do
  6191. self.optColSet.dropDownTexture.List[i] = {}
  6192. local info = self.optColSet.dropDownTexture.List[i]
  6193. info.text = i
  6194. info.arg1 = ExRT.F.textureList[i]
  6195. info.arg2 = i
  6196. info.func = dropDownTextureButtonClick
  6197. info.texture = ExRT.F.textureList[i]
  6198. info.justifyH = "CENTER"
  6199. end
  6200. if LibStub then
  6201. local loaded,media = pcall(LibStub,"LibSharedMedia-3.0")
  6202. if loaded and media then
  6203. local barsList = media:HashTable("statusbar")
  6204. if barsList then
  6205. local count = #self.optColSet.dropDownTexture.List
  6206. for key,texture in pairs(barsList) do
  6207. count = count + 1
  6208. self.optColSet.dropDownTexture.List[count] = {}
  6209. local info = self.optColSet.dropDownTexture.List[count]
  6210.  
  6211. info.text = key
  6212. info.arg1 = texture
  6213. info.arg2 = key
  6214. info.func = dropDownTextureButtonClick
  6215. info.texture = texture
  6216. info.justifyH = "CENTER"
  6217. end
  6218. end
  6219. end
  6220. end
  6221.  
  6222. self.optColSet.textDDBorder = ELib:Text(self.optColSet.superTabFrame.tab[3],L.cd2OtherSetBorder..":"):Size(200,20):Point(10,-65)
  6223. self.optColSet.sliderBorderSize = ELib:Slider(self.optColSet.superTabFrame.tab[3],""):Size(170):Point(180,-68):Range(0,20):OnChange(function(self,event)
  6224. event = event - event%1
  6225. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderSize = event
  6226. self.tooltipText = event
  6227. self:tooltipReload(self)
  6228. module:ReloadAllSplits()
  6229. end)
  6230. self.optColSet.colorPickerBorder = ExRT.lib.CreateColorPickButton(self.optColSet.superTabFrame.tab[3],20,20,nil,361,-65)
  6231. self.optColSet.colorPickerBorder:SetScript("OnClick",function (self)
  6232. ColorPickerFrame.previousValues = {VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorR or module.db.colsDefaults.textureBorderColorR,VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorG or module.db.colsDefaults.textureBorderColorG,VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorB or module.db.colsDefaults.textureBorderColorB, VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorA or module.db.colsDefaults.textureBorderColorA}
  6233. ColorPickerFrame.hasOpacity = true
  6234. local nilFunc = ExRT.NULLfunc
  6235. local function changedCallback(restore)
  6236. local newR, newG, newB, newA
  6237. if restore then
  6238. newR, newG, newB, newA = unpack(restore)
  6239. else
  6240. newA, newR, newG, newB = OpacitySliderFrame:GetValue(), ColorPickerFrame:GetColorRGB()
  6241. end
  6242. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorR = newR
  6243. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorG = newG
  6244. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorB = newB
  6245. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorA = newA
  6246. module:ReloadAllSplits()
  6247.  
  6248. self.color:SetColorTexture(newR,newG,newB,newA)
  6249. end
  6250. ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc = nilFunc, nilFunc, nilFunc
  6251. ColorPickerFrame.opacity = VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorA or module.db.colsDefaults.textureBorderColorA
  6252. ColorPickerFrame:SetColorRGB(VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorR or module.db.colsDefaults.textureBorderColorR,VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorG or module.db.colsDefaults.textureBorderColorG,VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureBorderColorB or module.db.colsDefaults.textureBorderColorB)
  6253. ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc = changedCallback, changedCallback, changedCallback
  6254. ColorPickerFrame:Show()
  6255. end)
  6256.  
  6257. self.optColSet.chkAnimation = ELib:Check(self.optColSet.superTabFrame.tab[3],L.cd2OtherSetAnimation):Point(10,-97):OnClick(function(self)
  6258. if self:GetChecked() then
  6259. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureAnimation = true
  6260. else
  6261. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureAnimation = nil
  6262. end
  6263. module:ReloadAllSplits()
  6264. end)
  6265.  
  6266. self.optColSet.chkHideSpark = ELib:Check(self.optColSet.superTabFrame.tab[3],L.cd2OtherSetHideSpark):Point(200,-97):OnClick(function(self)
  6267. if self:GetChecked() then
  6268. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureHideSpark = true
  6269. else
  6270. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureHideSpark = nil
  6271. end
  6272. module:ReloadAllSplits()
  6273. end)
  6274.  
  6275. self.optColSet.chkSmoothAnimation = ELib:Check(self.optColSet.superTabFrame.tab[3],L.cd2TextureSmoothAnim):Point(10,-122):OnClick(function(self)
  6276. if self:GetChecked() then
  6277. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureSmoothAnimation = true
  6278. else
  6279. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureSmoothAnimation = nil
  6280. end
  6281. module:ReloadAllSplits()
  6282. end)
  6283.  
  6284. self.optColSet.sliderSmoothAnimationDuration = ELib:Slider(self.optColSet.superTabFrame.tab[3],""):Size(140):Point("TOP",self.optColSet.chkSmoothAnimation,0,-2):Point("LEFT",self.optColSet.chkSmoothAnimation.text,"RIGHT",20,0):Range(10,200):OnChange(function(self,event)
  6285. event = event - event%1
  6286. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureSmoothAnimationDuration = event
  6287. module:ReloadAllSplits()
  6288. self.tooltipText = event / 100
  6289. self:tooltipReload(self)
  6290. end)
  6291. self.optColSet.sliderSmoothAnimationDuration.Low:SetText("0.1")
  6292. self.optColSet.sliderSmoothAnimationDuration.High:SetText("2")
  6293.  
  6294.  
  6295. self.colorSetupFrame = CreateFrame("Frame",nil,self.optColSet.superTabFrame.tab[3])
  6296. self.colorSetupFrame:SetSize(420,290)
  6297. self.colorSetupFrame:SetPoint("TOP",0,-135)
  6298.  
  6299. self.colorSetupFrame.backAlpha = ELib:Slider(self.colorSetupFrame,L.cd2OtherSetColorFrameAlpha):Size(400):Point("TOP",0,-163):Range(0,100)
  6300. self.colorSetupFrame.backCDAlpha = ELib:Slider(self.colorSetupFrame,L.cd2OtherSetColorFrameAlphaCD):Size(400):Point("TOP",0,-198):Range(0,100)
  6301. self.colorSetupFrame.backCooldownAlpha = ELib:Slider(self.colorSetupFrame,L.cd2OtherSetColorFrameAlphaCooldown):Size(400):Point("TOP",0,-233):Range(0,100)
  6302. self.colorSetupFrame.backAlpha.inOptName = "textureAlphaBackground"
  6303. self.colorSetupFrame.backCDAlpha.inOptName = "textureAlphaTimeLine"
  6304. self.colorSetupFrame.backCooldownAlpha.inOptName = "textureAlphaCooldown"
  6305.  
  6306. local function colorPickerButtonClick(self)
  6307. ColorPickerFrame.previousValues = {VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."R"] or module.db.colsDefaults[self.inOptName.."R"],VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."G"] or module.db.colsDefaults[self.inOptName.."G"],VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."B"] or module.db.colsDefaults[self.inOptName.."B"], 1}
  6308. local nilFunc = ExRT.NULLfunc
  6309. local function changedCallback(restore)
  6310. local newR, newG, newB, newA
  6311. if restore then
  6312. newR, newG, newB, newA = unpack(restore)
  6313. else
  6314. newA, newR, newG, newB = OpacitySliderFrame:GetValue(), ColorPickerFrame:GetColorRGB()
  6315. end
  6316. VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."R"] = newR
  6317. VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."G"] = newG
  6318. VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."B"] = newB
  6319. module:ReloadAllSplits()
  6320.  
  6321. self.color:SetColorTexture(newR,newG,newB,1)
  6322. end
  6323. ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc = nilFunc, nilFunc, nilFunc
  6324. ColorPickerFrame:SetColorRGB(VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."R"] or module.db.colsDefaults[self.inOptName.."R"],VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."G"] or module.db.colsDefaults[self.inOptName.."G"],VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName.."B"] or module.db.colsDefaults[self.inOptName.."B"])
  6325. ColorPickerFrame.func, ColorPickerFrame.cancelFunc = changedCallback, changedCallback
  6326. ColorPickerFrame:Show()
  6327. end
  6328.  
  6329. local function colorPickerSliderValue(self,newval)
  6330. VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName] = newval / 100
  6331. module:ReloadAllSplits()
  6332. self.tooltipText = ExRT.F.Round(newval)
  6333. self:tooltipReload(self)
  6334. end
  6335.  
  6336. local function colorPickerCheckBoxClick(self)
  6337. if self:GetChecked() then
  6338. VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName] = true
  6339. else
  6340. VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.inOptName] = nil
  6341. end
  6342. module:ReloadAllSplits()
  6343. end
  6344.  
  6345. local colorSetupFrameColorsNames_TopText = {L.cd2OtherSetColorFrameTopText,L.cd2OtherSetColorFrameTopBack,L.cd2OtherSetColorFrameTopTimeLine}
  6346. for i=1,3 do
  6347. self.colorSetupFrame["topText"..i] = ELib:Text(self.colorSetupFrame,colorSetupFrameColorsNames_TopText[i],12):Size(50,20):Point(225+(i-1)*40,-15):Center():Color():Shadow()
  6348. end
  6349.  
  6350. local colorSetupFrameColorsNames_Text = {L.cd2OtherSetColorFrameText..":",L.cd2OtherSetColorFrameActive..":",L.cd2OtherSetColorFrameCooldown..":"}
  6351. for j=1,3 do
  6352. for i=1,3 do
  6353. self.colorSetupFrame["color"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]] = ExRT.lib.CreateColorPickButton(self.colorSetupFrame,20,20,nil,240+(i-1)*40,-35-(j-1)*20)
  6354. self.colorSetupFrame["color"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]].inOptName = "textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]
  6355. self.colorSetupFrame["color"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]]:SetScript("OnClick",colorPickerButtonClick)
  6356. end
  6357. self.colorSetupFrame["text"..colorSetupFrameColorsNames[j]] = ELib:Text(self.colorSetupFrame,colorSetupFrameColorsNames_Text[j],12):Size(210,20):Point(10,-35-(j-1)*20):Right():Color():Shadow()
  6358. end
  6359.  
  6360. local checksInOptNames = {"textureClassText","textureClassBackground","textureClassTimeLine"}
  6361. for i=1,3 do
  6362. self.colorSetupFrame["colorClass"..colorSetupFrameColorsObjectsNames[i]] = ELib:Check(self.colorSetupFrame,""):Point(241+(i-1)*40,-117):Size(18,18):OnClick(colorPickerCheckBoxClick)
  6363. self.colorSetupFrame["colorClass"..colorSetupFrameColorsObjectsNames[i]].inOptName = checksInOptNames[i]
  6364. end
  6365. self.colorSetupFrame["textClass"] = ELib:Text(self.colorSetupFrame,L.cd2OtherSetColorFrameClass..":",12):Size(210,20):Point(10,-115):Right():Color():Shadow()
  6366.  
  6367. self.colorSetupFrame.backAlpha:SetScript("OnValueChanged",colorPickerSliderValue)
  6368. self.colorSetupFrame.backCDAlpha:SetScript("OnValueChanged",colorPickerSliderValue)
  6369. self.colorSetupFrame.backCooldownAlpha:SetScript("OnValueChanged",colorPickerSliderValue)
  6370.  
  6371. self.colorSetupFrame.resetButton = ELib:Button(self.colorSetupFrame,L.cd2OtherSetColorFrameReset):Size(160,20):Point("TOP",-81,-265)
  6372. self.colorSetupFrame.softenButton = ELib:Button(self.colorSetupFrame,L.cd2OtherSetColorFrameSoften):Size(160,20):Point("TOP",81,-265)
  6373.  
  6374. self.colorSetupFrame.softenButton:SetScript("OnClick",function()
  6375. local tmpColors = {"R","G","B"}
  6376. for j=1,3 do
  6377. for i=1,3 do
  6378. local maxColor = 0
  6379. for n=1,3 do
  6380. local color = VExRT.ExCD2.colSet[module.options.optColTabs.selected]["textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]..tmpColors[n]] or module.db.colsDefaults["textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]..tmpColors[n]]
  6381. maxColor = max(maxColor,color)
  6382. end
  6383. for n=1,3 do
  6384. local color = VExRT.ExCD2.colSet[module.options.optColTabs.selected]["textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]..tmpColors[n]] or module.db.colsDefaults["textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]..tmpColors[n]]
  6385. if color < maxColor then
  6386. VExRT.ExCD2.colSet[module.options.optColTabs.selected]["textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]..tmpColors[n]] = color + (maxColor - color) / 2
  6387. end
  6388. end
  6389. end
  6390. end
  6391. module.options.showColorFrame(module.options.colorSetupFrame)
  6392. module:ReloadAllSplits()
  6393. end)
  6394.  
  6395. self.colorSetupFrame.resetButton:SetScript("OnClick",function()
  6396. local tmpColors = {"R","G","B"}
  6397. for j=1,4 do
  6398. for i=1,3 do
  6399. for n=1,3 do
  6400. VExRT.ExCD2.colSet[module.options.optColTabs.selected]["textureColor"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]..tmpColors[n]] = nil
  6401. end
  6402. end
  6403. end
  6404. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureAlphaBackground = nil
  6405. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureAlphaTimeLine = nil
  6406. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureAlphaCooldown = nil
  6407. for i=1,3 do
  6408. VExRT.ExCD2.colSet[module.options.optColTabs.selected][ checksInOptNames[i] ] = nil
  6409. end
  6410. module.options.showColorFrame(module.options.colorSetupFrame)
  6411. module:ReloadAllSplits()
  6412. end)
  6413.  
  6414. function self:showColorFrame()
  6415. for j=1,3 do
  6416. for i=1,3 do
  6417. local this = module.options.colorSetupFrame["color"..colorSetupFrameColorsObjectsNames[i]..colorSetupFrameColorsNames[j]]
  6418. this.color:SetColorTexture(VExRT.ExCD2.colSet[module.options.optColTabs.selected][this.inOptName.."R"] or module.db.colsDefaults[this.inOptName.."R"],VExRT.ExCD2.colSet[module.options.optColTabs.selected][this.inOptName.."G"] or module.db.colsDefaults[this.inOptName.."G"],VExRT.ExCD2.colSet[module.options.optColTabs.selected][this.inOptName.."B"] or module.db.colsDefaults[this.inOptName.."B"],1)
  6419. end
  6420. end
  6421. for i=1,3 do
  6422. module.options.colorSetupFrame["colorClass"..colorSetupFrameColorsObjectsNames[i]]:SetChecked( VExRT.ExCD2.colSet[module.options.optColTabs.selected][ checksInOptNames[i] ] )
  6423. end
  6424.  
  6425. self.backAlpha:SetValue((VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.backAlpha.inOptName] or module.db.colsDefaults[self.backAlpha.inOptName])*100)
  6426. self.backCDAlpha:SetValue((VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.backCDAlpha.inOptName] or module.db.colsDefaults[self.backCDAlpha.inOptName])*100)
  6427. self.backCooldownAlpha:SetValue((VExRT.ExCD2.colSet[module.options.optColTabs.selected][self.backCooldownAlpha.inOptName] or module.db.colsDefaults[self.backCooldownAlpha.inOptName])*100)
  6428. end
  6429.  
  6430. self.colorSetupFrame:SetScript("OnShow",self.showColorFrame)
  6431.  
  6432.  
  6433. self.optColSet.chkGeneralColorize = ELib:Check(self.optColSet.superTabFrame.tab[3],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6434. if self:GetChecked() then
  6435. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureGeneral = true
  6436. else
  6437. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureGeneral = nil
  6438. end
  6439. module:ReloadAllSplits()
  6440. self:doAlphas()
  6441. end)
  6442. function self.optColSet.chkGeneralColorize:doAlphas()
  6443. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].textureGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.dropDownTexture,module.options.optColSet.chkAnimation,module.options.colorSetupFrame,module.options.optColSet.colorPickerBorder,module.options.optColSet.sliderBorderSize,module.options.optColSet.chkHideSpark)
  6444. end
  6445.  
  6446. --> Font Options
  6447. self.optColSet.nowFont = "font"
  6448.  
  6449. self.optColSet.superTabFrame.tab[4].decorationLine = CreateFrame("Frame",nil,self.optColSet.superTabFrame.tab[4])
  6450. self.optColSet.superTabFrame.tab[4].decorationLine.texture = self.optColSet.superTabFrame.tab[4].decorationLine:CreateTexture(nil, "BACKGROUND")
  6451. self.optColSet.superTabFrame.tab[4].decorationLine:SetPoint("TOPLEFT",self.optColSet.superTabFrame.tab[4],0,-35)
  6452. self.optColSet.superTabFrame.tab[4].decorationLine:SetPoint("BOTTOMRIGHT",self.optColSet.superTabFrame.tab[4],"TOPRIGHT",0,-55)
  6453. self.optColSet.superTabFrame.tab[4].decorationLine.texture:SetAllPoints()
  6454. self.optColSet.superTabFrame.tab[4].decorationLine.texture:SetColorTexture(1,1,1,1)
  6455. self.optColSet.superTabFrame.tab[4].decorationLine.texture:SetGradientAlpha("VERTICAL",.24,.25,.30,1,.27,.28,.33,1)
  6456.  
  6457. self.optColSet.fontsTab = ELib:Tabs(self.optColSet.superTabFrame.tab[4],0,L.cd2ColSetFontPosGeneral,L.cd2ColSetFontPosRight,L.cd2ColSetFontPosCenter,L.cd2ColSetFontPosIcon):Size(455,160):Point(0,-55)
  6458. self.optColSet.fontsTab:SetBackdropBorderColor(0,0,0,0)
  6459. self.optColSet.fontsTab:SetBackdropColor(0,0,0,0)
  6460. local function fontsTabButtonClick(self)
  6461. local tabFrame = self.mainFrame
  6462. tabFrame.selected = self.id
  6463. tabFrame.UpdateTabs(tabFrame)
  6464.  
  6465. module.options.optColSet.nowFont = self.fontMark
  6466.  
  6467. local i = module.options.optColTabs.selected
  6468. do
  6469. local FontNameForDropDown = select(3,string.find(VExRT.ExCD2.colSet[i][self.fontMark.."Name"] or module.db.colsDefaults.fontName,"\\([^\\]*)$"))
  6470. module.options.optColSet.dropDownFont:SetText( (FontNameForDropDown or VExRT.ExCD2.colSet[i][self.fontMark.."Name"] or module.db.colsDefaults.fontName or "?") )
  6471. end
  6472. module.options.optColSet.sliderFont:SetValue(VExRT.ExCD2.colSet[i][self.fontMark.."Size"] or module.db.colsDefaults.fontSize)
  6473. module.options.optColSet.chkFontOutline:SetChecked(VExRT.ExCD2.colSet[i][self.fontMark.."Outline"])
  6474. module.options.optColSet.chkFontShadow:SetChecked(VExRT.ExCD2.colSet[i][self.fontMark.."Shadow"])
  6475. end
  6476. for i=1,4 do
  6477. self.optColSet.fontsTab.tabs[i].button:SetScript("OnClick",fontsTabButtonClick)
  6478. end
  6479. local fontOtherAvailableTable = {"Left","Right","Center","Icon"}
  6480. function self.fontOtherAvailable(isAvailable)
  6481. if isAvailable then
  6482. for i=2,4 do
  6483. self.optColSet.fontsTab.tabs[i].button:Show()
  6484. end
  6485. self.optColSet.fontsTab.tabs[1].button:SetText(L.cd2ColSetFontPosLeft)
  6486. for i=1,4 do
  6487. self.optColSet.fontsTab.tabs[i].button.fontMark = "font"..fontOtherAvailableTable[i]
  6488. end
  6489. else
  6490. for i=2,4 do
  6491. self.optColSet.fontsTab.tabs[i].button:Hide()
  6492. end
  6493. self.optColSet.fontsTab.tabs[1].button:SetText(L.cd2ColSetFontPosGeneral)
  6494. self.optColSet.fontsTab.tabs[1].button.fontMark = "font"
  6495. end
  6496. self.optColSet.fontsTab.resizeFunc(self.optColSet.fontsTab.tabs[1].button, 0, nil, nil, self.optColSet.fontsTab.tabs[1].button:GetFontString():GetStringWidth(), self.optColSet.fontsTab.tabs[1].button:GetFontString():GetStringWidth())
  6497. fontsTabButtonClick(module.options.optColSet.fontsTab.tabs[1].button)
  6498. end
  6499.  
  6500. self.optColSet.chkFontOtherAvailable = ELib:Check(self.optColSet.superTabFrame.tab[4],L.cd2ColSetFontOtherAvailable):Point(10,-220):OnClick(function(self)
  6501. if self:GetChecked() then
  6502. VExRT.ExCD2.colSet[module.options.optColTabs.selected].fontOtherAvailable = true --fontOtherAvailable
  6503. else
  6504. VExRT.ExCD2.colSet[module.options.optColTabs.selected].fontOtherAvailable = nil
  6505. end
  6506. module:ReloadAllSplits()
  6507. module.options.fontOtherAvailable( self:GetChecked() )
  6508. end)
  6509.  
  6510. self.optColSet.sliderFont = ELib:Slider(self.optColSet.fontsTab,L.cd2OtherSetFontSize):Size(400):Point("TOP",0,-60):Range(8,72):OnChange(function(self,event)
  6511. event = event - event%1
  6512. VExRT.ExCD2.colSet[module.options.optColTabs.selected][module.options.optColSet.nowFont.."Size"] = event --fontSize
  6513. module:ReloadAllSplits()
  6514. self.tooltipText = event
  6515. self:tooltipReload(self)
  6516. end)
  6517.  
  6518. self.optColSet.textDDFont = ELib:Text(self.optColSet.fontsTab,L.cd2OtherSetFont..":"):Size(200,20):Point(10,-15)
  6519.  
  6520. local function dropDownFontButtonClick(self,arg1,arg2)
  6521. ELib:DropDownClose()
  6522. VExRT.ExCD2.colSet[module.options.optColTabs.selected][module.options.optColSet.nowFont.."Name"] = arg1 --fontName
  6523. module:ReloadAllSplits()
  6524. local FontNameForDropDown = select(3,string.find(arg1,"\\([^\\]*)$"))
  6525. if arg2 <= #ExRT.F.fontList then
  6526. module.options.optColSet.dropDownFont:SetText(FontNameForDropDown or ExRT.F.fontList[arg2])
  6527. else
  6528. module.options.optColSet.dropDownFont:SetText(FontNameForDropDown or arg2)
  6529. end
  6530. end
  6531.  
  6532. self.optColSet.dropDownFont = ELib:DropDown(self.optColSet.fontsTab,350,10):Size(200):Point(180,-15)
  6533. for i=1,#ExRT.F.fontList do
  6534. self.optColSet.dropDownFont.List[i] = {}
  6535. local info = self.optColSet.dropDownFont.List[i]
  6536. info.text = ExRT.F.fontList[i]
  6537. info.arg1 = ExRT.F.fontList[i]
  6538. info.arg2 = i
  6539. info.func = dropDownFontButtonClick
  6540. info.font = ExRT.F.fontList[i]
  6541. info.justifyH = "CENTER"
  6542. end
  6543. if LibStub then
  6544. local loaded,media = pcall(LibStub,"LibSharedMedia-3.0")
  6545. if loaded and media then
  6546. local fontList = media:HashTable("font")
  6547. if fontList then
  6548. local count = #self.optColSet.dropDownFont.List
  6549. for key,font in pairs(fontList) do
  6550. count = count + 1
  6551. self.optColSet.dropDownFont.List[count] = {}
  6552. local info = self.optColSet.dropDownFont.List[count]
  6553.  
  6554. info.text = font
  6555. info.arg1 = font
  6556. info.arg2 = count
  6557. info.func = dropDownFontButtonClick
  6558. info.font = font
  6559. info.justifyH = "CENTER"
  6560. end
  6561. end
  6562. end
  6563. end
  6564.  
  6565. self.optColSet.chkFontOutline = ELib:Check(self.optColSet.fontsTab,L.cd2OtherSetOutline):Point(10,-95):OnClick(function(self)
  6566. if self:GetChecked() then
  6567. VExRT.ExCD2.colSet[module.options.optColTabs.selected][module.options.optColSet.nowFont.."Outline"] = true --fontOutline
  6568. else
  6569. VExRT.ExCD2.colSet[module.options.optColTabs.selected][module.options.optColSet.nowFont.."Outline"] = nil
  6570. end
  6571. module:ReloadAllSplits()
  6572. end)
  6573.  
  6574. self.optColSet.chkFontShadow = ELib:Check(self.optColSet.fontsTab,L.cd2OtherSetFontShadow):Point(10,-120):OnClick(function(self)
  6575. if self:GetChecked() then
  6576. VExRT.ExCD2.colSet[module.options.optColTabs.selected][module.options.optColSet.nowFont.."Shadow"] = true -- fontShadow
  6577. else
  6578. VExRT.ExCD2.colSet[module.options.optColTabs.selected][module.options.optColSet.nowFont.."Shadow"] = nil
  6579. end
  6580. module:ReloadAllSplits()
  6581. end)
  6582.  
  6583. self.optColSet.chkGeneralFont = ELib:Check(self.optColSet.superTabFrame.tab[4],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6584. if self:GetChecked() then
  6585. VExRT.ExCD2.colSet[module.options.optColTabs.selected].fontGeneral = true
  6586. else
  6587. VExRT.ExCD2.colSet[module.options.optColTabs.selected].fontGeneral = nil
  6588. end
  6589. module:ReloadAllSplits()
  6590. self:doAlphas()
  6591. end)
  6592. function self.optColSet.chkGeneralFont:doAlphas()
  6593. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].fontGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.dropDownFont,module.options.optColSet.sliderFont,module.options.optColSet.chkFontOutline,module.options.optColSet.chkFontShadow)
  6594. end
  6595.  
  6596. --> Text options
  6597.  
  6598. self.optColSet.textLeftTemText = ELib:Text(self.optColSet.superTabFrame.tab[5],L.cd2ColSetTextLeft..":"):Size(200,20):Point(10,-40)
  6599. self.optColSet.textLeftTemEdit = ELib:Edit(self.optColSet.superTabFrame.tab[5]):Size(220,20):Point(180,-40):OnChange(function(self,isUser)
  6600. if isUser then
  6601. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textTemplateLeft = self:GetText()
  6602. module:ReloadAllSplits()
  6603. end
  6604. end)
  6605.  
  6606. self.optColSet.textRightTemText = ELib:Text(self.optColSet.superTabFrame.tab[5],L.cd2ColSetTextRight..":"):Size(200,20):Point(10,-65)
  6607. self.optColSet.textRightTemEdit = ELib:Edit(self.optColSet.superTabFrame.tab[5]):Size(220,20):Point(180,-65):OnChange(function(self,isUser)
  6608. if isUser then
  6609. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textTemplateRight = self:GetText()
  6610. module:ReloadAllSplits()
  6611. end
  6612. end)
  6613.  
  6614. self.optColSet.textCenterTemText = ELib:Text(self.optColSet.superTabFrame.tab[5],L.cd2ColSetTextCenter..":"):Size(200,20):Point(10,-90)
  6615. self.optColSet.textCenterTemEdit = ELib:Edit(self.optColSet.superTabFrame.tab[5]):Size(220,20):Point(180,-90):OnChange(function(self,isUser)
  6616. if isUser then
  6617. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textTemplateCenter = self:GetText()
  6618. module:ReloadAllSplits()
  6619. end
  6620. end)
  6621.  
  6622. self.optColSet.textAllTemplates = ELib:Text(self.optColSet.superTabFrame.tab[5],L.cd2ColSetTextTooltip,11):Size(450,200):Point(10,-115):Top():Color()
  6623.  
  6624. self.optColSet.textResetButton = ELib:Button(self.optColSet.superTabFrame.tab[5],L.cd2ColSetTextReset):Size(340,20):Point("TOP",0,-225):OnClick(function(self)
  6625. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textTemplateLeft = nil
  6626. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textTemplateRight = nil
  6627. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textTemplateCenter = nil
  6628. module:ReloadAllSplits()
  6629. module.options.optColSet.textLeftTemEdit:SetText(module.db.colsDefaults.textTemplateLeft)
  6630. module.options.optColSet.textRightTemEdit:SetText(module.db.colsDefaults.textTemplateRight)
  6631. module.options.optColSet.textCenterTemEdit:SetText(module.db.colsDefaults.textTemplateCenter)
  6632. end)
  6633.  
  6634. self.optColSet.chkIconName = ELib:Check(self.optColSet.superTabFrame.tab[5],L.cd2ColSetTextIconName):Point(10,-250):OnClick(function(self)
  6635. if self:GetChecked() then
  6636. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textIconName = true
  6637. else
  6638. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textIconName = nil
  6639. end
  6640. module:ReloadAllSplits()
  6641. end)
  6642.  
  6643. self.optColSet.chkGeneralText = ELib:Check(self.optColSet.superTabFrame.tab[5],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6644. if self:GetChecked() then
  6645. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textGeneral = true
  6646. else
  6647. VExRT.ExCD2.colSet[module.options.optColTabs.selected].textGeneral = nil
  6648. end
  6649. module:ReloadAllSplits()
  6650. self:doAlphas()
  6651. end)
  6652. function self.optColSet.chkGeneralText:doAlphas()
  6653. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].textGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.textLeftTemEdit,module.options.optColSet.textRightTemEdit,module.options.optColSet.textCenterTemEdit,module.options.optColSet.chkIconName,module.options.optColSet.textAllTemplates,module.options.optColSet.textLeftTemText,module.options.optColSet.textRightTemText,module.options.optColSet.textCenterTemText,module.options.optColSet.textResetButton)
  6654. end
  6655.  
  6656. --> Method options
  6657.  
  6658. self.optColSet.chkShowOnlyOnCD = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2OtherSetOnlyOnCD):Point(10,-30):OnClick(function(self)
  6659. if self:GetChecked() then
  6660. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsShownOnCD = true
  6661. else
  6662. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsShownOnCD = nil
  6663. end
  6664. module:ReloadAllSplits()
  6665. end)
  6666.  
  6667. self.optColSet.chkBotToTop = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2ColSetBotToTop):Point(10,-55):OnClick(function(self)
  6668. if self:GetChecked() then
  6669. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameAnchorBottom = true
  6670. else
  6671. VExRT.ExCD2.colSet[module.options.optColTabs.selected].frameAnchorBottom = nil
  6672. end
  6673. module:ReloadAllSplits()
  6674. end)
  6675.  
  6676. self.optColSet.textStyleAnimation = ELib:Text(self.optColSet.superTabFrame.tab[6],L.cd2OtherSetStyleAnimation..":",11):Size(200,20):Point(10,-80)
  6677. self.optColSet.dropDownStyleAnimation = ELib:DropDown(self.optColSet.superTabFrame.tab[6],205,2):Size(220):Point(180,-80)
  6678. self.optColSet.dropDownStyleAnimation.Styles = {L.cd2OtherSetStyleAnimation1,L.cd2OtherSetStyleAnimation2}
  6679. for i=1,#self.optColSet.dropDownStyleAnimation.Styles do
  6680. self.optColSet.dropDownStyleAnimation.List[i] = {
  6681. text = self.optColSet.dropDownStyleAnimation.Styles[i],
  6682. arg1 = i,
  6683. func = function (self,arg)
  6684. ELib:DropDownClose()
  6685. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsStyleAnimation = arg
  6686. module:ReloadAllSplits()
  6687. self:GetParent().parent:SetText(module.options.optColSet.dropDownStyleAnimation.Styles[arg])
  6688. end
  6689. }
  6690. end
  6691.  
  6692. self.optColSet.textTimeLineAnimation = ELib:Text(self.optColSet.superTabFrame.tab[6],L.cd2OtherSetTimeLineAnimation..":",11):Size(200,20):Point(10,-105)
  6693. self.optColSet.dropDownTimeLineAnimation = ELib:DropDown(self.optColSet.superTabFrame.tab[6],205,2):Size(220):Point(180,-105)
  6694. self.optColSet.dropDownTimeLineAnimation.Styles = {L.cd2OtherSetTimeLineAnimation1,L.cd2OtherSetTimeLineAnimation2}
  6695. for i=1,#self.optColSet.dropDownTimeLineAnimation.Styles do
  6696. self.optColSet.dropDownTimeLineAnimation.List[i] = {
  6697. text = self.optColSet.dropDownTimeLineAnimation.Styles[i],
  6698. arg1 = i,
  6699. func = function (self,arg)
  6700. ELib:DropDownClose()
  6701. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsTimeLineAnimation = arg
  6702. module:ReloadAllSplits()
  6703. self:GetParent().parent:SetText(module.options.optColSet.dropDownTimeLineAnimation.Styles[arg])
  6704. end
  6705. }
  6706. end
  6707.  
  6708. self.optColSet.chkIconTooltip = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2OtherSetIconToolip):Point(10,-130):OnClick(function(self)
  6709. if self:GetChecked() then
  6710. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsIconTooltip = true
  6711. else
  6712. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsIconTooltip = nil
  6713. end
  6714. module:ReloadAllSplits()
  6715. end)
  6716.  
  6717. self.optColSet.chkLineClick = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2OtherSetLineClick):Point(10,-155):OnClick(function(self)
  6718. if self:GetChecked() then
  6719. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsLineClick = true
  6720. else
  6721. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsLineClick = nil
  6722. end
  6723. module:ReloadAllSplits()
  6724. end)
  6725.  
  6726.  
  6727. self.optColSet.chkNewSpellNewLine = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2NewSpellNewLine):Point(10,-180):Tooltip(L.cd2NewSpellNewLineTooltip):OnClick(function(self)
  6728. if self:GetChecked() then
  6729. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsNewSpellNewLine = true
  6730. else
  6731. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsNewSpellNewLine = nil
  6732. end
  6733. module:ReloadAllSplits()
  6734. end)
  6735.  
  6736. self.optColSet.textSortingRules= ELib:Text(self.optColSet.superTabFrame.tab[6],L.cd2MethodsSortingRules..":",11):Size(200,20):Point(10,-205)
  6737. self.optColSet.dropDownSortingRules = ELib:DropDown(self.optColSet.superTabFrame.tab[6],405,6):Size(220):Point(180,-205)
  6738. self.optColSet.dropDownSortingRules.Rules = {L.cd2MethodsSortingRules1,L.cd2MethodsSortingRules2,L.cd2MethodsSortingRules3,L.cd2MethodsSortingRules4,L.cd2MethodsSortingRules5,L.cd2MethodsSortingRules6}
  6739. for i=1,#self.optColSet.dropDownSortingRules.Rules do
  6740. self.optColSet.dropDownSortingRules.List[i] = {
  6741. text = self.optColSet.dropDownSortingRules.Rules[i],
  6742. arg1 = i,
  6743. func = function (self,arg)
  6744. ELib:DropDownClose()
  6745. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsSortingRules = arg
  6746. module:ReloadAllSplits()
  6747. module.main:GROUP_ROSTER_UPDATE()
  6748. self:GetParent().parent:SetText(module.options.optColSet.dropDownSortingRules.Rules[arg])
  6749. end
  6750. }
  6751. end
  6752.  
  6753. self.optColSet.chkHideOwnSpells = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2MethodsDisableOwn):Point(10,-230):OnClick(function(self)
  6754. if self:GetChecked() then
  6755. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsHideOwnSpells = true
  6756. else
  6757. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsHideOwnSpells = nil
  6758. end
  6759. module:ReloadAllSplits()
  6760. end)
  6761.  
  6762. self.optColSet.chkAlphaNotInRange = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2MethodsAlphaNotInRange):Point(10,-255):OnClick(function(self)
  6763. if self:GetChecked() then
  6764. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsAlphaNotInRange = true
  6765. else
  6766. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsAlphaNotInRange = nil
  6767. end
  6768. module:ReloadAllSplits()
  6769. end)
  6770.  
  6771. self.optColSet.sliderAlphaNotInRange = ELib:Slider(self.optColSet.superTabFrame.tab[6],""):Size(140):Point("TOPLEFT",self.optColSet.chkAlphaNotInRange,270,-3):Range(0,100):OnChange(function(self,event)
  6772. event = event - event%1
  6773. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsAlphaNotInRangeNum = event
  6774. module:ReloadAllSplits()
  6775. self.tooltipText = event
  6776. self:tooltipReload(self)
  6777. end)
  6778.  
  6779. self.optColSet.chkDisableActive = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2ColSetDisableActive):Point(10,-280):OnClick(function(self)
  6780. if self:GetChecked() then
  6781. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsDisableActive = true
  6782. else
  6783. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsDisableActive = nil
  6784. end
  6785. module:ReloadAllSplits()
  6786. end)
  6787.  
  6788. self.optColSet.chkOneSpellPerCol = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2ColSetOneSpellPerCol):Point(10,-305):OnClick(function(self)
  6789. if self:GetChecked() then
  6790. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsOneSpellPerCol = true
  6791. else
  6792. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsOneSpellPerCol = nil
  6793. end
  6794. module:ReloadAllSplits()
  6795. end):Tooltip(L.cd2ColSetOneSpellPerColTooltip)
  6796.  
  6797. self.optColSet.chkGeneralMethods = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6798. if self:GetChecked() then
  6799. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsGeneral = true
  6800. else
  6801. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsGeneral = nil
  6802. end
  6803. module:ReloadAllSplits()
  6804. self:doAlphas()
  6805. end)
  6806. function self.optColSet.chkGeneralMethods:doAlphas()
  6807. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.chkShowOnlyOnCD,module.options.optColSet.chkBotToTop,module.options.optColSet.dropDownStyleAnimation,module.options.optColSet.dropDownTimeLineAnimation,module.options.optColSet.chkIconTooltip,module.options.optColSet.chkLineClick,module.options.optColSet.chkNewSpellNewLine,module.options.optColSet.dropDownSortingRules,module.options.optColSet.textSortingRules,module.options.optColSet.textStyleAnimation,module.options.optColSet.textTimeLineAnimation,module.options.optColSet.chkHideOwnSpells,module.options.optColSet.chkAlphaNotInRange,module.options.optColSet.sliderAlphaNotInRange,module.options.optColSet.chkDisableActive,module.options.optColSet.chkOneSpellPerCol)
  6808. end
  6809.  
  6810. self.optColSet.chkSortByAvailability = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2SortByAvailability,VExRT.ExCD2.SortByAvailability):Point(10,-330):OnClick(function(self)
  6811. if self:GetChecked() then
  6812. VExRT.ExCD2.SortByAvailability = true
  6813. else
  6814. VExRT.ExCD2.SortByAvailability = nil
  6815. module.main:GROUP_ROSTER_UPDATE()
  6816. end
  6817. end)
  6818.  
  6819. self.optColSet.chkSortByAvailability_activeToTop = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2SortByAvailabilityActiveToTop,VExRT.ExCD2.SortByAvailabilityActiveToTop):Point("TOPLEFT",self.optColSet.chkSortByAvailability,0,-25):Tooltip(L.cd2SortByAvailabilityActiveToTopTooltip):OnClick(function(self)
  6820. if self:GetChecked() then
  6821. VExRT.ExCD2.SortByAvailabilityActiveToTop = true
  6822. else
  6823. VExRT.ExCD2.SortByAvailabilityActiveToTop = nil
  6824. end
  6825. module:ReloadAllSplits()
  6826. end)
  6827.  
  6828. self.optColSet.chkReverseSorting = ELib:Check(self.optColSet.superTabFrame.tab[6],L.cd2ReverseSorting,VExRT.ExCD2.ReverseSorting):Point("TOPLEFT",self.optColSet.chkSortByAvailability_activeToTop,0,-25):OnClick(function(self)
  6829. if self:GetChecked() then
  6830. VExRT.ExCD2.ReverseSorting = true
  6831. else
  6832. VExRT.ExCD2.ReverseSorting = nil
  6833. end
  6834. module:ReloadAllSplits()
  6835. end)
  6836.  
  6837. --> Visibility
  6838.  
  6839.  
  6840. self.optColSet.chkOnlyInCombat = ELib:Check(self.optColSet.superTabFrame.tab[7],L.TimerOnlyInCombat):Point(10,-30):OnClick(function(self)
  6841. if self:GetChecked() then
  6842. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsOnlyInCombat = true
  6843. else
  6844. VExRT.ExCD2.colSet[module.options.optColTabs.selected].methodsOnlyInCombat = nil
  6845. end
  6846. module:ReloadAllSplits()
  6847. end)
  6848.  
  6849. self.optColSet.visibilityTextPartyType = ELib:Text(self.optColSet.superTabFrame.tab[7],L.cd2OtherVisibilityPartyType..":",10):Point(10,-60):Color()
  6850.  
  6851. self.optColSet.chkVisibilityPartyTypeAlways = ELib:Radio(self.optColSet.superTabFrame.tab[7],ALWAYS):Point(10,-75):OnClick(function(self)
  6852. module.options.optColSet.chkVisibilityPartyTypeAlways:SetChecked(true)
  6853. module.options.optColSet.chkVisibilityPartyTypeParty:SetChecked(false)
  6854. module.options.optColSet.chkVisibilityPartyTypeRaid:SetChecked(false)
  6855. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityPartyType = nil
  6856. module:ReloadAllSplits()
  6857. end)
  6858. self.optColSet.chkVisibilityPartyTypeParty = ELib:Radio(self.optColSet.superTabFrame.tab[7],AGGRO_WARNING_IN_PARTY):Point(10,-95):OnClick(function(self)
  6859. module.options.optColSet.chkVisibilityPartyTypeAlways:SetChecked(false)
  6860. module.options.optColSet.chkVisibilityPartyTypeParty:SetChecked(true)
  6861. module.options.optColSet.chkVisibilityPartyTypeRaid:SetChecked(false)
  6862. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityPartyType = 1
  6863. module:ReloadAllSplits()
  6864. end)
  6865. self.optColSet.chkVisibilityPartyTypeRaid = ELib:Radio(self.optColSet.superTabFrame.tab[7],L.cd2OtherVisibilityPartyTypeRaid):Point(10,-115):OnClick(function(self)
  6866. module.options.optColSet.chkVisibilityPartyTypeAlways:SetChecked(false)
  6867. module.options.optColSet.chkVisibilityPartyTypeParty:SetChecked(false)
  6868. module.options.optColSet.chkVisibilityPartyTypeRaid:SetChecked(true)
  6869. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityPartyType = 2
  6870. module:ReloadAllSplits()
  6871. end)
  6872.  
  6873. self.optColSet.visibilityTextZoneType = ELib:Text(self.optColSet.superTabFrame.tab[7],L.cd2OtherVisibilityZoneType..":",10):Point(10,-140):Color()
  6874.  
  6875. self.optColSet.chkVisibilityZoneArena = ELib:Check(self.optColSet.superTabFrame.tab[7],ARENA):Point(10,-155):OnClick(function(self)
  6876. if self:GetChecked() then
  6877. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableArena = nil
  6878. else
  6879. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableArena = true
  6880. end
  6881. module:ReloadAllSplits()
  6882. end)
  6883.  
  6884. self.optColSet.chkVisibilityZoneBG = ELib:Check(self.optColSet.superTabFrame.tab[7],BATTLEGROUND):Point(10,-180):OnClick(function(self)
  6885. if self:GetChecked() then
  6886. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableBG = nil
  6887. else
  6888. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableBG = true
  6889. end
  6890. module:ReloadAllSplits()
  6891. end)
  6892.  
  6893. self.optColSet.chkVisibilityZoneScenario = ELib:Check(self.optColSet.superTabFrame.tab[7],TRACKER_HEADER_SCENARIO):Point(10,-205):OnClick(function(self)
  6894. if self:GetChecked() then
  6895. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisable3ppl = nil
  6896. else
  6897. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisable3ppl = true
  6898. end
  6899. module:ReloadAllSplits()
  6900. end)
  6901.  
  6902. self.optColSet.chkVisibilityZone5ppl = ELib:Check(self.optColSet.superTabFrame.tab[7],CALENDAR_TYPE_DUNGEON):Point(10,-230):OnClick(function(self)
  6903. if self:GetChecked() then
  6904. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisable5ppl = nil
  6905. else
  6906. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisable5ppl = true
  6907. end
  6908. module:ReloadAllSplits()
  6909. end)
  6910.  
  6911. self.optColSet.chkVisibilityZoneRaid = ELib:Check(self.optColSet.superTabFrame.tab[7],RAID):Point(10,-255):OnClick(function(self)
  6912. if self:GetChecked() then
  6913. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableRaid = nil
  6914. else
  6915. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableRaid = true
  6916. end
  6917. module:ReloadAllSplits()
  6918. end)
  6919.  
  6920. self.optColSet.chkVisibilityZoneOutdoor = ELib:Check(self.optColSet.superTabFrame.tab[7],WORLD):Point(10,-280):OnClick(function(self)
  6921. if self:GetChecked() then
  6922. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableWorld = nil
  6923. else
  6924. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityDisableWorld = true
  6925. end
  6926. module:ReloadAllSplits()
  6927. end)
  6928.  
  6929. self.optColSet.chkGeneralVisibility = ELib:Check(self.optColSet.superTabFrame.tab[7],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6930. if self:GetChecked() then
  6931. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityGeneral = true
  6932. else
  6933. VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityGeneral = nil
  6934. end
  6935. module:ReloadAllSplits()
  6936. self:doAlphas()
  6937. end)
  6938. function self.optColSet.chkGeneralVisibility:doAlphas()
  6939. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].visibilityGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.chkOnlyInCombat,module.options.optColSet.visibilityTextPartyType,module.options.optColSet.chkVisibilityPartyTypeAlways,module.options.optColSet.chkVisibilityPartyTypeParty,module.options.optColSet.chkVisibilityPartyTypeRaid,module.options.optColSet.visibilityTextZoneType,module.options.optColSet.chkVisibilityZoneArena,module.options.optColSet.chkVisibilityZoneBG,module.options.optColSet.chkVisibilityZoneScenario,module.options.optColSet.chkVisibilityZone5ppl,module.options.optColSet.chkVisibilityZoneRaid,module.options.optColSet.chkVisibilityZoneOutdoor)
  6940. end
  6941.  
  6942. --> Black List
  6943.  
  6944. self.optColSet.blacklistText = ELib:Text(self.optColSet.superTabFrame.tab[8],L.cd2ColSetBlacklistTooltip,11):Size(430,200):Point(10,-30):Top():Color()
  6945.  
  6946. self.optColSet.blacklistEditBox = ELib:MultiEdit(self.optColSet.superTabFrame.tab[8]):Size(430,140):Point("TOP",0,-85)
  6947. do
  6948. local scheluded = nil
  6949. local function ScheludeFunc(self)
  6950. scheluded = nil
  6951. module:ReloadAllSplits()
  6952. end
  6953. function self.optColSet.blacklistEditBox:OnTextChanged(isUser)
  6954. if not isUser then
  6955. return
  6956. end
  6957. VExRT.ExCD2.colSet[module.options.optColTabs.selected].blacklistText = strtrim( self:GetText() )
  6958. if not scheluded then
  6959. scheluded = ExRT.F.ScheduleTimer(ScheludeFunc, 1)
  6960. end
  6961. end
  6962. end
  6963.  
  6964. self.optColSet.whitelistText = ELib:Text(self.optColSet.superTabFrame.tab[8],L.cd2ColSetWhitelistTooltip,11):Size(430,200):Point(10,-235):Top():Color()
  6965.  
  6966. self.optColSet.whitelistEditBox = ELib:MultiEdit(self.optColSet.superTabFrame.tab[8]):Size(430,140):Point("TOP",0,-290)
  6967. do
  6968. local scheluded = nil
  6969. local function ScheludeFunc(self)
  6970. scheluded = nil
  6971. module:ReloadAllSplits()
  6972. end
  6973. function self.optColSet.whitelistEditBox:OnTextChanged(isUser)
  6974. if not isUser then
  6975. return
  6976. end
  6977. VExRT.ExCD2.colSet[module.options.optColTabs.selected].whitelistText = strtrim( self:GetText() )
  6978. if not scheluded then
  6979. scheluded = ExRT.F.ScheduleTimer(ScheludeFunc, 1)
  6980. end
  6981. end
  6982. end
  6983.  
  6984. self.optColSet.chkGeneralBlackList = ELib:Check(self.optColSet.superTabFrame.tab[8],L.cd2ColSetGeneral):Point("TOPRIGHT",-10,-10):Left():OnClick(function(self)
  6985. if self:GetChecked() then
  6986. VExRT.ExCD2.colSet[module.options.optColTabs.selected].blacklistGeneral = true
  6987. else
  6988. VExRT.ExCD2.colSet[module.options.optColTabs.selected].blacklistGeneral = nil
  6989. end
  6990. module:ReloadAllSplits()
  6991. self:doAlphas()
  6992. end)
  6993. function self.optColSet.chkGeneralBlackList:doAlphas()
  6994. ExRT.lib.SetAlphas(VExRT.ExCD2.colSet[module.options.optColTabs.selected].blacklistGeneral and module.options.optColTabs.selected ~= (module.db.maxColumns + 1) and 0.5 or 1,module.options.optColSet.blacklistEditBox,module.options.optColSet.whitelistEditBox,module.options.optColSet.whitelistText,module.options.optColSet.blacklistText)
  6995. end
  6996.  
  6997. --> Templates Tab
  6998. self.optColSet.templates = {}
  6999. self.optColSet.templateData = {
  7000. spells = {31821,62618,97462,20484,98008},
  7001. spellsCD = {90,0,0,20,0},
  7002. spellsDuration = {0,10,0,0,0},
  7003. spellsDead = {nil,nil,true,nil,nil},
  7004. spellsCharge = {nil,nil,nil,true,nil},
  7005. spellsClass = {"PALADIN","PRIEST","WARRIOR","DRUID","SHAMAN"},
  7006. [1] = {
  7007. iconSize = 16,
  7008. optionAnimation = true,
  7009. optionStyleAnimation = 1,
  7010. optionTimeLineAnimation = 1,
  7011. optionIconPosition = 1,
  7012. optionGray = true,
  7013. fontSize = 12,
  7014. fontName = ExRT.F.defFont,
  7015. fontOutline = true,
  7016. fontShadow = false,
  7017. textureFile = ExRT.F.barImg,
  7018. colorsText = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7019. colorsBack = {0,1,0, 0,1,0, 1,0,0, 1,1,0},
  7020. colorsTL = {0,1,0, 0,1,0, 1,0,0, 1,1,0},
  7021. textureAlphaBackground = 0.3,
  7022. textureAlphaTimeLine = 0.8,
  7023. textureAlphaCooldown = 1,
  7024. optionClassColorBackground = false,
  7025. optionClassColorTimeLine = false,
  7026. optionClassColorText = false,
  7027. textTemplateLeft = "%name%",
  7028. textTemplateRight = "%time%",
  7029. textTemplateCenter = "",
  7030. },
  7031. [2] = {
  7032. iconSize = 14,
  7033. optionAnimation = false,
  7034. optionStyleAnimation = 1,
  7035. optionTimeLineAnimation = 1,
  7036. optionIconPosition = 1,
  7037. optionGray = false,
  7038. fontSize = 12,
  7039. fontName = ExRT.F.defFont,
  7040. fontOutline = true,
  7041. fontShadow = false,
  7042. textureFile = ExRT.F.barImg,
  7043. colorsText = {1,1,1, 0.5,1,0.5, 1,0.5,0.5, 1,1,0.5,},
  7044. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7045. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7046. textureAlphaBackground = 0.3,
  7047. textureAlphaTimeLine = 0.8,
  7048. textureAlphaCooldown = 1,
  7049. optionClassColorBackground = false,
  7050. optionClassColorTimeLine = false,
  7051. optionClassColorText = false,
  7052. textTemplateLeft = "%time% %name%",
  7053. textTemplateRight = "",
  7054. textTemplateCenter = "",
  7055. },
  7056. [3] = {
  7057. iconSize = 14,
  7058. optionAnimation = true,
  7059. optionStyleAnimation = 1,
  7060. optionTimeLineAnimation = 2,
  7061. optionIconPosition = 1,
  7062. optionGray = false,
  7063. fontSize = 12,
  7064. fontName = ExRT.F.defFont,
  7065. fontOutline = false,
  7066. fontShadow = true,
  7067. textureFile = "Interface\\AddOns\\ExRT\\media\\bar26.tga",
  7068. colorsText = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7069. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7070. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7071. textureAlphaBackground = 0.15,
  7072. textureAlphaTimeLine = 0.8,
  7073. textureAlphaCooldown = 1,
  7074. optionClassColorBackground = false,
  7075. optionClassColorTimeLine = true,
  7076. optionClassColorText = false,
  7077. textTemplateLeft = "",
  7078. textTemplateRight = "%time%",
  7079. textTemplateCenter = "%name%: %spell%",
  7080. },
  7081. [4] = {
  7082. iconSize = 16,
  7083. optionAnimation = true,
  7084. optionStyleAnimation = 2,
  7085. optionTimeLineAnimation = 2,
  7086. optionIconPosition = 1,
  7087. optionGray = false,
  7088. fontSize = 12,
  7089. fontName = ExRT.F.defFont,
  7090. fontOutline = false,
  7091. fontShadow = true,
  7092. textureFile = "Interface\\AddOns\\ExRT\\media\\bar19.tga",
  7093. colorsText = {1,1,1, 0.5,1,0.5, 1,1,1, 1,1,0.5},
  7094. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7095. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7096. textureAlphaBackground = 0.15,
  7097. textureAlphaTimeLine = 1,
  7098. textureAlphaCooldown = 0.85,
  7099. optionClassColorBackground = true,
  7100. optionClassColorTimeLine = true,
  7101. optionClassColorText = false,
  7102. textTemplateLeft = "%name%",
  7103. textTemplateRight = "%time%",
  7104. textTemplateCenter = "",
  7105.  
  7106. frameBetweenLines = 1,
  7107. },
  7108. [5] = {
  7109. iconSize = 40,
  7110. optionAnimation = false,
  7111. optionStyleAnimation = 1,
  7112. optionTimeLineAnimation = 1,
  7113. optionIconPosition = 1,
  7114. optionGray = false,
  7115. fontSize = 10,
  7116. fontName = ExRT.F.defFont,
  7117. fontOutline = true,
  7118. fontShadow = false,
  7119. textureFile = ExRT.F.barImg,
  7120. colorsText = {1,1,1, 0.5,1,0.5, 1,0.5,0.5, 1,1,0.5,},
  7121. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7122. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7123. textureAlphaBackground = 0,
  7124. textureAlphaTimeLine = 0,
  7125. textureAlphaCooldown = 0.7,
  7126. optionClassColorBackground = false,
  7127. optionClassColorTimeLine = false,
  7128. optionClassColorText = false,
  7129. textTemplateLeft = "",
  7130. textTemplateRight = "",
  7131. textTemplateCenter = "",
  7132. textIconName = true,
  7133. methodsCooldown = true,
  7134.  
  7135. frameWidth = 40,
  7136. frameColumns = 4,
  7137. },
  7138. [6] = {
  7139. iconSize = 12,
  7140. optionAnimation = false,
  7141. optionStyleAnimation = 1,
  7142. optionTimeLineAnimation = 1,
  7143. optionIconPosition = 1,
  7144. optionGray = false,
  7145. fontSize = 12,
  7146. fontName = ExRT.F.defFont,
  7147. fontOutline = false,
  7148. fontShadow = false,
  7149. textureFile = ExRT.F.barImg,
  7150. colorsText = {1,1,1, 0.5,1,0.5, 1,0.5,0.5, 1,1,0.5,},
  7151. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7152. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7153. textureAlphaBackground = 0,
  7154. textureAlphaTimeLine = 0,
  7155. textureAlphaCooldown = 1,
  7156. optionClassColorBackground = false,
  7157. optionClassColorTimeLine = false,
  7158. optionClassColorText = false,
  7159. textTemplateLeft = "%time% %name%",
  7160. textTemplateRight = "",
  7161. textTemplateCenter = "",
  7162. },
  7163. [7] = {
  7164. iconSize = 14,
  7165. optionAnimation = true,
  7166. optionStyleAnimation = 1,
  7167. optionTimeLineAnimation = 1,
  7168. optionIconPosition = 1,
  7169. optionGray = false,
  7170. fontSize = 12,
  7171. fontName = ExRT.F.defFont,
  7172. fontOutline = false,
  7173. fontShadow = true,
  7174. textureFile = "Interface\\AddOns\\ExRT\\media\\bar29.tga",
  7175. colorsText = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7176. colorsBack = {0,1,0, 0,1,0, 0.8,0,0, 1,1,0},
  7177. colorsTL = {0,1,0, 0,1,0, 0.8,0,0, 1,1,0},
  7178. textureAlphaBackground = 0.3,
  7179. textureAlphaTimeLine = 0.8,
  7180. textureAlphaCooldown = 0.5,
  7181. optionClassColorBackground = false,
  7182. optionClassColorTimeLine = false,
  7183. optionClassColorText = false,
  7184. textTemplateLeft = "%name%",
  7185. textTemplateRight = "%stime%",
  7186. textTemplateCenter = "",
  7187. },
  7188. [8] = {
  7189. iconSize = 16,
  7190. optionAnimation = true,
  7191. optionStyleAnimation = 2,
  7192. optionTimeLineAnimation = 2,
  7193. optionIconPosition = 2,
  7194. optionGray = true,
  7195. fontSize = 13,
  7196. fontName = ExRT.F.defFont,
  7197. fontOutline = true,
  7198. fontShadow = true,
  7199. textureFile = "Interface\\AddOns\\ExRT\\media\\bar6.tga",
  7200. colorsText = {1,1,1, 0.5,1,0.5, 1,0.5,0.5, 1,1,0.5,},
  7201. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7202. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7203. textureAlphaBackground = 0.3,
  7204. textureAlphaTimeLine = 0.8,
  7205. textureAlphaCooldown = 0.5,
  7206. optionClassColorBackground = false,
  7207. optionClassColorTimeLine = false,
  7208. optionClassColorText = true,
  7209. textTemplateLeft = "%name%",
  7210. textTemplateRight = "",
  7211. textTemplateCenter = "",
  7212. },
  7213. [9] = {
  7214. iconSize = 18,
  7215. optionAnimation = true,
  7216. optionStyleAnimation = 1,
  7217. optionTimeLineAnimation = 2,
  7218. optionIconPosition = 1,
  7219. optionGray = false,
  7220. fontSize = 12,
  7221. fontName = ExRT.F.defFont,
  7222. fontOutline = false,
  7223. fontShadow = true,
  7224. textureFile = "Interface\\AddOns\\ExRT\\media\\bar16.tga",
  7225. colorsText = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7226. colorsBack = {0,0,0, 0,0,0, 0,0,0, 0,0,0},
  7227. colorsTL = {0.24,0.44,1, 1,0.37,1, 0.24,0.44,1, 1,0.46,0.10},
  7228. textureAlphaBackground = 0.3,
  7229. textureAlphaTimeLine = 0.9,
  7230. textureAlphaCooldown = 1,
  7231. optionClassColorBackground = false,
  7232. optionClassColorTimeLine = false,
  7233. optionClassColorText = false,
  7234. textTemplateLeft = "%name%",
  7235. textTemplateRight = "%stime%",
  7236. textTemplateCenter = "",
  7237. textureBorderSize = 1,
  7238. frameBetweenLines = 3,
  7239. textureBorderColorA = 1,
  7240. },
  7241. [10] = {
  7242. iconSize = 18,
  7243. optionAnimation = true,
  7244. optionStyleAnimation = 1,
  7245. optionTimeLineAnimation = 2,
  7246. optionIconPosition = 1,
  7247. optionGray = false,
  7248. fontSize = 12,
  7249. fontName = ExRT.F.defFont,
  7250. fontOutline = false,
  7251. fontShadow = true,
  7252. textureFile = "Interface\\AddOns\\ExRT\\media\\bar16.tga",
  7253. colorsText = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7254. colorsBack = {0,0,0, 0,0,0, 0,0,0, 0,0,0},
  7255. colorsTL = {0.24,0.44,1, 1,0.37,1, 0.24,0.44,1, 1,0.46,0.10},
  7256. textureAlphaBackground = 0.3,
  7257. textureAlphaTimeLine = 0.9,
  7258. textureAlphaCooldown = 1,
  7259. optionClassColorBackground = false,
  7260. optionClassColorTimeLine = true,
  7261. optionClassColorText = false,
  7262. textTemplateLeft = "%name%",
  7263. textTemplateRight = "%stime%",
  7264. textTemplateCenter = "",
  7265. textureBorderSize = 1,
  7266. frameBetweenLines = 3,
  7267. textureBorderColorA = 1,
  7268. },
  7269. [11] = {
  7270. _twoSized = true,
  7271. _Scaled = .8,
  7272.  
  7273. iconSize = 40,
  7274. optionAnimation = true,
  7275. optionStyleAnimation = 1,
  7276. optionTimeLineAnimation = 2,
  7277. optionIconPosition = 1,
  7278. optionGray = true,
  7279. fontSize = 14,
  7280. fontName = ExRT.F.defFont,
  7281. fontOutline = true,
  7282. fontShadow = false,
  7283. textureFile = "Interface\\AddOns\\ExRT\\media\\bar17.tga",
  7284. colorsText = {1,1,1, 1,1,1, 1,.6,.6, 1,1,.5},
  7285. colorsBack = {0,0,0, 0,0,0, 0,0,0, 0,0,0},
  7286. colorsTL = {0,0,0, 0,0,0, 0,0,0, 0,0,0},
  7287. textureAlphaBackground = 0.8,
  7288. textureAlphaTimeLine = 1,
  7289. textureAlphaCooldown = .5,
  7290. optionClassColorBackground = false,
  7291. optionClassColorTimeLine = true,
  7292. optionClassColorText = false,
  7293. textTemplateLeft = "%name%",
  7294. textTemplateRight = "",
  7295. textTemplateCenter = "",
  7296. methodsCooldown = true,
  7297. methodsNewSpellNewLine = true,
  7298. frameColumns = 5,
  7299. iconHideBlizzardEdges = true,
  7300.  
  7301. frameLines = 60,
  7302.  
  7303. DiffSpellData = {
  7304. spells = {31821, 31821, 0, 0, 0, 97462, 0, 0, 0, 0, 20484, 20484},
  7305. spellsCD = {90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0},
  7306. spellsDuration = {0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  7307. spellsDead = {nil, nil, nil, nil, nil, true, nil, nil, nil, nil, nil, nil},
  7308. spellsCharge = {nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, true, nil},
  7309. spellsClass = {"PALADIN","PALADIN",nil,nil,nil, "WARRIOR",nil,nil,nil,nil, "DRUID","DRUID"},
  7310. },
  7311. },
  7312. [12] = {},
  7313. [13] = {
  7314. iconSize = 13,
  7315. optionAnimation = true,
  7316. optionStyleAnimation = 2,
  7317. optionTimeLineAnimation = 2,
  7318. optionIconPosition = 2,
  7319. optionGray = false,
  7320. fontSize = 12,
  7321. fontName = ExRT.F.defFont,
  7322. fontOutline = false,
  7323. fontShadow = true,
  7324. textureFile = "Interface\\AddOns\\ExRT\\media\\bar19.tga",
  7325. colorsText = {1,1,1, 0.5,1,0.5, 1,1,1, 1,1,0.5},
  7326. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7327. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7328. textureAlphaBackground = 0.15,
  7329. textureAlphaTimeLine = 1,
  7330. textureAlphaCooldown = 0.85,
  7331. optionClassColorBackground = true,
  7332. optionClassColorTimeLine = true,
  7333. optionClassColorText = false,
  7334. textTemplateLeft = "%name%",
  7335. textTemplateRight = "%time%",
  7336. textTemplateCenter = "",
  7337. iconTitles = true,
  7338.  
  7339. frameBetweenLines = 0,
  7340.  
  7341. DiffSpellData = {
  7342. spells = {31821, 31821, 31821, 97462, 97462, 51052, 51052, 51052, },
  7343. spellsCD = {0, 90, 0, 0, 0, 0, 0, 20, },
  7344. spellsDuration ={0, 0, 10, 0, 0, 0, 0, 0, },
  7345. spellsDead = {nil, nil, nil, nil, true, nil, nil, nil, },
  7346. spellsCharge = {nil, nil, nil, nil, nil, nil, nil, true, },
  7347. spellsClass = {"title","PALADIN","PALADIN","title","WARRIOR","title","DEATHKNIGHT","DEATHKNIGHT"},
  7348. },
  7349. },
  7350. [14] = {
  7351. iconSize = 14,
  7352. optionAnimation = true,
  7353. optionStyleAnimation = 2,
  7354. optionTimeLineAnimation = 2,
  7355. optionIconPosition = 1,
  7356. optionGray = false,
  7357. fontSize = 12,
  7358. fontName = ExRT.F.defFont,
  7359. fontOutline = false,
  7360. fontShadow = true,
  7361. textureFile = "Interface\\AddOns\\ExRT\\media\\bar19.tga",
  7362. colorsText = {1,1,1, 0.5,1,0.5, 1,1,1, 1,1,0.5},
  7363. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7364. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7365. textureAlphaBackground = 0.15,
  7366. textureAlphaTimeLine = 1,
  7367. textureAlphaCooldown = 0.85,
  7368. optionClassColorBackground = true,
  7369. optionClassColorTimeLine = true,
  7370. optionClassColorText = false,
  7371. textTemplateLeft = "%name%",
  7372. textTemplateRight = "%time%",
  7373. textTemplateCenter = "",
  7374.  
  7375. frameBetweenLines = 0,
  7376. },
  7377. [15] = {
  7378. _twoSized = true,
  7379. _Scaled = .75,
  7380.  
  7381. iconSize = 13,
  7382. optionAnimation = true,
  7383. optionStyleAnimation = 2,
  7384. optionTimeLineAnimation = 2,
  7385. optionIconPosition = 1,
  7386. optionGray = false,
  7387. fontSize = 12,
  7388. fontName = ExRT.F.defFont,
  7389. fontOutline = false,
  7390. fontShadow = true,
  7391. textureFile = "Interface\\AddOns\\ExRT\\media\\bar19.tga",
  7392. colorsText = {1,1,1, 0.5,1,0.5, 1,1,1, 1,1,0.5},
  7393. colorsBack = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7394. colorsTL = {1,1,1, 1,1,1, 1,1,1, 1,1,1},
  7395. textureAlphaBackground = 0.15,
  7396. textureAlphaTimeLine = 1,
  7397. textureAlphaCooldown = 0.85,
  7398. optionClassColorBackground = true,
  7399. optionClassColorTimeLine = true,
  7400. optionClassColorText = false,
  7401. textTemplateLeft = "%name%",
  7402. textTemplateRight = "%time%",
  7403. textTemplateCenter = "",
  7404. iconTitles = true,
  7405. methodsNewSpellNewLine = true,
  7406. frameColumns = 5,
  7407. frameLines = 60,
  7408. frameBetweenLines = 0,
  7409.  
  7410. DiffSpellData = {
  7411. spells = {31821, 31821, 31821, 0, 0, 97462, 97462, 0, 0, 0, 740, 740, 740, 0, 0, 51052, 51052, 51052, 0, 0, 64843, 64843, 64843,},
  7412. spellsCD = {0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 70,},
  7413. spellsDuration ={0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
  7414. spellsDead = {nil, nil, nil, nil, nil, nil, true, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,},
  7415. spellsCharge = {nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, true, nil, nil, nil, nil, nil,},
  7416. spellsClass = {"title","PALADIN","PALADIN",nil,nil,"title","WARRIOR",nil,nil,nil,"title","DRUID","DRUID",nil,nil,"title","DEATHKNIGHT","DEATHKNIGHT",nil,nil,"title","PRIEST","PRIEST"},
  7417. },
  7418. },
  7419. [16] = {},
  7420. toOptions = {
  7421. iconSize = "iconSize",
  7422. optionAnimation = "textureAnimation",
  7423. optionStyleAnimation = "methodsStyleAnimation",
  7424. optionTimeLineAnimation = "methodsTimeLineAnimation",
  7425. optionIconPosition = "iconPosition",
  7426. optionGray = "iconGray",
  7427. fontSize = "fontSize",
  7428. fontName = "fontName",
  7429. fontOutline = "fontOutline",
  7430. fontShadow = "fontShadow",
  7431. textureFile = "textureFile",
  7432. colorsText = {"textureColorTextDefaultR","textureColorTextDefaultG","textureColorTextDefaultB","textureColorTextActiveR","textureColorTextActiveG","textureColorTextActiveB","textureColorTextCooldownR","textureColorTextCooldownG","textureColorTextCooldownB","textureColorTextCastR","textureColorTextCastG","textureColorTextCastB",},
  7433. colorsBack = {"textureColorBackgroundDefaultR","textureColorBackgroundDefaultG","textureColorBackgroundDefaultB","textureColorBackgroundActiveR","textureColorBackgroundActiveG","textureColorBackgroundActiveB","textureColorBackgroundCooldownR","textureColorBackgroundCooldownG","textureColorBackgroundCooldownB","textureColorBackgroundCastR","textureColorBackgroundCastG","textureColorBackgroundCastB",},
  7434. colorsTL = {"textureColorTimeLineDefaultR","textureColorTimeLineDefaultG","textureColorTimeLineDefaultB","textureColorTimeLineActiveR","textureColorTimeLineActiveG","textureColorTimeLineActiveB","textureColorTimeLineCooldownR","textureColorTimeLineCooldownG","textureColorTimeLineCooldownB","textureColorTimeLineCastR","textureColorTimeLineCastG","textureColorTimeLineCastB",},
  7435. textureAlphaBackground = "textureAlphaBackground",
  7436. textureAlphaTimeLine = "textureAlphaTimeLine",
  7437. textureAlphaCooldown = "textureAlphaCooldown",
  7438. optionClassColorBackground = "textureClassBackground",
  7439. optionClassColorTimeLine = "textureClassTimeLine",
  7440. optionClassColorText = "textureClassText",
  7441. textTemplateLeft = "textTemplateLeft",
  7442. textTemplateRight = "textTemplateRight",
  7443. textTemplateCenter = "textTemplateCenter",
  7444. methodsCooldown = "methodsCooldown",
  7445. textIconName = "textIconName",
  7446. fontOtherAvailable = "fontOtherAvailable",
  7447. frameBetweenLines = "frameBetweenLines",
  7448. textureBorderSize = "textureBorderSize",
  7449. textureBorderColorR = "textureBorderColorR",
  7450. textureBorderColorG = "textureBorderColorG",
  7451. textureBorderColorB = "textureBorderColorB",
  7452. textureBorderColorA = "textureBorderColorA",
  7453. methodsNewSpellNewLine = "methodsNewSpellNewLine",
  7454. methodsSortingRules = "methodsSortingRules",
  7455. iconTitles = "iconTitles",
  7456. iconHideBlizzardEdges = "iconHideBlizzardEdges",
  7457.  
  7458. iconGeneral = "iconGeneral",
  7459. textureGeneral = "textureGeneral",
  7460. methodsGeneral = "methodsGeneral",
  7461. fontGeneral = "fontGeneral",
  7462. textGeneral = "textGeneral",
  7463. frameGeneral = "frameGeneral",
  7464.  
  7465. frameColumns = "frameColumns",
  7466.  
  7467. _frameAlpha = "frameAlpha",
  7468. _frameWidth = "frameWidth",
  7469. _frameBlackBack = "frameBlackBack",
  7470. _frameLines = "frameLines",
  7471. },
  7472. }
  7473. self.optColSet.templateSaveData = nil
  7474.  
  7475. self.optColSet.templatesScrollFrame = ELib:ScrollFrame(self.optColSet.superTabFrame.tab[9]):Size(430,380):Point("TOP",0,-50):Height( ceil(#self.optColSet.templateData/2) * 125 + 10 )
  7476. for i=1,#self.optColSet.templateData do if i==1 or not self.optColSet.templateData[i-1]._twoSized then
  7477. local templateFrame = CreateFrame("Button",nil,self.optColSet.templatesScrollFrame.C)
  7478. self.optColSet.templates[i] = templateFrame
  7479. templateFrame:SetPoint(self.optColSet.templateData[i]._twoSized and "TOP" or (i-1)%2 == 0 and "TOPRIGHT" or "TOPLEFT",self.optColSet.templatesScrollFrame.C,"TOP",0,-floor((i-1)/2) * 125 - 5)
  7480. templateFrame:SetSize(185,120)
  7481. if self.optColSet.templateData[i]._twoSized then
  7482. templateFrame:SetSize(370,120)
  7483. end
  7484. templateFrame:SetBackdrop({edgeFile = ExRT.F.defBorder, edgeSize = 8})
  7485. templateFrame:SetBackdropBorderColor(1,1,1,0)
  7486. templateFrame.backgTexture = templateFrame:CreateTexture(nil, "BACKGROUND")
  7487. templateFrame.backgTexture:SetAllPoints()
  7488.  
  7489. templateFrame:SetScript("OnEnter",function (self)
  7490. self:SetBackdropBorderColor(1,1,1,0.5)
  7491. self.backgTexture:SetColorTexture(1,1,1,0.3)
  7492. end)
  7493.  
  7494. templateFrame:SetScript("OnLeave",function (self)
  7495. self:SetBackdropBorderColor(1,1,1,0)
  7496. self.backgTexture:SetColorTexture(0,0,0,0)
  7497. end)
  7498.  
  7499. templateFrame:SetScript("OnClick",function (self)
  7500. module.options.optColSet.templateRestore:Show()
  7501. module.options.optColSet.templateSaveData = {}
  7502. ExRT.F.table_copy(VExRT.ExCD2.colSet[module.options.optColTabs.selected],module.options.optColSet.templateSaveData)
  7503. for key,val in pairs(module.options.optColSet.templateData.toOptions) do
  7504. if type(val) ~= "table" then
  7505. if string.find(key,"^_") then
  7506. local key2 = string.sub(key,2)
  7507. if module.options.optColSet.templateData[i][key2] then
  7508. VExRT.ExCD2.colSet[module.options.optColTabs.selected][val] = module.options.optColSet.templateData[i][key2]
  7509. elseif key2 == "frameWidth" then
  7510. VExRT.ExCD2.colSet[module.options.optColTabs.selected][val] = max(110,VExRT.ExCD2.colSet[module.options.optColTabs.selected][val] or 110)
  7511. end
  7512. elseif val:find("General") then
  7513. VExRT.ExCD2.colSet[module.options.optColTabs.selected][val] = nil
  7514. else
  7515. VExRT.ExCD2.colSet[module.options.optColTabs.selected][val] = module.options.optColSet.templateData[i][key]
  7516. end
  7517. else
  7518. for k=1,#val do
  7519. VExRT.ExCD2.colSet[module.options.optColTabs.selected][val[k]] = module.options.optColSet.templateData[i][key][k]
  7520. end
  7521. end
  7522. end
  7523. module:ReloadAllSplits()
  7524. module.options.selectColumnTab()
  7525. end)
  7526.  
  7527. local width,height = self.optColSet.templateData[i].frameWidth or 160, self.optColSet.templateData[i].iconSize
  7528. local betweenLines = self.optColSet.templateData[i].frameBetweenLines or 0
  7529.  
  7530. templateFrame.barWidth = width
  7531. templateFrame.iconSize = height
  7532.  
  7533. templateFrame.fontName = self.optColSet.templateData[i].fontName
  7534. templateFrame.fontSize = self.optColSet.templateData[i].fontSize
  7535. templateFrame.fontOutline = self.optColSet.templateData[i].fontOutline
  7536. templateFrame.fontShadow = self.optColSet.templateData[i].fontShadow
  7537. for _,pos in pairs({"Left","Right","Center","Icon"}) do
  7538. templateFrame["font"..pos.."Name"] = self.optColSet.templateData[i]["font"..pos.."Name"] or templateFrame.fontName
  7539. templateFrame["font"..pos.."Size"] = self.optColSet.templateData[i]["font"..pos.."Size"] or templateFrame.fontSize
  7540. templateFrame["font"..pos.."Outline"] = self.optColSet.templateData[i]["font"..pos.."Outline"] or templateFrame.fontOutline
  7541. templateFrame["font"..pos.."Shadow"] = self.optColSet.templateData[i]["font"..pos.."Shadow"] or templateFrame.fontShadow
  7542. end
  7543.  
  7544. templateFrame.textTemplateLeft = self.optColSet.templateData[i].textTemplateLeft
  7545. templateFrame.textTemplateRight = self.optColSet.templateData[i].textTemplateRight
  7546. templateFrame.textTemplateCenter = self.optColSet.templateData[i].textTemplateCenter
  7547. templateFrame.optionIconName = self.optColSet.templateData[i].textIconName
  7548. templateFrame.optionCooldown = self.optColSet.templateData[i].methodsCooldown
  7549. templateFrame.optionIconPosition = self.optColSet.templateData[i].optionIconPosition
  7550. templateFrame.optionAnimation = self.optColSet.templateData[i].optionAnimation
  7551. templateFrame.optionGray = self.optColSet.templateData[i].optionGray
  7552.  
  7553. templateFrame.textureFile = self.optColSet.templateData[i].textureFile
  7554. templateFrame.optionAlphaBackground = self.optColSet.templateData[i].textureAlphaBackground
  7555. templateFrame.optionAlphaTimeLine = self.optColSet.templateData[i].textureAlphaTimeLine
  7556. templateFrame.optionAlphaCooldown = self.optColSet.templateData[i].textureAlphaCooldown
  7557.  
  7558. templateFrame.optionTimeLineAnimation = self.optColSet.templateData[i].optionTimeLineAnimation
  7559. templateFrame.optionStyleAnimation = self.optColSet.templateData[i].optionStyleAnimation
  7560.  
  7561. templateFrame.optionClassColorBackground = self.optColSet.templateData[i].optionClassColorBackground
  7562. templateFrame.optionClassColorTimeLine = self.optColSet.templateData[i].optionClassColorTimeLine
  7563. templateFrame.optionClassColorText = self.optColSet.templateData[i].optionClassColorText
  7564.  
  7565. templateFrame.optionIconHideBlizzardEdges = self.optColSet.templateData[i].iconHideBlizzardEdges
  7566.  
  7567. templateFrame.textureBorderColorR = self.optColSet.templateData[i].textureBorderColorR or 0
  7568. templateFrame.textureBorderColorG = self.optColSet.templateData[i].textureBorderColorG or 0
  7569. templateFrame.textureBorderColorB = self.optColSet.templateData[i].textureBorderColorB or 0
  7570. templateFrame.textureBorderColorA = self.optColSet.templateData[i].textureBorderColorA or 0
  7571.  
  7572. templateFrame.optionIconTitles = self.optColSet.templateData[i].iconTitles
  7573.  
  7574. local templateDataColorsTablesNames = {"colorsText","colorsBack","colorsTL"}
  7575. for object_c=1,3 do
  7576. for state_c=1,3 do
  7577. templateFrame["optionColor".. colorSetupFrameColorsObjectsNames[object_c] .. colorSetupFrameColorsNames[state_c] ] = {
  7578. r = self.optColSet.templateData[i][ templateDataColorsTablesNames[object_c] ][ (state_c-1)*3+1 ],
  7579. g = self.optColSet.templateData[i][ templateDataColorsTablesNames[object_c] ][ (state_c-1)*3+2 ],
  7580. b = self.optColSet.templateData[i][ templateDataColorsTablesNames[object_c] ][ (state_c-1)*3+3 ],
  7581. }
  7582. end
  7583. end
  7584.  
  7585. templateFrame.textureBorderSize = self.optColSet.templateData[i].textureBorderSize or 0
  7586.  
  7587. templateFrame.optionSmoothAnimationDuration = module.db.colsDefaults.textureSmoothAnimationDuration
  7588.  
  7589. local DiffSpellData = self.optColSet.templateData[i].DiffSpellData
  7590.  
  7591. local classColorsTable = type(CUSTOM_CLASS_COLORS)=="table" and CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS
  7592.  
  7593. templateFrame.lines = {}
  7594. for j=1,DiffSpellData and #DiffSpellData.spells or 5 do if not DiffSpellData or DiffSpellData.spells[j] ~= 0 then
  7595. local bar = CreateBar(templateFrame)
  7596. templateFrame.lines[j] = bar
  7597.  
  7598. if not self.optColSet.templateData[i].frameColumns then
  7599. bar:SetPoint("TOP",0,-height*(j-1)-10 -betweenLines*(j-1))
  7600. else
  7601. local inLine = (j-1) % self.optColSet.templateData[i].frameColumns
  7602. local line = ExRT.F.Round( ((j-1) - inLine) / self.optColSet.templateData[i].frameColumns )
  7603. if self.optColSet.templateData[i]._twoSized then
  7604. bar:SetPoint("TOPLEFT", inLine*width + 10, -line*height -10 -betweenLines*line)
  7605. else
  7606. local pos = inLine * width
  7607. local totalWidth = self.optColSet.templateData[i].frameColumns * width
  7608. pos = pos - totalWidth / 2
  7609. bar:SetPoint("TOPLEFT", templateFrame,"TOP",pos, -line*height -10 -betweenLines*line)
  7610. end
  7611. end
  7612.  
  7613. if self.optColSet.templateData[i]._Scaled then
  7614. bar:SetScale(self.optColSet.templateData[i]._Scaled)
  7615. end
  7616.  
  7617. local spellID = DiffSpellData and DiffSpellData.spells[j] or self.optColSet.templateData.spells[j]
  7618. local spellName,_,spellTexture = GetSpellInfo(spellID or 0)
  7619.  
  7620. local spellClass = DiffSpellData and DiffSpellData.spellsClass[j] or self.optColSet.templateData.spellsClass[j]
  7621.  
  7622. bar.data = {
  7623. name = ExRT.SDB.charName,
  7624. fullName = ExRT.SDB.charName,
  7625. icon = spellTexture,
  7626. spellName = i == 3 and spellName:sub(1,spellName:find(' ')) or spellName,
  7627. db = {spellID,spellClass},
  7628. lastUse = GetTime(),
  7629. charge = GetTime(),
  7630. cd = DiffSpellData and DiffSpellData.spellsCD[j] or self.optColSet.templateData.spellsCD[j],
  7631. duration = DiffSpellData and DiffSpellData.spellsDuration[j] or self.optColSet.templateData.spellsDuration[j],
  7632. classColor = classColorsTable[spellClass] or module.db.notAClass,
  7633.  
  7634. disabled = ((DiffSpellData and DiffSpellData.spellsDead[j]) or (not DiffSpellData and self.optColSet.templateData.spellsDead[j])) and 1,
  7635. isCharge = DiffSpellData and DiffSpellData.spellsCharge[j] or not DiffSpellData and self.optColSet.templateData.spellsCharge[j],
  7636.  
  7637. specialUpdateData = function(data)
  7638. local currTime = GetTime()
  7639. if data.isCharge then
  7640. if (data.charge + data.cd) < currTime then
  7641. data.charge = currTime
  7642. data.lastUse = currTime
  7643. end
  7644. return
  7645. end
  7646. if data.cd ~= 0 then
  7647. if (data.lastUse + data.cd) < currTime then
  7648. data.lastUse = currTime
  7649. end
  7650. elseif data.duration ~= 0 then
  7651. if (data.lastUse + data.duration) < currTime then
  7652. data.lastUse = currTime
  7653. end
  7654. end
  7655. end,
  7656. }
  7657.  
  7658. bar:UpdateStyle()
  7659. bar:Update()
  7660. bar:UpdateStatus()
  7661. if spellClass == "title" then
  7662. bar:CreateTitle()
  7663. end
  7664. end end
  7665. end end
  7666.  
  7667. self.optColSet.templateRestore = CreateFrame("Button",nil,self.optColSet.superTabFrame.tab[9])
  7668. self.optColSet.templateRestore:SetPoint("TOP",0,-10)
  7669. self.optColSet.templateRestore:SetSize(430,30)
  7670. self.optColSet.templateRestore:SetBackdrop({edgeFile = ExRT.F.defBorder, edgeSize = 8})
  7671. self.optColSet.templateRestore:SetBackdropBorderColor(1,0.5,0.5,1)
  7672. self.optColSet.templateRestore.text = ELib:Text(self.optColSet.templateRestore,L.cd2OtherSetTemplateRestore,12):Point('x'):Center():Color():Shadow()
  7673. self.optColSet.templateRestore:SetScript("OnEnter",function (self)
  7674. self.text:SetTextColor(1,1,0,1)
  7675. end)
  7676. self.optColSet.templateRestore:SetScript("OnLeave",function (self)
  7677. self.text:SetTextColor(1,1,1,1)
  7678. end)
  7679. self.optColSet.templateRestore:SetScript("OnClick",function (self)
  7680. VExRT.ExCD2.colSet[module.options.optColTabs.selected] = {}
  7681. ExRT.F.table_copy(module.options.optColSet.templateSaveData,VExRT.ExCD2.colSet[module.options.optColTabs.selected])
  7682. module:ReloadAllSplits()
  7683. module.options.selectColumnTab()
  7684. self:Hide()
  7685. end)
  7686. self.optColSet.templateRestore:Hide()
  7687.  
  7688. do
  7689. module.options.optColTabs.selected = module.db.maxColumns+1
  7690. module.options.tab.tabs[2]:SetScript("OnShow",function ()
  7691. module.options.selectColumnTab(self.optColTabs.tabs[module.db.maxColumns+1].button)
  7692. module.options.tab.tabs[2]:SetScript("OnShow",nil)
  7693. end)
  7694. end
  7695.  
  7696. --> Other setts
  7697. self.optSetTab = ELib:OneTab(self.tab.tabs[2],L.cd2OtherSet):Size(652,34):Point("TOP",0,-532)
  7698.  
  7699. self.chkSplit = ELib:Check(self.optSetTab,L.cd2split,VExRT.ExCD2.SplitOpt):Point("LEFT",10,0):Tooltip(L.cd2splittooltip):OnClick(function(self,event)
  7700. if self:GetChecked() then
  7701. VExRT.ExCD2.SplitOpt = true
  7702. else
  7703. VExRT.ExCD2.SplitOpt = nil
  7704. end
  7705. module:SplitExCD2Window()
  7706. module:ReloadAllSplits()
  7707. end)
  7708.  
  7709. self.chkNoRaid = ELib:Check(self.optSetTab,L.cd2noraid,VExRT.ExCD2.NoRaid):Point("LEFT",165,0):OnClick(function(self,event)
  7710. if self:GetChecked() then
  7711. VExRT.ExCD2.NoRaid = true
  7712. else
  7713. VExRT.ExCD2.NoRaid = nil
  7714. end
  7715. UpdateRoster()
  7716. end)
  7717.  
  7718. self.testMode = ELib:Check(self.optSetTab,L.cd2GeneralSetTestMode,module.db.testMode):Point("LEFT",325,0):Tooltip(L.cd2HelpTestButton):OnClick(function(self,event)
  7719. if self:GetChecked() then
  7720. module.db.testMode = true
  7721. else
  7722. module.db.testMode = nil
  7723. TestMode(1)
  7724. end
  7725. UpdateRoster()
  7726. end)
  7727.  
  7728. self.butResetToDef = ELib:Button(self.optSetTab,L.cd2OtherSetReset):Size(160,20):Point("LEFT",480,0):Tooltip(L.cd2HelpButtonDefault):OnClick(function()
  7729. StaticPopupDialogs["EXRT_EXCD_DEFAULT"] = {
  7730. text = L.cd2OtherSetReset,
  7731. button1 = L.YesText,
  7732. button2 = L.NoText,
  7733. OnAccept = function()
  7734. table_wipe2(VExRT.ExCD2.colSet[module.options.optColTabs.selected])
  7735. for optName,optVal in pairs(module.db.colsInit) do
  7736. VExRT.ExCD2.colSet[module.options.optColTabs.selected][optName] = optVal
  7737. end
  7738. VExRT.ExCD2.SortByAvailability = nil
  7739.  
  7740. module.options.selectColumnTab(self.optColTabs.tabs[module.options.optColTabs.selected].button)
  7741. module:ReloadAllSplits()
  7742. end,
  7743. timeout = 0,
  7744. whileDead = true,
  7745. hideOnEscape = true,
  7746. preferredIndex = 3,
  7747. }
  7748. StaticPopup_Show("EXRT_EXCD_DEFAULT")
  7749. end)
  7750.  
  7751.  
  7752.  
  7753. --> OPTIONS TAB3: History
  7754. self.butHistoryClear = ELib:Button(self.tab.tabs[3],L.cd2HistoryClear):Size(180,20):Point("TOPRIGHT",-3,-6):OnClick(function()
  7755. table_wipe2(module.db.historyUsage)
  7756. module.options.historyBox.EditBox:SetText("")
  7757. end)
  7758.  
  7759. local historyBoxUpdateTable = {}
  7760. local function historyBoxUpdate(v)
  7761. table_wipe2(historyBoxUpdateTable)
  7762. local count = 0
  7763. for i=1,#module.db.historyUsage do
  7764. if VExRT.ExCD2.CDE[module.db.historyUsage[i][2]] then
  7765. count = count + 1
  7766. end
  7767. if count >= v and VExRT.ExCD2.CDE[module.db.historyUsage[i][2]] then
  7768. local tm = date("%X",module.db.historyUsage[i][1])
  7769. local bosshpstr = module.db.historyUsage[i][4] and format(" (%d:%.2d)",module.db.historyUsage[i][4]/60,module.db.historyUsage[i][4]%60) or ""
  7770. local spellName,_,spellIcon = GetSpellInfo(module.db.historyUsage[i][2])
  7771. historyBoxUpdateTable [#historyBoxUpdateTable + 1] = format("|cffffff00[%s]%s|r %s |Hspell:%d|h|T%s:0|t%s|h",tm,bosshpstr,module.db.historyUsage[i][3] or "?",module.db.historyUsage[i][2] or 0,spellIcon or "Interface\\Icons\\Trade_Engineering",spellName or "?")
  7772. end
  7773. if #historyBoxUpdateTable > 44 then
  7774. break
  7775. end
  7776. end
  7777. module.options.historyBox.EditBox:SetText(strjoin("\n",unpack(historyBoxUpdateTable)))
  7778. end
  7779.  
  7780. self.historyBox = ELib:MultiEdit2(self.tab.tabs[3]):Size(652,530):Point("TOP",0,-36):Hyperlinks()
  7781. self.historyBox.EditBox:SetScript("OnShow",function(self)
  7782. historyBoxUpdate(1)
  7783. local count = 0
  7784. for i=1,#module.db.historyUsage do
  7785. if VExRT.ExCD2.CDE[module.db.historyUsage[i][2]] then
  7786. count = count + 1
  7787. end
  7788. end
  7789. module.options.historyBox.ScrollBar:SetMinMaxValues(1,max(count,1))
  7790. module.options.historyBox.ScrollBar:UpdateButtons()
  7791. end)
  7792. self.historyBox.ScrollBar:SetScript("OnValueChanged",function (self,val)
  7793. val = ExRT.F.Round(val)
  7794. historyBoxUpdate(val)
  7795. self:UpdateButtons()
  7796. end)
  7797.  
  7798. self.HelpPlate = {
  7799. [1] = {
  7800. FramePos = { x = 0, y = 0 },FrameSize = { width = 660, height = 615 },
  7801. [1] = { ButtonPos = { x = 500, y = -40 }, HighLightBox = { x = 485, y = -50, width = 170, height = 25 }, ToolTipDir = "LEFT", ToolTipText = L.cd2HelpFastSetup },
  7802. [2] = { ButtonPos = { x = 0, y = -135 }, HighLightBox = { x = 7, y = -85, width = 34, height = 495 }, ToolTipDir = "RIGHT", ToolTipText = L.cd2HelpOnOff },
  7803. [3] = { ButtonPos = { x = 250, y = -135 }, HighLightBox = { x = 225, y = -85, width = 150, height = 495 }, ToolTipDir = "DOWN", ToolTipText = L.cd2HelpCol },
  7804. [4] = { ButtonPos = { x = 375, y = -135}, HighLightBox = { x = 380, y = -85, width = 85, height = 495 }, ToolTipDir = "DOWN", ToolTipText = L.cd2HelpPriority },
  7805. [5] = { ButtonPos = { x = 470, y = -135 }, HighLightBox = { x = 465, y = -85, width = 165, height = 495 }, ToolTipDir = "LEFT", ToolTipText = L.cd2HelpTime },
  7806. [6] = { ButtonPos = { x = 370, y = -570 }, HighLightBox = { x = 7, y = -580, width = 625, height = 30 }, ToolTipDir = "UP", ToolTipText = L.cd2HelpAddButton },
  7807. },
  7808. [2] = {
  7809. FramePos = { x = 0, y = 0 },FrameSize = { width = 660, height = 615 },
  7810. [1] = { ButtonPos = { x = 50, y = -130 }, HighLightBox = { x = 0, y = -70, width = 660, height = 480 }, ToolTipDir = "RIGHT", ToolTipText = L.cd2HelpColSetup },
  7811. [2] = { ButtonPos = { x = 320, y = -570 }, HighLightBox = { x = 315, y = -580, width = 140, height = 30 }, ToolTipDir = "LEFT", ToolTipText = L.cd2HelpTestButton },
  7812. [3] = { ButtonPos = { x = 500, y = -570 }, HighLightBox = { x = 490, y = -580, width = 160, height = 30 }, ToolTipDir = "LEFT", ToolTipText = L.cd2HelpButtonDefault },
  7813. },
  7814. [3] = {
  7815. FramePos = { x = 0, y = 0 },FrameSize = { width = 660, height = 615 },
  7816. [1] = { ButtonPos = { x = 310, y = -50 }, HighLightBox = { x = 0, y = -50, width = 660, height = 565 }, ToolTipDir = "DOWN", ToolTipText = L.cd2HelpHistory },
  7817. }
  7818. }
  7819. self.HELPButton = ExRT.lib.CreateHelpButton(self,self.HelpPlate,self.tab)
  7820. self.HELPButton:SetPoint("CENTER",self,"TOPLEFT",0,15)
  7821.  
  7822. function self.HELPButton:Click2()
  7823. local min,max=module.options.ScrollBar:GetMinMaxValues()
  7824. module.options.ScrollBar:SetValue(max)
  7825. end
  7826. end
  7827.  
  7828. function module.options:CleanUPVariables()
  7829. local cleanUP = {}
  7830. for sett,col in pairs(VExRT.ExCD2.CDECol) do
  7831. local bool = nil
  7832. for i=1,#module.db.spellDB do
  7833. for j=3,7 do
  7834. if module.db.spellDB[i][j] then
  7835. if tonumber( string.gsub(sett,";%d",""),nil ) == module.db.spellDB[i][j][1] then
  7836. bool = true
  7837. end
  7838. end
  7839. end
  7840. end
  7841. if not bool then
  7842. cleanUP [#cleanUP + 1] = sett
  7843. end
  7844. end
  7845. for i=1,#cleanUP do
  7846. VExRT.ExCD2.CDECol[cleanUP[i]] = nil
  7847. end
  7848. table_wipe2(cleanUP)
  7849. for sid,val in pairs(VExRT.ExCD2.CDE) do
  7850. local bool = nil
  7851. for i=1,#module.db.spellDB do
  7852. if sid == module.db.spellDB[i][1] then
  7853. bool = true
  7854. end
  7855. end
  7856. if not bool then
  7857. cleanUP [#cleanUP + 1] = sid
  7858. end
  7859. end
  7860. for i=1,#cleanUP do
  7861. VExRT.ExCD2.CDE[cleanUP[i]] = nil
  7862. end
  7863. table_wipe2(cleanUP)
  7864. for sid,val in pairs(VExRT.ExCD2.Priority) do
  7865. local bool = nil
  7866. for i=1,#module.db.spellDB do
  7867. if sid == module.db.spellDB[i][1] then
  7868. bool = true
  7869. end
  7870. end
  7871. if not bool then
  7872. cleanUP [#cleanUP + 1] = sid
  7873. end
  7874. end
  7875. for i=1,#cleanUP do
  7876. VExRT.ExCD2.Priority[cleanUP[i]] = nil
  7877. end
  7878. end
  7879.  
  7880. local function CreateBlackList(text)
  7881. local blacklist = {}
  7882. local tmpList = {strsplit("\n", text)}
  7883. for i=1,#tmpList do
  7884. if tmpList[i]~="" then
  7885. if tmpList[i]:find(":(%d+)") then
  7886. local name,spellID = tmpList[i]:match("([^:]+):(%d+)")
  7887. if name and spellID then
  7888. spellID = tonumber(spellID)
  7889. blacklist[ spellID ] = blacklist[ spellID ] or {}
  7890. name = name:lower()
  7891. blacklist[ spellID ][name] = true
  7892. end
  7893. else
  7894. tmpList[i] = tmpList[i]:lower()
  7895. blacklist[ tmpList[i] ] = true
  7896. end
  7897. end
  7898. end
  7899. return blacklist
  7900. end
  7901. local function CreateWhiteList(text)
  7902. if text == "" then
  7903. return
  7904. end
  7905. local whitelist = {}
  7906. local tmpList = {strsplit("\n", text)}
  7907. for i=1,#tmpList do
  7908. if tmpList[i]~="" then
  7909. tmpList[i] = tmpList[i]:lower()
  7910. whitelist[ tmpList[i] ] = true
  7911. end
  7912. end
  7913. return whitelist
  7914. end
  7915.  
  7916. local lastSplitsReload = 0
  7917. function module:ReloadAllSplits(argScaleFix)
  7918. local _ctime = GetTime()
  7919. if lastSplitsReload > _ctime then
  7920. return
  7921. end
  7922. lastSplitsReload = _ctime + 0.05
  7923. local VExRT_ColumnOptions = VExRT.ExCD2.colSet
  7924. local Width = 0
  7925. local maxHeight = 0
  7926. local maxLine = VExRT_ColumnOptions[module.db.maxColumns+1].frameLines or module.db.colsDefaults.frameLines
  7927. local maxBetweenLines = 0
  7928. if VExRT_ColumnOptions[module.db.maxColumns+1].frameColumns then
  7929. maxLine = ceil(maxLine / VExRT_ColumnOptions[module.db.maxColumns+1].frameColumns)
  7930. end
  7931.  
  7932. for i=1,module.db.maxColumns do
  7933. local columnFrame = module.frame.colFrame[i]
  7934. if not columnFrame.LOADEDs then
  7935. columnFrame.LOADEDs = {}
  7936. end
  7937.  
  7938. columnFrame.iconSize = (not VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[i].iconSize) or (VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].iconSize) or module.db.colsDefaults.iconSize
  7939. if VExRT_ColumnOptions[i].enabled and columnFrame.iconSize > maxHeight then
  7940. maxHeight = columnFrame.iconSize
  7941. end
  7942.  
  7943. local frameBetweenLines = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameBetweenLines) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameBetweenLines) or module.db.colsDefaults.frameBetweenLines
  7944.  
  7945. local frameColumns = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameColumns) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameColumns) or module.db.colsDefaults.frameColumns
  7946. columnFrame.frameColumns = frameColumns
  7947. local linesShown = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameLines) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameLines) or module.db.colsDefaults.frameLines
  7948. linesShown = ceil(linesShown / frameColumns)
  7949. local linesTotal = linesShown * frameColumns
  7950. if VExRT.ExCD2.SplitOpt then
  7951. columnFrame:SetHeight(columnFrame.iconSize*linesShown+frameBetweenLines*(linesShown-1))
  7952. else
  7953. columnFrame:SetHeight(columnFrame.iconSize*linesShown)
  7954. if VExRT_ColumnOptions[i].enabled then
  7955. if linesShown > maxLine then
  7956. maxLine = linesShown
  7957. end
  7958. local nowBetweenLines = frameBetweenLines*(linesShown-1)
  7959. if nowBetweenLines > maxBetweenLines then
  7960. maxBetweenLines = nowBetweenLines
  7961. end
  7962. end
  7963. end
  7964. columnFrame.NumberLastLinesActive = module.db.maxLinesInCol
  7965.  
  7966. if VExRT_ColumnOptions[i].enabled then
  7967. for j=1,linesTotal do
  7968. if not columnFrame.LOADEDs[j] then
  7969. columnFrame.lines[j] = CreateBar(columnFrame)
  7970. columnFrame.lines[j]:Hide()
  7971. columnFrame.LOADEDs[j] = true
  7972. end
  7973. end
  7974. columnFrame.IsColumnEnabled = true
  7975. else
  7976. columnFrame.IsColumnEnabled = false
  7977. end
  7978.  
  7979. local frameAlpha = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameAlpha) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameAlpha) or module.db.colsDefaults.frameAlpha
  7980. columnFrame:SetAlpha(frameAlpha/100)
  7981.  
  7982. local frameScale = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameScale) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameScale) or module.db.colsDefaults.frameScale
  7983. if VExRT.ExCD2.SplitOpt then
  7984. if argScaleFix == "ScaleFix" then
  7985. ExRT.F.SetScaleFix(columnFrame,frameScale/100)
  7986. else
  7987. columnFrame:SetScale(frameScale/100)
  7988. end
  7989. else
  7990. columnFrame:SetScale(1)
  7991. end
  7992.  
  7993. local blackBack = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameBlackBack) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameBlackBack) or module.db.colsDefaults.frameBlackBack
  7994. columnFrame.texture:SetColorTexture(0,0,0,blackBack / 100)
  7995.  
  7996. --> View options
  7997. columnFrame.optionClassColorBackground = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureClassBackground) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureClassBackground)
  7998. columnFrame.optionClassColorTimeLine = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureClassTimeLine) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureClassTimeLine)
  7999. columnFrame.optionClassColorText = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureClassText) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureClassText)
  8000.  
  8001. columnFrame.optionAnimation = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureAnimation) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureAnimation)
  8002. columnFrame.optionSmoothAnimation = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureSmoothAnimation) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureSmoothAnimation)
  8003. columnFrame.optionSmoothAnimationDuration = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureSmoothAnimationDuration) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureSmoothAnimationDuration) or module.db.colsDefaults.textureSmoothAnimationDuration
  8004. columnFrame.optionSmoothAnimationDuration = columnFrame.optionSmoothAnimationDuration / 100
  8005. columnFrame.optionLinesMax = min(linesShown*frameColumns,module.db.maxLinesInCol)
  8006. columnFrame.optionShownOnCD = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsShownOnCD) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsShownOnCD)
  8007. columnFrame.optionIconPosition = (not VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[i].iconPosition) or (VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].iconPosition) or module.db.colsDefaults.iconPosition
  8008. columnFrame.optionStyleAnimation = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsStyleAnimation) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsStyleAnimation) or module.db.colsDefaults.methodsStyleAnimation
  8009. columnFrame.optionTimeLineAnimation = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsTimeLineAnimation) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsTimeLineAnimation) or module.db.colsDefaults.methodsTimeLineAnimation
  8010. columnFrame.optionCooldown = (not VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[i].methodsCooldown) or (VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsCooldown)
  8011. columnFrame.optionIconName = (not VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[i].textIconName) or (VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textIconName)
  8012. columnFrame.optionHideSpark = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureHideSpark) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureHideSpark)
  8013. columnFrame.optionIconTitles = (not VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[i].iconTitles) or (VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].iconTitles)
  8014. columnFrame.optionIconTitles = columnFrame.optionIconTitles and not (columnFrame.optionIconPosition == 3)
  8015. columnFrame.optionIconHideBlizzardEdges = (not VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[i].iconHideBlizzardEdges) or (VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].iconHideBlizzardEdges)
  8016.  
  8017. columnFrame.methodsIconTooltip = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsIconTooltip) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsIconTooltip)
  8018. columnFrame.methodsLineClick = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsLineClick) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsLineClick)
  8019. columnFrame.methodsNewSpellNewLine = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsNewSpellNewLine) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsNewSpellNewLine)
  8020. columnFrame.methodsSortingRules = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsSortingRules) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsSortingRules) or module.db.colsDefaults.methodsSortingRules
  8021. columnFrame.methodsHideOwnSpells = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsHideOwnSpells) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsHideOwnSpells)
  8022. columnFrame.methodsAlphaNotInRange = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsAlphaNotInRange) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsAlphaNotInRange)
  8023. columnFrame.methodsAlphaNotInRangeNum = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsAlphaNotInRangeNum) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsAlphaNotInRangeNum) or module.db.colsDefaults.methodsAlphaNotInRangeNum
  8024. columnFrame.methodsAlphaNotInRangeNum = columnFrame.methodsAlphaNotInRangeNum / 100
  8025. columnFrame.methodsDisableActive = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsDisableActive) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsDisableActive)
  8026. columnFrame.methodsOneSpellPerCol = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].methodsOneSpellPerCol) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsOneSpellPerCol)
  8027.  
  8028. columnFrame.methodsOnlyInCombat = (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].methodsOnlyInCombat) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].methodsOnlyInCombat)
  8029. columnFrame.visibilityPartyType = (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityPartyType) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityPartyType)
  8030. columnFrame.visibilityArena = not ( (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityDisableArena) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityDisableArena) )
  8031. columnFrame.visibilityBG = not ( (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityDisableBG) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityDisableBG) )
  8032. columnFrame.visibility3ppl = not ( (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityDisable3ppl) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityDisable3ppl) )
  8033. columnFrame.visibility5ppl = not ( (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityDisable5ppl) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityDisable5ppl) )
  8034. columnFrame.visibilityRaid = not ( (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityDisableRaid) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityDisableRaid) )
  8035. columnFrame.visibilityWorld = not ( (not VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[i].visibilityDisableWorld) or (VExRT_ColumnOptions[i].visibilityGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].visibilityDisableWorld) )
  8036.  
  8037. columnFrame.textTemplateLeft = (not VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[i].textTemplateLeft) or (VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textTemplateLeft) or module.db.colsDefaults.textTemplateLeft
  8038. columnFrame.textTemplateRight = (not VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[i].textTemplateRight) or (VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textTemplateRight) or module.db.colsDefaults.textTemplateRight
  8039. columnFrame.textTemplateCenter = (not VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[i].textTemplateCenter) or (VExRT_ColumnOptions[i].textGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textTemplateCenter) or module.db.colsDefaults.textTemplateCenter
  8040.  
  8041. local blacklistText = (not VExRT_ColumnOptions[i].blacklistGeneral and VExRT_ColumnOptions[i].blacklistText) or (VExRT_ColumnOptions[i].blacklistGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].blacklistText) or module.db.colsDefaults.blacklistText
  8042. columnFrame.BlackList = CreateBlackList(blacklistText)
  8043. local whitelistText = (not VExRT_ColumnOptions[i].blacklistGeneral and VExRT_ColumnOptions[i].whitelistText) or (VExRT_ColumnOptions[i].blacklistGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].whitelistText) or module.db.colsDefaults.whitelistText
  8044. columnFrame.WhiteList = CreateWhiteList(whitelistText)
  8045.  
  8046. local frameWidth = (not VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[i].frameWidth) or (VExRT_ColumnOptions[i].frameGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameWidth) or module.db.colsDefaults.frameWidth
  8047. columnFrame:SetWidth(frameWidth*frameColumns)
  8048. columnFrame.barWidth = frameWidth
  8049.  
  8050. columnFrame.optionGray = (not VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[i].iconGray) or (VExRT_ColumnOptions[i].iconGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].iconGray)
  8051. columnFrame.fontSize = (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontSize) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontSize) or module.db.colsDefaults.fontSize
  8052. columnFrame.fontName = (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontName) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontName) or module.db.colsDefaults.fontName
  8053. columnFrame.fontOutline = (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontOutline) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontOutline)
  8054. columnFrame.fontShadow = (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontShadow) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontShadow)
  8055. columnFrame.textureFile = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureFile) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureFile) or module.db.colsDefaults.textureFile
  8056. columnFrame.textureBorderSize = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureBorderSize) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureBorderSize) or module.db.colsDefaults.textureBorderSize
  8057.  
  8058. columnFrame.textureBorderColorR = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureBorderColorR) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureBorderColorR) or module.db.colsDefaults.textureBorderColorR
  8059. columnFrame.textureBorderColorG = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureBorderColorG) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureBorderColorG) or module.db.colsDefaults.textureBorderColorG
  8060. columnFrame.textureBorderColorB = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureBorderColorB) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureBorderColorB) or module.db.colsDefaults.textureBorderColorB
  8061. columnFrame.textureBorderColorA = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureBorderColorA) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureBorderColorA) or module.db.colsDefaults.textureBorderColorA
  8062.  
  8063. local fontOtherAvailable = (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontOtherAvailable) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontOtherAvailable)
  8064.  
  8065. columnFrame.fontLeftSize = (not fontOtherAvailable and columnFrame.fontSize) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontLeftSize) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontLeftSize) or module.db.colsDefaults.fontSize
  8066. columnFrame.fontLeftName = (not fontOtherAvailable and columnFrame.fontName) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontLeftName) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontLeftName) or module.db.colsDefaults.fontName
  8067. columnFrame.fontLeftOutline = (not fontOtherAvailable and columnFrame.fontOutline) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontLeftOutline) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontLeftOutline)))
  8068. columnFrame.fontLeftShadow = (not fontOtherAvailable and columnFrame.fontShadow) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontLeftShadow) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontLeftShadow)))
  8069.  
  8070. columnFrame.fontRightSize = (not fontOtherAvailable and columnFrame.fontSize) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontRightSize) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontRightSize) or module.db.colsDefaults.fontSize
  8071. columnFrame.fontRightName = (not fontOtherAvailable and columnFrame.fontName) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontRightName) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontRightName) or module.db.colsDefaults.fontName
  8072. columnFrame.fontRightOutline = (not fontOtherAvailable and columnFrame.fontOutline) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontRightOutline) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontRightOutline)))
  8073. columnFrame.fontRightShadow = (not fontOtherAvailable and columnFrame.fontShadow) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontRightShadow) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontRightShadow)))
  8074.  
  8075. columnFrame.fontCenterSize = (not fontOtherAvailable and columnFrame.fontSize) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontCenterSize) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontCenterSize) or module.db.colsDefaults.fontSize
  8076. columnFrame.fontCenterName = (not fontOtherAvailable and columnFrame.fontName) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontCenterName) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontCenterName) or module.db.colsDefaults.fontName
  8077. columnFrame.fontCenterOutline = (not fontOtherAvailable and columnFrame.fontOutline) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontCenterOutline) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontCenterOutline)))
  8078. columnFrame.fontCenterShadow = (not fontOtherAvailable and columnFrame.fontShadow) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontCenterShadow) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontCenterShadow)))
  8079.  
  8080. columnFrame.fontIconSize = (not fontOtherAvailable and columnFrame.fontSize) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontIconSize) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontIconSize) or module.db.colsDefaults.fontSize
  8081. columnFrame.fontIconName = (not fontOtherAvailable and columnFrame.fontName) or (not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontIconName) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontIconName) or module.db.colsDefaults.fontName
  8082. columnFrame.fontIconOutline = (not fontOtherAvailable and columnFrame.fontOutline) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontIconOutline) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontIconOutline)))
  8083. columnFrame.fontIconShadow = (not fontOtherAvailable and columnFrame.fontShadow) or (fontOtherAvailable and ((not VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[i].fontIconShadow) or (VExRT_ColumnOptions[i].fontGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].fontIconShadow)))
  8084.  
  8085. for j=1,3 do
  8086. for n=1,3 do
  8087. local object = colorSetupFrameColorsObjectsNames[j]
  8088. local state = colorSetupFrameColorsNames[n]
  8089. if not columnFrame["optionColor"..object..state] then
  8090. columnFrame["optionColor"..object..state] = {}
  8091. end
  8092.  
  8093. columnFrame["optionColor"..object..state].r = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i]["textureColor"..object..state.."R"]) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1]["textureColor"..object..state.."R"]) or module.db.colsDefaults["textureColor"..object..state.."R"]
  8094. columnFrame["optionColor"..object..state].g = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i]["textureColor"..object..state.."G"]) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1]["textureColor"..object..state.."G"]) or module.db.colsDefaults["textureColor"..object..state.."G"]
  8095. columnFrame["optionColor"..object..state].b = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i]["textureColor"..object..state.."B"]) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1]["textureColor"..object..state.."B"]) or module.db.colsDefaults["textureColor"..object..state.."B"]
  8096. end
  8097. end
  8098.  
  8099. columnFrame.optionAlphaBackground = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureAlphaBackground) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureAlphaBackground) or module.db.colsDefaults.textureAlphaBackground
  8100. columnFrame.optionAlphaTimeLine = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureAlphaTimeLine) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureAlphaTimeLine) or module.db.colsDefaults.textureAlphaTimeLine
  8101. columnFrame.optionAlphaCooldown = (not VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[i].textureAlphaCooldown) or (VExRT_ColumnOptions[i].textureGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].textureAlphaCooldown) or module.db.colsDefaults.textureAlphaCooldown
  8102.  
  8103. if VExRT_ColumnOptions[i].enabled then
  8104. for n=1,linesTotal do
  8105. columnFrame.lines[n]:UpdateStyle()
  8106. if columnFrame.lines[n]:IsVisible() then
  8107. columnFrame.lines[n]:UpdateStatus()
  8108. end
  8109. end
  8110.  
  8111. local frameAnchorBottom = (not VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[i].frameAnchorBottom) or (VExRT_ColumnOptions[i].methodsGeneral and VExRT_ColumnOptions[module.db.maxColumns+1].frameAnchorBottom)
  8112. if frameAnchorBottom then
  8113. local lastLine = nil
  8114. for n=1,linesTotal do
  8115. local inLine = (n-1) % frameColumns
  8116. local line = ((n-1) - inLine) / frameColumns
  8117. columnFrame.lines[n]:ClearAllPoints()
  8118. columnFrame.lines[n]:SetPoint("BOTTOMLEFT", inLine*frameWidth, line*columnFrame.iconSize+line*frameBetweenLines)
  8119.  
  8120. if line ~= lastLine then
  8121. columnFrame.lines[n].IsNewLine = true
  8122. else
  8123. columnFrame.lines[n].IsNewLine = nil
  8124. end
  8125. lastLine = line
  8126. end
  8127. else
  8128. local lastLine = nil
  8129. for n=1,linesTotal do
  8130. local inLine = (n-1) % frameColumns
  8131. local line = ExRT.F.Round( ((n-1) - inLine) / frameColumns )
  8132. columnFrame.lines[n]:ClearAllPoints()
  8133. columnFrame.lines[n]:SetPoint("TOPLEFT", inLine*frameWidth, -line*columnFrame.iconSize-line*frameBetweenLines)
  8134.  
  8135. if line ~= lastLine then
  8136. columnFrame.lines[n].IsNewLine = true
  8137. else
  8138. columnFrame.lines[n].IsNewLine = nil
  8139. end
  8140. lastLine = line
  8141. end
  8142. end
  8143. end
  8144.  
  8145. if VExRT_ColumnOptions[i].enabled and VExRT.ExCD2.enabled then
  8146. columnFrame.optionIsEnabled = true
  8147. columnFrame:Show()
  8148. else
  8149. columnFrame.optionIsEnabled = nil
  8150. columnFrame:Hide()
  8151. end
  8152. if not VExRT.ExCD2.SplitOpt then
  8153. columnFrame:ClearAllPoints()
  8154. columnFrame:SetPoint("TOPLEFT",module.frame,Width, 0)
  8155. else
  8156. if VExRT_ColumnOptions[i].posX and VExRT_ColumnOptions[i].posY then
  8157. columnFrame:ClearAllPoints()
  8158. columnFrame:SetPoint("TOPLEFT",UIParent,"BOTTOMLEFT",VExRT_ColumnOptions[i].posX,VExRT_ColumnOptions[i].posY)
  8159. else
  8160. columnFrame:ClearAllPoints()
  8161. columnFrame:SetPoint("CENTER",UIParent,"CENTER",0,0)
  8162. end
  8163. end
  8164. if VExRT_ColumnOptions[i].enabled then
  8165. Width = Width + frameWidth*frameColumns
  8166. end
  8167. end
  8168. module.frame:SetWidth(Width)
  8169. module.frame:SetHeight(maxHeight*maxLine + maxBetweenLines)
  8170. module.frame:SetAlpha((VExRT_ColumnOptions[module.db.maxColumns+1].frameAlpha or module.db.colsDefaults.frameAlpha)/100)
  8171. if argScaleFix == "ScaleFix" then
  8172. ExRT.F.SetScaleFix(module.frame,(VExRT_ColumnOptions[module.db.maxColumns+1].frameScale or module.db.colsDefaults.frameScale)/100)
  8173. else
  8174. module.frame:SetScale((VExRT_ColumnOptions[module.db.maxColumns+1].frameScale or module.db.colsDefaults.frameScale)/100)
  8175. end
  8176.  
  8177. module:updateCombatVisibility()
  8178.  
  8179. SortAllData()
  8180. UpdateAllData()
  8181. end
  8182.  
  8183. function module:SplitExCD2Window()
  8184. if VExRT.ExCD2.SplitOpt then
  8185. for i=1,module.db.maxColumns do
  8186. module.frame.colFrame[i]:SetParent(UIParent)
  8187. module.frame.colFrame[i]:EnableMouse(false)
  8188.  
  8189. if not VExRT.ExCD2.lock then
  8190. ExRT.F.LockMove(module.frame.colFrame[i],true,module.frame.colFrame[i].lockTexture)
  8191. ExRT.lib.AddShadowComment(module.frame.colFrame[i],nil,L.cd2,i,72,"OUTLINE")
  8192. end
  8193. end
  8194. module.frame:Hide()
  8195. else
  8196. for i=1,module.db.maxColumns do
  8197. module.frame.colFrame[i]:SetParent(module.frame)
  8198. ExRT.F.LockMove(module.frame.colFrame[i],nil,module.frame.colFrame[i].lockTexture)
  8199. ExRT.lib.AddShadowComment(module.frame.colFrame[i],1)
  8200. end
  8201. module.frame:Show()
  8202. end
  8203.  
  8204. end
  8205.  
  8206. function module:slash(arg1,arg2)
  8207. if string.find(arg1,"runcd ") then
  8208. local sid,name = arg2:match("%a+ (%d+) (.+)")
  8209. if sid and name then
  8210. print("Run CD "..sid.." by "..name)
  8211. module.main:COMBAT_LOG_EVENT_UNFILTERED(nil,"SPELL_CAST_SUCCESS",nil,nil,name,nil,nil,nil,nil,nil,nil,sid)
  8212. end
  8213. elseif string.find(arg1,"resetcd ") then
  8214. local sid,name = arg2:match("%a+ (%d+) (.+)")
  8215. if sid and name then
  8216. print("Reset CD "..sid.." by "..name)
  8217. local j = module.db.cdsNav[name][sid]
  8218. if j then
  8219. j[3] = 0
  8220. end
  8221. end
  8222. end
  8223. end
  8224.  
  8225. module.db.AllClassSpellsInText = [[
  8226. --16:38 18.07.2016, Build 22248 Pre-patch
  8227. local module = GExRT.A.ExCD2
  8228. module.db.allClassSpells = {
  8229. ["WARRIOR"] = {
  8230. {107574,3, {107574,90, 20}, nil, nil, nil, }, --Аватара
  8231. {184364,4, nil, nil, {184364,120, 8}, nil, }, --Безудержное восстановление
  8232. {2565, 4, nil, nil, nil, {2565, 13, 6}, }, --Блок щитом
  8233. {1719, 3, {1719, 60, 5}, nil, nil, nil, }, --Боевой крик
  8234. {118038,4, nil, {118038,180, 8}, nil, nil, }, --Бой насмерть
  8235. {202168,4, nil, nil, nil, {202168,30, 0}, }, --Верная победа
  8236. {46924, 3, nil, nil, {46924, 90, 6}, nil, }, --Вихрь клинков
  8237. {227847,3, nil, {227847,90, 6}, nil, nil, }, --Вихрь клинков
  8238. {6544, 4, {52174, 45, 0}, nil, nil, nil, }, --Героический прыжок
  8239. {871, 4, nil, nil, nil, {871, 240, 8}, }, --Глухая оборона
  8240. {1160, 4, nil, nil, nil, {1160, 90, 8}, }, --Деморализующий крик
  8241. {6552, 5, {6552, 15, 0}, nil, nil, nil, }, --Зуботычина
  8242. {12292, 3, nil, nil, {12292, 30, 10}, nil, }, --Кровавая баня
  8243. {213915,1, nil, nil, nil, {213915,30, 0}, }, --Массовое отражение заклинания
  8244. {209577,3, nil, {209577,60, 0}, nil, nil, }, --Миротворец
  8245. {12975, 4, nil, nil, nil, {12975, 180, 15}, }, --Ни шагу назад
  8246. {97462, 3, nil, {97462, 180, 10}, {97462, 180, 10}, nil, }, --Ободряющий клич
  8247. {197690,4, nil, {197690,10, 0}, nil, nil, }, --Оборонительная стойка
  8248. {152277,3, nil, {152277,60, 6.5}, nil, nil, }, --Опустошитель
  8249. {228920,3, nil, nil, nil, {228920,60, 6.5}, }, --Опустошитель
  8250. {23920, 4, nil, nil, nil, {23920, 25, 5}, }, --Отражение заклинания
  8251. {198304,2, nil, nil, nil, {198304,15, 10}, }, --Перехват
  8252. {355, 5, {355, 8, 0}, nil, nil, nil, }, --Провокация
  8253. {118000,3, nil, nil, {118000,25, 0}, nil, }, --Рев дракона
  8254. {100, 3, {100, 20, 0}, nil, nil, nil, }, --Рывок
  8255. {107570,3, {107570,30, 0}, nil, nil, nil, }, --Удар громовержца
  8256. {167105,3, nil, {167105,45, 8}, nil, nil, }, --Удар колосса
  8257. {46968, 1, {46968, 40, 0}, nil, nil, nil, }, --Ударная волна
  8258. {5246, 3, nil, {5246, 90, 0}, {5246, 90, 0}, nil, }, --Устрашающий крик
  8259. {203524,4, nil, nil, nil, {203524,45, 3}, }, --Ярость Нелтариона
  8260. {205546,3, nil, nil, {205546,45, 0}, nil, }, --Ярость Одина
  8261. {18499, 3, {18499, 60, 6}, nil, nil, nil, }, --Ярость берсерка
  8262. },
  8263. ["PALADIN"] = {
  8264. {204035,4, nil, nil, {204035,180, 0}, nil, }, --Бастион Света
  8265. {1022, 2, {1022, 300, 10}, nil, nil, nil, }, --Благословение защиты
  8266. {204018,2, nil, nil, {204018,180, 10}, nil, }, --Благословение защиты от заклинаний
  8267. {1044, 2, {1044, 25, 8}, nil, nil, nil, }, --Благословенная свобода
  8268. {498, 4, nil, {498, 60, 8}, {498, 60, 8}, nil, }, --Божественная защита
  8269. {114165,3, nil, {114165,20, 0}, nil, nil, }, --Божественная призма
  8270. {190784,3, {190784,45, 3}, nil, nil, nil, }, --Божественный скакун
  8271. {642, 4, {642, 300, 8}, nil, nil, nil, }, --Божественный щит
  8272. {214202,3, nil, {214202,30, 10}, nil, nil, }, --Верховенство закона
  8273. {31821, 1, nil, {31821, 180, 6}, nil, nil, }, --Владение аурами
  8274. {633, 2, {633, 600, 0}, nil, nil, nil, }, --Возложение рук
  8275. {31884, 3, nil, nil, {31884, 120, 20}, {31884, 120, 20}, }, --Гнев карателя
  8276. {31842, 1, nil, {31842, 120, 20}, nil, nil, }, --Гнев карателя
  8277. {210220,3, nil, nil, nil, {210220,180, 0}, }, --Гнев небес
  8278. {223306,3, nil, {223306,12, 5}, nil, nil, }, --Дарование веры
  8279. {62124, 5, {62124, 8, 0}, nil, nil, nil, }, --Длань расплаты
  8280. {6940, 2, nil, {6940, 150, 0}, {6940, 150, 0}, nil, }, --Жертвенное благословление
  8281. {86659, 4, nil, nil, {86659, 300, 8}, nil, }, --Защитник древних королей
  8282. {200652,3, nil, {200652,90, 0}, nil, nil, }, --Избавление Тира
  8283. {205273,3, nil, nil, nil, {205273,30, 0}, }, --Испепеляющий след
  8284. {114158,3, nil, {114158,60, 14}, nil, nil, }, --Молот Света
  8285. {853, 3, {853, 60, 0}, nil, nil, nil, }, --Молот правосудия
  8286. {209202,4, nil, nil, {209202,60, 0}, nil, }, --Око Тира
  8287. {205191,4, nil, nil, nil, {205191,60, 10}, }, --Око за око
  8288. {4987, 5, nil, {4987, 8, 0}, {213644,8, 0}, {213644,8, 0}, }, --Очищение
  8289. {20066, 3, {20066, 15, 0}, nil, nil, nil, }, --Покаяние
  8290. {183218,3, nil, nil, nil, {183218,30, 10}, }, --Преграждающая длань
  8291. {31850, 4, nil, nil, {31850, 120, 8}, nil, }, --Ревностный защитник
  8292. {85222, 3, nil, {85222, 12, 0}, nil, nil, }, --Свет зари
  8293. {184092,3, nil, nil, {184092,15, 0}, nil, }, --Свет защитника
  8294. {105809,3, nil, {105809,90, 20}, nil, nil, }, --Святой каратель
  8295. {224668,3, nil, nil, nil, {224668,120, 20}, }, --Священная война
  8296. {152262,3, nil, nil, {152262,30, 16}, nil, }, --Серафим
  8297. {115750,3, {115750,90, 6}, nil, nil, nil, }, --Слепящий свет
  8298. {213757,3, nil, nil, nil, {213757,20, 6.5}, }, --Смертный приговор
  8299. {210191,3, nil, nil, nil, {210191,60, 0}, }, --Торжество
  8300. {96231, 5, nil, nil, {96231, 15, 0}, {96231, 15, 0}, }, --Укор
  8301. {200025,3, nil, {200025,15, 8}, nil, nil, }, --Частица добродетели
  8302. {184662,4, nil, nil, nil, {184662,120, 15}, }, --Щит мстителя
  8303. {204150,1, nil, nil, {204150,300, 6}, nil, }, --Эгида Света
  8304. },
  8305. ["HUNTER"] = {
  8306. {191241,3, nil, nil, nil, {191241,30, 3}, }, --Бомба-липучка
  8307. {191433,3, nil, nil, nil, {191433,30, 0}, }, --Взрывная ловушка
  8308. {186387,3, nil, nil, {186387,30, 0}, nil, }, --Взрывной выстрел
  8309. {147362,5, nil, {147362,24, 0}, {147362,24, 0}, {187707,15, 0}, }, --Встречный выстрел
  8310. {190925,3, nil, nil, nil, {190925,20, 0}, }, --Гарпун
  8311. {194855,3, nil, nil, nil, {194855,30, 8}, }, --Граната пламени дракона
  8312. {207068,3, nil, {207068,60, 0}, nil, nil, }, --Гром титанов
  8313. {186257,4, {186257,180, 12}, nil, nil, nil, }, --Дух гепарда
  8314. {193530,3, nil, {193530,120, 10}, nil, nil, }, --Дух дикой природы
  8315. {186289,3, nil, nil, nil, {186289,120, 10}, }, --Дух орла
  8316. {186265,4, {186265,180, 8}, nil, nil, nil, }, --Дух черепахи
  8317. {194291,4, nil, nil, {194291,120, 0}, nil, }, --Живость
  8318. {109304,4, nil, {109304,120, 0}, nil, {109304,120, 0}, }, --Живость
  8319. {187650,3, nil, nil, nil, {187650,30, 0}, }, --Замораживающая ловушка
  8320. {19574, 3, nil, {19574, 90, 15}, nil, nil, }, --Звериный гнев
  8321. {201430,3, nil, {201430,180, 12}, nil, nil, }, --Звериный натиск
  8322. {199483,4, nil, nil, {199483,60, 60}, {199483,60, 60}, }, --Камуфляж
  8323. {162488,3, nil, nil, nil, {162488,60, 0}, }, --Капкан
  8324. {5116, 3, nil, {5116, 5, 6}, {5116, 5, 6}, nil, }, --Контузящий выстрел
  8325. {136, 3, {136, 10, 0}, nil, nil, nil, }, --Лечение питомца
  8326. {209997,3, {209997,30, 0}, nil, nil, nil, }, --Ложная смерть
  8327. {193526,3, nil, nil, {193526,180, 15}, nil, }, --Меткий выстрел
  8328. {1543, 3, {1543, 20, 0}, nil, nil, nil, }, --Осветительная ракета
  8329. {781, 4, {781, 20, 0}, nil, nil, nil, }, --Отрыв
  8330. {201078,3, nil, nil, nil, {201078,90, 0}, }, --Охотник на змей
  8331. {34477, 3, nil, {34477, 30, 8}, {34477, 30, 8}, nil, }, --Перенаправление
  8332. {194407,3, nil, nil, nil, {194407,60, 0}, }, --Плюющаяся кобра
  8333. {5384, 4, {5384, 30, 0}, nil, nil, nil, }, --Притвориться мертвым
  8334. {210000,3, {210000,30, 0}, nil, nil, nil, }, --Пробуждение
  8335. {198670,3, nil, nil, {198670,30, 0}, nil, }, --Пронзающий выстрел
  8336. {212431,3, nil, nil, {212431,30, 0}, nil, }, --Разрывной выстрел
  8337. {185855,3, nil, nil, nil, {185855,10, 0}, }, --Режущий удар
  8338. {109248,3, nil, {109248,45, 0}, {109248,45, 0}, nil, }, --Связующий выстрел
  8339. {187698,3, nil, nil, nil, {187698,30, 0}, }, --Смоляная ловушка
  8340. {206505,3, nil, nil, nil, {206505,60, 0}, }, --Стая воронов
  8341. {131894,3, nil, {131894,60, 15}, {131894,60, 15}, nil, }, --Стая воронов
  8342. {217200,3, nil, {217200,15, 0}, nil, nil, }, --Ужасное бешенство
  8343. {19386, 3, nil, {19386, 45, 0}, {19386, 45, 0}, nil, }, --Укус виверны
  8344. {19577, 3, nil, {19577, 60, 0}, nil, nil, }, --Устрашение
  8345. {194277,3, nil, nil, nil, {194277,15, 0}, }, --Шипы
  8346. {120360,3, nil, {120360,20, 0}, {120360,20, 0}, nil, }, --Шквал
  8347. {204147,3, nil, nil, {204147,20, 0}, nil, }, --Шквальный ветер
  8348. {203415,3, nil, nil, nil, {203415,45, 0}, }, --Ярость орла
  8349. },
  8350. ["ROGUE"] = {
  8351. {195457,4, nil, nil, {195457,30, 0}, nil, }, --Абордажный крюк
  8352. {185311,4, {185311,30, 6}, nil, nil, nil, }, --Алый фиал
  8353. {79140, 3, nil, {79140, 120, 20}, nil, nil, }, --Вендетта
  8354. {13750, 3, nil, nil, {13750, 180, 15}, nil, }, --Выброс адреналина
  8355. {1856, 3, {1856, 120, 3}, nil, nil, nil, }, --Исчезновение
  8356. {57934, 3, {57934, 30, 6}, nil, nil, nil, }, --Маленькие хитрости
  8357. {137619,3, {137619,60, 0}, nil, nil, nil, }, --Метка смерти
  8358. {185767,3, nil, nil, {185767,60, 0}, nil, }, --Обстрел ядрами
  8359. {2094, 3, nil, nil, {2094, 120, 0}, {2094, 120, 0}, }, --Ослепление
  8360. {1725, 3, {1725, 30, 10}, nil, nil, nil, }, --Отвлечение
  8361. {199754,3, nil, nil, {199754,120, 10}, nil, }, --Отражение ударов
  8362. {199743,3, nil, nil, {199743,20, 0}, nil, }, --Парламентер
  8363. {1766, 5, {1766, 15, 0}, nil, nil, nil, }, --Пинок
  8364. {31224, 4, {31224, 90, 5}, nil, nil, nil, }, --Плащ Теней
  8365. {192759,3, nil, {192759,45, 0}, nil, nil, }, --Погибель королей
  8366. {199740,3, nil, nil, {199740,1800, 0}, nil, }, --Подкуп
  8367. {202665,3, nil, nil, {202665,90, 0}, nil, }, --Проклятие Клинков Ужаса
  8368. {200806,3, nil, {200806,45, 0}, nil, nil, }, --Пускание крови
  8369. {212283,3, nil, nil, nil, {212283,10, 35}, }, --Символы смерти
  8370. {152150,3, {152150,20, 0}, nil, nil, nil, }, --Смерть с небес
  8371. {2983, 4, {2983, 60, 8}, nil, nil, nil, }, --Спринт
  8372. {185313,3, nil, nil, nil, {185313,60, 3}, }, --Танец теней
  8373. {121471,3, nil, nil, nil, {121471,180, 15}, }, --Теневые клинки
  8374. {408, 3, nil, {408, 20, 0}, nil, {408, 20, 0}, }, --Удар по почкам
  8375. {209782,3, nil, nil, nil, {209782,60, 0}, }, --Укус Кровавой Пасти
  8376. {5277, 4, nil, {5277, 120, 10}, nil, {5277, 120, 10}, }, --Ускользание
  8377. {51690, 3, nil, nil, {51690, 120, 3}, nil, }, --Череда убийств
  8378. {36554, 3, nil, {36554, 30, 2}, nil, {36554, 30, 2}, }, --Шаг сковзь тень
  8379. },
  8380. ["PRIEST"] = {
  8381. {15487, 5, nil, nil, nil, {15487, 45, 0}, }, --Безмолвие
  8382. {110744,3, nil, {110744,15, 0}, {110744,15, 0}, nil, }, --Божественная звезда
  8383. {121536,3, {121536,20, 0}, nil, nil, nil, }, --Божественное перышко
  8384. {64843, 1, nil, nil, {64843, 180, 8}, nil, }, --Божественный гимн
  8385. {47536, 3, nil, {47536, 120, 8}, nil, nil, }, --Вознесение
  8386. {73325, 2, nil, {73325, 90, 0}, {73325, 90, 0}, nil, }, --Духовное рвение
  8387. {228260,3, nil, nil, nil, {228260,3, 0}, }, --Извержение Бездны
  8388. {34433, 3, nil, {34433, 180, 12}, nil, {34433, 180, 12}, }, --Исчадие Тьмы
  8389. {204883,3, nil, nil, {204883,15, 0}, nil, }, --Круг исцеления
  8390. {32375, 1, {32375, 15, 0}, nil, nil, nil, }, --Массовое рассеивание
  8391. {8122, 3, nil, {8122, 60, 0}, nil, {8122, 60, 0}, }, --Ментальный крик
  8392. {19236, 4, nil, nil, {19236, 90, 10}, nil, }, --Молитва отчаяния
  8393. {205369,3, nil, nil, nil, {205369,30, 2}, }, --Мыслебомба
  8394. {47788, 2, nil, nil, {47788, 240, 10}, nil, }, --Оберегающий дух
  8395. {15286, 1, nil, nil, nil, {15286, 180, 15}, }, --Объятия вампира
  8396. {527, 5, nil, {527, 8, 0}, {527, 8, 0}, {213634,8, 0}, }, --Очищение
  8397. {33206, 2, nil, {33206, 240, 8}, nil, nil, }, --Подавление боли
  8398. {123040,3, nil, {123040,60, 12}, nil, nil, }, --Подчиняющий разум
  8399. {200174,3, nil, nil, nil, {200174,60, 15}, }, --Подчиняющий разум
  8400. {193223,3, nil, nil, nil, {193223,600, 0}, }, --Покорение безумию
  8401. {205065,3, nil, nil, nil, {205065,60, 0}, }, --Поток Бездны
  8402. {10060, 3, nil, {10060, 120, 20}, nil, {10060, 120, 20}, }, --Придание сил
  8403. {200183,3, nil, nil, {200183,180, 30}, nil, }, --Прославление
  8404. {64901, 1, nil, nil, {64901, 360, 10}, nil, }, --Символ надежды
  8405. {120517,3, nil, {120517,40, 0}, {120517,40, 0}, nil, }, --Сияние
  8406. {204263,3, nil, {204263,60, 3}, {204263,60, 3}, nil, }, --Сияющая мощь
  8407. {47585, 4, nil, nil, nil, {47585, 120, 6}, }, --Слияние с Тьмой
  8408. {2050, 3, nil, nil, {2050, 60, 0}, nil, }, --Слово Света: Безмятежность
  8409. {88625, 3, nil, nil, {88625, 60, 0}, nil, }, --Слово Света: Наказание
  8410. {34861, 3, nil, nil, {34861, 60, 0}, nil, }, --Слово Света: Освящение
  8411. {62618, 1, nil, {62618, 180, 10}, nil, nil, }, --Слово силы: Барьер
  8412. {129250,3, nil, {129250,12, 0}, nil, nil, }, --Слово силы: Утешение
  8413. {17, 3, nil, {17, 7, 0}, nil, {17, 7, 0}, }, --Слово силы: Щит
  8414. {214121,3, nil, nil, {214121,10, 4}, nil, }, --Тело и разум
  8415. {205385,3, nil, nil, nil, {205385,30, 0}, }, --Темное сокрушение
  8416. {586, 4, {586, 30, 10}, nil, nil, nil, }, --Уход в тень
  8417. {207946,3, nil, {207946,90, 0}, nil, nil, }, --Ярость Света
  8418. },
  8419. ["DEATHKNIGHT"] = {
  8420. {48707, 4, {48707, 60, 5}, nil, nil, nil, }, --Антимагический панцирь
  8421. {220143,3, nil, nil, nil, {220143,90, 0}, }, --Апокалипсис
  8422. {221562,3, nil, {221562,45, 5}, nil, nil, }, --Асфиксия
  8423. {108194,3, nil, nil, nil, {108194,45, 5}, }, --Асфиксия
  8424. {196770,3, nil, nil, {196770,20, 8}, nil, }, --Беспощадность зимы
  8425. {212552,4, {212552,45, 3}, nil, nil, nil, }, --Блуждающий дух
  8426. {194844,4, nil, {194844,60, 0}, nil, nil, }, --Буря костей
  8427. {42650, 3, nil, nil, nil, {42650, 600, 40}, }, --Войско мертвых
  8428. {46584, 3, nil, nil, nil, {46584, 60, 0}, }, --Воскрешение мертвых
  8429. {61999, 2, {61999, 600, 0}, nil, nil, nil, }, --Воскрешение союзника
  8430. {152279,3, nil, nil, {152279,120, 0}, nil, }, --Дыхание Синдрагосы
  8431. {130736,3, nil, nil, nil, {130736,45, 5}, }, --Жнец душ
  8432. {47528, 5, {47528, 15, 0}, nil, nil, nil, }, --Заморозка разума
  8433. {194918,3, nil, nil, nil, {194918,60, 0}, }, --Зачумленное руническое оружие
  8434. {194679,4, nil, {194679,25, 3}, nil, nil, }, --Захват рун
  8435. {57330, 3, nil, nil, {57330, 30, 0}, nil, }, --Зимний горн
  8436. {206977,3, nil, {206977,120, 0}, nil, nil, }, --Кровавое зеркало
  8437. {221699,4, nil, {221699,60, 0}, nil, nil, }, --Кровоотвод
  8438. {206931,4, nil, {206931,30, 0}, nil, nil, }, --Кровопийца
  8439. {55233, 4, nil, {55233, 90, 10}, nil, nil, }, --Кровь вампира
  8440. {51271, 3, nil, nil, {51271, 60, 20}, nil, }, --Ледяной столп
  8441. {219809,4, nil, {219809,60, 0}, nil, nil, }, --Надгробный камень
  8442. {48792, 4, nil, nil, {48792, 180, 8}, {48792, 180, 8}, }, --Незыблемость льда
  8443. {152280,3, nil, nil, nil, {152280,30, 10}, }, --Осквернение
  8444. {207167,3, nil, nil, {207167,60, 0}, nil, }, --Ослепляющая наледь
  8445. {49206, 3, nil, nil, nil, {49206, 180, 40}, }, --Призыв горгульи
  8446. {43265, 3, nil, {43265, 15, 10}, nil, {43265, 30, 10}, }, --Смерть и разложение
  8447. {49028, 3, nil, {49028, 180, 8}, nil, nil, }, --Танцующее руническое оружие
  8448. {56222, 5, {56222, 8, 0}, nil, nil, nil, }, --Темная власть
  8449. {63560, 3, nil, nil, nil, {63560, 60, 20}, }, --Темное превращение
  8450. {207349,3, nil, nil, nil, {207349,180, 15}, }, --Темный судья
  8451. {207319,4, nil, nil, nil, {207319,60, 10}, }, --Трупный щит
  8452. {205223,4, nil, {205223,45, 0}, nil, nil, }, --Увядание
  8453. {207256,3, nil, nil, {207256,90, 8}, nil, }, --Уничтожение
  8454. {47568, 3, nil, nil, {46578, 180, 0}, nil, }, --Усиление рунического оружия
  8455. {108199,1, nil, {108199,180, 0}, nil, nil, }, --Хватка Кровожада
  8456. {49576, 3, nil, {49576, 15, 0}, {49576, 25, 0}, {49576, 25, 0}, }, --Хватка смерти
  8457. {190778,3, nil, nil, {190778,300, 0}, nil, }, --Ярость Синдрагосы
  8458. },
  8459. ["SHAMAN"] = {
  8460. {108271,4, {108271,90, 8}, nil, nil, nil, }, --Астральный сдвиг
  8461. {79206, 3, nil, nil, nil, {79206, 120, 15}, }, --Благосклонность предков
  8462. {204945,3, nil, nil, {204945,60, 0}, nil, }, --Ветра Рока
  8463. {73685, 3, nil, nil, nil, {73685, 15, 0}, }, --Высвободить чары жизни
  8464. {32182, 3, {32182, 300, 0}, nil, nil, nil, }, --Героизм
  8465. {51490, 3, nil, {51490, 45, 0}, nil, nil, }, --Гром и молния
  8466. {207778,3, nil, nil, nil, {207778,45, 0}, }, --Дар королевы
  8467. {51533, 3, nil, nil, {51533, 120, 15}, nil, }, --Дух дикого зверя
  8468. {2825, 3, {2825, 300, 40}, nil, nil, nil, }, --Жажда крови
  8469. {210714,3, nil, {210714,30, 0}, nil, nil, }, --Ледяная ярость
  8470. {215864,3, nil, nil, {215864,10, 0}, nil, }, --Ливень
  8471. {108281,3, nil, {108281,120, 10}, nil, {108281,120, 10}, }, --Наставления предков
  8472. {51886, 5, nil, {51886, 8, 0}, {51886, 8, 0}, {77130, 8, 0}, }, --Очищение духа
  8473. {114052,1, nil, nil, nil, {114052,180, 15}, }, --Перерождение
  8474. {114051,3, nil, nil, {114051,180, 15}, nil, }, --Перерождение
  8475. {114050,3, nil, {114050,180, 15}, nil, nil, }, --Перерождение
  8476. {201898,3, nil, nil, {201898,45, 20}, nil, }, --Песнь ветра
  8477. {16166, 3, nil, {16166, 120, 20}, nil, nil, }, --Покорение стихий
  8478. {192063,4, nil, {192063,15, 0}, nil, {192063,15, 0}, }, --Порыв ветра
  8479. {58875, 3, nil, nil, {58875, 60, 8}, nil, }, --Поступь духа
  8480. {57994, 5, {57994, 12, 0}, nil, nil, nil, }, --Пронизывающий ветер
  8481. {197214,3, nil, nil, {197214,40, 0}, nil, }, --Раскол
  8482. {20608, 2, {21169, 1800, 0}, nil, nil, nil, }, --Реинкарнация
  8483. {197995,3, nil, nil, nil, {197995,20, 0}, }, --Родник
  8484. {196884,3, nil, nil, {196884,30, 0}, nil, }, --Свирепый выпад
  8485. {51514, 3, {51514, 30, 0}, nil, nil, nil, }, --Сглаз
  8486. {192077,1, {192077,120, 15}, nil, nil, nil, }, --Тотем ветряного порыва
  8487. {196932,3, {196932,30, 10}, nil, nil, nil, }, --Тотем вуду
  8488. {192058,3, {192058,45, 2}, nil, nil, nil, }, --Тотем выброса тока
  8489. {98008, 1, nil, nil, nil, {98008, 180, 6}, }, --Тотем духовной связи
  8490. {192222,3, nil, {192222,60, 15}, nil, nil, }, --Тотем жидкой магмы
  8491. {207399,1, nil, nil, nil, {207399,300, 30}, }, --Тотем защиты Предков
  8492. {198838,4, nil, nil, nil, {198838,60, 15}, }, --Тотем земного щита
  8493. {5394, 3, nil, nil, nil, {5394, 30, 15}, }, --Тотем исцеляющего потока
  8494. {157153,3, nil, nil, nil, {157153,30, 15}, }, --Тотем разразившегося ливня
  8495. {51485, 3, {51485, 30, 20}, nil, nil, nil, }, --Тотем хватки земли
  8496. {108280,1, nil, nil, nil, {108280,180, 10}, }, --Тотем целительного прилива
  8497. {205495,3, nil, {205495,60, 0}, nil, nil, }, --Хранитель бурь
  8498. {73920, 3, nil, nil, nil, {73920, 10, 0}, }, --Целительный ливень
  8499. {192249,3, nil, {192249,300, 60}, nil, nil, }, --Элементаль бури
  8500. {198103,3, nil, {198103,120, 15}, nil, nil, }, --Элементаль земли
  8501. {198067,3, nil, {198067,300, 60}, nil, nil, }, --Элементаль огня
  8502. },
  8503. ["MAGE"] = {
  8504. {2139, 5, {2139, 24, 0}, nil, nil, nil, }, --Антимагия
  8505. {205029,3, nil, nil, {205029,45, 0}, nil, }, --Ба-бах!
  8506. {153595,3, nil, nil, nil, {153595,30, 0}, }, --Буря комет
  8507. {110959,4, nil, {110959,120, 20}, nil, nil, }, --Великая невидимость
  8508. {205025,3, nil, {205025,60, 0}, nil, nil, }, --Величие разума
  8509. {157981,3, nil, nil, {157981,25, 0}, nil, }, --Взрывная волна
  8510. {190319,3, nil, nil, {190319,120, 10}, nil, }, --Возгорание
  8511. {205022,3, nil, {205022,10, 0}, nil, nil, }, --Волшебный фамилиар
  8512. {31661, 3, nil, nil, {31661, 20, 0}, nil, }, --Дыхание дракона
  8513. {55342, 3, {55342, 120, 40}, nil, nil, nil, }, --Зеркальное изображение
  8514. {224968,3, nil, {224968,60, 0}, nil, nil, }, --Знак Алунета
  8515. {80353, 3, {80353, 300, 40}, nil, nil, nil, }, --Искажение времени
  8516. {122, 3, {122, 30, 0}, nil, nil, nil, }, --Кольцо льда
  8517. {113724,3, {113724,45, 10}, nil, nil, nil, }, --Кольцо мороза
  8518. {157997,3, nil, nil, nil, {157997,25, 0}, }, --Кольцо обледенения
  8519. {120, 3, nil, nil, nil, {120, 12, 0}, }, --Конус холода
  8520. {45438, 4, {45438, 300, 10}, nil, nil, nil, }, --Ледяная глыба
  8521. {11426, 4, {11426, 25, 60}, nil, nil, nil, }, --Ледяная преграда
  8522. {84714, 3, nil, nil, nil, {84714, 60, 0}, }, --Ледяной шар
  8523. {212653,4, nil, {212653,15, 0}, nil, nil, }, --Мерцание
  8524. {153561,3, nil, nil, {153561,45, 3}, nil, }, --Метеор
  8525. {205030,3, nil, nil, nil, {205030,30, 0}, }, --Морозное касание
  8526. {205021,3, nil, nil, nil, {205021,60, 10}, }, --Морозный луч
  8527. {12042, 3, nil, {12042, 90, 10}, nil, nil, }, --Мощь тайной магии
  8528. {205032,3, nil, {205032,40, 0}, nil, nil, }, --Наполнение силой
  8529. {66, 4, nil, nil, {66, 300, 0}, {66, 300, 0}, }, --Невидимость
  8530. {108839,3, {108839,20, 15}, nil, nil, nil, }, --Плавучая льдина
  8531. {214634,3, nil, nil, nil, {214634,45, 0}, }, --Полярная стрела
  8532. {31687, 3, nil, nil, nil, {31687, 60, 0}, }, --Призыв элементаля воды
  8533. {12051, 3, nil, {12051, 90, 6}, nil, nil, }, --Прилив сил
  8534. {116011,3, {116011,40, 0}, nil, nil, nil, }, --Руна мощи
  8535. {157980,3, nil, {157980,25, 0}, nil, nil, }, --Сверхновая
  8536. {135029,3, nil, nil, nil, {135029,25, 0}, }, --Сильная струя воды
  8537. {1953, 4, {1953, 15, 0}, nil, nil, nil, }, --Скачок
  8538. {195676,4, nil, {195676,30, 0}, nil, nil, }, --Смещение
  8539. {12472, 3, nil, nil, nil, {12472, 180, 20}, }, --Стылая кровь
  8540. {153626,3, nil, {153626,20, 0}, nil, nil, }, --Чародейский шар
  8541. },
  8542. ["WARLOCK"] = {
  8543. {5484, 3, nil, {5484, 40, 0}, nil, nil, }, --Вой ужаса
  8544. {111771,3, {111771,10, 0}, nil, nil, nil, }, --Демонические врата
  8545. {48018, 4, {48020, 30, 0}, nil, nil, nil, }, --Демонический круг
  8546. {196098,3, {196098,120, 10}, nil, nil, nil, }, --Жатва душ
  8547. {20707, 2, {20707, 600, 0}, nil, nil, nil, }, --Камень души
  8548. {152108,3, nil, nil, nil, {152108,45, 0}, }, --Катаклизм
  8549. {6789, 4, {6789, 45, 0}, nil, nil, nil, }, --Лик тлена
  8550. {30283, 3, nil, nil, {30283, 30, 4}, {30283, 30, 4}, }, --Неистовство Тьмы
  8551. {205181,3, nil, nil, {205181,14, 0}, nil, }, --Пламя тьмы
  8552. {211714,3, nil, nil, {211714,45, 0}, nil, }, --Поглощение Тал'киэля
  8553. {205179,3, nil, {205179,60, 15}, nil, nil, }, --Призрачная сингулярность
  8554. {104316,3, nil, nil, {104316,15, 12}, nil, }, --Призыв зловещих охотников
  8555. {1122, 3, {1122, 180, 25}, nil, nil, nil, }, --Призыв инфернала
  8556. {205180,3, nil, nil, {205180,24, 12}, nil, }, --Призыв созерцателя Тьмы
  8557. {18540, 3, {18540, 180, 25}, nil, nil, nil, }, --Призыв стража ужаса
  8558. {698, 3, {698, 120, 0}, nil, nil, nil, }, --Ритуал призыва
  8559. {29893, 3, {29893, 120, 0}, nil, nil, nil, }, --Создание источника душ
  8560. {104773,4, {104773,180, 8}, nil, nil, {104773,90, 8}, }, --Твердая решимость
  8561. {108416,4, {108416,60, 20}, nil, nil, nil, }, --Темный пакт
  8562. {80240, 3, nil, nil, nil, {80240, 20, 8}, }, --Хаос
  8563. },
  8564. ["MONK"] = {
  8565. {152173,3, nil, nil, {152173,90, 8}, nil, }, --Безмятежность
  8566. {115288,3, nil, nil, {115288,60, 0}, nil, }, --Будоражащий отвар
  8567. {137639,3, nil, nil, {137639,90, 15}, nil, }, --Буря, земля и огонь
  8568. {214326,3, nil, {214326,75, 0}, nil, nil, }, --Взрывной бочонок
  8569. {115098,3, nil, {115098,15, 0}, {115098,15, 0}, nil, }, --Волна ци
  8570. {115310,1, nil, nil, nil, {115310,180, 0}, }, --Восстановление сил
  8571. {123986,3, {123986,30, 0}, nil, nil, nil, }, --Выброс ци
  8572. {115546,5, {115546,8, 0}, nil, nil, nil, }, --Вызов
  8573. {116680,3, nil, nil, nil, {116680,30, 0}, }, --Громовой чай
  8574. {115450,5, nil, {218164,8, 0}, {218164,8, 0}, {115450,8, 0}, }, --Детоксикация
  8575. {124081,3, nil, nil, nil, {124081,15, 0}, }, --Дзен-импульс
  8576. {115176,4, nil, {115176,300, 0}, nil, nil, }, --Дзен-медитация
  8577. {122470,4, nil, nil, {122470,90, 10}, nil, }, --Закон кармы
  8578. {116849,2, nil, nil, nil, {116849,180, 12}, }, --Исцеляющий кокон
  8579. {116844,1, {116844,45, 8}, nil, nil, nil, }, --Круг мира
  8580. {119381,1, {119381,45, 5}, nil, nil, nil, }, --Круговой удар ногой
  8581. {109132,4, {109132,20, 0}, nil, nil, nil, }, --Кувырок
  8582. {197908,3, nil, nil, nil, {197908,90, 10}, }, --Маначай
  8583. {113656,3, nil, nil, {113656,24, 4}, nil, }, --Неистовые кулаки
  8584. {115308,4, nil, {115308,21, 0}, nil, nil, }, --Отвар железной шкуры
  8585. {115399,3, nil, {115399,90, 0}, nil, nil, }, --Отвар Черного Быка
  8586. {119582,3, nil, {119582,21, 0}, nil, nil, }, --Очищающий отвар
  8587. {115078,3, {115078,15, 0}, nil, nil, nil, }, --Паралич
  8588. {198898,3, nil, nil, nil, {198898,30, 0}, }, --Песнь Чи-Цзи
  8589. {132578,3, nil, {132578,180, 45}, nil, nil, }, --Призыв Нюцзао, Черного Быка
  8590. {123904,3, nil, nil, {123904,180, 45}, nil, }, --Призыв Сюэня, Белого Тигра
  8591. {198664,3, nil, nil, nil, {198664,180, 45}, }, --Призыв Чи-Цзи, Красного Журавля
  8592. {115313,3, nil, nil, nil, {115313,10, 0}, }, --Призыв статуи Нефритовой Змеи
  8593. {115315,3, nil, {115315,10, 0}, nil, nil, }, --Призыв статуи Черного Быка
  8594. {122783,4, {122783,120, 6}, nil, nil, nil, }, --Распыление магии
  8595. {116705,5, nil, {116705,15, 0}, {116705,15, 0}, nil, }, --Рука-копье
  8596. {115080,3, nil, nil, {115080,120, 8}, nil, }, --Смертельное касание
  8597. {122278,4, {122278,120, 45}, nil, nil, nil, }, --Смягчение удара
  8598. {197945,3, nil, nil, nil, {197945,20, 0}, }, --Странник туманов
  8599. {116841,3, {116841,30, 6}, nil, nil, nil, }, --Тигриное рвение
  8600. {101643,4, {101643,10, 0}, nil, nil, nil, }, --Трансцендентность
  8601. {119996,4, {119996,25, 0}, nil, nil, nil, }, --Трансцендентность: перенос
  8602. {205320,3, nil, nil, {205320,40, 0}, nil, }, --Удар Владыки Ветра
  8603. {101545,3, nil, nil, {101545,25, 0}, nil, }, --Удар летящего змея
  8604. {115203,4, nil, {115203,420, 15}, nil, nil, }, --Укрепляющий отвар
  8605. {122281,4, {122281,30, 0}, nil, nil, nil, }, --Целебный элексир
  8606. {115008,4, {115008,20, 10}, nil, nil, nil, }, --Ци-полет
  8607. },
  8608. ["DRUID"] = {
  8609. {202359,3, nil, {202359,80, 0}, nil, nil, nil, }, --Астральное единение
  8610. {102280,4, {102280,30, 4}, nil, nil, nil, nil, }, --Астральный скачок
  8611. {106951,3, nil, nil, {106951,180, 15}, nil, nil, }, --Берсерк
  8612. {210722,3, nil, nil, {210722,75, 0}, nil, nil, }, --Бешенство Пеплошкурой
  8613. {202360,3, nil, {202360,15, 0}, nil, nil, nil, }, --Благословение Древних
  8614. {18562, 3, nil, nil, nil, nil, {18562, 30, 0}, }, --Быстрое восстановление
  8615. {102793,1, nil, nil, nil, nil, {102793,60, 10}, }, --Вихрь Урсола
  8616. {20484, 2, {20484, 600, 0}, nil, nil, nil, nil, }, --Возрождение
  8617. {202425,3, nil, {202425,45, 0}, nil, nil, nil, }, --Воин Элуны
  8618. {33891, 3, nil, nil, nil, nil, {33891, 180, 30}, }, --Воплощение: Древо Жизни
  8619. {102560,3, nil, {102560,180, 30}, nil, nil, nil, }, --Воплощение: Избранный Элуны
  8620. {102543,3, nil, nil, {102543,180, 30}, nil, nil, }, --Воплощение: Король джунглей
  8621. {102558,3, nil, nil, nil, {102558,180, 30}, nil, }, --Воплощение: Страж Урсока
  8622. {22812, 4, nil, {22812, 60, 12}, nil, {22812, 90, 12}, {22812, 60, 12}, }, --Дубовая кожа
  8623. {102342,2, nil, nil, nil, nil, {102342,90, 12}, }, --Железная кора
  8624. {61336, 4, nil, nil, {61336, 120, 6}, {61336, 240, 6}, nil, }, --Инстинкты выживания
  8625. {155835,3, nil, nil, nil, {155835,40, 8}, nil, }, --Колючий мех
  8626. {5215, 3, {5215, 10, 0}, nil, nil, nil, nil, }, --Крадущийся зверь
  8627. {106839,5, nil, nil, {106839,15, 0}, {106839,15, 0}, nil, }, --Лобовая атака
  8628. {204066,3, nil, nil, nil, {204066,90, 8}, nil, }, --Лунный луч
  8629. {102359,1, {102359,30, 20}, nil, nil, nil, nil, }, --Массовое оплетение
  8630. {5211, 3, {5211, 50, 5}, nil, nil, nil, nil, }, --Мощное оглушение
  8631. {202060,3, nil, nil, {202060,45, 0}, nil, nil, }, --Наставление Элуны
  8632. {22842, 4, nil, nil, nil, {22842, 24, 3}, nil, }, --Неистовствое восстановление
  8633. {108238,4, {108238,120, 0}, nil, nil, nil, nil, }, --Обновление
  8634. {29166, 2, nil, {29166, 180, 10}, nil, nil, {29166, 180, 10}, }, --Озарение
  8635. {194223,3, nil, {194223,180, 15}, nil, nil, nil, }, --Парад планет
  8636. {99, 3, nil, nil, nil, {99, 30, 0}, nil, }, --Парализующий рык
  8637. {1850, 4, {1850, 180, 15}, nil, nil, nil, nil, }, --Порыв
  8638. {197721,3, nil, nil, nil, nil, {197721,60, 6}, }, --Расцвет
  8639. {6795, 5, {6795, 8, 0}, nil, nil, nil, nil, }, --Рык
  8640. {205636,3, nil, {205636,60, 10}, nil, nil, nil, }, --Сила Природы
  8641. {2782, 5, {2782, 8, 0}, nil, nil, nil, {88423, 8, 0}, }, --Снятие порчи
  8642. {740, 1, nil, nil, nil, nil, {740, 180, 8}, }, --Спокойствие
  8643. {78675, 5, nil, {78675, 60, 8}, nil, nil, nil, }, --Столп солнечного света
  8644. {102401,3, {102401,15, 0}, nil, nil, nil, nil, }, --Стремительный рывок
  8645. {208253,3, nil, nil, nil, nil, {208253,90, 10}, }, --Сущность Г'ханира
  8646. {132469,3, {132469,30, 6}, nil, nil, nil, nil, }, --Тайфун
  8647. {5217, 3, nil, nil, {5217, 30, 8}, nil, nil, }, --Тигриное неистовство
  8648. {106898,1, nil, nil, {77764, 120, 8}, {77761, 120, 8}, nil, }, --Тревожный рев
  8649. {102351,3, nil, nil, nil, nil, {102351,30, 0}, }, --Щит Кенария
  8650. {200851,4, nil, nil, nil, {200851,90, 10}, nil, }, --Ярость Спящего
  8651. {202770,3, nil, {202770,90, 0}, nil, nil, nil, }, --Ярость Элуны
  8652. },
  8653. ["DEMONHUNTER"] = {
  8654. {203720,4, nil, nil, {203720,15, 6}, }, --Демоническаие шипы
  8655. {178740,3, nil, nil, {178740,15, 6}, }, --Жар преисподней
  8656. {206491,3, nil, {206491,120, 60}, nil, }, --Заклятый враг
  8657. {198589,3, nil, {198589,60, 10}, nil, }, --Затуманивание
  8658. {211881,3, {211881,35, 0}, nil, nil, }, --Извержение Скверны
  8659. {189110,4, nil, nil, {189110,20, 0}, }, --Инфернальный удар
  8660. {198793,4, nil, {198793,25, 3}, nil, }, --Коварное отступление
  8661. {179057,1, {179057,60, 5}, nil, nil, }, --Кольцо Хаоса
  8662. {187827,3, nil, nil, {187827,180, 15}, }, --Метаморфоза
  8663. {191427,3, nil, {191427,300, 30}, nil, }, --Метаморфоза
  8664. {196718,1, nil, {196718,180, 8}, nil, }, --Мрак
  8665. {185245,5, nil, nil, {185245,8, 0}, }, --Мучение
  8666. {204021,3, nil, nil, {204021,60, 8}, }, --Огненное клеймо
  8667. {212084,3, nil, nil, {212084,60, 0}, }, --Опустошение Скверны
  8668. {202137,3, nil, nil, {202137,60, 8}, }, --Печать немоты
  8669. {204596,3, nil, nil, {204596,30, 8}, }, --Печать огня
  8670. {207684,3, nil, nil, {207684,60, 2}, }, --Печать страдания
  8671. {202138,3, nil, nil, {202138,60, 2}, }, --Печать цепей
  8672. {217832,3, {217832,10, 0}, nil, nil, }, --Пленение
  8673. {183752,5, {183752,15, 0}, nil, nil, }, --Поглощение магии
  8674. {188501,3, {188501,30, 10}, nil, nil, }, --Призрачное зрение
  8675. {227225,4, nil, nil, {227225,20, 8}, }, --Призрачный барьер
  8676. {198013,3, nil, {198013,45, 0}, nil, }, --Пронзающий взгляд
  8677. {196555,4, nil, {196555,90, 5}, nil, }, --Путь Пустоты
  8678. {207407,3, nil, nil, {207407,40, 0}, }, --Разрубатель душ
  8679. {195072,4, nil, {195072,10, 0}, nil, }, --Рывок Скверны
  8680. {207810,2, nil, nil, {207810,120, 15}, }, --Узы Пустоты
  8681. {218256,4, nil, nil, {218256,20, 6}, }, --Усиление оберегов
  8682. {201467,3, nil, {201467,60, 0}, nil, }, --Ярость иллидари
  8683. },
  8684.  
  8685. ["PET"] = {
  8686.  
  8687. },
  8688. ["RACIAL"] = {
  8689. {68992, 3, {68992, 120, 10}, }, --Worgen
  8690. {20589, 3, {20589, 60, 0}, }, --Gnome
  8691. {20594, 3, {20594, 120, 8}, }, --Dwarf
  8692. {121093,3, {121093,180, 5}, }, --Draenei
  8693. {58984, 3, {58984, 120, 0}, }, --NightElf
  8694. {59752, 3, {59752, 120, 0}, }, --Human
  8695. {69041, 3, {69041, 90, 0}, }, --Goblin
  8696. {69070, 3, {69070, 90, 0}, }, --Goblin
  8697. {7744, 3, {7744, 120, 0}, }, --Undead
  8698. {20577, 3, {20577, 120, 10}, }, --Undead
  8699. {20572, 3, {20572, 120, 15}, }, --Orc
  8700. {20549, 3, {20549, 90, 0}, }, --Tauren
  8701. {26297, 3, {26297, 180, 10}, }, --Troll
  8702. {28730, 3, {28730, 90, 0}, }, --BloodElf
  8703. {107079,3, {107079,120, 4}, }, --Pandaren
  8704. },
  8705. ["ITEMS"] = {
  8706. {67826, 3, {67826, 3600, 0}, }, --Jeevs
  8707. --{177592,3, {177592,120, 0}, }, --Candle
  8708. --{176873,3, {176873,120, 20}, }, --Tank BRF
  8709. --{176875,3, {176875,120, 20}, }, --Shard of nothing
  8710. --{177597,3, {177597,120, 20}, }, --Coin
  8711. --{177594,3, {177594,120, 20}, }, --Couplend
  8712. --{177189,3, {177189,90, 15}, }, --Kyanos
  8713. --{176460,3, {176460,120, 20}, }, --Kyb
  8714. --{183929,3, {183929,90, 15}, }, --Intuition's Gift
  8715. --{184270,3, {184270,60, 20}, }, --Mirror of the Blademaster
  8716. {201414,3, {201414,60, 0}, }, --Purified Shard of the Third Moon
  8717. {201371,3, {201371,60, 0}, }, --Judgment of the Naaru
  8718. {90633, 3, {90633, 600, 0}, }, --Guild Battle Standard
  8719. {90632, 3, {90632, 600, 0}, }, --Guild Battle Standard
  8720. {90631, 3, {90631, 600, 0}, }, --Guild Battle Standard
  8721. {215956,3, {215956,120, 30}, }, --Horn of Valor
  8722. {215648,3, {215648,90, 20}, }, --Moonlit Prism
  8723. {214962,3, {214962,120, 30}, }, --Faulty Countermeasure
  8724. {215936,3, {215936,120, 20}, }, --Orb of Torment
  8725. {215658,3, {215658,75, 15}, }, --Tirathon's Betrayal
  8726. {214980,3, {214980,120, 6}, }, --Windscar Whetstone
  8727. {215206,3, {215206,20, 0}, }, --Jewel of Insatiable Desire
  8728. {214584,3, {214584,60, 10}, }, --Shivermaw's Jawbone
  8729. {215467,3, {215467,60, 15}, }, --Obelisk of the Void
  8730. {214971,3, {214971,60, 8}, }, --Giant Ornamental Pearl
  8731. {214423,3, {214423,60, 15}, }, --Talisman of the Cragshaper
  8732. {214366,3, {214366,120, 30}, }, --Shard of Rokmora
  8733. {215670,3, {215670,120, 15}, }, --Figurehead of the Naglfar
  8734. {214203,3, {214203,60, 0}, }, --Gift of Radiance
  8735. {214198,3, {214198,90, 0}, }, --Mote of Sanctification
  8736. {221837,3, {221837,120, 10}, }, --Cocoon of Enforced Solitude
  8737. {221992,3, {221992,60, 0}, }, --Horn of Cenarius
  8738. {221695,3, {221695,120, 25}, }, --Unbridled Fury
  8739. {222046,3, {222046,120, 0}, }, --Wriggling Sinew
  8740. {221803,3, {221803,60, 10}, }, --Ravaged Seed Pod
  8741.  
  8742. },
  8743. }
  8744. ]]
  8745.  
  8746.  
  8747. -------------------------------------------
  8748. ----------------- -----------------
  8749. ----------------- Inspect -----------------
  8750. ----------------- -----------------
  8751. -------------------------------------------
  8752.  
  8753.  
  8754. local moduleInspect = ExRT.mod:New("Inspect",nil,true)
  8755.  
  8756. moduleInspect.db.inspectDB = {}
  8757. moduleInspect.db.inspectDBAch = {}
  8758. moduleInspect.db.inspectQuery = {}
  8759. moduleInspect.db.inspectItemsOnly = {}
  8760. moduleInspect.db.inspectID = nil
  8761. moduleInspect.db.inspectCleared = nil
  8762.  
  8763. module.db.inspectDB = moduleInspect.db.inspectDB --Quick fix for other modules
  8764.  
  8765. local inspectForce = false
  8766. function moduleInspect:Force() inspectForce = true end
  8767. function moduleInspect:Slowly() inspectForce = false end
  8768.  
  8769. moduleInspect.db.statsNames = {
  8770. haste = {L.cd2InspectHaste,L.cd2InspectHasteGem},
  8771. mastery = {L.cd2InspectMastery,L.cd2InspectMasteryGem},
  8772. crit = {L.cd2InspectCrit,L.cd2InspectCritGem,L.cd2InspectCritGemLegendary},
  8773. spirit = {L.cd2InspectSpirit,L.cd2InspectAll},
  8774.  
  8775. intellect = {L.cd2InspectInt,L.cd2InspectIntGem,L.cd2InspectAll},
  8776. agility = {L.cd2InspectAgi,L.cd2InspectAll},
  8777. strength = {L.cd2InspectStr,L.cd2InspectStrGem,L.cd2InspectAll},
  8778. spellpower = {L.cd2InspectSpd},
  8779.  
  8780. versatility = {L.cd2InspectVersatility,L.cd2InspectVersatilityGem},
  8781. leech = {L.cd2InspectLeech},
  8782. armor = {L.cd2InspectBonusArmor},
  8783. avoidance = {L.cd2InspectAvoidance},
  8784. speed = {L.cd2InspectSpeed},
  8785.  
  8786. }
  8787.  
  8788. moduleInspect.db.itemsSlotTable = {
  8789. 1, --INVSLOT_HEAD
  8790. 2, --INVSLOT_NECK
  8791. 3, --INVSLOT_SHOULDER
  8792. 15, --INVSLOT_BACK
  8793. 5, --INVSLOT_CHEST
  8794. 9, --INVSLOT_WRIST
  8795. 10, --INVSLOT_HAND
  8796. 6, --INVSLOT_WAIST
  8797. 7, --INVSLOT_LEGS
  8798. 8, --INVSLOT_FEET
  8799. 11, --INVSLOT_FINGER1
  8800. 12, --INVSLOT_FINGER2
  8801. 13, --INVSLOT_TRINKET1
  8802. 14, --INVSLOT_TRINKET2
  8803. 16, --INVSLOT_MAINHAND
  8804. 17, --INVSLOT_OFFHAND
  8805. }
  8806.  
  8807. local inspectScantip = CreateFrame("GameTooltip", "ExRTInspectScanningTooltip", nil, "GameTooltipTemplate")
  8808. inspectScantip:SetOwner(UIParent, "ANCHOR_NONE")
  8809.  
  8810. local inspectLastTime = 0
  8811. local function InspectNext()
  8812. if RaidInCombat() or (InspectFrame and InspectFrame:IsShown()) then
  8813. return
  8814. end
  8815. local nowTime = GetTime()
  8816. for name,timeAdded in pairs(moduleInspect.db.inspectQuery) do
  8817. if name and CanInspect(name) then--and CheckInteractDistance(name,1) then
  8818. NotifyInspect(name)
  8819.  
  8820. if (VExRT and VExRT.InspectViewer and VExRT.InspectViewer.EnableA4ivs) and not moduleInspect.db.inspectDBAch[name] then
  8821. if AchievementFrameComparison then
  8822. AchievementFrameComparison:UnregisterEvent("INSPECT_ACHIEVEMENT_READY")
  8823. ExRT.F.Timer(AchievementFrameComparison.RegisterEvent, inspectForce and 1 or 2.5, AchievementFrameComparison, "INSPECT_ACHIEVEMENT_READY")
  8824. end
  8825. ClearAchievementComparisonUnit()
  8826. SetAchievementComparisonUnit(name)
  8827. end
  8828.  
  8829. moduleInspect.db.inspectQuery[name] = nil
  8830. return
  8831. elseif (timeAdded + 300) < nowTime or not UnitName(name) then
  8832. moduleInspect.db.inspectQuery[name] = nil
  8833. end
  8834. end
  8835. end
  8836.  
  8837. local function InspectQueue()
  8838. local n = GetNumGroupMembers() or 0
  8839. local timeAdded = GetTime()
  8840. for j=1,n do
  8841. local name,_,subgroup,_,_,_,_,online = GetRaidRosterInfo(j)
  8842. if name and not moduleInspect.db.inspectDB[name] and online then
  8843. moduleInspect.db.inspectQuery[name] = timeAdded
  8844. end
  8845. end
  8846. end
  8847.  
  8848. function moduleInspect:AddToQueue(name)
  8849. if not moduleInspect.db.inspectQuery[name] then
  8850. moduleInspect.db.inspectQuery[name] = GetTime()
  8851. end
  8852. end
  8853.  
  8854.  
  8855. local function ExCD2_ClearTierSetsInfoFromUnit(name)
  8856. for tierUID,tierData in pairs(module.db.tierSetsSpells) do
  8857. if tierData[1] then
  8858. if type(tierData[1]) ~= "table" then
  8859. module.db.session_gGUIDs[name] = -tierData[1]
  8860. else
  8861. for i=1,#tierData[1] do
  8862. module.db.session_gGUIDs[name] = -tierData[1][i]
  8863. end
  8864. end
  8865. end
  8866. if tierData[2] then
  8867. if type(tierData[2]) ~= "table" then
  8868. module.db.session_gGUIDs[name] = -tierData[2]
  8869. else
  8870. for i=1,#tierData[2] do
  8871. module.db.session_gGUIDs[name] = -tierData[2][i]
  8872. end
  8873. end
  8874. end
  8875. end
  8876. for itemID,spellID in pairs(module.db.itemsToSpells) do
  8877. module.db.session_gGUIDs[name] = -spellID
  8878. end
  8879. end
  8880.  
  8881. local InspectItems = nil
  8882. do
  8883. local ITEM_LEVEL = (ITEM_LEVEL or "NO DATA FOR ITEM_LEVEL"):gsub("%%d","(%%d+)")
  8884. function InspectItems(name,inspectedName,inspectSavedID)
  8885. if moduleInspect.db.inspectCleared or moduleInspect.db.inspectID ~= inspectSavedID then
  8886. return
  8887. end
  8888. moduleInspect.db.inspectDB[name] = moduleInspect.db.inspectDB[name] or {}
  8889. local inspectData = moduleInspect.db.inspectDB[name]
  8890. inspectData['ilvl'] = 0
  8891. inspectData['tiersets'] = {}
  8892. inspectData['items'] = {}
  8893. inspectData['items_ilvl'] = {}
  8894. for stateName,stateData in pairs(moduleInspect.db.statsNames) do
  8895. inspectData[stateName] = 0
  8896. end
  8897. local ilvl_count = 0
  8898.  
  8899. ExCD2_ClearTierSetsInfoFromUnit(name) --------> ExCD2
  8900.  
  8901. local isArtifactEqipped = 0
  8902. local ArtifactIlvlSlot1,ArtifactIlvlSlot2 = 0,0
  8903. for i=1,#moduleInspect.db.itemsSlotTable do
  8904. local itemSlotID = moduleInspect.db.itemsSlotTable[i]
  8905. --local itemLink = GetInventoryItemLink(inspectedName, itemSlotID)
  8906. inspectScantip:SetInventoryItem(inspectedName, itemSlotID)
  8907.  
  8908. local _,itemLink = inspectScantip:GetItem()
  8909. if itemLink then
  8910. inspectData['items'][itemSlotID] = itemLink
  8911. --inspectScantip:SetInventoryItem(inspectedName, itemSlotID)
  8912. local itemID = itemLink:match("item:(%d+):")
  8913.  
  8914. if itemSlotID == 16 or itemSlotID == 17 then
  8915. local _,_,quality = GetItemInfo(itemLink)
  8916. if quality == 6 then
  8917. isArtifactEqipped = isArtifactEqipped + 1
  8918. end
  8919. end
  8920.  
  8921. for j=2, inspectScantip:NumLines() do
  8922. local tooltipLine = _G["ExRTInspectScanningTooltipTextLeft"..j]
  8923. local text = tooltipLine:GetText()
  8924. if text and text ~= "" then
  8925. for stateName,stateData in pairs(moduleInspect.db.statsNames) do
  8926. inspectData[stateName] = inspectData[stateName] or 0
  8927. local findText = text:gsub(",","")
  8928. for k=1,#stateData do
  8929. local findData = findText:match(stateData[k])
  8930. if findData then
  8931. local cR,cG,cB = tooltipLine:GetTextColor()
  8932. cR = abs(cR - 0.5)
  8933. cG = abs(cG - 0.5)
  8934. cB = abs(cB - 0.5)
  8935. if cR < 0.01 and cG < 0.01 and cB < 0.01 then
  8936. findData = 0
  8937. end
  8938. inspectData[stateName] = inspectData[stateName] + tonumber(findData)
  8939. end
  8940. end
  8941. end
  8942.  
  8943. local ilvl = text:match(ITEM_LEVEL)
  8944. if ilvl then
  8945. ilvl = tonumber(ilvl)
  8946. inspectData['ilvl'] = inspectData['ilvl'] + ilvl
  8947. ilvl_count = ilvl_count + 1
  8948.  
  8949. inspectData['items_ilvl'][itemSlotID] = ilvl
  8950.  
  8951. if isArtifactEqipped > 0 then
  8952. if itemSlotID == 16 then
  8953. ArtifactIlvlSlot1 = ilvl
  8954. else
  8955. ArtifactIlvlSlot2 = ilvl
  8956. end
  8957. end
  8958. end
  8959. end
  8960. end
  8961.  
  8962. itemID = tonumber(itemID or 0)
  8963.  
  8964. --------> ExCD2
  8965. local tierSetID = module.db.tierSetsList[itemID]
  8966. if tierSetID then
  8967. inspectData['tiersets'][tierSetID] = inspectData['tiersets'][tierSetID] and inspectData['tiersets'][tierSetID] + 1 or 1
  8968. end
  8969. local isTrinket = module.db.itemsToSpells[itemID]
  8970. if isTrinket then
  8971. module.db.session_gGUIDs[name] = isTrinket
  8972. end
  8973.  
  8974. if itemID == 124634 or itemID == 124636 or itemID == 124635 or itemID == 124637 or itemID == 124638 then
  8975. UpdateLegendaryRingState()
  8976. end
  8977. end
  8978.  
  8979. inspectScantip:ClearLines()
  8980. end
  8981. if isArtifactEqipped > 0 then
  8982. inspectData['ilvl'] = inspectData['ilvl'] - ArtifactIlvlSlot1 - ArtifactIlvlSlot2 + max(ArtifactIlvlSlot1,ArtifactIlvlSlot2) * 2
  8983. end
  8984. inspectData['ilvl'] = inspectData['ilvl'] / ((inspectData['items'][17] or isArtifactEqipped > 0) and 16 or 15)
  8985.  
  8986. --------> ExCD2
  8987. for tierUID,count in pairs(inspectData['tiersets']) do
  8988. local p2 = module.db.tierSetsSpells[tierUID][1]
  8989. local p4 = module.db.tierSetsSpells[tierUID][2]
  8990. if p2 and count >= 2 then
  8991. if type(p2) ~= "table" then
  8992. module.db.session_gGUIDs[name] = p2
  8993. else
  8994. for i=1,#p2 do
  8995. module.db.session_gGUIDs[name] = p2[i]
  8996. end
  8997. end
  8998. end
  8999. if p4 and count >= 4 then
  9000. if type(p4) ~= "table" then
  9001. module.db.session_gGUIDs[name] = p4
  9002. else
  9003. for i=1,#p4 do
  9004. module.db.session_gGUIDs[name] = p4[i]
  9005. end
  9006. end
  9007. end
  9008. end
  9009. UpdateAllData()
  9010. end
  9011. end
  9012.  
  9013. hooksecurefunc("NotifyInspect", function() moduleInspect.db.inspectID = GetTime() moduleInspect.db.inspectCleared = nil end)
  9014. hooksecurefunc("ClearInspectPlayer", function() moduleInspect.db.inspectCleared = true end)
  9015.  
  9016. hooksecurefunc("SetAchievementComparisonUnit", function() moduleInspect.db.achievementCleared = nil end)
  9017. hooksecurefunc("ClearAchievementComparisonUnit", function() moduleInspect.db.achievementCleared = true end)
  9018.  
  9019. do
  9020. local tmr = 0
  9021. local queueTimer = 0
  9022. function moduleInspect:timer(elapsed)
  9023. tmr = tmr + elapsed
  9024. if tmr > (inspectForce and 1.2 or 3.5) then
  9025. queueTimer = queueTimer + tmr
  9026. tmr = 0
  9027. if queueTimer > 60 then
  9028. queueTimer = 0
  9029. InspectQueue()
  9030. end
  9031. InspectNext()
  9032. end
  9033. end
  9034. function moduleInspect:ResetTimer() tmr = 0 end
  9035. function moduleInspect:AddonLoaded() tmr = -5 end
  9036. end
  9037.  
  9038. function moduleInspect:Enable()
  9039. moduleInspect:RegisterTimer()
  9040. moduleInspect:RegisterEvents('PLAYER_SPECIALIZATION_CHANGED','INSPECT_READY','UNIT_INVENTORY_CHANGED','PLAYER_EQUIPMENT_CHANGED','GROUP_ROSTER_UPDATE','ZONE_CHANGED_NEW_AREA','INSPECT_ACHIEVEMENT_READY','ENCOUNTER_START')
  9041. end
  9042. function moduleInspect:Disable()
  9043. moduleInspect:UnregisterTimer()
  9044. moduleInspect:UnregisterEvents('PLAYER_SPECIALIZATION_CHANGED','INSPECT_READY','UNIT_INVENTORY_CHANGED','PLAYER_EQUIPMENT_CHANGED','GROUP_ROSTER_UPDATE','ZONE_CHANGED_NEW_AREA','INSPECT_ACHIEVEMENT_READY','ENCOUNTER_START')
  9045. end
  9046.  
  9047. local Inspect_Artifact_ADDON_LOADED
  9048.  
  9049. function moduleInspect.main:ADDON_LOADED()
  9050. if ExRT.SDB.charName then
  9051. moduleInspect.db.inspectQuery[ExRT.SDB.charName] = GetTime()
  9052. end
  9053. moduleInspect:Enable()
  9054. moduleInspect:AddonLoaded()
  9055. moduleInspect:RegisterAddonMessage()
  9056.  
  9057. VExRT.InspectArtifact = VExRT.InspectArtifact or {}
  9058. VExRT.InspectArtifact.players = VExRT.InspectArtifact.players or {}
  9059.  
  9060. Inspect_Artifact_ADDON_LOADED()
  9061. end
  9062.  
  9063. function moduleInspect.main:PLAYER_SPECIALIZATION_CHANGED(arg)
  9064. if arg and UnitName(arg) then
  9065. local name = UnitCombatlogname(arg)
  9066. moduleInspect.db.inspectDB[name] = nil
  9067.  
  9068. --------> ExCD2
  9069. VExRT.ExCD2.gnGUIDs[name] = nil
  9070. local _,class = UnitClass(name)
  9071. if module.db.spell_talentsList[class] then
  9072. for specID,specTalents in pairs(module.db.spell_talentsList[class]) do
  9073. for i=1,18 do
  9074. if type(specTalents[i]) == "table" then
  9075. for j=1,#specTalents[i] do
  9076. module.db.session_gGUIDs[name] = -(specTalents[i][j] or 0)
  9077. end
  9078. else
  9079. module.db.session_gGUIDs[name] = -(specTalents[i] or 0)
  9080. end
  9081. end
  9082. end
  9083. end
  9084. if module.db.spell_glyphsList[class] then
  9085. for spellId,_ in pairs(module.db.spell_glyphsList[class]) do
  9086. module.db.session_gGUIDs[name] = -spellId
  9087. end
  9088. end
  9089.  
  9090. UpdateAllData()
  9091. --------> / ExCD2
  9092.  
  9093. moduleInspect.db.inspectQuery[name] = GetTime()
  9094. end
  9095. end
  9096.  
  9097. do
  9098. local scheludedQueue = nil
  9099. local function funcScheduledUpdate()
  9100. scheludedQueue = nil
  9101. InspectQueue()
  9102. end
  9103. function moduleInspect.main:GROUP_ROSTER_UPDATE()
  9104. if not scheludedQueue then
  9105. scheludedQueue = ScheduleTimer(funcScheduledUpdate,2)
  9106. end
  9107. end
  9108.  
  9109.  
  9110. local prevDiff = nil
  9111. function moduleInspect.main:ZONE_CHANGED_NEW_AREA()
  9112. local _,_,difficulty = GetInstanceInfo()
  9113. if difficulty == 8 or prevDiff == 8 then
  9114. local n = GetNumGroupMembers() or 0
  9115. if IsInRaid() then
  9116. n = min(n,5)
  9117. for j=1,n do
  9118. local name,_,subgroup = GetRaidRosterInfo(j)
  9119. if name and subgroup == 1 then
  9120. moduleInspect.db.inspectItemsOnly[name] = true
  9121. moduleInspect.db.inspectQuery[name] = GetTime()
  9122. end
  9123. end
  9124. else
  9125. for j=1,5 do
  9126. local uid = "party"..j
  9127. if j==5 then
  9128. uid = "player"
  9129. end
  9130. local name = UnitCombatlogname(uid)
  9131. if name then
  9132. moduleInspect.db.inspectItemsOnly[name] = true
  9133. moduleInspect.db.inspectQuery[name] = GetTime()
  9134. end
  9135. end
  9136. end
  9137. end
  9138. prevDiff = difficulty
  9139.  
  9140. if not scheludedQueue then
  9141. scheludedQueue = ScheduleTimer(funcScheduledUpdate,4)
  9142. end
  9143. end
  9144. end
  9145.  
  9146. do
  9147. local lastInspectTime = {}
  9148. function moduleInspect.main:INSPECT_READY(arg)
  9149. if not moduleInspect.db.inspectCleared then
  9150. ExRT.F.dprint('INSPECT_READY',arg)
  9151. local time_ = GetTime()
  9152. if arg and lastInspectTime[arg] and (time_ - lastInspectTime[arg]) < 0.2 then
  9153. return
  9154. end
  9155. if arg then
  9156. lastInspectTime[arg] = time_
  9157. end
  9158. local _,_,_,race,_,name,realm = GetPlayerInfoByGUID(arg)
  9159. if name then
  9160. if realm and realm ~= "" then name = name.."-"..realm end
  9161. local inspectedName = name
  9162. if UnitName("target") == DelUnitNameServer(name) then
  9163. inspectedName = "target"
  9164. elseif not UnitName(name) then
  9165. return
  9166. end
  9167. moduleInspect:ResetTimer()
  9168. local _,class,classID = UnitClass(inspectedName)
  9169.  
  9170. for i,slotID in ipairs(moduleInspect.db.itemsSlotTable) do
  9171. local link = GetInventoryItemLink(inspectedName, slotID)
  9172. end
  9173. ScheduleTimer(InspectItems, inspectForce and 0.8 or 1.5, name, inspectedName, moduleInspect.db.inspectID)
  9174.  
  9175. if moduleInspect.db.inspectDB[name] and moduleInspect.db.inspectItemsOnly[name] then
  9176. moduleInspect.db.inspectItemsOnly[name] = nil
  9177. return
  9178. end
  9179. moduleInspect.db.inspectItemsOnly[name] = nil
  9180.  
  9181. if moduleInspect.db.inspectDB[name] then
  9182. wipe(moduleInspect.db.inspectDB[name])
  9183. else
  9184. moduleInspect.db.inspectDB[name] = {}
  9185. end
  9186. local data = moduleInspect.db.inspectDB[name]
  9187.  
  9188. data.spec = round( GetInspectSpecialization(inspectedName) )
  9189. if data.spec < 1000 then
  9190. VExRT.ExCD2.gnGUIDs[name] = data.spec
  9191. end
  9192. data.class = class
  9193. data.level = UnitLevel(inspectedName)
  9194. data.race = race
  9195. data.time = time()
  9196. data.GUID = UnitGUID(inspectedName)
  9197.  
  9198. local specIndex = 1
  9199. for i=1,GetNumSpecializationsForClassID(classID) do
  9200. if GetSpecializationInfoForClassID(classID,i) == data.spec then
  9201. specIndex = i
  9202. break
  9203. end
  9204. end
  9205.  
  9206.  
  9207. for i=1,6 do
  9208. data[i] = 0
  9209. end
  9210. data.talentsIDs = {}
  9211.  
  9212. local classTalents = module.db.spell_talentsList[class]
  9213. local specTalents = classTalents and classTalents[data.spec]
  9214. if specTalents then
  9215. for i=0,20 do
  9216. local row,col = (i-i%3)/3+1,i%3+1
  9217.  
  9218. local t_id,_,_,t = GetTalentInfo(row,col,specIndex,true,inspectedName)
  9219. if t then
  9220. data[row] = col
  9221. data.talentsIDs[row] = t_id
  9222. end
  9223.  
  9224. --------> ExCD2
  9225. local talentID = specTalents[i+1]
  9226. if talentID then
  9227. if type(talentID) == "table" then
  9228. for j,sID in ipairs(talentID) do
  9229. if t then
  9230. module.db.session_gGUIDs[name] = sID
  9231. else
  9232. module.db.session_gGUIDs[name] = -sID
  9233. end
  9234. end
  9235. else
  9236. if t then
  9237. module.db.session_gGUIDs[name] = talentID
  9238. else
  9239. module.db.session_gGUIDs[name] = -talentID
  9240. end
  9241. end
  9242. end
  9243. --------> /ExCD2
  9244. end
  9245. end
  9246. for i=0,17 do
  9247. local row,col = (i-i%3)/3+1,i%3+1
  9248.  
  9249. local t_id,_,_,t = GetPvpTalentInfo(row,col,specIndex,true,inspectedName)
  9250. if t then
  9251. data[row+7] = col
  9252. data.talentsIDs[row+7] = t_id
  9253. end
  9254. end
  9255. InspectItems(name, inspectedName, moduleInspect.db.inspectID)
  9256.  
  9257. UpdateAllData() --------> ExCD2
  9258. end
  9259. end
  9260. end
  9261. end
  9262.  
  9263. do
  9264. local lastInspectTime,lastInspectGUID = 0
  9265. moduleInspect.db.acivementsIDs = {}
  9266. function moduleInspect.main:INSPECT_ACHIEVEMENT_READY(guid)
  9267. ExRT.F.dprint('INSPECT_ACHIEVEMENT_READY',guid)
  9268. if moduleInspect.db.achievementCleared then
  9269. C_Timer.NewTimer(.3,ClearAchievementComparisonUnit) --prevent client crash on opening statistic
  9270. return
  9271. end
  9272. local currTime = GetTime()
  9273. if not guid or (lastInspectGUID == guid and (currTime - lastInspectTime) < 0.2) then
  9274. C_Timer.NewTimer(.3,ClearAchievementComparisonUnit) --prevent client crash on opening statistic
  9275. return
  9276. end
  9277. lastInspectGUID = guid
  9278. lastInspectTime = currTime
  9279. local _,_,_,_,_,name,realm = GetPlayerInfoByGUID(guid)
  9280. if name then
  9281. if realm and realm ~= "" then name = name.."-"..realm end
  9282.  
  9283. if moduleInspect.db.inspectDBAch[name] then
  9284. wipe(moduleInspect.db.inspectDBAch[name])
  9285. else
  9286. moduleInspect.db.inspectDBAch[name] = {}
  9287. end
  9288. local data = moduleInspect.db.inspectDBAch[name]
  9289. data.guid = guid
  9290. for _,id in pairs(moduleInspect.db.acivementsIDs) do
  9291. if id > 0 then
  9292. local completed, month, day, year, unk1 = GetAchievementComparisonInfo(id)
  9293. if completed then
  9294. data[id] = month..":"..day..":"..year
  9295. end
  9296. else
  9297. id = -id
  9298. local info = GetComparisonStatistic(id)
  9299. info = tonumber(info or "-")
  9300. if info then
  9301. data[id] = info
  9302. end
  9303. end
  9304. end
  9305. end
  9306. if not AchievementFrame or not AchievementFrame:IsShown() then
  9307. C_Timer.NewTimer(.3,ClearAchievementComparisonUnit) --prevent client crash on opening statistic
  9308. end
  9309. end
  9310. end
  9311.  
  9312. function moduleInspect.main:UNIT_INVENTORY_CHANGED(arg)
  9313. if arg=='player' then return end
  9314. local name = UnitCombatlogname(arg or "?")
  9315. if name and name ~= ExRT.SDB.charName then
  9316. moduleInspect.db.inspectItemsOnly[name] = true
  9317. moduleInspect.db.inspectQuery[name] = GetTime()
  9318. end
  9319. end
  9320.  
  9321. local Inspect_Artifact_PLAYER_EQUIPMENT_CHANGED
  9322.  
  9323. function moduleInspect.main:PLAYER_EQUIPMENT_CHANGED(arg)
  9324. local name = UnitCombatlogname("player")
  9325. moduleInspect.db.inspectItemsOnly[name] = true
  9326. moduleInspect.db.inspectQuery[name] = GetTime()
  9327.  
  9328. Inspect_Artifact_PLAYER_EQUIPMENT_CHANGED(arg)
  9329. end
  9330.  
  9331. -------------------------------------------
  9332. ------------- --------------
  9333. ------------- Legendary ring --------------
  9334. ------------- --------------
  9335. -------------------------------------------
  9336.  
  9337. if not ExRT.isLegionContent then
  9338.  
  9339. local module_legendary = ExRT.mod:New("LegendaryRing",ExRT.L.LegendaryRing,nil,true)
  9340.  
  9341. local module_legendary_ring = nil
  9342.  
  9343. function module_legendary.options:Load()
  9344. self:CreateTilte()
  9345.  
  9346. self.enableChk = ELib:Check(self,L.LegendaryRingEnable,VExRT.LegendaryRing.enabled):Point(5,-30):OnClick(function(self)
  9347. if self:GetChecked() then
  9348. VExRT.LegendaryRing.enabled = true
  9349. module_legendary:RegisterEvents("COMBAT_LOG_EVENT_UNFILTERED")
  9350. module_legendary:RegisterAddonMessage()
  9351. else
  9352. VExRT.LegendaryRing.enabled = nil
  9353. module_legendary:UnregisterEvents("COMBAT_LOG_EVENT_UNFILTERED")
  9354. module_legendary:UnregisterAddonMessage()
  9355. end
  9356. end)
  9357.  
  9358. self.typeChk = ELib:Check(self,L.LegendaryRingType,VExRT.LegendaryRing.ShowType):Point(5,-55):OnClick(function(self)
  9359. if self:GetChecked() then
  9360. VExRT.LegendaryRing.ShowType = true
  9361. else
  9362. VExRT.LegendaryRing.ShowType = nil
  9363. end
  9364. end)
  9365.  
  9366. self.raidWarningChk = ELib:Check(self,RAID_WARNING,VExRT.LegendaryRing.raidWarning):Point(5,-80):OnClick(function(self)
  9367. if self:GetChecked() then
  9368. VExRT.LegendaryRing.raidWarning = true
  9369. else
  9370. VExRT.LegendaryRing.raidWarning = nil
  9371. end
  9372. end)
  9373.  
  9374.  
  9375. end
  9376.  
  9377. function module_legendary.main:ADDON_LOADED()
  9378. if not VExRT then
  9379. return
  9380. end
  9381. VExRT.LegendaryRing = VExRT.LegendaryRing or {}
  9382.  
  9383. if VExRT.LegendaryRing.enabled then
  9384. module_legendary:RegisterAddonMessage()
  9385. module_legendary:RegisterEvents("COMBAT_LOG_EVENT_UNFILTERED")
  9386. end
  9387. end
  9388.  
  9389. do
  9390. local isSendByMe = true
  9391. local function SendToChat(name,ringtype)
  9392. if isSendByMe then
  9393. local chat_type,chat_tar = ExRT.F.chatType()
  9394. ringtype = VExRT.LegendaryRing.ShowType and ringtype
  9395. if chat_type == "RAID" and VExRT.LegendaryRing.raidWarning then
  9396. chat_type = "raid_warning"
  9397. elseif chat_type == "WHISPER" then
  9398. return
  9399. end
  9400. SendChatMessage(format("%s: %s",L.LegendaryRingFrodo,name)..(ringtype and " ["..ringtype.."]" or ""),chat_type,nil,chat_tar)
  9401. end
  9402. end
  9403. function module_legendary.Ring(name,ringtype)
  9404. if not VExRT.LegendaryRing or not VExRT.LegendaryRing.enabled then
  9405. return
  9406. end
  9407. isSendByMe = true
  9408. ExRT.F.ScheduleTimer(ExRT.F.SendExMsg, 0.15, "legendary","RING")
  9409. local dealy = ExRT.F.IsPlayerRLorOfficer(ExRT.SDB.charName) == 2 and 0.01 or 1.3
  9410. ExRT.F.ScheduleTimer(SendToChat, dealy, name, ringtype)
  9411. end
  9412.  
  9413. function module_legendary:addonMessage(sender, prefix, sub_type)
  9414. if prefix == "legendary" then
  9415. if sender then
  9416. if ExRT.F.IsPlayerRLorOfficer(ExRT.SDB.charName) == 2 then
  9417. return
  9418. end
  9419. if sender < ExRT.SDB.charName or ExRT.F.IsPlayerRLorOfficer(sender) == 2 then
  9420. if sub_type == "RING" then
  9421. isSendByMe = nil
  9422. end
  9423. end
  9424. end
  9425. end
  9426. end
  9427. end
  9428. module_legendary_ring = module_legendary.Ring
  9429.  
  9430. module_legendary.db.types = {
  9431. [187614] = DAMAGER,
  9432. [187615] = DAMAGER,
  9433. [187611] = DAMAGER,
  9434. [187613] = TANK,
  9435. [187612] = HEALER,
  9436. }
  9437. function module_legendary.main:COMBAT_LOG_EVENT_UNFILTERED(_,_,event,_,sourceGUID,sourceName,_,_,_,_,_,_,spellID)
  9438. if event == "SPELL_CAST_SUCCESS" and (spellID == 187614 or spellID == 187615 or spellID == 187611 or spellID == 187613 or spellID == 187612) then
  9439. if not sourceName or not UnitName(sourceName) then
  9440. return
  9441. end
  9442. module_legendary_ring(sourceName,module_legendary.db.types[spellID])
  9443. end
  9444. end
  9445.  
  9446. end
  9447.  
  9448.  
  9449. -------------------------------------------
  9450. ------------- --------------
  9451. ------------- Artifact --------------
  9452. ------------- --------------
  9453. -------------------------------------------
  9454.  
  9455. moduleInspect.db.artifactDB = {}
  9456. moduleInspect.db.artifactNoResDB = {}
  9457.  
  9458. local ArtifactCache = {}
  9459. moduleInspect.db.selfArtifactCache = ArtifactCache
  9460.  
  9461. moduleInspect.db.relicTypeToID = {
  9462. ["Fel"] = 0,
  9463. ["Fire"] = 1,
  9464. ["Blood"] = 2,
  9465. ["Life"] = 3,
  9466. ["Holy"] = 4,
  9467. ["Frost"] = 5,
  9468. ["Shadow"] = 6,
  9469. ["Iron"] = 7,
  9470. ["Arcane"] = 8,
  9471. ["Wind"] = 9,
  9472. }
  9473.  
  9474. local function ScanArtifactData()
  9475. wipe(ArtifactCache)
  9476.  
  9477. local powers = C_ArtifactUI.GetPowers()
  9478.  
  9479. if not powers then
  9480. return
  9481. end
  9482.  
  9483. local traits = {}
  9484. ArtifactCache.traits = traits
  9485. for i = 1, #powers do
  9486. local traitID = powers[i]
  9487. local spellID, _, currentRank, maxRank, bonusRanks, _, _, _, isStart, isGold, isFinal = C_ArtifactUI.GetPowerInfo(traitID)
  9488. traits[#traits + 1] = {
  9489. traitID = traitID,
  9490. currentRank = currentRank,
  9491. maxRank = maxRank,
  9492. sort = (isStart and 100) or (isFinal and -100) or (isGold and 50) or 0,
  9493. }
  9494. end
  9495.  
  9496. sort(traits,function(a,b)
  9497. if a and b then
  9498. if a.sort == b.sort then
  9499. return a.traitID > b.traitID
  9500. else
  9501. return a.sort > b.sort
  9502. end
  9503. end
  9504. end)
  9505.  
  9506. ArtifactCache.KnowledgeLevel = C_ArtifactUI.GetArtifactKnowledgeLevel()
  9507. ArtifactCache.KnowledgeMultiplier = C_ArtifactUI.GetArtifactKnowledgeMultiplier()
  9508. local itemID, _, _, _, _, aLevel = C_ArtifactUI.GetArtifactInfo()
  9509. ArtifactCache.AftifactLevel = aLevel
  9510. ArtifactCache.itemID = itemID
  9511.  
  9512. for i=1,3 do
  9513. local _,_,_,relicLink = C_ArtifactUI.GetRelicInfo(i)
  9514. if relicLink then
  9515. relicLink = relicLink:match("(item:.-)|h")
  9516. end
  9517. ArtifactCache["relic"..i] = relicLink
  9518.  
  9519. local relicType = C_ArtifactUI.GetRelicSlotType(i)
  9520. relicType = moduleInspect.db.relicTypeToID[ relicType or "?" ]
  9521. ArtifactCache["relicType"..i] = relicType
  9522. end
  9523. end
  9524.  
  9525. local function UpdateArtifactData()
  9526. if true then
  9527. return
  9528. end
  9529. if not C_ArtifactUI.GetEquippedArtifactInfo() then
  9530. return
  9531. end
  9532. local isArtifactFrameShown = ArtifactFrame and ArtifactFrame:IsShown()
  9533. if not isArtifactFrameShown then
  9534. SocketInventoryItem(16)
  9535. end
  9536. ScanArtifactData()
  9537. if not isArtifactFrameShown then
  9538. C_ArtifactUI.Clear()
  9539. end
  9540. end
  9541.  
  9542. do
  9543. --Fix Blizzard Errors
  9544. local def = C_ArtifactUI.GetTotalPurchasedRanks
  9545. C_ArtifactUI.GetTotalPurchasedRanks = function(...)
  9546. local arg1,arg2,arg3 = def(...)
  9547. if not arg1 then
  9548. return 0
  9549. end
  9550. return arg1,arg2,arg3
  9551. end
  9552. end
  9553.  
  9554. local artifactUIfixTimer
  9555. local function artifactUI_CheckMajorFrames(self)
  9556. if (not WorldMapFrame or not WorldMapFrame:IsVisible()) and (not PlayerTalentFrame or not PlayerTalentFrame:IsVisible()) and (not OrderHallMissionFrame or not OrderHallMissionFrame:IsVisible()) then
  9557. if artifactUIfixTimer then
  9558. artifactUIfixTimer:Cancel()
  9559. end
  9560. if self then
  9561. self:Cancel()
  9562. end
  9563.  
  9564. UIParent:UnregisterEvent("ARTIFACT_UPDATE")
  9565. C_Timer.After(.1,function()
  9566. UIParent:RegisterEvent("ARTIFACT_UPDATE")
  9567. end)
  9568.  
  9569. UpdateArtifactData()
  9570. return true
  9571. end
  9572. end
  9573.  
  9574. local artifactUIfix = CreateFrame'Frame'
  9575. artifactUIfix:RegisterEvent('LOADING_SCREEN_DISABLED')
  9576. artifactUIfix:SetScript("OnEvent",function(self)
  9577. C_Timer.NewTimer(9,function()
  9578. artifactUIfixTimer = C_Timer.NewTicker(1,artifactUI_CheckMajorFrames)
  9579. moduleInspect:RegisterEvents('ARTIFACT_XP_UPDATE')
  9580. end)
  9581. self:UnregisterAllEvents()
  9582. end)
  9583.  
  9584.  
  9585. function moduleInspect:ArtifactAddToQueue(name)
  9586. ExRT.F.SendExMsg("inspect", ExRT.F.CreateAddonMsg("art","GET",name))
  9587. end
  9588.  
  9589.  
  9590. local function Inspect_SendArtifactData()
  9591. if not ArtifactCache.AftifactLevel then
  9592. ExRT.F.SendExMsg("inspect", ExRT.F.CreateAddonMsg("art","NO"))
  9593. return
  9594. end
  9595. local equippedItemID = C_ArtifactUI.GetEquippedArtifactInfo()
  9596. if not equippedItemID then
  9597. ExRT.F.SendExMsg("inspect", ExRT.F.CreateAddonMsg("art","NO"))
  9598. return
  9599. end
  9600. if ArtifactCache.itemID ~= equippedItemID then
  9601. UpdateArtifactData()
  9602. if not ArtifactCache.AftifactLevel then
  9603. ExRT.F.SendExMsg("inspect", ExRT.F.CreateAddonMsg("art","NO"))
  9604. return
  9605. end
  9606. end
  9607.  
  9608. local res = ArtifactCache.AftifactLevel..":"..ArtifactCache.KnowledgeLevel..":"
  9609. for i=1,#ArtifactCache.traits do
  9610. res = res .. ArtifactCache.traits[i].traitID .. "-" ..ArtifactCache.traits[i].currentRank .. "-" .. ArtifactCache.traits[i].maxRank .. ":"
  9611. end
  9612. res = res .. equippedItemID
  9613.  
  9614. ExRT.F.SendExMsg("inspect", ExRT.F.CreateAddonMsg("art","R",res))
  9615.  
  9616. local res = ""
  9617. for i=1,3 do
  9618. res = res .. (ArtifactCache["relicType"..i] or "-") .. "^" .. (ArtifactCache["relic"..i] or "-") .. (i < 3 and "^" or "")
  9619. end
  9620.  
  9621. ExRT.F.SendExMsg("inspect", ExRT.F.CreateAddonMsg("art","AR",res))
  9622. end
  9623.  
  9624. function moduleInspect.main:ENCOUNTER_START()
  9625. C_Timer.NewTimer(3,function()
  9626. Inspect_SendArtifactData()
  9627. end)
  9628. end
  9629.  
  9630. function moduleInspect.main:ARTIFACT_XP_UPDATE()
  9631. artifactUIfixTimer = nil
  9632. if not artifactUI_CheckMajorFrames() then
  9633. artifactUIfixTimer = C_Timer.NewTicker(1,artifactUI_CheckMajorFrames)
  9634. end
  9635. end
  9636.  
  9637. local function Inspect_ParseArtifactString(db,string)
  9638. local al,ak,tr = strsplit(":",string,3)
  9639.  
  9640. db.Level = tonumber(al)
  9641. db.KnowledgeLevel = tonumber(ak)
  9642.  
  9643. while tr do
  9644. local trait,o = strsplit(":",tr,2)
  9645.  
  9646. local id,cr,mr = strsplit("-",trait)
  9647. if id and cr and mr then
  9648. db[#db+1] = {tonumber(id),tonumber(cr),tonumber(mr)}
  9649. else
  9650. break
  9651. end
  9652.  
  9653. tr = o
  9654. end
  9655.  
  9656. local itemID,rest = strsplit(":",tr or "",2)
  9657. if itemID then
  9658. db.itemID = tonumber(itemID)
  9659. end
  9660. tr = rest
  9661.  
  9662. return db
  9663. end
  9664.  
  9665. local function Inspect_ParseArtifactRelicString(db,string)
  9666. for i=1,3 do
  9667. if not string then
  9668. break
  9669. end
  9670. local relicType,relicLink,o = strsplit("^",string,3)
  9671.  
  9672. relicType = tonumber(relicType or "?")
  9673. if not relicLink or not relicLink:find("item:") then
  9674. relicLink = nil
  9675. end
  9676.  
  9677. db["relic"..i] = relicLink
  9678. db["relicType"..i] = relicType
  9679.  
  9680. string = o
  9681. end
  9682.  
  9683. return db
  9684. end
  9685.  
  9686. local UpdateArtifactToTalentsData
  9687.  
  9688. function Inspect_Artifact_ADDON_LOADED()
  9689. for player,data in pairs(VExRT.InspectArtifact.players) do
  9690. local db = {
  9691. time = data[2],
  9692. }
  9693. moduleInspect.db.artifactDB[ player ] = db
  9694.  
  9695. Inspect_ParseArtifactString(db, data[1])
  9696. UpdateArtifactToTalentsData(player)
  9697. end
  9698. --LoadAddOn("Blizzard_ArtifactUI")
  9699.  
  9700. --Rewrite default function, cuz GetTotalPurchasedRanks return nil after log on char
  9701. --function ArtifactUI_CanViewArtifact()
  9702. -- return C_ArtifactUI.IsAtForge() or (C_ArtifactUI.GetTotalPurchasedRanks() or 0) > 0 or C_ArtifactUI.GetNumObtainedArtifacts() > 1;
  9703. --end
  9704. end
  9705.  
  9706. local UpdateArtifactInfoTimer
  9707. function Inspect_Artifact_PLAYER_EQUIPMENT_CHANGED(slot)
  9708. if not (slot == 16 or slot == 17) then
  9709. return
  9710. end
  9711. if UpdateArtifactInfoTimer then
  9712. UpdateArtifactInfoTimer:Cancel()
  9713. end
  9714. UpdateArtifactInfoTimer = C_Timer.NewTimer(2,function()
  9715. UpdateArtifactInfoTimer = nil
  9716. UpdateArtifactData()
  9717. end)
  9718. end
  9719.  
  9720.  
  9721. do
  9722. local powerToSpellID = {}
  9723.  
  9724. function UpdateArtifactToTalentsData(player)
  9725. local name = ExRT.F.delUnitNameServer(player)
  9726. for i=1,#module.db.artifactAllSpells do
  9727. module.db.session_gGUIDs[ name ] = -module.db.artifactAllSpells[i]
  9728. end
  9729. if not moduleInspect.db.artifactDB[ player ] then
  9730. return
  9731. end
  9732. for i=1,#moduleInspect.db.artifactDB[ player ] do
  9733. if moduleInspect.db.artifactDB[ player ][i][2] > 0 then
  9734. local powerID = moduleInspect.db.artifactDB[ player ][i][1]
  9735. local spellID = powerToSpellID[powerID]
  9736. if not spellID then
  9737. spellID = C_ArtifactUI.GetPowerInfo(powerID)
  9738. powerToSpellID[powerID] = spellID
  9739. end
  9740. if spellID then
  9741. module.db.session_gGUIDs[ name ] = spellID
  9742. end
  9743. end
  9744. end
  9745. end
  9746.  
  9747.  
  9748.  
  9749. function GetArtifactTraitsKnown(playerName, spellID)
  9750. local data
  9751. for long_name,DB in pairs(moduleInspect.db.artifactDB) do
  9752. if ExRT.F.delUnitNameServer(long_name) == playerName then
  9753. if (not data) or (DB.time > data.time) then
  9754. data = DB
  9755. end
  9756. end
  9757. end
  9758. if not data then
  9759. return 0
  9760. end
  9761. for i=1,#data do
  9762. local powerID = data[i][1]
  9763. local powerSpellID = powerToSpellID[powerID]
  9764. if not powerSpellID then
  9765. powerSpellID = C_ArtifactUI.GetPowerInfo(powerID)
  9766. powerToSpellID[powerID] = powerSpellID
  9767. end
  9768. if powerSpellID == spellID then
  9769. return data[i][2]
  9770. end
  9771. end
  9772. return 0
  9773. end
  9774. end
  9775.  
  9776. function moduleInspect:addonMessage(sender, prefix, prefix2, ...)
  9777. if prefix == "inspect" then
  9778. if prefix2 == "art" then
  9779. local type,name = ...
  9780. if type == "GET" then
  9781. if ExRT.F.delUnitNameServer(name) == ExRT.SDB.charName then
  9782. Inspect_SendArtifactData()
  9783. end
  9784. elseif type == "R" then
  9785. local db = {}
  9786.  
  9787. moduleInspect.db.artifactDB[ sender ] = db
  9788.  
  9789. Inspect_ParseArtifactString(db, name)
  9790. UpdateArtifactToTalentsData(sender)
  9791.  
  9792. local currTime = time()
  9793.  
  9794. db.time = currTime
  9795.  
  9796. VExRT.InspectArtifact.players[ sender ] = {
  9797. name,
  9798. currTime,
  9799. }
  9800. elseif type == "AR" then
  9801. local db = moduleInspect.db.artifactDB[ sender ]
  9802. if not db then
  9803. return
  9804. end
  9805.  
  9806. Inspect_ParseArtifactRelicString(db,name)
  9807.  
  9808. elseif type == "NO" then
  9809. moduleInspect.db.artifactNoResDB[ sender ] = true
  9810. end
  9811. end
  9812. end
  9813. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement