A Molten Giant
Join Date: Dec 2009
Posts: 784
|
Guess it should be something like this then?
Lua Code:
if AftermathhUI.plugins.repbar == false then return end local Reputation = CreateFrame("Frame", nil, UIParent) local ReputationBar = CreateFrame('StatusBar', nil, UIParent) local InvisFrame = CreateFrame("Frame", nil, ReputationBar) InvisFrame:SetFrameStrata("HIGH") InvisFrame:SetFrameLevel(5) InvisFrame:SetAllPoints() local ReputationBarFont = InvisFrame:CreateFontString(nil, 'OVERLAY') 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: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), 1, 1, 1, 1, 1, 1) 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 local function UpdateRep() if GetWatchedFactionInfo() then local Name, ID, Min, Max, Value = GetWatchedFactionInfo() ReputationBar:SetMinMaxValues(Min, Max) ReputationBar:SetValue(Value) ReputationBarFont:SetFormattedText("%d / %d - %s", Min, Max, Name) local FactionColors = FACTION_BAR_COLORS[ID] ReputationBar:SetStatusBarColor(FactionColors.r, FactionColors.g, FactionColors.b) end end Reputation:RegisterEvent("UPDATE_FACTION") Reputation:RegisterEvent("PLAYER_ENTERING_WORLD") Reputation:SetScript("OnEvent", UpdateRep)
or
Lua Code:
if AftermathhUI.plugins.repbar == false then return end local Reputation = CreateFrame("Frame", nil, UIParent) local ReputationBar = CreateFrame('StatusBar', nil, UIParent) local InvisFrame = CreateFrame("Frame", nil, ReputationBar) InvisFrame:SetFrameStrata("HIGH") InvisFrame:SetFrameLevel(5) InvisFrame:SetAllPoints() local ReputationBarFont = InvisFrame:CreateFontString(nil, 'OVERLAY') 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: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), 1, 1, 1, 1, 1, 1) 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 local function UpdateRep() if (not GetWatchedFactionInfo()) then return end local Name, ID, Min, Max, Value = GetWatchedFactionInfo() ReputationBar:SetMinMaxValues(Min, Max) ReputationBar:SetValue(Value) ReputationBarFont:SetFormattedText("%d / %d - %s", Min, Max, Name) local FactionColors = FACTION_BAR_COLORS[ID] ReputationBar:SetStatusBarColor(FactionColors.r, FactionColors.g, FactionColors.b) end Reputation:RegisterEvent("UPDATE_FACTION") Reputation:RegisterEvent("PLAYER_ENTERING_WORLD") Reputation:SetScript("OnEvent", UpdateRep)
Last edited by Aftermathhqt : 11-21-14 at 03:02 PM.
|