Add CS2 pattern fetcher subtool
Introduce a CS2 pattern download tool with toolbar entry, translations, and requests dependency. Document the workflow and requirements updates.
This commit is contained in:
+14
-1
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import colorsys
|
||||
import tkinter as tk
|
||||
import tkinter.font as tkfont
|
||||
from tkinter import ttk
|
||||
from tkinter import messagebox, ttk
|
||||
|
||||
|
||||
class UIBuilderMixin:
|
||||
@@ -24,6 +24,7 @@ class UIBuilderMixin:
|
||||
("💾", self._t("toolbar.save_overlay"), self.save_overlay),
|
||||
("△", self._t("toolbar.toggle_free_draw"), self.toggle_exclusion_mode),
|
||||
("🧹", self._t("toolbar.clear_excludes"), self.clear_excludes),
|
||||
("🎯", self._t("toolbar.cs2_tool"), self.open_cs2_pattern_tool),
|
||||
("↩", self._t("toolbar.undo_exclude"), self.undo_exclude),
|
||||
("🔄", self._t("toolbar.reset_sliders"), self.reset_sliders),
|
||||
("🌓", self._t("toolbar.toggle_theme"), self.toggle_theme),
|
||||
@@ -522,6 +523,18 @@ class UIBuilderMixin:
|
||||
activeforeground=palette["fg"],
|
||||
)
|
||||
|
||||
def open_cs2_pattern_tool(self) -> None:
|
||||
try:
|
||||
from app.tools import open_cs2_pattern_tool as _open_cs2_pattern_tool
|
||||
except Exception as exc: # noqa: BLE001
|
||||
messagebox.showerror(
|
||||
self._t("dialog.error_title"),
|
||||
self._t("cs2.launch_error").format(error=str(exc)),
|
||||
parent=getattr(self, "root", None),
|
||||
)
|
||||
return
|
||||
_open_cs2_pattern_tool(self)
|
||||
|
||||
def _canvas_background_colour(self) -> str:
|
||||
return "#0f0f10" if getattr(self, "theme", "light") == "dark" else "#ffffff"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user