--================================================================ |
--[[ |
PuppyHelmHider |
by Chrome67 (aka. Rhusty@EmeraldDream.US) |
available on Curse.com and WoWInterface.com |
|
-- Change Log -- |
-- 0.01 (12.30.2010, initial alpha) |
-- 0.01b (3.27.2012, beta testing complete, code cleanup) |
-- 0.01c (3.28.2012, more code cleanup, added reload slash command) |
-- 0.02 (4.22.2012, added CityHelm compatability) |
]]-- |
--================================================================ |
|
--[[ Initialization ]]-- |
|
local version = "0.01c" |
local PuppyHelmHider = CreateFrame("PlayerModel", nil, UIParent) |
PuppyHelmHider:SetUnit("player") |
local race = UnitRace("player") |
local PHH_debug = 1 |
|
--[[ Functions ]]-- |
|
function HatBeGone() |
PuppyHelmHider:SetUnit("player") |
if strfind(PuppyHelmHider:GetModel(),"\\human") == nil |
then |
ShowHelm(hide) |
if PHH_debug == 1 then DEFAULT_CHAT_FRAME:AddMessage("worgen-form helm hidden...") end |
else |
local zone = GetZoneText() -- CityHelm addon compatibility |
if changeHelm == (0 or nil) |
then |
ShowHelm() |
elseif CityZoneMap[zone] ~= "city" |
then |
ShowHelm() |
end |
if PHH_debug == 1 then DEFAULT_CHAT_FRAME:AddMessage("human-form helm shown...") end |
end |
end |
|
function PuppyHelmHider:OnEvent(event, arg1, ...) |
if event == "PLAYER_LOGIN" then |
print("|cffffd700<PuppyHelmHider>|r v" ..version.. " by |cff66ccffChrome67|r loaded...") |
HatBeGone() |
else |
HatBeGone() |
end |
end |
|
if race == "Worgen" |
then |
PuppyHelmHider:SetScript("OnEvent", PuppyHelmHider.OnEvent) |
PuppyHelmHider:RegisterEvent("UNIT_MODEL_CHANGED") |
PuppyHelmHider:RegisterEvent("PLAYER_LOGIN") |
else |
print("|cffffd700<PuppyHelmHider>|r v" ..version.. " by |cff66ccffChrome67|r NOT loaded...(hint: you are not a worgen!)") |
return |
end |
|
--[[ Slash Commands and Help ]]-- |
|
SLASH_RELOAD1 = "/rl" |
SlashCmdList["RELOAD"] = function(cmd) |
ReloadUI() |
end |