Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Demonstrates sorting issue in AdiBags config dialog using AceConfigDialog-3.0
- local keySort = {}
- keySort[1] = "Ancient Mana"
- keySort[2] = "description"
- keySort[4] = "Trade Goods"
- keySort[8] = "Quest"
- keySort[16] = "Key"
- keySort[17] = "Relic"
- keySort[9] = "New"
- keySort[18] = "Junk"
- keySort[19] = "Item Enhancement!"
- keySort[10] = "Tradeskill"
- keySort[11] = "Power"
- keySort[3] = "Champion Equipment"
- keySort[6] = "BoA"
- keySort[12] = "Miscellaneous"
- keySort[5] = "Recipe"
- keySort[15] = "Item Enhancement"
- keySort[13] = "Equipment"
- keySort[7] = "newAssoc"
- keySort[14] = "Consumable"
- local tempOrders = {}
- tempOrders["Ancient Mana"] = 0
- tempOrders["description"] = 1
- tempOrders["Champion Equipment"] = 0
- tempOrders["Trade Goods"] = 0
- tempOrders["Recipe"] = 0
- tempOrders["BoA"] = 0
- tempOrders["newAssoc"] = 10
- tempOrders["Quest"] = 30
- tempOrders["New"] = 100
- tempOrders["Tradeskill"] = 20
- tempOrders["Power"] = 0
- tempOrders["Miscellaneous"] = -20
- tempOrders["Equipment"] = 10
- tempOrders["Consumable"] = -10
- tempOrders["Item Enhancement"] = 0
- tempOrders["Item Enhancement!"] = 0
- tempOrders["Relic"] = 0
- tempOrders["Junk"] = -40
- tempOrders["Key"] = 0
- local tempNames = {}
- tempNames["Ancient Mana"] = "Ancient Mana"
- tempNames["description"] = "Allow you manually redefine the section in which an item should be put. Simply drag an item on the section title."
- tempNames["Champion Equipment"] = "Champion Equipment"
- tempNames["Trade Goods"] = "Trade Goods"
- tempNames["Recipe"] = "Recipe"
- tempNames["BoA"] = "BoA"
- tempNames["newAssoc"] = "New Override"
- tempNames["Quest"] = "Quest"
- tempNames["New"] = "New"
- tempNames["Tradeskill"] = "Tradeskill"
- tempNames["Power"] = "Power"
- tempNames["Miscellaneous"] = "Miscellaneous"
- tempNames["Equipment"] = "Equipment"
- tempNames["Consumable"] = "Consumable"
- tempNames["Item Enhancement"] = "Item Enhancement"
- tempNames["Item Enhancement!"] = "Item Enhancement!"
- tempNames["Relic"] = "Relic"
- tempNames["Junk"] = "Junk"
- tempNames["Key"] = "Key"
- local function compareOptions(a,b)
- if not a then
- return true
- end
- if not b then
- return false
- end
- local OrderA, OrderB = tempOrders[a] or 100, tempOrders[b] or 100
- if OrderA == OrderB then
- local NameA = (type(tempNames[a]) == "string") and tempNames[a] or ""
- local NameB = (type(tempNames[b]) == "string") and tempNames[b] or ""
- return NameA:upper() < NameB:upper()
- end
- if OrderA < 0 then
- if OrderB > 0 then
- return false
- end
- else
- if OrderB < 0 then
- return true
- end
- end
- return OrderA < OrderB
- end
- table.sort(keySort, compareOptions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement