-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCore.lua
More file actions
68 lines (60 loc) · 2.08 KB
/
Copy pathCore.lua
File metadata and controls
68 lines (60 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local ADDON_NAME, ns = ...
local AceAddon = LibStub("AceAddon-3.0")
OvershieldsReforged = AceAddon:NewAddon(ADDON_NAME, "AceEvent-3.0", "AceConsole-3.0")
function OvershieldsReforged:OnInitialize()
self:InitializeDatabase()
self:SetupOptions()
end
function OvershieldsReforged:OnEnable()
self:RegisterChatCommand("overshieldsreforged", "HandleSlashCommand")
self:RegisterChatCommand("osr", "HandleSlashCommand")
-- Hook Bliz's heal-prediction.
hooksecurefunc("CompactUnitFrame_UpdateHealPrediction", function(frame)
if ns.hibernating then return end
if not OvershieldsReforged:IsFrameContextEnabled(frame) then
ns.ReleaseFrame(frame, ns.StyleCache)
return
end
local profile = OvershieldsReforged.db and OvershieldsReforged.db.profile
if profile and profile.anchorModeShielded == "health_right" then
ns.EnforceNativeAbsorbVisibility(frame, profile)
end
--@alpha@
ns.Debug.Inc("hookFires")
--@end-alpha@
ns.QueueCompactUnitFrameUpdate(frame)
end)
-- Initial appearance pass to style any frames already visible when loading.
-- Defer to allow frame containers to fully initialize.
-- Evaluate hibernation AFTER initial appearance pass to ensure proper state.
if C_Timer and C_Timer.After then
C_Timer.After(0, function()
-- First evaluate hibernation state
if ns.EvaluateHibernation then
ns.EvaluateHibernation()
end
-- If not hibernating, update frame appearances
if not ns.hibernating then
ns.UpdateAllFrameAppearances()
end
end)
else
-- Fallback for clients without C_Timer
if ns.EvaluateHibernation then
ns.EvaluateHibernation()
end
if not ns.hibernating then
ns.UpdateAllFrameAppearances()
end
end
-- Re-apply appearance after Blizzard UI refreshes
if not self._appearanceEventFrame then
self._appearanceEventFrame = CreateFrame("Frame")
self._appearanceEventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
self._appearanceEventFrame:RegisterEvent("GROUP_ROSTER_UPDATE")
self._appearanceEventFrame:SetScript("OnEvent", function()
if ns.hibernating then return end
ns.UpdateAllFrameAppearances()
end)
end
end