Code format
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
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"
|
||||
[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
|
||||
@@ -39,18 +38,27 @@ aura_env.Key = {
|
||||
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
return string.format("%-30s %-8s %-8s %-10s %-10s", self.name, self.role, level, self.time, score)
|
||||
end,
|
||||
})
|
||||
self.name = name
|
||||
@@ -61,9 +69,7 @@ aura_env.Key = {
|
||||
return self
|
||||
end,
|
||||
---@return string
|
||||
hash = function(self)
|
||||
return table.concat({ self.name, self.role, self.level, self.time, self.score }, "/")
|
||||
end,
|
||||
hash = function(self) return table.concat({ self.name, self.role, self.level, self.time, self.score }, "/") end,
|
||||
|
||||
---@param self Key
|
||||
---@param other Key
|
||||
@@ -71,9 +77,7 @@ aura_env.Key = {
|
||||
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
|
||||
if self.name <= other.name then return true end
|
||||
return false
|
||||
end,
|
||||
---@param self Key
|
||||
@@ -81,5 +85,5 @@ aura_env.Key = {
|
||||
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
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user