Skip to content
Browse files

Misc fixes + skinned buffs

  • Loading branch information...
1 parent b1614d7 commit 8abae69befba2c39bbc330fa71871ef28e4b51dd @Safturento committed Oct 6, 2012
View
3 SaftUI/SaftUI.xml
@@ -1,5 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
+ <Script file="config.lua"/>
+
<Script file="core\savedvars.lua"/>
<Script file="core\api.lua"/>
<Script file="core\functions.lua"/>
@@ -9,6 +11,7 @@
<Script file="modules\maps.lua"/>
<Script file="modules\datatext.lua"/>
<Script file="modules\unitframes.lua"/>
+ <Script file="modules\nameplates.lua"/>
<Script file="modules\actionbars.lua"/>
<Script file="modules\experience.lua"/>
<Script file="modules\bags.lua"/>
View
13 SaftUI/config.lua
@@ -0,0 +1,13 @@
+local T, C, L, G = unpack(Tukui)
+
+C.bags.improvedsearch = true
+
+C.unitframes.units = {
+ ["player"] = { ["width"] = 250, ["height"] = 40, ["point"] = {"TOPRIGHT", UIParent, "CENTER", -150, -180} },
+ ["target"] = { ["width"] = 250, ["height"] = 40, ["point"] = {"TOPLEFT", UIParent, "CENTER", 150, -180} },
+ ["targettarget"] = { ["width"] = 100, ["height"] = 30, ["point"] = {"TOP", UIParent, "CENTER", 0, -200} },
+ ["pet"] = { ["width"] = 100, ["height"] = 30, ["point"] = {"TOP", G.UnitFrames.TargetTarget, "BOTTOM", 0, -6} },
+ ["arena_boss"] = { ["width"] = 200, ["height"] = 30, ["point"] = {"BOTTOM", G.UnitFrames.Target, "TOP", 0, 120} },
+ ["focus"] = { ["width"] = 200, ["height"] = 30, ["point"] = {"BOTTOM", G.UnitFrames.Player, "TOP", 0, 120} },
+ ["raid"] = { ["width"] = 50, ["height"] = 40, ["point"] = {"TOPLEFT", UIParent, "TOPLEFT", 15, -15} },
+}
View
25 SaftUI/core/functions.lua
@@ -90,4 +90,29 @@ end
T.SetOriginalTextColor = function(self)
local color = RAID_CLASS_COLORS[T.myclass]
self:SetTextColor(unpack(self.originalColor or {1, 1, 1, 1}) )
+end
+
+T.ReskinAuras = function(self, button)
+ local timer = button.remaining
+ local count = button.count
+ timer:SetPixelFont()
+ timer:ClearAllPoints()
+ timer:Point("BOTTOM", button, "BOTTOM", 1, 1)
+
+ count:SetPixelFont()
+ count:ClearAllPoints()
+ count:Point("TOPLEFT", button, "TOPLEFT", 2, 0)
+ count:SetJustifyH('LEFT')
+ count:SetTextColor(0.84, 0.75, 0.65)
+end
+
+T.ReupdateAuras = function(self, unit, icon, index, offset, filter, isDebuff, duration, timeLeft)
+ local _, _, _, _, dtype, _, _, _, isStealable = UnitAura(unit, index, icon.filter)
+ if icon and (icon.filter ~= "HARMFUL") then
+ if (isStealable or ((T.myclass == "MAGE" or T.myclass == "PRIEST" or T.myclass == "SHAMAN") and dtype == "Magic")) and not UnitIsFriend("player", unit) then
+ icon:SetBackdropBorderColor(1, .8, 0)
+ else
+ icon:SetTemplate()
+ end
+ end
end
View
2 SaftUI/modules/actionbars.lua
@@ -157,8 +157,6 @@ local function LoadActionBarConfig()
title:SetText("Action Bar Config")
titleBar.text = title
- titleBar:SetScript("OnEnter", T.SetModifiedBackdrop)
-
local close = CreateFrame("Button", nil, titleBar)
close:SetPoint("RIGHT", -3, 0)
close:SetSize(18,18)
View
130 SaftUI/modules/bags.lua
@@ -1,64 +1,68 @@
-ITEM_RARITY_STRINGS = {
- [0] = "Poor",
- [1] = "Common",
- [2] = "Uncommon",
- [3] = "Rare",
- [4] = "Epic",
- [5] = "Legendary",
- [6] = "Artifact",
- [7] = "Heriloom",
-}
-
-local queryShortcuts = {
- ["boe"] = "binds when equipped",
- ["bop"] = "soulbound",
-}
-
-local function checkMatch(self, query)
- if not self.name then return end
- if string.len(query) < 1 then
- Stuffing:SearchReset()
- end
- if queryShortcuts[query] then
- query = queryShortcuts[query]
- end
-
- local name, link, quality, iLvl, minLvl, class, subclass, count, equiploc= GetItemInfo(self.name)
- local parseString = name.." "..ITEM_RARITY_STRINGS[quality].." " ..class.." "..subclass.." " ..equiploc
-
- GameTooltip:SetBagItem(self.bag, self.slot)
- for i=1, GameTooltip:NumLines() do
- local left, right = _G["GameTooltipTextLeft"..i], _G["GameTooltipTextRight"..i]
- if left:GetText() then
- parseString = parseString .. " " .. left:GetText()
- end
- if right:GetText() then
- parseString = parseString .. " " .. right:GetText()
- end
- end
-
- return strfind(strlower(parseString), strlower(query), 1, true)
-end
-
-function Stuffing:SearchUpdate(query)
- for _, b in ipairs(self.buttons) do
- if b.frame and not b.name then
- b.frame:SetAlpha(.2)
- end
- if not checkMatch(b, query) then
- SetItemButtonDesaturated(b.frame, 1, 1, 1, 1)
- b.frame:SetAlpha(.2)
- else
- SetItemButtonDesaturated(b.frame, 0, 1, 1, 1)
- b.frame:SetAlpha(1)
- end
- end
-end
-
-local updateSearch = function(self, t)
- if t == true then
- Stuffing:SearchUpdate(self:GetText())
- end
-end
-
+local T, C, L, G = unpack(Tukui)
+
+if not C.bags.improvedsearch then return end
+
+ITEM_RARITY_STRINGS = {
+ [0] = "Poor",
+ [1] = "Common",
+ [2] = "Uncommon",
+ [3] = "Rare",
+ [4] = "Epic",
+ [5] = "Legendary",
+ [6] = "Artifact",
+ [7] = "Heriloom",
+}
+
+local queryShortcuts = {
+ ["boe"] = "binds when equipped",
+ ["bop"] = "soulbound",
+}
+
+local function checkMatch(self, query)
+ if not self.name then return end
+ if string.len(query) < 1 then
+ Stuffing:SearchReset()
+ end
+ if queryShortcuts[query] then
+ query = queryShortcuts[query]
+ end
+
+ local name, link, quality, iLvl, minLvl, class, subclass, count, equiploc= GetItemInfo(self.name)
+ local parseString = name.." "..ITEM_RARITY_STRINGS[quality].." " ..class.." "..subclass.." " ..equiploc
+
+ GameTooltip:SetBagItem(self.bag, self.slot)
+ for i=1, GameTooltip:NumLines() do
+ local left, right = _G["GameTooltipTextLeft"..i], _G["GameTooltipTextRight"..i]
+ if left:GetText() then
+ parseString = parseString .. " " .. left:GetText()
+ end
+ if right:GetText() then
+ parseString = parseString .. " " .. right:GetText()
+ end
+ end
+
+ return strfind(strlower(parseString), strlower(query), 1, true)
+end
+
+function Stuffing:SearchUpdate(query)
+ for _, b in ipairs(self.buttons) do
+ if b.frame and not b.name then
+ b.frame:SetAlpha(.2)
+ end
+ if not checkMatch(b, query) then
+ SetItemButtonDesaturated(b.frame, 1, 1, 1, 1)
+ b.frame:SetAlpha(.2)
+ else
+ SetItemButtonDesaturated(b.frame, 0, 1, 1, 1)
+ b.frame:SetAlpha(1)
+ end
+ end
+end
+
+local updateSearch = function(self, t)
+ if t == true then
+ Stuffing:SearchUpdate(self:GetText())
+ end
+end
+
TukuiBags.editbox:SetScript("OnTextChanged", updateSearch)
View
6 SaftUI/modules/experience.lua
@@ -59,7 +59,7 @@ local function Update(self)
self.xpBar:SetValue(currentXP)
if restXP then
- self.Text:SetFormattedText('%d%% |cff3399ff+%d%%|r', percentXP, percentRestXP)
+ self.Text:SetFormattedText('%s%% |cff3399ff+%s%%|r', percentXP, percentRestXP)
self.xpBar:SetStatusBarColor(.2, .6, .9, 1)
@@ -68,14 +68,14 @@ local function Update(self)
self.restBar:SetMinMaxValues(0, maxXP)
self.restBar:SetValue(currentXP+restXP)
else
- self.Text:SetFormattedText('%d%%', percentXP)
+ self.Text:SetFormattedText('%s%%', percentXP)
self.restBar:Hide()
self.xpBar:SetStatusBarColor(.5, 0, .75, 1)
end
elseif GetWatchedFactionInfo() then
local name, rank, minRep, maxRep, value = GetWatchedFactionInfo()
local percentRep = T.Round((value-minRep)/(maxRep-minRep)*100, 1)
- self.Text:SetFormattedText('%d%%', percentRep)
+ self.Text:SetFormattedText('%s%%', percentRep)
self.xpBar:SetMinMaxValues(minRep, maxRep)
self.xpBar:SetValue(value)
View
0 SaftUI/modules/nameplates.lua
No changes.
View
62 SaftUI/modules/unitframes.lua
@@ -9,48 +9,12 @@ oUF.Tags.Methods['Tukui:nametiny'] = function(unit)
return name:sub(1,4)
end
-C.unitframes.units = {
- ["player"] = { ["width"] = 230, ["height"] = 40, ["point"] = {"TOPRIGHT", UIParent, "CENTER", -150, -180} },
- ["target"] = { ["width"] = 230, ["height"] = 40, ["point"] = {"TOPLEFT", UIParent, "CENTER", 150, -180} },
- ["targettarget"] = { ["width"] = 100, ["height"] = 30, ["point"] = {"TOP", UIParent, "CENTER", 0, -200} },
- ["pet"] = { ["width"] = 100, ["height"] = 30, ["point"] = {"TOP", G.UnitFrames.TargetTarget, "BOTTOM", 0, -6} },
- ["arena_boss"] = { ["width"] = 200, ["height"] = 40, ["point"] = {"BOTTOM", G.UnitFrames.Target, "TOP", 0, 120} },
- ["focus"] = { ["width"] = 200, ["height"] = 40, ["point"] = {"BOTTOM", G.UnitFrames.Player, "TOP", 0, 120} },
- ["raid"] = { ["width"] = 50, ["height"] = 40, ["point"] = {"TOPLEFT", UIParent, "TOPLEFT", 15, -15} },
-}
+
for _,self in pairs(G.UnitFrames) do
local unit = self.unit
if not unit then return end
- if unit == "targettarget" and not Power then
- local power = CreateFrame("StatusBar", nil, self)
- power:SetStatusBarTexture(C["media"].normTex)
-
- local powerBG = power:CreateTexture(nil, "BORDER")
- powerBG:SetAllPoints(power)
- powerBG:SetTexture(C["media"].normTex)
- powerBG.multiplier = 0.3
-
- power.PreUpdate = T.PreUpdatePower
-
- power.frequentUpdates = true
- power.colorDisconnected = true
-
- power.Smooth = C["unitframes"].showsmooth
-
- if C["unitframes"].unicolor == true then
- power.colorTapping = true
- power.colorClass = true
- powerBG.multiplier = 0.1
- else
- power.colorPower = true
- end
-
- self.Power = power
- self.Power.bg = powerBG
- end
-
local frame = self --for when we need to use this within a function where self is already defined
local Health = self.Health
local Power = self.Power
@@ -59,16 +23,28 @@ for _,self in pairs(G.UnitFrames) do
local Panel = self.panel
local config = C.unitframes.units[unit]
- if unit == 'arena1' or unit == 'boss1' then
- -- print(unit)
+ if strmatch(unit, 'arena%d') or strmatch(unit, 'boss%d') then
config = C.unitframes.units['arena_boss']
end
if config then
- self:ClearAllPoints()
- self:SetPoint(unpack(config.point))
self:SetWidth(config.width)
self:SetHeight(config.height)
+
+ if not ((strmatch(unit, 'arena%d') and unit ~= 'arena1') or (strmatch(unit, 'boss%d') and unit ~= 'boss1')) then
+ self:ClearAllPoints()
+ self:SetPoint(unpack(config.point))
+ end
+ end
+
+ if self.Debuffs then
+ hooksecurefunc(self.Debuffs, 'PostCreateIcon', T.ReskinAuras)
+ hooksecurefunc(self.Debuffs, 'PostUpdateIcon', T.ReupdateAuras)
+ end
+
+ if self.Buffs then
+ hooksecurefunc(self.Buffs, 'PostCreateIcon', T.ReskinAuras)
+ hooksecurefunc(self.Buffs, 'PostUpdateIcon', T.ReupdateAuras)
end
if self.Portrait then
@@ -436,4 +412,6 @@ function T.PostUpdateRaidUnit(self, unit, header)
end
end
end
-end
+end
+
+TukuiRaid:SetPoint(unpack(C.unitframes.units.raid))

0 comments on commit 8abae69

Please sign in to comment.
Something went wrong with that request. Please try again.