|
19 | 19 | from src.item.data.item_type import is_sigil |
20 | 20 | from src.item.filter import Filter, FilterResult |
21 | 21 | from src.item.find_descr import find_descr |
22 | | -from src.scripts.common import ( |
23 | | - ASPECT_UPGRADES_LABEL, |
24 | | - COLOR_BLUE, |
25 | | - COLOR_GREEN, |
26 | | - COLOR_GREY, |
27 | | - COLOR_ORANGE, |
28 | | - COLOR_RED, |
29 | | - is_ignored_item, |
30 | | - is_junk_rarity, |
31 | | - reset_canvas, |
32 | | -) |
| 22 | +from src.scripts.common import ASPECT_UPGRADES_LABEL, get_filter_colors, is_ignored_item, is_junk_rarity, reset_canvas |
33 | 23 | from src.tts import Publisher |
34 | 24 | from src.ui.char_inventory import CharInventory |
35 | 25 | from src.ui.stash import Stash |
@@ -221,44 +211,46 @@ def draw_empty_outline(self, item_roi, color, text: str | None): |
221 | 211 |
|
222 | 212 | def draw_match_outline(self, item_roi, should_keep_res, item_descr): |
223 | 213 | x, y, w, h, off = self.get_coords_from_roi(item_roi) |
224 | | - self.create_signal_rect(self.canvas, w, self.thick, COLOR_GREEN) |
| 214 | + self.create_signal_rect(self.canvas, w, self.thick, get_filter_colors().matched) |
225 | 215 |
|
226 | 216 | # show all info strings of the profiles |
227 | 217 | text_y = h |
228 | 218 | for match in reversed(should_keep_res.matched): |
229 | | - text_y = self.draw_text(self.canvas, match.profile, COLOR_GREEN, text_y, 5, w // 2) |
| 219 | + text_y = self.draw_text(self.canvas, match.profile, get_filter_colors().matched, text_y, 5, w // 2) |
230 | 220 | # Show matched bullets |
231 | 221 | if item_descr and len(should_keep_res.matched) > 0: |
232 | 222 | bullet_width = self.thick * 3 |
233 | 223 | for affix in should_keep_res.matched[0].matched_affixes: |
234 | 224 | if affix.loc: |
235 | | - self.draw_rect(self.canvas, bullet_width, affix, off, COLOR_GREEN) |
| 225 | + self.draw_rect(self.canvas, bullet_width, affix, off, get_filter_colors().matched) |
236 | 226 |
|
237 | 227 | if item_descr.aspect and item_descr.aspect.loc and any(m.did_match_aspect for m in should_keep_res.matched): |
238 | | - self.draw_rect(self.canvas, bullet_width, item_descr.aspect, off, COLOR_GREEN) |
| 228 | + self.draw_rect(self.canvas, bullet_width, item_descr.aspect, off, get_filter_colors().matched) |
239 | 229 |
|
240 | 230 | self.root.update_idletasks() |
241 | 231 | self.root.update() |
242 | 232 |
|
243 | 233 | def draw_no_match_outline(self, item_roi): |
244 | 234 | x, y, w, h, off = self.get_coords_from_roi(item_roi) |
245 | | - self.create_signal_rect(self.canvas, w, self.thick, COLOR_RED) |
| 235 | + self.create_signal_rect(self.canvas, w, self.thick, get_filter_colors().no_match) |
246 | 236 | self.root.update_idletasks() |
247 | 237 | self.root.update() |
248 | 238 |
|
249 | 239 | def draw_codex_upgrade_outline(self, item_roi, should_keep_result: FilterResult): |
250 | 240 | x, y, w, h, off = self.get_coords_from_roi(item_roi) |
251 | 241 |
|
252 | | - self.create_signal_rect(self.canvas, w, self.thick, COLOR_ORANGE) |
| 242 | + self.create_signal_rect(self.canvas, w, self.thick, get_filter_colors().codex_upgrade) |
253 | 243 |
|
254 | 244 | # show string indicating that this item upgrades the codex |
255 | 245 | if len(should_keep_result.matched) == 1 and should_keep_result.matched[0].profile == ASPECT_UPGRADES_LABEL: |
256 | | - self.draw_text(self.canvas, "Codex Upgrade", COLOR_ORANGE, h, 5, w // 2) |
| 246 | + self.draw_text(self.canvas, "Codex Upgrade", get_filter_colors().codex_upgrade, h, 5, w // 2) |
257 | 247 | else: |
258 | 248 | # This matched an Aspects section in a profile, write the profiles |
259 | 249 | text_y = h |
260 | 250 | for match in reversed(should_keep_result.matched): |
261 | | - text_y = self.draw_text(self.canvas, match.profile, COLOR_ORANGE, text_y, 5, w // 2) |
| 251 | + text_y = self.draw_text( |
| 252 | + self.canvas, match.profile, get_filter_colors().codex_upgrade, text_y, 5, w // 2 |
| 253 | + ) |
262 | 254 |
|
263 | 255 | self.root.update_idletasks() |
264 | 256 | self.root.update() |
@@ -346,12 +338,12 @@ def evaluate_item_and_queue_draw(self, item_descr: Item): |
346 | 338 | if ignored_item: |
347 | 339 | if item_descr.sanctified: |
348 | 340 | self.request_empty_outline( |
349 | | - item_descr, item_roi, COLOR_BLUE, "Sanctified (Not Supported)" |
| 341 | + item_descr, item_roi, get_filter_colors().unhandled, "Sanctified (Not Supported)" |
350 | 342 | ) |
351 | 343 | else: |
352 | | - self.request_empty_outline(item_descr, item_roi, COLOR_BLUE) |
| 344 | + self.request_empty_outline(item_descr, item_roi, get_filter_colors().unhandled) |
353 | 345 | else: |
354 | | - self.request_empty_outline(item_descr, item_roi, COLOR_GREY) |
| 346 | + self.request_empty_outline(item_descr, item_roi, get_filter_colors().processing) |
355 | 347 |
|
356 | 348 | # Since we've now drawn something we kick off a thread to remove the drawing |
357 | 349 | # if the item is unselected. It is also automatically removed if a different |
|
0 commit comments