@@ -57,6 +57,57 @@ function PetitionersOverlay:init()
5757 },
5858 }
5959end
60+ local skill_color_ranges = {
61+ {0 , 0 , COLOR_GREY }, -- MINING
62+ {1 , 2 , COLOR_BROWN }, -- Woodcutting / Carpentry
63+ {3 , 4 , COLOR_BROWN }, -- Engrave / Masonry
64+ {5 , 23 , COLOR_YELLOW }, -- Cooking / artisan crafting
65+ {24 , 28 , COLOR_ORANGE }, -- Smelt / forge
66+ {29 , 30 , COLOR_CYAN }, -- Gem cutting / encrusting
67+ {31 , 36 , COLOR_BROWN }, -- Crafting
68+ {37 , 53 , COLOR_RED }, -- Weapon skills
69+ {54 , 56 , COLOR_MAGENTA }, -- Mechanics, magic, sneak
70+ {57 , 62 , COLOR_LIME }, -- Medical skills (healing green)
71+ {63 , 69 , COLOR_TAN }, -- Odd jobs
72+ {70 , 82 , COLOR_BLUE }, -- Social skills
73+ {83 , 87 , COLOR_PURPLE }, -- Inner skills like discipline
74+ {88 , 91 , COLOR_MAGENTA }, -- Writing / Poetry / Reading
75+ {92 , 96 , COLOR_BLUE }, -- Teaching / Leadership
76+ {97 , 106 , COLOR_DARKRED }, -- Military skills
77+ {107 , 113 , COLOR_BROWN }, -- Artisan odd jobs
78+ {114 , 115 , COLOR_GREEN }, -- Climbing / Gelding
79+ {116 , 122 , COLOR_MAGENTA }, -- Artistic skills
80+ {123 , 130 , COLOR_TEAL }, -- Thinking / Engineering
81+ {131 , 132 , COLOR_MAGENTA }, -- Papermaking / bookbinding
82+ {133 , 134 , COLOR_BROWN }, -- Cut / carve stone
83+ }
84+
85+
86+ local function get_skill_color (skill_id )
87+ if not skill_id then return COLOR_GREY end
88+ for _ , range in ipairs (skill_color_ranges ) do
89+ local min_id , max_id , color = table.unpack (range )
90+ if skill_id >= min_id and skill_id <= max_id then
91+ return color
92+ end
93+ end
94+ return COLOR_GREY -- fallback
95+ end
96+
97+ local function get_rating_color (rating )
98+ if not rating then return COLOR_GREY end
99+ if rating <= 4 then
100+ return COLOR_GREY
101+ elseif rating <= 8 then
102+ return COLOR_WHITE
103+ elseif rating <= 12 then
104+ return COLOR_YELLOW
105+ elseif rating <= 16 then
106+ return COLOR_ORANGE
107+ else -- 17-20
108+ return COLOR_RED
109+ end
110+ end
60111
61112-- Builds or refreshes the list contents based on the currently selected petition
62113function PetitionersOverlay :SetListChoices ()
@@ -115,8 +166,8 @@ function PetitionersOverlay:SetListChoices()
115166 -- local skill_name_pen = COLOR_CYAN -- for skill name
116167 -- local skill_rating_pen = COLOR_WHITE -- for rating
117168
118- table.insert (lines , { text = string.format (" %-26s" , df .job_skill [skill .id ]), pen = COLOR_RED })
119- table.insert (lines , { text = string.format (" %2d" , skill .rating ), pen = COLOR_BLUE })
169+ table.insert (lines , { text = string.format (" %-26s" , df .job_skill [skill .id ]), pen = get_skill_color ( skill . id ) })
170+ table.insert (lines , { text = string.format (" %2d" , skill .rating ), pen = get_rating_color ( skill . rating ) })
120171 table.insert (lines , NEWLINE )
121172 end
122173 end
0 commit comments