Quantcast

reskin details addon

rawoil [09-26-21 - 06:36]
reskin details addon
Filename
rSkin/init.lua
rSkin/modules/BigWigs.lua
rSkin/modules/Details.lua
rSkin/rSkin.toc
diff --git a/rSkin/init.lua b/rSkin/init.lua
index 134034f..da754ca 100644
--- a/rSkin/init.lua
+++ b/rSkin/init.lua
@@ -70,7 +70,7 @@ function rSkin:RegisterSkin(name, func)
 end

 function rSkin:OnLogin()
-    print("|cffffa6c9"..A.."|r loaded.")
+    print("|cffffa6c9"..A.." loaded.|r")
     for name, func in next, self.skins do
 		if name and type(func) == "function" then
 			local _, catch = pcall(func)
diff --git a/rSkin/modules/BigWigs.lua b/rSkin/modules/BigWigs.lua
new file mode 100644
index 0000000..4be539e
--- /dev/null
+++ b/rSkin/modules/BigWigs.lua
@@ -0,0 +1 @@
+local A, L = ...
\ No newline at end of file
diff --git a/rSkin/modules/Details.lua b/rSkin/modules/Details.lua
new file mode 100644
index 0000000..dc64013
--- /dev/null
+++ b/rSkin/modules/Details.lua
@@ -0,0 +1,105 @@
+local A, L = ...
+
+local function SetupInstance(instance)
+    if instance.styled then return end
+    if not instance.baseframe then return end
+
+    instance:ChangeSkin("Minimalistic")
+    instance:InstanceWallpaper(false)
+    instance:DesaturateMenu(true)
+	instance:SetAutoHideMenu(true)
+    instance:HideMainIcon(true)
+    instance:SetBackdropTexture("Details Ground")
+	instance:SetBackgroundAlpha(0)
+	instance:InstanceColor(0, 0, 0, 0)
+	instance:SetBarFollowPlayer(true)
+    -- instance:MenuAnchor(16, 3)
+    -- instance:ToolbarMenuButtonsSize(1)
+    instance:AttributeMenu(false)
+	instance:SetBarSettings(
+		20,						-- bar height
+		"Blizzard Raid Bar",	-- bar texture name of medialib
+		true,					-- use class color
+		{0, 0, 0, 0},			-- fixed color
+		"Solid",				-- bg texture name of medialib
+		false, 					-- bg use class color
+		{0.23, 0.23, 0.23, 1},	-- fixed bg color
+		0,						-- alpha
+		"",						-- icon file
+		true,					-- start after icon
+		3,						-- bar space
+		""						-- custom texture file, u can use oUF_SimpleConfig.textures.statusbar or "" as default
+	)
+
+	instance:SetBarBackdropSettings(true, 1, {0,0,0,1}, "1 Pixel")
+	instance:SetBarTextSettings(12, "Expressway", {1,1,1,1}, false, false, true, true)
+	instance:SetBarSpecIconSettings(false)
+	-- instance:SetBarRightTextSettings(false, true, false, "NONE")  -- just "dps/hps" no total and percent
+
+    instance.styled = true
+end
+
+local function EmbedWindow(instance, x, y, width, height)
+	if not instance.baseframe then return end
+	instance.baseframe:ClearAllPoints()
+	instance.baseframe:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", x, y)
+	instance:SetSize(width, height)
+	instance:SaveMainWindowPosition()
+	instance:RestoreMainWindowPosition()
+	instance:LockInstance(true)
+end
+
+local function Details()
+	if not IsAddOnLoaded("Details") then return end
+
+    local Details = _G.Details
+	-- instance table can be nil sometimes
+	Details.tabela_instancias = Details.tabela_instancias or {}
+	Details.instances_amount = Details.instances_amount or 5
+	-- toggle windows on init
+	Details:ReabrirTodasInstancias()
+	-- disable group
+	Details.disable_lock_ungroup_buttons = false
+
+	local index = 1
+	local instance = Details:GetInstance(index)
+	while instance do
+		SetupInstance(instance)
+		index = index + 1
+		instance = Details:GetInstance(index)
+	end
+
+	-- Reanchor
+	local instance1 = Details:GetInstance(1)
+	local instance2 = Details:GetInstance(2)
+
+	local height = 124
+	local width = 150
+	if instance1 then
+		EmbedWindow(instance1, -10, 50, width, height)
+		if instance2 then
+			EmbedWindow(instance2, -15-width, 50, width, height)
+		end
+	end
+
+	local listener = Details:CreateEventListener()
+	listener:RegisterEvent("DETAILS_INSTANCE_OPEN")
+	function listener:OnDetailsEvent(event, instance)
+		if event == "DETAILS_INSTANCE_OPEN" then
+			if not instance.styled and instance:GetId() == 2 then
+				instance:SetSize(width, height)
+				EmbedWindow(instance, -15-width, 50, width, height)
+			end
+			SetupInstance(instance)
+		end
+	end
+
+	Details.OpenWelcomeWindow = function()
+		if instance1 then
+			EmbedWindow(instance1, -10, 50, width, height)
+			SetupInstance(instance1)
+		end
+	end
+end
+
+rSkin:RegisterSkin("Details", Details)
\ No newline at end of file
diff --git a/rSkin/rSkin.toc b/rSkin/rSkin.toc
index eb26403..5caf73a 100644
--- a/rSkin/rSkin.toc
+++ b/rSkin/rSkin.toc
@@ -3,9 +3,9 @@
 ## Title: rSkin |cff1a9fc0BCC|r
 ## Notes: Reskin other addons to fit zorkui's L&F
 ## RequiredDeps: rLib, rButtonTemplate_Zork, oUF_SimpleConfig
-## OptionalDeps: MerInspect, ThreatClassic2, DBM, WeakAuras, ls_Toasts
+## OptionalDeps: DBM, WeakAuras, ls_Toasts, Details, BigWigs

 init.lua
 modules\ls_Toasts.lua
-##modules\MerInspect.lua
-##modules\ThreatClassic2.lua
\ No newline at end of file
+modules\Details.lua
+modules\BigWigs.lua
\ No newline at end of file