Skip to content

Commit

Permalink
Fix prestige icon display
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Oct 29, 2017
1 parent 96f4f7e commit 33e3e17
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 25 deletions.
24 changes: 4 additions & 20 deletions REFlexFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local sgsub, sbyte = string.gsub, string.byte
local strsplit, date, select, tostring, PlaySound, time = strsplit, date, select, tostring, PlaySound, time
local GetAchievementCriteriaInfo = GetAchievementCriteriaInfo
local GetServerTime = GetServerTime
local GetPrestigeInfo = GetPrestigeInfo
local PanelTemplates_GetSelectedTab = PanelTemplates_GetSelectedTab
local StaticPopup_Hide = StaticPopup_Hide
local CLASS_ICON_TCOORDS, RAID_CLASS_COLORS = CLASS_ICON_TCOORDS, RAID_CLASS_COLORS
Expand Down Expand Up @@ -327,26 +328,9 @@ function RE:GetRaceIcon(token, size)
end

function RE:GetPrestigeIcon(level, size)
local sufix = ""
if level > 0 and level < 5 then
sufix = level
elseif level > 4 and level < 10 then
sufix = "2-"..level - 4
elseif level > 9 and level < 15 then
sufix = "3-"..level - 9
elseif level > 14 and level < 20 then
sufix = "4-"..level - 14
elseif level > 19 and level < 25 then
sufix = "5-"..level - 19
elseif level > 24 and level < 30 then
sufix = "6-"..level - 24
elseif level > 29 and level < 35 then
sufix = "7-"..level - 29
elseif level > 34 and level < 40 then
sufix = "8-"..level - 34
end
if sufix ~= "" then
return "|TInterface\\PVPFrame\\Icons\\prestige-icon-"..sufix..":"..size..":"..size..":0:0|t"
local prestigeID = GetPrestigeInfo(level)
if RE.PrestigeIcons[prestigeID] then
return "|T"..RE.PrestigeIcons[prestigeID]..":"..size..":"..size..":0:0|t"
else
return ""
end
Expand Down
48 changes: 43 additions & 5 deletions REFlexStructures.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,53 @@ RE.RaceIcons = {
["Dwarf"] = {0.125, 0.25, 0, 0.25},
["Gnome"] = {0.25, 0.375, 0, 0.25},
["Night Elf"] = {0.375, 0.5, 0, 0.25},
["Tauren"] = {0, 0.125, 0.25, 0.5},
["Undead"] = {0.125, 0.25, 0.25, 0.5},
["Tauren"] = {0, 0.125, 0.25, 0.5},
["Undead"] = {0.125, 0.25, 0.25, 0.5},
["Troll"] = {0.25, 0.375, 0.25, 0.5},
["Orc"] = {0.375, 0.5, 0.25, 0.5},
["Blood Elf"] = {0.5, 0.625, 0.25, 0.5},
["Draenei"] = {0.5, 0.625, 0, 0.25},
["Goblin"] = {0.629, 0.750, 0.25, 0.5},
["Worgen"] = {0.629, 0.750, 0, 0.25},
["Pandaren"] = {0.756, 0.881, 0, 0.25}
["Goblin"] = {0.629, 0.750, 0.25, 0.5},
["Worgen"] = {0.629, 0.750, 0, 0.25},
["Pandaren"] = {0.756, 0.881, 0, 0.25}
}

RE.PrestigeIcons = {
[1375574] = "Interface/PVPFrame/Icons/prestige-icon-1",
[1551554] = "Interface/PVPFrame/Icons/prestige-icon-2-1",
[1551555] = "Interface/PVPFrame/Icons/prestige-icon-2-2",
[1551556] = "Interface/PVPFrame/Icons/prestige-icon-2-3",
[1551557] = "Interface/PVPFrame/Icons/prestige-icon-2-4",
[1567394] = "Interface/PVPFrame/Icons/prestige-icon-2-5",
[1375575] = "Interface/PVPFrame/Icons/prestige-icon-2",
[1597386] = "Interface/PVPFrame/Icons/prestige-icon-3-1",
[1597388] = "Interface/PVPFrame/Icons/prestige-icon-3-2",
[1597390] = "Interface/PVPFrame/Icons/prestige-icon-3-3",
[1597392] = "Interface/PVPFrame/Icons/prestige-icon-3-4",
[1597394] = "Interface/PVPFrame/Icons/prestige-icon-3-5",
[1375576] = "Interface/PVPFrame/Icons/prestige-icon-3",
[1597396] = "Interface/PVPFrame/Icons/prestige-icon-4-1",
[1597397] = "Interface/PVPFrame/Icons/prestige-icon-4-2",
[1597398] = "Interface/PVPFrame/Icons/prestige-icon-4-3",
[1597399] = "Interface/PVPFrame/Icons/prestige-icon-4-4",
[1597400] = "Interface/PVPFrame/Icons/prestige-icon-4-5",
[1375577] = "Interface/PVPFrame/Icons/prestige-icon-4",
[1713158] = "Interface/PVPFrame/Icons/prestige-icon-5-1",
[1713159] = "Interface/PVPFrame/Icons/prestige-icon-5-2",
[1713160] = "Interface/PVPFrame/Icons/prestige-icon-5-3",
[1713161] = "Interface/PVPFrame/Icons/prestige-icon-5-4",
[1713162] = "Interface/PVPFrame/Icons/prestige-icon-6-1",
[1713163] = "Interface/PVPFrame/Icons/prestige-icon-6-2",
[1713164] = "Interface/PVPFrame/Icons/prestige-icon-6-3",
[1713165] = "Interface/PVPFrame/Icons/prestige-icon-6-4",
[1713166] = "Interface/PVPFrame/Icons/prestige-icon-7-1",
[1713167] = "Interface/PVPFrame/Icons/prestige-icon-7-2",
[1713168] = "Interface/PVPFrame/Icons/prestige-icon-7-3",
[1713169] = "Interface/PVPFrame/Icons/prestige-icon-7-4",
[1713170] = "Interface/PVPFrame/Icons/prestige-icon-8-1",
[1713171] = "Interface/PVPFrame/Icons/prestige-icon-8-2",
[1713172] = "Interface/PVPFrame/Icons/prestige-icon-8-3",
[1713173] = "Interface/PVPFrame/Icons/prestige-icon-8-4",
}

RE.Roles = {}
Expand Down

0 comments on commit 33e3e17

Please sign in to comment.