Files
yusufipk c2a5a2d4d2 Hearthstone deck tracker for Linux, first public version
Reads the game's own Power.log: no screen capture, no image
recognition, no memory reading.

- deck tracking (remaining cards, draw chance, played cards fade in place)
- opponent panel (revealed cards, hand and deck counts)
- decks read from the game's offline cache, matched to the match
- card art in rows, full card on hover
- overlay and window modes, adjustable transparency, tray icon
- English and Turkish interface
- consistency tests over a real log corpus, cross-checked against Zone.log
2026-07-27 22:31:13 +07:00

38 lines
1.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Kullanıcı ayarları. ~/.config/deste/config.json"""
from __future__ import annotations
import json
import os
from pathlib import Path
CONFIG_DIR = Path(os.environ.get("XDG_CONFIG_HOME", "~/.config")).expanduser() / "deste"
CONFIG_PATH = CONFIG_DIR / "config.json"
DEFAULTS = {
"game_dir": "",
"window_mode": "overlay", # overlay veya window
"opacity": 0.92,
"geometry": {}, # mod -> [genişlik, yükseklik]
"show_draw_chance": True,
"selected_deck": "", # boş ise otomatik eşleştirme
"language": "auto", # auto, tr, en
}
def load() -> dict:
data = dict(DEFAULTS)
if CONFIG_PATH.exists():
try:
data.update(json.loads(CONFIG_PATH.read_text(encoding="utf-8")))
except (OSError, json.JSONDecodeError):
pass
return data
def save(data: dict) -> None:
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
tmp = CONFIG_PATH.with_suffix(".tmp")
tmp.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
tmp.replace(CONFIG_PATH)