In GenerateTooltipContent(): Changed skill colorization to be based on comparing the player's skill level with the recipe's optimal, medium, easy, and trivial levels rather than using the optimal only and a comparison of 20, 30, and 40 - yields correct results and is in-line with the recipe difficulty colors in the list.
torhal [02-15-10 - 04:18]
In GenerateTooltipContent(): Changed skill colorization to be based on comparing the player's skill level with the recipe's optimal, medium, easy, and trivial levels rather than using the optimal only and a comparison of 20, 30, and 40 - yields correct results and is in-line with the recipe difficulty colors in the list.
diff --git a/Frame.lua b/Frame.lua
index ed79aca..89e5bc2 100644
--- a/Frame.lua
+++ b/Frame.lua
@@ -647,19 +647,26 @@ do
-- Add in skill level requirement, colored correctly
local color_1 = addon:hexcolor("NORMAL")
+ local color_2
- local recipe_level = recipe_entry.skill_level
local skill_level = Player["ProfessionLevel"]
- local color_2
+ local recipe_level = recipe_entry.skill_level
+ local optimal_level = recipe_entry.optimal_level
+ local medium_level = recipe_entry.medium_level
+ local easy_level = recipe_entry.easy_level
+ local trivial_level = recipe_entry.trivial_level
+
if recipe_level > skill_level then
color_2 = addon:hexcolor("RED")
- elseif skill_level - recipe_level < 20 then
- color_2 = addon:hexcolor("ORANGE")
- elseif skill_level - recipe_level < 30 then
- color_2 = addon:hexcolor("YELLOW")
- elseif skill_level - recipe_level < 40 then
+ elseif skill_level >= trivial_level then
+ color_2 = addon:hexcolor("MIDGREY")
+ elseif skill_level >= easy_level then
color_2 = addon:hexcolor("GREEN")
+ elseif skill_level >= medium_level then
+ color_2 = addon:hexcolor("YELLOW")
+ elseif skill_level >= optimal_level then
+ color_2 = addon:hexcolor("ORANGE")
else
color_2 = addon:hexcolor("MIDGREY")
end