Subject | Hash | Author | Date (UTC) |
---|---|---|---|
feat!: Show spell tooltip on indicator mouseover | dd69f46f1522f49ce942d8e0b3756c609471be7a | Vladyslav Bondarenko | 2021-10-13 01:12:08 |
feat!: Indicator grouping feature | df7e0579a51388dba73bc5d92b3d04369bb0e426 | Vladyslav Bondarenko | 2021-10-13 00:17:28 |
feat!: Redo the core functionality | 085af1bc403b3a9d2d4b99ec460d67889239fabd | Vladyslav Bondarenko | 2021-07-09 11:15:31 |
feat: Track additional auras | 958e52f9808d64ebb816663d2aa22a4eb39a2068 | Vladyslav Bondarenko | 2021-01-22 20:28:13 |
fix!: No longer crash on unknown spell | 65061085f0f55b75910c9ed4d8249b1e8e30f9ee | Vladyslav Bondarenko | 2020-12-11 17:31:16 |
fix: Render indicators properly on first login | bf102cc749cc23d3769a82f10fe93a05afc5277f | Vladyslav Bondarenko | 2020-12-11 14:25:11 |
feat: Add Serendipity and Surge of Light indicators | ba1d0f32a4b8f4f5d4e2730f0a4e409e23b52974 | Vladyslav Bondarenko | 2020-12-10 16:19:55 |
Initial commit | 9b3df418e373218125fec12271084afebb11cfc2 | Vladyslav Bondarenko | 2020-12-04 10:27:24 |
File | Lines added | Lines deleted |
---|---|---|
.luacheckrc | 8 | 7 |
clearcasting.lua | 58 | 2 |
clearcasting.toc | 1 | 1 |
File .luacheckrc changed (mode: 100644) (index e61fec4..9b16a88) | |||
2 | 2 | stds.wow = { | stds.wow = { |
3 | 3 | globals = {}, -- these globals can be set and accessed. | globals = {}, -- these globals can be set and accessed. |
4 | 4 | read_globals = { | read_globals = { |
5 | "ChatFrame1", | ||
5 | 6 | "CreateFrame", | "CreateFrame", |
6 | 7 | "DEFAULT_CHAT_FRAME", | "DEFAULT_CHAT_FRAME", |
7 | 8 | "GameFontNormal", | "GameFontNormal", |
8 | 9 | "GameMenuFrame", | "GameMenuFrame", |
10 | "GameTooltip", | ||
9 | 11 | "GetBinding", | "GetBinding", |
10 | 12 | "GetChatWindowInfo", | "GetChatWindowInfo", |
11 | 13 | "GetContainerItemID", | "GetContainerItemID", |
... | ... | stds.wow = { | |
17 | 19 | "GetItemCooldown", | "GetItemCooldown", |
18 | 20 | "GetItemInfo", | "GetItemInfo", |
19 | 21 | "GetLocale", | "GetLocale", |
22 | "GetLocale", | ||
20 | 23 | "GetLootSlotInfo", | "GetLootSlotInfo", |
21 | 24 | "GetMacroInfo", | "GetMacroInfo", |
22 | 25 | "GetMoney", | "GetMoney", |
... | ... | stds.wow = { | |
37 | 40 | "GetSubZoneText", | "GetSubZoneText", |
38 | 41 | "GetTalentInfo", | "GetTalentInfo", |
39 | 42 | "GetTime", | "GetTime", |
43 | "GetTime", | ||
40 | 44 | "GetZoneText", | "GetZoneText", |
41 | 45 | "HideUIPanel", | "HideUIPanel", |
42 | 46 | "IsSpellInRange", | "IsSpellInRange", |
... | ... | stds.wow = { | |
45 | 49 | "MainMenuBar", | "MainMenuBar", |
46 | 50 | "MerchantFrame", | "MerchantFrame", |
47 | 51 | "NUM_CHAT_WINDOWS", | "NUM_CHAT_WINDOWS", |
52 | "NumberFont_OutlineThick_Mono_Small", | ||
48 | 53 | "NumberFont_Outline_Large", | "NumberFont_Outline_Large", |
49 | 54 | "OpenAllBags", | "OpenAllBags", |
50 | 55 | "PaladinPowerBar", | "PaladinPowerBar", |
... | ... | stds.wow = { | |
65 | 70 | "ToggleSpellBook", | "ToggleSpellBook", |
66 | 71 | "ToggleTalentFrame", | "ToggleTalentFrame", |
67 | 72 | "UIParent", | "UIParent", |
73 | "UIParent", | ||
68 | 74 | "UnitAffectingCombat", | "UnitAffectingCombat", |
69 | 75 | "UnitAura", | "UnitAura", |
76 | "UnitAura", | ||
70 | 77 | "UnitBuff", | "UnitBuff", |
71 | 78 | "UnitClass", | "UnitClass", |
72 | 79 | "UnitFactionGroup", | "UnitFactionGroup", |
73 | 80 | "UnitIsDead", | "UnitIsDead", |
81 | "UnitIsEnemy", | ||
74 | 82 | "UnitName", | "UnitName", |
75 | 83 | "UnitPlayerControlled", | "UnitPlayerControlled", |
76 | 84 | "UnitPower", | "UnitPower", |
77 | 85 | "UnitSetRole", | "UnitSetRole", |
78 | "UnitIsEnemy", | ||
79 | 86 | "date", | "date", |
80 | 87 | "difftime", | "difftime", |
81 | 88 | "geterrorhandler", | "geterrorhandler", |
... | ... | stds.wow = { | |
83 | 90 | "hooksecurefunc", | "hooksecurefunc", |
84 | 91 | "strtrim", | "strtrim", |
85 | 92 | "time", | "time", |
86 | "ChatFrame1", | ||
87 | "UnitAura", | ||
88 | "GetTime", | ||
89 | "GetLocale", | ||
90 | "UIParent", | ||
91 | "NumberFont_OutlineThick_Mono_Small", | ||
92 | 93 | } -- these globals can only be accessed. | } -- these globals can only be accessed. |
93 | 94 | } | } |
94 | 95 |
File clearcasting.lua changed (mode: 100644) (index 40e7c1c..89ea08f) | |||
... | ... | local function attemptToApply(f, name, rank, pictureFile, stackQuantity, categor | |
310 | 310 | assert (f ~= nil) | assert (f ~= nil) |
311 | 311 | ||
312 | 312 | if not name then | if not name then |
313 | f.spellId = nil | ||
314 | f.spellName = nil | ||
313 | 315 | f:Hide() | f:Hide() |
314 | 316 | f:SetScript('OnUpdate', nil) | f:SetScript('OnUpdate', nil) |
315 | 317 | return | return |
316 | 318 | end | end |
317 | 319 | ||
320 | assert (name ~= nil) | ||
321 | assert ('string' == type(name)) | ||
322 | assert (string.len(name) >= 2) | ||
323 | assert (string.len(name) <= 256) | ||
324 | f.spellName = name | ||
325 | |||
326 | assert (id ~= nil) | ||
327 | assert ('number' == type(id)) | ||
328 | assert (id >= 1) | ||
329 | f.spellId = math.floor(id) | ||
330 | |||
318 | 331 | applyBackground(f, pictureFile) | applyBackground(f, pictureFile) |
319 | 332 | applyBorder(f, category, caster) | applyBorder(f, category, caster) |
320 | 333 | applyDuration(f, duration, expirationInstance, stackQuantity) | applyDuration(f, duration, expirationInstance, stackQuantity) |
334 | |||
321 | 335 | f:Show() | f:Show() |
322 | 336 | f:SetScript('OnUpdate', indicatorUpdateProcessor) | f:SetScript('OnUpdate', indicatorUpdateProcessor) |
323 | 337 | end | end |
... | ... | local function indicatorEventProcessor(f) | |
337 | 351 | assert (string.len(filterDescriptor) >= 4) | assert (string.len(filterDescriptor) >= 4) |
338 | 352 | assert (string.len(filterDescriptor) <= 64) | assert (string.len(filterDescriptor) <= 64) |
339 | 353 | ||
340 | local target = f.spell | ||
354 | local target = f.target | ||
341 | 355 | assert (target ~= nil) | assert (target ~= nil) |
342 | 356 | ||
343 | 357 | local name, rank, pictureFile, stackQuantity, category, | local name, rank, pictureFile, stackQuantity, category, |
... | ... | local function indicatorEventProcessor(f) | |
371 | 385 | caster, stealableFlag, consolidateFlag, id) | caster, stealableFlag, consolidateFlag, id) |
372 | 386 | end | end |
373 | 387 | ||
388 | local function tooltipOverlayEventProcessor(tooltipOverlay) | ||
389 | assert (tooltipOverlay ~= nil) | ||
390 | |||
391 | GameTooltip:SetOwner(tooltipOverlay, 'ANCHOR_BOTTOMRIGHT') | ||
392 | |||
393 | local indicator = tooltipOverlay:GetParent() | ||
394 | assert (indicator ~= nil) | ||
395 | |||
396 | local spellId = indicator.spellId | ||
397 | if spellId then | ||
398 | assert ('number' == type(spellId)) | ||
399 | local t = GetSpellLink(spellId) | ||
400 | GameTooltip:SetHyperlink(t) | ||
401 | else | ||
402 | GameTooltip:SetText('spell description could not be found') | ||
403 | end | ||
404 | end | ||
405 | |||
406 | local function createTooltipOverlay(indicator) | ||
407 | assert (indicator ~= nil) | ||
408 | |||
409 | local p = indicator:GetName() or 'Clearcasting' | ||
410 | local n = p .. 'TooltipOverlay' | ||
411 | local o = CreateFrame('FRAME', n, indicator) | ||
412 | o:SetAllPoints() | ||
413 | |||
414 | --[[ It is critical to call EnableMouse method on a tooltip overlay frame ]]-- | ||
415 | o:EnableMouse(true) | ||
416 | |||
417 | indicator.tooltipOverlay = o | ||
418 | |||
419 | o:SetScript('OnEnter', tooltipOverlayEventProcessor) | ||
420 | o:SetScript('OnLeave', function() GameTooltip:Hide(); end) | ||
421 | |||
422 | return o | ||
423 | end | ||
424 | |||
374 | 425 | local function createIndicator(parentFrame, target, unitDesignation, filterDescriptor) | local function createIndicator(parentFrame, target, unitDesignation, filterDescriptor) |
375 | 426 | assert (parentFrame ~= nil) | assert (parentFrame ~= nil) |
376 | 427 | ||
... | ... | local function createIndicator(parentFrame, target, unitDesignation, filterDescr | |
414 | 465 | ||
415 | 466 | f.unit = unitDesignation | f.unit = unitDesignation |
416 | 467 | f.filter = string.upper(filterDescriptor or 'HELPFUL') | f.filter = string.upper(filterDescriptor or 'HELPFUL') |
417 | f.spell = target | ||
468 | f.target = target | ||
469 | f.spellId = nil | ||
470 | f.spellName = nil | ||
471 | |||
472 | createTooltipOverlay(f) | ||
473 | |||
418 | 474 | f:SetScript('OnEvent', indicatorEventProcessor) | f:SetScript('OnEvent', indicatorEventProcessor) |
419 | 475 | f:SetScript('OnUpdate', indicatorUpdateProcessor) | f:SetScript('OnUpdate', indicatorUpdateProcessor) |
420 | 476 | f:RegisterEvent('PLAYER_ENTERING_WORLD') | f:RegisterEvent('PLAYER_ENTERING_WORLD') |
File clearcasting.toc changed (mode: 100644) (index 98bdf2f..f9e44cd) | |||
1 | 1 | ##Interface: 30300 | ##Interface: 30300 |
2 | 2 | ##Notes: Add separate indicators for specific buffs. | ##Notes: Add separate indicators for specific buffs. |
3 | 3 | ##Title: Clearcasting | ##Title: Clearcasting |
4 | ##Version: 0.0.2-SNAPSHOT | ||
4 | ##Version: 0.0.3-SNAPSHOT | ||
5 | 5 | ##SavedVariablesPerCharacter: ClearcastingDebugFlag | ##SavedVariablesPerCharacter: ClearcastingDebugFlag |
6 | 6 | clearcasting.xml | clearcasting.xml |
7 | 7 | clearcasting.lua | clearcasting.lua |