Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Feature: Sort Only Visible Bags #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion classes/frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ end
--[[ Shared ]]--

function Frame:SortItems()
Addon.Sorting:Start(self:GetOwner(), self.Bags)
local sortingBags = {}
for _, bag in pairs(self.Bags) do
if self:IsShowingBag(bag) or not Addon.sets.sortOnlyShowingBags then
table.insert(sortingBags, bag)
end
end
Addon.Sorting:Start(self:GetOwner(), sortingBags)
end

function Frame:IsShowingBag(bag)
Expand Down
97 changes: 49 additions & 48 deletions config/general.lua
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
--[[
general.lua
General settings menu
--]]

local CONFIG = ...
local L = LibStub('AceLocale-3.0'):GetLocale(CONFIG)
local ADDON, Addon = CONFIG:match('[^_]+'), _G[CONFIG:match('[^_]+')]
local General = Addon.OptionsGroup('GeneralOptions')

function General:Populate()
self:AddCheck('locked')
self:AddCheck('tipCount')

if CanGuildBankRepair and self.sets.tipCount then
local guild = self:AddCheck('countGuild')
guild.left = guild.left + 10
guild:SetSmall(true)
end

self:AddCheck('flashFind')
self:AddCheck('displayBlizzard')

local global = self:Add('Check', L.CharacterSpecific)
global:SetChecked(Addon.profile ~= Addon.sets.global)
global:SetCall('OnInput', function() self:ToggleGlobals() end)
end

function General:ToggleGlobals()
if Addon.profile == Addon.sets.global then
self:SetProfile(CopyTable(Addon.sets.global))
else
LibStub('Sushi-3.1').Popup {
id = ADDON .. 'ConfirmGlobals',
text = L.ConfirmGlobals, button1 = YES, button2 = NO,
whileDead = 1, exclusive = 1, hideOnEscape = 1,
OnAccept = function()
self:SetProfile(nil)
self:Update()
end
}
end
end

function General:SetProfile(profile)
Addon:SetCurrentProfile(profile)
Addon.Frames:Update()
end
--[[
general.lua
General settings menu
--]]

local CONFIG = ...
local L = LibStub('AceLocale-3.0'):GetLocale(CONFIG)
local ADDON, Addon = CONFIG:match('[^_]+'), _G[CONFIG:match('[^_]+')]
local General = Addon.OptionsGroup('GeneralOptions')

function General:Populate()
self:AddCheck('locked')
self:AddCheck('tipCount')

if CanGuildBankRepair and self.sets.tipCount then
local guild = self:AddCheck('countGuild')
guild.left = guild.left + 10
guild:SetSmall(true)
end

self:AddCheck('flashFind')
self:AddCheck('displayBlizzard')
self:AddCheck('sortOnlyShowingBags')

local global = self:Add('Check', L.CharacterSpecific)
global:SetChecked(Addon.profile ~= Addon.sets.global)
global:SetCall('OnInput', function() self:ToggleGlobals() end)
end

function General:ToggleGlobals()
if Addon.profile == Addon.sets.global then
self:SetProfile(CopyTable(Addon.sets.global))
else
LibStub('Sushi-3.1').Popup {
id = ADDON .. 'ConfirmGlobals',
text = L.ConfirmGlobals, button1 = YES, button2 = NO,
whileDead = 1, exclusive = 1, hideOnEscape = 1,
OnAccept = function()
self:SetProfile(nil)
self:Update()
end
}
end
end

function General:SetProfile(profile)
Addon:SetCurrentProfile(profile)
Addon.Frames:Update()
end
1 change: 1 addition & 0 deletions localization/config/cn.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ L.CountGuild = '包含公会银行'
L.FlashFind = '闪烁搜索'
L.DisplayBlizzard = '显示暴雪框架隐藏背包'
L.DisplayBlizzardTip = '如果启用,隐藏背包或银行容器将显示默认暴雪用户界面背包面板。\n\n|cffff1919需要重载用户界面。|r'
L.SortOnlyShowingBags = '不要从停用的袋子中订购物品'
L.ConfirmGlobals = '确定要禁用特定此角色的特定设置?所有特定设置将丢失。'
L.CharacterSpecific = '角色特定设置'

Expand Down
Empty file modified localization/config/de.lua
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions localization/config/en.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ L.CountGuild = 'Include Guild Banks'
L.FlashFind = 'Flash Find'
L.DisplayBlizzard = 'Fallback Hidden Bags'
L.DisplayBlizzardTip = 'If enabled, the default Blizzard UI bag panels will be displayed for hidden inventory or bank containers.\n\n|cffff1919Requires UI reload.|r'
L.SortOnlyShowingBags = 'Do not sort items from hidden bags'
L.ConfirmGlobals = 'Are you sure you want to disable specific settings for this character? All specific settings will be lost.'
L.CharacterSpecific = 'Character Specific Settings'

Expand Down
1 change: 1 addition & 0 deletions localization/config/es.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ L.TipCount = 'Contador de objetos en tooltips'
L.FlashFind = 'Activar búsqueda rápida'
L.DisplayBlizzard = 'Mostrar ventanas de Blizzard para bolsas desactivadas'
L.DisplayBlizzardTip = 'Si se activa, se mostrará la interfaz por defecto de Blizzard para bolsas ocultas del inventario o del banco.\n\n|cffff1919Requiere reiniciar la interfaz (UI Reload).|r'
L.SortOnlyShowingBags = 'No ordene artículos de bolsas desactivadas'
L.ConfirmGlobals = '¿Estás seguro de que quieres desactivar la configuración específica para este personaje? Se perderán todos los ajustes guardados.'
L.CharacterSpecific = 'Ajustes del personaje'

Expand Down
1 change: 1 addition & 0 deletions localization/config/fr.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ L.CountGuild = 'Inclure les banques de guilde'
L.FlashFind = 'Activer résultat éclair'
L.EmptySlots = 'Afficher un fond sur les emplacements vides'
L.DisplayBlizzard = 'Afficher les cadres de Blizzard pour les sacs désactivés'
L.SortOnlyShowingBags = 'НNe commandez pas d\'articles à partir les sacs désactivés'

-- frame
L.FrameOptions = 'Options des fenêtres'
Expand Down
1 change: 1 addition & 0 deletions localization/config/it.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ L.CountGuild = 'Includi Banca di Gilda'
L.FlashFind = 'Attiva Ricerca Veloce.'
L.DisplayBlizzard = 'Mostra le finestre di Blizzard per le borse disabilitate.'
L.DisplayBlizzardTip = 'Se abilitato, verrà utilizzata l\'interfaccia Blizzard di base per le sacche o gli inventari di banca nascosti.\n\n|cffff1919Richiede un riavvio dell\'UI.|r'
L.SortOnlyShowingBags = 'Non ordinare articoli le borse disattivate'
L.ConfirmGlobals = 'Sei sicuro di voler disabilitare le impostazioni specifiche per questo personaggio? Tutte le impostazioni specifiche verranno perse.'
L.CharacterSpecific = 'Impostazioni specifiche personaggio'

Expand Down
1 change: 1 addition & 0 deletions localization/config/ko.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ L.CountGuild = '길드 금고 포함'
L.FlashFind = '빠른 찾기 사용'
L.DisplayBlizzard = '숨은 가방 대비책'
L.DisplayBlizzardTip = '만약 활성화하면 숨긴 가방 또는 은행 저장소에 대해 기본 블리자드 UI 가방 창이 표시됩니다.\n\n|cffff1919UI 리로드가 필요합니다.|r'
L.SortOnlyShowingBags = '비활성화된 가방에서 품목을 주문하지 마십시오.'
L.ConfirmGlobals = '이 캐릭터에 대한 개별 설정을 비활성화 하시겠습니까? 모든 개별 설정을 잃게됩니다.'
L.CharacterSpecific = '캐릭터 개별 설정'

Expand Down
1 change: 1 addition & 0 deletions localization/config/pt.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ L.TipCount = 'Ativar contagem de itens nas dicas'
L.FlashFind = 'Ativar Flash Find'
L.EmptySlots = 'Mostrar fundo em espaços para itens vazios'
L.DisplayBlizzard = 'Mostrar janelas da Blizzard para sacos desligados'
L.SortOnlyShowingBags = 'Não peça itens de sacos desligados'

-- frame
L.FrameOptions = 'Preferências de Janela'
Expand Down
1 change: 1 addition & 0 deletions localization/config/ru.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ L.CountGuild = 'Учитывать банк гильдии'
L.FlashFind = 'Включить мгновенный поиск'
L.DisplayBlizzard = 'Использовать стандартные окна для скрытых сумок'
L.DisplayBlizzardTip = 'Если настройка включена, скрытые сумки инвентаря или банка будут использовать стандартный интерфейс Blizzard.\n\n|cffff1919Потребуется перезагрузка интерфейса.|r'
L.SortOnlyShowingBags = 'Не сортировать предметы из скрытых сумок'
L.ConfirmGlobals = 'Уверены, что хотите отключить использование индивидуальных настроек для этого персонажа? Все индивидуальные настройки будут потеряны.'
L.CharacterSpecific = 'Использовать отдельные настройки для текущего персонажа'

Expand Down
1 change: 1 addition & 0 deletions localization/config/tw.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ L.CountGuild = '包括工會銀行'
L.FlashFind = '閃爍找到'
L.EmptySlots = '在空的槽位顯示背景顏色'
L.DisplayBlizzard = '隱藏的背包顯示為內建框架'
L.SortOnlyShowingBags = '不要從停用的袋子中訂購物品'

-- frame
L.FrameOptions = '框架設定'
Expand Down