A Molten Giant
Join Date: Dec 2009
Posts: 784
|
Made a repbar too if anyone want to use them you're welcome to do so
REP BAR:
Lua Code:
local Reputation = CreateFrame("Frame", nil, UIParent) local ReputationBar = CreateFrame('StatusBar', nil, UIParent) local InvisFrame = CreateFrame("Frame", nil, ExperienceBar) InvisFrame:SetFrameStrata("HIGH") InvisFrame:SetFrameLevel(5) InvisFrame:SetAllPoints() local ReputationBarFont = InvisFrame:CreateFontString(nil, 'OVERLAY') local function UpdateRep() local Name, ID, Min, Max, Value = GetWatchedFactionInfo() ReputationBar:SetMinMaxValues(Min, Max) ReputationBar:SetValue(Value) ReputationBar:SetStatusBarColor(FACTION_BAR_COLORS[ID].r, FACTION_BAR_COLORS[ID].g, FACTION_BAR_COLORS[ID].b) ReputationBarFont:SetText(""..Min.." / "..Max.." - "..Name.."") end ReputationBar:SetPoint('LEFT', oUF_AftermathhPlayer, 223, -178) ReputationBar:SetStatusBarTexture(AftermathhUI.media.texture) ReputationBar:SetSize(235, 20) ReputationBar:SetBackdrop({ bgFile = AftermathhUI.media.blank, insets = {top = -1, left = -1, bottom = -1, right = -1}, }) ReputationBar:SetBackdropColor(unpack(AftermathhUI.media.backdropcolor)) CreateBorderLight(ReputationBar, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 3) ReputationBar:EnableMouse() ReputationBar:SetScript("OnEnter", function(self) if (not GetWatchedFactionInfo()) then return end local Name, ID, Min, Max, Value = GetWatchedFactionInfo() GameTooltip:SetOwner(self, "ANCHOR_CURSOR") GameTooltip:AddLine(string.format("%s (%s)", Name, _G["FACTION_STANDING_LABEL" .. ID])) GameTooltip:AddLine(string.format("%d / %d (%d%%)", Value - Min, Max - Min, (Value - Min) / (Max - Min) * 100)) GameTooltip:Show() GameTooltip:Show() end) ReputationBar:SetScript("OnLeave", function() if GameTooltip:IsShown() then GameTooltip:Hide() end end) ReputationBar:SetAlpha(0) ReputationBar:HookScript("OnEnter", function(self) UIFrameFadeIn(self, 1.2, self:GetAlpha(), 1) end) ReputationBar:HookScript("OnLeave", function(self) UIFrameFadeIn(self, 0.8, self:GetAlpha(), 0) end) ReputationBarFont:SetPoint('CENTER', ReputationBar) ReputationBarFont:SetFont(AftermathhUI.media.font, 12, AftermathhUI.media.fontflag) if AftermathhUI.media.shadowoffset == true then ReputationBarFont:SetShadowOffset(1, -1) ReputationBarFont:SetShadowColor(0,0,0) end Reputation:RegisterEvent("UPDATE_FACTION") Reputation:RegisterEvent("PLAYER_ENTERING_WORLD") Reputation:SetScript("OnEvent", UpdateRep)
EXP BAR:
Lua Code:
if AftermathhUI.plugins.expbar == false then return end local Current, Max = UnitXP("player"), UnitXPMax("player") local Rested = GetXPExhaustion() local IsRested = GetRestState() local Experience = CreateFrame("Frame", nil, UIParent) local ExperienceBar = CreateFrame('StatusBar', nil, UIParent) local ExperienceBarRested = CreateFrame('StatusBar', nil, UIParent) local InvisFrame = CreateFrame("Frame", nil, ExperienceBar) InvisFrame:SetFrameStrata("HIGH") InvisFrame:SetFrameLevel(5) InvisFrame:SetAllPoints() local ExperienceFont = InvisFrame:CreateFontString(nil, 'OVERLAY') local function UpdateExp() local Current, Max = UnitXP("player"), UnitXPMax("player") local Rested = GetXPExhaustion() local IsRested = GetRestState() ExperienceBar:SetMinMaxValues(0, Max) ExperienceBar:SetValue(Current) if (IsRested == 1 and Rested) then ExperienceBarRested:SetMinMaxValues(0, Max) ExperienceBarRested:SetValue(Rested + Current) ExperienceBarRested:SetSize(230, 18) ExperienceBarRested:SetAlpha(0.5) ExperienceBarRested:SetParent(ExperienceBar) ExperienceBarRested:SetAllPoints(ExperienceBar) ExperienceBarRested:SetStatusBarTexture(AftermathhUI.media.texture) ExperienceBarRested:SetStatusBarColor(0, 144/255, 1) ExperienceFont:SetText(""..Current.." / "..Max.." ("..Rested..")") else ExperienceBar:SetValue(0) ExperienceFont:SetText(""..Current.." / "..Max.."") end end ExperienceBar:SetFrameLevel(5) ExperienceBar:SetPoint('LEFT', oUF_AftermathhPlayer, 223, -178) ExperienceBar:SetStatusBarTexture(AftermathhUI.media.texture) ExperienceBar:SetSize(235, 20) ExperienceBar:SetStatusBarColor(0.6, 0, 0.6) ExperienceBar:SetBackdrop({ bgFile = AftermathhUI.media.blank, insets = {top = -1, left = -1, bottom = -1, right = -1}, }) ExperienceBar:SetBackdropColor(unpack(AftermathhUI.media.backdropcolor)) CreateBorderLight(ExperienceBar, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 3) ExperienceBar:EnableMouse() ExperienceBar:SetScript("OnEnter", function(self) local Current, Max = UnitXP("player"), UnitXPMax("player") local Rested = GetXPExhaustion() local IsRested = GetRestState() GameTooltip:SetOwner(self, "ANCHOR_CURSOR") GameTooltip:AddLine("|cffffd200Experience|r") GameTooltip:AddDoubleLine("Current Exp", Current, 1, 1, 1, 1, 1, 1) GameTooltip:AddDoubleLine("Remaining Exp", Max - Current, 1, 1, 1, 1, 1, 1) if Rested == nil then GameTooltip:AddDoubleLine("Rested Exp", "0", 1, 1, 1, 1, 1, 1) else GameTooltip:AddDoubleLine("Rested Exp", Rested, 1, 1, 1, 1, 1, 1) end GameTooltip:Show() end) ExperienceBar:SetScript("OnLeave", function() if GameTooltip:IsShown() then GameTooltip:Hide() end end) ExperienceBar:SetAlpha(0) ExperienceBar:HookScript("OnEnter", function(self) UIFrameFadeIn(self, 1.2, self:GetAlpha(), 1) end) ExperienceBar:HookScript("OnLeave", function(self) UIFrameFadeIn(self, 0.8, self:GetAlpha(), 0) end) ExperienceFont:SetPoint('CENTER', ExperienceBar) ExperienceFont:SetFont(AftermathhUI.media.font, 12, AftermathhUI.media.fontflag) if AftermathhUI.media.shadowoffset == true then ExperienceFont:SetShadowOffset(1, -1) ExperienceFont:SetShadowColor(0,0,0) end Experience:RegisterEvent("PLAYER_XP_UPDATE") Experience:RegisterEvent("PLAYER_LEVEL_UP") Experience:RegisterEvent("UPDATE_EXHAUSTION") Experience:RegisterEvent("PLAYER_ENTERING_WORLD") Experience:RegisterEvent("PLAYER_UPDATE_RESTING") Experience:SetScript("OnEvent", UpdateExp)
|