diff --git a/SaftUI/SaftUI.xml b/SaftUI/SaftUI.xml index 042a4c2..11d85b5 100644 --- a/SaftUI/SaftUI.xml +++ b/SaftUI/SaftUI.xml @@ -8,6 +8,7 @@ <Include file="modules\unitframes\stUnitFrames.xml"/> <Include file="modules\classbars\classbars.xml"/> <Script file="modules\datatext\experience.lua"/> + <Script file="modules\threatbar.lua"/> <Script file="frames\reskinframes.lua"/> <Script file="frames\killframes.lua"/> diff --git a/SaftUI/core/functions.lua b/SaftUI/core/functions.lua index 85db535..5d05da5 100644 --- a/SaftUI/core/functions.lua +++ b/SaftUI/core/functions.lua @@ -151,7 +151,7 @@ end T.PostUpdatePower = function(power, unit, min, max) local self = power:GetParent() local pType, pToken = UnitPowerType(unit) - local color + local color = {1, 1, 1} --Overwrite oUF colors with Tukui's colors for consistency if power.colorTapping and UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then color = T.UnitColor.tapped @@ -167,11 +167,14 @@ T.PostUpdatePower = function(power, unit, min, max) 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]) + local tColor = {1, 1, 1} + if power.value.colorPower then + tColor = pToken and T.UnitColor.power[pToken] + end + power.value:SetTextColor(tColor[1], tColor[2], tColor[3]) if not UnitIsPlayer(unit) and not UnitPlayerControlled(unit) or not UnitIsConnected(unit) then power.value:SetText("") @@ -184,11 +187,11 @@ T.PostUpdatePower = function(power, unit, min, max) end end - T.ReverseBar(power, unit, min, max, {r, g, b} ) + T.ReverseBar(power, unit, min, max, {r, g, b}) end function T.KillClassBars(self) - local toKill = { + local toSkin = { self.CPoints, self.EclipseBar, self.SoulShards, @@ -201,7 +204,7 @@ function T.KillClassBars(self) if frame then if frame[1] then for i=1, #frame do - if frame[i].Kill then frame[i]:Kill() end + if frame[i].SetTemplate then frame[i]:SetTemplate(); frame[i]:ThickBorder() end end end if frame.Kill then frame:Kill() end @@ -218,17 +221,183 @@ function T.SkinAura(self, button) button.Glow:Kill() end +T.classFuncs = {} +function T.classFuncs.SHAMAN(self) + if not self.TotemBar then return end + + local tb = self.TotemBar + for i=1, 4 do + tb[i]:SetBackdrop(nil) + tb[i]:CreateBackdrop() + tb[i].backdrop:ThickBorder() + tb[i]:SetWidth((self.width-19)/4) + tb[i]:SetHeight(5) + tb[i]:ClearAllPoints() + end + tb[2]:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 2, 5) + tb[1]:SetPoint("LEFT", tb[2], "RIGHT", 5, 0) + tb[3]:SetPoint("LEFT", tb[1], "RIGHT", 5, 0) + tb[4]:SetPoint("LEFT", tb[3], "RIGHT", 5, 0) +end +function T.classFuncs.PALADIN(self) + if not self.HolyPower then return end + + local hp = self.HolyPower + hp:SetTemplate() + hp:ThickBorder() + hp:SetHeight(9) + hp:SetWidth(self.width) + hp:ClearAllPoints() + hp:SetPoint("BOTTOM", self, "TOP", 0, 3) + + for i=1, 3 do + hp[i]:ClearAllPoints() + if i == 1 then + hp[i]:SetPoint("LEFT", hp, "LEFT", 2, 0) + else + hp[i]:SetPoint("LEFT", hp[i-1], "RIGHT", 1, 0) + end + hp[i]:SetWidth((self.width-6)/3) + hp[i]:SetHeight(hp:GetHeight()-4) + end +end +function T.classFuncs.WARLOCK(self) + if not self.SoulShards then return end + + local ss = self.SoulShards + ss:SetTemplate() + ss:ThickBorder() + ss:SetHeight(9) + ss:SetWidth(self.width) + ss:ClearAllPoints() + ss:SetPoint("BOTTOM", self, "TOP", 0, 3) + + for i=1, 3 do + ss[i]:ClearAllPoints() + if i == 1 then + ss[i]:SetPoint("LEFT", ss, "LEFT", 2, 0) + else + ss[i]:SetPoint("LEFT", ss[i-1], "RIGHT", 1, 0) + end + ss[i]:SetWidth((self.width-6)/3) + ss[i]:SetHeight(ss:GetHeight()-4) + end +end +function T.classFuncs.DEATHKNIGHT(self) + if not self.Runes then return end + + local rs = self.Runes + rs:SetTemplate() + rs:ThickBorder() + rs:SetHeight(9) + rs:SetWidth(self.width) + rs:ClearAllPoints() + rs:SetPoint("BOTTOM", self, "TOP", 0, 3) + + for i=1, 6 do + rs[i]:ClearAllPoints() + if i == 1 then + rs[i]:SetPoint("LEFT", rs, "LEFT", 2, 0) + else + rs[i]:SetPoint("LEFT", rs[i-1], "RIGHT", 1, 0) + end + rs[i]:SetWidth((self.width-9)/6) + rs[i]:SetHeight(rs:GetHeight()-4) + end +end +function T.classFuncs.DRUID(self) + if not self.EclipseBar then return end + + local eb = self.EclipseBar + eb:ClearAllPoints() + eb:SetPoint("BOTTOM", self, "TOP", 0, 3) + eb:ThickBorder() + eb:SetTemplate() + eb:SetWidth(self.width) + eb.LunarBar:ClearAllPoints() + eb.LunarBar:SetPoint('LEFT', eb, 'LEFT', 2, 0) + eb.LunarBar:SetHeight(eb:GetHeight()-4) + eb.LunarBar:SetWidth(eb:GetWidth()-4) + eb.SolarBar:SetHeight(eb:GetHeight()-4) + eb.SolarBar:SetWidth(eb:GetWidth()-4) + + -- local dmb = + self.DruidManaBackground:Hide() + -- dmb:ClearAllPoints() + -- dmb:SetPoint("BOTTOM", self, "TOP", 0, 3) + -- dmb:SetTemplate() + -- dmb:ThickBorder() + -- dmb:SetWidth(self.width) + -- dmb:SetHeight(9) + + local dm = self.DruidMana + dm:AllPoints(dmb, 2) + dm:SetWidth(self.width-4) + dm:SetPoint("BOTTOM", self, "TOP", 0, 5) + dm:CreateBackdrop() + dm.backdrop:ThickBorder() +end +function T.classFuncs.GENERAL(self) + if TukuiCombo then + local parent = TukuiCombo:GetParent() + local parentUnit = parent=="TukuiPlayer" and "player" or "target" + + local tc = TukuiCombo + tc:ClearAllPoints() + tc:SetPoint("BOTTOM", self, "TOP", 0, 3) + tc:SetWidth(self.width) + tc:SetHeight(9) + + tc:SetBackdrop(nil) + + for i=1, 5 do + tc[i]:CreateBackdrop("Transparent") + tc[i].backdrop:ThickBorder() + tc[i]:SetMinMaxValues(0, 1) + tc[i]:SetValue(0) + tc[i]:SetAlpha(1) + + tc[i]:SetWidth((self.width-24)/5) + tc[i]:SetHeight(5) + + + tc[i]:ClearAllPoints() + if i == 1 then + tc[i]:SetPoint("LEFT", tc, "LEFT", 2, 0) + else + tc[i]:SetPoint("LEFT", tc[i-1], "RIGHT", 5, 0) + end + end + + tc:SetScript("OnEvent", function(self) + local points + + if UnitHasVehicleUI("player") then + points = GetComboPoints("vehicle", "target") + else + points = GetComboPoints("player", "target") + end - - - - + if points then + -- update combos display + for i = 1, MAX_COMBO_POINTS do + if i <= points then + self[i]:SetValue(1) + else + self[i]:SetValue(0) + end + self:SetAlpha(1) + end + end + end) + end +end diff --git a/SaftUI/frames/datatext.lua b/SaftUI/frames/datatext.lua index 8b7794e..3cf5b1a 100644 --- a/SaftUI/frames/datatext.lua +++ b/SaftUI/frames/datatext.lua @@ -58,8 +58,8 @@ local function SkinDataText() TukuiInfoBackdrop = CreateFrame("Frame", "TukuiInfoBackdrop", UIParent) TukuiInfoBackdrop:SetTemplate("Transparent") TukuiInfoBackdrop:ThickBorder() - TukuiInfoBackdrop:SetPoint("TOPLEFT", TukuiInfoLeft) - TukuiInfoBackdrop:SetPoint("BOTTOMRIGHT", mmsRight and TukuiMinimapStatsRight or mmsLeft and TukuiMinimapStatsLeft or TukuiInfoRight) + TukuiInfoBackdrop:SetPoint("BOTTOMLEFT", TukuiInfoLeft, -8, 0) + TukuiInfoBackdrop:SetPoint("TOPRIGHT", UIParent, 2, 2)--mmsRight and TukuiMinimapStatsRight or mmsLeft and TukuiMinimapStatsLeft or TukuiInfoRight) TukuiInfoBackdrop:SetFrameStrata("BACKGROUND") TukuiInfoBackdrop:SetFrameLevel(0) end diff --git a/SaftUI/frames/moveframes.lua b/SaftUI/frames/moveframes.lua index 04b38b8..908c637 100644 --- a/SaftUI/frames/moveframes.lua +++ b/SaftUI/frames/moveframes.lua @@ -2,12 +2,14 @@ local T, C, L = unpack(Tukui) local frames = { ["TukuiRollAnchor"] = {"BOTTOM", TukuiChatBackgroundLeft or ChatFrame1, "TOP", 0, 5}, - ["TukuiInfoLeft"] = {"TOPLEFT", UIParent, "TOPLEFT", 6, -6}, + ["TukuiInfoLeft"] = {"TOPLEFT", UIParent, "TOPLEFT", 6, 3}, ["TukuiInfoRight"] = {"LEFT", TukuiInfoLeft, "RIGHT", 0, 0}, ["TukuiMinimapStatsLeft"] = {"LEFT", TukuiInfoRight, "RIGHT", 0, 0}, ["TukuiMinimapStatsRight"] = {"LEFT", TukuiMinimapStatsLeft, "RIGHT", 0, 0}, ["TukuiTooltipAnchor"] = {"BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0}, ["TukuiBags"] = {"BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -6, 6}, + ["TukuiMinimap"] = {"TOPRIGHT", UIParent, "TOPRIGHT", -4, -24}, + ["TukuiAurasPlayerBuffs"] = {"TOPRIGHT", TukuiMinimap, "TOPLEFT", -6, 0}, } local function FixVehicleButton() diff --git a/SaftUI/modules/actionbars.lua b/SaftUI/modules/actionbars.lua index c7649e4..ac05cb3 100644 --- a/SaftUI/modules/actionbars.lua +++ b/SaftUI/modules/actionbars.lua @@ -65,8 +65,10 @@ local function style(self) local HotKey = _G[name.."HotKey"] local Border = _G[name.."Panel"] - Count:SetFont(unpack(C.pFont)) - HotKey:SetFont(unpack(C.pFont)) + Count:SetFont(T.GetPixelFont()) + Count.SetFont = T.dummy + HotKey:SetFont(T.GetPixelFont()) + HotKey.SetFont = T.dummy Border:ThickBorder() Border:AllPoints(self) @@ -93,7 +95,7 @@ function T.UpdateAllActionBars() local perRow = C.actionbar.barspecific[i].perRow local userPlaced = C.actionbar.barspecific[i].userPlaced - if enabled then bar:Show() else bar:Hide() end + if C.actionbar.barspecific[i].enabled then bar:Show() else bar:Hide() end for j=1, 12 do local b = _G[bSuffix..j] @@ -101,7 +103,7 @@ function T.UpdateAllActionBars() style(b) - if not enabled then + if not C.actionbar.barspecific[i].enabled then b:Hide() else b:Show() @@ -284,11 +286,6 @@ function T.LoadActionBarMenu() if InCombatLockdown() then print("Cannot configure action bars in combat.") return end if TukuiActionBarMenu.Loaded then ToggleFrame(TukuiActionBarMenu) return end --Only continue if the config is not loaded - local Config_bSize = C.actionbar.buttonsize - local Config_bSpacing = C.actionbar.buttonspacing - local Config_ShowHotkey = C.actionbar.hotkey - local Config_ShowGrid = C.actionbar.showgrid - window:SetPoint("CENTER", UIParent, "CENTER", 0, 0) window:SetSize(250, 20) window:SetTemplate() @@ -331,14 +328,14 @@ function T.LoadActionBarMenu() buttonSize.editbox = CreateEditBox(buttonSize, 30, 14) buttonSize.editbox:SetTextInsets(3, 0, 0, 1) buttonSize.editbox:SetPoint("RIGHT", buttonSize, "RIGHT", -4, 0) - buttonSize.editbox:SetText(Config_bSize) + buttonSize.editbox:SetText(C.actionbar.buttonsize) buttonSize.editbox:SetScript("OnEscapePressed", function(self) self:ClearFocus() - self:SetText(Config_bSize) + self:SetText(C.actionbar.buttonsize) end) buttonSize.editbox:SetScript("OnEnterPressed", function(self) self:ClearFocus() - if not tonumber(self:GetText()) then self:SetText(Config_bSize) return end + if not tonumber(self:GetText()) then self:SetText(C.actionbar.buttonsize) return end local newbuttonSize = tonumber(self:GetText()) if newbuttonSize > 40 then newbuttonSize = 40; self:SetText("40") end @@ -356,14 +353,14 @@ function T.LoadActionBarMenu() buttonSpacing.editbox = CreateEditBox(buttonSpacing, 30, 14) buttonSpacing.editbox:SetTextInsets(3, 0, 0, 1) buttonSpacing.editbox:SetPoint("RIGHT", buttonSpacing, "RIGHT", -4, 0) - buttonSpacing.editbox:SetText(Config_bSpacing) + buttonSpacing.editbox:SetText(C.actionbar.buttonspacing) buttonSpacing.editbox:SetScript("OnEscapePressed", function(self) self:ClearFocus() - self:SetText(Config_bSpacing) + self:SetText(C.actionbar.buttonspacing) end) buttonSpacing.editbox:SetScript("OnEnterPressed", function(self) self:ClearFocus() - if not tonumber(self:GetText()) then self:SetText(Config_bSpacing) return end + if not tonumber(self:GetText()) then self:SetText(C.actionbar.buttonspacing) return end local newButtonSpacing = tonumber(self:GetText()) if newButtonSpacing > 10 then newButtonSpacing = 10; self:SetText("10") end @@ -380,7 +377,7 @@ function T.LoadActionBarMenu() hotKey:AddText("text", "Show Hotkey", "LEFT", hotKey, "LEFT", 4, 1) hotKey.checkbox = CreateFrame("CheckButton", nil, hotKey, "UICheckButtonTemplate") T.SkinCheckBox(hotKey.checkbox) - hotKey.checkbox:SetChecked(Config_ShowHotkey) + hotKey.checkbox:SetChecked(C.actionbar.hotkey) hotKey.checkbox:SetPoint("RIGHT", hotKey, "RIGHT", -4, 0) hotKey.checkbox:SetSize(16,16) hotKey.checkbox:HookScript("OnClick", function(self) @@ -412,7 +409,7 @@ function T.LoadActionBarMenu() -- showGrid:AddText("text", "Show Grid", "LEFT", showGrid, "LEFT", 4, 0) -- showGrid.checkbox = CreateFrame("CheckButton", nil, showGrid, "UICheckButtonTemplate") -- T.SkinCheckBox(showGrid.checkbox) - -- showGrid.checkbox:SetChecked(Config_ShowGrid) + -- showGrid.checkbox:SetChecked(C.actionbar.showgrid) -- showGrid.checkbox:SetPoint("RIGHT", showGrid, "RIGHT", -4, 0) -- showGrid.checkbox:SetSize(16,16) -- showGrid.checkbox:HookScript("OnClick", function(self) @@ -439,10 +436,6 @@ function T.LoadActionBarMenu() end for i=1, 5 do - local Config_Enabled = C.actionbar.barspecific[i].enabled - local Config_NumButtons = C.actionbar.barspecific[i].numButtons - local Config_PerRow = C.actionbar.barspecific[i].perRow - local panel = CreateFrame("Frame", nil, window) panel:SetTemplate() panel:SetWidth(window:GetWidth()-10) @@ -452,7 +445,7 @@ function T.LoadActionBarMenu() panel.enable = CreateFrame("CheckButton", nil, panel, "UICheckButtonTemplate") T.SkinCheckBox(panel.enable) - panel.enable:SetChecked(Config_Enabled) + panel.enable:SetChecked(C.actionbar.barspecific[i].enabled) panel.enable:SetPoint("CENTER", panel, "CENTER", -33, 0) panel.enable:SetSize(16,16) panel.enable:HookScript("OnClick", function(self) @@ -464,14 +457,14 @@ function T.LoadActionBarMenu() panel.numButtons:SetTextInsets(3, 0, 0, 1) panel.numButtons:SetJustifyH("CENTER") panel.numButtons:SetPoint("CENTER", panel, "CENTER", 30, 0) - panel.numButtons:SetText(Config_NumButtons) + panel.numButtons:SetText(C.actionbar.barspecific[i].numButtons) panel.numButtons:SetScript("OnEscapePressed", function(self) self:ClearFocus() - self:SetText(Config_NumButtons) + self:SetText(C.actionbar.barspecific[i].numButtons) end) panel.numButtons:SetScript("OnEnterPressed", function(self) self:ClearFocus() - if not tonumber(self:GetText()) then self:SetText(Config_NumButtons) return end + if not tonumber(self:GetText()) then self:SetText(C.actionbar.barspecific[i].numButtons) return end local newNumButtons = tonumber(self:GetText()) if newNumButtons > 12 then newNumButtons = 12; self:SetText("12") end @@ -484,14 +477,14 @@ function T.LoadActionBarMenu() panel.perRow:SetTextInsets(3, 0, 0, 1) panel.perRow:SetJustifyH("CENTER") panel.perRow:SetPoint("CENTER", panel, "RIGHT", -27, 0) - panel.perRow:SetText(Config_PerRow) + panel.perRow:SetText(C.actionbar.barspecific[i].perRow) panel.perRow:SetScript("OnEscapePressed", function(self) self:ClearFocus() - self:SetText(Config_PerRow) + self:SetText(C.actionbar.barspecific[i].perRow) end) panel.perRow:SetScript("OnEnterPressed", function(self) self:ClearFocus() - if not tonumber(self:GetText()) then self:SetText(Config_PerRow) return end + if not tonumber(self:GetText()) then self:SetText(C.actionbar.barspecific[i].perRow) return end local newPerRow = tonumber(self:GetText()) if newPerRow > 12 then newPerRow = 12; self:SetText("12") end diff --git a/SaftUI/modules/chat.lua b/SaftUI/modules/chat.lua index 029a4b3..99bae3a 100644 --- a/SaftUI/modules/chat.lua +++ b/SaftUI/modules/chat.lua @@ -27,6 +27,12 @@ local function SetupChat(self) loot:SetPoint("BOTTOMLEFT", rightbg, "BOTTOMLEFT", 6, 6) loot:SetPoint("TOPRIGHT", rightbg, "TOPRIGHT", -6, -32) + + general._SetPoint = general.SetPoint + general.SetPoint = T.Dummy + loot._SetPoint = general.SetPoint + loot.SetPoint = T.Dummy + leftbg:ClearAllPoints() leftbg:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 6, 6) @@ -340,8 +346,8 @@ local function SaveVariables() chatSaved.leftHeight = C.chat.leftHeight end -local function SetupChat(self) - self:UnregisterAllEvents() +local function SetupChat(self, event) + self:UnregisterEvent(event) RestoreSavedVariables() SetupBackgrounds() PositionChatWindows() @@ -353,6 +359,7 @@ end local OnLoad = CreateFrame("Frame") OnLoad:RegisterEvent("PLAYER_ENTERING_WORLD") +OnLoad:RegisterEvent("PLAYER_LOGIN") OnLoad:SetScript("OnEvent", SetupChat) local numlines = 1 diff --git a/SaftUI/modules/classbars/arcaneblast.lua b/SaftUI/modules/classbars/arcaneblast.lua deleted file mode 100644 index 448b564..0000000 --- a/SaftUI/modules/classbars/arcaneblast.lua +++ /dev/null @@ -1,80 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.arcaneBlast[1] ~= true or T.myclass ~= "MAGE" then return end - -local tbWidth, tbHeight = C.classbar.arcaneBlast[2], C.classbar.arcaneBlast[3] - -local colors = { - { 0/255, 75/255, 1, 1}, - { 0/255, 100/255, 1, 1}, - { 0/255, 125/255, 1, 1}, - { 0/255, 150/255, 1, 1}, -} - -local mover = CreateFrame("Frame", "TukuiArcaneBlastMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Arcane Blast", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local aBlast = CreateFrame("Frame", "TukuiArcaneBlast", UIParent) -aBlast:Width(tbWidth) -aBlast:Height(tbHeight) -aBlast:Point("CENTER", mover) - -local stacks = {} - -for i=1,4 do - stacks[i] = CreateFrame("Frame", "TukuiArcaneBlast_Stack"..i, aBlast) - stacks[i]:SetWidth((tbWidth-3) / 4) - stacks[i]:SetHeight(tbHeight) - stacks[i]:CreateBackdrop("Transparent") - stacks[i].backdrop:ThickBorder() - stacks[i].tex = stacks[i]:CreateTexture(nil, "OVERLAY") - stacks[i].tex:SetTexture(C.media.normTex) - stacks[i].tex:SetVertexColor(unpack(colors[i])) - stacks[i].tex:AllPoints(stacks[i]) - if i==1 then - stacks[i]:SetPoint("LEFT", aBlast, "LEFT", 0, 0) - else - stacks[i]:SetPoint("LEFT", stacks[i-1], "RIGHT", 5, 0) - end -end - -local function UpdateStacks(self, event, unit) - if (event ~= "PLAYER_ENTERING_WORLD") and (unit ~= "player") then return end - local _, _, _, numStacks, _, duration, expires = UnitDebuff("player", "Arcane Blast") - if numStacks == nil then numStacks = 0 end - for i = 1, 4 do - if (i <= numStacks) then - stacks[i].tex:Show() - else - stacks[i].tex:Hide() - end - end - if numStacks == 0 then - aBlast:Hide() - else - aBlast:Show() - end -end - -aBlast:RegisterEvent("UNIT_AURA") -aBlast:RegisterEvent("PLAYER_ENTERING_WORLD") -aBlast:SetScript("OnEvent", UpdateStacks) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - aBlast:Hide() - else - aBlast:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/classbars.xml b/SaftUI/modules/classbars/classbars.xml deleted file mode 100644 index 5f77b87..0000000 --- a/SaftUI/modules/classbars/classbars.xml +++ /dev/null @@ -1,11 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file="arcaneblast.lua"/> - <Script file="combopoints.lua"/> - <Script file="eclipsebar.lua"/> - <Script file="totemtimers.lua"/> - <Script file="fulmination.lua"/> - <Script file="holypower.lua"/> - <Script file="runebars.lua"/> - <Script file="soulshards.lua"/> - <Script file="thunderclap.lua"/> -</Ui> \ No newline at end of file diff --git a/SaftUI/modules/classbars/combopoints.lua b/SaftUI/modules/classbars/combopoints.lua deleted file mode 100644 index c8abe81..0000000 --- a/SaftUI/modules/classbars/combopoints.lua +++ /dev/null @@ -1,73 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.comboPoints[1] ~= true then return end - -local tbWidth, tbHeight = C.classbar.comboPoints[2], C.classbar.comboPoints[3] - --- Taken from Smelly_Combo :P -local colors = { - {.69, .31, .31, 1}, - {.65, .42, .31, 1}, - {.65, .63, .35, 1}, - {.46, .63, .35, 1}, - {.33, .63, .33, 1}, -} - - -local mover = CreateFrame("Frame", "TukuiComboPointsMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Combo Points", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local cpoints = CreateFrame("Frame", "TukuiComboPoints", UIParent) -cpoints:Width(tbWidth) -cpoints:Height(tbHeight) -cpoints:Point("CENTER", mover) - -local points = {} - -for i=1,MAX_COMBO_POINTS do - points[i] = CreateFrame("Frame", "TukuiComboPoints_Point"..i, cpoints) - points[i]:SetWidth((tbWidth-(MAX_COMBO_POINTS-1)) / MAX_COMBO_POINTS) - points[i]:SetHeight(tbHeight) - points[i]:CreateBackdrop("Transparent") - points[i].backdrop:ThickBorder() - points[i].tex = points[i]:CreateTexture(nil, "OVERLAY") - points[i].tex:SetTexture(C.media.normTex) - points[i].tex:SetVertexColor(unpack(colors[i])) - points[i].tex:AllPoints(points[i]) - if i==1 then - points[i]:SetPoint("LEFT", cpoints, "LEFT", 0, 0) - else - points[i]:SetPoint("LEFT", points[i-1], "RIGHT", 5, 0) - end -end - -local function UpdatePoints() - local numPoints = GetComboPoints("player", "target") - if numPoints <= 0 then - cpoints:Hide() - else - cpoints:Show() - for i = 1, 5 do - if (i <= numPoints) then - points[i].tex:Show() - else - points[i].tex:Hide() - end - end - end -end - - -cpoints:RegisterEvent("UNIT_COMBO_POINTS") -cpoints:RegisterEvent("PLAYER_TARGET_CHANGED") -cpoints:RegisterEvent("PLAYER_ENTERING_WORLD") -cpoints:SetScript("OnEvent", UpdatePoints) \ No newline at end of file diff --git a/SaftUI/modules/classbars/eclipsebar.lua b/SaftUI/modules/classbars/eclipsebar.lua deleted file mode 100644 index b966b37..0000000 --- a/SaftUI/modules/classbars/eclipsebar.lua +++ /dev/null @@ -1,110 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.eclipseBar[1] ~= true or T.myclass ~= "DRUID" then return end - -local tbWidth, tbHeight = C.classbar.eclipseBar[2], C.classbar.eclipseBar[3] - -local SPELL_POWER_ECLIPSE = SPELL_POWER_ECLIPSE -local MOONKIN_FORM = MOONKIN_FORM - -local mover = CreateFrame("Frame", "TukuiEclipseMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Eclipse Bar", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local eBar = CreateFrame("Frame", "TukuiEclipseBar", UIParent) -eBar:Width(tbWidth) -eBar:Height(tbHeight) -eBar:Point("CENTER", mover) -eBar:CreateBackdrop("Transparent") -eBar.backdrop:ThickBorder() - -eBar.lunar = CreateFrame("StatusBar", "TukuiEclipseBar_LunarBar", eBar) -eBar.lunar:SetPoint('LEFT', eBar, 'LEFT', 0, 0) -eBar.lunar:SetSize(eBar:GetWidth(), eBar:GetHeight()) -eBar.lunar:SetStatusBarTexture(C.media.normTex) -eBar.lunar:SetStatusBarColor(.50, .52, .70) - -eBar.solar = CreateFrame('StatusBar', "TukuiEclipseBar_SolarBar", eBar) -eBar.solar:SetPoint('LEFT', eBar.lunar:GetStatusBarTexture(), 'RIGHT', 0, 0) -eBar.solar:SetSize(eBar:GetWidth(), eBar:GetHeight()) -eBar.solar:SetStatusBarTexture(C.media.normTex) -eBar.solar:SetStatusBarColor(.80, .82, .60) - -eBar.tframe = CreateFrame("Frame", nil, eBar) -eBar.tframe:SetAllPoints(eBar) -eBar.tframe:SetFrameLevel(eBar:GetFrameLevel()+2) - -eBar.tframe:FontString("text", unpack(C.pFont)) -eBar.tframe.text:SetPoint("TOPLEFT", eBar.tframe, 0, 0) -eBar.tframe.text:SetPoint("BOTTOMRIGHT", eBar.tframe, 0, 2) -eBar.tframe.text:SetJustifyH("CENTER") -eBar.tframe.text:SetJustifyV("CENTER") - -local updateBar = function(self, event, unit, powerType) - if (event ~= "PLAYER_ENTERING_WORLD") and (unit ~= "player" or powerType ~= 'ECLIPSE') then return end - - local power = UnitPower('player', SPELL_POWER_ECLIPSE) - local maxPower = UnitPowerMax('player', SPELL_POWER_ECLIPSE) - self.lunar:SetMinMaxValues(-maxPower, maxPower) - self.lunar:SetValue(power) - self.solar:SetMinMaxValues(-maxPower, maxPower) - self.solar:SetValue(-power) - - --taken from functions.lua - local dir = GetEclipseDirection() - if dir == "sun" then - self.tframe.text:SetText("|cffE5994C"..L.unitframes_ouf_starfirespell.."|r") - elseif dir == "moon" then - self.tframe.text:SetText("|cff4478BC"..L.unitframes_ouf_wrathspell.."|r") - else - self.tframe.text:SetText("") - end -end - -local function toggleBar(self, event) - local form = GetShapeshiftFormID() - if form and (form == MOONKIN_FORM) then - self:Show() - else - self:Hide() - end - if event == "PLAYER_ENTERING_WORLD" then - self:UnregisterEvent("PLAYER_ENTERING_WORLD") - end -end - -local function OnEvent(self, event, ...) - if event == "PLAYER_ENTERING_WORLD" then - toggleBar(self, event) - updateBar(self, event, ...) - elseif event == "UPDATE_SHAPESHIFT_FORM" then - toggleBar(self, event) - elseif event == "UNIT_POWER" then - updateBar(self, event, ...) - end -end - -eBar:RegisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE) -eBar:RegisterEvent('UNIT_AURA', UNIT_AURA) -eBar:RegisterEvent('UNIT_POWER') -eBar:RegisterEvent('UPDATE_SHAPESHIFT_FORM') -eBar:RegisterEvent('PLAYER_ENTERING_WORLD') -eBar:SetScript("OnEvent", OnEvent) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - eBar:Hide() - else - eBar:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/fulmination.lua b/SaftUI/modules/classbars/fulmination.lua deleted file mode 100644 index 6ca9090..0000000 --- a/SaftUI/modules/classbars/fulmination.lua +++ /dev/null @@ -1,107 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.fulmTracker[1] ~= true or T.myclass ~= "SHAMAN" then return end - -local tbWidth, tbHeight = C.classbar.fulmTracker[2], C.classbar.fulmTracker[3] - -local colors = { - { 0/255, 75/255, 1, 1}, - { 0/255, 100/255, 1, 1}, - { 0/255, 125/255, 1, 1}, - { 0/255, 150/255, 1, 1}, - { 0/255, 175/255, 1, 1}, - { 0/255, 200/255, 1, 1}, -} - - -local mover = CreateFrame("Frame", "TukuiFulminationMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -if C.classbar.totemTimers then - mover:Point("BOTTOM", TukuiTotemTimers, "TOP", 0, 6) -else - mover:Point("TOP", UIParent, "CENTER", 0, -150) -end -mover:SetTemplate("Thin") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Fulmination Tracker", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local fTracker = CreateFrame("Frame", "TukuiFulminationTracker", UIParent) -fTracker:Width(tbWidth) -fTracker:Height(tbHeight) -fTracker:Point("CENTER", mover) - -local stacks = {} - -for i=1,6 do - stacks[i] = CreateFrame("Frame", "TukuiFulminationTracker_Stack"..(i), fTracker) - stacks[i]:SetWidth((tbWidth-25) / 6) - stacks[i]:SetHeight(tbHeight) - stacks[i]:CreateBackdrop("Transparent") - stacks[i].backdrop:ThickBorder() - stacks[i].tex = stacks[i]:CreateTexture(nil, "OVERLAY") - stacks[i].tex:SetTexture(C.media.normTex) - stacks[i].tex:SetVertexColor(unpack(colors[i])) - stacks[i].tex:AllPoints(stacks[i]) - if i==1 then - stacks[i]:SetPoint("LEFT", fTracker, "LEFT", 0, 0) - else - stacks[i]:SetPoint("LEFT", stacks[i-1], "RIGHT", 5, 0) - end -end - -local function HasFulmination() - local hasFulm - for i=1, GetNumTalents(1) do - nameTalent, icon, tier, column, currRank, maxRank= GetTalentInfo(1,i); - if nameTalent == "Fulmination" then - if currRank > 0 then - hasFulm = true - end - end - end - return hasFulm -end - - - -local function UpdateStacks(self, event, unit) - if (event ~= "PLAYER_ENTERING_WORLD") and (unit ~= "player") then return end - local _, _, _, numStacks, _, duration, expires = UnitBuff("player", "Lightning Shield") - if numStacks == nil then - numStacks = 0 - else - numStacks = numStacks - 3 - end - for i = 1, 6 do - if (i <= numStacks) then - stacks[i].tex:Show() - else - stacks[i].tex:Hide() - end - end - if HasFulmination() then - fTracker:Show() - else - fTracker:Hide() - end -end - -fTracker:RegisterEvent("UNIT_AURA") -fTracker:RegisterEvent("PLAYER_ENTERING_WORLD") -fTracker:RegisterEvent("HEALTH_REGEN_ENABLED") -fTracker:SetScript("OnEvent", UpdateStacks) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - fTracker:Hide() - else - fTracker:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/holypower.lua b/SaftUI/modules/classbars/holypower.lua deleted file mode 100644 index 0214b8c..0000000 --- a/SaftUI/modules/classbars/holypower.lua +++ /dev/null @@ -1,66 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.holyPower[1] ~= true or T.myclass ~= "PALADIN" then return end - -local tbWidth, tbHeight = C.classbar.holyPower[2], C.classbar.holyPower[3] - -local mover = CreateFrame("Frame", "TukuiHolyPowerMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Holy Power", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local hPower = CreateFrame("Frame", "TukuiHolyPower", UIParent) -hPower:Width(tbWidth) -hPower:Height(tbHeight) -hPower:Point("CENTER", mover) - -local charges = {} - -for i=1,3 do - charges[i] = CreateFrame("Frame", "TukuiHolyPower_Charge"..i, hPower) - charges[i]:SetWidth((tbWidth-10) / 3) - charges[i]:SetHeight(tbHeight) - charges[i]:CreateBackdrop("Transparent") - charges[i].backdrop:ThickBorder() - charges[i].tex = charges[i]:CreateTexture(nil, "OVERLAY") - charges[i].tex:SetTexture(C.media.normTex) - charges[i].tex:SetVertexColor(225/255,225/255,15/255) - charges[i].tex:AllPoints(charges[i]) - if i==1 then - charges[i]:SetPoint("LEFT", hPower, "LEFT", 0, 0) - else - charges[i]:SetPoint("LEFT", charges[i-1], "RIGHT", 5, 0) - end -end - -local function UpdateCharges() - local numCharges = UnitPower("player", SPELL_POWER_HOLY_POWER) - for i = 1, 3 do - if (i <= numCharges) then - charges[i].tex:Show() - else - charges[i].tex:Hide() - end - end -end - -hPower:RegisterEvent("UNIT_POWER") -hPower:RegisterEvent("PLAYER_ENTERING_WORLD") -hPower:SetScript("OnEvent", UpdateCharges) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - hPower:Hide() - else - hPower:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/runebars.lua b/SaftUI/modules/classbars/runebars.lua deleted file mode 100644 index d46ae6b..0000000 --- a/SaftUI/modules/classbars/runebars.lua +++ /dev/null @@ -1,93 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.runeBars[1] ~= true or T.myclass ~= "DEATHKNIGHT" then return end - -local tbWidth, tbHeight = C.classbar.runeBars[2], C.classbar.runeBars[3] - -RuneFrame:Kill() - -local total = 1 -local delay = 0.03 -local GetRuneType, GetRuneCooldown, SetValue, GetTime = GetRuneType, GetRuneCooldown, SetValue, GetTime - -local colors = { - {1, 0, 0}; - {0, .5, 0}; - {0, 1, 1}; - {.9, .1, 1}; -} - -local mover = CreateFrame("Frame", "TukuiRuneBarsMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Rune Bars", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local runebars = CreateFrame("Frame", "TukuiRuneBars", UIParent) -runebars:Width(tbWidth) -runebars:Height(tbHeight) -runebars:Point("CENTER", mover) - -local runes = {} - -for i=1,6 do - runes[i] = CreateFrame("StatusBar", "TukuiRuneBars_Rune"..i, runebars) - runes[i]:SetWidth((tbWidth-25) / 6) - runes[i]:SetHeight(tbHeight) - if runes[i]:GetHeight() > runes[i]:GetWidth() then - runes[i]:SetOrientation("VERTICAL") - else - runes[i]:SetOrientation("HORIZONTAL") - end - if i==1 then - runes[i]:SetPoint("LEFT", runebars, 0, 0) - else - runes[i]:SetPoint("LEFT", runes[i-1], "RIGHT", 5, 0) - end - runes[i]:SetStatusBarTexture(C.media.normTex) - runes[i]:CreateBackdrop("Transparent") - runes[i].backdrop:ThickBorder() - - runes[i]:AddText("timer", "", "CENTER") -end - -local function UpdateRune(i) - local start, duration, finished = GetRuneCooldown(i) - local runetype = GetRuneType(i) - - runes[i]:SetStatusBarColor(unpack(colors[runetype])) - runes[i]:SetMinMaxValues(0, duration) - if finished then - runes[i]:SetValue(duration) - runes[i].timer:SetText("") - else - runes[i]:SetValue(GetTime() - start) - runes[i].timer:SetFormattedText("%01d", duration - (GetTime() - start)) - end -end - -runebars:SetScript("OnUpdate", function(self, elapsed) - total = total + elapsed - if (total > .01) then - for i=1, 6 do - UpdateRune(i) - end - end - total = 0 -end) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - runebars:Hide() - else - runebars:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/soulshards.lua b/SaftUI/modules/classbars/soulshards.lua deleted file mode 100644 index f0b98a4..0000000 --- a/SaftUI/modules/classbars/soulshards.lua +++ /dev/null @@ -1,66 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.soulShards[1] ~= true or T.myclass ~= "WARLOCK" then return end - -local tbWidth, tbHeight = C.classbar.soulShards[2], C.classbar.soulShards[3] - -local mover = CreateFrame("Frame", "TukuiSoulShardsMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Soul Shards", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local sshards = CreateFrame("Frame", "TukuiSoulShards", UIParent) -sshards:Width(tbWidth) -sshards:Height(tbHeight) -sshards:Point("CENTER", mover) - -local shards = {} - -for i=1,3 do - shards[i] = CreateFrame("Frame", "TukuiSoulShards_Shard"..i, sshards) - shards[i]:SetWidth((tbWidth-2) / 3) - shards[i]:SetHeight(tbHeight) - shards[i]:CreateBackdrop("Transparent") - shards[i].backdrop:ThickBorder() - shards[i].tex = shards[i]:CreateTexture(nil, "OVERLAY") - shards[i].tex:SetTexture(C.media.normTex) - shards[i].tex:SetVertexColor(150/255,100/255,250/255) - shards[i].tex:AllPoints(shards[i]) - if i==1 then - shards[i]:SetPoint("LEFT", sshards, "LEFT", 0, 0) - else - shards[i]:SetPoint("LEFT", shards[i-1], "RIGHT", 5, 0) - end -end - -local function UpdateShards() - local numShards = UnitPower("player", SPELL_POWER_SOUL_SHARDS) - for i = 1, 3 do - if (i <= numShards) then - shards[i].tex:Show() - else - shards[i].tex:Hide() - end - end -end - -sshards:RegisterEvent("UNIT_POWER") -sshards:RegisterEvent("PLAYER_ENTERING_WORLD") -sshards:SetScript("OnEvent", UpdateShards) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - sshards:Hide() - else - sshards:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/stClassBars.toc b/SaftUI/modules/classbars/stClassBars.toc deleted file mode 100644 index 861dd5f..0000000 --- a/SaftUI/modules/classbars/stClassBars.toc +++ /dev/null @@ -1,16 +0,0 @@ -## Interface: 40300 -## Author: Safturento -## Version: 0.1 -## Title: |cff00aaffst|rClassBars -## Notes: Minimalist class specific modules - -core.lua -arcaneblast.lua -combopoints.lua -eclipsebar.lua -fulmination.lua -holypower.lua -runebars.lua -soulshards.lua -thunderclap.lua -totemtimers.lua \ No newline at end of file diff --git a/SaftUI/modules/classbars/thunderclap.lua b/SaftUI/modules/classbars/thunderclap.lua deleted file mode 100644 index 2f14b0a..0000000 --- a/SaftUI/modules/classbars/thunderclap.lua +++ /dev/null @@ -1,133 +0,0 @@ -if true then return end -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.thunderclap[1] ~= true or T.myclass ~= "WARRIOR" then return end - -local colors = { - { 0/255, 75/255, 1, 1}, - { 0/255, 100/255, 1, 1}, - { 0/255, 125/255, 1, 1}, - { 0/255, 150/255, 1, 1}, -} - -local tbWidth, tbHeight = C.classbar.thunderclap[2], C.classbar.thunderclap[3] - -local total = 0 - -local mover = CreateFrame("Frame", "TukuiThunderclapMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thick") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Thunderclap Tracker", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local tClap = CreateFrame("Frame", "TukuiThunderclapTracker", UIParent) -tClap:Width(tbWidth) -tClap:Height(tbHeight) -tClap:Point("CENTER", mover) -tClap:CreateBackdrop("Transparent") - - -local stacks = {} - -for i=1,3 do - stacks[i] = CreateFrame("Frame", "TukuiThunderclap_Stack"..i, tClap) - stacks[i]:SetWidth((tbWidth-2) / 3) - stacks[i]:SetHeight(tbHeight) - stacks[i]:CreateBackdrop("Transparent") - stacks[i].tex = stacks[i]:CreateTexture(nil, "OVERLAY") - stacks[i].tex:SetTexture(C.media.normTex) - stacks[i].tex:SetVertexColor(unpack(colors[i])) - stacks[i].tex:AllPoints(stacks[i]) - if i==1 then - stacks[i]:SetPoint("LEFT", tClap, "LEFT", 0, 0) - else - stacks[i]:SetPoint("LEFT", stacks[i-1], "RIGHT", 5, 0) - end - stacks[i].tex:Hide() -end - -local function HasThunderstruckTalent() - local hasThunderstruck - for i=1, GetNumTalents(3) do - nameTalent, icon, tier, column, currRank, maxRank = GetTalentInfo(3,i); - if nameTalent == "Thunderstruck" then - if currRank > 0 then - hasThunderstruck = true - end - end - end - return hasThunderstruck -end - -local function UpdateStacks() - local _, _, _, tClapStacks, _, tClapDuration, tClapExpires = UnitBuff("player", "Thunderstruck") - if tClapStacks == nil then tClapStacks = 0 end - for i = 1, 3 do - if (i <= tClapStacks) then - stacks[i].tex:Show() - else - stacks[i].tex:Hide() - end - end -end - --- Red border if target is missing rend, then shows blue if 3 stacks of thunderclap, then shows green if thunderclap is off CD, then shows regular border -local function UpdateBorder() - if not InCombatLockdown() then return end - local _, _, _, _, _, rendDuration, rendExpires = UnitDebuff("target", "Rend") - local _, _, _, tClapStacks, _, tClapDuration, tClapExpires = UnitBuff("player", "Thunderstruck") - local tClapUsable = GetSpellCooldown("Thunderclap") - if not rendDuration then - tClap.backdrop:SetBackdropBorderColor(1, 0, 0) - elseif tClapStacks == 3 then - tClap.backdrop:SetBackdropBorderColor(0, 1, 0) - elseif tClapUsable then - tClap.backdrop:SetBackdropBorderColor(0, 1, 1) - else - tClap.backdrop:SetTemplate("ThickTransparent") - end -end - -local function UpdateFrameState() - if HasThunderstruckTalent() then - tClap:Show() - tClap:SetScript("OnUpdate", OnUpdate) - else - tClap:Hide() - tClap:SetScript("OnUpdate", nil) - end -end - -local function OnEvent(self, event, ...) - if event == "PLAYER_ENTERING_WORLD" or event == "PLAYER_TALENT_UPDATE" or event == "ACTIVE_TALENT_GROUP_cHANGED" then - UpdateFrameState() - elseif event == "UNIT_AURA" then - UpdateStacks() - UpdateBorder() - elseif event == "PLAYER_TARGET_CHANGED" then - UpdateBorder() - end -end - -tClap:RegisterEvent("PLAYER_ENTERING_WORLD") -tClap:RegisterEvent("PLAYER_TALENT_UPDATE") -tClap:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") -tClap:RegisterEvent("PLAYER_TARGET_CHANGED") -tClap:RegisterEvent("UNIT_AURA") -tClap:SetScript("OnEvent", OnEvent) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - tClap:Hide() - else - tClap:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/classbars/totemtimers.lua b/SaftUI/modules/classbars/totemtimers.lua deleted file mode 100644 index f900dba..0000000 --- a/SaftUI/modules/classbars/totemtimers.lua +++ /dev/null @@ -1,134 +0,0 @@ -local T, C, L = unpack(Tukui) -- Import: T - functions, constants, variables; C - config; L - locales -if C.classbar.totemTimers[1] ~= true or T.myclass ~= "SHAMAN" then return end - -local tbWidth, tbHeight = C.classbar.totemTimers[2], C.classbar.totemTimers[3] - -local total = 0 -local delay = 0.01 -local GetTotemInfo, SetValue, GetTime = GetTotemInfo, SetValue, GetTime - --- In the order, fire, earth, water, air -local colors = { - [1] = {.58,.23,.10}, - [2] = {.23,.45,.13}, - [3] = {.19,.48,.60}, - [4] = {.42,.18,.74}, -} - -local mover = CreateFrame("Frame", "TukuiTotemTimersMover", UIParent) -mover:Width(tbWidth+4) -mover:Height(tbHeight+4) -mover:Point("TOP", UIParent, "CENTER", 0, -150) -mover:SetTemplate("Thin") -mover:SetBackdropBorderColor(1,0,0) -mover:SetClampedToScreen(true) -mover:SetMovable(true) -mover:SetFrameStrata("HIGH") -mover:AddText("text", "Move Totem Timers", "CENTER") -mover:Hide() -tinsert(T.AllowFrameMoving, mover) - -local tTimers = CreateFrame("Frame", "TukuiTotemTimers", UIParent) -tTimers:Width(tbWidth) -tTimers:Height(tbHeight) -tTimers:Point("CENTER", mover) - -local totems = {} - -for i=1,4 do - totems[i] = CreateFrame("StatusBar", "TukuiTotemTimers_TotemBar"..i, tTimers) - totems[i]:SetWidth((tbWidth-15) / 4) - totems[i]:SetHeight(tbHeight) - if totems[i]:GetHeight() > totems[i]:GetWidth() then - totems[i]:SetOrientation("VERTICAL") - else - totems[i]:SetOrientation("HORIZONTAL") - end - totems[i]:SetStatusBarTexture(C.media.normTex) - totems[i]:CreateBackdrop("Transparent") - totems[i].backdrop:ThickBorder() - - totems[i]:FontString("timer", unpack(C.pFont)) - totems[i].timer:SetPoint("CENTER", 0, 1) -end - --- re-arrange the order -totems[2]:Point("LEFT", tTimers, "LEFT", 0, 0) -totems[1]:Point("LEFT", totems[2], "RIGHT", 5, 0) -totems[3]:Point("LEFT", totems[1], "RIGHT", 5, 0) -totems[4]:Point("LEFT", totems[3], "RIGHT", 5, 0) - -function ToClock(seconds) - seconds = ceil(tonumber(seconds)) - if(seconds <= 0) then - return " " - elseif seconds < 600 then - local d, h, m, s = ChatFrame_TimeBreakDown(seconds) - return format("%01d:%02d", m, s) - elseif(seconds < 3600) then - local d, h, m, s = ChatFrame_TimeBreakDown(seconds); - return format("%02d:%02d", m, s) - else - return "1 hr+" - end -end - -local function GetTimeLeft(slot) - local havetotem, name, startTime, duration, totemIcon = GetTotemInfo(slot) - return (duration-(GetTime() - startTime)) -end - -local function UpdateSlot() - for slot=1, 4 do - local havetotem, name, startTime, duration, totemIcon = GetTotemInfo(slot) - totems[slot]:SetStatusBarColor(unpack(colors[slot])) - totems[slot]:SetValue(0) - - totems[slot].ID = slot - - -- If we have a totems then set his value - if(havetotem) then - if(duration >= 0) then - totems[slot]:SetMinMaxValues(0, duration) - totems[slot]:SetValue(GetTimeLeft(slot)) -- -(GetTime() - startTime)) - totems[slot].timer:SetText() - -- Status bar update - totems[slot]:SetScript("OnUpdate",function(self,elapsed) - total = total + elapsed - if total >= delay then - total = 0 - havetotem, name, startTime, duration, totemIcon = GetTotemInfo(self.ID) - if (GetTimeLeft(slot) >= 0) then --(GetTime() - startTime) <= 0) then - self:SetValue(GetTimeLeft(slot)) - totems[slot].timer:SetText(ToClock(GetTimeLeft(slot))) - else - self:SetValue(0) - totems[slot].timer:SetText(" ") - end - end - end) - else - -- There's no need to update because it doesn't have any duration - totems[slot]:SetScript("OnUpdate",nil) - totems[slot]:SetValue(0) - end - else - -- No totems = no time - totems[slot]:SetValue(0) - end - end -end - -tTimers:RegisterEvent("PLAYER_ENTERING_WORLD") -tTimers:RegisterEvent("PLAYER_TOTEM_UPDATE") -tTimers:SetScript("OnEvent", UpdateSlot) - -local vehicle = CreateFrame("Frame") -vehicle:RegisterEvent("VEHICLE_UPDATE") -vehicle:SetScript("OnEvent", function() - if UnitHasVehicleUI("player") then - tTimers:Hide() - else - tTimers:Show() - end -end) \ No newline at end of file diff --git a/SaftUI/modules/threatbar.lua b/SaftUI/modules/threatbar.lua new file mode 100644 index 0000000..9b82e99 --- /dev/null +++ b/SaftUI/modules/threatbar.lua @@ -0,0 +1,16 @@ +local function ReskinThreat() + if not TukuiThreatBar then return end + + local tb = TukuiThreatBar + tb:AllPoints(TukuiTarget.Detail, 2) + tb:SetOrientation("VERTICAL") + tb:SetFrameLevel(TukuiTarget.Detail:GetFrameLevel()+2) + tb:SetFrameStrata(TukuiTarget.Detail:GetFrameStrata()) + + tb.text:Kill() + tb.Title:Kill() +end + +local f = CreateFrame("frame") +f:RegisterEvent("PLAYER_ENTERING_WORLD") +f:SetScript("OnEvent", ReskinThreat) \ No newline at end of file diff --git a/SaftUI/modules/unitframes/groups/core.lua b/SaftUI/modules/unitframes/groups/core.lua index 4bdcbd6..2903a17 100644 --- a/SaftUI/modules/unitframes/groups/core.lua +++ b/SaftUI/modules/unitframes/groups/core.lua @@ -1,134 +1,33 @@ --- raid editing guide by hydra/tukz - local T, C, L = unpack(Tukui) +local oUF = oUFTukui or oUF --------------------------------------------------------------- --- 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) - +function T.PostUpdateRaidUnit(self) if T.groupframefuncs["general"] then - T.groupframefuncs["general"](frame) + T.groupframefuncs["general"](self) 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("showPlayer", true) - 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") + if strfind(self:GetName(), "TukuiPartyPet") then return end + local header = self:GetParent() + local layout = header:GetName() - -- don't need to load, because we will reload anyway after user select their layout - if heal and dps then return end + self:SetSize(C.unitframes.Groups[layout].width, C.unitframes.Groups[layout].height) - 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) + if T.groupframefuncs[layout] then + T.groupframefuncs[layout](self) end +end - -- init, here we modify the initial Config. - local function SpawnHeader(name, layout, visibility, ...) - EditUnitAttributes(layout) - end +local function SpawnHeader(name, layout, visibility, ...) + if not C.unitframes.Groups[layout] then return 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) + _G[layout]:SetAttribute("showPlayer", true) + _G[layout]:SetAttribute("showSolo", true) 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() + if addon == "Tukui_Raid_Healing" or addon == "Tukui_Raid" then + hooksecurefunc(oUF, "SpawnHeader", SpawnHeader) end end) \ No newline at end of file diff --git a/SaftUI/modules/unitframes/groups/dpsraid25.lua b/SaftUI/modules/unitframes/groups/dpsraid25.lua index b8f1775..5a65e62 100644 --- a/SaftUI/modules/unitframes/groups/dpsraid25.lua +++ b/SaftUI/modules/unitframes/groups/dpsraid25.lua @@ -6,6 +6,7 @@ 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 diff --git a/SaftUI/modules/unitframes/groups/general.lua b/SaftUI/modules/unitframes/groups/general.lua index c4ccd6e..5736052 100644 --- a/SaftUI/modules/unitframes/groups/general.lua +++ b/SaftUI/modules/unitframes/groups/general.lua @@ -4,6 +4,8 @@ local oUF = oUFTukui or oUF local barTex = T.GetBarTexture() +T.groupframefuncs = {} + T.groupframefuncs["general"] = function(self) self:ThickBorder() self:SetTemplate("Transparent") diff --git a/SaftUI/modules/unitframes/stUnitFrames.xml b/SaftUI/modules/unitframes/stUnitFrames.xml index 09294b5..f485414 100644 --- a/SaftUI/modules/unitframes/stUnitFrames.xml +++ b/SaftUI/modules/unitframes/stUnitFrames.xml @@ -9,10 +9,10 @@ <Script file="units\pet.lua"/> <Script file="units\focus.lua"/> - <Script file="groups\core.lua"/> <Script file="groups\general.lua"/> <Script file="groups\dpsraid25.lua"/> <Script file="groups\dpsraid40.lua"/> <Script file="groups\healraid15.lua"/> <Script file="groups\healraid40.lua"/> + <Script file="groups\core.lua"/> </Ui> \ No newline at end of file diff --git a/SaftUI/modules/unitframes/units/core.lua b/SaftUI/modules/unitframes/units/core.lua index e964f6a..b8999fa 100644 --- a/SaftUI/modules/unitframes/units/core.lua +++ b/SaftUI/modules/unitframes/units/core.lua @@ -14,8 +14,7 @@ local DefaultPositions = { T.unitframefuncs = {} local function LoadUnitFrames(self) --Only run this once - self:UnregisterAllEvents() - self:SetScript("OnEvent", nil) + self:UnregisterAllEvents() for k, obj in next, oUF.objects do if T.unitframefuncs.general then diff --git a/SaftUI/modules/unitframes/units/general.lua b/SaftUI/modules/unitframes/units/general.lua index 2384f19..123912a 100644 --- a/SaftUI/modules/unitframes/units/general.lua +++ b/SaftUI/modules/unitframes/units/general.lua @@ -50,6 +50,7 @@ T.unitframefuncs["general"] = function(self) power:AddSpark() power.PostUpdate = T.PostUpdatePower if power.value then + power.value.colorPower = true power.value:SetFont(T.GetPixelFont()) power.value:SetShadowOffset(0, 0) end diff --git a/SaftUI/modules/unitframes/units/player.lua b/SaftUI/modules/unitframes/units/player.lua index a879654..5a4a836 100644 --- a/SaftUI/modules/unitframes/units/player.lua +++ b/SaftUI/modules/unitframes/units/player.lua @@ -5,6 +5,9 @@ local oUF = oUFTukui or oUF T.unitframefuncs["TukuiPlayer"] = function(self) local enabled, width, height = T.GetUnitConfig("player") + self.width = width + self.height = height + self.Health:ClearAllPoints() self.Health:SetPoint("TOPLEFT", 2, -2) self.Health:SetPoint("BOTTOMRIGHT", self, "RIGHT", -2, 0) @@ -37,5 +40,6 @@ T.unitframefuncs["TukuiPlayer"] = function(self) self.Castbar.button:SetSize(size, size) end - T.KillClassBars(self) + if T.classFuncs[T.myclass] then T.classFuncs[T.myclass](self) end + if T.classFuncs.GENERAL then T.classFuncs.GENERAL(self) end end \ No newline at end of file diff --git a/SaftUI/modules/unitframes/units/target.lua b/SaftUI/modules/unitframes/units/target.lua index 03dfab0..c4c9901 100644 --- a/SaftUI/modules/unitframes/units/target.lua +++ b/SaftUI/modules/unitframes/units/target.lua @@ -52,6 +52,4 @@ T.unitframefuncs["TukuiTarget"] = function(self) local size = castbar:GetHeight()+power:GetHeight()+11 castbar.button:SetSize(size, size) end - - T.KillClassBars(self) end \ No newline at end of file