Quantcast

skin tc2

Ou Junhui [10-04-21 - 12:58]
skin tc2
Filename
rSkin/init.lua
rSkin/modules/ThreatClassic2.lua
rSkin/rSkin.toc
diff --git a/rSkin/init.lua b/rSkin/init.lua
index b81e7eb..794e5e7 100644
--- a/rSkin/init.lua
+++ b/rSkin/init.lua
@@ -44,6 +44,7 @@ local defaults = {
 		details = true,
 		weakauras = true,
 		lstoasts = true,
+		threatclassic2 = true,
 	}
 }

diff --git a/rSkin/modules/ThreatClassic2.lua b/rSkin/modules/ThreatClassic2.lua
new file mode 100644
index 0000000..3fd5cfe
--- /dev/null
+++ b/rSkin/modules/ThreatClassic2.lua
@@ -0,0 +1,75 @@
+local A, L = ...
+
+local thin = L.C.thin
+
+local function ReskinStatusBar(self)
+	self:SetBackdrop(nil)
+	self.SetBackdrop = L.Dummy
+
+	local backdrop = self.edgeBackdrop or self.backdrop
+	if backdrop then
+		backdrop:SetBackdrop(nil)
+		backdrop.SetBackdrop = L.Dummy
+	end
+
+    L.CreateBackdrop(self, nil, thin)
+end
+
+local function SkinThreatClassic2()
+	if not IsAddOnLoaded("ThreatClassic2") then return end
+
+    local frame = _G.ThreatClassic2BarFrame
+    if not frame then return end
+
+    frame:SetScale(L.C.scale)
+
+    local frameBg = frame.bg
+    if frameBg then
+        frameBg:SetColorTexture(0, 0, 0, 0)
+        frameBg:SetVertexColor(0, 0, 0, 0)
+        frameBg.SetVertexColor = L.Dummy
+    end
+
+    local header = frame.header
+    if header then
+        ReskinStatusBar(header)
+        header:SetStatusBarColor(0, 0, 0, 0)
+        header.SetStatusBarColor = L.Dummy
+        header.text:SetPoint("LEFT", header, 4, 0)
+    end
+
+    for _, child in pairs {frame:GetChildren()} do
+        if child:GetObjectType() == "StatusBar" and child.bg and child.val then
+            ReskinStatusBar(child)
+            child.bg:SetVertexColor(0, 0, 0, 0)
+            child.bg.SetVertexColor = L.Dummy
+        end
+    end
+
+    if rSkinDB.resets.threatclassic2 then
+        ThreatClassic2DB = ThreatClassic2DB or {}
+        ThreatClassic2DB["profiles"] = ThreatClassic2DB["profiles"] or {}
+        ThreatClassic2DB["profiles"]["Default"] = ThreatClassic2DB["profiles"]["Default"] or {}
+
+        local profile = ThreatClassic2DB["profiles"]["Default"]
+        if profile then
+            local barCfg = L.C.bar
+            local w, h = unpack(barCfg.small)
+            profile.bar = profile.bar or {}
+            profile.bar.texture = profile.bar.texture or "normTex"
+            profile.bar.padding = barCfg.space.small
+            profile.bar.count = 5
+            profile.bar.height = h + 1
+            profile.frame = profile.frame or {}
+            profile.frame.scale = L.C.scale
+			profile.frame.width = w
+            profile.frame.height = (h+profile.bar.padding)*profile.bar.count
+            profile.frame.headerShow = false
+            profile.frame.locked = true
+            profile.frame.position = {"BOTTOMRIGHT", nil, "BOTTOMRIGHT", -20-w , 54}
+        end
+        rSkinDB.resets.threatclassic2 = false
+    end
+end
+
+rSkin:RegisterSkin("ThreatClassic2", SkinThreatClassic2)
\ No newline at end of file
diff --git a/rSkin/rSkin.toc b/rSkin/rSkin.toc
index 0a409ae..87b9a77 100644
--- a/rSkin/rSkin.toc
+++ b/rSkin/rSkin.toc
@@ -3,7 +3,7 @@
 ## Title: rSkin |cff1a9fc0BCC|r
 ## Notes: Reskin other addons to fit zorkui's L&F
 ## RequiredDeps: rLib, rButtonTemplate_Zork, oUF_SimpleConfig
-## OptionalDeps: DBM-Core, WeakAuras, ls_Toasts, Details, BigWigs_Plugins
+## OptionalDeps: DBM-Core, WeakAuras, ls_Toasts, Details, BigWigs_Plugins, ThreatClassic2
 ## SavedVariablesPerCharacter: rSkinDB

 init.lua
@@ -11,4 +11,5 @@ modules\ls_Toasts.lua
 modules\Details.lua
 modules\BigWigs.lua
 modules\DBM.lua
-modules\WeakAuras.lua
\ No newline at end of file
+modules\WeakAuras.lua
+modules\ThreatClassic2.lua
\ No newline at end of file