Compare commits

...

28 Commits

Author SHA1 Message Date
Max 4a7ca281dd more symmetrical grid 2026-06-01 21:54:44 +02:00
Max d3b7ebfc15 Edit Grid spacings for 3x2 monitor 2026-06-01 21:51:01 +02:00
Max 3114e0ae7f Overview should also use calculated equivalent counts 2026-06-01 21:23:08 +02:00
Max fb7bcf5780 Fix compacting 2026-06-01 21:14:07 +02:00
Max d1b569979e Change badge font 2026-06-01 20:46:04 +02:00
Max 4c00d3b232 Add compressionlevel batch to Item 2026-06-01 20:34:26 +02:00
Max 5907cd8f27 Implement the page now showing equivalent item counts for all compression levels 2026-06-01 20:29:20 +02:00
Max 5915e928c3 Fix scrolling / update race condition 2026-06-01 16:13:21 +02:00
Max 6d22b5547c smaller scale 2026-06-01 15:40:56 +02:00
Max 911d51815d temporarily set text scale back to one 2026-06-01 15:37:38 +02:00
Max 4c77395fc7 Improve asnyc updates 2026-06-01 15:36:06 +02:00
Max 4653050f45 Revert chunked loading, improve async loading 2026-06-01 15:26:03 +02:00
Max f8ad2a6439 Devide update into steps for better async behaviour 2026-06-01 15:18:35 +02:00
Max 514c7e9b22 Async count updates 2026-06-01 15:10:15 +02:00
Max 0c33acf06d Mebride compatibility fix 2026-06-01 14:57:40 +02:00
Max 63775ae3ea Fix compacting 2026-06-01 14:49:44 +02:00
Max 862aa03549 compact atc_chains 2026-06-01 14:45:09 +02:00
Max 816a28986c Removed pngs from chain json 2026-06-01 14:33:19 +02:00
Max 8d9abc8cb2 Add whitelist capabilities 2026-06-01 13:43:18 +02:00
Max 14961629f2 Translate everything to english 2026-06-01 13:31:37 +02:00
Max 2a15e704b2 Auto pull dependencies 2026-06-01 13:29:41 +02:00
Max 991bc5eb3e Let scrollbar only scroll to whole row numbers 2026-06-01 05:19:36 +02:00
Max 0a9380cd22 Remember overview scroll position 2026-06-01 05:14:01 +02:00
Max d381ac1693 Implement page scrolling (seperate into runScrollableGrid) 2026-06-01 05:12:24 +02:00
Max 8a5e4a0fb1 Implement overview scrolling 2026-06-01 05:04:39 +02:00
Max e5f7da3cc5 Update fallback icon 2026-06-01 04:27:01 +02:00
Max 4f623656bb Resort overview every 30seconds 2026-06-01 04:23:27 +02:00
Max acfc5e7324 Added sorting to Overview 2026-06-01 04:22:06 +02:00
7 changed files with 28831 additions and 59391 deletions
+1 -31561
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+100
View File
@@ -0,0 +1,100 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import json
from pathlib import Path
def crop_icon(icon: str | None) -> list[int | str] | None:
if not icon:
return None
lines = icon.split("\n")
xs: list[int] = []
ys: list[int] = []
for y, line in enumerate(lines):
for x, char in enumerate(line):
if char != " ":
xs.append(x)
ys.append(y)
if not xs:
return [0, 0, ""]
min_x = min(xs)
max_x = max(xs)
min_y = min(ys)
max_y = max(ys)
cropped_lines = [line[min_x : max_x + 1].rstrip() for line in lines[min_y : max_y + 1]]
return [min_x, min_y, "\n".join(cropped_lines)]
def compact_chains(data: object) -> list[list[object]]:
if isinstance(data, dict):
chains = data.get("chains")
else:
chains = data
if not isinstance(chains, list):
raise ValueError("Input JSON does not contain a valid chains array")
compact: list[list[object]] = []
for chain in chains:
if isinstance(chain, list):
if len(chain) == 2 and isinstance(chain[1], list):
compact.append(chain)
continue
if len(chain) == 3 and isinstance(chain[1], int) and isinstance(chain[2], list):
compact.append([chain[0], chain[2]])
continue
raise ValueError("Invalid compact chain entry")
if not isinstance(chain, dict):
raise ValueError("Expected verbose or compact chain entries as input")
items = chain.get("items")
if not isinstance(items, list) or not items:
continue
base_id = chain["base_id"]
compact_items: list[list[object]] = []
for item in items:
compact_items.append([
item["item_id"],
crop_icon(item.get("icon_nfp_16x16")),
])
compact.append([base_id, compact_items])
return compact
def main() -> int:
parser = argparse.ArgumentParser(
description="Rewrite atc_chains.json into a compact format used by compcount.lua."
)
parser.add_argument("source", nargs="?", default="atc_chains_uncompressed.json")
parser.add_argument("destination", nargs="?", default="atc_chains.json")
args = parser.parse_args()
source_path = Path(args.source)
destination_path = Path(args.destination)
original_text = source_path.read_text(encoding="utf-8")
data = json.loads(original_text)
compact = {"chains": compact_chains(data)}
compact_text = json.dumps(compact, separators=(",", ":"))
destination_path.write_text(compact_text, encoding="utf-8")
print(f"Compacted {source_path} -> {destination_path}")
print(f"Old size: {len(original_text.encode('utf-8'))} bytes")
print(f"New size: {len(compact_text.encode('utf-8'))} bytes")
return 0
if __name__ == "__main__":
raise SystemExit(main())
+891 -136
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
from pathlib import Path
def remove_icon_png_base64_lines(path: Path) -> int:
original = path.read_text(encoding="utf-8")
lines = original.splitlines(keepends=True)
kept_lines = []
removed = 0
for line in lines:
if '"icon_png_base64"' in line:
removed += 1
continue
kept_lines.append(line)
if removed:
path.write_text("".join(kept_lines), encoding="utf-8")
return removed
def main() -> int:
parser = argparse.ArgumentParser(
description="Remove icon_png_base64 fields from atc_chains.json while preserving all other text."
)
parser.add_argument(
"path",
nargs="?",
default="atc_chains.json",
help="Path to the JSON file to rewrite in place.",
)
args = parser.parse_args()
path = Path(args.path)
removed = remove_icon_png_base64_lines(path)
print(f"Removed {removed} icon_png_base64 field(s) from {path}.")
return 0
if __name__ == "__main__":
raise SystemExit(main())
+3
View File
@@ -0,0 +1,3 @@
[
]