Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
noname08662 authored Jan 26, 2025
1 parent 8ff09ca commit bc57229
Show file tree
Hide file tree
Showing 15 changed files with 925 additions and 340 deletions.
20 changes: 9 additions & 11 deletions ElvUI_Extras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -813,20 +813,17 @@ if isAwesome then
return core.hooks[LAI].GUIDAura(self, guid, index, filter, ...)
end

core.SPELL_AURA_APPLIED = true
core.SPELL_AURA_REMOVED = true
core.SPELL_AURA_REFRESH = true

core:SecureHook(NP, "StyleFilterConfigure", function()
if NP.StyleFilterTriggerEvents.UNIT_AURA or NP.StyleFilterTriggerEvents.UNIT_AURA then
for filterName, filter in pairs(E.global.nameplates.filters) do
local t = filter.triggers
if t and E.db.nameplates and E.db.nameplates.filters then
if E.db.nameplates.filters[filterName] and E.db.nameplates.filters[filterName].triggers
and E.db.nameplates.filters[filterName].triggers.enable and filter.actions.nameOnly then
core:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", function(_, _, eventType, _, _, _, dstGUID)
if core[eventType] then
local frame = NP:SearchNameplateByGUID(dstGUID)
core:RegisterEvent("UNIT_AURA", function(_, unit)
if find(unit, 'nameplate', 1, true) then
local plate = GetNamePlateForUnit(unit)
local frame = plate and plate.UnitFrame
if frame then
if frame.NameOnlyChanged then
frame.Health:Show() -- UpdateElement_Auras' first line blocks any update
Expand All @@ -840,9 +837,10 @@ if isAwesome then
end
end
end
core:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", function(_, _, eventType, _, _, _, dstGUID)
if core[eventType] then
local frame = NP:SearchNameplateByGUID(dstGUID)
core:RegisterEvent("UNIT_AURA", function(_, unit)
if find(unit, 'nameplate', 1, true) then
local plate = GetNamePlateForUnit(unit)
local frame = plate and plate.UnitFrame
if frame then
NP:UpdateElement_Auras(frame)
end
Expand Down Expand Up @@ -1837,7 +1835,7 @@ function core:GetOptions()
args = {
colors = {
type = "group",
name = L["Version: "].."1.08",
name = L["Version: "].."1.09",
guiInline = true,
get = function(info) return colorConvert(E.db.Extras[info[#info]]) end,
set = function(info, r, g, b)
Expand Down
2 changes: 1 addition & 1 deletion ElvUI_Extras.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 30300
## Author: noname08662
## Version: 1.08
## Version: 1.09
## Title: |cff1784d1E|r|cffe5e3e3lvUI|r |cff1784d1Ex|r|cffe5e3e3tras
## Notes: Various additions.
## RequiredDeps: ElvUI
Expand Down
2 changes: 2 additions & 0 deletions Locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1135,3 +1135,5 @@ L["TierText"] = "Stufentext"
L["Select Item"] = "Artikel auswählen"
L["Add Item (ID)"] = "Artikel hinzufügen (ID)"
L["Item Text"] = "Artikeltext"
L["Sort by Filter"] = "Nach Filter sortieren"
L["Makes aura sorting abide filter priorities."] = "Sortiert Auren gemäß der Filterprioritäten."
4 changes: 3 additions & 1 deletion Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -923,4 +923,6 @@ L["Enables tooltips to display which set an item belongs to."] = true
L["TierText"] = true
L["Select Item"] = true
L["Add Item (ID)"] = true
L["Item Text"] = true
L["Item Text"] = true
L["Sort by Filter"] = true
L["Makes aura sorting abide filter priorities."] = true
2 changes: 2 additions & 0 deletions Locales/esMX.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1140,4 +1140,6 @@ L["TierText"] = "Texto de nivel"
L["Select Item"] = "Seleccionar artículo"
L["Add Item (ID)"] = "Agregar artículo (ID)"
L["Item Text"] = "Texto del artículo"
L["Sort by Filter"] = "Ordenar por filtro"
L["Makes aura sorting abide filter priorities."] = "Hace que la ordenación de auras respete las prioridades del filtro."

2 changes: 2 additions & 0 deletions Locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1141,3 +1141,5 @@ L["TierText"] = "Texte de niveau"
L["Select Item"] = "Sélectionner un article"
L["Add Item (ID)"] = "Ajouter un article (ID)"
L["Item Text"] = "Texte de l'article"
L["Sort by Filter"] = "Trier par filtre"
L["Makes aura sorting abide filter priorities."] = "Fait en sorte que le tri des auras respecte les priorités des filtres."
2 changes: 2 additions & 0 deletions Locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1139,3 +1139,5 @@ L["TierText"] = "티어 텍스트"
L["Select Item"] = "아이템 선택"
L["Add Item (ID)"] = "아이템 추가 (ID)"
L["Item Text"] = "아이템 텍스트"
L["Sort by Filter"] = "필터별 정렬"
L["Makes aura sorting abide filter priorities."] = "오라 정렬이 필터 우선순위를 따르도록 설정합니다."
2 changes: 2 additions & 0 deletions Locales/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1138,3 +1138,5 @@ L["TierText"] = "Texto de nível"
L["Select Item"] = "Selecionar item"
L["Add Item (ID)"] = "Adicionar item (ID)"
L["Item Text"] = "Texto do item"
L["Sort by Filter"] = "Ordenar por filtro"
L["Makes aura sorting abide filter priorities."] = "Faz com que a organização de auras siga as prioridades do filtro."
2 changes: 2 additions & 0 deletions Locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1139,3 +1139,5 @@ L["TierText"] = "Текст уровня"
L["Select Item"] = "Выбрать предмет"
L["Add Item (ID)"] = "Добавить предмет (ID)"
L["Item Text"] = "Текст предмета"
L["Sort by Filter"] = "Сортировка по фильтру"
L["Makes aura sorting abide filter priorities."] = "Сортировка аур в соответствии с приоритетами фильтра."
2 changes: 2 additions & 0 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1135,3 +1135,5 @@ L["TierText"] = "等级文本"
L["Select Item"] = "选择物品"
L["Add Item (ID)"] = "添加物品 (ID)"
L["Item Text"] = "物品文本"
L["Sort by Filter"] = "按过滤器排序"
L["Makes aura sorting abide filter priorities."] = "使光环排序遵循过滤器优先级。"
2 changes: 2 additions & 0 deletions Locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1135,3 +1135,5 @@ L["TierText"] = "階級文字"
L["Select Item"] = "選擇物品"
L["Add Item (ID)"] = "添加物品 (ID)"
L["Item Text"] = "物品文字"
L["Sort by Filter"] = "依過濾條件排序"
L["Makes aura sorting abide filter priorities."] = "使光環排序遵循過濾條件的優先順序。"
85 changes: 52 additions & 33 deletions Modules/General/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ local _G, unpack, pairs, ipairs, select, print, next, setfenv = _G, unpack, pair
local tonumber, tostring, loadstring, pcall, type = tonumber, tostring, loadstring, pcall, type
local tinsert, tremove, twipe, tsort, tconcat = table.insert, table.remove, table.wipe, table.sort, table.concat
local min, max, floor, ceil, huge, pi = min, max, floor, ceil, math.huge, math.pi
local find, format, lower, match, gmatch, gsub = string.find, string.format, string.lower, string.match, string.gmatch, string.gsub
local find, format, lower = string.find, string.format, string.lower
local match, gmatch, gsub = string.match, string.gmatch, string.gsub
local UIParent, GameTooltip_Hide, InCombatLockdown, UnitFactionGroup = UIParent, GameTooltip_Hide, InCombatLockdown, UnitFactionGroup
local GetItemInfo, GetInventoryItemTexture, GetBagName, GetCursorInfo = GetItemInfo, GetInventoryItemTexture, GetBagName, GetCursorInfo
local ContainerIDToInventoryID, GetContainerItemID = ContainerIDToInventoryID, GetContainerItemID
Expand Down Expand Up @@ -114,6 +115,20 @@ local inventorySlotIDs = {
["INVTYPE_RELIC"] = 18,
}

local bagIDToInventoryID = {
[1] = 20,
[2] = 21,
[3] = 22,
[4] = 23,
[5] = 68,
[6] = 69,
[7] = 70,
[8] = 71,
[9] = 72,
[10] = 73,
[11] = 74,
}


local function getItemDetails(bagID, slotID, itemID)
if not itemID then return nil end
Expand Down Expand Up @@ -467,6 +482,7 @@ function mod:UpdateButtonPositions(button, bagMap, bagID, slotID, currentSection
currentSection.db.storedPositions[otherButton.bagID..'-'..otherButton.slotID] = j
end
end
break
end
end
end
Expand Down Expand Up @@ -1634,39 +1650,34 @@ function mod:ConfigureContainer(f, isBank, db, numColumns, buttonSize, buttonSpa

if next(layoutSections) then
if not isBank or f:IsShown() then
local cleanup = {}
for i, section in ipairs(sections) do
if section.isSpecialBag then
for i = #sections, 1, -1 do
local section = sections[i]
if section and section.isSpecialBag then
local bagID = section.bagID
if buttonMap[bagID] then
local numSlots, bagType = GetContainerNumFreeSlots(bagID)
if numSlots == 0 or (not bagType or bagType == 0) or (db.specialBags[bagID] and db.specialBags[bagID] ~= GetBagName(bagID)) then
local bagName = GetBagName(bagID)
if not GetInventoryItemID("player", bagIDToInventoryID[bagID])
or (bagName and db.specialBags[bagID] and db.specialBags[bagID] ~= bagName) then
buttonMap[bagID] = {}
db.specialBags[bagID] = false
tremove(sections, i)
tremove(layoutSections, i)
cleanup[bagID] = true
end
end
end
end
if next(cleanup) then
for _, section in ipairs(layoutSections) do
if section.isSpecialBag and cleanup[section.bagID] then
for _, button in ipairs(section.buttons) do
if button.highlight then
button.highlight:Hide()
button.highlight = nil
local targetSection = layoutSections[i]
for _, button in ipairs(targetSection.buttons) do
if button.highlight then
button.highlight:Hide()
button.highlight = nil
end
end
end
local frame = section.frame
if frame then
frame:Hide()
section.frame = nil
local frame = targetSection.frame
if frame then
frame:Hide()
targetSection.frame = nil
end
tremove(layoutSections, i)
if E.RefreshGUI then E:RefreshGUI() end
end
end
end
if E.RefreshGUI then E:RefreshGUI() end
end
end
local currentRowColumns
Expand Down Expand Up @@ -1701,17 +1712,17 @@ function mod:ConfigureContainer(f, isBank, db, numColumns, buttonSize, buttonSpa
["size"] = 13,
["flags"] = "OUTLINE",
["point"] = "BOTTOMLEFT",
["relativeTo"] = "TOPLEFT",
["relativeTo"] = "BOTTOMRIGHT",
["xOffset"] = 0,
["yOffset"] = 0,
},
["icon"] = {
["enabled"] = false,
["enabled"] = true,
["texture"] = GetInventoryItemTexture("player", ContainerIDToInventoryID(bagID)),
["point"] = "TOPLEFT",
["relativeTo"] = "TOPLEFT",
["xOffset"] = 0,
["yOffset"] = 0,
["yOffset"] = 2,
["toText"] = false,
["size"] = 16,
},
Expand All @@ -1720,7 +1731,7 @@ function mod:ConfigureContainer(f, isBank, db, numColumns, buttonSize, buttonSpa
}
db.specialBags[bagID] = GetBagName(bagID)
tinsert(sections, 1, specialSection)
if f.emptyButton then
if f.emptyButton and (not f.forceShow or not f:IsShown()) then
f.emptyButton.highlight.tex:SetTexture("Interface\\Buttons\\UI-Common-MouseHilight")
f.emptyButton.highlight.tex:SetVertexColor(0, 1, 1)
E:UIFrameFadeIn(f.emptyButton.highlight, 1, f.emptyButton.highlight:GetAlpha(), 1)
Expand Down Expand Up @@ -2545,6 +2556,14 @@ function mod:ConfigureContainer(f, isBank, db, numColumns, buttonSize, buttonSpa
button:Show()
end
end
for hash in pairs(section.db.storedPositions) do
local bagID, slotID = match(hash, "(.+)-(.+)")
local bag = f.Bags[tonumber(bagID)]
local button = bag and bag[tonumber(slotID)]
if button and not button.hasItem then
section.db.storedPositions[hash] = nil
end
end
self:UpdateSection(f, section, numColumns, buttonSize, buttonSpacing)
end

Expand Down Expand Up @@ -2607,10 +2626,10 @@ end
function mod:UpdateSlot(self, f, bagID, slotID)
local bag = f.Bags[bagID]
local bagMap = buttonMap[bagID]
local layout = f.currentLayout

if not bag or not bag[slotID] or not bagMap or (bag.numSlots ~= GetContainerNumSlots(bagID)) then return end
if not (layout and bag and bag[slotID] and bagMap) or (bag.numSlots ~= GetContainerNumSlots(bagID)) then return end

local layout = f.currentLayout
local button = bag[slotID]
local bagType = bag.type

Expand Down Expand Up @@ -3034,7 +3053,7 @@ function mod:SplitHandler(self, button)
if button == 'LeftButton' then
local stackCount = select(2, B_GetItemInfo(nil, bagID, slotID))
if not stackCount or stackCount == 1 then return end
local split = floor(stackCount / 2)
local splitHalf = floor(stackCount / 2)
local _, freeBagID, freeSlotID

if isBagsExtendedV2 then
Expand All @@ -3047,7 +3066,7 @@ function mod:SplitHandler(self, button)
_, freeBagID, freeSlotID = mod:FindEmpty(nil, f)
end
if freeSlotID then
B_SplitItem(nil, bagID, slotID, split)
B_SplitItem(nil, bagID, slotID, splitHalf)
B_PickupItem(nil, freeBagID, freeSlotID)
else
print(core.customColorBad..ERR_SPLIT_FAILED)
Expand Down
Loading

0 comments on commit bc57229

Please sign in to comment.