Skip to content

Commit

Permalink
Recount skin changed. It looks awesome imo. (credit: Tukz)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asphyxia committed Sep 28, 2011
1 parent 7fa233b commit d16d49a
Showing 1 changed file with 105 additions and 51 deletions.
156 changes: 105 additions & 51 deletions Tukui/modules/addonskins/Recount.lua
Original file line number Diff line number Diff line change
@@ -1,55 +1,47 @@
--[[
Recount Skin by Darth Android / Telroth - Black Dragonflight
Skins Recount to look like TelUI.
Todo:
+ Reorganize to support skin subclass overrides
+ Reorganize to support layout subclass overrides
+ Skin "Reset Data" windows
(C)2010 Darth Android / Telroth - Black Dragonflight
File version v15.37
]]
local T, C, L = unpack(select(2, ...)) -- Import Functions/Constants, Config, Locales


if not IsAddOnLoaded("Recount") or not C.Addon_Skins.Recount then return end

--[[ Credit Tukz ]]--
local T, C, L = unpack(Tukui)
local Recount = _G.Recount

local function SkinFrame(frame)
frame.bgMain = CreateFrame("Frame", nil, frame)
frame.bgMain:SetTemplate("Default")
frame.bgMain:SetTemplate("Transparent")
frame.bgMain:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT")
frame.bgMain:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT")
frame.bgMain:SetPoint("TOP", frame, "TOP", 0, -7)
frame.bgMain:SetFrameLevel(frame:GetFrameLevel())
frame.CloseButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -1, -9)
frame:SetBackdrop(nil)
frame.Title:SetFont(C.media.pixelfont, C["datatext"].fontsize +1, "MONOCHROMEOUTLINE")
frame.TitleBackground = CreateFrame("Frame", nil, frame.bgMain)
frame.TitleBackground:SetPoint("TOP", 0)
frame.TitleBackground:SetPoint("LEFT", 0)
frame.TitleBackground:SetPoint("RIGHT", 0)
frame.TitleBackground:SetHeight(24)
frame.TitleBackground:SetTemplate("Transparent")
frame.Title:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
frame.Title:SetParent(frame.TitleBackground)
frame.Title:ClearAllPoints()
frame.Title:SetPoint("LEFT", 4, 0)
frame.CloseButton:SetNormalTexture("")
frame.CloseButton:SetPushedTexture("")
frame.CloseButton:SetHighlightTexture("")
frame.CloseButton.t = frame.CloseButton:CreateFontString(nil, "OVERLAY")
frame.CloseButton.t:SetFont(C.media.pixelfont, C["datatext"].fontsize +1, "MONOCHROMEOUTLINE")
frame.CloseButton.t:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
frame.CloseButton.t:SetPoint("CENTER", 0, 1)
frame.CloseButton.t:SetText(T.datacolor.."X")
frame.CloseButton:SetScript("OnEnter", function() frame.CloseButton.t:SetText(T.datacolor.."X") end)
frame.CloseButton:SetScript("OnLeave", function() frame.CloseButton.t:SetText(T.datacolor.."X") end)
end

Recount.UpdateBarTextures = function(self)
for k, v in pairs(Recount.MainWindow.Rows) do
v.StatusBar:SetStatusBarTexture(C["media"].normTex)
v.StatusBar:GetStatusBarTexture():SetHorizTile(false)
v.StatusBar:GetStatusBarTexture():SetVertTile(false)
v.LeftText:SetPoint("LEFT", 4, 1)
v.LeftText:SetFont(C.media.pixelfont, C["datatext"].fontsize +1, "MONOCHROMEOUTLINE")
v.RightText:SetPoint("RIGHT", -4, 1)
v.RightText:SetFont(C.media.pixelfont, C["datatext"].fontsize +1, "MONOCHROMEOUTLINE")
end
for k, v in pairs(Recount.MainWindow.Rows) do
v.StatusBar:SetStatusBarTexture(C["media"].normTex)
v.StatusBar:GetStatusBarTexture():SetHorizTile(false)
v.StatusBar:GetStatusBarTexture():SetVertTile(false)
v.LeftText:SetPoint("LEFT", 4, 1)
v.LeftText:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
v.RightText:SetPoint("RIGHT", -4, 1)
v.RightText:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
end
Recount.SetBarTextures = Recount.UpdateBarTextures
end
Recount.SetBarTextures = Recount.UpdateBarTextures

-- Fix bar textures as they're created
Recount.SetupBar_ = Recount.SetupBar
Expand All @@ -66,25 +58,87 @@ Recount.CreateFrame = function(self, Name, Title, Height, Width, ShowFunc, HideF
return frame
end

-- Skin existing frames
if Recount.MainWindow then SkinFrame(Recount.MainWindow) end
if Recount.ConfigWindow then SkinFrame(Recount.ConfigWindow) end
if Recount.GraphWindow then SkinFrame(Recount.GraphWindow) end
if Recount.DetailWindow then SkinFrame(Recount.DetailWindow) end
if Recount.ResetFrame then SkinFrame(Recount.ResetFrame) end
if _G["Recount_Realtime_!RAID_DAMAGE"] then SkinFrame(_G["Recount_Realtime_!RAID_DAMAGE"].Window) end
if _G["Recount_Realtime_!RAID_HEALING"] then SkinFrame(_G["Recount_Realtime_!RAID_HEALING"].Window) end
if _G["Recount_Realtime_!RAID_HEALINGTAKEN"] then SkinFrame(_G["Recount_Realtime_!RAID_HEALINGTAKEN"].Window) end
if _G["Recount_Realtime_!RAID_DAMAGETAKEN"] then SkinFrame(_G["Recount_Realtime_!RAID_DAMAGETAKEN"].Window) end
if _G["Recount_Realtime_Bandwidth Available_AVAILABLE_BANDWIDTH"] then SkinFrame(_G["Recount_Realtime_Bandwidth Available_AVAILABLE_BANDWIDTH"].Window) end
if _G["Recount_Realtime_FPS_FPS"] then SkinFrame(_G["Recount_Realtime_FPS_FPS"].Window) end
if _G["Recount_Realtime_Latency_LAG"] then SkinFrame(_G["Recount_Realtime_Latency_LAG"].Window) end
if _G["Recount_Realtime_Downstream Traffic_DOWN_TRAFFIC"] then SkinFrame(_G["Recount_Realtime_Downstream Traffic_DOWN_TRAFFIC"].Window) end
if _G["Recount_Realtime_Upstream Traffic_UP_TRAFFIC"] then SkinFrame(_G["Recount_Realtime_Upstream Traffic_UP_TRAFFIC"].Window) end
-- frame we want to skins
local elements = {
Recount.MainWindow,
Recount.ConfigWindow,
Recount.GraphWindow,
Recount.DetailWindow,
Recount.ResetFrame,
}

-- skin them
for i = 1, getn(elements) do
local frame = elements[i]
if frame then
SkinFrame(frame)
end
end

--Update Textures
Recount:UpdateBarTextures()

-- skin dropdown
Recount.MainWindow.FileButton:HookScript("OnClick", function(self) if LibDropdownFrame0 then LibDropdownFrame0:SetTemplate() end end)

-- reskin button
Recount.MainWindow.RightButton:SetTemplate("Transparent")
Recount.MainWindow.RightButton:SetNormalTexture("")
Recount.MainWindow.RightButton:SetPushedTexture("")
Recount.MainWindow.RightButton:SetHighlightTexture("")
Recount.MainWindow.RightButton:SetSize(16, 16)
Recount.MainWindow.RightButton:FontString("text", C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
Recount.MainWindow.RightButton.text:SetText(T.datacolor..">")
Recount.MainWindow.RightButton.text:SetPoint("CENTER", 1, 1)
Recount.MainWindow.RightButton:ClearAllPoints()
Recount.MainWindow.RightButton:SetPoint("RIGHT", Recount.MainWindow.CloseButton, "LEFT", -2, 0)

Recount.MainWindow.LeftButton:SetTemplate("Transparent")
Recount.MainWindow.LeftButton:SetNormalTexture("")
Recount.MainWindow.LeftButton:SetPushedTexture("")
Recount.MainWindow.LeftButton:SetHighlightTexture("")
Recount.MainWindow.LeftButton:SetSize(16, 16)
Recount.MainWindow.LeftButton:FontString("text", C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
Recount.MainWindow.LeftButton.text:SetText(T.datacolor.."<")
Recount.MainWindow.LeftButton.text:SetPoint("CENTER", 1, 1)
Recount.MainWindow.LeftButton:SetPoint("RIGHT", Recount.MainWindow.RightButton, "LEFT", -2, 0)

Recount.MainWindow.ResetButton:SetTemplate("Transparent")
Recount.MainWindow.ResetButton:SetNormalTexture("")
Recount.MainWindow.ResetButton:SetPushedTexture("")
Recount.MainWindow.ResetButton:SetHighlightTexture("")
Recount.MainWindow.ResetButton:FontString("text", C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
Recount.MainWindow.ResetButton.text:SetText(T.datacolor.."R")
Recount.MainWindow.ResetButton.text:SetPoint("CENTER", 1, 1)
Recount.MainWindow.ResetButton:SetPoint("RIGHT", Recount.MainWindow.LeftButton, "LEFT", -2, 0)

Recount.MainWindow.FileButton:SetTemplate("Transparent")
Recount.MainWindow.FileButton:SetNormalTexture("")
Recount.MainWindow.FileButton:SetPushedTexture("")
Recount.MainWindow.FileButton:SetHighlightTexture("")
Recount.MainWindow.FileButton:FontString("text", C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
Recount.MainWindow.FileButton.text:SetText(T.datacolor.."F")
Recount.MainWindow.FileButton.text:SetPoint("CENTER", 1, 1)
Recount.MainWindow.FileButton:SetPoint("RIGHT", Recount.MainWindow.ResetButton, "LEFT", -2, 0)

Recount.MainWindow.ConfigButton:SetTemplate("Transparent")
Recount.MainWindow.ConfigButton:SetNormalTexture("")
Recount.MainWindow.ConfigButton:SetPushedTexture("")
Recount.MainWindow.ConfigButton:SetHighlightTexture("")
Recount.MainWindow.ConfigButton:FontString("text", C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
Recount.MainWindow.ConfigButton.text:SetText(T.datacolor.."C")
Recount.MainWindow.ConfigButton.text:SetPoint("CENTER", 1, 1)
Recount.MainWindow.ConfigButton:SetPoint("RIGHT", Recount.MainWindow.FileButton, "LEFT", -2, 0)

Recount.MainWindow.ReportButton:SetTemplate("Transparent")
Recount.MainWindow.ReportButton:SetNormalTexture("")
Recount.MainWindow.ReportButton:SetPushedTexture("")
Recount.MainWindow.ReportButton:SetHighlightTexture("")
Recount.MainWindow.ReportButton:FontString("text", C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
Recount.MainWindow.ReportButton.text:SetText(T.datacolor.."S")
Recount.MainWindow.ReportButton.text:SetPoint("CENTER", 1, 1)
Recount.MainWindow.ReportButton:SetPoint("RIGHT", Recount.MainWindow.ConfigButton, "LEFT", -2, 0)

if C["Addon_Skins"].embedright == "Recount" then
local Recount_Skin = CreateFrame("Frame")
Recount_Skin:RegisterEvent("PLAYER_ENTERING_WORLD")
Expand All @@ -107,7 +161,7 @@ if C["Addon_Skins"].embedright == "Recount" then

button.tex = button:CreateTexture(nil, 'OVERLAY')
button.tex:SetTexture([[Interface\AddOns\Tukui\medias\textures\addons_toggle.tga]])
button.tex:Point('TOPRIGHT', -2, -2)
button.tex:Point('TOPRIGHT', -2, 0)
button.tex:Height(button:GetHeight() - 4)
button.tex:Width(16)

Expand All @@ -116,7 +170,7 @@ if C["Addon_Skins"].embedright == "Recount" then
button.text:SetTextColor(unpack(C["media"].datacolor))

button:SetScript('OnEnter', function(self) button.text:SetText(L.addons_toggle..' Recount') end)
button:SetScript('OnLeave', function(self) self.tex:Point('TOPRIGHT', -2, -2); button.text:SetText(nil) end)
button:SetScript('OnLeave', function(self) self.tex:Point('TOPRIGHT', -2, 0); button.text:SetText(nil) end)
button:SetScript('OnMouseDown', function(self) self.tex:Point('TOPRIGHT', -4, -4) end)
button:SetScript('OnMouseUp', function(self) self.tex:Point('TOPRIGHT', -2, -2) end)
button:SetScript('OnClick', function(self) ToggleFrame(Recount_MainWindow) end)
Expand All @@ -126,4 +180,4 @@ if C["Addon_Skins"].embedright == "Recount" then
TukuiChatBackgroundRight:HookScript("OnShow", function() Recount_MainWindow:Hide() end)
TukuiChatBackgroundRight:HookScript("OnHide", function() Recount_MainWindow:Show() end)
end
end
end

0 comments on commit d16d49a

Please sign in to comment.