WoWInterface SVN ZoneLevel

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /ShadowExperience
    from Rev 19 to Rev 20
    Reverse comparison

Rev 19 → Rev 20

Core.lua
11,13 → 11,14
ShadowEOptions = {
 
PetScale = 1;
PetHeight = 12;
PetHeight = 8;
PetWidth = 22;
PlayerScale = 1;
PlayerHeight = 12;
PlayerWidth = 120;
PlayerTipAnchor = "CURSOR";
 
 
locked = false;
 
 
28,22 → 29,29
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.")
 
DEFAULT_CHAT_FRAME:AddMessage("ShadowExperience loaded. Please do /shadow for more.")
Shadow_CreateBar();
end
 
function tooltipset()
local ToGoLeft = floor(UnitXP("player")-UnitXPMax("player"))
local Perfect = floor(UnitXP("player")*100/UnitXPMax("player"))
local h = UnitXP("player")
local b = UnitXPMax("player")
local c = floor(h*100/b)
local ToGoLeft = floor(b-h)
txt = c.."%"
txt1 = ToGoLeft.." left to level"
 
GameTooltip:SetOwner("ShadowPlayerExperience", ShadowEOptions.PlayerTipAnchor)
GameTooltip:SetOwner(PlayerExp, ShadowEOptions.PlayerTipAnchor)
GameTooltip:SetText(UnitName("Player"))
GameTooltip:AddLine(UnitLevel("player"))
GameTooltip:AddLine("Level "..UnitLevel("player"))
GameTooltip:AddLine(UnitXP("player").."/"..UnitXPMax("player"))
GameTooltip:AddLine(Perfect"%")
GameTooltip:AddLine(ToGoLeft.." to go.")
GameTooltip:AddLine(txt)
GameTooltip:AddLine(txt1)
 
 
GameTooltip:Show()
end
 
52,26 → 60,40
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()
\ No newline at end of file
ShadowExperience.toc
6,6 → 6,6
## eMail: soulofsin007@gmail.com
## DefaultState: Enabled
## LoadOnDemand: 0
## SavedVariablesPerCharacter: ShadowEOptions
## SavedVariablesPerCharacter: ShadowEOptions,Position
Core.lua
locales.lua