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) |
function Shadow_CreateBar() |
PlayerExp = CreateFrame("StatusBar", "ShadowPlayerExperience", WorldFrame, "AchievementProgressBarTemplate"); |
PlayerExp:SetWidth(ShadowEOptions.PlayerWidth); |
PlayerExp:SetHeight(ShadowEOptions.PlayerHeight); |
PlayerExp:SetPoint("CENTER") |
PlayerExp:SetOrientation("HORIZONTAL"); |
PlayerExp:SetStatusBarColor(68, 0, 68, 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 |
PlayerExp:SetValue(UnitXP("player")) |
PlayerExp.text:SetText(UnitXP("player").."/"..UnitXPMax("player")) |
end |
if event == "PLAYER_ENTERING_WORLD" then |
PlayerExp:SetValue(UnitXP("player")) |
PlayerExp.text:SetText(UnitXP("player").."/"..UnitXPMax("player")) |
end |
if Position then |
PlayerExp:ClearAllPoints() |
PlayerExp:SetPoint(unpack(Position)) |
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") |
|
PlayerExp:SetScript("OnMouseDown", function() PlayerExp:StartMoving() end) |
PlayerExp:SetScript("OnMouseUp", function() PlayerExp:StopMovingOrSizing() Position = { PlayerExp:GetPoint() } end) |
PlayerExp:SetScript("OnEnter", tooltipset) |
PlayerExp:SetScript("OnLeave", tooltipleave) |
PlayerExp:EnableMouse(true) |
PlayerExp:SetMovable(true) |
PlayerExp:RegisterEvent("PLAYER_XP_UPDATE") |
PlayerExp:RegisterEvent("PLAYER_ENTERING_WORLD") |
PlayerExp:RegisterEvent("VARIABLES_LOADED") |
end |
--config |
|
|
ShadowExperience_OnLoad() |