Files
ShaguTweaks-ClassicAPI/mods/unitframes-hide-player-portrait.lua
T

22 lines
763 B
Lua

local T = ShaguTweaks.T
local module = ShaguTweaks:register({
title = T["Hide Player Portrait"],
description = T["Hides only your player portrait image. The player name, health bar and power bar remain visible."],
expansions = { ["vanilla"] = true },
category = T["Unit Frames"],
enabled = nil,
})
module.enable = function(self)
if self.installed or not PlayerPortrait then return end
self.installed = true
local setAlpha = PlayerPortrait.SetAlpha
setAlpha(PlayerPortrait, 0)
-- Keep the texture object available to the stock portrait code and class
-- portrait module. Neither its visibility nor its parent's bars are altered.
ShaguTweaks.hooksecurefunc(PlayerPortrait, "SetAlpha", function(texture)
setAlpha(texture, 0)
end)
end