ClassicAPI cleanup and safe hooks

This commit is contained in:
Dusk-92
2026-08-30 09:10:12 +02:00
parent 4af510e3dc
commit 279417bd54
11 changed files with 164 additions and 325 deletions
+10 -6
View File
@@ -1,5 +1,6 @@
local _G = ShaguTweaks.GetGlobalEnv()
local T = ShaguTweaks.T
local hooksecurefunc = ShaguTweaks.hooksecurefunc
local module = ShaguTweaks:register({
title = T["Floating Actionbar"],
@@ -52,13 +53,13 @@ module.enable = function(self)
-- replace experience bar texture
MainMenuExpBar:SetStatusBarTexture("Interface\\AddOns\\ShaguTweaks-extras\\img\\xpbar")
local _, _, _, _, _, background = MainMenuExpBar:GetRegions()
background:SetTexture("Interface\\AddOns\\ShaguTweaks-extras\\img\\xpbar")
background:SetVertexColor(0, 0, 0, .5)
if background then
background:SetTexture("Interface\\AddOns\\ShaguTweaks-extras\\img\\xpbar")
background:SetVertexColor(0, 0, 0, .5)
end
-- update reputation bar position
local HookReputationWatchBar_Update = ReputationWatchBar_Update
ReputationWatchBar_Update = function(newLevel)
HookReputationWatchBar_Update(newLevel)
-- keep the custom reputation position without replacing Blizzard's updater
local function UpdateReputationPosition()
if MainMenuExpBar:IsShown() then
ReputationWatchBar:SetPoint("BOTTOM", MainMenuBar, "TOP", 0, -7)
else
@@ -66,6 +67,9 @@ module.enable = function(self)
end
end
hooksecurefunc("ReputationWatchBar_Update", UpdateReputationPosition)
UpdateReputationPosition()
-- hide max level top frame
MainMenuBarMaxLevelBar:SetAlpha(0)