Skip to content

Commit

Permalink
Make shamans blue in Era
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Dec 14, 2024
1 parent e838861 commit 7c9861d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
21 changes: 20 additions & 1 deletion LootReserve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,32 @@ function LootReserve:UnitSex(player)
end);
end

function LootReserve:GetClassColor(classFilename)
if self:GetCurrentExpansion() == 0 then
if CUSTOM_CLASS_COLORS then
return CUSTOM_CLASS_COLORS[classFilename]; -- Support for WeWantBlueShamans
else
local color = RAID_CLASS_COLORS[classFilename];
if classFilename == "SHAMAN" then
local r, g, b = 0, 0.44, 0.87;

color = CreateColor(r, g, b)
color.colorStr = color:GenerateHexColor()
end
return color;
end
else
return RAID_CLASS_COLORS[classFilename];
end
end

local function GetPlayerClassColor(player, dim, class)
local className, classFilename, classId = LootReserve:UnitClass(player);
if class then
className, classFilename, classId = LootReserve:GetClassInfo(class);
end
if classFilename then
local colors = RAID_CLASS_COLORS[classFilename];
local colors = LootReserve:GetClassColor(classFilename);
if colors then
if dim then
local r, g, b, a = colors:GetRGBA();
Expand Down
4 changes: 2 additions & 2 deletions Windows/ServerLootEditWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
for i = 1, LootReserve:GetNumClasses() do
local name, file, id = LootReserve:GetClassInfo(i);
if id and LootReserve.ItemConditions:TestClassMask(conditions.ClassMask, id) then
text = text .. (#text > 0 and ", " or "") .. format("|c%s%s|r", RAID_CLASS_COLORS[file].colorStr, name);
text = text .. (#text > 0 and ", " or "") .. format("|c%s%s|r", LootReserve:GetClassColor(file).colorStr, name);
end
end
self:SetText(text);
Expand Down Expand Up @@ -67,7 +67,7 @@
index = index + 1;
table.insert(menu, index,
{
text = format("|c%s%s|r", RAID_CLASS_COLORS[file].colorStr, name),
text = format("|c%s%s|r", LootReserve:GetClassColor(file).colorStr, name),
checked = conditions and LootReserve.ItemConditions:TestClassMask(conditions.ClassMask, id) or false,
arg1 = id,
func = function(_, id, _, checked)
Expand Down
4 changes: 2 additions & 2 deletions Windows/ServerWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@
self.DMBLocate = function(self, unit)
local _, playerClass = LootReserve:UnitClass("player");
local _, targetClass = LootReserve:UnitClass(unit);
local color1 = RAID_CLASS_COLORS[playerClass];
local color2 = RAID_CLASS_COLORS[targetClass];
local color1 = LootReserve:GetClassColor(playerClass);
local color2 = LootReserve:GetClassColor(targetClass);

if self.Locator.active then
self.Locator.m1:Free(true);
Expand Down

0 comments on commit 7c9861d

Please sign in to comment.