Commit 5e4274cc authored by Darth Predator's avatar Darth Predator
Browse files

HS toys order

parent 7cc85153
......@@ -657,6 +657,7 @@ L["Ignore missing info"] = true
L["SLE_LOCPANEL_IGNOREMISSINGINFO"] = [[Due to how client functions some item info may become unavailable for a period of time. This mostly happens to toys info.
When called the menu will wait for all information being available before showing up. This may resul in menu opening after some concidarable amount of time, depends on how fast the server will answer info requests.
By enabling this option you'll make the menu ignore items with missing info, resulting in them not showing up in the list.]]
L["HS Toys Order"] = true
--Miscs
L["Error Frame"] = true
......
......@@ -648,6 +648,7 @@ L["Ignore missing info"] = true
L["SLE_LOCPANEL_IGNOREMISSINGINFO"] = [[Due to how client functions some item info may become unavailable for a period of time. This mostly happens to toys info.
When called the menu will wait for all information being available before showing up. This may resul in menu opening after some concidarable amount of time, depends on how fast the server will answer info requests.
By enabling this option you'll make the menu ignore items with missing info, resulting in them not showing up in the list.]]
L["HS Toys Order"] = true
--Miscs
L["Error Frame"] = true
......
......@@ -641,6 +641,7 @@ L["Ignore missing info"] = true
L["SLE_LOCPANEL_IGNOREMISSINGINFO"] = [[Due to how client functions some item info may become unavailable for a period of time. This mostly happens to toys info.
When called the menu will wait for all information being available before showing up. This may resul in menu opening after some concidarable amount of time, depends on how fast the server will answer info requests.
By enabling this option you'll make the menu ignore items with missing info, resulting in them not showing up in the list.]]
L["HS Toys Order"] = true
--Miscs
L["Error Frame"] = "오류 프레임"
......
......@@ -654,6 +654,7 @@ L["Ignore missing info"] = "Игнорировать отсутсвие инфо
L["SLE_LOCPANEL_IGNOREMISSINGINFO"] = [[Из-за особенностей работы клиента информация о некоторых предметах может оказаться недоступной на какой-то период времени.В большинстве своем это качается игрушек.
При вызове меню будет ожидать появления информации о всех предметах перед отображением. Это может занять ощутимое время, зависит от скорости ответа сервера.
Включив эту опцию, вы заставите меню игнорировать предметы с отсутствующей информацией, что может привести к их отсутствию в списке.]]
L["HS Toys Order"] = "Порядок игрушек-камней"
--Miscs
L["Error Frame"] = "Фрейм ошибок"
......
......@@ -425,26 +425,40 @@ function LP:ItemList(check)
T.tinsert(LP.MainMenu, {text = ITEMS..":", title = true, nohighlight = true})
if LP.db.portals.showHearthstones then
local priority = 100
local ShownHearthstone
local tmp = {}
for i = 1, #LP.Hearthstones do
local tmp = {}
local data = LP.Hearthstones[i]
local ID, isToy = data.secure.ID, data.secure.isToy
isToy = (LP.db.portals.showToys and isToy)
if not LP.db.portals.ignoreMissingInfo and ((isToy and PlayerHasToy(ID)) and C_ToyBox.IsToyUsable(ID) == nil) then return false end
if (not isToy and (SLE:BagSearch(ID) and T.IsUsableItem(ID))) or (isToy and (PlayerHasToy(ID) and C_ToyBox.IsToyUsable(ID))) then
if data.text then
local cd = DD:GetCooldown("Item", ID)
E:CopyTable(tmp, data)
if cd or (T.tonumber(cd) and T.tonumber(cd) > 1.5) then
tmp.text = "|cff636363"..tmp.text.."|r"..T.format(LP.CDformats[LP.db.portals.cdFormat], cd)
T.tinsert(LP.MainMenu, tmp)
if not isToy then
ShownHearthstone = data
break
else
T.tinsert(LP.MainMenu, data)
local curPriorirty = E.db.sle.minimap.locPanel.portals.hsPrio[T.tostring(ID)]
if curPriorirty < priority then
priority = curPriorirty
ShownHearthstone = data
end
if priority == 1 then break end
end
break
end
end
end
local data = ShownHearthstone
local ID, isToy = data.secure.ID, data.secure.isToy
local cd = DD:GetCooldown("Item", ID)
E:CopyTable(tmp, data)
if cd or (T.tonumber(cd) and T.tonumber(cd) > 1.5) then
tmp.text = "|cff636363"..tmp.text.."|r"..T.format(LP.CDformats[LP.db.portals.cdFormat], cd)
T.tinsert(LP.MainMenu, tmp)
else
T.tinsert(LP.MainMenu, data)
end
end
for i = 1, #LP.PortItems do
......
......@@ -3,6 +3,43 @@ local LP = SLE:GetModule("LocationPanel")
local DEFAULT, CUSTOM = DEFAULT, CUSTOM
local function configTable()
if not SLE.initialized then return end
local function CreateHSPrio()
local config = {
type = "group",
order = 12,
guiInline = true,
name = L["HS Toys Order"],
hidden = function() return not E.db.sle.minimap.locPanel.portals.showHearthstones end,
args = {},
}
for key,_ in T.pairs(E.db.sle.minimap.locPanel.portals.hsPrio) do
config.args[key] = {
type = "select",
name = T.GetItemInfo(key),
order = T.tonumber(key),
width = "full",
get = function(info) return (E.db.sle.minimap.locPanel.portals.hsPrio[key] or 1) end,
set = function(info, value) E.db.sle.minimap.locPanel.portals.hsPrio[key] = value end,
values = {
[1] = "1",
[2] = "2",
[3] = "3",
[4] = "4",
[5] = "5",
[6] = "6",
[7] = "7",
[8] = "8",
[9] = "9",
[10] = "10",
[11] = "11",
[12] = "12",
},
}
end
return config
end
E.Options.args.sle.args.modules.args.minimap.args.locPanel = {
type = "group",
name = L["Location Panel"],
......@@ -217,37 +254,38 @@ local function configTable()
},
HSplace = {
type = "toggle",
order = 6,
order = 10,
name = L["Hearthstone Location"],
desc = L["Show the name on location your Heathstone is bound to."],
},
showHearthstones = {
type = "toggle",
order = 7,
order = 11,
name = L["Show hearthstones"],
desc = L["Show hearthstone type items in the list."],
},
hsProprity = CreateHSPrio(),
showToys = {
type = "toggle",
order = 8,
order = 20,
name = L["Show Toys"],
desc = L["Show toys in the list. This option will affect all other display options as well."],
},
showSpells = {
type = "toggle",
order = 9,
order = 30,
name = L["Show spells"],
desc = L["Show relocation spells in the list."],
},
showEngineer = {
type = "toggle",
order = 10,
order = 40,
name = L["Show engineer gadgets"],
desc = L["Show items used only by engineers when the profession is learned."],
},
ignoreMissingInfo = {
type = "toggle",
order = 11,
order = 100,
name = L["Ignore missing info"],
desc = L["SLE_LOCPANEL_IGNOREMISSINGINFO"],
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment