end |
|
--exp bars |
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:SetScript("OnEvent", function(self, event, ...) |
|
PlayerExpT = CreateFrame("StatusBar", "ShadowPlayerExperience", PlayerFrame); |
PlayerExpT:SetWidth(130); |
PlayerExpT:SetHeight(15); |
PlayerExpT:SetPoint("CENTER",45,-20) |
PlayerExpT:SetOrientation("HORIZONTAL"); |
PlayerExpT:SetBackdropColor(0, 0, 0, 1); |
PlayerExpT:EnableMouse(true) |
PlayerExpT:SetScript("OnEnter", tooltipset) |
PlayerExpT:SetScript("OnLeave", tooltipleave) |
PlayerExpT: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")) |
PlayerExpT:SetValue(UnitXP("player")) |
PlayerExpT.text:SetText(UnitXP("player").."/"..UnitXPMax("player")) |
|
local retVal = GetXPExhaustion() |
if retVal == false then |
PlayerExpT:SetStatusBarTexture("Interface\\AddOns\\ShadowExperience\\text\\NonRested.tga"); |
else |
PlayerExpT:SetStatusBarTexture("Interface\\AddOns\\ShadowExperience\\text\\Rested.tga"); |
end |
end |
if event == "PLAYER_ENTERING_WORLD" then |
local retVal = GetXPExhaustion() |
|
PlayerExp.text:SetText(UnitXP("player").."/"..UnitXPMax("player")) |
PlayerExp:SetMinMaxValues(1,UnitXPMax("player")); |
PlayerExp:SetValue(UnitXP("player")) |
PlayerExpT.text:SetText(UnitXP("player").."/"..UnitXPMax("player")) |
PlayerExpT:SetMinMaxValues(1,UnitXPMax("player")); |
PlayerExpT:SetValue(UnitXP("player")) |
if retVal == false then |
PlayerExp:SetStatusBarColor(68, 0, 68, 1); |
PlayerExpT:SetStatusBarTexture("Interface\\AddOns\\ShadowExperience\\text\\NonRested.tga"); |
else |
PlayerExp:SetStatusBarColor(0,0,1,1); |
PlayerExpT:SetStatusBarTexture("Interface\\AddOns\\ShadowExperience\\text\\Rested.tga"); |
end |
end |
if Position then |
PlayerExp:ClearAllPoints() |
PlayerExp:SetPoint(unpack(Position)) |
end |
end) |
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 |
end) |
|
PlayerExpT:RegisterEvent("PLAYER_XP_UPDATE") |
PlayerExpT:RegisterEvent("PLAYER_ENTERING_WORLD") |
|
PlayerExpT.text = PlayerExpT:CreateFontString(nil, "OVERLAY", "GameFontNormal") |
PlayerExpT.text:SetPoint("CENTER") |
PlayerExpT.text:SetText("FUC") |
|
PlayerExpParent = CreateFrame("Frame", "PlayerExpParent", PlayerFrame) |
PlayerExpParent:SetPoint("BOTTOM",50,-65) |
PlayerExpParent:SetWidth(150) |
PlayerExpParent:SetHeight(100) |
PlayerExpParent:SetBackdrop(nil or {bgFile = "Interface\\AddOns\\ShadowExperience\\text\\BottomPlayerFrame.tga", edgeFile = "nil", tile = false, tileSize = 0, edgeSize = 32, insets = { left = 0, right = 0, top = 0, bottom = 0 }}) |
--config |
|
|