--[[ |
ShadowExperience Redux |
Soulofsin_007 |
Copyright (C) 2010 Alex Shoemaker, All rights reserved. |
|
Changelog |
----------- |
|
-]] |
|
ShadowEOptions = { |
|
PetScale = 1; |
PetHeight = 12; |
PetWidth = 22; |
PlayerScale = 1; |
PlayerHeight = 12; |
PlayerWidth = 120; |
PlayerTipAnchor = "CURSOR"; |
|
locked = false; |
|
|
}; |
|
function ShadowExperience_OnLoad() |
local loaded, reason = LoadAddOn("Blizzard_AchievementUI") |
if not loaded then |
print("Can't load the achievement UI elements. Please check your installation.") |
end |
|
|
DEFAULT_CHAT_FRAME:AddMessage("ShadowExperience loaded. Please do /shadow for more.") |
end |
|
function tooltipset() |
local ToGoLeft = floor(UnitXP("player")-UnitXPMax("player")) |
local Perfect = floor(UnitXP("player")*100/UnitXPMax("player")) |
|
GameTooltip:SetOwner("ShadowPlayerExperience", ShadowEOptions.PlayerTipAnchor) |
GameTooltip:SetText(UnitName("Player")) |
GameTooltip:AddLine(UnitLevel("player")) |
GameTooltip:AddLine(UnitXP("player").."/"..UnitXPMax("player")) |
GameTooltip:AddLine(Perfect"%") |
GameTooltip:AddLine(ToGoLeft.." to go.") |
|
GameTooltip:Show() |
end |
|
function tooltipleave() |
GameTooltip:Hide() |
end |
|
--exp bars |
PlayerExp = CreateFrame("StatusBar", "ShadowPlayerExperience", WorldFrame, "AchievementProgressBarTemplate"); |
PlayerExp:SetWidth(ShadowEOptions.PlayerWidth); |
PlayerExp:SetHeight(ShadowEOptions.PlayerHeight); |
PlayerExp:SetOrientation("HORIZONTAL"); |
PlayerExp:SetStatusBarColor(1, 0, 0, 1); |
PlayerExp:SetBackdropColor(0, 0, 0, 1); |
PlayerExp:SetMinMaxValues(1,UnitXPMax("player")); |
PlayerExp:SetScript("OnEvent", function(self, event, ...) |
if event == "PLAYER_XP_UPDATE" and arg1 == "player" then |
PlayerXP:SetValue(UnitXP) |
end |
if event == "PLAYER_ENTERING_WORLD" then |
PlayerExp:SetValue(UnitXP) |
PlayerExp:SetText(UnitXP("player").."/"..UnitXPMax("player")) |
end |
end) |
PlayerExp:SetScript("OnEnter", tooltipset) |
PlayerExp:SetScript("OnLeave", tooltipleave) |
PlayerExp:RegisterEvent("PLAYER_XP_UPDATE") |
PlayerExp:ReigsterEvent("PLAYER_ENTERING_WORLD") |
|
--config |
|