diff --git a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua index cbab8c4..29ad08a 100644 --- a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua +++ b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua @@ -540,7 +540,7 @@ end CONSTRUCTS ########################################################## ]]-- -function Mentalo:New(frame, moveName, title, snap, dragStopFunc) +function Mentalo:New(frame, moveName, title, snap, dragStopFunc, callbackOnEnter) if(not frame or (self.Frames[moveName] ~= nil)) then return end self.Frames[moveName] = { @@ -600,7 +600,7 @@ function Mentalo:New(frame, moveName, title, snap, dragStopFunc) movable:SetMovable(true) movable:Hide() - if(dragStopFunc and (type(dragStopFunc) == "function")) then + if(dragStopFunc and (type(dragStopFunc) == "function") and callbackOnEnter) then movable:RegisterEvent("PLAYER_ENTERING_WORLD") movable:SetScript("OnEvent", function(this, event) local point = Pinpoint(this) @@ -630,14 +630,14 @@ function Mentalo:ChangeSnapOffset(frameName, snapOffset) _G[frameName].snapOffset = snapOffset or -2; end -function Mentalo:Add(frame, title, snapOffset, dragStopFunc, overrideName) +function Mentalo:Add(frame, title, snapOffset, dragStopFunc, overrideName, callbackOnEnter) if(not frame or (not overrideName and not frame:GetName())) then return end local frameName = overrideName or frame:GetName() local moveName = ("%s_MOVE"):format(frameName) - self:New(frame, moveName, title, snapOffset, dragStopFunc) + self:New(frame, moveName, title, snapOffset, dragStopFunc, callbackOnEnter) end -function Mentalo:Reset(request) +function Mentalo:Reset(request, bypass) if(request == "" or request == nil) then for frameName, frameData in pairs(self.Frames) do local frame = _G[frameName]; @@ -645,8 +645,10 @@ function Mentalo:Reset(request) local u, v, w, x, y = split("\031", frameData.point) frame:ClearAllPoints() frame:SetPoint(u, v, w, x, y) - if(frameData.postdrag and (type(frameData.postdrag) == "function")) then - frameData.postdrag(frame, Pinpoint(frame)) + if(not bypass) then + if(frameData.postdrag and (type(frameData.postdrag) == "function")) then + frameData.postdrag(frame, Pinpoint(frame)) + end end end if(SV.cache.Anchors and SV.cache.Anchors[frameName]) then @@ -660,8 +662,10 @@ function Mentalo:Reset(request) local u, v, w, x, y = split("\031", frameData.point) frame:ClearAllPoints() frame:SetPoint(u, v, w, x, y) - if (frameData.postdrag and (type(frameData.postdrag) == "function"))then - frameData.postdrag(frame, Pinpoint(frame)) + if(not bypass) then + if(frameData.postdrag and (type(frameData.postdrag) == "function")) then + frameData.postdrag(frame, Pinpoint(frame)) + end end if(SV.cache.Anchors and SV.cache.Anchors[frameName]) then SV.cache.Anchors[frameName] = nil diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua index 194871f..108c54a 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua @@ -113,7 +113,16 @@ local Update = function(self, event, unit, powerType) fury.bar:SetStatusBarColor(unpack(colors)) fury.bar:SetMinMaxValues(0, maxPower) fury.bar:SetValue(power) - fury.bar.text:SetText(power) + fury.text:SetText(power) + if(percent > 99) then + fury.text:SetTextColor(1,0,0) + elseif(percent > 80) then + fury.text:SetTextColor(1,0.5,0) + elseif(percent > 50) then + fury.text:SetTextColor(1,1,0) + else + fury.text:SetTextColor(1,1,1) + end if(fury.bar.Update) then local filled = (percent > 80) and 1 or 0 diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 96aaa64..c2e22c5 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -232,15 +232,15 @@ end local function SetFilterMenu(self) for i = LE_BAG_FILTER_FLAG_EQUIPMENT, NUM_LE_BAG_FILTER_FLAGS do - if(GetBagSlotFlag(self.id, i)) then + if(GetBagSlotFlag(self.internalID, i)) then BagFilters.buttons[i].activeTex:Show() else BagFilters.buttons[i].activeTex:Hide() end - BagFilters.buttons[i].BagID = self.id + BagFilters.buttons[i].BagID = self.internalID end - BagFilters.buttons[NUM_LE_BAG_FILTER_FLAGS + 1].BagID = self.id + BagFilters.buttons[NUM_LE_BAG_FILTER_FLAGS + 1].BagID = self.internalID local maxHeight = ((NUM_LE_BAG_FILTER_FLAGS) * 16) + 30 local maxWidth = 135 @@ -288,6 +288,93 @@ function MOD:INVENTORY_SEARCH_UPDATE() end end end +end + +function MOD:SlotUpdate(bagID, slotID) + if (self.Bags[bagID] and self.Bags[bagID].numSlots ~= GetContainerNumSlots(bagID)) or not self.Bags[bagID] or not self.Bags[bagID][slotID] then + return; + end + + local slot = self.Bags[bagID][slotID]; + local bagType = self.Bags[bagID].bagFamily; + + slot:Show() + + local texture, count, locked = GetContainerItemInfo(bagID, slotID); + local start, duration, enable = GetContainerItemCooldown(bagID, slotID); + local isQuestItem, questId, isActiveQuest = GetContainerItemQuestInfo(bagID, slotID); + + local itemID = GetContainerItemID(bagID, slotID); + if(itemID and VendorQueue[itemID]) then + slot.JunkIcon:Show() + else + slot.JunkIcon:Hide() + end + + local r,g,b = 0,0,0 + slot.HasQuestItem = nil + if(questId and (not isActiveQuest)) then + r,g,b = 1,0.3,0.3 + slot.questIcon:Show(); + slot.HasQuestItem = true; + elseif(questId or isQuestItem) then + r,g,b = 1,0.3,0.3 + slot.questIcon:Hide(); + slot.HasQuestItem = true; + elseif(bagType) then + r,g,b = bagType[1],bagType[2],bagType[3] + slot.questIcon:Hide(); + else + slot.questIcon:Hide(); + local itemLink = GetContainerItemLink(bagID, slotID); + if(itemLink) then + local rarity = select(3, GetItemInfo(itemLink)); + if(rarity) then + if(rarity > 1) then + r,g,b = GetItemQualityColor(rarity) + elseif(rarity == 0) then + slot.JunkIcon:Show() + end + end + else + if(GameTooltip:NumLines() ~= 0) then + GameTooltip:Hide() + end + end + end + + slot:SetBackdropColor(r,g,b,0.6) + slot:SetBackdropBorderColor(r,g,b,1) + + CooldownFrame_SetTimer(slot.cooldown, start, duration, enable); + + if((duration > 0) and (enable == 0)) then + SetItemButtonTextureVertexColor(slot, 0.4, 0.4, 0.4) + else + SetItemButtonTextureVertexColor(slot, 1, 1, 1) + end + + if(C_NewItems.IsNewItem(bagID, slotID)) then + C_NewItems.RemoveNewItem(bagID, slotID) + end + + if(slot.NewItemTexture) then slot.NewItemTexture:Hide() end; + if(slot.flashAnim) then slot.flashAnim:Stop() end; + if(slot.newitemglowAnim) then slot.newitemglowAnim:Stop() end; + + SetItemButtonTexture(slot, texture) + SetItemButtonCount(slot, count) + SetItemButtonDesaturated(slot, locked, 0.5, 0.5, 0.5) + + if(slot.GearInfo) then + local loc = format("%d_%d", bagID, slotID) + if(GEARSET_LISTING[loc]) then + local level = #GEARSET_LISTING[loc] < 4 and #GEARSET_LISTING[loc] or 3; + SetGearLabel(level, slot.GearInfo, GEARSET_LISTING[loc]) + else + SetGearLabel(0, slot.GearInfo, nil) + end + end end local SlotUpdate = function(self, slotID) @@ -375,10 +462,21 @@ local SlotUpdate = function(self, slotID) end end +function MOD:RefreshSlots(bagID) + if(self.Bags[bagID]) then + local bag = self.Bags[bagID] + local maxcount = GetContainerNumSlots(bagID) + for slotID = 1, maxcount do + bag:SlotUpdate(slotID) + end + end +end + local RefreshSlots = function(self) local bagID = self:GetID() if(not bagID) then return end local maxcount = GetContainerNumSlots(bagID) + --print("RefreshSlots BAG:" .. bagID) for slotID = 1, maxcount do self:SlotUpdate(slotID) end @@ -400,7 +498,7 @@ local BagMenu_OnEnter = function(self) local numSlots = GetContainerNumSlots(bagID) for slotID = 1, numSlots do if bag[slotID] then - if bagID == self.id then + if bagID == self.internalID then bag[slotID]:SetAlpha(1) else bag[slotID]:SetAlpha(0.1) @@ -453,8 +551,10 @@ local ContainerFrame_UpdateCooldowns = function(self) end local ContainerFrame_UpdateBags = function(self) - for bagID, bag in pairs(self.Bags) do - bag:RefreshSlots() + for _, bagID in ipairs(self.BagIDs) do + if self.Bags[bagID] then + self.Bags[bagID]:RefreshSlots(); + end end end @@ -507,22 +607,22 @@ local ContainerFrame_UpdateLayout = function(self) self.holderFrame:SetWidthToScale(holderWidth); local menu = self.BagMenu + local lastMenu; + for i, bagID in ipairs(self.BagIDs) do + if((not isBank and bagID <= 3) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots))) then - for i, bagID in ipairs(self.BagIDs) do - if((not isBank and bagID <= 3) or (isBank and (bagID ~= -1 and numContainerSlots >= 1))) then menu:SetSizeToScale(((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing, buttonSize + (buttonSpacing * 2)) - local bagSlot, globalName, bagTemplate; - - if isBank then - globalName = ("SVUI_BankBag%d"):format(bagID - 4); - bagTemplate = "BankItemButtonBagTemplate" - else - globalName = ("SVUI_MainBag%dSlot"):format(bagID); - bagTemplate = "BagSlotButtonTemplate" - end - if(not menu[i]) then + local bagSlot, globalName, bagTemplate; + if isBank then + globalName = "SVUI_BankBag" .. bagID - 4; + bagTemplate = "BankItemButtonBagTemplate" + else + globalName = "SVUI_MainBag" .. bagID .. "Slot"; + bagTemplate = "BagSlotButtonTemplate" + end + bagSlot = CreateFrame("CheckButton", globalName, menu, bagTemplate) bagSlot.parent = self; @@ -548,160 +648,144 @@ local ContainerFrame_UpdateLayout = function(self) if(isBank) then bagSlot:SetID(bagID - 4) - bagSlot.id = bagID; + bagSlot.internalID = bagID; else bagSlot:HookScript("OnClick", BagMenu_OnClick) - bagSlot.id = (bagID + 1); + bagSlot.internalID = (bagID + 1); end menu[i] = bagSlot; - else - bagSlot = menu[i] end - bagSlot:SetSizeToScale(buttonSize) - bagSlot:ClearAllPoints() + menu[i]:SetSizeToScale(buttonSize) + menu[i]:ClearAllPoints() if(isBank) then + BankFrameItemButton_Update(menu[i]) + BankFrameItemButton_UpdateLocked(menu[i]) + if(i == 2) then - bagSlot:SetPoint("BOTTOMLEFT", menu, "BOTTOMLEFT", buttonSpacing, buttonSpacing) + menu[i]:SetPoint("BOTTOMLEFT", menu, "BOTTOMLEFT", buttonSpacing, buttonSpacing) else - bagSlot:SetPoint("LEFT", menu[i - 1], "RIGHT", buttonSpacing, 0) - end - - if(bagSlot.GetInventorySlot) then - BankFrameItemButton_Update(bagSlot) - BankFrameItemButton_UpdateLocked(bagSlot) + menu[i]:SetPoint("LEFT", lastMenu, "RIGHT", buttonSpacing, 0) end else if(i == 1) then - bagSlot:SetPoint("BOTTOMLEFT", menu, "BOTTOMLEFT", buttonSpacing, buttonSpacing) + menu[i]:SetPoint("BOTTOMLEFT", menu, "BOTTOMLEFT", buttonSpacing, buttonSpacing) else - bagSlot:SetPoint("LEFT", menu[i - 1], "RIGHT", buttonSpacing, 0) + menu[i]:SetPoint("LEFT", lastMenu, "RIGHT", buttonSpacing, 0) end end + lastMenu = menu[i]; end local numSlots = GetContainerNumSlots(bagID); local bagName = ("%sBag%d"):format(containerName, bagID) - local template = (bagID == -1) and "BankItemButtonGenericTemplate" or "ContainerFrameItemButtonTemplate" local bag; if numSlots > 0 then if not self.Bags[bagID] then - bag = CreateFrame("Frame", bagName, self); - bag:SetID(bagID); - bag.SlotUpdate = SlotUpdate; - bag.RefreshSlots = RefreshSlots; - self.Bags[bagID] = bag - else - bag = self.Bags[bagID] + self.Bags[bagID] = CreateFrame("Frame", bagName, self); + self.Bags[bagID]:SetID(bagID); + self.Bags[bagID].SlotUpdate = SlotUpdate; + self.Bags[bagID].RefreshSlots = RefreshSlots; end - bag.numSlots = numSlots; - bag.bagFamily = false; + self.Bags[bagID].numSlots = numSlots; + self.Bags[bagID].bagFamily = false; local btype = select(2, GetContainerNumFreeSlots(bagID)); if RefProfessionColors[btype] then local r, g, b = unpack(RefProfessionColors[btype]); - bag.bagFamily = {r, g, b}; + self.Bags[bagID].bagFamily = {r, g, b}; end for i = 1, MAX_CONTAINER_ITEMS do - if bag[i] then - bag[i]:Hide(); + if self.Bags[bagID][i] then + self.Bags[bagID][i]:Hide(); end end for slotID = 1, numSlots do - local slot; totalSlots = totalSlots + 1; - if not bag[slotID] then + if not self.Bags[bagID][slotID] then local slotName = ("%sSlot%d"):format(bagName, slotID) local iconName = ("%sIconTexture"):format(slotName) local cdName = ("%sCooldown"):format(slotName) local questIcon = ("%sIconQuestTexture"):format(slotName) - slot = CreateFrame("CheckButton", slotName, bag, template); - slot:SetNormalTexture(""); - slot:SetCheckedTexture(""); - slot:RemoveTextures(); - slot:SetStylePanel("Slot", true, 1, 0, 0); + self.Bags[bagID][slotID] = CreateFrame("CheckButton", slotName, self.Bags[bagID], bagID == -1 and "BankItemButtonGenericTemplate" or "ContainerFrameItemButtonTemplate"); + self.Bags[bagID][slotID]:SetNormalTexture(""); + self.Bags[bagID][slotID]:SetCheckedTexture(""); + self.Bags[bagID][slotID]:RemoveTextures(); + self.Bags[bagID][slotID]:SetStylePanel("Slot", true, 1, 0, 0); - if(not slot.NewItemTexture) then - slot.NewItemTexture = slot:CreateTexture(nil, "OVERLAY", 1); + if(not self.Bags[bagID][slotID].NewItemTexture) then + self.Bags[bagID][slotID].NewItemTexture = self.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY", 1); end - slot.NewItemTexture:SetAllPointsIn(slot); - slot.NewItemTexture:SetTexture(0,0,0,0); - slot.NewItemTexture:Hide() + self.Bags[bagID][slotID].NewItemTexture:SetAllPointsIn(self.Bags[bagID][slotID]); + self.Bags[bagID][slotID].NewItemTexture:SetTexture(0,0,0,0); + self.Bags[bagID][slotID].NewItemTexture:Hide() - if(not slot.JunkIcon) then - slot.JunkIcon = slot:CreateTexture(nil, "OVERLAY"); - slot.JunkIcon:SetSizeToScale(16,16); + if(not self.Bags[bagID][slotID].JunkIcon) then + self.Bags[bagID][slotID].JunkIcon = self.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY"); + self.Bags[bagID][slotID].JunkIcon:SetSizeToScale(16,16); end - slot.JunkIcon:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Coin-Up]]); - slot.JunkIcon:SetPointToScale("TOPLEFT", slot, "TOPLEFT", -4, 4); + self.Bags[bagID][slotID].JunkIcon:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Coin-Up]]); + self.Bags[bagID][slotID].JunkIcon:SetPointToScale("TOPLEFT", self.Bags[bagID][slotID], "TOPLEFT", -4, 4); - if(not slot.icon) then - slot.icon = slot:CreateTexture(nil, "BORDER"); + if(not self.Bags[bagID][slotID].icon) then + self.Bags[bagID][slotID].icon = self.Bags[bagID][slotID]:CreateTexture(nil, "BORDER"); end - slot.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9); - slot.icon:SetAllPointsIn(slot); + self.Bags[bagID][slotID].icon:SetTexCoord(0.1, 0.9, 0.1, 0.9); + self.Bags[bagID][slotID].icon:SetAllPointsIn(self.Bags[bagID][slotID]); - slot.questIcon = _G[questIcon] or slot:CreateTexture(nil, "OVERLAY") - slot.questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); - slot.questIcon:SetAllPointsIn(slot); - slot.questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9); + self.Bags[bagID][slotID].questIcon = _G[questIcon] or self.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY") + self.Bags[bagID][slotID].questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); + self.Bags[bagID][slotID].questIcon:SetAllPointsIn(self.Bags[bagID][slotID]); + self.Bags[bagID][slotID].questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9); - hooksecurefunc(slot, "SetBackdropColor", function(self, r, g, b, a) if(self.HasQuestItem and (r ~= 1)) then self:SetBackdropColor(1,0.3,0.3,a) end end) - hooksecurefunc(slot, "SetBackdropBorderColor", function(self, r, g, b, a) if(self.HasQuestItem and (r ~= 1)) then self:SetBackdropBorderColor(1,0.3,0.3,a) end end) - - slot.cooldown = _G[cdName]; + hooksecurefunc(self.Bags[bagID][slotID], "SetBackdropColor", function(self, r, g, b, a) if(self.HasQuestItem and (r ~= 1)) then self:SetBackdropColor(1,0.3,0.3,a) end end) + hooksecurefunc(self.Bags[bagID][slotID], "SetBackdropBorderColor", function(self, r, g, b, a) if(self.HasQuestItem and (r ~= 1)) then self:SetBackdropBorderColor(1,0.3,0.3,a) end end) - bag[slotID] = slot - else - slot = bag[slotID] + self.Bags[bagID][slotID].cooldown = _G[cdName]; end - if(SV.db.SVGear.misc.setoverlay and (not slot.GearInfo)) then - slot.GearInfo = slot:CreateFontString(nil,"OVERLAY") - slot.GearInfo:SetFontObject(SVUI_Font_Default) - slot.GearInfo:SetAllPoints(slot) - slot.GearInfo:SetWordWrap(true) - slot.GearInfo:SetJustifyH('LEFT') - slot.GearInfo:SetJustifyV('BOTTOM') + if(SV.db.SVGear.misc.setoverlay and (not self.Bags[bagID][slotID].GearInfo)) then + self.Bags[bagID][slotID].GearInfo = self.Bags[bagID][slotID]:CreateFontString(nil,"OVERLAY") + self.Bags[bagID][slotID].GearInfo:SetFontObject(SVUI_Font_Default) + self.Bags[bagID][slotID].GearInfo:SetAllPoints(self.Bags[bagID][slotID]) + self.Bags[bagID][slotID].GearInfo:SetWordWrap(true) + self.Bags[bagID][slotID].GearInfo:SetJustifyH('LEFT') + self.Bags[bagID][slotID].GearInfo:SetJustifyV('BOTTOM') end - slot:SetID(slotID); - slot:SetSizeToScale(buttonSize); + self.Bags[bagID][slotID]:SetID(slotID); + self.Bags[bagID][slotID]:SetSizeToScale(buttonSize); - if slot:GetPoint() then - slot:ClearAllPoints(); + if self.Bags[bagID][slotID]:GetPoint() then + self.Bags[bagID][slotID]:ClearAllPoints(); end if lastButton then if((totalSlots - 1) % numContainerColumns == 0) then - slot:SetPointToScale("TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing); - lastRowButton = slot; + self.Bags[bagID][slotID]:SetPointToScale("TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing); + lastRowButton = self.Bags[bagID][slotID]; else - slot:SetPointToScale("LEFT", lastButton, "RIGHT", buttonSpacing, 0); + self.Bags[bagID][slotID]:SetPointToScale("LEFT", lastButton, "RIGHT", buttonSpacing, 0); end else - slot:SetPointToScale("TOPLEFT", self.holderFrame, "TOPLEFT"); - lastRowButton = slot; + self.Bags[bagID][slotID]:SetPointToScale("TOPLEFT", self.holderFrame, "TOPLEFT"); + lastRowButton = self.Bags[bagID][slotID]; end - lastButton = slot; + lastButton = self.Bags[bagID][slotID]; - bag:SlotUpdate(slotID); + self.Bags[bagID]:SlotUpdate(slotID); end else - if(menu[i] and menu[i].GetInventorySlot) then - BankFrameItemButton_Update(menu[i]) - BankFrameItemButton_UpdateLocked(menu[i]) - end if(self.Bags[bagID]) then self.Bags[bagID].numSlots = numSlots; @@ -711,6 +795,13 @@ local ContainerFrame_UpdateLayout = function(self) end end end + + if(isBank) then + if(menu[i]) then + BankFrameItemButton_Update(menu[i]) + BankFrameItemButton_UpdateLocked(menu[i]) + end + end end end @@ -820,8 +911,10 @@ local ReagentFrame_UpdateLayout = function(self) lastButton = slot; - BankFrameItemButton_Update(slot); - BankFrameItemButton_UpdateLocked(slot); + if(slot.GetInventorySlot) then + BankFrameItemButton_Update(slot) + BankFrameItemButton_UpdateLocked(slot) + end bag:SlotUpdate(slotID); end @@ -1098,11 +1191,8 @@ BAG EVENTS ########################################################## ]]-- local Container_OnEvent = function(self, event, ...) - if(event == "ITEM_LOCK_CHANGED") then - local bagID, slotID = ... - if(bagID and slotID and self.Bags[bagID]) then - self.Bags[bagID]:SlotUpdate(slotID) - end + if(event == "ITEM_LOCK_CHANGED" or event == "ITEM_UNLOCKED") then + MOD.SlotUpdate(self, ...) elseif(event == "BAG_UPDATE" or event == "EQUIPMENT_SETS_CHANGED") then BuildEquipmentMap() for _, id in ipairs(self.BagIDs) do @@ -1112,10 +1202,7 @@ local Container_OnEvent = function(self, event, ...) return; end end - local bagID = ... - if(bagID and self.Bags[bagID]) then - self.Bags[bagID]:RefreshSlots() - end + MOD.RefreshSlots(self, ...) elseif(event == "BAG_UPDATE_COOLDOWN") then self:RefreshCooldowns() elseif(event == "PLAYERBANKSLOTS_CHANGED") then @@ -1260,6 +1347,7 @@ do frame.RefreshCooldowns = ContainerFrame_UpdateCooldowns; frame:RegisterEvent("ITEM_LOCK_CHANGED") + frame:RegisterEvent("ITEM_UNLOCKED") frame:RegisterEvent("BAG_UPDATE_COOLDOWN") frame:RegisterEvent("BAG_UPDATE") frame:RegisterEvent("EQUIPMENT_SETS_CHANGED") @@ -1449,6 +1537,7 @@ do frame.RefreshCooldowns = ContainerFrame_UpdateCooldowns; frame:RegisterEvent("ITEM_LOCK_CHANGED") + frame:RegisterEvent("ITEM_UNLOCKED") frame:RegisterEvent("BAG_UPDATE_COOLDOWN") frame:RegisterEvent("BAG_UPDATE") frame:RegisterEvent("EQUIPMENT_SETS_CHANGED") diff --git a/Interface/AddOns/SVUI/packages/override/components/alert.lua b/Interface/AddOns/SVUI/packages/override/components/alert.lua index da5630a..bcb702e 100644 --- a/Interface/AddOns/SVUI/packages/override/components/alert.lua +++ b/Interface/AddOns/SVUI/packages/override/components/alert.lua @@ -219,7 +219,7 @@ PACKAGE CALL ]]-- function MOD:SetAlerts() SVUI_AlertFrame:SetSizeToScale(180, 20); - SV.Mentalo:Add(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, AlertFramePostMove_Hook) + SV.Mentalo:Add(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, AlertFramePostMove_Hook, nil, true) NewHook('AlertFrame_FixAnchors', AlertFramePostMove_Hook) NewHook('AlertFrame_SetLootAnchors', _hook_AlertFrame_SetLootAnchors) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua index ffe5de5..bc7a94d 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua @@ -75,6 +75,10 @@ local RUNE_BG = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\RUNES-BG] POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.Necromancy; @@ -170,7 +174,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index bf727e5..d61fa11 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -101,6 +101,10 @@ end POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local bar = self.Druidness local chicken = bar.Chicken; @@ -310,7 +314,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.ClassBarRefresh = Reposition; playerFrame.Druidness = bar diff --git a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua index a8743b9..917815d 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua @@ -51,6 +51,10 @@ local HAS_SNAKE_TRAP = false; POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.HunterTraps; @@ -147,7 +151,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua index eb79627..3487df6 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua @@ -63,6 +63,10 @@ local specColors = { POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.MageMagic; @@ -201,7 +205,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua index f3aa043..c70dac2 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua @@ -68,6 +68,10 @@ local CHI_COORDS = { POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.KungFu; @@ -169,7 +173,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max playerFrame.ClassBarRefresh = Reposition diff --git a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua index 2cb0485..cc01d4a 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua @@ -60,6 +60,10 @@ LOCAL FUNCTIONS POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.HolyPower; @@ -154,7 +158,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua index d3e48f5..ec7db18 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua @@ -56,6 +56,10 @@ local specEffects = { [1] = "holy", [2] = "holy", [3] = "shadow" }; POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.PriestOrbs; @@ -125,7 +129,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index a837dc2..4344c89 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -58,6 +58,10 @@ local ICON_ANTI = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\ROGUE-A POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.HyperCombo; @@ -148,7 +152,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = 5; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua index 5317f4f..5a81fac 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua @@ -63,6 +63,10 @@ local totemTextures = { POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.TotemBars @@ -117,7 +121,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = totemMax; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 3443215..adae3e2 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -57,6 +57,7 @@ local specEffects = { [1] = "affliction", [2] = "none", [3] = "fire" }; LOCAL FUNCTIONS ########################################################## ]]-- +local FURY_FONT = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]] local shardColors = { [1] = {{0.67,0.42,0.93,1}, {0,0,0,0.9}}, [2] = {{0,0,0,0}, {0,0,0,0}}, @@ -91,6 +92,10 @@ local SPEC_WARLOCK_DEMONOLOGY = SPEC_WARLOCK_DEMONOLOGY POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.WarlockShards; @@ -100,7 +105,7 @@ local Reposition = function(self) local dbOffset = (size * 0.15) bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then - SV.Mentalo:Reset(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"], true) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -110,9 +115,6 @@ local Reposition = function(self) bar:ClearAllPoints() bar:SetAllPoints(bar.Holder) - bar.DemonicFury:ClearAllPoints() - bar.DemonicFury:SetAllPointsIn(bar.Holder, 1, 3) - for i = 1, max do bar[i]:ClearAllPoints() bar[i]:SetHeight(size) @@ -123,6 +125,15 @@ local Reposition = function(self) bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) end end + + local barHeight = bar.Holder:GetHeight() + local fontSize = floor(barHeight * 0.45) + local offset = fontSize * 2 + + bar.DemonicFury:ClearAllPoints() + bar.DemonicFury:SetPoint("TOPLEFT", bar.Holder, "TOPLEFT", 0, 0) + bar.DemonicFury:SetPoint("BOTTOMRIGHT", bar.Holder, "BOTTOMRIGHT", -offset, 6) + bar.DemonicFury.text:SetFont(FURY_FONT, fontSize, 'OUTLINE') end --[[ ########################################################## @@ -218,7 +229,7 @@ function MOD:CreateClassBar(playerFrame) local bgTexture = bgFrame:CreateTexture(nil, "BACKGROUND") bgTexture:SetAllPoints(bgFrame) - bgTexture:SetTexture(0.2,0,0,0.5) + bgTexture:SetTexture(0.1,0,0,0.75) local borderB = bgFrame:CreateTexture(nil,"OVERLAY") borderB:SetTexture(0,0,0) @@ -246,15 +257,16 @@ function MOD:CreateClassBar(playerFrame) local demonBar = CreateFrame("StatusBar", nil, bgFrame) demonBar.noupdate = true; - demonBar:SetAllPointsIn(bgFrame) + demonBar:SetAllPointsIn(bgFrame,2,2) demonBar:SetOrientation("HORIZONTAL") - demonBar:SetStatusBarTexture(SV.Media.bar.glow) - demonBar.text = demonBar:CreateFontString(nil, "OVERLAY") - demonBar.text:SetPoint("LEFT") - demonBar.text:SetFontObject(SVUI_Font_Unit_Small) - demonBar.text:SetJustifyH('LEFT') - demonBar.text:SetTextColor(1,1,0) - demonBar.text:SetText("0") + demonBar:SetStatusBarTexture(SV.Media.bar.default) + + demonicFury.text = demonicFury:CreateFontString(nil, "OVERLAY") + demonicFury.text:SetPoint("LEFT", demonicFury, "RIGHT", 0, 0) + demonicFury.text:SetFont(FURY_FONT, 16, 'OUTLINE') + demonicFury.text:SetJustifyH('LEFT') + demonicFury.text:SetTextColor(1,1,0) + demonicFury.text:SetText("0") SV.SpecialFX:SetFXFrame(demonBar, "overlay_demonbar", true) demonBar.FX:SetScript("OnShow", EffectModel_OnShow) @@ -272,7 +284,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua index 19a6da2..f6910e1 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua @@ -44,6 +44,10 @@ SV.SpecialFX:Register("conqueror", [[Spells\Warlock_destructioncharge_impact_che POSITIONING ########################################################## ]]-- +local OnMove = function() + SV.db.SVUnit.player.classbar.detachFromFrame = true +end + local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.Conqueror; @@ -128,7 +132,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV.Mentalo:Add(bar.Holder, L["Classbar"]) + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, OnMove) playerFrame.MaxClassPower = max playerFrame.ClassBarRefresh = Reposition diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua index dceadb9..fff1888 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua @@ -232,29 +232,4 @@ SV.Options.args.SVUnit.args.commonGroup.args.player = { } } } -} - -if(SV.class == "MONK") then - SV.Options.args.SVUnit.args.commonGroup.args.player.args.classbar.args.stagger = { - type = "toggle", - order = 3, - name = L["Stagger Bar"], - get = function(l)return SV.db.SVUnit["player"]["stagger"].enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", "player", "stagger");MOD:SetUnitFrame("player")end, - } -end -if(SV.class == "DRUID") then - SV.Options.args.SVUnit.args.commonGroup.args.player.args.classbar.args.druidMana = { - type = "toggle", - order = 3, - name = L["Druid Mana"], - desc = L["Display druid mana bar when in cat or bear form and when mana is not 100%."], - get = function(key) - return SV.db.SVUnit["player"]["power"].druidMana - end, - set = function(key, value) - MOD:ChangeDBVar(value, "druidMana", "player", "power"); - MOD:SetUnitFrame("player") - end, - } -end \ No newline at end of file +} \ No newline at end of file