90 lines
2.4 KiB
Lua
90 lines
2.4 KiB
Lua
aura_env.challengeNameMap = {
|
|
[165] = "Graimrail Depot",
|
|
[166] = "Shadowmoon Burial Grounds",
|
|
[197] = "Eye of Azshara",
|
|
[198] = "Darkheart Thicket",
|
|
[199] = "Black Rook Hold",
|
|
[200] = "Halls of Valor",
|
|
[206] = "Neltharion's Lair",
|
|
[207] = "Vault of the Wardens",
|
|
[208] = "Maw of Souls",
|
|
[209] = "The Arcway",
|
|
[210] = "Court of Stars",
|
|
[227] = "Return to Karazhan: Lower",
|
|
[233] = "Cathedral of Eternal Night",
|
|
[234] = "Return to Karazhan: Upper",
|
|
[239] = "Seat of the Triumvirate",
|
|
}
|
|
|
|
---@class Key
|
|
---@field name string
|
|
---@field role string
|
|
---@field level string
|
|
---@field time string
|
|
---@field score number
|
|
aura_env.Key = {
|
|
---@return Key
|
|
---@param name string
|
|
---@param role string
|
|
---@param level string
|
|
---@param time string
|
|
---@param score string
|
|
new = function(name, role, level, time, score)
|
|
local self = setmetatable({}, {
|
|
__index = Key,
|
|
__tostring = function(self)
|
|
local score = self.score
|
|
local keyLevel = tonumber(self.level:match("%d+$")) or 0
|
|
|
|
local formattedScore, err = aura_env.ScoreColorer.Interpolate(self.score)
|
|
if not err then
|
|
score = string.format(
|
|
"|cff%02x%02x%02x%d|r",
|
|
formattedScore.r * 255,
|
|
formattedScore.g * 255,
|
|
formattedScore.b * 255,
|
|
self.score
|
|
)
|
|
end
|
|
|
|
local formattedLevel, err = aura_env.KeyLevel.Interpolate(keyLevel)
|
|
if not err then
|
|
level = string.format(
|
|
"|cff%02x%02x%02x%s|r",
|
|
formattedLevel.r * 255,
|
|
formattedLevel.g * 255,
|
|
formattedLevel.b * 255,
|
|
self.level
|
|
)
|
|
end
|
|
|
|
return string.format("%-30s %-8s %-8s %-10s %-10s", self.name, self.role, level, self.time, score)
|
|
end,
|
|
})
|
|
self.name = name
|
|
self.role = role
|
|
self.level = level
|
|
self.time = time
|
|
self.score = tonumber(score) or 0
|
|
return self
|
|
end,
|
|
---@return string
|
|
hash = function(self) return table.concat({ self.name, self.role, self.level, self.time, self.score }, "/") end,
|
|
|
|
---@param self Key
|
|
---@param other Key
|
|
---@return boolean
|
|
compareTo = function(self, other)
|
|
if not self then return true end
|
|
if not other then return false end
|
|
if self.name <= other.name then return true end
|
|
return false
|
|
end,
|
|
---@param self Key
|
|
register = function(self)
|
|
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
|
|
if not WeakAurasSaved.Cyka.MData then WeakAurasSaved.Cyka.MData = {} end
|
|
WeakAurasSaved.Cyka.MData[self:hash()] = self
|
|
end,
|
|
}
|