Quantcast

Reskinned group frames, fixed a few bugs (http://www.tukui.org/forums/topic.php?id=18509#post-136009)

Safturento [12-10-11 - 17:08]
Reskinned group frames, fixed a few bugs (http://www.tukui.org/forums/topic.php?id=18509#post-136009)
Filename
SaftUI/SaftUI.toc
SaftUI/config/config.lua
SaftUI/core/functions.lua
SaftUI/frames/killframes.lua
SaftUI/frames/moveframes.lua
SaftUI/modules/unitframes/groups/core.lua
SaftUI/modules/unitframes/groups/dpsraid25.lua
SaftUI/modules/unitframes/groups/dpsraid40.lua
SaftUI/modules/unitframes/groups/general.lua
SaftUI/modules/unitframes/groups/healraid15.lua
SaftUI/modules/unitframes/groups/healraid40.lua
SaftUI/modules/unitframes/oUF.lua
SaftUI/modules/unitframes/stUnitFrames.xml
SaftUI/modules/unitframes/units/focus.lua
SaftUI/modules/unitframes/units/general.lua
SaftUI/modules/unitframes/units/player.lua
SaftUI/modules/unitframes/units/target.lua
SaftUI/modules/unitframes/units/targettarget.lua
diff --git a/SaftUI/SaftUI.toc b/SaftUI/SaftUI.toc
index b064328..32a2718 100644
--- a/SaftUI/SaftUI.toc
+++ b/SaftUI/SaftUI.toc
@@ -1,6 +1,6 @@
 ## Interface: 40300
 ## Author: Safturento
-## Version: 1.0.0
+## Version: 0.1
 ## Title: |cff00aaffSaftUI|r
 ## Notes: Saft's custom edit of Tukui
 ## RequiredDeps: Tukui
diff --git a/SaftUI/config/config.lua b/SaftUI/config/config.lua
index 433c6f2..6295887 100644
--- a/SaftUI/config/config.lua
+++ b/SaftUI/config/config.lua
@@ -18,14 +18,21 @@ C["classbar"] = {

 --UnitFrames To Show
 C.unitframes.Units = {
-	["player"] = 		{ enable = true, width = 239, height = 38 },
-	["target"] = 		{ enable = true, width = 239, height = 38 },
-	["pet"] = 			{ enable = true, width = 160, height = 15 },
-	["targettarget"] = 	{ enable = true, width = 160, height = 15 },
-	["focus"] = 		{ enable = true, width = 160, height = 15 },
-	["focustarget"] =	{ enable = true, width = 160, height = 15 },
-	["arena"] = 		{ enable = true, width = 239, height = 38 },
-	["boss"] = 			{ enable = true, width = 239, height = 38 },
+	["player"] 			= { enable = true, width = 239, height = 39 },
+	["target"] 			= { enable = true, width = 239, height = 39 },
+	["pet"]				= { enable = true, width = 160, height = 15 },
+	["targettarget"]	= { enable = true, width = 160, height = 15 },
+	["focus"]			= { enable = true, width = 160, height = 15 },
+	["focustarget"]		= { enable = true, width = 160, height = 15 },
+	["arena"]			= { enable = true, width = 239, height = 38 },
+	["boss"]			= { enable = true, width = 239, height = 38 },
+}
+
+C.unitframes.Groups = {
+	["TukuiRaidHealerGrid"]	= { width = 47, height = 35 },
+	["TukuiRaidHealer15"]	= { width = 239, height = 38 },
+	["TukuiRaid40"]			= { width = 120, height = 12 },
+	["TukuiRaid25"]			= { width = 120, height = 16 },
 }

 --StatusBar Config
diff --git a/SaftUI/core/functions.lua b/SaftUI/core/functions.lua
index 76d5b48..1f24111 100644
--- a/SaftUI/core/functions.lua
+++ b/SaftUI/core/functions.lua
@@ -107,10 +107,10 @@ function T.UpdateDetailColor(self)
 end

 function T.GetUnitConfig(unit)
-	local enabled = C.unitframes.Units[unit].enabled
+	local enable = C.unitframes.Units[unit].enable
 	local width = C.unitframes.Units[unit].width
 	local height = C.unitframes.Units[unit].height
-	return enabled, width, height
+	return enable, width, height
 end

 function T.ReverseBar(bar, unit, min, max, colorTable)
@@ -119,7 +119,7 @@ function T.ReverseBar(bar, unit, min, max, colorTable)
 	if UnitIsDead(unit) or UnitIsGhost(unit) then
 		bar:SetValue(max)
 	else
-		bar:SetValue((max-min))
+		bar:SetValue(max-min)
 	end
 	if not bar.fill then bar:CreateFiller() end
 	bar.fill:SetVertexColor(unpack(colorTable))
@@ -144,22 +144,70 @@ T.GetHealthColor = function(self, unit)
 	return r, g, b, a
 end
 T.PostUpdateHealth = function(self, unit, min, max)
+	local status = not UnitIsConnected(unit) and "DC" or UnitIsDead(unit) and "Dead" or UnitIsGhost(unit) and "Ghost"
 	if self.value then
-		self.value:SetFormattedText('%s', T.fmtVal(min))
-	end
-
-	if UnitIsDead(unit) or UnitIsGhost(unit) then
-		self:SetValue(0)
-		if self.value then
-			self.value:SetFormattedText("")
+		if status then
+			if status == "Dead" or "Ghost" then
+				self:SetValue(0)
+			end
+			self.value:SetText("<"..status..">")
+		elseif min == max then
+			self.value:SetText("")
+		else
+			local r, g, b = oUF.ColorGradient(min/max, 0.69, 0.31, 0.31, 0.65, 0.63, 0.35, 0.33, 0.59, 0.33)
+			self.value:SetFormattedText("|cff%02x%02x%02x%s|r", r*255, g*255, b*255, T.fmtVal(min))
 		end
 	end
-

 	self:SetStatusBarColor(T.GetHealthColor(self, unit))
 	T.ReverseBar(self, unit, min, max, {T.GetHealthColor(self, unit)})
 end

+
+function T.GetPowerColor(self, unit)
+	local r, g, b, a = 0, 0, 0, 1
+	if C.unitframes.unicolor then
+	end
+end
+T.PostUpdatePower = function(power, unit, min, max)
+	local self = power:GetParent()
+	local pType, pToken = UnitPowerType(unit)
+	local color
+	--Overwrite oUF colors with Tukui's colors for consistency
+	if power.colorTapping and UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then
+		color = T.UnitColor.tapped
+	elseif(power.colorDisconnected and not UnitIsConnected(unit)) then
+		color = T.UnitColor.disconnected
+	elseif power.colorPower then
+		color = pToken and T.UnitColor.power[pToken]
+	elseif(power.colorClass and UnitIsPlayer(unit)) or
+	(power.colorClassNPC and not UnitIsPlayer(unit)) or
+	(power.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then
+		local _, class = UnitClass(unit)
+		color = class and T.UnitColor.class[class]
+	elseif(power.colorReaction and UnitReaction(unit, 'player')) then
+		color = T.UnitColors.reaction[UnitReaction(unit, "player")]
+	end
+	if not color then color = {.05, .05, .05} end --Just incase none of these pass
+	local r, g, b = color[1], color[2], color[3]
+
+	if power.value then
+		power.value:SetTextColor(color[1], color[2], color[3])
+
+		if not UnitIsPlayer(unit) and not UnitPlayerControlled(unit) or not UnitIsConnected(unit) then
+			power.value:SetText("")
+		elseif UnitIsDead(unit) or UnitIsGhost(unit) then
+			power.value:SetText("")
+		elseif min == max then
+			power.value:SetText("")
+		else
+			power.value:SetText(T.fmtVal(min))
+		end
+	end
+
+	T.ReverseBar(power, unit, min, max, {r, g, b} )
+end
+
 function T.KillClassBars(self)
 	local toKill = {
 		self.CPoints,
diff --git a/SaftUI/frames/killframes.lua b/SaftUI/frames/killframes.lua
index 571b9c4..18bea70 100644
--- a/SaftUI/frames/killframes.lua
+++ b/SaftUI/frames/killframes.lua
@@ -16,6 +16,8 @@ local frames = {
 	TukuiTabsRightBackground,
 	TukuiMinimapStatsLeft,
 	TukuiMinimapStatsRight,
+	TukuiExitVehicleButtonRight,
+	TukuiInfoLeftBattleGround,
 }

 local datatext = {
diff --git a/SaftUI/frames/moveframes.lua b/SaftUI/frames/moveframes.lua
index 3a6405b..94ff959 100644
--- a/SaftUI/frames/moveframes.lua
+++ b/SaftUI/frames/moveframes.lua
@@ -1,9 +1,17 @@
 local T, C, L = unpack(Tukui)

 local frames = {
-	["TukuiRollAnchor"] = {"BOTTOM", TukuiChatBackgroundLeft, "TOP", 0, 5}
+	["TukuiRollAnchor"] = {"BOTTOM", TukuiChatBackgroundLeft or ChatFrame1, "TOP", 0, 5},
 }

+local function FixVehicleButton()
+	vehicleButton = TukuiExitVehicleButtonLeft
+	vehicleButton:ClearAllPoints()
+	vehicleButton:AllPoints(TukuiPlayer_Detail)
+	vehicleButton:SetFrameLevel(TukuiPlayer_Detail:GetFrameLevel()+1)
+	vehicleButton.text:SetFont(T.GetPixelFont())
+end
+
 local OnLoad = CreateFrame("Frame")
 OnLoad:RegisterEvent("PLAYER_ENTERING_WORLD")
 OnLoad:SetScript("OnEvent", function()
@@ -13,4 +21,8 @@ OnLoad:SetScript("OnEvent", function()
 			_G[frame]:SetPoint(unpack(point))
 		end
 	end
+
+	FixVehicleButton()
 end)
+
+
diff --git a/SaftUI/modules/unitframes/groups/core.lua b/SaftUI/modules/unitframes/groups/core.lua
new file mode 100644
index 0000000..878dcd0
--- /dev/null
+++ b/SaftUI/modules/unitframes/groups/core.lua
@@ -0,0 +1,134 @@
+-- raid editing guide by hydra/tukz
+
+local T, C, L = unpack(Tukui)
+
+--------------------------------------------------------------
+-- Edit Unit Raid Frames here!
+--------------------------------------------------------------
+-- 1 second delay before edited skin apply (can probably be a lower because 1 second is really too long, 0.1 or 0.2 should be the best, setting it to 1 was just for testing, CANNOT BE 0)
+local delay = 0.2
+T.groupframefuncs = {}
+
+local function EditUnitFrame(frame, header)
+
+	if T.groupframefuncs["general"] then
+		T.groupframefuncs["general"](frame)
+	end
+
+	if T.groupframefuncs[header:GetName()] then
+		T.groupframefuncs[header:GetName()](frame)
+	end
+end
+
+local function EditUnitAttributes(layout)
+	local header = _G[layout]
+	if not header then return end
+	local width = C.unitframes.Groups[layout].width
+	local height = C.unitframes.Groups[layout].height
+
+
+	header:SetAttribute("initial-width", width)
+	header:SetAttribute("initial-height", height)
+end
+
+--------------------------------------------------------------
+-- Stop Editing!
+--------------------------------------------------------------
+
+-- import the framework
+local oUF = oUFTukui or oUF
+
+local function InitScript()
+	local children
+	local heal = IsAddOnLoaded("Tukui_Raid_Healing")
+	local dps = IsAddOnLoaded("Tukui_Raid")
+
+	-- don't need to load, because we will reload anyway after user select their layout
+	if heal and dps then return end
+
+	local function UpdateRaidUnitSize(frame, header)
+		frame:SetSize(header:GetAttribute("initial-width"), header:GetAttribute("initial-height"))
+	end
+
+	local GetActiveHeader = function()
+		local players = (GetNumPartyMembers() + 1)
+
+		if UnitInRaid("player") then
+			players = GetNumRaidMembers()
+		end
+
+		if heal then
+			if C["unitframes"].gridonly then
+				return TukuiRaidHealerGrid
+			else
+				if players <= 15 then
+					return TukuiRaidHealer15
+				else
+					return TukuiRaidHealerGrid
+				end
+			end
+		elseif dps then
+			if players <= 25 then
+				return TukuiRaid25
+			elseif players > 25 then
+				return TukuiRaid40
+			end
+		end
+	end
+
+	local function Update(frame, header, event)
+		if (frame and frame.unit) then
+			local isEdited = frame.isEdited
+
+			-- we need to update size of every raid frames if already in raid when we enter world (or /rl)
+			if event == "PLAYER_ENTERING_WORLD" then
+				UpdateRaidUnitSize(frame, header)
+			end
+
+			-- we check for "isEdited" here because we don't want to edit every frame
+			-- every time a member join the raid else it will cause high cpu usage
+			-- and could cause screen freezing
+			if not frame.isEdited then
+				EditUnitFrame(frame, header)
+				frame.isEdited = true
+			end
+		end
+	end
+
+	local function Skin(header, event)
+		children = {header:GetChildren()}
+
+		for _, frame in pairs(children) do
+			Update(frame, header, event)
+		end
+	end
+
+	local StyleRaidFrames = function(self, event)
+		local header = GetActiveHeader()
+		-- make sure we... catch them all! (I feel pikachu inside me)
+		-- we add a delay to make sure latest created unit is catched.
+		T.Delay(delay, function() Skin(header, event) end)
+	end
+
+	-- init, here we modify the initial Config.
+	local function SpawnHeader(name, layout, visibility, ...)
+		EditUnitAttributes(layout)
+	end
+
+	-- this is the function oUF framework use to create and set attributes to headers
+	hooksecurefunc(oUF, "SpawnHeader", SpawnHeader)
+
+	local style = CreateFrame("Frame")
+	style:RegisterEvent("PLAYER_ENTERING_WORLD")
+	style:RegisterEvent("PARTY_MEMBERS_CHANGED")
+	style:RegisterEvent("RAID_ROSTER_UPDATE")
+	style:SetScript("OnEvent", StyleRaidFrames)
+end
+
+local script = CreateFrame("Frame")
+script:RegisterEvent("ADDON_LOADED")
+script:SetScript("OnEvent", function(self, event, addon)
+	if addon == "Tukui_Raid" or addon == "Tukui_Raid_Healing" then
+		InitScript()
+	end
+end)
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/groups/dpsraid25.lua b/SaftUI/modules/unitframes/groups/dpsraid25.lua
new file mode 100644
index 0000000..b8f1775
--- /dev/null
+++ b/SaftUI/modules/unitframes/groups/dpsraid25.lua
@@ -0,0 +1,12 @@
+local T, C, L = unpack(Tukui)
+if not C.unitframes.enable then return end
+local oUF = oUFTukui or oUF
+
+local barTex = T.GetBarTexture()
+
+T.groupframefuncs["TukuiRaid25"] = function(self)
+	if self.Power then self.Power:Kill() end
+	if C.unitframes.unicolor then
+		self:Tag(self.Name, '[raidcolor][Tukui:namemedium] [Tukui:dead][Tukui:afk]')
+	end
+end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/groups/dpsraid40.lua b/SaftUI/modules/unitframes/groups/dpsraid40.lua
new file mode 100644
index 0000000..fed691e
--- /dev/null
+++ b/SaftUI/modules/unitframes/groups/dpsraid40.lua
@@ -0,0 +1,12 @@
+local T, C, L = unpack(Tukui)
+if not C.unitframes.enable then return end
+local oUF = oUFTukui or oUF
+
+local barTex = T.GetBarTexture()
+
+T.groupframefuncs["TukuiRaid40"] = function(self)
+	if self.Power then self.Power:Kill() end
+	if C.unitframes.unicolor then
+		self:Tag(self.Name, '[raidcolor][Tukui:namemedium] [Tukui:dead][Tukui:afk]')
+	end
+end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/groups/general.lua b/SaftUI/modules/unitframes/groups/general.lua
new file mode 100644
index 0000000..cd5b32c
--- /dev/null
+++ b/SaftUI/modules/unitframes/groups/general.lua
@@ -0,0 +1,19 @@
+local T, C, L = unpack(Tukui)
+if not C.unitframes.enable then return end
+local oUF = oUFTukui or oUF
+
+local barTex = T.GetBarTexture()
+
+T.groupframefuncs["general"] = function(self)
+	self:ThickBorder()
+
+	self.Health:ClearAllPoints()
+	self.Health:AllPoints(self, 2)
+
+	self.Name:SetFont(T.GetPixelFont())
+
+	self.Power:ClearAllPoints()
+	self.Power:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 2, 2)
+	self.Power:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -2, 2)
+	self.Power:SetFrameLevel(self.Health:GetFrameLevel()+2)
+end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/groups/healraid15.lua b/SaftUI/modules/unitframes/groups/healraid15.lua
new file mode 100644
index 0000000..d9f7ad1
--- /dev/null
+++ b/SaftUI/modules/unitframes/groups/healraid15.lua
@@ -0,0 +1,9 @@
+local T, C, L = unpack(Tukui)
+if not C.unitframes.enable then return end
+local oUF = oUFTukui or oUF
+
+local barTex = T.GetBarTexture()
+
+T.groupframefuncs["TukuiRaidHealer15"] = function(self)
+
+end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/groups/healraid40.lua b/SaftUI/modules/unitframes/groups/healraid40.lua
new file mode 100644
index 0000000..f6a25ae
--- /dev/null
+++ b/SaftUI/modules/unitframes/groups/healraid40.lua
@@ -0,0 +1,25 @@
+local T, C, L = unpack(Tukui)
+if not C.unitframes.enable then return end
+local oUF = oUFTukui or oUF
+local barTex = T.GetBarTexture()
+
+T.groupframefuncs["TukuiRaidHealerGrid"] = function(self)
+
+	self.panel:SetBackdrop(nil)
+	self.panel:ClearAllPoints()
+	self.panel:AllPoints(self.Health)
+	self.panel:SetFrameLevel(self.Health:GetFrameLevel()+10)
+
+	self.Power:SetHeight(1)
+
+
+	self.Health.value:Hide()
+
+	self.Name:ClearAllPoints()
+	self.Name:SetPoint("CENTER", self.Health, "CENTER", 1, 0)
+	if C.unitframes.unicolor then
+		self:Tag(self.Name, '[raidcolor][st:nametiny]')
+	else
+		self:Tag(self.Name, '[st:nametiny]')
+	end
+end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/oUF.lua b/SaftUI/modules/unitframes/oUF.lua
index 34a87fb..a824f61 100644
--- a/SaftUI/modules/unitframes/oUF.lua
+++ b/SaftUI/modules/unitframes/oUF.lua
@@ -72,24 +72,28 @@ end
 oUF.TagEvents['st:nametiny'] = 'UNIT_NAME_UPDATE'
 oUF.Tags['st:nametiny'] = function(unit)
 	local name = UnitName(unit)
+	if not name then return end
 	return strsub(name, 1, 4)
 end

 oUF.TagEvents['st:nameshort'] = 'UNIT_NAME_UPDATE'
 oUF.Tags['st:nameshort'] = function(unit)
 	local name = UnitName(unit)
+	if not name then return end
 	return strsub(name, 1, 10)
 end

 oUF.TagEvents['st:namemedium'] = 'UNIT_NAME_UPDATE'
 oUF.Tags['st:namemedium'] = function(unit)
 	local name = UnitName(unit)
+	if not name then return end
 	return strsub(name, 1, 15)
 end

 oUF.TagEvents['st:namelong'] = 'UNIT_NAME_UPDATE'
 oUF.Tags['st:namelong'] = function(unit)
 	local name = UnitName(unit)
+	if not name then return end
 	return strsub(name, 1, 20)
 end

diff --git a/SaftUI/modules/unitframes/stUnitFrames.xml b/SaftUI/modules/unitframes/stUnitFrames.xml
index be71870..09294b5 100644
--- a/SaftUI/modules/unitframes/stUnitFrames.xml
+++ b/SaftUI/modules/unitframes/stUnitFrames.xml
@@ -7,6 +7,7 @@
 	<Script file="units\target.lua"/>
 	<Script file="units\targettarget.lua"/>
 	<Script file="units\pet.lua"/>
+	<Script file="units\focus.lua"/>

 	<Script file="groups\core.lua"/>
 	<Script file="groups\general.lua"/>
diff --git a/SaftUI/modules/unitframes/units/focus.lua b/SaftUI/modules/unitframes/units/focus.lua
new file mode 100644
index 0000000..d4d8116
--- /dev/null
+++ b/SaftUI/modules/unitframes/units/focus.lua
@@ -0,0 +1,20 @@
+local T, C, L = unpack(Tukui)
+if not C.unitframes.enable then return end
+local oUF = oUFTukui or oUF
+
+T.unitframefuncs["TukuiPet"] = function(self)
+	local enabled, width, height = T.GetUnitConfig("pet")
+
+	local panel = self.panel
+
+	self.Health:ClearAllPoints()
+	self.Health:AllPoints(self, 2)
+
+	if self.Power then self.Power:Kill() end
+	if self.Castbar then self.Castbar:Kill() end
+
+	self:Tag(self.Name, '[st:nameshort] [Tukui:diffcolor][level] [shortclassification]')
+
+	self:AddDetail(10, height, "LEFT", self, "RIGHT", 3, 0)
+	-- self:CreateAuraTracker(height, "RIGHT", self.Detail, "LEFT", -3, 0)
+end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/units/general.lua b/SaftUI/modules/unitframes/units/general.lua
index 9d7505f..2384f19 100644
--- a/SaftUI/modules/unitframes/units/general.lua
+++ b/SaftUI/modules/unitframes/units/general.lua
@@ -8,7 +8,9 @@ T.unitframefuncs["general"] = function(self)
 	local name = self:GetName()
 	local unit = strlower(strsub(name, strfind(name, "Tukui")+5, strfind(name, "%d") and strfind(name, "%d")-1))
 	if not C.unitframes.Units[unit] then return end
-	local enabled, width, height = T.GetUnitConfig(unit)
+	local enable, width, height = T.GetUnitConfig(unit)
+
+	if enable~=true then self:Kill() return end

 	local health = self.Health
 	local power = self.Power
@@ -46,6 +48,7 @@ T.unitframefuncs["general"] = function(self)
 		power:CreateBackdrop("Transparent")
 		power:ThickBorder()
 		power:AddSpark()
+		power.PostUpdate = T.PostUpdatePower
 		if power.value then
 			power.value:SetFont(T.GetPixelFont())
 			power.value:SetShadowOffset(0, 0)
@@ -70,7 +73,7 @@ T.unitframefuncs["general"] = function(self)
 		castbar:SetHeight(13)
 		castbar:CreateBackdrop("Transparent")
 		castbar:ThickBorder()
-		castbar.bg:Kill()
+		if castbar.bg then castbar.bg:Kill() end

 		castbar.Time:ClearAllPoints()
 		castbar.Time:Point("RIGHT", castbar, "RIGHT", -4, 0)
diff --git a/SaftUI/modules/unitframes/units/player.lua b/SaftUI/modules/unitframes/units/player.lua
index 58108d4..a879654 100644
--- a/SaftUI/modules/unitframes/units/player.lua
+++ b/SaftUI/modules/unitframes/units/player.lua
@@ -5,26 +5,36 @@ local oUF = oUFTukui or oUF
 T.unitframefuncs["TukuiPlayer"] = function(self)
 	local enabled, width, height = T.GetUnitConfig("player")

-	local health = self.Health
-	local healthText = health.value
-	local panel = self.panel
-	local nameText = self.Name
-	local castbar = self.Castbar
-
 	self.Health:ClearAllPoints()
 	self.Health:SetPoint("TOPLEFT", 2, -2)
 	self.Health:SetPoint("BOTTOMRIGHT", self, "RIGHT", -2, 0)

 	self.Power:ClearAllPoints()
 	self.Power:SetPoint("BOTTOMLEFT", 44, 2)
-	self.Power:SetPoint("TOPRIGHT", health, "BOTTOMRIGHT", 0, -7)
+	self.Power:SetPoint("TOPRIGHT", self.Health, "BOTTOMRIGHT", 0, -7)
+
+	if self.Power.value then
+		local value = self.Power.value
+		value:ClearAllPoints()
+		value:SetPoint("LEFT", self.Power, "LEFT", 5, 0)
+	end
+
+	if self.Health.value then
+		local value = self.Health.value
+		value:ClearAllPoints()
+		value:SetPoint("LEFT", self.Health, "LEFT", 5, 0)
+	end

 	self:AddDetail(10, height, "LEFT", self, "RIGHT", 3, 0)
 	self:CreateAuraTracker(height, "LEFT", self.Detail, "RIGHT", 3, 0)

 	if self.Castbar and self.Castbar.button then
 		self.Castbar.button:ClearAllPoints()
-		self.Castbar.button:SetPoint("TOPRIGHT", self.Power, "TOPLEFT", -7, 0)
+		self.Castbar.button:SetPoint("TOPLEFT", self.Health, "BOTTOMLEFT", -2, -5)
+		self.Castbar.button:ThickBorder()
+		self.Castbar.button.shadow:Kill()
+		local size = self.Castbar:GetHeight()+self.Power:GetHeight()+11
+		self.Castbar.button:SetSize(size, size)
 	end

 	T.KillClassBars(self)
diff --git a/SaftUI/modules/unitframes/units/target.lua b/SaftUI/modules/unitframes/units/target.lua
index b3246ce..08fca47 100644
--- a/SaftUI/modules/unitframes/units/target.lua
+++ b/SaftUI/modules/unitframes/units/target.lua
@@ -20,8 +20,10 @@ T.unitframefuncs["TukuiTarget"] = function(self)
 	power:ClearAllPoints()
 	power:SetPoint("BOTTOMRIGHT", -44, 2)
 	power:SetPoint("TOPLEFT", health, "BOTTOMLEFT", 0, -7)
+	power.value:ClearAllPoints()
+	power.value:SetPoint("RIGHT", power, "RIGHT", -3, 0)

-	self:Tag(nameText, '[Tukui:namelong] [Tukui:diffcolor][level] [shortclassification]')
+	self:Tag(nameText, '[Tukui:namelong] [Tukui:diffcolor][st:level]')

 	self:AddDetail(10, height, "RIGHT", self, "LEFT", -3, 0)
 	self:CreateAuraTracker(height, "RIGHT", self.Detail, "LEFT", -3, 0)
@@ -33,17 +35,23 @@ T.unitframefuncs["TukuiTarget"] = function(self)
 			hooksecurefunc(f, "PostCreateIcon", T.SkinAura)
 			f.num = 10
 			f.spacing = 1
-			f.size = width/(f.num+f.spacing)
+			f.size = 23
 			f:SetHeight(f.size)
 		end
 		buffs:ClearAllPoints()
 		buffs:SetPoint("BOTTOMRIGHT", self.Health, "TOPRIGHT", 0, 5)
 		debuffs:ClearAllPoints()
-		debuffs:SetPoint("BOTTOM", buffs, "TOP", 0, 2)
+		debuffs:SetPoint("BOTTOM", buffs, "TOP", 0, buffs.spacing)
 	end

-
-
+	if self.Castbar and self.Castbar.button then
+		self.Castbar.button:ClearAllPoints()
+		self.Castbar.button:SetPoint("TOPRIGHT", self.Health, "BOTTOMRIGHT", 2, -5)
+		self.Castbar.button:ThickBorder()
+		self.Castbar.button.shadow:Kill()
+		local size = self.Castbar:GetHeight()+self.Power:GetHeight()+11
+		self.Castbar.button:SetSize(size, size)
+	end

 	T.KillClassBars(self)
 end
\ No newline at end of file
diff --git a/SaftUI/modules/unitframes/units/targettarget.lua b/SaftUI/modules/unitframes/units/targettarget.lua
index 02b15ce..7a69df9 100644
--- a/SaftUI/modules/unitframes/units/targettarget.lua
+++ b/SaftUI/modules/unitframes/units/targettarget.lua
@@ -16,7 +16,9 @@ T.unitframefuncs["TukuiTargetTarget"] = function(self)
 	if self.Power then self.Power:Kill() end
 	if castbar then castbar:Kill() end

-	self:Tag(nameText, '[st:nameshort] [Tukui:diffcolor][level] [shortclassification]')
+	self.Name:ClearAllPoints()
+	self.Name:SetPoint("LEFT", health, "LEFT", 5, 0)
+	self:Tag(self.Name, '[st:nameshort] [Tukui:diffcolor][level] [shortclassification]')

 	self:AddDetail(10, height, "RIGHT", self, "LEFT", -3, 0)
 	-- self:CreateAuraTracker(height, "RIGHT", self.Detail, "LEFT", -3, 0)