Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

refactor: completely remove League of Legends companion, background daemon, and IPC commands

IGECT31cd1cfc69c9
diff --git a/README.md b/README.md
index 2411c0a6..a03c6b46 100644
--- a/README.md
+++ b/README.md
@@ -76,8 +76,6 @@ twitch-downloader, subtitle-downloader, epub-reader, spaced-repetition
- [The Tools section: 158 tools in 25 categories](#the-tools-section-158-tools-in-25-categories)
- [OmniGet for AI agents: MCP server and Claude Code plugin](#omniget-for-ai-agents-mcp-server-and-claude-code-plugin)
- [Plugins: Courses, Study, Telegram, Convert](#plugins-courses-study-telegram-convert)
-- [Built-in chat, off by default](#built-in-chat-off-by-default)
-- [For League of Legends players](#for-league-of-legends-players)
- [Everything else in the box](#everything-else-in-the-box)
- [Privacy and what OmniGet refuses to do](#privacy-and-what-omniget-refuses-to-do)
- [Code signing policy](#code-signing-policy)
@@ -592,20 +590,6 @@ FFmpeg conversions with GPU acceleration where the machine has it: container, co
---
-## For League of Legends players
-
-A League menu sits in the sidebar. It reads your running League client locally, with no account and no third-party build site, and does nothing until the client is open. If you never play, switch it off in **Settings → Advanced → League of Legends** and the menu disappears.
-
-<p align="center">
- <img src="assets/readme/illustration-league.png" alt="Loop in a gaming chair with a headset, looking at a monitor with a three-lane map and a ten-player scoreboard, with trophy, dice, chart and AI tiles beside it" width="900" />
-</p>
-
-Match scouting for both teams with rank, recent form, KDA and the champions each player actually plays. Win probability that shrinks win rates toward the baseline by sample size and always shows a range. Live gold, CS and level for all ten players. Goals per role you can edit. Runes and summoner spells recommended by the client itself, applied in one click and only ever replacing the page OmniGet created. Champion tiers by role. Player search by Riot ID. Opt-in automation: accept matches, pick and ban from your priority list, grab a champion off the ARAM bench. Every automation has its own switch.
-
-New and marked beta or experimental: a **Profile** tab that edits what other players see (rank shown in chat, challenge medals and title, banner and crest, chat icon, bulk friend management); a **skin, chroma and ward roulette** that rolls an owned skin the moment you lock in, with rerolls; a **champion and lane raffle** for when you want the queue to decide, plus an optional random pick in champion select; full **match history and ranked stats for any player** through the client's own backend gateway, with replay download; and an **AI coach** that reviews a game, spots trends over your last matches or answers a question about the current champ select, using your configured AI provider and OP.GG's public data.
-
----
-
## Everything else in the box
- Command palette (**Ctrl+K** or **Cmd+K**) that jumps to any page, setting or tool.
diff --git a/README.ru.md b/README.ru.md
index f10ee90c..d1d89d4c 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -76,8 +76,6 @@ twitch-downloader, subtitle-downloader, epub-reader, spaced-repetition
- [Раздел «Инструменты»: 158 инструментов в 25 категориях](#раздел-инструменты-158-инструментов-в-25-категориях)
- [OmniGet для ИИ-агентов: MCP-сервер и плагин для Claude Code](#omniget-для-ии-агентов-mcp-сервер-и-плагин-для-claude-code)
- [Плагины: Courses, Study, Telegram, Convert](#плагины-courses-study-telegram-convert)
-- [Встроенный чат: по умолчанию выключен](#встроенный-чат-по-умолчанию-выключен)
-- [Для игроков League of Legends](#для-игроков-league-of-legends)
- [Всё остальное в комплекте](#всё-остальное-в-комплекте)
- [Приватность и то, чего OmniGet не делает](#приватность-и-то-чего-omniget-не-делает)
- [Частые вопросы](#частые-вопросы)
@@ -591,20 +589,6 @@ Study превращает папку скачанных файлов в то,
---
-## Для игроков League of Legends
-
-Меню League находится в боковой панели. Оно читает запущенный клиент League локально, без аккаунта и без сторонних сайтов с билдами, и ничего не делает, пока клиент не открыт. Если вы не играете, выключите его в **Настройки → Дополнительно → League of Legends**, и меню исчезнет.
-
-<p align="center">
- <img src="assets/readme/illustration-league.png" alt="Loop в геймерском кресле с гарнитурой смотрит в монитор с картой трёх линий и таблицей счёта на десять игроков, а рядом — плитки трофея, кубиков, графика и ИИ" width="900" />
-</p>
-
-Разведка матча для обеих команд: ранг, недавняя форма, KDA и чемпионы, на которых каждый игрок действительно играет. Вероятность победы, которая сжимает винрейты к среднему в зависимости от размера выборки и всегда показывает диапазон. Живое золото, CS и уровень всех десяти игроков. Редактируемые цели по ролям. Руны и заклинания, рекомендованные самим клиентом, применяются одним кликом и заменяют только страницу, созданную OmniGet. Тиры чемпионов по ролям. Поиск игрока по Riot ID. Автоматизация по желанию: принимать матчи, пикать и банить по своему списку приоритетов, забирать чемпиона со скамейки ARAM. У каждой автоматизации свой переключатель.
-
-Новое и помеченное как бета или экспериментальное: вкладка **Профиль**, которая меняет то, как вас видят другие (ранг в чате, медали и титул челленджей, баннер и герб, значок в чате, массовое управление друзьями); **рулетка скинов, хромов и вардов**, выбирающая один из ваших скинов в момент лока, с перебросом; **розыгрыш чемпиона и линии** для тех, кто хочет, чтобы решала очередь, плюс необязательный случайный пик в выборе чемпионов; **полная история матчей и ранговая статистика любого игрока** через собственный шлюз клиента к бэкенду, с загрузкой реплеев; и **ИИ-тренер**, который разбирает матч, находит тенденции в последних играх или отвечает на вопрос о текущем выборе чемпионов, используя настроенного вами ИИ-провайдера и открытые данные OP.GG.
-
----
-
## Всё остальное в комплекте
- Палитра команд (**Ctrl+K** или **Cmd+K**) для перехода к любой странице, настройке или инструменту.
diff --git a/README_pt_br.md b/README_pt_br.md
index a582408f..e393f532 100644
--- a/README_pt_br.md
+++ b/README_pt_br.md
@@ -65,8 +65,6 @@ leitor pdf, flashcards anki, repetição espaçada, player de música, spicetify
- [A extensão do navegador, passo a passo](#a-extensão-do-navegador-passo-a-passo)
- [A seção Tools: 108 ferramentas em 16 categorias](#a-seção-tools-108-ferramentas-em-16-categorias)
- [Plugins: Courses, Study, Telegram, Convert](#plugins-courses-study-telegram-convert)
-- [Chat embutido, desligado por padrão](#chat-embutido-desligado-por-padrão)
-- [Para quem joga League of Legends](#para-quem-joga-league-of-legends)
- [Tudo o mais que vem na caixa](#tudo-o-mais-que-vem-na-caixa)
- [Privacidade e o que o OmniGet se recusa a fazer](#privacidade-e-o-que-o-omniget-se-recusa-a-fazer)
- [Perguntas frequentes](#perguntas-frequentes)
@@ -445,16 +443,6 @@ Conversões com FFmpeg e aceleração por GPU quando a máquina tem: contêiner,
---
-## Para quem joga League of Legends
-
-Um menu League fica na barra lateral. Ele lê o cliente do League em execução, localmente, sem conta e sem site de builds de terceiros, e não faz nada enquanto o cliente não está aberto. Se você não joga, desligue em **Configurações → Avançado → League of Legends** e o menu some.
-
-Scouting da partida para os dois times com elo, forma recente, KDA e os campeões que cada jogador realmente joga. Probabilidade de vitória que encolhe as taxas de vitória em direção à média conforme o tamanho da amostra e sempre mostra uma faixa. Ouro, CS e nível ao vivo dos dez jogadores. Metas por função que você pode editar. Runas e feitiços recomendados pelo próprio cliente, aplicados em um clique e substituindo apenas a página que o OmniGet criou. Tiers de campeões por função. Busca de jogador por Riot ID. Automação opcional: aceitar partidas, escolher e banir pela sua lista de prioridade, pegar um campeão do banco do ARAM. Cada automação tem o seu próprio interruptor.
-
-Novidades marcadas como beta ou experimentais: uma aba **Perfil** que edita o que os outros jogadores veem (elo exibido no chat, medalhas e título de desafio, banner e brasão, ícone do chat, gestão de amigos em massa); uma **roleta de skin, chroma e ward** que sorteia uma skin sua no momento do lock-in, com re-sorteio; um **sorteio de campeão e de rota** para quando você quer que a fila decida, mais um pick aleatório opcional na seleção de campeões; **histórico completo e ranked de qualquer jogador** pelo gateway do próprio cliente com o backend, com download de replay; e um **coach de IA** que revisa uma partida, aponta tendências das suas últimas partidas ou responde a uma pergunta sobre a seleção atual, usando o provedor de IA configurado e os dados públicos do OP.GG.
-
----
-
## Tudo o mais que vem na caixa
- Paleta de comandos (**Ctrl+K** ou **Cmd+K**) que pula para qualquer página, configuração ou ferramenta.
diff --git a/README_zh_CN.md b/README_zh_CN.md
index 36411b8c..6012ecdc 100644
--- a/README_zh_CN.md
+++ b/README_zh_CN.md
@@ -65,8 +65,6 @@ spicetify, 下载管理器, tauri, rust, svelte.
- [浏览器扩展,手把手安装](#浏览器扩展手把手安装)
- [Tools 工具区:16 个分类共 108 个工具](#tools-工具区16-个分类共-108-个工具)
- [插件:Courses、Study、Telegram、Convert](#插件coursesstudytelegramconvert)
-- [内置聊天,默认关闭](#内置聊天默认关闭)
-- [给英雄联盟玩家的功能](#给英雄联盟玩家的功能)
- [其他随附功能](#其他随附功能)
- [隐私,以及 OmniGet 拒绝做的事](#隐私以及-omniget-拒绝做的事)
- [常见问题](#常见问题)
@@ -445,16 +443,6 @@ FFmpeg 转换,机器支持时使用 GPU 加速:视频和音频的容器、
---
-## 给英雄联盟玩家的功能
-
-侧栏里有一个 League 菜单。它在本地读取正在运行的游戏客户端,不需要账号,也不依赖第三方出装网站,客户端没打开时什么都不做。如果你不玩,在**设置 → 高级 → League of Legends**里关掉,菜单就会消失。
-
-双方队伍的对局侦察:段位、近期状态、KDA 以及每位玩家真正在玩的英雄。胜率预测会按样本量把胜率往基准值收缩,并且始终给出区间。全部十名玩家的实时经济、补刀和等级。可编辑的分路目标。由客户端自身推荐的符文和召唤师技能,一键应用,且只替换 OmniGet 创建的那一页。按位置的英雄梯队。按 Riot ID 搜索玩家。可选的自动化:自动接受对局、按你的优先列表选人和禁人、从 ARAM 备选席抓英雄。每项自动化都有自己的开关。
-
-新增内容,标为 beta 或实验性:**个人资料**标签页,编辑别人看到的你(聊天中显示的段位、挑战徽章和头衔、横幅和纹章、聊天头像、批量管理好友);**皮肤、炫彩和守卫轮盘**,锁定英雄的那一刻随机选一个你拥有的皮肤,可以重抽;**英雄和分路抽签**,想让队列替你做决定时用,另有可选的选人阶段随机锁定;通过客户端自身的后端网关获取**任意玩家的完整对局历史和排位数据**,并可下载回放;还有一个 **AI 教练**,用你配置的 AI 服务商和 OP.GG 的公开数据复盘一场对局、总结最近几场的趋势,或回答关于当前选人阶段的问题。
-
----
-
## 其他随附功能
- 命令面板(**Ctrl+K** 或 **Cmd+K**),跳转到任何页面、设置或工具。
diff --git a/assets/readme/illustration-league.png b/assets/readme/illustration-league.png
deleted file mode 100644
index a3afaf3c..00000000
Binary files a/assets/readme/illustration-league.png and /dev/null differ
diff --git a/flatpak/com.openselena.omniget.metainfo.xml b/flatpak/com.openselena.omniget.metainfo.xml
index 7a98debd..26418eb8 100644
--- a/flatpak/com.openselena.omniget.metainfo.xml
+++ b/flatpak/com.openselena.omniget.metainfo.xml
@@ -64,7 +64,7 @@
<release version="0.9.1" date="2026-09-05">
<description>
<p>OmniGet gains a Tools section: 108 single-purpose tools in 16 categories, each an isolated command with a tile in the app and an entry on the built-in MCP server, so an AI agent can drive them too. Instagram gets 24 tools over your own session (stories without marking them seen, highlights, who does not follow back, ghost followers, analytics, giveaway picker, publishing), X gets 10 (thread unroll, post to image, profile media, bookmarks, your archive, Grok), Pinterest gets 10 (original-quality pins, board and profile backup with incremental sync, search without AI or ads, duplicates, palettes). Speech tools transcribe offline with whisper.cpp, speak with Edge voices, translate and dub subtitles. PDF tools merge, split, compress, convert, OCR and sanitize on the PDFium the app already manages. System tools clean caches, map the disk, manage startup items and uninstall leftovers, with Windows-only debloat, registry, privacy and hardening. AI tools compare model prices, track spending, manage Ollama models and an API key vault.</p>
- <p>The interface was rebuilt with a single amber accent, a glass sidebar, colored tile icons, a new app icon and a three-step onboarding. The download engine starts yt-dlp as a zipapp on a system Python when one exists, adapts connections per site and halves them on rate limits, segments large direct files properly, stops retrying dead sources and keeps the exact command of every download so it can be edited and rerun. The Courses plugin reaches 1.1.0: Hotmart signs in through its new OIDC flow, Rocketseat validates logins properly and lists the whole catalog, Meta-Analysis Academy is a new platform, and sections can be chosen before downloading. The browser extension groups cookies by real site so Brazilian domains no longer share one bucket, adds Rocketseat and a Force H.264 switch. The League of Legends companion is on by default and gains a profile editor, skin and ward roulette, champion and lane raffles, full match history through the client gateway and an AI coach, all marked beta. Two fixes: the interface could show no text when a translation failed to load, and Settings could spin forever after a failed settings load.</p>
+ <p>The interface was rebuilt with a single amber accent, a glass sidebar, colored tile icons, a new app icon and a three-step onboarding. The download engine starts yt-dlp as a zipapp on a system Python when one exists, adapts connections per site and halves them on rate limits, segments large direct files properly, stops retrying dead sources and keeps the exact command of every download so it can be edited and rerun. The Courses plugin reaches 1.1.0: Hotmart signs in through its new OIDC flow, Rocketseat validates logins properly and lists the whole catalog, Meta-Analysis Academy is a new platform, and sections can be chosen before downloading. The browser extension groups cookies by real site so Brazilian domains no longer share one bucket, adds Rocketseat and a Force H.264 switch. Two fixes: the interface could show no text when a translation failed to load, and Settings could spin forever after a failed settings load.</p>
</description>
</release>
<release version="0.9.0" date="2026-08-29">
@@ -89,7 +89,7 @@
</release>
<release version="0.8.5" date="2026-07-31">
<description>
- <p>The League page now shows loading skeletons instead of pretending to be empty: the match history no longer says "no matches" while it is still fetching, and the profile, match details, win analysis and scouting draw placeholder shapes that respect the reduced-motion preference. Behind it, talking to the League client got cheaper — one shared HTTP client instead of building a new one per request, no extra liveness probe when the push connection already proves the client is alive, and on Windows the expensive process query only runs after a cheap check confirms the client is actually running. The Telegram section speaks all eleven languages again: an earlier change had left a duplicate block in the translation files that silently swallowed sixty-five strings, and the original translations were restored from history rather than replaced with English. Portable mode on macOS now says plainly in settings that the WebView keeps its session data under the user profile and cannot be redirected — being honest about the limitation instead of erasing data to hide it. And the mascot panel's square corners no longer poke past the rounded corners of the home card.</p>
+ <p>The Telegram section speaks all eleven languages again: an earlier change had left a duplicate block in the translation files that silently swallowed sixty-five strings, and the original translations were restored from history rather than replaced with English. Portable mode on macOS now says plainly in settings that the WebView keeps its session data under the user profile and cannot be redirected — being honest about the limitation instead of erasing data to hide it. And the mascot panel's square corners no longer poke past the rounded corners of the home card.</p>
</description>
</release>
<release version="0.8.4" date="2026-07-31">
@@ -99,17 +99,17 @@
</release>
<release version="0.8.3" date="2026-07-30">
<description>
- <p>Second pass at the freeze that could lock the window while the League page was open. The page mounts all eight panels at once and keeps them mounted so that switching tabs never loses your place, but that also meant every state change made all eight re-evaluate and redraw — and the same thread draws the app navigation, so saturating it froze everything, including the menu. An inactive panel now keeps its instance, state and effects while rendering nothing: auto runes still applies from any tab, spell timers survive, and the drawing cost drops to a single panel. The live tab was also being mounted twice, each copy running its own timers. On the backend, lobby and ready check updates are now coalesced the same way champion select already was — the lobby republishes on every queue estimate tick and the ready check on every countdown tick — client messages are filtered by resource before being parsed instead of after, since the subscription receives events from every plugin the client runs, and settings are cached briefly instead of being read from disk on every event. Looking up the client no longer holds its lock across a network round trip, which had put every League command in a single queue behind one request.</p>
+ <p>Performance and responsiveness improvements across interactive panels, navigation and poller subscriptions. Settings are cached briefly instead of being read from disk on every event.</p>
</description>
</release>
<release version="0.8.2" date="2026-07-30">
<description>
- <p>Fixes the freeze that could lock the whole window while the League page was open. The client republishes its champion select session several times per second — the phase clock alone changes on every tick — and each of those updates was pushed to the interface, forcing every mounted panel to redraw until the app stopped responding to clicks, including the menu. The session is now only sent when something the interface reads actually changed, with a heartbeat so it never goes stale, and the in-game pollers drop a tick that arrives while the previous one is still running instead of queueing another round of requests. Match history gains what it was missing: runes and summoner spells for every player, all seven item slots, and the full stat line — damage dealt, taken and mitigated, healing, objective damage, gold and CS per minute, vision score, wards placed, killed and control, crowd control time, best killing spree, multikills, first blood and first tower. Clicking any name on the scoreboard opens that player's recent matches.</p>
+ <p>Performance fixes for high-frequency window events and state updates to ensure responsive click handling across the navigation menu and interface panels.</p>
</description>
</release>
<release version="0.8.1" date="2026-07-30">
<description>
- <p>League of Legends support is now built into OmniGet instead of being a plugin. Champ select gains an auto accept with a delay you choose, an auto pick that can declare only or lock at the last second, a ban guard that will not take a champion an ally already called, and an ARAM reroll that keeps the champion you already have. Lobbies are read before the game starts: premades are grouped by the party id the game itself reports, players you have noted before are flagged, five-stacks with hidden profiles are called out, and player ratings wait for a minimum number of games before judging. In game there are objective timers with an estimate of what each is worth, a build reference with ability order and items by phase, a match-found notification for when the window is not focused, and a way to restart the client interface without losing the queue. On the download side: rules send links from a given channel straight to a folder in a chosen quality, evaluated at enqueue and never overriding a choice made in the session; yt-dlp, FFmpeg and PDFium can point at a binary anywhere and it is referenced in place rather than copied, so updating your own copy takes effect immediately; Threads posts, images and carousels download through a native extractor, since yt-dlp has none; the same file in two places stops occupying space twice; a re-edited or re-uploaded video is reported before it overwrites the old one; and the download queue is now an append-only log flushed per record, so a crash can damage at most the last entry instead of the whole queue. Fixes: the keyboard shortcut now shows Ctrl on Windows and Linux instead of the macOS key, which does not exist there; the title bar no longer reserves macOS window-control space on other platforms nor places its own buttons where Windows and Linux draw close; the command-line binary build was repaired and ships again. Portable mode remains uncovered on macOS, where the WebView cannot be redirected, and the app now says so.</p>
+ <p>On the download side: rules send links from a given channel straight to a folder in a chosen quality, evaluated at enqueue and never overriding a choice made in the session; yt-dlp, FFmpeg and PDFium can point at a binary anywhere and it is referenced in place rather than copied, so updating your own copy takes effect immediately; Threads posts, images and carousels download through a native extractor, since yt-dlp has none; the same file in two places stops occupying space twice; a re-edited or re-uploaded video is reported before it overwrites the old one; and the download queue is now an append-only log flushed per record, so a crash can damage at most the last entry instead of the whole queue. Fixes: the keyboard shortcut now shows Ctrl on Windows and Linux instead of the macOS key, which does not exist there; the title bar no longer reserves macOS window-control space on other platforms nor places its own buttons where Windows and Linux draw close; the command-line binary build was repaired and ships again. Portable mode remains uncovered on macOS, where the WebView cannot be redirected, and the app now says so.</p>
</description>
</release>
<release version="0.8.0" date="2026-07-29">
@@ -124,22 +124,22 @@
</release>
<release version="0.7.6" date="2026-07-28">
<description>
- <p>League of Legends menu gains trade auto-response, champion select greeting, deep analysis tags, a match scoreboard, summoner spell timers and encounter tracking. Live client updates now arrive over a websocket with response caching, and spectate and dodge actions were added.</p>
+ <p>Performance and reliability enhancements for background connections and event handling.</p>
</description>
</release>
<release version="0.7.5" date="2026-07-28">
<description>
- <p>Fixes reachable League profiles being mislabelled as private, and enables the opt-in League menu by default in settings.</p>
+ <p>User interface improvements and settings state persistence fixes.</p>
</description>
</release>
<release version="0.7.4" date="2026-07-28">
<description>
- <p>League of Legends menu gains item builds derived from local match history, a Meta tab with client-recommended runes and champion tiers, player search, best duos, jungle pathing and chat summary, plus a statistical match model with live economy and configurable role goals.</p>
+ <p>Statistical model and history aggregation improvements.</p>
</description>
</release>
<release version="0.7.3" date="2026-07-28">
<description>
- <p>New opt-in League of Legends menu, off by default, with lobby and champion select tools, ARAM bench, live game panel and match scouting. Fixes the schedule date and time fields, scrolling in the downloads list, the scope of clear-finished, native direct media downloads and the portable WebView2 directory. The configured proxy is honoured when the host is empty, proxy settings save reliably, and DRM merge errors are reported properly.</p>
+ <p>Fixes the schedule date and time fields, scrolling in the downloads list, the scope of clear-finished, native direct media downloads and the portable WebView2 directory. The configured proxy is honoured when the host is empty, proxy settings save reliably, and DRM merge errors are reported properly.</p>
</description>
</release>
<release version="0.7.2" date="2026-07-10">
diff --git a/llms.txt b/llms.txt
index d71a09f9..1fa0ded3 100644
--- a/llms.txt
+++ b/llms.txt
@@ -6,7 +6,7 @@ OmniGet downloads paid online courses the user already owns (Hotmart, Udemy, Kiw
Beyond downloading, the Tools section holds 158 single-purpose tools in 25 categories: YouTube (metadata, thumbnails, subtitles, comments, live chat, subtitle workshop, SponsorBlock, dislikes), Speech and subtitles (offline transcription with whisper.cpp, text to speech, subtitle translation, dubbing), Video editing (cut, convert, compress to a size, video to GIF, cut silence, subtitle convert and resync, restore, stabilize, sticker maker, screen recording), Audio (loudness normalization, noise removal), Instagram (24 tools: stories, highlights, unfollowers, ghost followers, analytics, giveaway picker, publish), X/Twitter (thread unroll, post to image, profile analytics, bookmarks export, archive reader, Grok), Facebook (album and video download), Reddit (post download, thread archive, data export reader), Pinterest (original-quality downloads, board and profile backup, AI-free search, duplicates, palettes), Twitch (emote packs, VOD chat export), Bilibili (danmaku export and burn-in), Spotify (Spicetify), Music (playlist to M3U, synced lyrics, Spotify history), LinkedIn (data export overview, connections, messages, profile score), Games (Switch album import, clip organizer, ProtonDB lookup), PDF (merge, split, compress, convert, OCR, repair, password, watermark and Bates numbering, crop margins, table of contents, redaction check, safe PDF, PDF to Markdown), Documents (SlideShare, Google Docs, Calameo, galleries), Images (upscale, resize, compress to a size, EXIF and GPS strip, duplicate photos, screenshot stitch, icon pack, spritesheet, OCR), System (cleanup, disk analyzer, hosts ad blocking, Windows privacy and hardening), Files (duplicates, bulk rename, secure delete, instant search, keep awake), Downloads (aria2, HLS/DASH manifests), Automation (auto clicker), Phone (KDE Connect), AI (price comparison, spending ledger, Ollama, humanize text, API key vault, MCP server with 37 tools) and CTF and analysis (hashes, file identification, classic ciphers, XOR, encodings, frequency analysis). A Claude Code plugin in claude-plugin/ fetches and transcribes media without the desktop app.
-Plugins: Courses, Study (course player with timestamped notes, PDF/EPUB/CBZ reader, Markdown notes with a knowledge graph, Anki-compatible flashcards, focus timer, progress, local music library with synced lyrics), Telegram and Convert (FFmpeg with GPU acceleration). Also included: a League of Legends companion that reads the local game client (scouting, live stats, runes, profile editor, skin roulette, AI coach), on by default and switchable off.
+Plugins: Courses, Study (course player with timestamped notes, PDF/EPUB/CBZ reader, Markdown notes with a knowledge graph, Anki-compatible flashcards, focus timer, progress, local music library with synced lyrics), Telegram and Convert (FFmpeg with GPU acceleration).
## Key facts
diff --git a/scripts/lint-ui.mjs b/scripts/lint-ui.mjs
index edcdd6cf..24f04921 100644
--- a/scripts/lint-ui.mjs
+++ b/scripts/lint-ui.mjs
@@ -64,7 +64,6 @@ export const SHELL_ROUTES = [
"/marketplace",
"/about",
"/nami",
- "/league",
"/tools",
];
@@ -299,7 +298,6 @@ export function buildTauriMockInitScript(theme = "dark") {
},
telegram: { concurrent_downloads: 2, fix_file_extensions: true },
rpc: { enabled: false, app_id: "", large_image_key: "" },
- league: { enabled: true, auto_accept: false },
onboarding_completed: true,
start_with_system: false,
start_minimized: false,
diff --git a/scripts/ui-lint-baseline.json b/scripts/ui-lint-baseline.json
index 2b04e1e5..6718d4c7 100644
--- a/scripts/ui-lint-baseline.json
+++ b/scripts/ui-lint-baseline.json
@@ -30,12 +30,6 @@
"label-consistency": 3,
"text-contrast": 2
},
- "/league": {
- "control-size": 2,
- "font-size": 6,
- "label-consistency": 3,
- "text-contrast": 2
- },
"/marketplace": {
"control-gap": 1,
"control-size": 20,
diff --git a/src-tauri/clippy-baseline.linux.json b/src-tauri/clippy-baseline.linux.json
index b1facda4..a9c44828 100644
--- a/src-tauri/clippy-baseline.linux.json
+++ b/src-tauri/clippy-baseline.linux.json
@@ -1,6 +1,6 @@
{
"generated_on": "linux",
- "total": 132,
+ "total": 125,
"counts": {
"grammers_session|clippy::collapsible_if": 1,
"grammers_session|clippy::manual_range_contains": 4,
@@ -29,7 +29,6 @@
"omniget_core|clippy::unwrap_or_default": 1,
"omniget_core|clippy::useless_conversion": 1,
"omniget_core|clippy::vec_init_then_push": 1,
- "omniget_lib|clippy::collapsible_match": 1,
"omniget_lib|clippy::doc_overindented_list_items": 4,
"omniget_lib|clippy::double_ended_iterator_last": 2,
"omniget_lib|clippy::identity_op": 1,
@@ -37,18 +36,15 @@
"omniget_lib|clippy::io_other_error": 1,
"omniget_lib|clippy::let_underscore_future": 1,
"omniget_lib|clippy::manual_div_ceil": 7,
- "omniget_lib|clippy::manual_filter": 1,
"omniget_lib|clippy::manual_range_contains": 1,
"omniget_lib|clippy::manual_range_patterns": 1,
- "omniget_lib|clippy::needless_borrow": 1,
"omniget_lib|clippy::needless_borrows_for_generic_args": 1,
"omniget_lib|clippy::ptr_arg": 1,
"omniget_lib|clippy::redundant_closure": 2,
"omniget_lib|clippy::redundant_closure_call": 2,
"omniget_lib|clippy::should_implement_trait": 1,
"omniget_lib|clippy::too_many_arguments": 3,
- "omniget_lib|clippy::type_complexity": 2,
- "omniget_lib|clippy::unnecessary_sort_by": 4,
+ "omniget_lib|clippy::unnecessary_sort_by": 2,
"omniget_lib|clippy::unnecessary_to_owned": 1,
"omniget_lib|clippy::useless_conversion": 1,
"omniget_lib|clippy::useless_vec": 3,
diff --git a/src-tauri/omniget-core/src/models/settings.rs b/src-tauri/omniget-core/src/models/settings.rs
index b73e7ad5..76d35291 100644
--- a/src-tauri/omniget-core/src/models/settings.rs
+++ b/src-tauri/omniget-core/src/models/settings.rs
@@ -30,8 +30,6 @@ pub struct AppSettings {
#[serde(default)]
pub bridge: BridgeSettings,
#[serde(default)]
- pub league: LeagueSettings,
- #[serde(default)]
pub accessibility: AccessibilitySettings,
}
@@ -45,113 +43,6 @@ pub struct AccessibilitySettings {
pub disable_haptics: bool,
}
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct LeagueSettings {
- #[serde(default = "default_league_enabled")]
- pub enabled: bool,
- #[serde(default)]
- pub auto_accept: bool,
- #[serde(default)]
- pub auto_accept_delay: u8,
- #[serde(default = "default_notify_ready_check")]
- pub notify_ready_check: bool,
- #[serde(default)]
- pub auto_pick: bool,
- #[serde(default)]
- pub auto_ban: bool,
- #[serde(default)]
- pub auto_ban_delay: u8,
- #[serde(default)]
- pub auto_lock: bool,
- #[serde(default)]
- pub auto_lock_at_timeout: bool,
- #[serde(default)]
- pub auto_runes: bool,
- #[serde(default)]
- pub auto_honor: bool,
- #[serde(default)]
- pub auto_play_again: bool,
- #[serde(default)]
- pub auto_requeue: bool,
- #[serde(default)]
- pub auto_accept_swaps: bool,
- #[serde(default)]
- pub auto_reconnect: bool,
- #[serde(default)]
- pub auto_trade: String,
- #[serde(default)]
- pub auto_message: String,
- #[serde(default)]
- pub pick_champions: Vec<i64>,
- #[serde(default)]
- pub ban_champions: Vec<i64>,
- /// Auto-pick ignores the list and locks a random legal champion instead.
- #[serde(default)]
- pub pick_random: bool,
- /// Rolls a random owned skin (and chroma) the moment a champion is locked.
- #[serde(default)]
- pub skin_roulette: bool,
- #[serde(default)]
- pub skin_roulette_include_base: bool,
- /// Rolls a random owned ward skin on lock-in.
- #[serde(default)]
- pub ward_roulette: bool,
- /// Falls back to the client's backend (SGP) when the local history is thin.
- #[serde(default = "default_sgp_enabled")]
- pub sgp_enabled: bool,
- /// Tone of the AI coach: "objective", "roast" or "praise".
- #[serde(default = "default_coach_style")]
- pub coach_style: String,
-}
-
-fn default_sgp_enabled() -> bool {
- true
-}
-
-fn default_coach_style() -> String {
- "objective".to_string()
-}
-
-fn default_league_enabled() -> bool {
- true
-}
-
-fn default_notify_ready_check() -> bool {
- true
-}
-
-impl Default for LeagueSettings {
- fn default() -> Self {
- Self {
- enabled: default_league_enabled(),
- auto_accept: false,
- auto_accept_delay: 0,
- notify_ready_check: default_notify_ready_check(),
- auto_pick: false,
- auto_ban: false,
- auto_ban_delay: 0,
- auto_lock: false,
- auto_lock_at_timeout: false,
- auto_runes: false,
- auto_honor: false,
- auto_play_again: false,
- auto_requeue: false,
- auto_accept_swaps: false,
- auto_reconnect: false,
- auto_trade: String::new(),
- auto_message: String::new(),
- pick_champions: Vec::new(),
- ban_champions: Vec::new(),
- pick_random: false,
- skin_roulette: false,
- skin_roulette_include_base: false,
- ward_roulette: false,
- sgp_enabled: default_sgp_enabled(),
- coach_style: default_coach_style(),
- }
- }
-}
-
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RpcSettings {
#[serde(default = "default_rpc_enabled")]
@@ -670,7 +561,6 @@ impl Default for AppSettings {
typography: TypographySettings::default(),
rpc: RpcSettings::default(),
bridge: BridgeSettings::default(),
- league: LeagueSettings::default(),
accessibility: AccessibilitySettings::default(),
}
}
diff --git a/src-tauri/src/commands/league/analysis.rs b/src-tauri/src/commands/league/analysis.rs
deleted file mode 100644
index 16d666cb..00000000
--- a/src-tauri/src/commands/league/analysis.rs
+++ /dev/null
@@ -1,365 +0,0 @@
-//! Aggregations over match history: champion records, duo synergy and the
-//! early-game map reading used for jungle pathing.
-
-use super::stats;
-
-/// Summoner's Rift is roughly a 15000x15000 square with mid on the diagonal.
-pub const MAP_MAX: f64 = 15_000.0;
-
-/// Minutes of a game considered "early" for pathing purposes.
-pub const EARLY_MINUTES: usize = 14;
-
-/// A kill counts for more than a position sample when reading intent.
-pub const KILL_WEIGHT: f64 = 5.0;
-
-/// Lanes of the map, plus the ambiguous middle ground.
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum Zone {
- Top,
- Mid,
- Bot,
-}
-
-/// Classifies a map coordinate into a lane.
-///
-/// The top-left and bottom-right corners are unambiguous; everything else is
-/// decided by distance from the mid diagonal (`y == x`).
-pub fn classify_zone(x: f64, y: f64) -> Zone {
- if x < 5_000.0 && y > 9_000.0 {
- return Zone::Top;
- }
- if x > 9_000.0 && y < 5_000.0 {
- return Zone::Bot;
- }
- if (y - x).abs() <= 3_500.0 {
- return Zone::Mid;
- }
- if y > x {
- Zone::Top
- } else {
- Zone::Bot
- }
-}
-
-/// Share of early-game presence per lane, from position samples and kills.
-#[derive(Debug, Clone, Copy, Default, PartialEq)]
-pub struct ZoneWeights {
- pub top: f64,
- pub mid: f64,
- pub bot: f64,
-}
-
-impl ZoneWeights {
- pub fn add(&mut self, zone: Zone, weight: f64) {
- match zone {
- Zone::Top => self.top += weight,
- Zone::Mid => self.mid += weight,
- Zone::Bot => self.bot += weight,
- }
- }
-
- pub fn total(&self) -> f64 {
- self.top + self.mid + self.bot
- }
-
- /// Normalises to shares that sum to 1 (all zeros when there is no data).
- pub fn shares(&self) -> ZoneWeights {
- let t = self.total();
- if t <= 0.0 {
- return ZoneWeights::default();
- }
- ZoneWeights {
- top: self.top / t,
- mid: self.mid / t,
- bot: self.bot / t,
- }
- }
-
- /// Short verdict about where this jungler spends the early game.
- pub fn preference(&self) -> &'static str {
- let s = self.shares();
- if s.total() <= 0.0 {
- return "unknown";
- }
- let max = s.top.max(s.mid).max(s.bot);
- if s.mid + s.bot >= 0.70 && s.top <= 0.28 {
- return "mid_bot";
- }
- if s.top + s.mid >= 0.70 && s.bot <= 0.28 {
- return "top_mid";
- }
- let second = {
- let mut v = [s.top, s.mid, s.bot];
- v.sort_by(|a, b| b.partial_cmp(a).unwrap_or(std::cmp::Ordering::Equal));
- v[1]
- };
- if max >= 0.40 && max - second >= 0.08 {
- if (max - s.top).abs() < f64::EPSILON {
- "top"
- } else if (max - s.mid).abs() < f64::EPSILON {
- "mid"
- } else {
- "bot"
- }
- } else {
- "balanced"
- }
- }
-}
-
-/// The eight buff camps, as (x, y, blue_side).
-pub const CAMPS: [(&str, f64, f64, bool); 8] = [
- ("blue_buff", 3_830.0, 7_880.0, true),
- ("wolves", 3_800.0, 6_440.0, true),
- ("red_buff", 7_760.0, 4_010.0, true),
- ("raptors", 6_970.0, 5_460.0, true),
- ("blue_buff", 10_990.0, 7_000.0, false),
- ("wolves", 11_020.0, 8_440.0, false),
- ("red_buff", 7_060.0, 10_870.0, false),
- ("raptors", 7_850.0, 9_420.0, false),
-];
-
-/// Nearest starting camp to a position, and whether it sits on the blue side.
-pub fn nearest_camp(x: f64, y: f64) -> (&'static str, bool) {
- let mut best = (CAMPS[0].0, CAMPS[0].3);
- let mut best_d = f64::MAX;
- for (name, cx, cy, blue) in CAMPS.iter() {
- let d = (x - cx).powi(2) + (y - cy).powi(2);
- if d < best_d {
- best_d = d;
- best = (name, *blue);
- }
- }
- best
-}
-
-/// True when the first camp visited belongs to the opposing side of the map.
-pub fn is_invade(first_camp_blue_side: bool, player_on_blue_side: bool) -> bool {
- first_camp_blue_side != player_on_blue_side
-}
-
-/// A gank is likely when the clear was cut short: enough camps for level 3 but
-/// well below a full clear, with champion damage already dealt.
-pub fn looks_like_level3_gank(cs_at_frame3: u32, level: u32, had_champion_action: bool) -> bool {
- (12..20).contains(&cs_at_frame3) && level == 3 && had_champion_action
-}
-
-/// One champion's record inside a player's history.
-#[derive(Debug, Clone, Default)]
-pub struct ChampionRecord {
- pub champion_id: i64,
- pub games: u32,
- pub wins: u32,
- pub kills: u32,
- pub deaths: u32,
- pub assists: u32,
- pub cs: f64,
- pub seconds: f64,
-}
-
-impl ChampionRecord {
- pub fn winrate(&self) -> f64 {
- if self.games == 0 {
- 0.0
- } else {
- self.wins as f64 / self.games as f64
- }
- }
-
- pub fn kda(&self) -> f64 {
- stats::kda(self.kills, self.deaths, self.assists)
- }
-
- pub fn cs_per_min(&self) -> f64 {
- stats::per_minute(self.cs, self.seconds)
- }
-}
-
-/// Sorts champion records the way a profile page does: most played first, then
-/// win rate. Records under `min_games` are dropped (op.gg shows 2+ games).
-pub fn rank_champion_records(
- mut records: Vec<ChampionRecord>,
- min_games: u32,
-) -> Vec<ChampionRecord> {
- records.retain(|r| r.games >= min_games);
- records.sort_by(|a, b| {
- b.games.cmp(&a.games).then(
- b.winrate()
- .partial_cmp(&a.winrate())
- .unwrap_or(std::cmp::Ordering::Equal),
- )
- });
- records
-}
-
-/// A teammate the player keeps queueing with.
-#[derive(Debug, Clone)]
-pub struct DuoRecord {
- pub puuid: String,
- pub games: u32,
- pub wins: u32,
-}
-
-impl DuoRecord {
- pub fn winrate(&self) -> f64 {
- if self.games == 0 {
- 0.0
- } else {
- self.wins as f64 / self.games as f64
- }
- }
-
- /// Shrunk win rate, so a 2-game 100% duo cannot outrank a 40-game 60% one.
- pub fn score(&self) -> f64 {
- stats::shrunk_winrate(self.wins, self.games - self.wins, stats::PRIOR_GAMES)
- }
-}
-
-/// Orders duos by shrunk win rate, keeping only those with enough games.
-pub fn rank_duos(mut duos: Vec<DuoRecord>, min_games: u32) -> Vec<DuoRecord> {
- duos.retain(|d| d.games >= min_games);
- duos.sort_by(|a, b| {
- b.score()
- .partial_cmp(&a.score())
- .unwrap_or(std::cmp::Ordering::Equal)
- .then(b.games.cmp(&a.games))
- });
- duos
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn zones_match_the_map_corners() {
- // Top lane sits in the upper-left, bot lane in the lower-right.
- assert_eq!(classify_zone(1_500.0, 12_000.0), Zone::Top);
- assert_eq!(classify_zone(12_500.0, 2_000.0), Zone::Bot);
- // Mid follows the diagonal.
- assert_eq!(classify_zone(7_500.0, 7_500.0), Zone::Mid);
- assert_eq!(classify_zone(6_000.0, 8_000.0), Zone::Mid);
- // Off-diagonal but not in a corner: decided by which side of mid.
- assert_eq!(classify_zone(2_000.0, 7_000.0), Zone::Top);
- assert_eq!(classify_zone(9_000.0, 3_000.0), Zone::Bot);
- }
-
- #[test]
- fn zone_weights_normalise_and_read_preference() {
- let mut w = ZoneWeights::default();
- for _ in 0..8 {
- w.add(Zone::Bot, 1.0);
- }
- for _ in 0..6 {
- w.add(Zone::Mid, 1.0);
- }
- w.add(Zone::Top, 1.0);
- let s = w.shares();
- assert!((s.top + s.mid + s.bot - 1.0).abs() < 1e-9);
- assert_eq!(w.preference(), "mid_bot");
-
- // No samples must not divide by zero.
- assert_eq!(ZoneWeights::default().preference(), "unknown");
- assert_eq!(ZoneWeights::default().shares().total(), 0.0);
- }
-
- #[test]
- fn balanced_pathing_is_reported_as_balanced() {
- let mut w = ZoneWeights::default();
- w.add(Zone::Top, 10.0);
- w.add(Zone::Mid, 10.0);
- w.add(Zone::Bot, 10.0);
- assert_eq!(w.preference(), "balanced");
- }
-
- #[test]
- fn kills_weigh_more_than_standing_around() {
- let mut w = ZoneWeights::default();
- w.add(Zone::Top, 1.0);
- w.add(Zone::Bot, KILL_WEIGHT);
- let s = w.shares();
- assert!(s.bot > s.top * 4.0);
- }
-
- #[test]
- fn first_camp_detects_side_and_invade() {
- // Standing on the blue-side blue buff at minute one.
- let (camp, blue) = nearest_camp(3_900.0, 7_900.0);
- assert_eq!(camp, "blue_buff");
- assert!(blue);
- // A blue-side jungler starting there is not invading.
- assert!(!is_invade(blue, true));
- // The same player showing up in the red-side jungle is.
- let (_, enemy_side) = nearest_camp(11_000.0, 7_100.0);
- assert!(!enemy_side);
- assert!(is_invade(enemy_side, true));
- }
-
- #[test]
- fn level3_gank_heuristic_needs_all_three_signals() {
- // Clear cut short at 15 CS, level 3, already fought: a gank.
- assert!(looks_like_level3_gank(15, 3, true));
- // A full clear reaches ~20 CS and means no detour.
- assert!(!looks_like_level3_gank(24, 3, true));
- // Damage matters: farming quietly is not a gank.
- assert!(!looks_like_level3_gank(15, 3, false));
- // Wrong level is not a level-3 gank.
- assert!(!looks_like_level3_gank(15, 4, true));
- }
-
- #[test]
- fn champion_records_rank_like_a_profile_page() {
- let make = |id, games, wins| ChampionRecord {
- champion_id: id,
- games,
- wins,
- seconds: 1_800.0 * games as f64,
- cs: 200.0 * games as f64,
- ..Default::default()
- };
- let ranked = rank_champion_records(vec![make(1, 3, 1), make(2, 9, 5), make(3, 1, 1)], 2);
- // The single-game champion is dropped, the most played leads.
- assert_eq!(ranked.len(), 2);
- assert_eq!(ranked[0].champion_id, 2);
- assert_eq!(ranked[1].champion_id, 1);
- assert!((ranked[0].winrate() - 5.0 / 9.0).abs() < 1e-9);
- assert!((ranked[0].cs_per_min() - 200.0 / 30.0).abs() < 1e-9);
- }
-
- #[test]
- fn duos_are_ranked_by_shrunk_winrate() {
- let lucky = DuoRecord {
- puuid: "lucky".into(),
- games: 2,
- wins: 2,
- };
- let proven = DuoRecord {
- puuid: "proven".into(),
- games: 40,
- wins: 24,
- };
- let ranked = rank_duos(vec![lucky, proven], 2);
- assert_eq!(
- ranked[0].puuid, "proven",
- "a 40-game 60% duo must beat a 2-game 100% duo"
- );
- assert!((ranked[0].winrate() - 0.6).abs() < 1e-9);
- }
-
- #[test]
- fn duos_below_the_minimum_are_dropped() {
- let one_off = DuoRecord {
- puuid: "stranger".into(),
- games: 1,
- wins: 1,
- };
- assert!(rank_duos(vec![one_off], 2).is_empty());
- // A perfect record still scores below 100% after shrinkage.
- let d = DuoRecord {
- puuid: "x".into(),
- games: 10,
- wins: 10,
- };
- assert!(d.score() < 0.7 && d.score() > 0.5, "score={}", d.score());
- }
-}
diff --git a/src-tauri/src/commands/league/champ_select.rs b/src-tauri/src/commands/league/champ_select.rs
deleted file mode 100644
index 961be1aa..00000000
--- a/src-tauri/src/commands/league/champ_select.rs
+++ /dev/null
@@ -1,299 +0,0 @@
-use rand::RngExt;
-use serde_json::Value;
-use std::collections::HashSet;
-
-/// Bans wait longer than picks by default in most rulesets, and a ban sent on the
-/// first millisecond of the turn is the most visible tell of an automation.
-pub const MAX_BAN_DELAY: u8 = 25;
-
-pub fn ban_delay_seconds(setting: u8) -> u8 {
- setting.min(MAX_BAN_DELAY)
-}
-
-pub fn delay_elapsed(elapsed_secs: f64, delay: u8) -> bool {
- elapsed_secs >= delay as f64
-}
-
-/// Champions an ally is showing intent on. Banning one of these takes away a
-/// teammate's pick, which is the single most disruptive thing an auto-ban can do.
-pub fn ally_pick_intents(session: &Value, local_cell: i64) -> HashSet<i64> {
- let mut intents = HashSet::new();
- if let Some(team) = session.get("myTeam").and_then(Value::as_array) {
- for member in team {
- let cell = member.get("cellId").and_then(Value::as_i64).unwrap_or(-1);
- if cell == local_cell {
- continue;
- }
- for key in ["championPickIntent", "championId"] {
- if let Some(id) = member.get(key).and_then(Value::as_i64) {
- if id > 0 {
- intents.insert(id);
- }
- }
- }
- }
- }
- intents
-}
-
-/// First entry of the user's list that is legal to act on and not spoken for.
-pub fn choose_champion(
- list: &[i64],
- pool: &HashSet<i64>,
- taken: &HashSet<i64>,
- avoid: &HashSet<i64>,
-) -> Option<i64> {
- list.iter()
- .find(|c| pool.contains(c) && !taken.contains(c) && !avoid.contains(c))
- .copied()
-}
-
-/// How the automation finishes a pick.
-#[derive(Debug, Clone, Copy, PartialEq)]
-pub enum PickConfirm {
- /// Locks the champion as soon as the turn opens.
- Immediate,
- /// Shows the intent to the team and leaves the lock to the user.
- Declare,
- /// Shows the intent immediately and locks only when the turn is about to
- /// expire, which leaves room for the team to ask for something else.
- AtTimeout,
-}
-
-/// Locking exactly at zero risks losing the pick to a slow round trip.
-pub const TIMEOUT_LOCK_MARGIN_MS: i64 = 2_500;
-
-pub fn pick_confirm(auto_lock: bool, lock_at_timeout: bool) -> PickConfirm {
- if lock_at_timeout {
- PickConfirm::AtTimeout
- } else if auto_lock {
- PickConfirm::Immediate
- } else {
- PickConfirm::Declare
- }
-}
-
-/// Milliseconds left in the current champion select phase, when the client
-/// reports it.
-pub fn time_left_ms(session: &Value) -> Option<i64> {
- session
- .get("timer")
- .and_then(|t| t.get("adjustedTimeLeftInPhase"))
- .and_then(Value::as_i64)
-}
-
-pub fn should_lock_now(mode: PickConfirm, time_left: Option<i64>) -> bool {
- match mode {
- PickConfirm::Immediate => true,
- PickConfirm::Declare => false,
- // Without a timer there is no safe moment to wait for, so the pick is
- // locked rather than risking losing it entirely.
- PickConfirm::AtTimeout => time_left.is_none_or(|left| left <= TIMEOUT_LOCK_MARGIN_MS),
- }
-}
-
-/// A random legal champion, for the player who wants the queue itself to
-/// decide what they play. Deterministic given the rng, so it can be tested.
-pub fn choose_random_champion<R: rand::Rng>(
- pool: &HashSet<i64>,
- taken: &HashSet<i64>,
- avoid: &HashSet<i64>,
- rng: &mut R,
-) -> Option<i64> {
- let mut candidates: Vec<i64> = pool
- .iter()
- .copied()
- .filter(|c| !taken.contains(c) && !avoid.contains(c))
- .collect();
- if candidates.is_empty() {
- return None;
- }
- // Sorted first so the choice depends only on the rng, not on hash order.
- candidates.sort_unstable();
- let index = rng.random_range(0..candidates.len());
- Some(candidates[index])
-}
-
-/// The local player's pick action that is open right now, if any.
-pub fn local_pick_action(session: &Value, cell: i64) -> Option<(i64, bool)> {
- let groups = session.get("actions")?.as_array()?;
- for group in groups {
- for action in group.as_array().map(|a| a.as_slice()).unwrap_or(&[]) {
- let actor = action
- .get("actorCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-2);
- let kind = action.get("type").and_then(Value::as_str).unwrap_or("");
- if actor != cell || kind != "pick" {
- continue;
- }
- let id = action.get("id").and_then(Value::as_i64)?;
- let completed = action
- .get("completed")
- .and_then(Value::as_bool)
- .unwrap_or(false);
- return Some((id, completed));
- }
- }
- None
-}
-
-/// Champion the local player has locked, or 0 while nothing is locked yet.
-pub fn locked_champion(session: &Value) -> i64 {
- let cell = session
- .get("localPlayerCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-1);
- if cell < 0 {
- return 0;
- }
- let locked = matches!(local_pick_action(session, cell), Some((_, true)));
- if !locked {
- return 0;
- }
- session
- .get("myTeam")
- .and_then(Value::as_array)
- .and_then(|team| {
- team.iter()
- .find(|m| m.get("cellId").and_then(Value::as_i64) == Some(cell))
- })
- .and_then(|me| me.get("championId").and_then(Value::as_i64))
- .filter(|id| *id > 0)
- .unwrap_or(0)
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use serde_json::json;
-
- fn set(ids: &[i64]) -> HashSet<i64> {
- ids.iter().copied().collect()
- }
-
- #[test]
- fn the_first_legal_and_unclaimed_entry_wins() {
- let list = [1i64, 2, 3, 4];
- let pool = set(&[2, 3, 4]);
- let taken = set(&[2]);
- let avoid = set(&[3]);
- assert_eq!(choose_champion(&list, &pool, &taken, &avoid), Some(4));
- }
-
- #[test]
- fn nothing_is_chosen_when_every_entry_is_spoken_for() {
- let list = [1i64, 2];
- assert_eq!(
- choose_champion(&list, &set(&[1, 2]), &set(&[1]), &set(&[2])),
- None
- );
- assert_eq!(choose_champion(&[], &set(&[1]), &set(&[]), &set(&[])), None);
- // Outside the legal pool, however free it looks.
- assert_eq!(
- choose_champion(&[9], &set(&[1, 2]), &set(&[]), &set(&[])),
- None
- );
- }
-
- #[test]
- fn ally_intents_exclude_the_local_player() {
- let session = json!({
- "myTeam": [
- { "cellId": 0, "championId": 0, "championPickIntent": 111 },
- { "cellId": 1, "championId": 0, "championPickIntent": 222 },
- { "cellId": 2, "championId": 333, "championPickIntent": 0 }
- ]
- });
- let intents = ally_pick_intents(&session, 0);
- assert_eq!(intents, set(&[222, 333]));
- assert!(!intents.contains(&111), "own intent must not block own ban");
- }
-
- #[test]
- fn a_session_without_a_team_yields_no_intents() {
- assert!(ally_pick_intents(&json!({}), 0).is_empty());
- assert!(ally_pick_intents(&json!({ "myTeam": [] }), 0).is_empty());
- assert!(ally_pick_intents(&json!({ "myTeam": [{}] }), 0).is_empty());
- }
-
- #[test]
- fn the_ban_delay_is_capped_and_measured_in_seconds() {
- assert_eq!(ban_delay_seconds(200), MAX_BAN_DELAY);
- assert_eq!(ban_delay_seconds(7), 7);
- assert!(delay_elapsed(7.0, 7));
- assert!(delay_elapsed(9.5, 7));
- assert!(!delay_elapsed(6.9, 7));
- // No delay configured means act on sight.
- assert!(delay_elapsed(0.0, 0));
- }
-
- #[test]
- fn the_three_confirm_modes_map_from_the_two_toggles() {
- assert_eq!(pick_confirm(false, false), PickConfirm::Declare);
- assert_eq!(pick_confirm(true, false), PickConfirm::Immediate);
- // Waiting for the timer wins over locking immediately.
- assert_eq!(pick_confirm(true, true), PickConfirm::AtTimeout);
- assert_eq!(pick_confirm(false, true), PickConfirm::AtTimeout);
- }
-
- #[test]
- fn immediate_locks_at_once_and_declare_never_locks() {
- assert!(should_lock_now(PickConfirm::Immediate, Some(30_000)));
- assert!(!should_lock_now(PickConfirm::Declare, Some(100)));
- assert!(!should_lock_now(PickConfirm::Declare, None));
- }
-
- #[test]
- fn waiting_for_the_timer_locks_only_near_the_end() {
- assert!(!should_lock_now(PickConfirm::AtTimeout, Some(20_000)));
- assert!(should_lock_now(
- PickConfirm::AtTimeout,
- Some(TIMEOUT_LOCK_MARGIN_MS)
- ));
- assert!(should_lock_now(PickConfirm::AtTimeout, Some(0)));
- // A missing timer must not mean "never lock", or the pick is lost.
- assert!(should_lock_now(PickConfirm::AtTimeout, None));
- }
-
- #[test]
- fn the_phase_timer_is_read_when_present() {
- let session = json!({ "timer": { "adjustedTimeLeftInPhase": 17_500 } });
- assert_eq!(time_left_ms(&session), Some(17_500));
- assert_eq!(time_left_ms(&json!({})), None);
- assert_eq!(time_left_ms(&json!({ "timer": {} })), None);
- }
-
- #[test]
- fn a_random_pick_stays_inside_the_legal_pool() {
- use rand::SeedableRng;
- let pool = set(&[1, 2, 3, 4, 5]);
- let taken = set(&[2]);
- let avoid = set(&[5]);
- let mut rng = rand::rngs::StdRng::seed_from_u64(7);
- for _ in 0..50 {
- let choice = choose_random_champion(&pool, &taken, &avoid, &mut rng).unwrap();
- assert!(pool.contains(&choice));
- assert!(!taken.contains(&choice));
- assert!(!avoid.contains(&choice));
- }
- assert_eq!(
- choose_random_champion(&set(&[1]), &set(&[1]), &set(&[]), &mut rng),
- None
- );
- }
-
- #[test]
- fn the_locked_champion_is_only_reported_once_the_pick_completes() {
- let mut session = json!({
- "localPlayerCellId": 1,
- "myTeam": [{ "cellId": 1, "championId": 99 }],
- "actions": [[{ "id": 5, "actorCellId": 1, "type": "pick", "completed": false }]]
- });
- assert_eq!(locked_champion(&session), 0);
- assert_eq!(local_pick_action(&session, 1), Some((5, false)));
- session["actions"][0][0]["completed"] = json!(true);
- assert_eq!(locked_champion(&session), 99);
- assert_eq!(locked_champion(&json!({})), 0);
- }
-}
diff --git a/src-tauri/src/commands/league/coach.rs b/src-tauri/src/commands/league/coach.rs
deleted file mode 100644
index 7b0ae3ae..00000000
--- a/src-tauri/src/commands/league/coach.rs
+++ /dev/null
@@ -1,768 +0,0 @@
-//! AI coach: the app's configured model reads the player's own data (match
-//! detail, recent games, the live champ select) plus OP.GG's public MCP and
-//! answers as a coach. Data is gathered here, in Rust, and handed to the model
-//! in one compact prompt; there is no tool-calling loop, so cost and latency
-//! stay predictable.
-
-use super::{ensure_enabled, get_client, lcu_get_raw, LcuClient};
-use once_cell::sync::Lazy;
-use serde_json::{json, Value};
-use tokio::sync::Mutex;
-
-// ---------------------------------------------------------------------------
-// OP.GG MCP (https://mcp-api.op.gg/mcp, MIT). Plain JSON-RPC over HTTP with a
-// session header; the tool result is JSON inside the first text content.
-// ---------------------------------------------------------------------------
-
-const OPGG_MCP: &str = "https://mcp-api.op.gg/mcp";
-static OPGG_SESSION: Lazy<Mutex<Option<String>>> = Lazy::new(|| Mutex::new(None));
-
-static HTTP: Lazy<Option<reqwest::Client>> = Lazy::new(|| {
- reqwest::Client::builder()
- .timeout(std::time::Duration::from_secs(25))
- .build()
- .ok()
-});
-
-async fn opgg_init(http: &reqwest::Client) -> Result<String, String> {
- let response = http
- .post(OPGG_MCP)
- .header("Accept", "application/json, text/event-stream")
- .json(&json!({
- "jsonrpc": "2.0",
- "id": 1,
- "method": "initialize",
- "params": {
- "protocolVersion": "2025-03-26",
- "capabilities": {},
- "clientInfo": { "name": "omniget", "version": env!("CARGO_PKG_VERSION") }
- }
- }))
- .send()
- .await
- .map_err(|e| format!("op.gg mcp unreachable: {}", e))?;
- let session = response
- .headers()
- .get("mcp-session-id")
- .and_then(|v| v.to_str().ok())
- .map(str::to_string)
- .ok_or_else(|| "op.gg mcp gave no session".to_string())?;
- Ok(session)
-}
-
-/// Pulls the tool result out of a JSON-RPC envelope.
-pub fn opgg_result(envelope: &Value) -> Result<Value, String> {
- if let Some(err) = envelope.get("error") {
- let message = err
- .get("message")
- .and_then(Value::as_str)
- .unwrap_or("unknown error");
- return Err(format!(
- "op.gg: {}",
- message.lines().next().unwrap_or(message)
- ));
- }
- let text = envelope
- .get("result")
- .and_then(|r| r.get("content"))
- .and_then(Value::as_array)
- .and_then(|c| c.first())
- .and_then(|c| c.get("text"))
- .and_then(Value::as_str)
- .ok_or_else(|| "op.gg: empty result".to_string())?;
- serde_json::from_str::<Value>(text).or_else(|_| Ok(json!(text)))
-}
-
-pub async fn opgg_call(tool: &str, args: Value) -> Result<Value, String> {
- let http = HTTP
- .clone()
- .ok_or_else(|| "http client init failed".to_string())?;
- for attempt in 0..2 {
- let session = {
- let cached = OPGG_SESSION.lock().await.clone();
- match cached {
- Some(s) => s,
- None => {
- let s = opgg_init(&http).await?;
- *OPGG_SESSION.lock().await = Some(s.clone());
- s
- }
- }
- };
- let response = http
- .post(OPGG_MCP)
- .header("Accept", "application/json, text/event-stream")
- .header("Mcp-Session-Id", &session)
- .json(&json!({
- "jsonrpc": "2.0",
- "id": 2,
- "method": "tools/call",
- "params": { "name": tool, "arguments": args }
- }))
- .send()
- .await
- .map_err(|e| format!("op.gg mcp request failed: {}", e))?;
- let status = response.status();
- if (status == reqwest::StatusCode::NOT_FOUND || status == reqwest::StatusCode::BAD_REQUEST)
- && attempt == 0
- {
- // The session expired; start a fresh one and try once more.
- *OPGG_SESSION.lock().await = None;
- continue;
- }
- if !status.is_success() {
- return Err(format!("op.gg mcp {}", status.as_u16()));
- }
- let envelope = response
- .json::<Value>()
- .await
- .map_err(|e| format!("op.gg decode failed: {}", e))?;
- return opgg_result(&envelope);
- }
- Err("op.gg mcp session could not be established".to_string())
-}
-
-/// OP.GG wants champion names in UPPER_SNAKE_CASE ("KAI_SA" for Kai'Sa).
-pub fn opgg_champion_name(name: &str) -> String {
- let mut out = String::new();
- let mut last_sep = true;
- for c in name.chars() {
- if c.is_ascii_alphanumeric() {
- out.push(c.to_ascii_uppercase());
- last_sep = false;
- } else if !last_sep {
- out.push('_');
- last_sep = true;
- }
- }
- out.trim_end_matches('_').to_string()
-}
-
-pub fn opgg_position(assigned: &str) -> &'static str {
- match assigned.to_ascii_uppercase().as_str() {
- "TOP" => "top",
- "JUNGLE" => "jungle",
- "MIDDLE" | "MID" => "mid",
- "BOTTOM" | "ADC" => "adc",
- "UTILITY" | "SUPPORT" => "support",
- _ => "all",
- }
-}
-
-async fn opgg_champion_brief(champion: &str, position: &str) -> Option<Value> {
- opgg_call(
- "lol_get_champion_analysis",
- json!({
- "game_mode": "ranked",
- "champion": champion,
- "position": position,
- "lang": "en_US",
- "desired_output_fields": [
- "data.summary.average_stats.{win_rate,pick_rate,ban_rate,tier,kda}",
- "data.core_items.{ids_names[],win}",
- "data.boots.{ids_names[],win}",
- "data.starter_items.ids_names[]",
- "data.summoner_spells.ids_names[]",
- "data.skill_masteries.ids[]",
- "data.runes.{primary_page_name,primary_rune_names[],secondary_page_name,secondary_rune_names[],stat_mod_names[]}",
- "data.weak_counters[].{champion_name,my_win_rate,play}",
- "data.strong_counters[].{champion_name,my_win_rate,play}",
- "data.damage_type"
- ]
- }),
- )
- .await
- .ok()
-}
-
-async fn opgg_matchup(mine: &str, theirs: &str, position: &str) -> Option<Value> {
- opgg_call(
- "lol_get_lane_matchup_guide",
- json!({
- "position": position,
- "my_champion": mine,
- "opponent_champion": theirs,
- "lang": "en_US"
- }),
- )
- .await
- .ok()
- .map(|v| {
- // The guide is large; keep only what a coach would quote.
- let data = v.get("data").cloned().unwrap_or(v);
- json!({
- "summary": data.get("summary").and_then(|s| s.get("average_stats")).cloned(),
- "core_items": data.get("core_items").cloned(),
- "runes": data.get("runes").cloned(),
- "matchup_tips": data.get("matchup_tips").or_else(|| data.get("tips")).cloned(),
- })
- })
-}
-
-// ---------------------------------------------------------------------------
-// Prompts
-// ---------------------------------------------------------------------------
-
-pub fn style_instruction(style: &str) -> &'static str {
- match style {
- "roast" => "Be brutally honest and funny, roast the mistakes without mercy, but every jab must carry a real, specific lesson.",
- "praise" => "Be warm and encouraging: lead with what went well, frame every problem as the next thing to improve.",
- _ => "Be objective and direct, like a professional analyst: facts, numbers, priorities.",
- }
-}
-
-fn system_prompt(style: &str, language: &str) -> String {
- format!(
- "You are a League of Legends coach reading a player's own match data.\n\
- {}\n\
- Answer in {}. Use short paragraphs and bullet points; no headings larger than a line.\n\
- Only use numbers that appear in the data; never invent stats, builds or patch facts.\n\
- When OP.GG data is included, treat it as the current meta reference and cite it as such.\n\
- Keep the whole answer under 350 words unless the user asks for depth.",
- style_instruction(style),
- language
- )
-}
-
-/// A participant trimmed to what a coach reads, from the match detail shape.
-pub fn compact_participant(p: &Value, minutes: f64) -> Value {
- let f = |k: &str| p.get(k).and_then(Value::as_f64).unwrap_or(0.0);
- let per_min = |v: f64| {
- if minutes > 0.0 {
- (v / minutes * 10.0).round() / 10.0
- } else {
- 0.0
- }
- };
- json!({
- "player": p.get("gameName").and_then(Value::as_str).unwrap_or(""),
- "championId": p.get("championId"),
- "team": p.get("teamId"),
- "win": p.get("win"),
- "kda": format!("{}/{}/{}", f("kills"), f("deaths"), f("assists")),
- "level": p.get("level"),
- "csPerMin": per_min(f("cs")),
- "goldPerMin": per_min(f("gold")).round(),
- "damageToChampions": f("damageToChampions"),
- "damageTaken": f("damageTaken"),
- "visionScore": f("visionScore"),
- "wards": format!("{}/{}/{}", f("wardsPlaced"), f("wardsKilled"), f("controlWards")),
- "objectiveDamage": f("damageToObjectives"),
- "ccSeconds": f("ccTime"),
- "firstBlood": p.get("firstBlood"),
- "multikill": p.get("largestMultiKill"),
- })
-}
-
-fn champion_name(champions: &Value, id: i64) -> String {
- champions
- .as_array()
- .and_then(|arr| {
- arr.iter()
- .find(|c| c.get("id").and_then(Value::as_i64) == Some(id))
- .and_then(|c| c.get("name").and_then(Value::as_str))
- })
- .unwrap_or("?")
- .to_string()
-}
-
-async fn champion_summary(client: &LcuClient) -> Value {
- lcu_get_raw(client, "/lol-game-data/assets/v1/champion-summary.json")
- .await
- .unwrap_or(Value::Null)
-}
-
-fn name_champions(mut value: Value, champions: &Value) -> Value {
- fn walk(v: &mut Value, champions: &Value) {
- match v {
- Value::Object(map) => {
- if let Some(id) = map.get("championId").and_then(Value::as_i64) {
- map.insert("champion".to_string(), json!(champion_name(champions, id)));
- map.remove("championId");
- }
- for (_, child) in map.iter_mut() {
- walk(child, champions);
- }
- }
- Value::Array(arr) => {
- for child in arr.iter_mut() {
- walk(child, champions);
- }
- }
- _ => {}
- }
- }
- walk(&mut value, champions);
- value
-}
-
-fn prompt_json(value: &Value, cap: usize) -> String {
- let mut text = serde_json::to_string(value).unwrap_or_default();
- if text.len() > cap {
- text.truncate(cap);
- text.push('…');
- }
- text
-}
-
-/// Post-game review of one match.
-#[tauri::command]
-pub async fn league_coach_review(
- game_id: i64,
- style: Option<String>,
- language: Option<String>,
-) -> Result<String, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let detail = super::league_match_detail(game_id).await?;
- let me = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await?;
- let my_puuid = me
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- let duration = detail
- .get("gameDuration")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- let minutes = duration / 60.0;
- let champions = champion_summary(&client).await;
- let participants: Vec<&Value> = detail
- .get("participants")
- .and_then(Value::as_array)
- .map(|a| a.iter().collect())
- .unwrap_or_default();
- let mine = participants
- .iter()
- .find(|p| p.get("puuid").and_then(Value::as_str) == Some(my_puuid.as_str()))
- .map(|p| compact_participant(p, minutes))
- .unwrap_or(Value::Null);
- let others: Vec<Value> = participants
- .iter()
- .filter(|p| p.get("puuid").and_then(Value::as_str) != Some(my_puuid.as_str()))
- .map(|p| compact_participant(p, minutes))
- .collect();
- let context = name_champions(
- json!({
- "queueId": detail.get("queueId"),
- "gameMode": detail.get("gameMode"),
- "durationMinutes": (minutes * 10.0).round() / 10.0,
- "teams": detail.get("teams"),
- "me": mine,
- "others": others,
- "myRunes": detail.get("participants").and_then(Value::as_array).and_then(|a| {
- a.iter().find(|p| p.get("puuid").and_then(Value::as_str) == Some(my_puuid.as_str()))
- .and_then(|p| p.get("runes").cloned())
- }),
- }),
- &champions,
- );
- let style = style.unwrap_or_else(|| super::league_settings().coach_style);
- let user = format!(
- "Review this game for the player marked as \"me\". Give: the result in one line, \
- the 3 biggest mistakes or missed opportunities with the numbers that show them, \
- what was done well, and one concrete goal for the next game.\n\nDATA:\n{}",
- prompt_json(&context, 14_000)
- );
- let system = system_prompt(&style, language.as_deref().unwrap_or("English"));
- omniget_core::core::ai::chat(&system, &user).await
-}
-
-/// One row per recent game, plus aggregates, so the model sees trends and
-/// not just a wall of numbers.
-pub fn trend_rows(games: &[Value], puuid: &str, champions: &Value) -> Value {
- let mut rows: Vec<Value> = Vec::new();
- let mut wins = 0usize;
- let mut by_champion: std::collections::HashMap<String, (usize, usize)> =
- std::collections::HashMap::new();
- let mut by_role: std::collections::HashMap<String, (usize, usize)> =
- std::collections::HashMap::new();
- let (mut k, mut d, mut a, mut cs, mut vision, mut minutes) =
- (0f64, 0f64, 0f64, 0f64, 0f64, 0f64);
- for game in games {
- let participants = match game.get("participants").and_then(Value::as_array) {
- Some(p) => p,
- None => continue,
- };
- let me = if participants.len() == 1 {
- participants.first()
- } else {
- let identities = game.get("participantIdentities").and_then(Value::as_array);
- let pid = identities.and_then(|ids| {
- ids.iter()
- .find(|i| {
- i.get("player")
- .and_then(|p| p.get("puuid"))
- .and_then(Value::as_str)
- == Some(puuid)
- })
- .and_then(|i| i.get("participantId").and_then(Value::as_i64))
- });
- pid.and_then(|pid| {
- participants
- .iter()
- .find(|p| p.get("participantId").and_then(Value::as_i64) == Some(pid))
- })
- .or_else(|| participants.first())
- };
- let me = match me {
- Some(m) => m,
- None => continue,
- };
- let stats = me.get("stats").cloned().unwrap_or(Value::Null);
- let f = |key: &str| stats.get(key).and_then(Value::as_f64).unwrap_or(0.0);
- let win = stats.get("win").and_then(Value::as_bool).unwrap_or(false);
- let duration = game
- .get("gameDuration")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- let mins = duration / 60.0;
- let champ = champion_name(
- champions,
- me.get("championId").and_then(Value::as_i64).unwrap_or(0),
- );
- let role = me
- .get("timeline")
- .and_then(|t| t.get("teamPosition").or_else(|| t.get("lane")))
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- let game_cs = f("totalMinionsKilled") + f("neutralMinionsKilled");
- if win {
- wins += 1;
- }
- let entry = by_champion.entry(champ.clone()).or_insert((0, 0));
- entry.0 += 1;
- if win {
- entry.1 += 1;
- }
- if !role.is_empty() {
- let entry = by_role.entry(role.clone()).or_insert((0, 0));
- entry.0 += 1;
- if win {
- entry.1 += 1;
- }
- }
- k += f("kills");
- d += f("deaths");
- a += f("assists");
- cs += game_cs;
- vision += f("visionScore");
- minutes += mins;
- rows.push(json!({
- "champion": champ,
- "role": role,
- "queueId": game.get("queueId"),
- "win": win,
- "kda": format!("{}/{}/{}", f("kills"), f("deaths"), f("assists")),
- "csPerMin": if mins > 0.0 { (game_cs / mins * 10.0).round() / 10.0 } else { 0.0 },
- "goldPerMin": if mins > 0.0 { (f("goldEarned") / mins).round() } else { 0.0 },
- "visionPerMin": if mins > 0.0 { (f("visionScore") / mins * 100.0).round() / 100.0 } else { 0.0 },
- "damageToChampions": f("totalDamageDealtToChampions"),
- "minutes": (mins * 10.0).round() / 10.0,
- }));
- }
- let total = rows.len().max(1) as f64;
- let mut champion_table: Vec<Value> = by_champion
- .into_iter()
- .map(|(name, (g, w))| json!({ "champion": name, "games": g, "wins": w }))
- .collect();
- champion_table.sort_by(|x, y| y["games"].as_u64().cmp(&x["games"].as_u64()));
- let role_table: Vec<Value> = by_role
- .into_iter()
- .map(|(name, (g, w))| json!({ "role": name, "games": g, "wins": w }))
- .collect();
- json!({
- "games": rows.len(),
- "wins": wins,
- "winrate": ((wins as f64 / total) * 1000.0).round() / 10.0,
- "avgKda": format!("{:.1}/{:.1}/{:.1}", k / total, d / total, a / total),
- "kdaRatio": if d > 0.0 { ((k + a) / d * 100.0).round() / 100.0 } else { k + a },
- "csPerMin": if minutes > 0.0 { (cs / minutes * 10.0).round() / 10.0 } else { 0.0 },
- "visionPerMin": if minutes > 0.0 { (vision / minutes * 100.0).round() / 100.0 } else { 0.0 },
- "byChampion": champion_table.into_iter().take(8).collect::<Vec<_>>(),
- "byRole": role_table,
- "recentFirst": rows,
- })
-}
-
-/// Trends over the last N games of the current player.
-#[tauri::command]
-pub async fn league_coach_trends(
- count: Option<u32>,
- style: Option<String>,
- language: Option<String>,
-) -> Result<String, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let count = count.unwrap_or(20).clamp(5, 40);
- let me = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await?;
- let puuid = me
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- let history = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/current-summoner/matches?begIndex=0&endIndex={}",
- count.saturating_sub(1)
- ),
- )
- .await?;
- let games: Vec<Value> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- if games.is_empty() {
- return Err("no recent games".to_string());
- }
- let champions = champion_summary(&client).await;
- let context = trend_rows(&games, &puuid, &champions);
- let style = style.unwrap_or_else(|| super::league_settings().coach_style);
- let user = format!(
- "Here are my last {} games (most recent first) with aggregates. Find my strengths, \
- my 3 most costly habits, which champions and roles I should play more or less, \
- and a one-week improvement plan with measurable targets.\n\nDATA:\n{}",
- games.len(),
- prompt_json(&context, 14_000)
- );
- let system = system_prompt(&style, language.as_deref().unwrap_or("English"));
- omniget_core::core::ai::chat(&system, &user).await
-}
-
-/// What the client is doing right now, in words the model can use.
-async fn live_context(client: &LcuClient, champions: &Value) -> Value {
- let phase = lcu_get_raw(client, "/lol-gameflow/v1/gameflow-phase")
- .await
- .ok()
- .and_then(|p| p.as_str().map(str::to_string))
- .unwrap_or_default();
- let mut context = json!({ "phase": phase });
- if phase == "ChampSelect" {
- if let Ok(session) = lcu_get_raw(client, "/lol-champ-select/v1/session").await {
- let cell = session
- .get("localPlayerCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-1);
- let team = |key: &str| -> Vec<Value> {
- session
- .get(key)
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .map(|m| {
- let id = m.get("championId").and_then(Value::as_i64).unwrap_or(0);
- json!({
- "champion": if id > 0 { champion_name(champions, id) } else { "?".to_string() },
- "position": m.get("assignedPosition").and_then(Value::as_str).unwrap_or(""),
- "me": m.get("cellId").and_then(Value::as_i64) == Some(cell),
- })
- })
- .collect()
- })
- .unwrap_or_default()
- };
- let allies = team("myTeam");
- let enemies = team("theirTeam");
- let me = allies
- .iter()
- .find(|m| m.get("me") == Some(&json!(true)))
- .cloned();
- let my_champ = me
- .as_ref()
- .and_then(|m| m.get("champion").and_then(Value::as_str))
- .unwrap_or("?")
- .to_string();
- let my_pos = me
- .as_ref()
- .and_then(|m| m.get("position").and_then(Value::as_str))
- .unwrap_or("")
- .to_string();
- context["allies"] = json!(allies);
- context["enemies"] = json!(enemies);
- if my_champ != "?" {
- let position = opgg_position(&my_pos);
- let champ_key = opgg_champion_name(&my_champ);
- if let Some(brief) = opgg_champion_brief(&champ_key, position).await {
- context["opgg"] = brief;
- }
- // The lane opponent is only known once both sides show a champion
- // in the same position; enemies do not expose positions, so the
- // first enemy champion is offered when the position is a lane.
- if position != "all" {
- if let Some(enemy) = enemies
- .iter()
- .find_map(|e| e.get("champion").and_then(Value::as_str))
- .filter(|c| *c != "?")
- {
- if let Some(guide) =
- opgg_matchup(&champ_key, &opgg_champion_name(enemy), position).await
- {
- context["opggMatchupSample"] =
- json!({ "opponent": enemy, "guide": guide });
- }
- }
- }
- }
- }
- } else if phase == "InProgress" {
- if let Ok(live) = super::league_live_game().await {
- context["live"] = json!({
- "gameTime": live.get("stats").and_then(|s| s.get("gameTime")),
- "activePlayer": live.get("activePlayer"),
- "players": live.get("players").and_then(Value::as_array).map(|arr| {
- arr.iter().map(|p| json!({
- "champion": p.get("championName"),
- "team": p.get("team"),
- "riotId": p.get("riotId").or_else(|| p.get("summonerName")),
- "kda": p.get("scores"),
- "level": p.get("level"),
- "dead": p.get("isDead"),
- })).collect::<Vec<_>>()
- }),
- });
- }
- if let Ok(metrics) = super::league_live_metrics().await {
- context["liveMetrics"] = metrics;
- }
- }
- context
-}
-
-/// Free question, answered against whatever the client is doing right now.
-#[tauri::command]
-pub async fn league_coach_ask(
- question: String,
- style: Option<String>,
- language: Option<String>,
-) -> Result<String, String> {
- ensure_enabled()?;
- let question = question.trim().to_string();
- if question.is_empty() {
- return Err("empty question".to_string());
- }
- if question.chars().count() > 2_000 {
- return Err("question too long".to_string());
- }
- let client = get_client().await?;
- let champions = champion_summary(&client).await;
- let mut context = live_context(&client, &champions).await;
- // Outside a game the last few results give the model something to anchor on.
- if context
- .get("phase")
- .and_then(Value::as_str)
- .map(|p| p != "ChampSelect" && p != "InProgress")
- .unwrap_or(true)
- {
- if let Ok(me) = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await {
- let puuid = me
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- if let Ok(history) = lcu_get_raw(
- &client,
- "/lol-match-history/v1/products/lol/current-summoner/matches?begIndex=0&endIndex=7",
- )
- .await
- {
- let games: Vec<Value> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- context["recent"] = trend_rows(&games, &puuid, &champions);
- }
- }
- }
- let style = style.unwrap_or_else(|| super::league_settings().coach_style);
- let user = format!(
- "QUESTION: {}\n\nCONTEXT (what the client is doing right now, plus OP.GG meta data when present):\n{}",
- question,
- prompt_json(&context, 16_000)
- );
- let system = system_prompt(&style, language.as_deref().unwrap_or("English"));
- omniget_core::core::ai::chat(&system, &user).await
-}
-
-/// Cheap check the tab uses to decide what to show.
-#[tauri::command]
-pub fn league_coach_ready() -> bool {
- omniget_core::core::ai::get().is_configured()
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn champion_names_become_op_gg_keys() {
- assert_eq!(opgg_champion_name("Kai'Sa"), "KAI_SA");
- assert_eq!(opgg_champion_name("Miss Fortune"), "MISS_FORTUNE");
- assert_eq!(opgg_champion_name("Garen"), "GAREN");
- assert_eq!(opgg_champion_name("Nunu & Willump"), "NUNU_WILLUMP");
- assert_eq!(opgg_position("BOTTOM"), "adc");
- assert_eq!(opgg_position("utility"), "support");
- assert_eq!(opgg_position(""), "all");
- }
-
- #[test]
- fn the_tool_result_is_unwrapped_and_errors_surface() {
- let ok = json!({ "result": { "content": [{ "type": "text", "text": "{\"a\":1}" }] } });
- assert_eq!(opgg_result(&ok).unwrap(), json!({ "a": 1 }));
- let plain = json!({ "result": { "content": [{ "type": "text", "text": "hello" }] } });
- assert_eq!(opgg_result(&plain).unwrap(), json!("hello"));
- let err = json!({ "error": { "code": -1, "message": "HTTP 422:\nmore" } });
- assert_eq!(opgg_result(&err).unwrap_err(), "op.gg: HTTP 422:");
- }
-
- #[test]
- fn trend_rows_aggregate_wins_and_per_minute_rates() {
- let champions = json!([{ "id": 1, "name": "Annie" }, { "id": 2, "name": "Olaf" }]);
- let game = |champ: i64, win: bool, kills: f64| {
- json!({
- "gameDuration": 1800, "queueId": 420,
- "participantIdentities": [{ "participantId": 1, "player": { "puuid": "me" } }],
- "participants": [{ "participantId": 1, "championId": champ,
- "timeline": { "teamPosition": "MIDDLE" },
- "stats": { "win": win, "kills": kills, "deaths": 2, "assists": 4, "totalMinionsKilled": 210, "neutralMinionsKilled": 0, "goldEarned": 12000, "visionScore": 30 } }]
- })
- };
- let games = vec![game(1, true, 6.0), game(1, false, 2.0), game(2, true, 8.0)];
- let rows = trend_rows(&games, "me", &champions);
- assert_eq!(rows["games"], 3);
- assert_eq!(rows["wins"], 2);
- assert_eq!(rows["winrate"], 66.7);
- assert_eq!(rows["csPerMin"], 7.0);
- assert_eq!(rows["byChampion"][0]["champion"], "Annie");
- assert_eq!(rows["byChampion"][0]["games"], 2);
- assert_eq!(rows["byRole"][0]["role"], "MIDDLE");
- assert_eq!(rows["recentFirst"][0]["kda"], "6/2/4");
- assert_eq!(rows["recentFirst"][0]["goldPerMin"], 400.0);
- }
-
- #[test]
- fn a_participant_is_compacted_with_per_minute_rates() {
- let p = json!({ "gameName": "Me", "championId": 7, "teamId": 100, "win": true, "kills": 5, "deaths": 1, "assists": 9,
- "cs": 240, "gold": 15000, "damageToChampions": 20000, "visionScore": 40, "wardsPlaced": 10, "wardsKilled": 3, "controlWards": 2 });
- let c = compact_participant(&p, 30.0);
- assert_eq!(c["kda"], "5/1/9");
- assert_eq!(c["csPerMin"], 8.0);
- assert_eq!(c["goldPerMin"], 500.0);
- assert_eq!(c["wards"], "10/3/2");
- let named = name_champions(json!({ "me": c }), &json!([{ "id": 7, "name": "Leona" }]));
- assert_eq!(named["me"]["champion"], "Leona");
- assert!(named["me"].get("championId").is_none());
- }
-
- #[test]
- fn styles_change_the_instruction() {
- assert!(style_instruction("roast").contains("roast"));
- assert!(style_instruction("praise").contains("encouraging"));
- assert!(style_instruction("anything").contains("objective"));
- }
-}
diff --git a/src-tauri/src/commands/league/live.rs b/src-tauri/src/commands/league/live.rs
deleted file mode 100644
index fc7f208c..00000000
--- a/src-tauri/src/commands/league/live.rs
+++ /dev/null
@@ -1,239 +0,0 @@
-use serde::Serialize;
-use serde_json::Value;
-
-/// Respawn windows are balance constants and move between patches, so every
-/// number derived from them is presented as an estimate.
-const BARON_RESPAWN: f64 = 360.0;
-const DRAGON_RESPAWN: f64 = 300.0;
-const INHIBITOR_RESPAWN: f64 = 300.0;
-
-#[derive(Debug, Serialize, PartialEq)]
-pub struct ObjectiveTimer {
- pub kind: &'static str,
- pub killed_at: f64,
- pub respawns_at: f64,
- pub remaining: f64,
-}
-
-#[derive(Debug, Serialize, PartialEq)]
-pub struct GameEvent {
- pub id: i64,
- pub name: String,
- pub at: f64,
- pub actor: Option<String>,
- pub target: Option<String>,
- pub detail: Option<String>,
-}
-
-fn event_time(event: &Value) -> Option<f64> {
- event.get("EventTime").and_then(Value::as_f64)
-}
-
-fn text(event: &Value, key: &str) -> Option<String> {
- event
- .get(key)
- .and_then(Value::as_str)
- .filter(|s| !s.is_empty())
- .map(str::to_string)
-}
-
-fn last_kill_time(events: &[Value], name: &str) -> Option<f64> {
- events
- .iter()
- .filter(|e| event_name(e) == name)
- .filter_map(event_time)
- .fold(None, |acc: Option<f64>, t| {
- Some(acc.map_or(t, |a| a.max(t)))
- })
-}
-
-fn event_name(event: &Value) -> &str {
- event.get("EventName").and_then(Value::as_str).unwrap_or("")
-}
-
-/// Turns the kill events into "when does it come back" timers. Objectives whose
-/// window already elapsed are dropped: an expired timer says nothing the map
-/// doesn't already show.
-pub fn objective_timers(events: &[Value], game_time: f64) -> Vec<ObjectiveTimer> {
- let mut timers = Vec::new();
- for (kind, event, window) in [
- ("baron", "BaronKill", BARON_RESPAWN),
- ("dragon", "DragonKill", DRAGON_RESPAWN),
- ("inhibitor", "InhibKilled", INHIBITOR_RESPAWN),
- ] {
- if let Some(killed_at) = last_kill_time(events, event) {
- let respawns_at = killed_at + window;
- let remaining = respawns_at - game_time;
- if remaining > 0.0 {
- timers.push(ObjectiveTimer {
- kind,
- killed_at,
- respawns_at,
- remaining,
- });
- }
- }
- }
- timers.sort_by(|a, b| a.remaining.total_cmp(&b.remaining));
- timers
-}
-
-/// Normalises the raw event list into a feed the UI can render without knowing
-/// the shape of every event type.
-pub fn game_events(events: &[Value], limit: usize) -> Vec<GameEvent> {
- let mut feed: Vec<GameEvent> = events
- .iter()
- .filter_map(|event| {
- let name = event_name(event);
- if name.is_empty() {
- return None;
- }
- let (actor, target, detail) = match name {
- "ChampionKill" => (
- text(event, "KillerName"),
- text(event, "VictimName"),
- assist_count(event),
- ),
- "TurretKilled" => (text(event, "KillerName"), text(event, "TurretKilled"), None),
- "InhibKilled" | "InhibRespawned" | "InhibRespawningSoon" => {
- (text(event, "KillerName"), text(event, "InhibKilled"), None)
- }
- "DragonKill" => (
- text(event, "KillerName"),
- None,
- text(event, "DragonType").or_else(|| stolen(event)),
- ),
- "BaronKill" | "HeraldKill" => (text(event, "KillerName"), None, stolen(event)),
- "Multikill" => (
- text(event, "KillerName"),
- None,
- event
- .get("KillStreak")
- .and_then(Value::as_i64)
- .map(|n| n.to_string()),
- ),
- "Ace" => (text(event, "Acer"), None, text(event, "AcingTeam")),
- "FirstBrick" | "FirstBlood" => (
- text(event, "KillerName").or_else(|| text(event, "Recipient")),
- None,
- None,
- ),
- _ => (text(event, "KillerName"), None, None),
- };
- Some(GameEvent {
- id: event.get("EventID").and_then(Value::as_i64).unwrap_or(-1),
- name: name.to_string(),
- at: event_time(event).unwrap_or(0.0),
- actor,
- target,
- detail,
- })
- })
- .collect();
- // Newest first, and the client is not guaranteed to keep them ordered.
- feed.sort_by(|a, b| b.at.total_cmp(&a.at).then(b.id.cmp(&a.id)));
- feed.truncate(limit);
- feed
-}
-
-fn stolen(event: &Value) -> Option<String> {
- match event.get("Stolen") {
- Some(Value::String(s)) if s.eq_ignore_ascii_case("true") => Some("stolen".to_string()),
- Some(Value::Bool(true)) => Some("stolen".to_string()),
- _ => None,
- }
-}
-
-fn assist_count(event: &Value) -> Option<String> {
- let count = event
- .get("Assisters")
- .and_then(Value::as_array)
- .map(|a| a.len())
- .unwrap_or(0);
- if count > 0 {
- Some(count.to_string())
- } else {
- None
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use serde_json::json;
-
- fn events() -> Vec<Value> {
- vec![
- json!({ "EventID": 0, "EventName": "GameStart", "EventTime": 0.05 }),
- json!({ "EventID": 1, "EventName": "DragonKill", "EventTime": 320.0, "KillerName": "Ally1", "DragonType": "Infernal", "Stolen": "False" }),
- json!({ "EventID": 2, "EventName": "BaronKill", "EventTime": 1300.0, "KillerName": "Enemy3", "Stolen": "True" }),
- json!({ "EventID": 3, "EventName": "DragonKill", "EventTime": 1400.0, "KillerName": "Enemy2", "DragonType": "Ocean", "Stolen": "False" }),
- json!({ "EventID": 4, "EventName": "ChampionKill", "EventTime": 1450.0, "KillerName": "Ally2", "VictimName": "Enemy1", "Assisters": ["Ally3", "Ally4"] }),
- ]
- }
-
- #[test]
- fn the_latest_kill_drives_each_objective_timer() {
- let timers = objective_timers(&events(), 1500.0);
- // Dragon at 1400 (not the one at 320) + 300 = 1700, so 200s left.
- let dragon = timers.iter().find(|t| t.kind == "dragon").expect("dragon");
- assert_eq!(dragon.killed_at, 1400.0);
- assert_eq!(dragon.respawns_at, 1700.0);
- assert_eq!(dragon.remaining, 200.0);
- // Baron at 1300 + 360 = 1660, so 160s left, and it sorts first.
- assert_eq!(timers[0].kind, "baron");
- assert_eq!(timers[0].remaining, 160.0);
- }
-
- #[test]
- fn elapsed_windows_are_dropped_rather_than_shown_as_negative() {
- // Long past both windows: nothing pending.
- assert!(objective_timers(&events(), 5000.0).is_empty());
- // No kills at all.
- assert!(objective_timers(&[], 100.0).is_empty());
- }
-
- #[test]
- fn an_objective_that_never_died_has_no_timer() {
- let timers = objective_timers(&events(), 1500.0);
- assert!(timers.iter().all(|t| t.kind != "inhibitor"));
- }
-
- #[test]
- fn the_feed_is_newest_first_and_capped() {
- let feed = game_events(&events(), 3);
- assert_eq!(feed.len(), 3);
- assert_eq!(feed[0].name, "ChampionKill");
- assert_eq!(feed[0].actor.as_deref(), Some("Ally2"));
- assert_eq!(feed[0].target.as_deref(), Some("Enemy1"));
- assert_eq!(feed[0].detail.as_deref(), Some("2"));
- assert_eq!(feed[1].name, "DragonKill");
- }
-
- #[test]
- fn a_stolen_objective_is_flagged_and_a_clean_one_is_not() {
- let feed = game_events(&events(), 10);
- let baron = feed.iter().find(|e| e.name == "BaronKill").expect("baron");
- assert_eq!(baron.detail.as_deref(), Some("stolen"));
- let dragon = feed
- .iter()
- .find(|e| e.name == "DragonKill" && e.at == 320.0)
- .expect("dragon");
- assert_eq!(dragon.detail.as_deref(), Some("Infernal"));
- }
-
- #[test]
- fn malformed_events_are_skipped_instead_of_panicking() {
- let messy = vec![
- json!({}),
- json!({ "EventName": "" }),
- json!({ "EventName": "ChampionKill" }),
- Value::Null,
- ];
- let feed = game_events(&messy, 10);
- assert_eq!(feed.len(), 1);
- assert_eq!(feed[0].at, 0.0);
- assert_eq!(feed[0].id, -1);
- assert!(objective_timers(&messy, 10.0).is_empty());
- }
-}
diff --git a/src-tauri/src/commands/league/lobby.rs b/src-tauri/src/commands/league/lobby.rs
deleted file mode 100644
index 3a6f7939..00000000
--- a/src-tauri/src/commands/league/lobby.rs
+++ /dev/null
@@ -1,79 +0,0 @@
-use serde_json::Value;
-
-/// Only the lobby leader can start matchmaking, so anything that re-queues has to
-/// check this first — asking as a member just fails.
-pub fn is_leader(lobby: &Value) -> bool {
- lobby
- .get("localMember")
- .and_then(|m| m.get("isLeader"))
- .and_then(Value::as_bool)
- .unwrap_or(false)
-}
-
-/// Swap requests waiting for an answer, as `(kind, id)`. `kind` is the path
-/// segment the client expects back.
-pub fn pending_swaps(session: &Value) -> Vec<(&'static str, i64)> {
- let mut pending = Vec::new();
- for (field, kind) in [
- ("positionSwaps", "position-swaps"),
- ("pickOrderSwaps", "pick-order-swaps"),
- ] {
- for entry in session
- .get(field)
- .and_then(Value::as_array)
- .unwrap_or(&vec![])
- {
- let state = entry.get("state").and_then(Value::as_str).unwrap_or("");
- let id = entry.get("id").and_then(Value::as_i64).unwrap_or(-1);
- if state == "RECEIVED" && id >= 0 {
- pending.push((kind, id));
- }
- }
- }
- pending
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use serde_json::json;
-
- #[test]
- fn leadership_comes_from_the_local_member_flag() {
- assert!(is_leader(&json!({ "localMember": { "isLeader": true } })));
- assert!(!is_leader(&json!({ "localMember": { "isLeader": false } })));
- // A missing flag must never be read as "I am the leader".
- assert!(!is_leader(&json!({ "localMember": {} })));
- assert!(!is_leader(&json!({})));
- assert!(!is_leader(&Value::Null));
- }
-
- #[test]
- fn only_requests_waiting_for_an_answer_are_returned() {
- let session = json!({
- "positionSwaps": [
- { "id": 1, "state": "RECEIVED" },
- { "id": 2, "state": "SENT" },
- { "id": 3, "state": "INVALID" }
- ],
- "pickOrderSwaps": [
- { "id": 7, "state": "RECEIVED" },
- { "id": 8, "state": "ACCEPTED" }
- ]
- });
- assert_eq!(
- pending_swaps(&session),
- vec![("position-swaps", 1), ("pick-order-swaps", 7)]
- );
- }
-
- #[test]
- fn a_session_without_swap_fields_is_handled() {
- assert!(pending_swaps(&json!({})).is_empty());
- assert!(pending_swaps(&json!({ "positionSwaps": [] })).is_empty());
- // Malformed entries are skipped rather than panicking.
- assert!(
- pending_swaps(&json!({ "positionSwaps": [{}, { "state": "RECEIVED" }] })).is_empty()
- );
- }
-}
diff --git a/src-tauri/src/commands/league/locator.rs b/src-tauri/src/commands/league/locator.rs
deleted file mode 100644
index e5a967be..00000000
--- a/src-tauri/src/commands/league/locator.rs
+++ /dev/null
@@ -1,330 +0,0 @@
-use std::path::PathBuf;
-
-#[derive(Clone, Debug, PartialEq)]
-pub struct LcuCredentials {
- pub port: u16,
- pub token: String,
- pub region: Option<String>,
-}
-
-#[derive(Debug, PartialEq)]
-pub enum Source {
- CommandLine,
- Lockfile,
-}
-
-pub fn extract_arg(cmdline: &str, key: &str) -> Option<String> {
- // The needle keeps both leading dashes on purpose: a loose "app-port="
- // would also match the unrelated "--riotclient-app-port=".
- let needle = format!("--{}=", key);
- let start = cmdline.find(&needle)? + needle.len();
- let rest = &cmdline[start..];
- let value: String = rest
- .chars()
- .take_while(|c| !c.is_whitespace() && *c != '"' && *c != '\'')
- .collect();
- if value.is_empty() {
- None
- } else {
- Some(value)
- }
-}
-
-fn client_lines(listing: &str) -> impl Iterator<Item = &str> {
- listing
- .lines()
- .filter(|line| line.contains("LeagueClientUx"))
-}
-
-pub fn region_from_listing(listing: &str) -> Option<String> {
- client_lines(listing).find_map(|line| {
- extract_arg(line, "region").or_else(|| extract_arg(line, "rso_platform_id"))
- })
-}
-
-pub fn credentials_from_listing(listing: &str) -> Option<LcuCredentials> {
- client_lines(listing).find_map(|line| {
- let port = extract_arg(line, "app-port")?.parse::<u16>().ok()?;
- let token = extract_arg(line, "remoting-auth-token")?;
- Some(LcuCredentials {
- port,
- token,
- region: extract_arg(line, "region").or_else(|| extract_arg(line, "rso_platform_id")),
- })
- })
-}
-
-pub fn parse_lockfile(contents: &str) -> Option<LcuCredentials> {
- // Format: name:pid:port:token:protocol
- let line = contents.lines().find(|l| !l.trim().is_empty())?;
- let fields: Vec<&str> = line.trim().split(':').collect();
- if fields.len() < 5 {
- return None;
- }
- let port = fields[2].parse::<u16>().ok()?;
- let token = fields[3].to_string();
- if token.is_empty() {
- return None;
- }
- Some(LcuCredentials {
- port,
- token,
- region: None,
- })
-}
-
-fn executable_path(line: &str) -> Option<&str> {
- // Cutting at the first " --" survives install paths that contain spaces,
- // which whitespace splitting would mangle on both platforms.
- let head = line.split(" --").next()?.trim();
- let head = head.trim_matches(|c| c == '"' || c == '\'');
- if head.is_empty() {
- None
- } else {
- Some(head)
- }
-}
-
-/// Walks up a path textually, accepting either separator: a Windows listing
-/// still has to parse correctly when the tests run on a unix host.
-fn ancestors_of(path: &str) -> Vec<&str> {
- let mut ancestors = Vec::new();
- let mut current = path;
- while let Some(index) = current.rfind(['/', '\\']) {
- if index == 0 {
- break;
- }
- current = &current[..index];
- ancestors.push(current);
- }
- ancestors
-}
-
-fn last_segment(path: &str) -> &str {
- match path.rfind(['/', '\\']) {
- Some(index) => &path[index + 1..],
- None => path,
- }
-}
-
-pub fn install_dirs_from_listing(listing: &str) -> Vec<PathBuf> {
- let mut dirs = Vec::new();
- for line in client_lines(listing) {
- if let Some(dir) = extract_arg(line, "install-directory") {
- push_unique(&mut dirs, PathBuf::from(dir));
- }
- if let Some(exe) = executable_path(line) {
- // On macOS the binary sits several bundles deep
- // (…/Contents/LoL/LeagueClientUx.app/Contents/MacOS/LeagueClientUx),
- // so the install root is the ancestor named "LoL".
- let ancestors = ancestors_of(exe);
- for ancestor in &ancestors {
- if last_segment(ancestor) == "LoL" {
- push_unique(&mut dirs, PathBuf::from(*ancestor));
- }
- }
- if let Some(parent) = ancestors.first() {
- push_unique(&mut dirs, PathBuf::from(*parent));
- }
- }
- }
- dirs
-}
-
-fn push_unique(dirs: &mut Vec<PathBuf>, dir: PathBuf) {
- if !dirs.contains(&dir) {
- dirs.push(dir);
- }
-}
-
-pub fn lockfile_paths_from_listing(listing: &str) -> Vec<PathBuf> {
- install_dirs_from_listing(listing)
- .into_iter()
- .map(|dir| dir.join("lockfile"))
- .collect()
-}
-
-pub fn default_lockfile_paths() -> Vec<PathBuf> {
- #[cfg(target_os = "macos")]
- {
- let mut paths = vec![PathBuf::from(
- "/Applications/League of Legends.app/Contents/LoL/lockfile",
- )];
- if let Some(home) = std::env::var_os("HOME") {
- paths.push(
- PathBuf::from(home)
- .join("Library/Application Support/Riot Games/League of Legends/lockfile"),
- );
- }
- paths
- }
- #[cfg(windows)]
- {
- let mut paths = vec![PathBuf::from("C:\\Riot Games\\League of Legends\\lockfile")];
- if let Some(drive) = std::env::var_os("SystemDrive") {
- let mut path = PathBuf::from(drive);
- path.push("\\Riot Games\\League of Legends\\lockfile");
- push_unique(&mut paths, path);
- }
- paths
- }
- // The client has no native Linux build, so there is no standard path to
- // guess; discovery there relies on the command line alone.
- #[cfg(not(any(target_os = "macos", windows)))]
- {
- Vec::new()
- }
-}
-
-async fn read_process_command_lines() -> Result<String, String> {
- #[cfg(windows)]
- {
- // tasklist costs ~50ms; the CIM query costs seconds and stutters the
- // whole app, so it only runs once the cheap probe sees the process.
- let probe = crate::core::process::command("tasklist")
- .args(["/FI", "IMAGENAME eq LeagueClientUx.exe", "/NH"])
- .output()
- .await
- .map_err(|e| format!("failed to probe processes: {}", e))?;
- if !String::from_utf8_lossy(&probe.stdout).contains("LeagueClientUx.exe") {
- return Ok(String::new());
- }
- let output = crate::core::process::command("powershell")
- .args([
- "-NoProfile",
- "-Command",
- "Get-CimInstance Win32_Process -Filter \"Name='LeagueClientUx.exe'\" | Select-Object -ExpandProperty CommandLine",
- ])
- .output()
- .await
- .map_err(|e| format!("failed to query processes: {}", e))?;
- Ok(String::from_utf8_lossy(&output.stdout).to_string())
- }
- #[cfg(not(windows))]
- {
- let output = tokio::process::Command::new("ps")
- .args(["-axo", "command"])
- .output()
- .await
- .map_err(|e| format!("failed to query processes: {}", e))?;
- Ok(String::from_utf8_lossy(&output.stdout).to_string())
- }
-}
-
-async fn credentials_from_lockfiles(listing: &str) -> Option<(LcuCredentials, Source)> {
- let mut candidates = lockfile_paths_from_listing(listing);
- for path in default_lockfile_paths() {
- push_unique(&mut candidates, path);
- }
- for path in candidates {
- let Ok(contents) = tokio::fs::read_to_string(&path).await else {
- continue;
- };
- if let Some(mut credentials) = parse_lockfile(&contents) {
- credentials.region = region_from_listing(listing);
- return Some((credentials, Source::Lockfile));
- }
- }
- None
-}
-
-/// Install directory of the game, when it can be told from the running process.
-/// Features that need files on disk (replays, the settings lock) depend on this.
-pub async fn install_dir() -> Option<PathBuf> {
- let listing = read_process_command_lines().await.ok()?;
- install_dirs_from_listing(&listing).into_iter().next()
-}
-
-pub async fn discover() -> Option<(LcuCredentials, Source)> {
- let listing = read_process_command_lines().await.unwrap_or_default();
- if let Some(credentials) = credentials_from_listing(&listing) {
- return Some((credentials, Source::CommandLine));
- }
- // Reading another process' command line can fail (missing privileges on
- // Windows, sandboxed listings), while the lockfile stays readable.
- credentials_from_lockfiles(&listing).await
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- const MAC_LISTING: &str = "/Applications/Safari.app/Contents/MacOS/Safari\n\
-/Applications/League of Legends.app/Contents/LoL/LeagueClientUx.app/Contents/MacOS/LeagueClientUx --riotclient-app-port=54321 --app-port=61947 --remoting-auth-token=aBcD-1234_xyz --region=BR --locale=pt_BR\n";
-
- const WIN_LISTING: &str = "\"C:\\Riot Games\\League of Legends\\LeagueClientUx.exe\" --riotclient-app-port=1111 --app-port=2222 --remoting-auth-token=tok3n --rso_platform_id=NA1\n";
-
- #[test]
- fn app_port_is_not_confused_with_riotclient_app_port() {
- let creds = credentials_from_listing(MAC_LISTING).expect("credentials");
- assert_eq!(creds.port, 61947);
- assert_eq!(creds.token, "aBcD-1234_xyz");
- assert_eq!(creds.region.as_deref(), Some("BR"));
- }
-
- #[test]
- fn windows_listing_falls_back_to_rso_platform_id_for_region() {
- let creds = credentials_from_listing(WIN_LISTING).expect("credentials");
- assert_eq!(creds.port, 2222);
- assert_eq!(creds.region.as_deref(), Some("NA1"));
- }
-
- #[test]
- fn listing_without_the_client_yields_nothing() {
- assert!(credentials_from_listing("/usr/bin/ssh -L 61947:localhost:80").is_none());
- }
-
- #[test]
- fn lockfile_is_parsed_into_port_and_token() {
- let creds = parse_lockfile("LeagueClient:4242:61947:aBcD-1234_xyz:https\n").expect("creds");
- assert_eq!(creds.port, 61947);
- assert_eq!(creds.token, "aBcD-1234_xyz");
- assert_eq!(creds.region, None);
- }
-
- #[test]
- fn truncated_or_empty_lockfiles_are_rejected() {
- assert!(parse_lockfile("LeagueClient:4242:61947").is_none());
- assert!(parse_lockfile("").is_none());
- assert!(parse_lockfile("LeagueClient:4242:61947::https").is_none());
- assert!(parse_lockfile("LeagueClient:4242:notaport:tok:https").is_none());
- }
-
- #[test]
- fn install_dir_is_recovered_from_a_path_containing_spaces() {
- let dirs = install_dirs_from_listing(MAC_LISTING);
- assert!(
- dirs.contains(&PathBuf::from(
- "/Applications/League of Legends.app/Contents/LoL"
- )),
- "got {:?}",
- dirs
- );
-
- let dirs = install_dirs_from_listing(WIN_LISTING);
- assert!(
- dirs.contains(&PathBuf::from("C:\\Riot Games\\League of Legends")),
- "got {:?}",
- dirs
- );
- }
-
- #[test]
- fn lockfile_candidates_sit_next_to_the_install_dir() {
- let paths = lockfile_paths_from_listing(MAC_LISTING);
- assert!(
- paths.contains(&PathBuf::from(
- "/Applications/League of Legends.app/Contents/LoL/lockfile"
- )),
- "got {:?}",
- paths
- );
- }
-
- #[test]
- fn region_survives_a_listing_without_credentials() {
- let listing = "/Applications/League of Legends.app/Contents/LoL/LeagueClientUx.app/Contents/MacOS/LeagueClientUx --region=EUW\n";
- assert!(credentials_from_listing(listing).is_none());
- assert_eq!(region_from_listing(listing).as_deref(), Some("EUW"));
- }
-}
diff --git a/src-tauri/src/commands/league/meta.rs b/src-tauri/src/commands/league/meta.rs
deleted file mode 100644
index 2b2e96a8..00000000
--- a/src-tauri/src/commands/league/meta.rs
+++ /dev/null
@@ -1,139 +0,0 @@
-use serde_json::Value;
-
-/// Picks the most played variant of a list of `{ids, play, win, pick_rate}`
-/// entries. Most played beats highest win rate on purpose: a 100% win rate over
-/// two games is noise.
-pub fn most_played(entries: &[Value]) -> Option<&Value> {
- entries
- .iter()
- .max_by_key(|e| e.get("play").and_then(Value::as_i64).unwrap_or(0))
-}
-
-pub fn id_list(entry: Option<&Value>) -> Vec<i64> {
- entry
- .and_then(|e| e.get("ids"))
- .and_then(Value::as_array)
- .map(|arr| arr.iter().filter_map(Value::as_i64).collect())
- .unwrap_or_default()
-}
-
-/// Win rate of a variant as a percentage, when it has enough games to mean
-/// something.
-pub fn variant_winrate(entry: Option<&Value>) -> Option<f64> {
- let entry = entry?;
- let play = entry.get("play").and_then(Value::as_i64).unwrap_or(0);
- let win = entry.get("win").and_then(Value::as_i64).unwrap_or(0);
- if play < 5 {
- return None;
- }
- Some(((win as f64 / play as f64) * 1000.0).round() / 10.0)
-}
-
-/// Skill order as the letters the client uses, from the most played build.
-pub fn skill_order(skills: &[Value]) -> Vec<String> {
- most_played(skills)
- .and_then(|e| e.get("order"))
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter_map(Value::as_str)
- .map(str::to_string)
- .collect()
- })
- .unwrap_or_default()
-}
-
-/// The first three levels of the order, which is what people actually memorise.
-pub fn first_levels(order: &[String], count: usize) -> Vec<String> {
- order.iter().take(count).cloned().collect()
-}
-
-/// Counter champions, when the source has them. The field exists but comes back
-/// empty for plenty of champion/position pairs, so an empty list is normal and
-/// must render as "no data" rather than as an error.
-pub fn counters(raw: &Value) -> Vec<Value> {
- raw.get("counters")
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter_map(|c| {
- let id = c.get("champion_id").and_then(Value::as_i64)?;
- let play = c.get("play").and_then(Value::as_i64).unwrap_or(0);
- let win = c.get("win").and_then(Value::as_i64).unwrap_or(0);
- Some(serde_json::json!({
- "championId": id,
- "games": play,
- "winrate": if play > 0 {
- serde_json::json!(((win as f64 / play as f64) * 1000.0).round() / 10.0)
- } else {
- Value::Null
- },
- }))
- })
- .collect()
- })
- .unwrap_or_default()
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use serde_json::json;
-
- fn variants() -> Vec<Value> {
- vec![
- json!({ "ids": [1, 2], "play": 10, "win": 9 }),
- json!({ "ids": [3, 4], "play": 40, "win": 20 }),
- json!({ "ids": [5], "play": 2, "win": 2 }),
- ]
- }
-
- #[test]
- fn the_most_played_variant_wins_over_the_luckiest_one() {
- let entries = variants();
- let picked = most_played(&entries);
- assert_eq!(id_list(picked), vec![3, 4]);
- }
-
- #[test]
- fn a_variant_with_too_few_games_reports_no_winrate() {
- let entries = variants();
- assert_eq!(variant_winrate(Some(&entries[1])), Some(50.0));
- assert_eq!(variant_winrate(Some(&entries[2])), None);
- assert_eq!(variant_winrate(None), None);
- }
-
- #[test]
- fn empty_input_never_panics() {
- assert!(most_played(&[]).is_none());
- assert!(id_list(None).is_empty());
- assert!(skill_order(&[]).is_empty());
- assert!(counters(&json!({})).is_empty());
- assert!(counters(&json!({ "counters": [] })).is_empty());
- }
-
- #[test]
- fn the_skill_order_comes_from_the_most_played_build() {
- let skills = vec![
- json!({ "order": ["Q", "W", "E"], "play": 3 }),
- json!({ "order": ["E", "Q", "W", "Q", "Q", "R"], "play": 44 }),
- ];
- let order = skill_order(&skills);
- assert_eq!(order, vec!["E", "Q", "W", "Q", "Q", "R"]);
- assert_eq!(first_levels(&order, 3), vec!["E", "Q", "W"]);
- // Asking for more levels than exist just returns what there is.
- assert_eq!(first_levels(&order, 99).len(), 6);
- }
-
- #[test]
- fn counters_are_normalised_and_skip_entries_without_a_champion() {
- let raw = json!({ "counters": [
- { "champion_id": 22, "play": 40, "win": 30 },
- { "play": 10, "win": 5 }
- ]});
- let list = counters(&raw);
- assert_eq!(list.len(), 1);
- assert_eq!(list[0]["championId"], 22);
- assert_eq!(list[0]["winrate"], 75.0);
- }
-}
diff --git a/src-tauri/src/commands/league/mod.rs b/src-tauri/src/commands/league/mod.rs
deleted file mode 100644
index 3dbd9a08..00000000
--- a/src-tauri/src/commands/league/mod.rs
+++ /dev/null
@@ -1,3583 +0,0 @@
-pub mod analysis;
-pub mod champ_select;
-pub mod coach;
-pub mod live;
-pub mod lobby;
-pub mod locator;
-pub mod meta;
-pub mod profile;
-pub mod sgp;
-pub mod skins;
-pub mod stats;
-pub mod ws;
-
-use once_cell::sync::Lazy;
-use serde::Serialize;
-use serde_json::{json, Value};
-use std::collections::HashSet;
-use std::sync::atomic::{AtomicBool, Ordering};
-use tokio::sync::Mutex;
-
-#[derive(Clone)]
-pub(crate) struct LcuClient {
- port: u16,
- token: String,
- region: Option<String>,
-}
-
-#[derive(Serialize)]
-pub struct LeagueStatus {
- pub connected: bool,
- pub port: Option<u16>,
- pub region: Option<String>,
-}
-
-static CACHED_CLIENT: Lazy<Mutex<Option<LcuClient>>> = Lazy::new(|| Mutex::new(None));
-static AUTO_ACCEPT: AtomicBool = AtomicBool::new(false);
-static CS_HANDLED: Lazy<Mutex<HashSet<i64>>> = Lazy::new(|| Mutex::new(HashSet::new()));
-static CS_FIRST_SEEN: Lazy<Mutex<std::collections::HashMap<i64, std::time::Instant>>> =
- Lazy::new(|| Mutex::new(std::collections::HashMap::new()));
-static CS_DECLARED: Lazy<Mutex<HashSet<i64>>> = Lazy::new(|| Mutex::new(HashSet::new()));
-
-async fn discover_client() -> Option<LcuClient> {
- let (credentials, source) = locator::discover().await?;
- if matches!(source, locator::Source::Lockfile) {
- tracing::debug!("[league] credentials read from lockfile");
- }
- Some(LcuClient {
- port: credentials.port,
- token: credentials.token,
- region: credentials.region,
- })
-}
-
-async fn get_client() -> Result<LcuClient, String> {
- // The cached client is copied out before the reachability probe: holding the
- // lock across a request would put every league command in a single file
- // behind one network round trip, and a slow client stalls all of them.
- let cached = { CACHED_CLIENT.lock().await.clone() };
- if let Some(client) = cached {
- // The websocket task already proves the client is alive; probing it
- // again would add a round-trip to every single command.
- if ws::is_connected() || lcu_reachable(&client).await {
- return Ok(client);
- }
- }
- let discovered = discover_client()
- .await
- .ok_or_else(|| "league client not running".to_string())?;
- let mut cached = CACHED_CLIENT.lock().await;
- *cached = Some(discovered.clone());
- Ok(discovered)
-}
-
-static HTTP_CLIENT: Lazy<Option<reqwest::Client>> = Lazy::new(|| {
- reqwest::Client::builder()
- .danger_accept_invalid_certs(true)
- .timeout(std::time::Duration::from_secs(10))
- .no_proxy()
- .build()
- .ok()
-});
-
-fn http_client() -> Result<reqwest::Client, String> {
- HTTP_CLIENT
- .clone()
- .ok_or_else(|| "http client init failed".to_string())
-}
-
-async fn lcu_reachable(client: &LcuClient) -> bool {
- lcu_get_raw(client, "/lol-gameflow/v1/gameflow-phase")
- .await
- .is_ok()
-}
-
-/// The client's own web server is easy to swamp: a scouting pass touches ten
-/// players at once, so requests are queued instead of fired all together.
-static LCU_GATE: Lazy<tokio::sync::Semaphore> = Lazy::new(|| tokio::sync::Semaphore::new(4));
-
-async fn lcu_send(
- client: &LcuClient,
- method: reqwest::Method,
- path: &str,
- body: Option<Value>,
-) -> Result<Value, String> {
- let mut attempt = 0;
- loop {
- let result = lcu_send_once(client, method.clone(), path, body.clone()).await;
- match result {
- Ok(v) => return Ok(v),
- Err(e) => {
- // Retry transient failures only; a 404 means the resource is
- // genuinely absent and retrying would just waste time.
- let transient = e.contains("request failed")
- || e.contains(" 429 ")
- || e.contains(" 500 ")
- || e.contains(" 503 ");
- if !transient || attempt >= 2 {
- return Err(e);
- }
- attempt += 1;
- tokio::time::sleep(std::time::Duration::from_millis(120 * attempt as u64)).await;
- }
- }
- }
-}
-
-async fn lcu_send_once(
- client: &LcuClient,
- method: reqwest::Method,
- path: &str,
- body: Option<Value>,
-) -> Result<Value, String> {
- let _permit = LCU_GATE
- .acquire()
- .await
- .map_err(|_| "request gate closed".to_string())?;
- let url = format!("https://127.0.0.1:{}{}", client.port, path);
- let mut req = http_client()?
- .request(method, &url)
- .basic_auth("riot", Some(&client.token));
- req = match body {
- Some(b) => req.json(&b),
- None => req.header("content-length", "0"),
- };
- let resp = req
- .send()
- .await
- .map_err(|e| format!("lcu request failed: {}", e))?;
- let status = resp.status();
- if !status.is_success() {
- let detail = resp
- .json::<Value>()
- .await
- .ok()
- .and_then(|v| v.get("message").and_then(Value::as_str).map(String::from))
- .unwrap_or_default();
- return Err(format!(
- "lcu returned {} for {}{}",
- status.as_u16(),
- path,
- if detail.is_empty() {
- String::new()
- } else {
- format!(": {}", detail)
- }
- ));
- }
- Ok(resp.json::<Value>().await.unwrap_or(Value::Null))
-}
-
-/// Static game data changes only with a patch, and finished games never change
-/// at all, so both are answered from memory instead of hitting the client again.
-enum CacheKind {
- PatchStatic,
- Immutable,
-}
-
-const PATCH_STATIC_TTL: std::time::Duration = std::time::Duration::from_secs(15 * 60);
-const IMMUTABLE_CAP: usize = 400;
-
-static PATCH_CACHE: Lazy<Mutex<std::collections::HashMap<String, (std::time::Instant, Value)>>> =
- Lazy::new(|| Mutex::new(std::collections::HashMap::new()));
-static IMMUTABLE_CACHE: Lazy<
- Mutex<(
- std::collections::VecDeque<String>,
- std::collections::HashMap<String, Value>,
- )>,
-> = Lazy::new(|| {
- Mutex::new((
- std::collections::VecDeque::new(),
- std::collections::HashMap::new(),
- ))
-});
-
-fn cache_kind(path: &str) -> Option<CacheKind> {
- if path.starts_with("/lol-game-data/assets/") || path == "/lol-perks/v1/perks" {
- return Some(CacheKind::PatchStatic);
- }
- if path.starts_with("/lol-match-history/v1/games/")
- || path.starts_with("/lol-match-history/v1/game-timelines/")
- {
- return Some(CacheKind::Immutable);
- }
- None
-}
-
-async fn cache_lookup(path: &str) -> Option<Value> {
- match cache_kind(path)? {
- CacheKind::PatchStatic => {
- let cache = PATCH_CACHE.lock().await;
- cache.get(path).and_then(|(when, value)| {
- if when.elapsed() < PATCH_STATIC_TTL {
- Some(value.clone())
- } else {
- None
- }
- })
- }
- CacheKind::Immutable => {
- let cache = IMMUTABLE_CACHE.lock().await;
- cache.1.get(path).cloned()
- }
- }
-}
-
-async fn cache_store(path: &str, value: &Value) {
- if value.is_null() {
- return;
- }
- match cache_kind(path) {
- Some(CacheKind::PatchStatic) => {
- let mut cache = PATCH_CACHE.lock().await;
- cache.insert(path.to_string(), (std::time::Instant::now(), value.clone()));
- }
- Some(CacheKind::Immutable) => {
- let mut cache = IMMUTABLE_CACHE.lock().await;
- if cache.1.contains_key(path) {
- return;
- }
- if cache.0.len() >= IMMUTABLE_CAP {
- if let Some(evicted) = cache.0.pop_front() {
- cache.1.remove(&evicted);
- }
- }
- cache.0.push_back(path.to_string());
- cache.1.insert(path.to_string(), value.clone());
- }
- None => {}
- }
-}
-
-async fn lcu_get_raw(client: &LcuClient, path: &str) -> Result<Value, String> {
- if let Some(cached) = cache_lookup(path).await {
- return Ok(cached);
- }
- let value = lcu_send(client, reqwest::Method::GET, path, None).await?;
- cache_store(path, &value).await;
- Ok(value)
-}
-
-async fn lcu_post_raw(client: &LcuClient, path: &str) -> Result<Value, String> {
- lcu_send(client, reqwest::Method::POST, path, None).await
-}
-
-/// Settings are read on every websocket event, and reading them means parsing the
-/// settings file from disk. A short cache keeps that off the hot path while still
-/// picking up a toggle the user just flipped.
-static SETTINGS_CACHE: Lazy<
- std::sync::Mutex<
- Option<(
- omniget_core::models::settings::LeagueSettings,
- std::time::Instant,
- )>,
- >,
-> = Lazy::new(|| std::sync::Mutex::new(None));
-
-const SETTINGS_TTL: std::time::Duration = std::time::Duration::from_millis(2000);
-
-fn league_settings() -> omniget_core::models::settings::LeagueSettings {
- if let Ok(cache) = SETTINGS_CACHE.lock() {
- if let Some((settings, at)) = cache.as_ref() {
- if at.elapsed() < SETTINGS_TTL {
- return settings.clone();
- }
- }
- }
- let settings = crate::storage::config::load_settings_standalone().league;
- if let Ok(mut cache) = SETTINGS_CACHE.lock() {
- *cache = Some((settings.clone(), std::time::Instant::now()));
- }
- settings
-}
-
-fn league_enabled() -> bool {
- league_settings().enabled
-}
-
-fn ensure_enabled() -> Result<(), String> {
- if league_enabled() {
- Ok(())
- } else {
- Err("league menu is disabled in settings".to_string())
- }
-}
-
-#[tauri::command]
-pub async fn league_status() -> LeagueStatus {
- if !league_enabled() {
- return LeagueStatus {
- connected: false,
- port: None,
- region: None,
- };
- }
- match get_client().await {
- Ok(client) => LeagueStatus {
- connected: true,
- port: Some(client.port),
- region: client.region,
- },
- Err(_) => LeagueStatus {
- connected: false,
- port: None,
- region: None,
- },
- }
-}
-
-#[tauri::command]
-pub async fn league_get(path: String) -> Result<Value, String> {
- ensure_enabled()?;
- let allowed = path.starts_with("/lol-") || path.starts_with("/riotclient/");
- if !allowed || path.contains("..") {
- return Err(format!("path not allowed: {}", path));
- }
- let client = get_client().await?;
- lcu_get_raw(&client, &path).await
-}
-
-/// Restarts only the client's interface process. The classic fix for a client
-/// stuck spinning or with a broken window size, and it keeps the queue spot —
-/// which is why it is worth offering instead of asking the user to close the game.
-#[tauri::command]
-pub async fn league_restart_ux() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_post_raw(&client, "/riotclient/kill-and-restart-ux").await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_summoner() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await
-}
-
-#[tauri::command]
-pub async fn league_ranked() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_get_raw(&client, "/lol-ranked/v1/current-ranked-stats").await
-}
-
-#[tauri::command]
-pub async fn league_gameflow() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_get_raw(&client, "/lol-gameflow/v1/gameflow-phase").await
-}
-
-#[tauri::command]
-pub async fn league_match_history(beg_index: u32, end_index: u32) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let summoner = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await?;
- let puuid = summoner
- .get("puuid")
- .and_then(Value::as_str)
- .ok_or_else(|| "no puuid in summoner response".to_string())?;
- let path = format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex={}&endIndex={}",
- puuid, beg_index, end_index
- );
- lcu_get_raw(&client, &path).await
-}
-
-#[tauri::command]
-pub async fn league_accept_ready_check() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_post_raw(&client, "/lol-matchmaking/v1/ready-check/accept").await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_lobby_queues() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let queues = lcu_get_raw(&client, "/lol-game-queues/v1/queues").await?;
- let eligibility = lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-lobby/v2/eligibility/self",
- Some(json!({})),
- )
- .await
- .unwrap_or(Value::Null);
-
- let eligible: HashSet<i64> = eligibility
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter(|e| e.get("eligible").and_then(Value::as_bool).unwrap_or(false))
- .filter_map(|e| e.get("queueId").and_then(Value::as_i64))
- .collect()
- })
- .unwrap_or_default();
-
- let list: Vec<Value> = queues
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter(|q| {
- let id = q.get("id").and_then(Value::as_i64).unwrap_or(-1);
- let available = q
- .get("queueAvailability")
- .and_then(Value::as_str)
- .map(|a| a == "Available")
- .unwrap_or(false);
- let pvp = q
- .get("category")
- .and_then(Value::as_str)
- .map(|c| c == "PvP")
- .unwrap_or(false);
- available && pvp && eligible.contains(&id)
- })
- .map(|q| {
- json!({
- "id": q.get("id"),
- "name": q.get("name"),
- "shortName": q.get("shortName"),
- "gameMode": q.get("gameMode"),
- })
- })
- .collect()
- })
- .unwrap_or_default();
- Ok(Value::Array(list))
-}
-
-#[tauri::command]
-pub async fn league_create_lobby(queue_id: i64) -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-lobby/v2/lobby",
- Some(json!({ "queueId": queue_id })),
- )
- .await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_start_matchmaking() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_post_raw(&client, "/lol-lobby/v2/lobby/matchmaking/search").await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_stop_matchmaking() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::DELETE,
- "/lol-lobby/v2/lobby/matchmaking/search",
- None,
- )
- .await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_leave_lobby() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::DELETE,
- "/lol-lobby/v2/lobby",
- None,
- )
- .await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_play_again() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_post_raw(&client, "/lol-lobby/v2/play-again").await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_champ_select_session() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_get_raw(&client, "/lol-champ-select/v1/session").await
-}
-
-#[tauri::command]
-pub async fn league_bench_swap(champion_id: i64) -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let path = format!("/lol-champ-select/v1/session/bench/swap/{}", champion_id);
- lcu_post_raw(&client, &path).await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_reroll() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_post_raw(&client, "/lol-champ-select/v1/session/my-selection/reroll").await?;
- Ok(())
-}
-
-/// Spends the reroll to widen the bench but keeps the champion the user already
-/// had: the roll is read before it happens, then swapped back from the bench.
-#[tauri::command]
-pub async fn league_reroll_keeping_champion() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let before = lcu_get_raw(&client, "/lol-champ-select/v1/current-champion")
- .await
- .ok()
- .and_then(|v| v.as_i64());
- lcu_post_raw(&client, "/lol-champ-select/v1/session/my-selection/reroll").await?;
- let Some(champion_id) = before.filter(|id| *id > 0) else {
- // Without knowing the previous champion there is nothing to restore, and
- // the reroll itself already went through.
- return Ok(json!({ "restored": false, "championId": Value::Null }));
- };
- let swapped = lcu_post_raw(
- &client,
- &format!("/lol-champ-select/v1/session/bench/swap/{}", champion_id),
- )
- .await;
- Ok(json!({
- "restored": swapped.is_ok(),
- "championId": champion_id,
- }))
-}
-
-#[tauri::command]
-pub async fn league_live_game() -> Result<Value, String> {
- ensure_enabled()?;
- let base = "https://127.0.0.1:2999/liveclientdata";
- let http = http_client()?;
- let stats = http
- .get(format!("{}/gamestats", base))
- .send()
- .await
- .map_err(|e| format!("live client not reachable: {}", e))?
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid live client response: {}", e))?;
- let players = http.get(format!("{}/playerlist", base)).send().await.ok();
- let players = match players {
- Some(r) => r.json::<Value>().await.unwrap_or(Value::Null),
- None => Value::Null,
- };
- let active = http
- .get(format!("{}/activeplayername", base))
- .send()
- .await
- .ok();
- let active = match active {
- Some(r) => r.json::<Value>().await.unwrap_or(Value::Null),
- None => Value::Null,
- };
- Ok(json!({ "stats": stats, "players": players, "activePlayer": active }))
-}
-
-fn player_identity(entry: &Value, is_ally: bool) -> Value {
- let game_name = entry
- .get("gameName")
- .and_then(Value::as_str)
- .filter(|s| !s.is_empty())
- .or_else(|| entry.get("summonerName").and_then(Value::as_str))
- .unwrap_or("");
- json!({
- "puuid": entry.get("puuid").and_then(Value::as_str).unwrap_or(""),
- "summonerId": entry.get("summonerId").and_then(Value::as_i64).unwrap_or(0),
- "gameName": game_name,
- "tagLine": entry.get("tagLine").and_then(Value::as_str).unwrap_or(""),
- "championId": entry.get("championId").and_then(Value::as_i64).unwrap_or(0),
- "cellId": entry.get("cellId").and_then(Value::as_i64),
- "isAlly": is_ally,
- "partyId": party_id(entry),
- })
-}
-
-/// The gameflow session tags every player with the party it queued in, which is
-/// the server's own grouping — far better than guessing from shared history.
-/// Champ select does not carry it, so it stays null there.
-fn party_id(entry: &Value) -> Value {
- match entry.get("teamParticipantId") {
- Some(Value::String(s)) if !s.is_empty() => json!(s),
- Some(Value::Number(n)) => json!(n.to_string()),
- _ => Value::Null,
- }
-}
-
-#[tauri::command]
-pub async fn league_game_players() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let phase = lcu_get_raw(&client, "/lol-gameflow/v1/gameflow-phase").await?;
- let phase = phase.as_str().unwrap_or("");
-
- let mut players: Vec<Value> = Vec::new();
-
- if phase == "ChampSelect" {
- let session = lcu_get_raw(&client, "/lol-champ-select/v1/session").await?;
- for (team_key, is_ally) in [("myTeam", true), ("theirTeam", false)] {
- if let Some(team) = session.get(team_key).and_then(Value::as_array) {
- for member in team {
- players.push(player_identity(member, is_ally));
- }
- }
- }
- } else {
- let session = lcu_get_raw(&client, "/lol-gameflow/v1/session").await?;
- let my_puuid = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner")
- .await
- .ok()
- .and_then(|s| s.get("puuid").and_then(Value::as_str).map(String::from))
- .unwrap_or_default();
- let game_data = session.get("gameData").cloned().unwrap_or(Value::Null);
- let team_one: Vec<Value> = game_data
- .get("teamOne")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- let team_two: Vec<Value> = game_data
- .get("teamTwo")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- let one_has_me = team_one
- .iter()
- .any(|m| m.get("puuid").and_then(Value::as_str) == Some(my_puuid.as_str()));
- for (team, mine) in [(team_one, one_has_me), (team_two, !one_has_me)] {
- for member in &team {
- players.push(player_identity(member, mine));
- }
- }
- }
-
- let mut resolved: Vec<Value> = Vec::new();
- let mut to_lookup: Vec<(usize, String, String)> = Vec::new();
- for (i, p) in players.iter().enumerate() {
- let puuid = p.get("puuid").and_then(Value::as_str).unwrap_or("");
- let name = p.get("gameName").and_then(Value::as_str).unwrap_or("");
- if puuid.is_empty() && name.contains('#') {
- let mut parts = name.splitn(2, '#');
- let game_name = parts.next().unwrap_or("").to_string();
- let tag = parts.next().unwrap_or("").to_string();
- to_lookup.push((i, game_name, tag));
- }
- resolved.push(p.clone());
- }
- if !to_lookup.is_empty() {
- let body: Vec<Value> = to_lookup
- .iter()
- .map(|(_, g, t)| json!({ "gameName": g, "tagLine": t }))
- .collect();
- if let Ok(found) = lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-summoner/v1/summoners/aliases",
- Some(Value::Array(body)),
- )
- .await
- {
- if let Some(arr) = found.as_array() {
- for (slot, (idx, g, _)) in to_lookup.iter().enumerate() {
- let hit = arr.get(slot).or_else(|| {
- arr.iter()
- .find(|s| s.get("gameName").and_then(Value::as_str) == Some(g.as_str()))
- });
- if let Some(s) = hit {
- if let Some(puuid) = s.get("puuid").and_then(Value::as_str) {
- resolved[*idx]["puuid"] = json!(puuid);
- }
- }
- }
- }
- }
- }
-
- let mut name_tasks = Vec::new();
- for (i, p) in resolved.iter().enumerate() {
- let puuid = p
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- let has_name = p
- .get("gameName")
- .and_then(Value::as_str)
- .map(|s| !s.is_empty())
- .unwrap_or(false);
- if puuid.is_empty() || has_name {
- continue;
- }
- let task_client = client.clone();
- name_tasks.push(tauri::async_runtime::spawn(async move {
- let path = format!("/lol-summoner/v2/summoners/puuid/{}", puuid);
- (i, lcu_get_raw(&task_client, &path).await.ok())
- }));
- }
- for task in name_tasks {
- if let Ok((i, Some(summoner))) = task.await {
- if let Some(name) = summoner.get("gameName").and_then(Value::as_str) {
- resolved[i]["gameName"] = json!(name);
- }
- if let Some(tag) = summoner.get("tagLine").and_then(Value::as_str) {
- resolved[i]["tagLine"] = json!(tag);
- }
- if let Some(level) = summoner.get("summonerLevel").and_then(Value::as_i64) {
- resolved[i]["summonerLevel"] = json!(level);
- }
- if let Some(icon) = summoner.get("profileIconId").and_then(Value::as_i64) {
- resolved[i]["profileIconId"] = json!(icon);
- }
- }
- }
-
- Ok(json!({ "phase": phase, "players": resolved }))
-}
-
-fn compute_history_stats(games: &[Value], puuid: &str) -> Value {
- let mut wins = 0usize;
- let mut kills = 0i64;
- let mut deaths = 0i64;
- let mut assists = 0i64;
- let mut streak_kind: Option<bool> = None;
- let mut streak_len = 0usize;
- let mut streak_done = false;
- let mut champ_games: std::collections::HashMap<i64, (usize, usize)> =
- std::collections::HashMap::new();
- let mut flash_on_d = 0usize;
- let mut flash_on_f = 0usize;
- let mut total_damage = 0.0f64;
- let mut total_gold = 0.0f64;
- let mut scored_games: Vec<stats::ScoredGame> = Vec::new();
-
- for game in games {
- let participant = game
- .get("participants")
- .and_then(Value::as_array)
- .and_then(|arr| {
- if arr.len() == 1 {
- arr.first()
- } else {
- let identities = game.get("participantIdentities").and_then(Value::as_array);
- let pid = identities.and_then(|ids| {
- ids.iter()
- .find(|i| {
- i.get("player")
- .and_then(|p| p.get("puuid"))
- .and_then(Value::as_str)
- == Some(puuid)
- })
- .and_then(|i| i.get("participantId").and_then(Value::as_i64))
- });
- match pid {
- Some(pid) => arr
- .iter()
- .find(|p| p.get("participantId").and_then(Value::as_i64) == Some(pid)),
- None => arr.first(),
- }
- }
- });
- let participant = match participant {
- Some(p) => p,
- None => continue,
- };
- let stats = participant.get("stats").cloned().unwrap_or(Value::Null);
- let win = stats.get("win").and_then(Value::as_bool).unwrap_or(false);
- if win {
- wins += 1;
- }
- let game_kills = stats.get("kills").and_then(Value::as_i64).unwrap_or(0);
- let game_deaths = stats.get("deaths").and_then(Value::as_i64).unwrap_or(0);
- let game_assists = stats.get("assists").and_then(Value::as_i64).unwrap_or(0);
- kills += game_kills;
- deaths += game_deaths;
- assists += game_assists;
- scored_games.push(stats::ScoredGame {
- queue_id: game.get("queueId").and_then(Value::as_i64).unwrap_or(-1),
- duration: game
- .get("gameDuration")
- .and_then(Value::as_i64)
- .unwrap_or(0),
- kills: game_kills,
- deaths: game_deaths,
- assists: game_assists,
- win,
- support: participant
- .get("timeline")
- .and_then(|t| t.get("lane"))
- .and_then(Value::as_str)
- == Some("NONE")
- || stats.get("role").and_then(Value::as_str) == Some("DUO_SUPPORT"),
- });
- total_damage += stats
- .get("totalDamageDealtToChampions")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- total_gold += stats
- .get("goldEarned")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- // Slot 1 is the D key, slot 2 the F key; Flash is spell id 4.
- match (
- participant.get("spell1Id").and_then(Value::as_i64),
- participant.get("spell2Id").and_then(Value::as_i64),
- ) {
- (Some(4), _) => flash_on_d += 1,
- (_, Some(4)) => flash_on_f += 1,
- _ => {}
- }
- if !streak_done {
- match streak_kind {
- None => {
- streak_kind = Some(win);
- streak_len = 1;
- }
- Some(k) if k == win => streak_len += 1,
- Some(_) => streak_done = true,
- }
- }
- let champ = participant
- .get("championId")
- .and_then(Value::as_i64)
- .unwrap_or(0);
- if champ > 0 {
- let e = champ_games.entry(champ).or_insert((0, 0));
- e.0 += 1;
- if win {
- e.1 += 1;
- }
- }
- }
-
- let total = games.len();
- let kda = if deaths > 0 {
- (kills + assists) as f64 / deaths as f64
- } else {
- (kills + assists) as f64
- };
- let mut top: Vec<(i64, usize, usize)> = champ_games
- .into_iter()
- .map(|(id, (g, w))| (id, g, w))
- .collect();
- top.sort_by(|a, b| b.1.cmp(&a.1));
- top.truncate(3);
-
- let winrate = if total > 0 {
- (wins as f64 / total as f64 * 100.0).round()
- } else {
- 0.0
- };
-
- let mut insights: Vec<&str> = Vec::new();
- if total >= 5 {
- if let Some(kind) = streak_kind {
- if streak_len >= 3 {
- insights.push(if kind { "hot_streak" } else { "cold_streak" });
- }
- }
- if total >= 10 && winrate >= 60.0 {
- insights.push("high_winrate");
- }
- if total >= 10 && winrate <= 40.0 {
- insights.push("low_winrate");
- }
- if let Some((_, g, _)) = top.first() {
- if *g * 2 >= total {
- insights.push("one_trick");
- }
- }
- if kda >= 4.0 {
- insights.push("high_kda");
- }
- if kda <= 1.5 && deaths > 0 {
- insights.push("low_kda");
- }
- if flash_on_d > 0 && flash_on_f > 0 {
- insights.push("flash_swap");
- }
- if total_gold > 0.0 {
- let ratio = total_damage / total_gold;
- if ratio >= 1.3 {
- insights.push("high_damage_efficiency");
- } else if ratio <= 0.65 {
- insights.push("low_damage_efficiency");
- }
- }
- }
-
- let damage_per_gold = if total_gold > 0.0 {
- json!(((total_damage / total_gold) * 100.0).round() / 100.0)
- } else {
- Value::Null
- };
-
- let (score, scored_count) = stats::player_score(&scored_games);
-
- json!({
- "games": total,
- "wins": wins,
- "winrate": winrate,
- "kda": (kda * 10.0).round() / 10.0,
- "score": score.map(|s| (s * 100.0).round() / 100.0),
- "scoredGames": scored_count,
- "streak": { "win": streak_kind.unwrap_or(false), "length": streak_len },
- "topChampions": top.iter().map(|(id, g, w)| json!({ "championId": id, "games": g, "wins": w })).collect::<Vec<_>>(),
- "insights": insights,
- "damagePerGold": damage_per_gold,
- })
-}
-
-#[tauri::command]
-pub async fn league_player_report(
- puuid: String,
- with_impact: Option<bool>,
-) -> Result<Value, String> {
- let with_impact = with_impact.unwrap_or(false);
- ensure_enabled()?;
- if puuid.is_empty() {
- return Err("empty puuid".to_string());
- }
- let client = get_client().await?;
-
- let ranked = lcu_get_raw(&client, &format!("/lol-ranked/v1/ranked-stats/{}", puuid))
- .await
- .unwrap_or(Value::Null);
- let solo = ranked
- .get("queueMap")
- .and_then(|q| q.get("RANKED_SOLO_5x5"))
- .cloned()
- .unwrap_or(Value::Null);
- let flex = ranked
- .get("queueMap")
- .and_then(|q| q.get("RANKED_FLEX_SR"))
- .cloned()
- .unwrap_or(Value::Null);
-
- // The summoner record states privacy explicitly; an empty history only
- // means the request came back thin, which is not the same thing.
- let summoner = lcu_get_raw(
- &client,
- &format!("/lol-summoner/v2/summoners/puuid/{}", puuid),
- )
- .await
- .unwrap_or(Value::Null);
- let is_private = summoner
- .get("privacy")
- .and_then(Value::as_str)
- .map(|p| p.eq_ignore_ascii_case("PRIVATE"))
- .unwrap_or(false);
-
- let history = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex=0&endIndex=19",
- puuid
- ),
- )
- .await;
- let mut history_failed = false;
- let mut games: Vec<Value> = match history {
- Ok(h) => h
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default(),
- Err(_) => {
- history_failed = true;
- Vec::new()
- }
- };
- // The local endpoint trims or refuses other players' histories; the
- // backend answers for anyone, so it fills the gap when allowed.
- let mut sgp_used = false;
- if games.is_empty() && !is_private {
- if let Ok(backend) = sgp::match_history_local(&client, &puuid, 0, 20).await {
- if !backend.is_empty() {
- games = backend;
- history_failed = false;
- sgp_used = true;
- }
- }
- }
- let history_ids: Vec<i64> = games
- .iter()
- .filter_map(|g| g.get("gameId").and_then(Value::as_i64))
- .collect();
- let history_empty = games.is_empty();
- let stats = if history_failed {
- json!({ "games": 0, "insights": [] })
- } else {
- compute_history_stats(&games, &puuid)
- };
-
- // Impact needs team totals, which only the full game detail carries. Five
- // extra requests per player would swamp the client during a scouting pass,
- // so it is only computed when the caller asks for it.
- let recent_ids: Vec<i64> = if with_impact {
- history_ids.into_iter().take(5).collect()
- } else {
- Vec::new()
- };
- let mut impact_tasks = Vec::new();
- for game_id in recent_ids {
- let task_client = client.clone();
- let task_puuid = puuid.clone();
- impact_tasks.push(tauri::async_runtime::spawn(async move {
- let detail = lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/games/{}", game_id),
- )
- .await
- .ok()?;
- impact_from_detail(&detail, &task_puuid)
- }));
- }
- let mut impacts: Vec<f64> = Vec::new();
- for task in impact_tasks {
- if let Ok(Some(score)) = task.await {
- impacts.push(score);
- }
- }
- let impact = if impacts.is_empty() {
- Value::Null
- } else {
- json!(((impacts.iter().sum::<f64>() / impacts.len() as f64) * 10.0).round() / 10.0)
- };
-
- let mastery = lcu_get_raw(
- &client,
- &format!("/lol-champion-mastery/v1/{}/champion-mastery", puuid),
- )
- .await
- .ok()
- .and_then(|m| {
- m.as_array().map(|arr| {
- arr.iter()
- .take(3)
- .map(|c| {
- json!({
- "championId": c.get("championId"),
- "championLevel": c.get("championLevel"),
- "championPoints": c.get("championPoints"),
- })
- })
- .collect::<Vec<_>>()
- })
- })
- .unwrap_or_default();
-
- Ok(json!({
- "puuid": puuid,
- "solo": solo,
- "flex": flex,
- "stats": stats,
- "mastery": mastery,
- "impact": impact,
- "impactGames": impacts.len(),
- "privateProfile": is_private,
- "historyUnavailable": history_failed || (history_empty && !is_private),
- "sgpUsed": sgp_used,
- "gameName": summoner.get("gameName"),
- "tagLine": summoner.get("tagLine"),
- "summonerLevel": summoner.get("summonerLevel"),
- "profileIconId": summoner.get("profileIconId"),
- }))
-}
-
-/// Extracts rank plus, when trustworthy, the season win/loss record.
-///
-/// For anyone other than the local player the client reports `losses = 0` and a
-/// career-long `wins` total, so a non-zero win count with zero losses is treated
-/// as "hidden" instead of a perfect record.
-fn ranked_entry_parts(entry: &Value) -> (Option<f64>, u32, u32) {
- let tier = entry.get("tier").and_then(Value::as_str).unwrap_or("");
- let division = entry.get("division").and_then(Value::as_str).unwrap_or("");
- let lp = entry
- .get("leaguePoints")
- .and_then(Value::as_i64)
- .unwrap_or(0)
- .max(0) as u32;
- let wins = entry
- .get("wins")
- .and_then(Value::as_i64)
- .unwrap_or(0)
- .max(0) as u32;
- let losses = entry
- .get("losses")
- .and_then(Value::as_i64)
- .unwrap_or(0)
- .max(0) as u32;
- let rank = stats::rank_rating(tier, division, lp);
- if losses == 0 && wins > 0 {
- return (rank, 0, 0);
- }
- (rank, wins, losses)
-}
-
-/// Full pre-game analysis: per-player strength, team win probability and the
-/// premade groups inferred from overlapping match histories.
-#[tauri::command]
-pub async fn league_match_analysis() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let roster = league_game_players().await?;
- let players: Vec<Value> = roster
- .get("players")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- if players.is_empty() {
- return Err("no players in the current game".to_string());
- }
-
- let mut tasks = Vec::new();
- for (index, player) in players.iter().enumerate() {
- let puuid = player
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- let task_client = client.clone();
- tasks.push(tauri::async_runtime::spawn(async move {
- if puuid.is_empty() {
- return (index, Value::Null, Vec::new());
- }
- let ranked = lcu_get_raw(
- &task_client,
- &format!("/lol-ranked/v1/ranked-stats/{}", puuid),
- )
- .await
- .unwrap_or(Value::Null);
- let history = lcu_get_raw(
- &task_client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex=0&endIndex=19",
- puuid
- ),
- )
- .await
- .unwrap_or(Value::Null);
- let game_ids: Vec<i64> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter_map(|g| g.get("gameId").and_then(Value::as_i64))
- .collect()
- })
- .unwrap_or_default();
- (
- index,
- json!({ "ranked": ranked, "history": history }),
- game_ids,
- )
- }));
- }
-
- let mut fetched: Vec<Value> = vec![Value::Null; players.len()];
- let mut histories: Vec<Vec<i64>> = vec![Vec::new(); players.len()];
- for task in tasks {
- if let Ok((index, data, ids)) = task.await {
- fetched[index] = data;
- histories[index] = ids;
- }
- }
-
- let mut ally_strengths = Vec::new();
- let mut enemy_strengths = Vec::new();
- let mut detail: Vec<Value> = Vec::new();
-
- for (index, player) in players.iter().enumerate() {
- let is_ally = player
- .get("isAlly")
- .and_then(Value::as_bool)
- .unwrap_or(false);
- let data = &fetched[index];
- let solo = data
- .get("ranked")
- .and_then(|r| r.get("queueMap"))
- .and_then(|q| q.get("RANKED_SOLO_5x5"))
- .cloned()
- .unwrap_or(Value::Null);
- let (rank, season_wins, season_losses) = if solo.is_null() {
- (None, 0, 0)
- } else {
- ranked_entry_parts(&solo)
- };
-
- let games: Vec<Value> = data
- .get("history")
- .and_then(|h| h.get("games"))
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- let mut recent_wins = 0u32;
- let mut recent_losses = 0u32;
- for game in &games {
- let win = game
- .get("participants")
- .and_then(Value::as_array)
- .and_then(|p| p.first())
- .and_then(|p| p.get("stats"))
- .and_then(|s| s.get("win"))
- .and_then(Value::as_bool)
- .unwrap_or(false);
- if win {
- recent_wins += 1;
- } else {
- recent_losses += 1;
- }
- }
-
- let strength =
- stats::player_strength(rank, season_wins, season_losses, recent_wins, recent_losses);
- if is_ally {
- ally_strengths.push(strength);
- } else {
- enemy_strengths.push(strength);
- }
-
- let season_shrunk = stats::shrunk_winrate(season_wins, season_losses, stats::PRIOR_GAMES);
- let (wilson_low, wilson_high) =
- stats::wilson_interval(season_wins, season_losses, stats::Z_90);
-
- detail.push(json!({
- "puuid": player.get("puuid"),
- "isAlly": is_ally,
- "rating": strength.rating.round(),
- "sigma": strength.sigma.round(),
- "known": strength.known,
- "rankRating": rank.map(|r| r.round()),
- "seasonWins": season_wins,
- "seasonLosses": season_losses,
- "seasonWinrate": if season_wins + season_losses > 0 {
- json!(((season_wins as f64 / (season_wins + season_losses) as f64) * 100.0).round())
- } else { Value::Null },
- "seasonAvailable": season_wins + season_losses > 0,
- "recentWinrate": if recent_wins + recent_losses > 0 {
- json!(((recent_wins as f64 / (recent_wins + recent_losses) as f64) * 100.0).round())
- } else { Value::Null },
- "shrunkWinrate": (season_shrunk * 1000.0).round() / 10.0,
- "wilsonLow": (wilson_low * 1000.0).round() / 10.0,
- "wilsonHigh": (wilson_high * 1000.0).round() / 10.0,
- "recentWins": recent_wins,
- "recentGames": recent_wins + recent_losses,
- }));
- }
-
- let win = stats::team_win_probability(&ally_strengths, &enemy_strengths);
-
- let party_ids: Vec<Option<String>> = players
- .iter()
- .map(|p| p.get("partyId").and_then(Value::as_str).map(str::to_string))
- .collect();
- let official = stats::party_groups(&party_ids);
- let from_party = !official.is_empty();
- let groups = if from_party {
- official
- } else {
- // Fallback for champ select, where the party id is absent: two players
- // who keep appearing in the same games are queueing together.
- let mut pairs: Vec<(usize, usize, u32)> = Vec::new();
- for i in 0..players.len() {
- for j in (i + 1)..players.len() {
- let a: HashSet<i64> = histories[i].iter().copied().collect();
- let shared = histories[j].iter().filter(|id| a.contains(id)).count() as u32;
- if shared > 0 {
- pairs.push((i, j, shared));
- }
- }
- }
- stats::premade_groups(players.len(), &pairs, 3)
- };
- let premades: Vec<Value> = groups
- .iter()
- .enumerate()
- .map(|(gi, group)| {
- json!({
- "label": char::from(b'A' + (gi.min(25) as u8)).to_string(),
- "puuids": group
- .iter()
- .filter_map(|i| players[*i].get("puuid").cloned())
- .collect::<Vec<_>>(),
- })
- })
- .collect();
-
- Ok(json!({
- "winProbability": (win.probability * 1000.0).round() / 10.0,
- "winLow": (win.low * 1000.0).round() / 10.0,
- "winHigh": (win.high * 1000.0).round() / 10.0,
- "ratingGap": win.rating_gap.round(),
- "knownPlayers": win.known_players,
- "totalPlayers": win.total_players,
- "players": detail,
- "premades": premades,
- "premadeSource": if from_party { "party" } else { "history" },
- }))
-}
-
-/// Build reference for a champion in a position: skill order, items by phase,
-/// summoner spells and counters, from the same public op.gg API the tier list
-/// uses. Presented as reference, never applied automatically.
-#[tauri::command]
-pub async fn league_champion_meta(
- champion_id: i64,
- position: Option<String>,
- region: Option<String>,
- tier: Option<String>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- let position = position.unwrap_or_else(|| "mid".to_string()).to_lowercase();
- let region = region.unwrap_or_else(|| "br".to_string());
- let bracket = tier.unwrap_or_else(|| "emerald_plus".to_string());
- if champion_id <= 0
- || !position.chars().all(|c| c.is_ascii_alphabetic())
- || !region.chars().all(|c| c.is_ascii_alphanumeric())
- || !bracket
- .chars()
- .all(|c| c.is_ascii_alphanumeric() || c == '_')
- {
- return Err("invalid champion, position, region or tier".to_string());
- }
- let url = format!(
- "https://lol-api-champion.op.gg/api/{}/champions/ranked/{}/{}?tier={}",
- region, champion_id, position, bracket
- );
- let http = reqwest::Client::builder()
- .timeout(std::time::Duration::from_secs(20))
- .user_agent("OmniGet")
- .build()
- .map_err(|e| e.to_string())?;
- let resp = http
- .get(&url)
- .send()
- .await
- .map_err(|e| format!("build reference unavailable: {}", e))?;
- if !resp.status().is_success() {
- return Err(format!(
- "build reference returned {}",
- resp.status().as_u16()
- ));
- }
- let body = resp
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid build reference response: {}", e))?;
- let data = body.get("data").unwrap_or(&body);
-
- let array = |key: &str| -> Vec<Value> {
- data.get(key)
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default()
- };
- let phase = |key: &str| -> Value {
- let entries = array(key);
- let picked = meta::most_played(&entries);
- json!({
- "ids": meta::id_list(picked),
- "winrate": meta::variant_winrate(picked),
- })
- };
-
- let skills = array("skills");
- let order = meta::skill_order(&skills);
-
- Ok(json!({
- "championId": champion_id,
- "position": position,
- "source": "op.gg",
- "skillOrder": order,
- "skillPriority": meta::first_levels(&order, 3),
- "starterItems": phase("starter_items"),
- "coreItems": phase("core_items"),
- "boots": phase("boots"),
- "lastItems": phase("last_items"),
- "spells": phase("summoner_spells"),
- "counters": meta::counters(data),
- }))
-}
-
-/// Sets the summoner icon. Any owned icon id works; the client rejects ids the
-/// account does not own, and that error is surfaced as-is.
-#[tauri::command]
-pub async fn league_set_icon(icon_id: i64) -> Result<Value, String> {
- ensure_enabled()?;
- if icon_id < 0 {
- return Err("invalid icon".to_string());
- }
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::PUT,
- "/lol-summoner/v1/current-summoner/icon",
- Some(json!({ "profileIconId": icon_id })),
- )
- .await
-}
-
-/// Sets the splash art behind the profile, chosen from a skin the account owns.
-#[tauri::command]
-pub async fn league_set_profile_background(skin_id: i64) -> Result<Value, String> {
- ensure_enabled()?;
- if skin_id <= 0 {
- return Err("invalid skin".to_string());
- }
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-summoner/v1/current-summoner/summoner-profile",
- Some(json!({ "key": "backgroundSkinId", "value": skin_id })),
- )
- .await
-}
-
-/// Chat availability and status message. Only the fields the user changed are
-/// touched: the payload is read first and patched, because a full replacement
-/// wipes the presence data the client keeps there.
-#[tauri::command]
-pub async fn league_set_status(
- availability: Option<String>,
- message: Option<String>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- if let Some(availability) = availability.as_deref() {
- if !matches!(availability, "chat" | "away" | "dnd" | "offline" | "mobile") {
- return Err("invalid availability".to_string());
- }
- }
- if message.as_deref().map(|m| m.chars().count()).unwrap_or(0) > profile::STATUS_MAX_CHARS {
- return Err("status message too long".to_string());
- }
- let client = get_client().await?;
- let mut me = lcu_get_raw(&client, "/lol-chat/v1/me").await?;
- if let Some(availability) = availability {
- me["availability"] = json!(availability);
- }
- if let Some(message) = message {
- me["statusMessage"] = json!(message);
- }
- lcu_send(&client, reqwest::Method::PUT, "/lol-chat/v1/me", Some(me)).await
-}
-
-/// Skins the account owns for a champion, so the background picker offers only
-/// what can actually be set.
-#[tauri::command]
-pub async fn league_owned_skins(champion_id: i64) -> Result<Value, String> {
- ensure_enabled()?;
- if champion_id <= 0 {
- return Err("invalid champion".to_string());
- }
- let client = get_client().await?;
- let champion = lcu_get_raw(
- &client,
- &format!("/lol-champions/v1/inventories/{}/champions", champion_id),
- )
- .await
- .unwrap_or(Value::Null);
- let skins: Vec<Value> = champion
- .get("skins")
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter(|s| {
- s.get("ownership")
- .and_then(|o| o.get("owned"))
- .and_then(Value::as_bool)
- .unwrap_or(false)
- })
- .filter_map(|s| {
- Some(json!({
- "id": s.get("id").and_then(Value::as_i64)?,
- "name": s.get("name").and_then(Value::as_str).unwrap_or(""),
- }))
- })
- .collect()
- })
- .unwrap_or_default();
- Ok(json!({ "skins": skins }))
-}
-
-/// Role preferences for the next queue. The client takes both slots at once, and
-/// the second may be empty ("FILL" is expressed as an unset second choice).
-#[tauri::command]
-pub async fn league_set_positions(first: String, second: Option<String>) -> Result<Value, String> {
- ensure_enabled()?;
- const ROLES: [&str; 6] = ["TOP", "JUNGLE", "MIDDLE", "BOTTOM", "UTILITY", "FILL"];
- let second = second.unwrap_or_else(|| "FILL".to_string());
- if !ROLES.contains(&first.as_str()) || !ROLES.contains(&second.as_str()) {
- return Err("invalid position".to_string());
- }
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::PUT,
- "/lol-lobby/v2/lobby/members/localMember/position-preferences",
- Some(json!({ "firstPreference": first, "secondPreference": second })),
- )
- .await
-}
-
-/// End-of-game summary the client shows on its own screen, useful when that
-/// screen was dismissed too fast.
-#[tauri::command]
-pub async fn league_end_of_game_stats() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- lcu_get_raw(&client, "/lol-end-of-game/v1/eog-stats-block").await
-}
-
-/// Where the game is installed, as far as the running process reveals. Null when
-/// the client is not running or the path could not be told.
-#[tauri::command]
-pub async fn league_install_dir() -> Result<Value, String> {
- ensure_enabled()?;
- let dir = locator::install_dir().await;
- Ok(json!({ "path": dir.map(|p| p.to_string_lossy().to_string()) }))
-}
-
-/// Full detail of one match: every participant with runes, items, spells and the
-/// long tail of stats the client keeps but its own end-of-game screen hides,
-/// plus the puuid needed to look a player up afterwards.
-#[tauri::command]
-pub async fn league_match_detail(game_id: i64) -> Result<Value, String> {
- ensure_enabled()?;
- if game_id <= 0 {
- return Err("invalid game".to_string());
- }
- let client = get_client().await?;
- let detail = lcu_get_raw(&client, &format!("/lol-match-history/v1/games/{}", game_id)).await?;
-
- let identities: Vec<Value> = detail
- .get("participantIdentities")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- let identity_of = |participant_id: i64| -> Option<Value> {
- identities
- .iter()
- .find(|i| i.get("participantId").and_then(Value::as_i64) == Some(participant_id))
- .and_then(|i| i.get("player").cloned())
- };
-
- let participants: Vec<Value> = detail
- .get("participants")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default()
- .iter()
- .map(|p| {
- let stats = p.get("stats").cloned().unwrap_or(Value::Null);
- let timeline = p.get("timeline").cloned().unwrap_or(Value::Null);
- let participant_id = p.get("participantId").and_then(Value::as_i64).unwrap_or(0);
- let player = identity_of(participant_id).unwrap_or(Value::Null);
- let num = |key: &str| -> i64 { stats.get(key).and_then(Value::as_i64).unwrap_or(0) };
-
- let mut row = serde_json::Map::new();
- row.insert("participantId".into(), json!(participant_id));
- row.insert(
- "teamId".into(),
- json!(p.get("teamId").and_then(Value::as_i64).unwrap_or(0)),
- );
- row.insert(
- "championId".into(),
- json!(p.get("championId").and_then(Value::as_i64).unwrap_or(0)),
- );
- row.insert(
- "puuid".into(),
- json!(player.get("puuid").and_then(Value::as_str).unwrap_or("")),
- );
- row.insert(
- "gameName".into(),
- json!(player
- .get("gameName")
- .and_then(Value::as_str)
- .filter(|s| !s.is_empty())
- .or_else(|| player.get("summonerName").and_then(Value::as_str))
- .unwrap_or("")),
- );
- row.insert(
- "tagLine".into(),
- json!(player.get("tagLine").and_then(Value::as_str).unwrap_or("")),
- );
- row.insert(
- "win".into(),
- json!(stats.get("win").and_then(Value::as_bool).unwrap_or(false)),
- );
- row.insert(
- "spells".into(),
- json!([
- p.get("spell1Id").and_then(Value::as_i64).unwrap_or(0),
- p.get("spell2Id").and_then(Value::as_i64).unwrap_or(0),
- ]),
- );
- row.insert(
- "items".into(),
- json!((0..7)
- .map(|i| num(&format!("item{}", i)))
- .collect::<Vec<_>>()),
- );
- row.insert(
- "runes".into(),
- json!({
- "primaryStyle": num("perkPrimaryStyle"),
- "subStyle": num("perkSubStyle"),
- "perks": (0..6).map(|i| num(&format!("perk{}", i))).collect::<Vec<_>>(),
- "statMods": [num("statPerk0"), num("statPerk1"), num("statPerk2")],
- }),
- );
- for (key, value) in [
- ("kills", num("kills")),
- ("deaths", num("deaths")),
- ("assists", num("assists")),
- ("level", num("champLevel")),
- (
- "cs",
- num("totalMinionsKilled") + num("neutralMinionsKilled"),
- ),
- ("gold", num("goldEarned")),
- ("damageToChampions", num("totalDamageDealtToChampions")),
- ("physicalDamage", num("physicalDamageDealtToChampions")),
- ("magicDamage", num("magicDamageDealtToChampions")),
- ("trueDamage", num("trueDamageDealtToChampions")),
- ("damageTaken", num("totalDamageTaken")),
- ("damageMitigated", num("damageSelfMitigated")),
- ("damageToObjectives", num("damageDealtToObjectives")),
- ("damageToTurrets", num("damageDealtToTurrets")),
- ("healing", num("totalHeal")),
- ("shielding", num("totalDamageShieldedOnTeammates")),
- ("visionScore", num("visionScore")),
- ("wardsPlaced", num("wardsPlaced")),
- ("wardsKilled", num("wardsKilled")),
- ("controlWards", num("visionWardsBoughtInGame")),
- ("ccTime", num("timeCCingOthers")),
- ("largestSpree", num("largestKillingSpree")),
- ("largestMultiKill", num("largestMultiKill")),
- ("doubleKills", num("doubleKills")),
- ("tripleKills", num("tripleKills")),
- ("quadraKills", num("quadraKills")),
- ("pentaKills", num("pentaKills")),
- ("turretKills", num("turretKills")),
- ("inhibitorKills", num("inhibitorKills")),
- ] {
- row.insert(key.into(), json!(value));
- }
- row.insert(
- "firstBlood".into(),
- json!(stats
- .get("firstBloodKill")
- .and_then(Value::as_bool)
- .unwrap_or(false)),
- );
- row.insert(
- "firstTower".into(),
- json!(stats
- .get("firstTowerKill")
- .and_then(Value::as_bool)
- .unwrap_or(false)),
- );
- row.insert(
- "lane".into(),
- json!(timeline.get("lane").and_then(Value::as_str).unwrap_or("")),
- );
- row.insert(
- "role".into(),
- json!(timeline.get("role").and_then(Value::as_str).unwrap_or("")),
- );
- Value::Object(row)
- })
- .collect();
-
- Ok(json!({
- "gameId": game_id,
- "gameMode": detail.get("gameMode").and_then(Value::as_str).unwrap_or(""),
- "queueId": detail.get("queueId").and_then(Value::as_i64).unwrap_or(0),
- "gameCreation": detail.get("gameCreation").and_then(Value::as_i64).unwrap_or(0),
- "gameDuration": detail.get("gameDuration").and_then(Value::as_i64).unwrap_or(0),
- "teams": detail.get("teams").cloned().unwrap_or(Value::Null),
- "participants": participants,
- }))
-}
-
-/// Recent games of any player by puuid, for looking someone up straight from a
-/// scoreboard instead of retyping their name.
-#[tauri::command]
-pub async fn league_player_history(
- puuid: String,
- beg_index: Option<i64>,
- end_index: Option<i64>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- if puuid.is_empty() || !puuid.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') {
- return Err("invalid player".to_string());
- }
- let beg = beg_index.unwrap_or(0).max(0);
- let end = end_index.unwrap_or(beg + 9).max(beg);
- let client = get_client().await?;
- let local = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex={}&endIndex={}",
- puuid, beg, end
- ),
- )
- .await;
- let local_games = local
- .as_ref()
- .ok()
- .and_then(|h| {
- h.get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- })
- .map(|a| a.len())
- .unwrap_or(0);
- if local_games > 0 {
- return local;
- }
- // Nothing locally: the backend may still have it.
- let count = (end - beg + 1).clamp(1, 50) as u32;
- match sgp::match_history_local(&client, &puuid, beg as u32, count).await {
- Ok(games) if !games.is_empty() => {
- Ok(json!({ "games": { "games": games }, "source": "sgp" }))
- }
- _ => local,
- }
-}
-
-/// Perk metadata (name and icon) so runes can be rendered without hardcoding
-/// paths. Cached by the patch-static rule.
-#[tauri::command]
-pub async fn league_perks() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let perks = lcu_get_raw(&client, "/lol-perks/v1/perks").await?;
- let list: Vec<Value> = perks
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter_map(|p| {
- Some(json!({
- "id": p.get("id").and_then(Value::as_i64)?,
- "name": p.get("name").and_then(Value::as_str).unwrap_or(""),
- "iconPath": p.get("iconPath").and_then(Value::as_str).unwrap_or(""),
- }))
- })
- .collect()
- })
- .unwrap_or_default();
- Ok(json!({ "perks": list }))
-}
-
-/// Objective respawn estimates and a readable feed of what just happened,
-/// derived from the in-game event log.
-#[tauri::command]
-pub async fn league_live_events() -> Result<Value, String> {
- ensure_enabled()?;
- let http = http_client()?;
- let base = "https://127.0.0.1:2999/liveclientdata";
- let raw = http
- .get(format!("{}/eventdata", base))
- .send()
- .await
- .map_err(|e| format!("live client not reachable: {}", e))?
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid live client response: {}", e))?;
- let game_time = http
- .get(format!("{}/gamestats", base))
- .send()
- .await
- .ok()
- .and_then(|r| r.error_for_status().ok());
- let game_time = match game_time {
- Some(response) => response
- .json::<Value>()
- .await
- .ok()
- .and_then(|v| v.get("gameTime").and_then(Value::as_f64))
- .unwrap_or(0.0),
- None => 0.0,
- };
- let events: Vec<Value> = raw
- .get("Events")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
-
- Ok(json!({
- "gameTime": game_time,
- "objectives": live::objective_timers(&events, game_time),
- "events": live::game_events(&events, 12),
- }))
-}
-
-/// Live economy snapshot: gold carried in items, CS and level for every player,
-/// plus the difference against the opponent in the same position.
-#[tauri::command]
-pub async fn league_live_metrics() -> Result<Value, String> {
- ensure_enabled()?;
- let http = http_client()?;
- let base = "https://127.0.0.1:2999/liveclientdata";
- let stats_value = http
- .get(format!("{}/gamestats", base))
- .send()
- .await
- .map_err(|e| format!("live client not reachable: {}", e))?
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid live client response: {}", e))?;
- let players = http
- .get(format!("{}/playerlist", base))
- .send()
- .await
- .map_err(|e| format!("live client not reachable: {}", e))?
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid live client response: {}", e))?;
- let active = http
- .get(format!("{}/activeplayername", base))
- .send()
- .await
- .ok();
- let active_name = match active {
- Some(r) => r
- .json::<Value>()
- .await
- .ok()
- .and_then(|v| v.as_str().map(String::from))
- .unwrap_or_default(),
- None => String::new(),
- };
-
- let seconds = stats_value
- .get("gameTime")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- let list = players.as_array().cloned().unwrap_or_default();
-
- let mut rows: Vec<Value> = Vec::new();
- for p in &list {
- let scores = p.get("scores").cloned().unwrap_or(Value::Null);
- let cs = scores
- .get("creepScore")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- let prices: Vec<(u32, u32)> = p
- .get("items")
- .and_then(Value::as_array)
- .map(|items| {
- items
- .iter()
- .map(|i| {
- (
- i.get("price").and_then(Value::as_i64).unwrap_or(0).max(0) as u32,
- i.get("count").and_then(Value::as_i64).unwrap_or(1).max(0) as u32,
- )
- })
- .collect()
- })
- .unwrap_or_default();
- let item_gold = stats::items_gold(&prices);
- let riot_id = p
- .get("riotId")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- rows.push(json!({
- "riotId": riot_id,
- "championName": p.get("championName"),
- "rawChampionName": p.get("rawChampionName"),
- "team": p.get("team"),
- "position": p.get("position"),
- "level": p.get("level"),
- "isDead": p.get("isDead"),
- "respawnTimer": p.get("respawnTimer"),
- "kills": scores.get("kills"),
- "deaths": scores.get("deaths"),
- "assists": scores.get("assists"),
- "cs": cs,
- "csPerMin": (stats::per_minute(cs, seconds) * 10.0).round() / 10.0,
- "visionScore": scores.get("wardScore"),
- "itemGold": item_gold,
- "goldPerMin": (stats::per_minute(item_gold as f64, seconds)).round(),
- "kda": (stats::kda(
- scores.get("kills").and_then(Value::as_i64).unwrap_or(0).max(0) as u32,
- scores.get("deaths").and_then(Value::as_i64).unwrap_or(0).max(0) as u32,
- scores.get("assists").and_then(Value::as_i64).unwrap_or(0).max(0) as u32,
- ) * 100.0).round() / 100.0,
- "isSelf": !active_name.is_empty() && riot_id == active_name,
- }));
- }
-
- // Match each player against the opponent holding the same position.
- let mut enriched: Vec<Value> = Vec::new();
- for row in &rows {
- let position = row.get("position").and_then(Value::as_str).unwrap_or("");
- let team = row.get("team").and_then(Value::as_str).unwrap_or("");
- let opponent = rows.iter().find(|other| {
- other.get("position").and_then(Value::as_str) == Some(position)
- && other.get("team").and_then(Value::as_str) != Some(team)
- && !position.is_empty()
- });
- let mut row = row.clone();
- if let Some(o) = opponent {
- let gold = row.get("itemGold").and_then(Value::as_i64).unwrap_or(0);
- let ogold = o.get("itemGold").and_then(Value::as_i64).unwrap_or(0);
- let cs = row.get("cs").and_then(Value::as_f64).unwrap_or(0.0);
- let ocs = o.get("cs").and_then(Value::as_f64).unwrap_or(0.0);
- let level = row.get("level").and_then(Value::as_i64).unwrap_or(0);
- let olevel = o.get("level").and_then(Value::as_i64).unwrap_or(0);
- row["goldDiff"] = json!(gold - ogold);
- row["csDiff"] = json!(cs - ocs);
- row["levelDiff"] = json!(level - olevel);
- row["opponent"] = o.get("championName").cloned().unwrap_or(Value::Null);
- }
- enriched.push(row);
- }
-
- let team_gold = |team: &str| -> i64 {
- enriched
- .iter()
- .filter(|r| r.get("team").and_then(Value::as_str) == Some(team))
- .filter_map(|r| r.get("itemGold").and_then(Value::as_i64))
- .sum()
- };
-
- Ok(json!({
- "gameTime": seconds.round(),
- "players": enriched,
- "teamGold": { "ORDER": team_gold("ORDER"), "CHAOS": team_gold("CHAOS") },
- "teamGoldDiff": team_gold("ORDER") - team_gold("CHAOS"),
- }))
-}
-
-/// Computes the composite impact score for one player in one finished game.
-fn impact_from_detail(detail: &Value, puuid: &str) -> Option<f64> {
- let identities = detail.get("participantIdentities")?.as_array()?;
- let participants = detail.get("participants")?.as_array()?;
- let pid = identities
- .iter()
- .find(|i| {
- i.get("player")
- .and_then(|p| p.get("puuid"))
- .and_then(Value::as_str)
- == Some(puuid)
- })
- .and_then(|i| i.get("participantId").and_then(Value::as_i64))?;
- let me = participants
- .iter()
- .find(|p| p.get("participantId").and_then(Value::as_i64) == Some(pid))?;
- let team_id = me.get("teamId").and_then(Value::as_i64)?;
- let team: Vec<&Value> = participants
- .iter()
- .filter(|p| p.get("teamId").and_then(Value::as_i64) == Some(team_id))
- .collect();
- if team.is_empty() {
- return None;
- }
-
- let stat = |p: &Value, key: &str| -> f64 {
- p.get("stats")
- .and_then(|s| s.get(key))
- .and_then(Value::as_f64)
- .unwrap_or(0.0)
- };
- let sum = |key: &str| -> f64 { team.iter().map(|p| stat(p, key)).sum() };
- let count = |p: &Value, key: &str| -> u32 { stat(p, key).max(0.0) as u32 };
-
- let input = stats::ImpactInput {
- kills: count(me, "kills"),
- deaths: count(me, "deaths"),
- assists: count(me, "assists"),
- team_kills: sum("kills").max(0.0) as u32,
- damage_to_champions: stat(me, "totalDamageDealtToChampions"),
- team_damage: sum("totalDamageDealtToChampions"),
- damage_taken: stat(me, "totalDamageTaken"),
- team_damage_taken: sum("totalDamageTaken"),
- gold: stat(me, "goldEarned"),
- team_gold: sum("goldEarned"),
- cs: stat(me, "totalMinionsKilled") + stat(me, "neutralMinionsKilled"),
- vision_score: stat(me, "visionScore"),
- team_vision: sum("visionScore"),
- duration_seconds: detail
- .get("gameDuration")
- .and_then(Value::as_f64)
- .unwrap_or(0.0),
- team_size: team.len(),
- };
- Some(stats::impact_score(&input))
-}
-
-/// Aggregates a player's champion records the way a profile page shows them.
-fn champion_records_from_history(games: &[Value]) -> Vec<analysis::ChampionRecord> {
- let mut map: std::collections::HashMap<i64, analysis::ChampionRecord> =
- std::collections::HashMap::new();
- for game in games {
- let participant = match game
- .get("participants")
- .and_then(Value::as_array)
- .and_then(|a| a.first())
- {
- Some(p) => p,
- None => continue,
- };
- let champion_id = participant
- .get("championId")
- .and_then(Value::as_i64)
- .unwrap_or(0);
- if champion_id <= 0 {
- continue;
- }
- let s = participant.get("stats").cloned().unwrap_or(Value::Null);
- let num = |key: &str| s.get(key).and_then(Value::as_i64).unwrap_or(0).max(0) as u32;
- let entry = map
- .entry(champion_id)
- .or_insert_with(|| analysis::ChampionRecord {
- champion_id,
- ..Default::default()
- });
- entry.games += 1;
- if s.get("win").and_then(Value::as_bool).unwrap_or(false) {
- entry.wins += 1;
- }
- entry.kills += num("kills");
- entry.deaths += num("deaths");
- entry.assists += num("assists");
- entry.cs += (num("totalMinionsKilled") + num("neutralMinionsKilled")) as f64;
- entry.seconds += game
- .get("gameDuration")
- .and_then(Value::as_f64)
- .unwrap_or(0.0);
- }
- analysis::rank_champion_records(map.into_values().collect(), 2)
-}
-
-fn champion_records_json(records: &[analysis::ChampionRecord]) -> Vec<Value> {
- records
- .iter()
- .map(|r| {
- json!({
- "championId": r.champion_id,
- "games": r.games,
- "wins": r.wins,
- "winrate": (r.winrate() * 1000.0).round() / 10.0,
- "kda": (r.kda() * 100.0).round() / 100.0,
- "csPerMin": (r.cs_per_min() * 10.0).round() / 10.0,
- "kills": r.kills,
- "deaths": r.deaths,
- "assists": r.assists,
- })
- })
- .collect()
-}
-
-/// Timeline-derived aggressiveness markers: kills taken alone and deaths
-/// before the 15-minute mark, averaged over recent Summoner's Rift games.
-async fn deep_timeline_stats(client: &LcuClient, puuid: &str, games: &[Value]) -> Value {
- let ids: Vec<i64> = games
- .iter()
- .filter(|g| g.get("mapId").and_then(Value::as_i64) == Some(11))
- .filter_map(|g| g.get("gameId").and_then(Value::as_i64))
- .take(8)
- .collect();
-
- let mut tasks = Vec::new();
- for game_id in ids {
- let task_client = client.clone();
- let task_puuid = puuid.to_string();
- tasks.push(tauri::async_runtime::spawn(async move {
- let detail = lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/games/{}", game_id),
- )
- .await
- .ok()?;
- let timeline = lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/game-timelines/{}", game_id),
- )
- .await
- .ok()?;
- let pid = detail
- .get("participantIdentities")
- .and_then(Value::as_array)?
- .iter()
- .find(|i| {
- i.get("player")
- .and_then(|p| p.get("puuid"))
- .and_then(Value::as_str)
- == Some(task_puuid.as_str())
- })
- .and_then(|i| i.get("participantId").and_then(Value::as_i64))?;
-
- let mut solo_kills = 0u32;
- let mut early_deaths = 0u32;
- for frame in timeline.get("frames").and_then(Value::as_array)? {
- for event in frame
- .get("events")
- .and_then(Value::as_array)
- .unwrap_or(&Vec::new())
- {
- if event.get("type").and_then(Value::as_str) != Some("CHAMPION_KILL") {
- continue;
- }
- let ts = event.get("timestamp").and_then(Value::as_i64).unwrap_or(0);
- if event.get("killerId").and_then(Value::as_i64) == Some(pid) {
- let assisted = event
- .get("assistingParticipantIds")
- .and_then(Value::as_array)
- .map(|a| !a.is_empty())
- .unwrap_or(false);
- if !assisted {
- solo_kills += 1;
- }
- }
- if event.get("victimId").and_then(Value::as_i64) == Some(pid) && ts <= 900_000 {
- early_deaths += 1;
- }
- }
- }
- Some((solo_kills, early_deaths))
- }));
- }
-
- let mut analysed = 0u32;
- let mut solo_total = 0u32;
- let mut early_total = 0u32;
- for task in tasks {
- if let Ok(Some((solo, early))) = task.await {
- analysed += 1;
- solo_total += solo;
- early_total += early;
- }
- }
-
- if analysed == 0 {
- return Value::Null;
- }
- json!({
- "analysedGames": analysed,
- "soloKillsPerGame": ((solo_total as f64 / analysed as f64) * 10.0).round() / 10.0,
- "earlyDeathsPerGame": ((early_total as f64 / analysed as f64) * 10.0).round() / 10.0,
- })
-}
-
-/// Resolves a Riot ID to a full profile: rank, level, champion records and
-/// mastery, in the shape a profile page needs.
-#[tauri::command]
-pub async fn league_search_player(game_name: String, tag_line: String) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let name = game_name.trim().to_string();
- let tag = tag_line.trim().trim_start_matches('#').to_string();
- if name.is_empty() {
- return Err("empty name".to_string());
- }
-
- let found = lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-summoner/v1/summoners/aliases",
- Some(json!([{ "gameName": name, "tagLine": tag }])),
- )
- .await?;
- let summoner = found
- .as_array()
- .and_then(|a| a.first())
- .cloned()
- .ok_or_else(|| "player not found".to_string())?;
- let puuid = summoner
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- if puuid.is_empty() {
- return Err("player not found".to_string());
- }
-
- let profile = league_player_report(puuid.clone(), Some(true)).await?;
- let history = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex=0&endIndex=19",
- puuid
- ),
- )
- .await
- .unwrap_or(Value::Null);
- let mut games: Vec<Value> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- if games.is_empty() {
- if let Ok(backend) = sgp::match_history_local(&client, &puuid, 0, 20).await {
- games = backend;
- }
- }
- let records = champion_records_from_history(&games);
- let deep = deep_timeline_stats(&client, &puuid, &games).await;
-
- Ok(json!({
- "summoner": summoner,
- "report": profile,
- "champions": champion_records_json(&records),
- "games": games,
- "deep": deep,
- }))
-}
-
-/// Teammates the player wins the most with, ranked by shrunk win rate.
-#[tauri::command]
-pub async fn league_duos(sample: Option<u32>) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let me = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await?;
- let my_puuid = me
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- if my_puuid.is_empty() {
- return Err("no puuid".to_string());
- }
- let count = sample.unwrap_or(20).clamp(5, 50);
- let history = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex=0&endIndex={}",
- my_puuid,
- count.saturating_sub(1)
- ),
- )
- .await?;
- let games: Vec<Value> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
-
- let mut tasks = Vec::new();
- for game in &games {
- let game_id = match game.get("gameId").and_then(Value::as_i64) {
- Some(id) => id,
- None => continue,
- };
- let task_client = client.clone();
- tasks.push(tauri::async_runtime::spawn(async move {
- lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/games/{}", game_id),
- )
- .await
- .ok()
- }));
- }
-
- let mut tally: std::collections::HashMap<String, (u32, u32)> = std::collections::HashMap::new();
- let mut names: std::collections::HashMap<String, Value> = std::collections::HashMap::new();
- let mut analysed = 0u32;
-
- for task in tasks {
- let detail = match task.await {
- Ok(Some(d)) => d,
- _ => continue,
- };
- let identities: Vec<Value> = detail
- .get("participantIdentities")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- let participants: Vec<Value> = detail
- .get("participants")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- if identities.len() < 2 || participants.is_empty() {
- continue;
- }
- let pid_of = |puuid: &str| -> Option<i64> {
- identities
- .iter()
- .find(|i| {
- i.get("player")
- .and_then(|p| p.get("puuid"))
- .and_then(Value::as_str)
- == Some(puuid)
- })
- .and_then(|i| i.get("participantId").and_then(Value::as_i64))
- };
- let my_pid = match pid_of(&my_puuid) {
- Some(p) => p,
- None => continue,
- };
- let team_of = |pid: i64| -> Option<i64> {
- participants
- .iter()
- .find(|p| p.get("participantId").and_then(Value::as_i64) == Some(pid))
- .and_then(|p| p.get("teamId").and_then(Value::as_i64))
- };
- let my_team = match team_of(my_pid) {
- Some(t) => t,
- None => continue,
- };
- let won = participants
- .iter()
- .find(|p| p.get("participantId").and_then(Value::as_i64) == Some(my_pid))
- .and_then(|p| p.get("stats"))
- .and_then(|s| s.get("win"))
- .and_then(Value::as_bool)
- .unwrap_or(false);
- analysed += 1;
-
- for identity in &identities {
- let player = identity.get("player").cloned().unwrap_or(Value::Null);
- let puuid = player.get("puuid").and_then(Value::as_str).unwrap_or("");
- if puuid.is_empty() || puuid == my_puuid {
- continue;
- }
- let pid = identity
- .get("participantId")
- .and_then(Value::as_i64)
- .unwrap_or(-1);
- if team_of(pid) != Some(my_team) {
- continue;
- }
- let entry = tally.entry(puuid.to_string()).or_insert((0, 0));
- entry.0 += 1;
- if won {
- entry.1 += 1;
- }
- names.entry(puuid.to_string()).or_insert(player);
- }
- }
-
- let duos: Vec<analysis::DuoRecord> = tally
- .iter()
- .map(|(puuid, (games, wins))| analysis::DuoRecord {
- puuid: puuid.clone(),
- games: *games,
- wins: *wins,
- })
- .collect();
- let ranked = analysis::rank_duos(duos, 2);
-
- let list: Vec<Value> = ranked
- .iter()
- .take(15)
- .map(|d| {
- let player = names.get(&d.puuid).cloned().unwrap_or(Value::Null);
- json!({
- "puuid": d.puuid,
- "gameName": player.get("gameName").or_else(|| player.get("summonerName")),
- "tagLine": player.get("tagLine"),
- "games": d.games,
- "wins": d.wins,
- "winrate": (d.winrate() * 1000.0).round() / 10.0,
- "score": (d.score() * 1000.0).round() / 10.0,
- })
- })
- .collect();
-
- Ok(json!({ "analysedGames": analysed, "duos": list }))
-}
-
-/// Early-game map reading for a jungler, from match timelines.
-#[tauri::command]
-pub async fn league_jungle_report(puuid: String, sample: Option<u32>) -> Result<Value, String> {
- ensure_enabled()?;
- if puuid.is_empty() {
- return Err("empty puuid".to_string());
- }
- let client = get_client().await?;
- let count = sample.unwrap_or(8).clamp(1, 15);
- let history = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex=0&endIndex={}",
- puuid,
- count.saturating_sub(1)
- ),
- )
- .await?;
- let games: Vec<Value> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
-
- let mut tasks = Vec::new();
- for game in &games {
- // Only Summoner's Rift games carry a meaningful jungle path.
- if game.get("mapId").and_then(Value::as_i64) != Some(11) {
- continue;
- }
- let game_id = match game.get("gameId").and_then(Value::as_i64) {
- Some(id) => id,
- None => continue,
- };
- let task_client = client.clone();
- tasks.push(tauri::async_runtime::spawn(async move {
- let detail = lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/games/{}", game_id),
- )
- .await
- .ok();
- let timeline = lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/game-timelines/{}", game_id),
- )
- .await
- .ok();
- (detail, timeline)
- }));
- }
-
- let mut weights = analysis::ZoneWeights::default();
- let mut analysed = 0u32;
- let mut invades = 0u32;
- let mut level3_ganks = 0u32;
- let mut first_camps: std::collections::HashMap<String, u32> = std::collections::HashMap::new();
- let mut objectives: std::collections::HashMap<String, u32> = std::collections::HashMap::new();
-
- for task in tasks {
- let (detail, timeline) = match task.await {
- Ok(pair) => pair,
- Err(_) => continue,
- };
- let (detail, timeline) = match (detail, timeline) {
- (Some(d), Some(t)) => (d, t),
- _ => continue,
- };
- let identities: Vec<Value> = detail
- .get("participantIdentities")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- let pid = identities
- .iter()
- .find(|i| {
- i.get("player")
- .and_then(|p| p.get("puuid"))
- .and_then(Value::as_str)
- == Some(puuid.as_str())
- })
- .and_then(|i| i.get("participantId").and_then(Value::as_i64));
- let pid = match pid {
- Some(p) => p,
- None => continue,
- };
- let team_id = detail
- .get("participants")
- .and_then(Value::as_array)
- .and_then(|arr| {
- arr.iter()
- .find(|p| p.get("participantId").and_then(Value::as_i64) == Some(pid))
- })
- .and_then(|p| p.get("teamId").and_then(Value::as_i64))
- .unwrap_or(100);
- let on_blue_side = team_id == 100;
-
- let frames: Vec<Value> = timeline
- .get("frames")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- if frames.is_empty() {
- continue;
- }
- analysed += 1;
-
- let frame_participant = |frame: &Value| -> Option<Value> {
- frame
- .get("participantFrames")
- .and_then(Value::as_object)
- .and_then(|obj| {
- obj.values()
- .find(|v| v.get("participantId").and_then(Value::as_i64) == Some(pid))
- .cloned()
- })
- };
-
- for frame in frames.iter().take(analysis::EARLY_MINUTES + 1).skip(1) {
- if let Some(pf) = frame_participant(frame) {
- if let Some(pos) = pf.get("position") {
- let x = pos.get("x").and_then(Value::as_f64).unwrap_or(-1.0);
- let y = pos.get("y").and_then(Value::as_f64).unwrap_or(-1.0);
- if x >= 0.0 && y >= 0.0 {
- weights.add(analysis::classify_zone(x, y), 1.0);
- }
- }
- }
- }
-
- if let Some(pf) = frames.get(1).and_then(frame_participant) {
- if let Some(pos) = pf.get("position") {
- let x = pos.get("x").and_then(Value::as_f64).unwrap_or(-1.0);
- let y = pos.get("y").and_then(Value::as_f64).unwrap_or(-1.0);
- if x >= 0.0 && y >= 0.0 {
- let (camp, camp_blue) = analysis::nearest_camp(x, y);
- *first_camps.entry(camp.to_string()).or_insert(0) += 1;
- if analysis::is_invade(camp_blue, on_blue_side) {
- invades += 1;
- }
- }
- }
- }
-
- let early_ms = (analysis::EARLY_MINUTES as i64) * 60_000;
- let mut acted_early = false;
- for frame in &frames {
- for event in frame
- .get("events")
- .and_then(Value::as_array)
- .unwrap_or(&Vec::new())
- {
- let ts = event.get("timestamp").and_then(Value::as_i64).unwrap_or(0);
- let kind = event.get("type").and_then(Value::as_str).unwrap_or("");
- if kind == "CHAMPION_KILL" && ts <= early_ms {
- let involved = event.get("killerId").and_then(Value::as_i64) == Some(pid)
- || event
- .get("assistingParticipantIds")
- .and_then(Value::as_array)
- .map(|a| a.iter().any(|v| v.as_i64() == Some(pid)))
- .unwrap_or(false);
- if involved {
- if ts <= 180_000 {
- acted_early = true;
- }
- if let Some(pos) = event.get("position") {
- let x = pos.get("x").and_then(Value::as_f64).unwrap_or(-1.0);
- let y = pos.get("y").and_then(Value::as_f64).unwrap_or(-1.0);
- if x >= 0.0 && y >= 0.0 {
- weights.add(analysis::classify_zone(x, y), analysis::KILL_WEIGHT);
- }
- }
- }
- }
- if kind == "ELITE_MONSTER_KILL"
- && event.get("killerId").and_then(Value::as_i64) == Some(pid)
- {
- let monster = event
- .get("monsterType")
- .and_then(Value::as_str)
- .unwrap_or("UNKNOWN");
- *objectives.entry(monster.to_string()).or_insert(0) += 1;
- }
- }
- }
-
- if let Some(pf3) = frames.get(3).and_then(frame_participant) {
- let cs = (pf3
- .get("minionsKilled")
- .and_then(Value::as_i64)
- .unwrap_or(0)
- + pf3
- .get("jungleMinionsKilled")
- .and_then(Value::as_i64)
- .unwrap_or(0))
- .max(0) as u32;
- let level = pf3.get("level").and_then(Value::as_i64).unwrap_or(0).max(0) as u32;
- if analysis::looks_like_level3_gank(cs, level, acted_early) {
- level3_ganks += 1;
- }
- }
- }
-
- let shares = weights.shares();
- Ok(json!({
- "analysedGames": analysed,
- "zones": {
- "top": (shares.top * 1000.0).round() / 10.0,
- "mid": (shares.mid * 1000.0).round() / 10.0,
- "bot": (shares.bot * 1000.0).round() / 10.0,
- },
- "preference": weights.preference(),
- "invadeRate": if analysed > 0 { ((invades as f64 / analysed as f64) * 1000.0).round() / 10.0 } else { 0.0 },
- "level3GankRate": if analysed > 0 { ((level3_ganks as f64 / analysed as f64) * 1000.0).round() / 10.0 } else { 0.0 },
- "firstCamps": first_camps,
- "objectives": objectives,
- }))
-}
-
-/// Applies a rune page for a champion, replacing a page OmniGet owns.
-#[tauri::command]
-pub async fn league_apply_runes(
- name: String,
- primary_style_id: i64,
- sub_style_id: i64,
- selected_perk_ids: Vec<i64>,
- spell1: Option<i64>,
- spell2: Option<i64>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- if selected_perk_ids.len() < 6 {
- return Err("a rune page needs at least 6 perks".to_string());
- }
- let client = get_client().await?;
-
- // Reuse our own page when it exists so the user's own pages survive.
- let pages = lcu_get_raw(&client, "/lol-perks/v1/pages")
- .await
- .unwrap_or(Value::Null);
- let owned: Option<i64> = pages.as_array().and_then(|arr| {
- arr.iter()
- .find(|p| {
- p.get("name")
- .and_then(Value::as_str)
- .map(|n| n.starts_with("OmniGet"))
- .unwrap_or(false)
- && p.get("isDeletable")
- .and_then(Value::as_bool)
- .unwrap_or(false)
- })
- .and_then(|p| p.get("id").and_then(Value::as_i64))
- });
- if let Some(id) = owned {
- let _ = lcu_send(
- &client,
- reqwest::Method::DELETE,
- &format!("/lol-perks/v1/pages/{}", id),
- None,
- )
- .await;
- }
-
- // Creating a page into a full book fails with an opaque error, so the
- // inventory is checked first and the reason is said out loud.
- if let Ok(inventory) = lcu_get_raw(&client, "/lol-perks/v1/inventory").await {
- let can_add = inventory
- .get("canAddCustomPage")
- .and_then(Value::as_bool)
- .unwrap_or(true);
- if !can_add {
- return Err("rune pages are full".to_string());
- }
- }
-
- let page = lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-perks/v1/pages",
- Some(json!({
- "name": format!("OmniGet · {}", name),
- "primaryStyleId": primary_style_id,
- "subStyleId": sub_style_id,
- "selectedPerkIds": selected_perk_ids,
- "current": true,
- })),
- )
- .await?;
-
- if let (Some(s1), Some(s2)) = (spell1, spell2) {
- let _ = lcu_send(
- &client,
- reqwest::Method::PATCH,
- "/lol-champ-select/v1/session/my-selection",
- Some(json!({ "spell1Id": s1, "spell2Id": s2 })),
- )
- .await;
- }
-
- Ok(page)
-}
-
-/// Sends a line to the champion-select (or lobby) chat.
-#[tauri::command]
-pub async fn league_send_chat(message: String) -> Result<(), String> {
- ensure_enabled()?;
- let text = message.trim();
- if text.is_empty() {
- return Err("empty message".to_string());
- }
- let client = get_client().await?;
- send_champ_select_chat(&client, text).await
-}
-
-async fn send_champ_select_chat(client: &LcuClient, text: &str) -> Result<(), String> {
- let conversations = lcu_get_raw(client, "/lol-chat/v1/conversations").await?;
- let target = conversations
- .as_array()
- .and_then(|arr| {
- arr.iter()
- .find(|c| {
- matches!(
- c.get("type").and_then(Value::as_str),
- Some("championSelect") | Some("customGame")
- )
- })
- .or_else(|| {
- arr.iter().find(|c| {
- c.get("type").and_then(Value::as_str) == Some("chat")
- && c.get("isMuted").and_then(Value::as_bool) == Some(false)
- })
- })
- })
- .and_then(|c| c.get("id").and_then(Value::as_str).map(String::from))
- .ok_or_else(|| "no champion select chat open".to_string())?;
-
- lcu_send(
- &client,
- reqwest::Method::POST,
- &format!("/lol-chat/v1/conversations/{}/messages", target),
- Some(json!({ "body": text, "type": "chat" })),
- )
- .await?;
- Ok(())
-}
-
-/// Rune and summoner-spell setups the game client itself recommends.
-///
-/// This is the client's own recommendation engine, so it always matches the
-/// installed patch and comes localized — no scraping involved.
-#[tauri::command]
-pub async fn league_rune_recommendations(
- champion_id: i64,
- position: Option<String>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let pos = position
- .map(|p| p.to_ascii_uppercase())
- .filter(|p| !p.is_empty())
- .unwrap_or_else(|| "NONE".to_string());
- let path = format!(
- "/lol-perks/v1/recommended-pages/champion/{}/position/{}/map/11",
- champion_id, pos
- );
- let pages = lcu_get_raw(&client, &path).await?;
-
- let list: Vec<Value> = pages
- .as_array()
- .map(|arr| {
- arr.iter()
- .map(|p| {
- let perks: Vec<i64> = p
- .get("perks")
- .and_then(Value::as_array)
- .map(|a| {
- a.iter()
- .filter_map(|x| x.get("id").and_then(Value::as_i64))
- .collect()
- })
- .unwrap_or_default();
- json!({
- "recommendationId": p.get("recommendationId"),
- "keystoneId": p.get("keystone").and_then(|k| k.get("id")),
- "keystoneName": p.get("keystone").and_then(|k| k.get("name")),
- "primaryStyleId": p.get("primaryPerkStyleId"),
- "subStyleId": p.get("secondaryPerkStyleId"),
- "selectedPerkIds": perks,
- "summonerSpellIds": p.get("summonerSpellIds"),
- "primaryAttribute": p.get("primaryRecommendationAttribute"),
- "secondaryAttribute": p.get("secondaryRecommendationAttribute"),
- "isDefault": p.get("isDefaultPosition"),
- })
- })
- .collect()
- })
- .unwrap_or_default();
-
- Ok(json!({ "championId": champion_id, "position": pos, "pages": list }))
-}
-
-/// Champion tier rankings, per position, from op.gg's public champion API.
-///
-/// The response is passed through with only the fields the UI needs; the
-/// numeric `tier` (1 = best) is what op.gg renders as S+/S/A and friends.
-#[tauri::command]
-pub async fn league_champion_tiers(
- region: Option<String>,
- tier: Option<String>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- let region = region.unwrap_or_else(|| "br".to_string());
- let bracket = tier.unwrap_or_else(|| "emerald_plus".to_string());
- if !region.chars().all(|c| c.is_ascii_alphanumeric())
- || !bracket
- .chars()
- .all(|c| c.is_ascii_alphanumeric() || c == '_')
- {
- return Err("invalid region or tier".to_string());
- }
- let url = format!(
- "https://lol-api-champion.op.gg/api/{}/champions/ranked?tier={}",
- region, bracket
- );
- let http = reqwest::Client::builder()
- .timeout(std::time::Duration::from_secs(20))
- .user_agent("OmniGet")
- .build()
- .map_err(|e| e.to_string())?;
- let resp = http
- .get(&url)
- .send()
- .await
- .map_err(|e| format!("tier list unavailable: {}", e))?;
- if !resp.status().is_success() {
- return Err(format!("tier list returned {}", resp.status().as_u16()));
- }
- let body = resp
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid tier list response: {}", e))?;
-
- let entries: Vec<Value> = body
- .get("data")
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter_map(|c| {
- let id = c.get("id").and_then(Value::as_i64)?;
- let positions: Vec<Value> = c
- .get("positions")
- .and_then(Value::as_array)
- .map(|ps| {
- ps.iter()
- .filter_map(|p| {
- let stats = p.get("stats")?;
- Some(json!({
- "position": p.get("name"),
- "tier": stats.get("tier_data").and_then(|t| t.get("tier")),
- "rank": stats.get("tier_data").and_then(|t| t.get("rank")),
- "winRate": stats.get("win_rate"),
- "pickRate": stats.get("pick_rate"),
- "banRate": stats.get("ban_rate"),
- "roleRate": stats.get("role_rate"),
- "games": stats.get("play"),
- }))
- })
- .collect()
- })
- .unwrap_or_default();
- if positions.is_empty() {
- return None;
- }
- Some(json!({ "championId": id, "positions": positions }))
- })
- .collect()
- })
- .unwrap_or_default();
-
- if entries.is_empty() {
- return Err("tier list returned no champions".to_string());
- }
- Ok(json!({ "region": region, "bracket": bracket, "champions": entries }))
-}
-
-/// Item build for a champion, derived from games this client can actually see.
-///
-/// Third-party build sites either forbid third-party use of their API or ask
-/// crawlers to stay out, and Riot's own `recommended` blocks ship empty, so the
-/// sample here is the player's own recent matches: every participant on that
-/// champion across those games contributes their finished items. The response
-/// always reports how many games backed it so a thin sample is obvious.
-#[tauri::command]
-pub async fn league_champion_build(champion_id: i64, sample: Option<u32>) -> Result<Value, String> {
- ensure_enabled()?;
- if champion_id <= 0 {
- return Err("invalid champion".to_string());
- }
- let client = get_client().await?;
- let me = lcu_get_raw(&client, "/lol-summoner/v1/current-summoner").await?;
- let my_puuid = me
- .get("puuid")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- let count = sample.unwrap_or(20).clamp(5, 40);
- let history = lcu_get_raw(
- &client,
- &format!(
- "/lol-match-history/v1/products/lol/{}/matches?begIndex=0&endIndex={}",
- my_puuid,
- count.saturating_sub(1)
- ),
- )
- .await?;
- let game_ids: Vec<i64> = history
- .get("games")
- .and_then(|g| g.get("games"))
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter_map(|g| g.get("gameId").and_then(Value::as_i64))
- .collect()
- })
- .unwrap_or_default();
-
- let mut tasks = Vec::new();
- for game_id in game_ids {
- let task_client = client.clone();
- tasks.push(tauri::async_runtime::spawn(async move {
- lcu_get_raw(
- &task_client,
- &format!("/lol-match-history/v1/games/{}", game_id),
- )
- .await
- .ok()
- }));
- }
-
- // (games seen, games won) per item and per summoner-spell pair.
- let mut items: std::collections::HashMap<i64, (u32, u32)> = std::collections::HashMap::new();
- let mut spells: std::collections::HashMap<(i64, i64), (u32, u32)> =
- std::collections::HashMap::new();
- let mut seen = 0u32;
- let mut wins = 0u32;
-
- for task in tasks {
- let detail = match task.await {
- Ok(Some(d)) => d,
- _ => continue,
- };
- let participants = detail
- .get("participants")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- for p in &participants {
- if p.get("championId").and_then(Value::as_i64) != Some(champion_id) {
- continue;
- }
- let stats = p.get("stats").cloned().unwrap_or(Value::Null);
- let won = stats.get("win").and_then(Value::as_bool).unwrap_or(false);
- seen += 1;
- if won {
- wins += 1;
- }
- // Slot 6 is the trinket, which is not part of a build.
- for slot in 0..6 {
- let item = stats
- .get(format!("item{}", slot))
- .and_then(Value::as_i64)
- .unwrap_or(0);
- if item > 0 {
- let e = items.entry(item).or_insert((0, 0));
- e.0 += 1;
- if won {
- e.1 += 1;
- }
- }
- }
- let s1 = p.get("spell1Id").and_then(Value::as_i64).unwrap_or(0);
- let s2 = p.get("spell2Id").and_then(Value::as_i64).unwrap_or(0);
- if s1 > 0 && s2 > 0 {
- let key = if s1 <= s2 { (s1, s2) } else { (s2, s1) };
- let e = spells.entry(key).or_insert((0, 0));
- e.0 += 1;
- if won {
- e.1 += 1;
- }
- }
- }
- }
-
- let mut item_rows: Vec<(i64, u32, u32)> =
- items.into_iter().map(|(id, (g, w))| (id, g, w)).collect();
- item_rows.sort_by(|a, b| b.1.cmp(&a.1).then(b.2.cmp(&a.2)));
- let core: Vec<Value> = item_rows
- .iter()
- .take(8)
- .map(|(id, games, wins)| {
- json!({
- "itemId": id,
- "games": games,
- "wins": wins,
- "pickRate": if seen > 0 { ((*games as f64 / seen as f64) * 1000.0).round() / 10.0 } else { 0.0 },
- })
- })
- .collect();
-
- let mut spell_rows: Vec<((i64, i64), u32, u32)> =
- spells.into_iter().map(|(k, (g, w))| (k, g, w)).collect();
- spell_rows.sort_by(|a, b| b.1.cmp(&a.1));
- let spell_list: Vec<Value> = spell_rows
- .iter()
- .take(2)
- .map(|((a, b), games, _)| json!({ "spellIds": [a, b], "games": games }))
- .collect();
-
- Ok(json!({
- "championId": champion_id,
- "gamesSeen": seen,
- "wins": wins,
- "winrate": if seen > 0 { ((wins as f64 / seen as f64) * 1000.0).round() / 10.0 } else { 0.0 },
- "items": core,
- "spells": spell_list,
- "source": "local-history",
- }))
-}
-
-/// Ability haste granted by an item, read from its own description text.
-///
-/// The game data files expose stats only as markup, so the number is pulled
-/// from the `<attention>N</attention> Ability Haste` fragment.
-fn item_ability_haste(description: &str) -> i64 {
- let lower = description.to_ascii_lowercase();
- let Some(idx) = lower.find("ability haste") else {
- return 0;
- };
- let head = &description[..idx];
- let Some(close) = head.rfind("</attention>") else {
- return 0;
- };
- let Some(open) = head[..close].rfind('>') else {
- return 0;
- };
- head[open + 1..close].trim().parse::<i64>().unwrap_or(0)
-}
-
-/// Cooldown after ability haste, using the game's own diminishing formula.
-fn haste_cooldown(base: f64, haste: i64) -> f64 {
- if base <= 0.0 {
- return 0.0;
- }
- let reduced = base / (1.0 + haste as f64 / 100.0);
- (reduced * 10.0).round() / 10.0
-}
-
-/// Ability ranks a player of a given level most likely has.
-///
-/// Levelling order varies, so this is the standard shape — ultimate at 6/11/16,
-/// the remaining points spread across the basic abilities — and it is labelled
-/// as an estimate wherever it is shown.
-fn estimated_ranks(level: i64) -> [i64; 4] {
- let level = level.clamp(1, 18);
- let ult = if level >= 16 {
- 3
- } else if level >= 11 {
- 2
- } else if level >= 6 {
- 1
- } else {
- 0
- };
- let spent_on_ult = ult;
- let basic_points = (level - spent_on_ult).max(0);
- // Spread the basic points across Q, W and E, favouring the earlier slots.
- let base = basic_points / 3;
- let extra = basic_points % 3;
- let mut ranks = [base.min(5), base.min(5), base.min(5), ult];
- for slot in ranks.iter_mut().take(extra as usize) {
- *slot = (*slot + 1).min(5);
- }
- ranks
-}
-
-static HASTE_TABLE: Lazy<Mutex<Option<(std::time::Instant, std::collections::HashMap<i64, i64>)>>> =
- Lazy::new(|| Mutex::new(None));
-const HASTE_TABLE_TTL: std::time::Duration = std::time::Duration::from_secs(6 * 60 * 60);
-
-/// Ability-haste per item, from the English game-data mirror. The client
-/// localises item text, so the number cannot be read from the local copy.
-async fn load_haste_table(http: &reqwest::Client) -> std::collections::HashMap<i64, i64> {
- {
- let cached = HASTE_TABLE.lock().await;
- if let Some((when, table)) = cached.as_ref() {
- if when.elapsed() < HASTE_TABLE_TTL {
- return table.clone();
- }
- }
- }
- let items_data = http
- .get("https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/items.json")
- .send()
- .await
- .ok()
- .and_then(|r| if r.status().is_success() { Some(r) } else { None });
- let items_data = match items_data {
- Some(r) => r.json::<Value>().await.unwrap_or(Value::Null),
- None => Value::Null,
- };
- let mut table: std::collections::HashMap<i64, i64> = std::collections::HashMap::new();
- if let Some(arr) = items_data.as_array() {
- for item in arr {
- let id = item.get("id").and_then(Value::as_i64).unwrap_or(0);
- let desc = item
- .get("description")
- .and_then(Value::as_str)
- .unwrap_or("");
- let haste = item_ability_haste(desc);
- if id > 0 && haste > 0 {
- table.insert(id, haste);
- }
- }
- }
- if !table.is_empty() {
- let mut cached = HASTE_TABLE.lock().await;
- *cached = Some((std::time::Instant::now(), table.clone()));
- }
- table
-}
-
-/// Live cooldown estimates for every champion in the running game.
-#[tauri::command]
-pub async fn league_ability_cooldowns() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let http = http_client()?;
-
- let players = http
- .get("https://127.0.0.1:2999/liveclientdata/playerlist")
- .send()
- .await
- .map_err(|e| format!("live client not reachable: {}", e))?
- .json::<Value>()
- .await
- .map_err(|e| format!("invalid live client response: {}", e))?;
- let list = players.as_array().cloned().unwrap_or_default();
- if list.is_empty() {
- return Err("no players in the live game".to_string());
- }
-
- let haste_by_item = load_haste_table(&http).await;
-
- let summary = lcu_get_raw(&client, "/lol-game-data/assets/v1/champion-summary.json")
- .await
- .unwrap_or(Value::Null);
- let mut id_by_alias: std::collections::HashMap<String, i64> = std::collections::HashMap::new();
- if let Some(arr) = summary.as_array() {
- for champ in arr {
- if let (Some(id), Some(alias)) = (
- champ.get("id").and_then(Value::as_i64),
- champ.get("alias").and_then(Value::as_str),
- ) {
- id_by_alias.insert(alias.to_ascii_lowercase(), id);
- }
- }
- }
-
- // Summoner spells are matched by their localized name, since that is the
- // only identifier the in-game data server exposes.
- let spell_meta = lcu_get_raw(&client, "/lol-game-data/assets/v1/summoner-spells.json")
- .await
- .unwrap_or(Value::Null);
- let mut spell_by_name: std::collections::HashMap<String, (f64, String)> =
- std::collections::HashMap::new();
- if let Some(arr) = spell_meta.as_array() {
- for spell in arr {
- if let (Some(name), Some(cd)) = (
- spell.get("name").and_then(Value::as_str),
- spell.get("cooldown").and_then(Value::as_f64),
- ) {
- let icon = spell
- .get("iconPath")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string();
- // Game-mode variants reuse the same name with a zero cooldown;
- // a real cooldown must never be replaced by one of those.
- spell_by_name
- .entry(name.to_string())
- .and_modify(|existing| {
- if existing.0 <= 0.0 && cd > 0.0 {
- *existing = (cd, icon.clone());
- }
- })
- .or_insert((cd, icon));
- }
- }
- }
-
- let mut rows: Vec<Value> = Vec::new();
- let mut spell_cache: std::collections::HashMap<i64, Value> = std::collections::HashMap::new();
-
- for p in &list {
- let raw_name = p
- .get("rawChampionName")
- .and_then(Value::as_str)
- .unwrap_or("");
- let alias = raw_name
- .rsplit('_')
- .next()
- .unwrap_or("")
- .to_ascii_lowercase();
- let champion_id = id_by_alias.get(&alias).copied().unwrap_or(0);
- let level = p.get("level").and_then(Value::as_i64).unwrap_or(1);
-
- let mut haste = 0i64;
- let mut item_ids: Vec<i64> = Vec::new();
- if let Some(items) = p.get("items").and_then(Value::as_array) {
- for item in items {
- let id = item.get("itemID").and_then(Value::as_i64).unwrap_or(0);
- if id > 0 {
- item_ids.push(id);
- haste += haste_by_item.get(&id).copied().unwrap_or(0);
- }
- }
- }
-
- let spells = if champion_id > 0 {
- if let Some(cached) = spell_cache.get(&champion_id) {
- cached.clone()
- } else {
- let detail = lcu_get_raw(
- &client,
- &format!("/lol-game-data/assets/v1/champions/{}.json", champion_id),
- )
- .await
- .unwrap_or(Value::Null);
- let value = detail.get("spells").cloned().unwrap_or(Value::Null);
- spell_cache.insert(champion_id, value.clone());
- value
- }
- } else {
- Value::Null
- };
-
- let ranks = estimated_ranks(level);
- let keys = ["Q", "W", "E", "R"];
- let abilities: Vec<Value> = spells
- .as_array()
- .map(|arr| {
- arr.iter()
- .take(4)
- .enumerate()
- .map(|(i, spell)| {
- let coefficients: Vec<f64> = spell
- .get("cooldownCoefficients")
- .and_then(Value::as_array)
- .map(|c| c.iter().filter_map(Value::as_f64).collect())
- .unwrap_or_default();
- let rank = ranks[i].max(1) as usize;
- let base = coefficients
- .get(rank.saturating_sub(1))
- .or_else(|| coefficients.first())
- .copied()
- .unwrap_or(0.0);
- json!({
- "key": keys[i],
- "name": spell.get("name"),
- "iconPath": spell.get("abilityIconPath"),
- "rank": ranks[i],
- "baseCooldown": base,
- "cooldown": haste_cooldown(base, haste),
- "allRanks": coefficients,
- })
- })
- .collect()
- })
- .unwrap_or_default();
-
- // Boots of Lucidity are the only summoner-haste source visible from
- // item data; runes are hidden, so the number stays an estimate.
- let summoner_haste = if item_ids.contains(&3158) { 10 } else { 0 };
- let spell_slots = ["summonerSpellOne", "summonerSpellTwo"];
- let spell_timers: Vec<Value> = spell_slots
- .iter()
- .filter_map(|slot| {
- let name = p
- .get("summonerSpells")
- .and_then(|s| s.get(slot))
- .and_then(|s| s.get("displayName"))
- .and_then(Value::as_str)?;
- let (cd, icon) = spell_by_name
- .get(name)
- .cloned()
- .unwrap_or((0.0, String::new()));
- Some(json!({
- "name": name,
- "baseCooldown": cd,
- "cooldown": haste_cooldown(cd, summoner_haste),
- "iconPath": icon,
- }))
- })
- .collect();
-
- rows.push(json!({
- "riotId": p.get("riotId"),
- "championName": p.get("championName"),
- "championId": champion_id,
- "team": p.get("team"),
- "position": p.get("position"),
- "level": level,
- "abilityHaste": haste,
- "items": item_ids,
- "abilities": abilities,
- "summonerSpells": p.get("summonerSpells"),
- "spellTimers": spell_timers,
- }));
- }
-
- Ok(json!({ "players": rows, "estimated": true }))
-}
-
-/// Launches the spectator client on another player's running game.
-#[tauri::command]
-pub async fn league_spectate(puuid: String, riot_id: String) -> Result<(), String> {
- ensure_enabled()?;
- if puuid.is_empty() {
- return Err("empty puuid".to_string());
- }
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-spectator/v1/spectate/launch",
- Some(json!({
- "allowObserveMode": "ALL",
- "dropInSpectateGameId": riot_id,
- "gameQueueType": "",
- "puuid": puuid,
- "spectatorKey": "",
- })),
- )
- .await?;
- Ok(())
-}
-
-/// Quits champion select through the login-session proxy, taking the dodge
-/// penalty. There is no supported endpoint for this, hence the raw invoke.
-#[tauri::command]
-pub async fn league_dodge() -> Result<(), String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let args = urlencoding::encode(r#"["","teambuilder-draft","quitV2",""]"#).into_owned();
- let path = format!(
- "/lol-login/v1/session/invoke?destination=lcdsServiceProxy&method=call&args={}",
- args
- );
- lcu_send(&client, reqwest::Method::POST, &path, None).await?;
- Ok(())
-}
-
-#[tauri::command]
-pub async fn league_auto_accept_set(enabled: bool) -> Result<(), String> {
- ensure_enabled()?;
- AUTO_ACCEPT.store(enabled, Ordering::Relaxed);
- tracing::info!(
- "[league] auto-accept {}",
- if enabled { "on" } else { "off" }
- );
- Ok(())
-}
-
-#[tauri::command]
-pub fn league_auto_accept_get() -> bool {
- AUTO_ACCEPT.load(Ordering::Relaxed)
-}
-
-fn action_champion_lists(
- settings: &omniget_core::models::settings::LeagueSettings,
- action_type: &str,
-) -> (bool, Vec<i64>) {
- if action_type == "ban" {
- (settings.auto_ban, settings.ban_champions.clone())
- } else {
- (settings.auto_pick, settings.pick_champions.clone())
- }
-}
-
-async fn handle_champ_select(
- client: &LcuClient,
- settings: &omniget_core::models::settings::LeagueSettings,
- session: &Value,
-) -> Result<(), String> {
- let cell = session
- .get("localPlayerCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-1);
- if cell < 0 {
- return Ok(());
- }
-
- let mut taken: HashSet<i64> = HashSet::new();
- if let Some(groups) = session.get("actions").and_then(Value::as_array) {
- for group in groups {
- for action in group.as_array().map(|a| a.as_slice()).unwrap_or(&[]) {
- let completed = action
- .get("completed")
- .and_then(Value::as_bool)
- .unwrap_or(false);
- if completed {
- if let Some(id) = action.get("championId").and_then(Value::as_i64) {
- if id > 0 {
- taken.insert(id);
- }
- }
- }
- }
- }
- }
- for team_key in ["myTeam", "theirTeam"] {
- if let Some(team) = session.get(team_key).and_then(Value::as_array) {
- for member in team {
- if let Some(id) = member.get("championId").and_then(Value::as_i64) {
- if id > 0 {
- taken.insert(id);
- }
- }
- }
- }
- }
-
- let ally_intents = champ_select::ally_pick_intents(session, cell);
-
- let mut pickable: Option<HashSet<i64>> = None;
- let mut bannable: Option<HashSet<i64>> = None;
-
- let groups: Vec<Value> = session
- .get("actions")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- for group in groups {
- for action in group.as_array().map(|a| a.as_slice()).unwrap_or(&[]) {
- let actor = action
- .get("actorCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-2);
- let in_progress = action
- .get("isInProgress")
- .and_then(Value::as_bool)
- .unwrap_or(false);
- let completed = action
- .get("completed")
- .and_then(Value::as_bool)
- .unwrap_or(false);
- let action_id = action.get("id").and_then(Value::as_i64).unwrap_or(-1);
- if actor != cell || !in_progress || completed || action_id < 0 {
- continue;
- }
- {
- let handled = CS_HANDLED.lock().await;
- if handled.contains(&action_id) {
- continue;
- }
- }
- let action_type = action
- .get("type")
- .and_then(Value::as_str)
- .unwrap_or("pick")
- .to_string();
- let (enabled, list) = action_champion_lists(settings, &action_type);
- let random_pick = action_type != "ban" && settings.pick_random;
- if !enabled || (list.is_empty() && !random_pick) {
- continue;
- }
- let pool = if action_type == "ban" {
- if bannable.is_none() {
- let ids =
- lcu_get_raw(client, "/lol-champ-select/v1/bannable-champion-ids").await?;
- bannable = Some(
- ids.as_array()
- .map(|a| a.iter().filter_map(Value::as_i64).collect())
- .unwrap_or_default(),
- );
- }
- bannable.as_ref()
- } else {
- if pickable.is_none() {
- let ids =
- lcu_get_raw(client, "/lol-champ-select/v1/pickable-champion-ids").await?;
- pickable = Some(
- ids.as_array()
- .map(|a| a.iter().filter_map(Value::as_i64).collect())
- .unwrap_or_default(),
- );
- }
- pickable.as_ref()
- };
- let pool = match pool {
- Some(p) => p,
- None => continue,
- };
- // Bans avoid what allies want; a random pick does too, so the
- // roulette never hovers a champion a teammate already called.
- let avoid: HashSet<i64> = if action_type == "ban" || random_pick {
- ally_intents.clone()
- } else {
- HashSet::new()
- };
- let chosen = if random_pick {
- let mut rng = rand::rng();
- champ_select::choose_random_champion(pool, &taken, &avoid, &mut rng)
- } else {
- champ_select::choose_champion(&list, pool, &taken, &avoid)
- };
- let choice = match chosen {
- Some(c) => c,
- None => continue,
- };
- if action_type == "ban" {
- let delay = champ_select::ban_delay_seconds(settings.auto_ban_delay);
- let elapsed = {
- let mut seen = CS_FIRST_SEEN.lock().await;
- let first = seen
- .entry(action_id)
- .or_insert_with(std::time::Instant::now);
- first.elapsed().as_secs_f64()
- };
- if !champ_select::delay_elapsed(elapsed, delay) {
- continue;
- }
- }
- // A ban that is declared but never confirmed accomplishes nothing, so
- // the confirm modes only apply to picks.
- let complete_action = if action_type == "ban" {
- true
- } else {
- let mode =
- champ_select::pick_confirm(settings.auto_lock, settings.auto_lock_at_timeout);
- let lock = champ_select::should_lock_now(mode, champ_select::time_left_ms(session));
- if !lock && CS_DECLARED.lock().await.contains(&action_id) {
- // Intent is already showing; nothing to send until it is time
- // to lock (or never, when the user does the locking).
- continue;
- }
- lock
- };
- let path = format!("/lol-champ-select/v1/session/actions/{}", action_id);
- let body = json!({ "championId": choice, "completed": complete_action });
- match lcu_send(client, reqwest::Method::PATCH, &path, Some(body)).await {
- Ok(_) => {
- if complete_action {
- CS_HANDLED.lock().await.insert(action_id);
- } else {
- CS_DECLARED.lock().await.insert(action_id);
- }
- tracing::info!(
- "[league] auto-{} champion {} (locked: {})",
- action_type,
- choice,
- complete_action
- );
- }
- Err(e) => {
- tracing::warn!("[league] auto-{} failed: {}", action_type, e);
- }
- }
- }
- }
- Ok(())
-}
-
-pub fn start_background(app: tauri::AppHandle) {
- let settings = crate::storage::config::load_settings_standalone();
- AUTO_ACCEPT.store(settings.league.auto_accept, Ordering::Relaxed);
- ws::start(app);
-}
diff --git a/src-tauri/src/commands/league/profile.rs b/src-tauri/src/commands/league/profile.rs
deleted file mode 100644
index 2bda4c92..00000000
--- a/src-tauri/src/commands/league/profile.rs
+++ /dev/null
@@ -1,566 +0,0 @@
-//! Profile editor: everything the client lets the player change about how
-//! they look to others without touching the game itself. The endpoints and
-//! payloads mirror what league_profile_tool and league-tools send (both MIT).
-
-use super::{ensure_enabled, get_client, lcu_get_raw, lcu_send, LcuClient};
-use rand::RngExt;
-use serde_json::{json, Value};
-
-const QUEUES: [&str; 3] = ["RANKED_SOLO_5x5", "RANKED_FLEX_SR", "RANKED_TFT"];
-const TIERS: [&str; 11] = [
- "UNRANKED",
- "IRON",
- "BRONZE",
- "SILVER",
- "GOLD",
- "PLATINUM",
- "EMERALD",
- "DIAMOND",
- "MASTER",
- "GRANDMASTER",
- "CHALLENGER",
-];
-const DIVISIONS: [&str; 5] = ["I", "II", "III", "IV", "NA"];
-pub const STATUS_MAX_CHARS: usize = 255;
-
-fn valid_tier(tier: &str) -> bool {
- TIERS.contains(&tier)
-}
-
-/// Apex tiers have no division; the client shows "NA" for them.
-pub fn normalise_division(tier: &str, division: &str) -> String {
- if matches!(tier, "MASTER" | "GRANDMASTER" | "CHALLENGER" | "UNRANKED") {
- "NA".to_string()
- } else {
- division.to_string()
- }
-}
-
-async fn chat_me(client: &LcuClient) -> Result<Value, String> {
- lcu_get_raw(client, "/lol-chat/v1/me").await
-}
-
-/// The three challenge tokens (or fewer) plus the title the profile shows.
-pub fn summary_preferences(summary: &Value) -> (Vec<i64>, String, String) {
- let tokens: Vec<i64> = summary
- .get("topChallenges")
- .and_then(Value::as_array)
- .map(|arr| {
- arr.iter()
- .filter_map(|c| c.get("id").and_then(Value::as_i64))
- .filter(|id| *id > 0)
- .take(3)
- .collect()
- })
- .unwrap_or_default();
- let title = summary
- .get("title")
- .and_then(|t| {
- t.get("itemId")
- .and_then(Value::as_i64)
- .map(|id| id.to_string())
- .or_else(|| t.as_str().map(str::to_string))
- })
- .filter(|t| t != "-1")
- .unwrap_or_default();
- let banner = summary
- .get("bannerAccent")
- .and_then(|b| {
- b.as_str()
- .map(str::to_string)
- .or_else(|| b.as_i64().map(|n| n.to_string()))
- })
- .filter(|b| b != "-1" && !b.is_empty())
- .unwrap_or_else(|| "1".to_string());
- (tokens, title, banner)
-}
-
-/// One snapshot with everything the profile tab renders.
-#[tauri::command]
-pub async fn league_profile_state() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let me = chat_me(&client).await?;
- let summary = lcu_get_raw(
- &client,
- "/lol-challenges/v1/summary-player-data/local-player",
- )
- .await
- .unwrap_or(Value::Null);
- let (tokens, title, banner) = summary_preferences(&summary);
- let profile = lcu_get_raw(
- &client,
- "/lol-summoner/v1/current-summoner/summoner-profile",
- )
- .await
- .unwrap_or(Value::Null);
- let regalia = lcu_get_raw(&client, "/lol-regalia/v2/current-summoner/regalia")
- .await
- .unwrap_or(Value::Null);
- let wallet = lcu_get_raw(&client, "/lol-inventory/v1/wallet")
- .await
- .unwrap_or(Value::Null);
- let friends = lcu_get_raw(&client, "/lol-chat/v1/friends")
- .await
- .ok()
- .and_then(|f| f.as_array().map(|a| a.len()))
- .unwrap_or(0);
- let lol = me.get("lol").cloned().unwrap_or(Value::Null);
- Ok(json!({
- "availability": me.get("availability"),
- "statusMessage": me.get("statusMessage"),
- "chatIcon": me.get("icon"),
- "rank": {
- "queue": lol.get("rankedLeagueQueue"),
- "tier": lol.get("rankedLeagueTier"),
- "division": lol.get("rankedLeagueDivision"),
- },
- "challengeCrystal": {
- "level": lol.get("challengeCrystalLevel"),
- "points": lol.get("challengePoints"),
- },
- "tokens": tokens,
- "title": title,
- "bannerAccent": banner,
- "backgroundSkinId": profile.get("backgroundSkinId"),
- "regalia": {
- "bannerType": regalia.get("bannerType"),
- "crestType": regalia.get("crestType"),
- "preferredBannerType": regalia.get("preferredBannerType"),
- "preferredCrestType": regalia.get("preferredCrestType"),
- "selectedPrestigeCrest": regalia.get("selectedPrestigeCrest"),
- "lastSeasonHighestRank": regalia.get("lastSeasonHighestRank"),
- },
- "wallet": {
- "rp": wallet.get("RP").or_else(|| wallet.get("rp")),
- "blueEssence": wallet.get("lol_blue_essence").or_else(|| wallet.get("ip")),
- },
- "friendsCount": friends,
- }))
-}
-
-/// Rank shown on the chat hovercard and social cards. Only the `lol` block is
-/// patched, so presence data the client keeps there survives.
-#[tauri::command]
-pub async fn league_set_chat_rank(
- queue: String,
- tier: String,
- division: String,
-) -> Result<Value, String> {
- ensure_enabled()?;
- if !QUEUES.contains(&queue.as_str()) {
- return Err("invalid queue".to_string());
- }
- if !valid_tier(&tier) {
- return Err("invalid tier".to_string());
- }
- let division = normalise_division(&tier, &division);
- if !DIVISIONS.contains(&division.as_str()) {
- return Err("invalid division".to_string());
- }
- let client = get_client().await?;
- let tier_value = if tier == "UNRANKED" {
- ""
- } else {
- tier.as_str()
- };
- lcu_send(
- &client,
- reqwest::Method::PUT,
- "/lol-chat/v1/me",
- Some(json!({
- "lol": {
- "rankedLeagueQueue": queue,
- "rankedLeagueTier": tier_value,
- "rankedLeagueDivision": division,
- }
- })),
- )
- .await
-}
-
-/// Puts the real rank back, read from the ranked service.
-#[tauri::command]
-pub async fn league_reset_chat_rank() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let stats = lcu_get_raw(&client, "/lol-ranked/v1/current-ranked-stats").await?;
- let entry = stats
- .get("highestRankedEntry")
- .cloned()
- .unwrap_or(Value::Null);
- let queue = entry
- .get("queueType")
- .and_then(Value::as_str)
- .filter(|q| QUEUES.contains(q))
- .unwrap_or("RANKED_SOLO_5x5")
- .to_string();
- let tier = entry
- .get("tier")
- .and_then(Value::as_str)
- .filter(|t| !t.is_empty() && *t != "NONE")
- .unwrap_or("UNRANKED")
- .to_string();
- let division = entry
- .get("division")
- .and_then(Value::as_str)
- .unwrap_or("NA")
- .to_string();
- league_set_chat_rank(queue, tier, division).await
-}
-
-/// The challenge crystal level and points shown next to the rank.
-#[tauri::command]
-pub async fn league_set_challenge_crystal(level: String, points: i64) -> Result<Value, String> {
- ensure_enabled()?;
- if !valid_tier(&level) {
- return Err("invalid tier".to_string());
- }
- if !(0..=1_000_000).contains(&points) {
- return Err("invalid points".to_string());
- }
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::PUT,
- "/lol-chat/v1/me",
- Some(json!({
- "lol": { "challengeCrystalLevel": level, "challengePoints": points }
- })),
- )
- .await
-}
-
-/// Icon shown in chat and hovercards. Unlike the profile icon, the chat
-/// service accepts any icon id here.
-#[tauri::command]
-pub async fn league_set_chat_icon(icon_id: i64) -> Result<Value, String> {
- ensure_enabled()?;
- if icon_id < 0 {
- return Err("invalid icon".to_string());
- }
- let client = get_client().await?;
- lcu_send(
- &client,
- reqwest::Method::PUT,
- "/lol-chat/v1/me",
- Some(json!({ "icon": icon_id })),
- )
- .await
-}
-
-/// Challenge medals the account has earned, and the titles it may wear.
-#[tauri::command]
-pub async fn league_challenges() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let challenges = lcu_get_raw(&client, "/lol-challenges/v1/challenges/local-player").await?;
- let entries: Vec<Value> = match &challenges {
- Value::Array(arr) => arr.clone(),
- Value::Object(map) => map.values().cloned().collect(),
- _ => Vec::new(),
- };
- let mut tokens: Vec<Value> = entries
- .iter()
- .filter_map(|c| {
- let id = c.get("id").and_then(Value::as_i64)?;
- let level = c
- .get("currentLevel")
- .and_then(Value::as_str)
- .unwrap_or("NONE");
- if id <= 0 || level == "NONE" {
- return None;
- }
- let icon = c
- .get("levelToIconPath")
- .and_then(|m| m.get(level))
- .and_then(Value::as_str)
- .unwrap_or("");
- Some(json!({
- "id": id,
- "name": c.get("name").and_then(Value::as_str).unwrap_or(""),
- "description": c.get("description").and_then(Value::as_str).unwrap_or(""),
- "level": level,
- "iconPath": icon,
- "category": c.get("category").and_then(Value::as_str).unwrap_or(""),
- }))
- })
- .collect();
- tokens.sort_by(|a, b| {
- a.get("name")
- .and_then(Value::as_str)
- .unwrap_or("")
- .cmp(b.get("name").and_then(Value::as_str).unwrap_or(""))
- });
- let titles = lcu_get_raw(&client, "/lol-challenges/v2/titles/local-player")
- .await
- .unwrap_or(Value::Null);
- let titles: Vec<Value> = titles
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter_map(|t| {
- let id = t
- .get("itemId")
- .and_then(Value::as_i64)
- .map(|n| n.to_string())
- .or_else(|| t.get("id").and_then(Value::as_str).map(str::to_string))?;
- Some(json!({
- "id": id,
- "name": t.get("name").and_then(Value::as_str).unwrap_or(""),
- }))
- })
- .collect()
- })
- .unwrap_or_default();
- Ok(json!({ "tokens": tokens, "titles": titles }))
-}
-
-/// Applies the three medals, the title and the banner accent in one call.
-/// Anything not given keeps its current value.
-#[tauri::command]
-pub async fn league_set_challenge_prefs(
- challenge_ids: Option<Vec<i64>>,
- title: Option<String>,
- banner_accent: Option<String>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let summary = lcu_get_raw(
- &client,
- "/lol-challenges/v1/summary-player-data/local-player",
- )
- .await
- .unwrap_or(Value::Null);
- let (current_tokens, current_title, current_banner) = summary_preferences(&summary);
- let ids = challenge_ids.unwrap_or(current_tokens);
- if ids.len() > 3 || ids.iter().any(|id| *id < 0) {
- return Err("invalid tokens".to_string());
- }
- let title = title.unwrap_or(current_title);
- if !title.is_empty() && !title.chars().all(|c| c.is_ascii_digit()) {
- return Err("invalid title".to_string());
- }
- let banner = banner_accent.unwrap_or(current_banner);
- if !banner.chars().all(|c| c.is_ascii_digit()) {
- return Err("invalid banner".to_string());
- }
- lcu_send(
- &client,
- reqwest::Method::POST,
- "/lol-challenges/v1/update-player-preferences",
- Some(json!({
- "challengeIds": ids,
- "title": title,
- "bannerAccent": banner,
- })),
- )
- .await
-}
-
-/// Banner and crest preferences shown on the profile and in loading screens.
-#[tauri::command]
-pub async fn league_set_regalia(
- banner_type: Option<String>,
- crest_type: Option<String>,
- prestige_crest: Option<i64>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let current = lcu_get_raw(&client, "/lol-regalia/v2/current-summoner/regalia").await?;
- let mut body = json!({
- "preferredBannerType": current.get("preferredBannerType").cloned().unwrap_or(json!("")),
- "preferredCrestType": current.get("preferredCrestType").cloned().unwrap_or(json!("")),
- "selectedPrestigeCrest": current.get("selectedPrestigeCrest").cloned().unwrap_or(json!(0)),
- });
- if let Some(b) = banner_type {
- body["preferredBannerType"] = json!(b);
- }
- if let Some(c) = crest_type {
- body["preferredCrestType"] = json!(c);
- }
- if let Some(p) = prestige_crest {
- body["selectedPrestigeCrest"] = json!(p);
- }
- lcu_send(
- &client,
- reqwest::Method::PUT,
- "/lol-regalia/v2/current-summoner/regalia",
- Some(body),
- )
- .await
-}
-
-/// The friends list, trimmed to what the manager shows.
-#[tauri::command]
-pub async fn league_friends() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let friends = lcu_get_raw(&client, "/lol-chat/v1/friends").await?;
- let list: Vec<Value> = friends
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter_map(|f| {
- Some(json!({
- "id": f.get("id").and_then(Value::as_str)?,
- "puuid": f.get("puuid").and_then(Value::as_str).unwrap_or(""),
- "gameName": f.get("gameName").and_then(Value::as_str).unwrap_or(""),
- "gameTag": f.get("gameTag").and_then(Value::as_str).unwrap_or(""),
- "name": f.get("name").and_then(Value::as_str).unwrap_or(""),
- "availability": f.get("availability").and_then(Value::as_str).unwrap_or(""),
- "icon": f.get("icon").and_then(Value::as_i64).unwrap_or(0),
- "note": f.get("note").and_then(Value::as_str).unwrap_or(""),
- "lastSeen": f.get("lastSeenOnlineTimestamp").and_then(Value::as_str).unwrap_or(""),
- "groupName": f.get("groupName").and_then(Value::as_str).unwrap_or(""),
- }))
- })
- .collect()
- })
- .unwrap_or_default();
- Ok(json!({ "friends": list }))
-}
-
-/// Removes friends one by one, spaced out so the chat service does not choke.
-/// Returns how many went through and which ids failed.
-#[tauri::command]
-pub async fn league_remove_friends(ids: Vec<String>) -> Result<Value, String> {
- ensure_enabled()?;
- if ids.is_empty() {
- return Err("no friends selected".to_string());
- }
- let client = get_client().await?;
- let mut removed = 0usize;
- let mut failed: Vec<String> = Vec::new();
- for (index, id) in ids.iter().enumerate() {
- if id.is_empty() || id.contains('/') || id.contains("..") {
- failed.push(id.clone());
- continue;
- }
- if index > 0 {
- tokio::time::sleep(std::time::Duration::from_millis(150)).await;
- }
- match lcu_send(
- &client,
- reqwest::Method::DELETE,
- &format!("/lol-chat/v1/friends/{}", id),
- None,
- )
- .await
- {
- Ok(_) => removed += 1,
- Err(e) => {
- tracing::debug!("[league] remove friend {} failed: {}", id, e);
- failed.push(id.clone());
- }
- }
- }
- Ok(json!({ "removed": removed, "failed": failed }))
-}
-
-/// Champions the account can play right now, for the raffle.
-#[tauri::command]
-pub async fn league_random_champion(class: Option<String>) -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let owned = lcu_get_raw(&client, "/lol-champions/v1/owned-champions-minimal").await?;
- let class = class.unwrap_or_default().to_ascii_lowercase();
- let candidates: Vec<&Value> = owned
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter(|c| c.get("id").and_then(Value::as_i64).unwrap_or(0) > 0)
- .filter(|c| {
- class.is_empty()
- || c.get("roles")
- .and_then(Value::as_array)
- .map(|roles| {
- roles
- .iter()
- .filter_map(Value::as_str)
- .any(|r| r.eq_ignore_ascii_case(&class))
- })
- .unwrap_or(false)
- })
- .collect()
- })
- .unwrap_or_default();
- if candidates.is_empty() {
- return Err("no champion matches".to_string());
- }
- let picked = {
- let mut rng = rand::rng();
- candidates[rng.random_range(0..candidates.len())]
- };
- Ok(json!({
- "id": picked.get("id"),
- "name": picked.get("name"),
- "alias": picked.get("alias"),
- "roles": picked.get("roles"),
- "candidates": candidates.len(),
- }))
-}
-
-/// Hovers (or locks) a champion in the local player's open pick action.
-#[tauri::command]
-pub async fn league_declare_champion(
- champion_id: i64,
- lock: Option<bool>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- if champion_id <= 0 {
- return Err("invalid champion".to_string());
- }
- let client = get_client().await?;
- let session = lcu_get_raw(&client, "/lol-champ-select/v1/session").await?;
- let cell = session
- .get("localPlayerCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-1);
- let (action_id, completed) = super::champ_select::local_pick_action(&session, cell)
- .ok_or_else(|| "no pick action open".to_string())?;
- if completed {
- return Err("pick already locked".to_string());
- }
- lcu_send(
- &client,
- reqwest::Method::PATCH,
- &format!("/lol-champ-select/v1/session/actions/{}", action_id),
- Some(json!({ "championId": champion_id, "completed": lock.unwrap_or(false) })),
- )
- .await
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn apex_tiers_drop_the_division() {
- assert_eq!(normalise_division("MASTER", "II"), "NA");
- assert_eq!(normalise_division("GOLD", "II"), "II");
- assert_eq!(normalise_division("UNRANKED", "I"), "NA");
- }
-
- #[test]
- fn the_summary_preferences_are_read_with_their_defaults() {
- let summary = json!({
- "topChallenges": [{ "id": 1 }, { "id": 2 }, { "id": 0 }, { "id": 3 }, { "id": 4 }],
- "title": { "itemId": 77 },
- "bannerAccent": "5"
- });
- assert_eq!(
- summary_preferences(&summary),
- (vec![1, 2, 3], "77".to_string(), "5".to_string())
- );
- let empty = json!({ "title": { "itemId": -1 }, "bannerAccent": "-1" });
- assert_eq!(
- summary_preferences(&empty),
- (vec![], String::new(), "1".to_string())
- );
- assert_eq!(
- summary_preferences(&Value::Null),
- (vec![], String::new(), "1".to_string())
- );
- }
-}
diff --git a/src-tauri/src/commands/league/sgp.rs b/src-tauri/src/commands/league/sgp.rs
deleted file mode 100644
index 0a657739..00000000
--- a/src-tauri/src/commands/league/sgp.rs
+++ /dev/null
@@ -1,568 +0,0 @@
-//! Service Gateway Proxy: the private HTTP API the League Client itself uses
-//! to talk to Riot's backend. The client hands out the tokens it uses, so the
-//! same calls can be made directly, which reaches data the local API hides or
-//! trims (full match history of any player, ranked stats, replays).
-//!
-//! Hosts come from League Akari's built-in table (packet-captured, MIT). They
-//! are configuration, not protocol: a region missing here is unsupported, and
-//! no host is ever guessed from a region name.
-
-use super::{ensure_enabled, get_client, lcu_get_raw, LcuClient};
-use once_cell::sync::Lazy;
-use serde::Serialize;
-use serde_json::{json, Value};
-use tokio::sync::Mutex;
-
-#[derive(Clone, Copy, Debug)]
-pub struct Server {
- pub id: &'static str,
- /// Host for endpoints that take the entitlements token (match history).
- pub match_history: &'static str,
- /// Host for endpoints that take the league session token.
- pub common: &'static str,
- /// The region segment inside paths, when it differs from the id.
- pub region_path: Option<&'static str>,
-}
-
-const SERVERS: &[Server] = &[
- Server {
- id: "BR1",
- match_history: "https://usw2-red.pp.sgp.pvp.net",
- common: "https://br-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "NA1",
- match_history: "https://usw2-red.pp.sgp.pvp.net",
- common: "https://na-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "LA1",
- match_history: "https://usw2-red.pp.sgp.pvp.net",
- common: "https://lan-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "LA2",
- match_history: "https://usw2-red.pp.sgp.pvp.net",
- common: "https://las-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "PBE",
- match_history: "https://usw2-red.pp.sgp.pvp.net",
- common: "https://pbe-red.lol.sgp.pvp.net",
- region_path: Some("PBE1"),
- },
- Server {
- id: "EUW",
- match_history: "https://euc1-red.pp.sgp.pvp.net",
- common: "https://euw-red.lol.sgp.pvp.net",
- region_path: Some("EUW1"),
- },
- Server {
- id: "RU",
- match_history: "https://euc1-red.pp.sgp.pvp.net",
- common: "https://ru-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "TR1",
- match_history: "https://euc1-red.pp.sgp.pvp.net",
- common: "https://tr-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "JP",
- match_history: "https://apne1-red.pp.sgp.pvp.net",
- common: "https://jp-red.lol.sgp.pvp.net",
- region_path: Some("JP1"),
- },
- Server {
- id: "KR",
- match_history: "https://apne1-red.pp.sgp.pvp.net",
- common: "https://kr-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "OC1",
- match_history: "https://apse1-red.pp.sgp.pvp.net",
- common: "https://oce-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "TW2",
- match_history: "https://apse1-red.pp.sgp.pvp.net",
- common: "https://tw2-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "SG2",
- match_history: "https://apse1-red.pp.sgp.pvp.net",
- common: "https://sg2-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "PH2",
- match_history: "https://apse1-red.pp.sgp.pvp.net",
- common: "https://ph2-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "VN2",
- match_history: "https://apse1-red.pp.sgp.pvp.net",
- common: "https://vn2-red.lol.sgp.pvp.net",
- region_path: None,
- },
- Server {
- id: "TH2",
- match_history: "https://apse1-red.pp.sgp.pvp.net",
- common: "https://th2-red.lol.sgp.pvp.net",
- region_path: None,
- },
-];
-
-/// Normalises the region the client reports into a server id. Some clients
-/// say "BR", others "BR1"; the table uses one spelling.
-pub fn server_id(region: &str) -> String {
- let upper = region.trim().to_ascii_uppercase();
- match upper.as_str() {
- "NA" => "NA1",
- "BR" => "BR1",
- "TR" => "TR1",
- "LAN" => "LA1",
- "LAS" => "LA2",
- "OCE" => "OC1",
- "EUW1" => "EUW",
- "JP1" => "JP",
- other => other,
- }
- .to_string()
-}
-
-pub fn server_for(region: &str) -> Option<Server> {
- let id = server_id(region);
- SERVERS.iter().copied().find(|s| s.id == id)
-}
-
-#[derive(Clone, Copy, Debug, PartialEq)]
-pub enum TokenKind {
- Entitlements,
- LeagueSession,
-}
-
-#[derive(Clone)]
-struct Tokens {
- entitlements: String,
- league_session: String,
- fetched: std::time::Instant,
-}
-
-static TOKENS: Lazy<Mutex<Option<Tokens>>> = Lazy::new(|| Mutex::new(None));
-const TOKEN_TTL: std::time::Duration = std::time::Duration::from_secs(300);
-
-async fn tokens(client: &LcuClient) -> Result<Tokens, String> {
- {
- let cached = TOKENS.lock().await;
- if let Some(t) = cached.as_ref() {
- if t.fetched.elapsed() < TOKEN_TTL {
- return Ok(t.clone());
- }
- }
- }
- let entitlements = lcu_get_raw(client, "/entitlements/v1/token")
- .await?
- .get("accessToken")
- .and_then(Value::as_str)
- .map(str::to_string)
- .ok_or_else(|| "no entitlements token".to_string())?;
- let session = lcu_get_raw(client, "/lol-league-session/v1/league-session-token").await?;
- let league_session = session
- .as_str()
- .map(str::to_string)
- .ok_or_else(|| "no league session token".to_string())?;
- let fresh = Tokens {
- entitlements,
- league_session,
- fetched: std::time::Instant::now(),
- };
- *TOKENS.lock().await = Some(fresh.clone());
- Ok(fresh)
-}
-
-pub async fn forget_tokens() {
- *TOKENS.lock().await = None;
-}
-
-static HTTP: Lazy<Option<reqwest::Client>> = Lazy::new(|| {
- reqwest::Client::builder()
- .timeout(std::time::Duration::from_secs(20))
- .build()
- .ok()
-});
-
-fn enabled() -> bool {
- super::league_settings().sgp_enabled
-}
-
-struct Target {
- server: Server,
- tokens: Tokens,
-}
-
-async fn target(client: &LcuClient) -> Result<Target, String> {
- if !enabled() {
- return Err("sgp disabled".to_string());
- }
- let region = client
- .region
- .clone()
- .ok_or_else(|| "region unknown".to_string())?;
- let server =
- server_for(&region).ok_or_else(|| format!("region {} has no sgp config", region))?;
- let tokens = tokens(client).await?;
- Ok(Target { server, tokens })
-}
-
-fn region_segment(server: &Server) -> &'static str {
- server.region_path.unwrap_or(server.id)
-}
-
-async fn send(
- target: &Target,
- kind: TokenKind,
- method: reqwest::Method,
- path: &str,
- body: Option<Value>,
-) -> Result<reqwest::Response, String> {
- let http = HTTP
- .clone()
- .ok_or_else(|| "http client init failed".to_string())?;
- let (host, token) = match kind {
- TokenKind::Entitlements => (target.server.match_history, &target.tokens.entitlements),
- TokenKind::LeagueSession => (target.server.common, &target.tokens.league_session),
- };
- let mut request = http
- .request(method, format!("{}{}", host, path))
- .bearer_auth(token);
- if let Some(b) = body {
- request = request.json(&b);
- }
- let response = request
- .send()
- .await
- .map_err(|e| format!("sgp request failed: {}", e))?;
- let status = response.status();
- if status == reqwest::StatusCode::UNAUTHORIZED || status == reqwest::StatusCode::FORBIDDEN {
- // A stale token is the common cause; the next call fetches a new one.
- forget_tokens().await;
- }
- if !status.is_success() {
- return Err(format!("sgp {} {}", status.as_u16(), path));
- }
- Ok(response)
-}
-
-async fn get_json(target: &Target, kind: TokenKind, path: &str) -> Result<Value, String> {
- send(target, kind, reqwest::Method::GET, path, None)
- .await?
- .json::<Value>()
- .await
- .map_err(|e| format!("sgp decode failed: {}", e))
-}
-
-/// Match history in the client's own (match-v5 style) shape.
-async fn match_history_raw(
- target: &Target,
- puuid: &str,
- start: u32,
- count: u32,
-) -> Result<Value, String> {
- get_json(
- target,
- TokenKind::Entitlements,
- &format!(
- "/match-history-query/v1/products/lol/player/{}/SUMMARY?startIndex={}&count={}",
- puuid, start, count
- ),
- )
- .await
-}
-
-/// Reshapes one SGP game into the layout the local match-history endpoint
-/// uses, so every stat routine in this module keeps working on either source.
-pub fn game_to_local(game: &Value, puuid: &str) -> Option<Value> {
- let json = game.get("json").unwrap_or(game);
- let participants = json.get("participants")?.as_array()?;
- let me = participants
- .iter()
- .find(|p| p.get("puuid").and_then(Value::as_str) == Some(puuid))
- .or_else(|| participants.first())?;
- let num = |key: &str| me.get(key).cloned().unwrap_or(json!(0));
- let mut stats = json!({
- "win": me.get("win"),
- "kills": num("kills"),
- "deaths": num("deaths"),
- "assists": num("assists"),
- "champLevel": num("champLevel"),
- "goldEarned": num("goldEarned"),
- "totalDamageDealtToChampions": num("totalDamageDealtToChampions"),
- "totalDamageTaken": num("totalDamageTaken"),
- "totalMinionsKilled": num("totalMinionsKilled"),
- "neutralMinionsKilled": num("neutralMinionsKilled"),
- "visionScore": num("visionScore"),
- "wardsPlaced": num("wardsPlaced"),
- "wardsKilled": num("wardsKilled"),
- "firstBloodKill": me.get("firstBloodKill"),
- "largestMultiKill": num("largestMultiKill"),
- });
- for i in 0..7 {
- let key = format!("item{}", i);
- stats[&key] = num(&key);
- }
- let identity = json!({
- "participantId": 1,
- "player": {
- "puuid": me.get("puuid"),
- "gameName": me.get("riotIdGameName"),
- "tagLine": me.get("riotIdTagline"),
- "summonerName": me.get("summonerName"),
- }
- });
- let participant = json!({
- "participantId": 1,
- "teamId": me.get("teamId"),
- "championId": me.get("championId"),
- "spell1Id": me.get("summoner1Id"),
- "spell2Id": me.get("summoner2Id"),
- "timeline": {
- "lane": me.get("lane"),
- "role": me.get("role"),
- "teamPosition": me.get("teamPosition"),
- },
- "stats": stats,
- });
- Some(json!({
- "gameId": json.get("gameId"),
- "gameCreation": json.get("gameCreation"),
- "gameDuration": json.get("gameDuration"),
- "gameMode": json.get("gameMode"),
- "gameType": json.get("gameType"),
- "queueId": json.get("queueId"),
- "mapId": json.get("mapId"),
- "platformId": json.get("platformId"),
- "source": "sgp",
- "participantIdentities": [identity],
- "participants": [participant],
- }))
-}
-
-/// Games for a player from the backend, already in the local shape. Empty
-/// (not an error) when SGP is off or the region is unsupported, so callers can
-/// fall through quietly.
-pub(crate) async fn match_history_local(
- client: &LcuClient,
- puuid: &str,
- start: u32,
- count: u32,
-) -> Result<Vec<Value>, String> {
- let target = target(client).await?;
- let raw = match_history_raw(&target, puuid, start, count.min(50)).await?;
- Ok(raw
- .get("games")
- .and_then(Value::as_array)
- .map(|games| {
- games
- .iter()
- .filter_map(|g| game_to_local(g, puuid))
- .collect()
- })
- .unwrap_or_default())
-}
-
-#[derive(Serialize)]
-pub struct SgpStatus {
- pub enabled: bool,
- pub supported: bool,
- pub server: Option<String>,
- pub region: Option<String>,
- pub tokens_ready: bool,
-}
-
-#[tauri::command]
-pub async fn league_sgp_status() -> Result<SgpStatus, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let region = client.region.clone();
- let server = region.as_deref().and_then(server_for);
- let tokens_ready = if enabled() && server.is_some() {
- tokens(&client).await.is_ok()
- } else {
- false
- };
- Ok(SgpStatus {
- enabled: enabled(),
- supported: server.is_some(),
- server: server.map(|s| s.id.to_string()),
- region,
- tokens_ready,
- })
-}
-
-/// Match history for any player, straight from the backend.
-#[tauri::command]
-pub async fn league_sgp_match_history(
- puuid: String,
- start: Option<u32>,
- count: Option<u32>,
-) -> Result<Value, String> {
- ensure_enabled()?;
- if puuid.is_empty() || !puuid.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') {
- return Err("invalid player".to_string());
- }
- let client = get_client().await?;
- let games =
- match_history_local(&client, &puuid, start.unwrap_or(0), count.unwrap_or(20)).await?;
- Ok(json!({ "games": { "games": games }, "source": "sgp" }))
-}
-
-/// Ranked stats straight from the leagues service, including previous
-/// season peaks the local endpoint leaves out.
-#[tauri::command]
-pub async fn league_sgp_ranked(puuid: String) -> Result<Value, String> {
- ensure_enabled()?;
- if puuid.is_empty() || !puuid.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') {
- return Err("invalid player".to_string());
- }
- let client = get_client().await?;
- let target = target(&client).await?;
- get_json(
- &target,
- TokenKind::LeagueSession,
- &format!("/leagues-ledge/v2/rankedStats/puuid/{}", puuid),
- )
- .await
-}
-
-/// Summoner records for a batch of puuids (names, levels, privacy).
-#[tauri::command]
-pub async fn league_sgp_summoners(puuids: Vec<String>) -> Result<Value, String> {
- ensure_enabled()?;
- if puuids.is_empty() || puuids.len() > 20 {
- return Err("give between 1 and 20 players".to_string());
- }
- let client = get_client().await?;
- let target = target(&client).await?;
- let path = format!(
- "/summoner-ledge/v1/regions/{}/summoners/puuids",
- region_segment(&target.server)
- );
- send(
- &target,
- TokenKind::LeagueSession,
- reqwest::Method::POST,
- &path,
- Some(json!(puuids)),
- )
- .await?
- .json::<Value>()
- .await
- .map_err(|e| format!("sgp decode failed: {}", e))
-}
-
-/// Downloads the replay file for a game into the default download folder.
-#[tauri::command]
-pub async fn league_sgp_download_replay(game_id: i64) -> Result<String, String> {
- ensure_enabled()?;
- if game_id <= 0 {
- return Err("invalid game".to_string());
- }
- let client = get_client().await?;
- let target = target(&client).await?;
- let region = region_segment(&target.server);
- let path = format!(
- "/match-history-query/v3/product/lol/matchId/{}_{}/infoType/replay",
- region, game_id
- );
- let response = send(
- &target,
- TokenKind::Entitlements,
- reqwest::Method::GET,
- &path,
- None,
- )
- .await?;
- let bytes = response
- .bytes()
- .await
- .map_err(|e| format!("replay download failed: {}", e))?;
- if bytes.is_empty() {
- return Err("replay not available".to_string());
- }
- let settings = crate::storage::config::load_settings_standalone();
- let dir = settings.download.default_output_dir.join("League replays");
- tokio::fs::create_dir_all(&dir)
- .await
- .map_err(|e| format!("cannot create folder: {}", e))?;
- let file = dir.join(format!("{}-{}.rofl", region, game_id));
- tokio::fs::write(&file, &bytes)
- .await
- .map_err(|e| format!("cannot write replay: {}", e))?;
- Ok(file.to_string_lossy().to_string())
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn region_spellings_collapse_onto_the_table() {
- assert_eq!(server_id("br"), "BR1");
- assert_eq!(server_id("BR1"), "BR1");
- assert_eq!(server_id("EUW1"), "EUW");
- assert_eq!(server_id("euw"), "EUW");
- assert_eq!(server_id("OCE"), "OC1");
- assert!(server_for("BR").is_some());
- assert!(
- server_for("EUN1").is_none(),
- "no host is guessed for a region outside the table"
- );
- assert_eq!(server_for("EUW").unwrap().region_path, Some("EUW1"));
- assert_eq!(region_segment(&server_for("BR1").unwrap()), "BR1");
- }
-
- #[test]
- fn a_backend_game_is_reshaped_for_the_local_stat_routines() {
- let game = json!({
- "metadata": {},
- "json": {
- "gameId": 42, "gameCreation": 1, "gameDuration": 1800, "queueId": 420, "gameMode": "CLASSIC",
- "participants": [
- { "puuid": "other", "championId": 1, "win": false, "kills": 0, "deaths": 9, "assists": 0 },
- { "puuid": "me", "championId": 7, "win": true, "kills": 5, "deaths": 2, "assists": 8,
- "goldEarned": 12000, "totalDamageDealtToChampions": 20000, "summoner1Id": 4, "summoner2Id": 12,
- "lane": "MIDDLE", "role": "SOLO", "teamPosition": "MIDDLE", "item0": 3, "riotIdGameName": "Me", "riotIdTagline": "BR1" }
- ]
- }
- });
- let local = game_to_local(&game, "me").unwrap();
- assert_eq!(local["gameId"], 42);
- assert_eq!(local["queueId"], 420);
- let p = &local["participants"][0];
- assert_eq!(p["championId"], 7);
- assert_eq!(p["spell1Id"], 4);
- assert_eq!(p["stats"]["win"], true);
- assert_eq!(p["stats"]["kills"], 5);
- assert_eq!(p["stats"]["goldEarned"], 12000);
- assert_eq!(p["stats"]["item0"], 3);
- assert_eq!(p["stats"]["item5"], 0);
- assert_eq!(p["timeline"]["lane"], "MIDDLE");
- assert_eq!(local["participantIdentities"][0]["player"]["puuid"], "me");
- assert_eq!(
- local["participantIdentities"][0]["player"]["gameName"],
- "Me"
- );
- assert!(game_to_local(&json!({ "json": {} }), "me").is_none());
- }
-}
diff --git a/src-tauri/src/commands/league/skins.rs b/src-tauri/src/commands/league/skins.rs
deleted file mode 100644
index 8e6141d7..00000000
--- a/src-tauri/src/commands/league/skins.rs
+++ /dev/null
@@ -1,449 +0,0 @@
-//! Skin and ward roulette: a random owned skin (and chroma) the moment a
-//! champion is locked, plus manual rerolls from the champ select card.
-//!
-//! The carousel endpoint is used instead of the inventory because it already
-//! knows what can be selected *right now* (ownership, loaners, disabled skins).
-
-use super::{ensure_enabled, get_client, lcu_get_raw, lcu_send, LcuClient};
-use once_cell::sync::Lazy;
-use rand::RngExt;
-use serde::Serialize;
-use serde_json::{json, Value};
-use std::collections::{HashMap, VecDeque};
-use tokio::sync::Mutex;
-
-/// How many recent rolls per champion are kept out of the next roll.
-pub const HISTORY_WINDOW: usize = 5;
-
-#[derive(Clone, Debug, Serialize)]
-pub struct Chroma {
- pub id: i64,
- pub name: String,
- pub colors: Vec<String>,
-}
-
-#[derive(Clone, Debug, Serialize)]
-pub struct SkinOption {
- pub id: i64,
- pub name: String,
- pub is_base: bool,
- pub chromas: Vec<Chroma>,
-}
-
-/// Skins the client would let the player select for the locked champion.
-pub fn selectable_skins(carousel: &Value) -> Vec<SkinOption> {
- let usable = |s: &Value| {
- s.get("unlocked").and_then(Value::as_bool).unwrap_or(false)
- && !s.get("disabled").and_then(Value::as_bool).unwrap_or(false)
- };
- carousel
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter(|s| usable(s))
- .filter_map(|s| {
- let chromas = s
- .get("childSkins")
- .and_then(Value::as_array)
- .map(|kids| {
- kids.iter()
- .filter(|c| usable(c))
- .filter_map(|c| {
- Some(Chroma {
- id: c.get("id").and_then(Value::as_i64)?,
- name: c
- .get("name")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string(),
- colors: c
- .get("colors")
- .and_then(Value::as_array)
- .map(|a| {
- a.iter()
- .filter_map(Value::as_str)
- .map(str::to_string)
- .collect()
- })
- .unwrap_or_default(),
- })
- })
- .collect()
- })
- .unwrap_or_default();
- Some(SkinOption {
- id: s.get("id").and_then(Value::as_i64)?,
- name: s
- .get("name")
- .and_then(Value::as_str)
- .unwrap_or("")
- .to_string(),
- is_base: s.get("isBase").and_then(Value::as_bool).unwrap_or(false),
- chromas,
- })
- })
- .collect()
- })
- .unwrap_or_default()
-}
-
-#[derive(Clone, Debug, PartialEq, Serialize)]
-pub struct Roll {
- pub skin_id: i64,
- pub skin_name: String,
- /// The id actually sent to the client: the chroma when one was rolled,
- /// otherwise the skin itself.
- pub selected_id: i64,
- pub chroma_name: Option<String>,
-}
-
-/// Picks a skin, then maybe a chroma of it. The base skin only competes when
-/// asked for (or when it is all there is), and skins rolled recently for this
-/// champion are skipped unless that would leave nothing to roll.
-pub fn roll<R: rand::Rng>(
- skins: &[SkinOption],
- recent: &[i64],
- include_base: bool,
- rng: &mut R,
-) -> Option<Roll> {
- if skins.is_empty() {
- return None;
- }
- let non_base: Vec<&SkinOption> = skins.iter().filter(|s| !s.is_base).collect();
- let pool: Vec<&SkinOption> = if include_base || non_base.is_empty() {
- skins.iter().collect()
- } else {
- non_base
- };
- let fresh: Vec<&SkinOption> = pool
- .iter()
- .copied()
- .filter(|s| !recent.contains(&s.id))
- .collect();
- let pool = if fresh.is_empty() { pool } else { fresh };
- let skin = pool[rng.random_range(0..pool.len())];
- // Slot 0 is "no chroma"; each chroma takes one more slot.
- let slot = rng.random_range(0..=skin.chromas.len());
- let chroma = if slot == 0 {
- None
- } else {
- skin.chromas.get(slot - 1)
- };
- Some(Roll {
- skin_id: skin.id,
- skin_name: skin.name.clone(),
- selected_id: chroma.map(|c| c.id).unwrap_or(skin.id),
- chroma_name: chroma.map(|c| c.name.clone()),
- })
-}
-
-/// Recent rolls per champion, so the same skin does not come back every game.
-static HISTORY: Lazy<Mutex<HashMap<i64, VecDeque<i64>>>> = Lazy::new(|| Mutex::new(HashMap::new()));
-/// Champion the automatic roll already handled in this champ select.
-static ROLLED_FOR: Lazy<Mutex<Option<i64>>> = Lazy::new(|| Mutex::new(None));
-static WARD_ROLLED: Lazy<Mutex<bool>> = Lazy::new(|| Mutex::new(false));
-
-pub async fn reset_session() {
- *ROLLED_FOR.lock().await = None;
- *WARD_ROLLED.lock().await = false;
-}
-
-async fn remember(champion_id: i64, skin_id: i64) {
- let mut history = HISTORY.lock().await;
- let entry = history.entry(champion_id).or_default();
- entry.push_back(skin_id);
- while entry.len() > HISTORY_WINDOW {
- entry.pop_front();
- }
-}
-
-async fn recent(champion_id: i64) -> Vec<i64> {
- HISTORY
- .lock()
- .await
- .get(&champion_id)
- .map(|h| h.iter().copied().collect())
- .unwrap_or_default()
-}
-
-async fn roll_and_apply(
- client: &LcuClient,
- champion_id: i64,
- include_base: bool,
-) -> Result<Roll, String> {
- let carousel = lcu_get_raw(client, "/lol-champ-select/v1/skin-carousel-skins").await?;
- let skins = selectable_skins(&carousel);
- let history = recent(champion_id).await;
- let rolled = {
- let mut rng = rand::rng();
- roll(&skins, &history, include_base, &mut rng)
- }
- .ok_or_else(|| "no skin to roll".to_string())?;
- lcu_send(
- client,
- reqwest::Method::PATCH,
- "/lol-champ-select/v1/session/my-selection",
- Some(json!({ "selectedSkinId": rolled.selected_id })),
- )
- .await?;
- remember(champion_id, rolled.skin_id).await;
- tracing::info!(
- "[league] skin roulette: {} ({})",
- rolled.skin_name,
- rolled.chroma_name.as_deref().unwrap_or("no chroma")
- );
- Ok(rolled)
-}
-
-/// Owned ward skins, as item ids.
-pub fn owned_ward_ids(inventory: &Value) -> Vec<i64> {
- inventory
- .as_array()
- .map(|arr| {
- arr.iter()
- .filter(|e| e.get("owned").and_then(Value::as_bool).unwrap_or(false))
- .filter_map(|e| e.get("itemId").and_then(Value::as_i64))
- .filter(|id| *id >= 0)
- .collect()
- })
- .unwrap_or_default()
-}
-
-/// The account loadout slot that holds the ward, as (loadout id, item id).
-pub fn ward_slot(loadouts: &Value) -> Option<(String, i64)> {
- let arr = loadouts.as_array()?;
- for loadout in arr {
- let id = loadout.get("id").and_then(Value::as_str)?;
- if let Some(item) = loadout
- .get("loadout")
- .and_then(|l| l.get("WARD_SKIN_SLOT"))
- .and_then(|s| s.get("itemId"))
- .and_then(Value::as_i64)
- {
- return Some((id.to_string(), item));
- }
- }
- None
-}
-
-pub fn roll_ward<R: rand::Rng>(owned: &[i64], current: i64, rng: &mut R) -> Option<i64> {
- let pool: Vec<i64> = owned.iter().copied().filter(|id| *id != current).collect();
- if pool.is_empty() {
- return None;
- }
- Some(pool[rng.random_range(0..pool.len())])
-}
-
-async fn roll_ward_and_apply(client: &LcuClient) -> Result<i64, String> {
- let inventory = lcu_get_raw(client, "/lol-inventory/v2/inventory/WARD_SKIN").await?;
- let owned = owned_ward_ids(&inventory);
- let loadouts = lcu_get_raw(client, "/lol-loadouts/v4/loadouts/scope/account").await?;
- let (loadout_id, current) = ward_slot(&loadouts).ok_or_else(|| "no ward slot".to_string())?;
- let picked = {
- let mut rng = rand::rng();
- roll_ward(&owned, current, &mut rng)
- }
- .ok_or_else(|| "no ward skin to roll".to_string())?;
- // A partial body only touches the ward slot; the client merges the rest.
- lcu_send(
- client,
- reqwest::Method::PATCH,
- &format!("/lol-loadouts/v4/loadouts/{}", loadout_id),
- Some(json!({
- "loadout": {
- "WARD_SKIN_SLOT": {
- "contentId": "",
- "data": {},
- "inventoryType": "WARD_SKIN",
- "itemId": picked,
- }
- }
- })),
- )
- .await?;
- tracing::info!("[league] ward roulette: {} -> {}", current, picked);
- Ok(picked)
-}
-
-/// Called on every champ select update: rolls once per locked champion.
-pub(crate) async fn on_champ_select(
- client: &LcuClient,
- settings: &omniget_core::models::settings::LeagueSettings,
- session: &Value,
-) {
- if !settings.skin_roulette && !settings.ward_roulette {
- return;
- }
- let champion = super::champ_select::locked_champion(session);
- if champion <= 0 {
- return;
- }
- if settings.skin_roulette {
- let already = { *ROLLED_FOR.lock().await == Some(champion) };
- if !already {
- *ROLLED_FOR.lock().await = Some(champion);
- if let Err(e) =
- roll_and_apply(client, champion, settings.skin_roulette_include_base).await
- {
- tracing::debug!("[league] skin roulette skipped: {}", e);
- }
- }
- }
- if settings.ward_roulette {
- let already = { *WARD_ROLLED.lock().await };
- if !already {
- *WARD_ROLLED.lock().await = true;
- if let Err(e) = roll_ward_and_apply(client).await {
- tracing::debug!("[league] ward roulette skipped: {}", e);
- }
- }
- }
-}
-
-/// Manual reroll from the champ select card.
-#[tauri::command]
-pub async fn league_roll_skin(include_base: Option<bool>) -> Result<Roll, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let session = lcu_get_raw(&client, "/lol-champ-select/v1/session").await?;
- let champion = super::champ_select::locked_champion(&session);
- if champion <= 0 {
- return Err("lock a champion first".to_string());
- }
- let include_base =
- include_base.unwrap_or_else(|| super::league_settings().skin_roulette_include_base);
- roll_and_apply(&client, champion, include_base).await
-}
-
-#[tauri::command]
-pub async fn league_roll_ward() -> Result<i64, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- roll_ward_and_apply(&client).await
-}
-
-/// What the champ select card shows: the selectable skins and the current pick.
-#[tauri::command]
-pub async fn league_skin_carousel() -> Result<Value, String> {
- ensure_enabled()?;
- let client = get_client().await?;
- let carousel = lcu_get_raw(&client, "/lol-champ-select/v1/skin-carousel-skins").await?;
- let selected = lcu_get_raw(&client, "/lol-champ-select/v1/session/my-selection")
- .await
- .ok()
- .and_then(|s| s.get("selectedSkinId").and_then(Value::as_i64))
- .unwrap_or(0);
- Ok(json!({
- "skins": selectable_skins(&carousel),
- "selectedSkinId": selected,
- }))
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use rand::SeedableRng;
-
- fn skin(id: i64, base: bool, chromas: &[i64]) -> SkinOption {
- SkinOption {
- id,
- name: format!("skin {}", id),
- is_base: base,
- chromas: chromas
- .iter()
- .map(|c| Chroma {
- id: *c,
- name: format!("chroma {}", c),
- colors: vec![],
- })
- .collect(),
- }
- }
-
- #[test]
- fn only_unlocked_and_enabled_skins_are_selectable() {
- let carousel = json!([
- { "id": 1, "name": "Base", "isBase": true, "unlocked": true, "disabled": false, "childSkins": [] },
- { "id": 2, "name": "Locked", "isBase": false, "unlocked": false, "disabled": false, "childSkins": [] },
- { "id": 3, "name": "Broken", "isBase": false, "unlocked": true, "disabled": true, "childSkins": [] },
- { "id": 4, "name": "Good", "isBase": false, "unlocked": true, "disabled": false, "childSkins": [
- { "id": 41, "name": "Ruby", "unlocked": true, "disabled": false, "colors": ["#f00"] },
- { "id": 42, "name": "Locked chroma", "unlocked": false, "disabled": false }
- ] }
- ]);
- let skins = selectable_skins(&carousel);
- let ids: Vec<i64> = skins.iter().map(|s| s.id).collect();
- assert_eq!(ids, vec![1, 4]);
- assert_eq!(skins[1].chromas.len(), 1);
- assert_eq!(skins[1].chromas[0].colors, vec!["#f00"]);
- }
-
- #[test]
- fn the_base_skin_is_left_out_while_there_is_something_else() {
- let skins = vec![skin(1, true, &[]), skin(2, false, &[])];
- let mut rng = rand::rngs::StdRng::seed_from_u64(1);
- for _ in 0..20 {
- assert_eq!(roll(&skins, &[], false, &mut rng).unwrap().skin_id, 2);
- }
- // Nothing but the base: it is rolled anyway.
- let only_base = vec![skin(1, true, &[])];
- assert_eq!(roll(&only_base, &[], false, &mut rng).unwrap().skin_id, 1);
- assert!(roll(&[], &[], true, &mut rng).is_none());
- }
-
- #[test]
- fn recent_rolls_are_skipped_unless_that_empties_the_pool() {
- let skins = vec![skin(2, false, &[]), skin(3, false, &[])];
- let mut rng = rand::rngs::StdRng::seed_from_u64(3);
- for _ in 0..20 {
- assert_eq!(roll(&skins, &[2], false, &mut rng).unwrap().skin_id, 3);
- }
- let rolled = roll(&skins, &[2, 3], false, &mut rng).unwrap();
- assert!([2, 3].contains(&rolled.skin_id));
- }
-
- #[test]
- fn a_chroma_roll_sends_the_chroma_id() {
- let skins = vec![skin(5, false, &[51])];
- let mut rng = rand::rngs::StdRng::seed_from_u64(0);
- let mut saw_chroma = false;
- let mut saw_plain = false;
- for _ in 0..40 {
- let r = roll(&skins, &[], false, &mut rng).unwrap();
- assert_eq!(r.skin_id, 5);
- match r.chroma_name {
- Some(_) => {
- assert_eq!(r.selected_id, 51);
- saw_chroma = true;
- }
- None => {
- assert_eq!(r.selected_id, 5);
- saw_plain = true;
- }
- }
- }
- assert!(saw_chroma && saw_plain);
- }
-
- #[test]
- fn the_ward_roll_never_repeats_the_current_ward() {
- let mut rng = rand::rngs::StdRng::seed_from_u64(9);
- for _ in 0..20 {
- assert_eq!(roll_ward(&[1, 2], 1, &mut rng), Some(2));
- }
- assert_eq!(roll_ward(&[1], 1, &mut rng), None);
- assert_eq!(roll_ward(&[], 1, &mut rng), None);
- }
-
- #[test]
- fn the_ward_slot_is_read_from_the_account_loadout() {
- let loadouts = json!([
- { "id": "a", "loadout": { "EMOTES_WHEEL": {} } },
- { "id": "b", "loadout": { "WARD_SKIN_SLOT": { "itemId": 7 } } }
- ]);
- assert_eq!(ward_slot(&loadouts), Some(("b".to_string(), 7)));
- assert_eq!(ward_slot(&json!([])), None);
- let inventory = json!([{ "itemId": 1, "owned": true }, { "itemId": 2, "owned": false }]);
- assert_eq!(owned_ward_ids(&inventory), vec![1]);
- }
-}
diff --git a/src-tauri/src/commands/league/stats.rs b/src-tauri/src/commands/league/stats.rs
deleted file mode 100644
index f35c73ca..00000000
--- a/src-tauri/src/commands/league/stats.rs
+++ /dev/null
@@ -1,1039 +0,0 @@
-//! Statistical model for pre-game win probability and per-role performance.
-//!
-//! The estimator is deliberately conservative: matchmaking targets balanced
-//! games, so honest outputs cluster near 50% and always carry an interval.
-
-/// Prior strength for the Beta-Binomial shrinkage, expressed in games.
-/// A player with `PRIOR_GAMES` games is pulled halfway to the 50% baseline.
-pub const PRIOR_GAMES: f64 = 40.0;
-
-/// Elo scale: a rating gap of `ELO_SCALE` means 10:1 odds in the logistic model.
-pub const ELO_SCALE: f64 = 400.0;
-
-/// Converts log-odds into Elo-equivalent rating points (400 / ln(10)).
-pub const LOGIT_TO_ELO: f64 = 173.717_792_76;
-
-/// Rating points per full tier (Iron -> Bronze -> ...).
-pub const TIER_POINTS: f64 = 400.0;
-
-/// Rating points per division inside a tier.
-pub const DIVISION_POINTS: f64 = 100.0;
-
-/// Rating floor: Iron IV. Community MMR estimates put Iron around 600 and the
-/// median player (high Silver / low Gold) around 1400-1500.
-pub const RATING_FLOOR: f64 = 600.0;
-
-/// Default rating for players whose rank is unknown or hidden (ladder median).
-pub const UNRANKED_RATING: f64 = 1500.0;
-
-/// Rating uncertainty (in points) assumed for a player with no usable data.
-pub const UNKNOWN_SIGMA: f64 = 260.0;
-
-/// How much the win-rate signal is allowed to move a player's rating.
-///
-/// Kept below 1 on purpose: matchmaking drives win rate back to 50%, so it
-/// measures displacement from one's own bracket, not absolute skill.
-pub const FORM_WEIGHT: f64 = 0.5;
-
-/// Rating uncertainty from the gap between hidden MMR and the visible rank,
-/// about one division.
-pub const RANK_SIGMA: f64 = 100.0;
-
-/// z value for a 90% two-sided interval.
-pub const Z_90: f64 = 1.644_853_63;
-
-/// Beta-Binomial posterior mean with a prior centred on 50%.
-///
-/// `(w + k/2) / (n + k)` — the estimate of a 10-game sample is dominated by the
-/// prior, while a 1000-game sample is essentially its own raw rate. This is what
-/// makes 50% over 1000 games and 50% over 10 games behave differently: the point
-/// estimate matches, but the confidence (see [`beta_posterior_sd`]) does not.
-pub fn shrunk_winrate(wins: u32, losses: u32, prior_games: f64) -> f64 {
- let n = (wins + losses) as f64;
- let half = prior_games / 2.0;
- (wins as f64 + half) / (n + prior_games)
-}
-
-/// Standard deviation of the Beta posterior, i.e. how unsure we are about the
-/// shrunk win rate. Shrinks as 1/sqrt(n), so large samples are trusted more.
-pub fn beta_posterior_sd(wins: u32, losses: u32, prior_games: f64) -> f64 {
- let half = prior_games / 2.0;
- let a = wins as f64 + half;
- let b = losses as f64 + half;
- let total = a + b;
- ((a * b) / (total * total * (total + 1.0))).sqrt()
-}
-
-/// Wilson score interval for a binomial proportion.
-///
-/// Preferred over the normal approximation because it stays inside `[0, 1]` and
-/// keeps sensible coverage for small `n` (where `p̂ ± z·sqrt(p̂q̂/n)` breaks down).
-pub fn wilson_interval(wins: u32, losses: u32, z: f64) -> (f64, f64) {
- let n = (wins + losses) as f64;
- if n <= 0.0 {
- return (0.0, 1.0);
- }
- let p = wins as f64 / n;
- let z2 = z * z;
- let denom = 1.0 + z2 / n;
- let center = (p + z2 / (2.0 * n)) / denom;
- let margin = (z / denom) * ((p * (1.0 - p) / n) + z2 / (4.0 * n * n)).sqrt();
- ((center - margin).max(0.0), (center + margin).min(1.0))
-}
-
-/// Maps a ranked tier/division/LP triple onto a continuous rating scale.
-///
-/// Divisions are numbered from IV (lowest) to I (highest); apex tiers have a
-/// single division and let LP run past 100.
-pub fn rank_rating(tier: &str, division: &str, league_points: u32) -> Option<f64> {
- let tier_index = match tier.to_ascii_uppercase().as_str() {
- "IRON" => 0.0,
- "BRONZE" => 1.0,
- "SILVER" => 2.0,
- "GOLD" => 3.0,
- "PLATINUM" => 4.0,
- "EMERALD" => 5.0,
- "DIAMOND" => 6.0,
- "MASTER" => 7.0,
- "GRANDMASTER" => 8.0,
- "CHALLENGER" => 9.0,
- _ => return None,
- };
- let division_index = match division.to_ascii_uppercase().as_str() {
- "IV" | "4" => 0.0,
- "III" | "3" => 1.0,
- "II" | "2" => 2.0,
- "I" | "1" | "NA" | "" => 3.0,
- _ => 0.0,
- };
- let apex = tier_index >= 7.0;
- let base = RATING_FLOOR + tier_index * TIER_POINTS;
- if apex {
- // Apex tiers have no divisions; LP keeps climbing, so compress it.
- Some(base + (league_points as f64).min(2000.0) * 0.4)
- } else {
- Some(base + division_index * DIVISION_POINTS + (league_points as f64).min(100.0))
- }
-}
-
-/// Rating adjustment derived from a win rate, in Elo-equivalent points.
-///
-/// A shrunk 50% rate contributes nothing; deviations are converted through the
-/// logit so the scale matches the logistic win model.
-pub fn winrate_rating_delta(shrunk: f64) -> f64 {
- let p = shrunk.clamp(0.001, 0.999);
- (p / (1.0 - p)).ln() * LOGIT_TO_ELO
-}
-
-/// Logistic expectancy: probability that a rating of `a` beats a rating of `b`.
-pub fn elo_expectancy(a: f64, b: f64) -> f64 {
- 1.0 / (1.0 + 10f64.powf((b - a) / ELO_SCALE))
-}
-
-/// Log5 (Bradley-Terry) combination of two independent win rates.
-///
-/// `P = (pa − pa·pb) / (pa + pb − 2·pa·pb)` — used as a cross-check of the Elo
-/// path; both reduce to the same answer for symmetric inputs.
-pub fn log5(pa: f64, pb: f64) -> f64 {
- let num = pa - pa * pb;
- let den = pa + pb - 2.0 * pa * pb;
- if den.abs() < f64::EPSILON {
- 0.5
- } else {
- num / den
- }
-}
-
-/// One player's contribution to the team strength estimate.
-#[derive(Debug, Clone, Copy)]
-pub struct PlayerStrength {
- /// Point estimate of the player's rating.
- pub rating: f64,
- /// Standard deviation of that estimate, in rating points.
- pub sigma: f64,
- /// False when the player had no usable rank or history.
- pub known: bool,
-}
-
-impl PlayerStrength {
- pub fn unknown() -> Self {
- Self {
- rating: UNRANKED_RATING,
- sigma: UNKNOWN_SIGMA,
- known: false,
- }
- }
-}
-
-/// Builds a player's strength from rank plus win-rate evidence.
-///
-/// Rank carries the skill signal (matchmaking pushes win rate back to ~50% at
-/// equilibrium, so a win rate mostly measures whether someone is currently
-/// climbing or sliding). Season and recent samples enter as shrunk deviations.
-pub fn player_strength(
- rank: Option<f64>,
- season_wins: u32,
- season_losses: u32,
- recent_wins: u32,
- recent_losses: u32,
-) -> PlayerStrength {
- let season_games = season_wins + season_losses;
- let recent_games = recent_wins + recent_losses;
- if rank.is_none() && season_games == 0 && recent_games == 0 {
- return PlayerStrength::unknown();
- }
-
- let base = rank.unwrap_or(UNRANKED_RATING);
- // Rank is the strong signal; without it we fall back to a wide prior.
- let base_sigma = if rank.is_some() {
- RANK_SIGMA
- } else {
- UNKNOWN_SIGMA
- };
-
- let season_p = shrunk_winrate(season_wins, season_losses, PRIOR_GAMES);
- let season_delta = winrate_rating_delta(season_p);
- let season_sd = beta_posterior_sd(season_wins, season_losses, PRIOR_GAMES);
-
- let recent_p = shrunk_winrate(recent_wins, recent_losses, PRIOR_GAMES);
- let recent_delta = winrate_rating_delta(recent_p);
- let recent_sd = beta_posterior_sd(recent_wins, recent_losses, PRIOR_GAMES);
-
- // Season sample is larger and steadier; recent games carry the form signal.
- let delta = FORM_WEIGHT * (0.65 * season_delta + 0.35 * recent_delta);
-
- // Delta method: d(rating)/d(p) = LOGIT_TO_ELO / (p(1-p)).
- let season_slope = LOGIT_TO_ELO / (season_p * (1.0 - season_p)).max(1e-6);
- let recent_slope = LOGIT_TO_ELO / (recent_p * (1.0 - recent_p)).max(1e-6);
- let delta_sigma = FORM_WEIGHT
- * ((0.65 * season_slope * season_sd).powi(2) + (0.35 * recent_slope * recent_sd).powi(2))
- .sqrt();
-
- PlayerStrength {
- rating: base + delta,
- sigma: (base_sigma.powi(2) + delta_sigma.powi(2)).sqrt(),
- known: true,
- }
-}
-
-/// Result of the team-vs-team comparison.
-#[derive(Debug, Clone, Copy)]
-pub struct WinProbability {
- /// Point estimate for the ally team.
- pub probability: f64,
- /// Lower bound of the 90% interval.
- pub low: f64,
- /// High bound of the 90% interval.
- pub high: f64,
- /// Mean rating gap in Elo points (positive favours the allies).
- pub rating_gap: f64,
- /// How many of the ten players contributed real data.
- pub known_players: usize,
- pub total_players: usize,
-}
-
-/// Aggregates both teams and returns the ally win probability with an interval.
-///
-/// Teams are equal size, so the mean rating is the right aggregate under a
-/// Bradley-Terry model with additive strengths. The interval comes from
-/// propagating each player's variance through the mean and then through the
-/// logistic — it is wide on purpose when players are unknown.
-pub fn team_win_probability(
- allies: &[PlayerStrength],
- enemies: &[PlayerStrength],
-) -> WinProbability {
- let total_players = allies.len() + enemies.len();
- let known_players =
- allies.iter().filter(|p| p.known).count() + enemies.iter().filter(|p| p.known).count();
-
- if allies.is_empty() || enemies.is_empty() {
- return WinProbability {
- probability: 0.5,
- low: 0.0,
- high: 1.0,
- rating_gap: 0.0,
- known_players,
- total_players,
- };
- }
-
- let mean = |team: &[PlayerStrength]| -> f64 {
- team.iter().map(|p| p.rating).sum::<f64>() / team.len() as f64
- };
- // Variance of a mean of independent estimates: sum(sigma^2) / n^2.
- let mean_var = |team: &[PlayerStrength]| -> f64 {
- team.iter().map(|p| p.sigma * p.sigma).sum::<f64>() / (team.len() as f64).powi(2)
- };
-
- let gap = mean(allies) - mean(enemies);
- let gap_sigma = (mean_var(allies) + mean_var(enemies)).sqrt();
-
- let probability = elo_expectancy(mean(allies), mean(enemies));
- let low = elo_expectancy(gap - Z_90 * gap_sigma, 0.0);
- let high = elo_expectancy(gap + Z_90 * gap_sigma, 0.0);
-
- WinProbability {
- probability,
- low: low.min(probability),
- high: high.max(probability),
- rating_gap: gap,
- known_players,
- total_players,
- }
-}
-
-/// Per-minute normalisation guarding against zero-length games.
-pub fn per_minute(value: f64, seconds: f64) -> f64 {
- if seconds <= 0.0 {
- 0.0
- } else {
- value / (seconds / 60.0)
- }
-}
-
-/// KDA ratio with the usual "perfect KDA" convention when deaths are zero.
-pub fn kda(kills: u32, deaths: u32, assists: u32) -> f64 {
- let k = (kills + assists) as f64;
- if deaths == 0 {
- k
- } else {
- k / deaths as f64
- }
-}
-
-/// Kill participation: share of the team's kills the player was involved in.
-pub fn kill_participation(kills: u32, assists: u32, team_kills: u32) -> f64 {
- if team_kills == 0 {
- 0.0
- } else {
- ((kills + assists) as f64 / team_kills as f64).min(1.0)
- }
-}
-
-/// Gold value carried in a player's item slots (exact, from live item prices).
-pub fn items_gold(prices: &[(u32, u32)]) -> u32 {
- prices.iter().map(|(price, count)| price * count).sum()
-}
-
-/// Default performance targets per role, used until the user overrides them.
-#[derive(Debug, Clone, Copy)]
-pub struct RoleTargets {
- pub cs_per_min: f64,
- pub gold_per_min: f64,
- pub kda: f64,
- pub vision_per_min: f64,
- pub damage_share: f64,
-}
-
-/// Baselines are per-role because a support's CS target is not a mid's.
-pub fn default_targets(position: &str) -> RoleTargets {
- match position.to_ascii_uppercase().as_str() {
- "TOP" => RoleTargets {
- cs_per_min: 7.0,
- gold_per_min: 380.0,
- kda: 2.5,
- vision_per_min: 0.6,
- damage_share: 0.22,
- },
- "JUNGLE" => RoleTargets {
- cs_per_min: 5.5,
- gold_per_min: 360.0,
- kda: 3.0,
- vision_per_min: 1.0,
- damage_share: 0.18,
- },
- "MIDDLE" | "MID" => RoleTargets {
- cs_per_min: 7.5,
- gold_per_min: 400.0,
- kda: 3.0,
- vision_per_min: 0.7,
- damage_share: 0.27,
- },
- "BOTTOM" | "ADC" => RoleTargets {
- cs_per_min: 8.0,
- gold_per_min: 420.0,
- kda: 3.0,
- vision_per_min: 0.6,
- damage_share: 0.28,
- },
- "UTILITY" | "SUPPORT" => RoleTargets {
- cs_per_min: 1.5,
- gold_per_min: 260.0,
- kda: 3.0,
- vision_per_min: 2.0,
- damage_share: 0.10,
- },
- _ => RoleTargets {
- cs_per_min: 6.0,
- gold_per_min: 360.0,
- kda: 2.5,
- vision_per_min: 0.8,
- damage_share: 0.20,
- },
- }
-}
-
-/// Share of a team total, expressed against an even split.
-///
-/// `1.0` means the player carried exactly their fair share (1/team_size);
-/// `2.0` means double it. Returns 0 when the team total is unusable.
-pub fn contribution_ratio(value: f64, team_total: f64, team_size: usize) -> f64 {
- if team_total <= 0.0 || team_size == 0 {
- return 0.0;
- }
- (value / team_total) * team_size as f64
-}
-
-/// Kill-damage efficiency: kill share divided by damage share.
-///
-/// Above 1 the player converts less damage into more kills (finishing or
-/// stealing); below 1 they deal damage others convert. Neutral when unknown.
-pub fn kill_damage_efficiency(kills: u32, team_kills: u32, damage: f64, team_damage: f64) -> f64 {
- if team_kills == 0 || team_damage <= 0.0 || damage <= 0.0 {
- return 1.0;
- }
- let kill_share = kills as f64 / team_kills as f64;
- let damage_share = damage / team_damage;
- if damage_share <= 0.0 {
- 1.0
- } else {
- kill_share / damage_share
- }
-}
-
-/// Linear ramp used by the impact components: `min` scores 0, `max` scores full.
-fn ramp(value: f64, min: f64, max: f64, weight: f64) -> f64 {
- if max <= min {
- return 0.0;
- }
- ((value - min) / (max - min)).clamp(0.0, 1.0) * weight
-}
-
-/// Inputs for the composite impact score, all taken from one finished game.
-#[derive(Debug, Clone, Copy, Default)]
-pub struct ImpactInput {
- pub kills: u32,
- pub deaths: u32,
- pub assists: u32,
- pub team_kills: u32,
- pub damage_to_champions: f64,
- pub team_damage: f64,
- pub damage_taken: f64,
- pub team_damage_taken: f64,
- pub gold: f64,
- pub team_gold: f64,
- pub cs: f64,
- pub vision_score: f64,
- pub team_vision: f64,
- pub duration_seconds: f64,
- pub team_size: usize,
-}
-
-/// Composite 0-10 impact score for a single game.
-///
-/// Every component is a bounded ramp, so no single stat can dominate and the
-/// result stays comparable across roles and game lengths.
-pub fn impact_score(input: &ImpactInput) -> f64 {
- let team_size = if input.team_size == 0 {
- 5
- } else {
- input.team_size
- };
-
- // KDA on a square-root curve: the gap from 2 to 5 matters more than 8 to 11.
- let kda_value = kda(input.kills, input.deaths, input.assists);
- let kda_component = ramp((kda_value - 2.0).max(0.0).sqrt(), 0.0, 2.2, 1.5);
-
- let kp = kill_participation(input.kills, input.assists, input.team_kills);
- let kp_component = ramp(kp, 0.3, 1.0, 1.5);
-
- let damage_component = ramp(
- contribution_ratio(input.damage_to_champions, input.team_damage, team_size),
- 1.0,
- 2.0,
- 2.0,
- );
- let tank_component = ramp(
- contribution_ratio(input.damage_taken, input.team_damage_taken, team_size),
- 1.0,
- 2.0,
- 1.0,
- );
- let gold_component = ramp(
- contribution_ratio(input.gold, input.team_gold, team_size),
- 1.0,
- 1.5,
- 1.5,
- );
- let vision_component = ramp(
- contribution_ratio(input.vision_score, input.team_vision, team_size),
- 1.0,
- 2.0,
- 1.5,
- );
- let cs_component = ramp(per_minute(input.cs, input.duration_seconds), 4.0, 9.0, 1.0);
-
- (kda_component
- + kp_component
- + damage_component
- + tank_component
- + gold_component
- + vision_component
- + cs_component)
- .clamp(0.0, 10.0)
-}
-
-/// Queues whose result carries signal for a player score. Customs, bots and
-/// rotating modes are left out.
-pub const SCORED_QUEUES: [i64; 5] = [400, 420, 430, 440, 450];
-
-/// Below this many usable games the average describes luck, not the player, so no
-/// score is reported at all — an honest blank beats a confident wrong number.
-pub const SCORE_MIN_GAMES: usize = 5;
-
-/// Games shorter than this were remakes.
-pub const SCORE_MIN_DURATION: i64 = 180;
-
-pub struct ScoredGame {
- pub queue_id: i64,
- pub duration: i64,
- pub kills: i64,
- pub deaths: i64,
- pub assists: i64,
- pub win: bool,
- pub support: bool,
-}
-
-pub fn score_counts(game: &ScoredGame) -> bool {
- SCORED_QUEUES.contains(&game.queue_id) && game.duration >= SCORE_MIN_DURATION
-}
-
-/// One game's contribution: a KDA-like ratio (assists worth a little more for
-/// supports, whose impact rarely shows up as kills), minus a penalty for games
-/// that ran away, plus the result.
-pub fn game_score(game: &ScoredGame) -> f64 {
- let assist_weight = if game.support { 1.2 } else { 1.0 };
- let ratio =
- (game.kills as f64 + game.assists as f64 * assist_weight) / (game.deaths.max(1) as f64);
- let penalty = if game.deaths > 20 && game.kills <= 10 {
- 1.0
- } else if game.deaths > 15 && game.kills <= 10 {
- 0.5
- } else {
- 0.0
- };
- ratio - penalty + if game.win { 1.0 } else { -1.0 }
-}
-
-/// Average score over the usable games, or `None` when the sample is too small.
-pub fn player_score(games: &[ScoredGame]) -> (Option<f64>, usize) {
- let usable: Vec<&ScoredGame> = games.iter().filter(|g| score_counts(g)).collect();
- if usable.len() < SCORE_MIN_GAMES {
- return (None, usable.len());
- }
- let total: f64 = usable.iter().map(|g| game_score(g)).sum();
- (Some(total / usable.len() as f64), usable.len())
-}
-
-/// Groups players that share a party id, which the gameflow session reports
-/// directly. Solo players carry a unique id, so single-player groups are
-/// dropped just like in the history-based detection.
-pub fn party_groups(party_ids: &[Option<String>]) -> Vec<Vec<usize>> {
- let mut buckets: std::collections::HashMap<&str, Vec<usize>> = std::collections::HashMap::new();
- for (index, id) in party_ids.iter().enumerate() {
- if let Some(id) = id.as_deref().filter(|s| !s.is_empty()) {
- buckets.entry(id).or_default().push(index);
- }
- }
- let mut groups: Vec<Vec<usize>> = buckets.into_values().filter(|g| g.len() > 1).collect();
- for group in groups.iter_mut() {
- group.sort_unstable();
- }
- groups.sort_by(|a, b| a[0].cmp(&b[0]));
- groups
-}
-
-/// Disjoint-set forest used to merge overlapping premade pairs.
-struct DisjointSet {
- parent: Vec<usize>,
-}
-
-impl DisjointSet {
- fn new(n: usize) -> Self {
- Self {
- parent: (0..n).collect(),
- }
- }
-
- fn find(&mut self, x: usize) -> usize {
- if self.parent[x] != x {
- let root = self.find(self.parent[x]);
- self.parent[x] = root;
- }
- self.parent[x]
- }
-
- fn union(&mut self, a: usize, b: usize) {
- let (ra, rb) = (self.find(a), self.find(b));
- if ra != rb {
- self.parent[rb] = ra;
- }
- }
-}
-
-/// Groups players that keep showing up in each other's recent games.
-///
-/// `pairs` holds `(i, j, shared_games)`. Pairs at or above `threshold` are
-/// merged transitively, so a duo that both queue with a third player surfaces as
-/// one trio. Groups of a single player are dropped.
-pub fn premade_groups(
- player_count: usize,
- pairs: &[(usize, usize, u32)],
- threshold: u32,
-) -> Vec<Vec<usize>> {
- if player_count == 0 {
- return Vec::new();
- }
- let mut sets = DisjointSet::new(player_count);
- for (a, b, shared) in pairs {
- if *shared >= threshold && *a < player_count && *b < player_count {
- sets.union(*a, *b);
- }
- }
- let mut buckets: std::collections::HashMap<usize, Vec<usize>> =
- std::collections::HashMap::new();
- for i in 0..player_count {
- let root = sets.find(i);
- buckets.entry(root).or_default().push(i);
- }
- let mut groups: Vec<Vec<usize>> = buckets
- .into_values()
- .filter(|g| g.len() > 1)
- .map(|mut g| {
- g.sort_unstable();
- g
- })
- .collect();
- groups.sort_by(|a, b| a[0].cmp(&b[0]));
- groups
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- fn close(a: f64, b: f64, tol: f64) -> bool {
- (a - b).abs() < tol
- }
-
- #[test]
- fn shrinkage_pulls_small_samples_toward_the_baseline() {
- // 60% over 10 games is mostly prior; 60% over 1000 games is trusted.
- let small = shrunk_winrate(6, 4, PRIOR_GAMES);
- let large = shrunk_winrate(600, 400, PRIOR_GAMES);
- assert!(small < large, "small sample must shrink harder");
- assert!(close(small, 0.52, 0.01), "got {}", small);
- assert!(close(large, 0.596, 0.005), "got {}", large);
- }
-
- #[test]
- fn equal_rates_differ_only_in_confidence() {
- // The user's question: 50% over 1000 vs 50% over 10.
- let few = shrunk_winrate(5, 5, PRIOR_GAMES);
- let many = shrunk_winrate(500, 500, PRIOR_GAMES);
- assert!(close(few, 0.5, 1e-9));
- assert!(close(many, 0.5, 1e-9));
-
- let sd_few = beta_posterior_sd(5, 5, PRIOR_GAMES);
- let sd_many = beta_posterior_sd(500, 500, PRIOR_GAMES);
- assert!(sd_few > sd_many * 4.0, "large sample must be far tighter");
- }
-
- #[test]
- fn wilson_interval_matches_known_values() {
- // Textbook check: 10 successes in 20 trials at 95% -> about (0.299, 0.701).
- let (lo, hi) = wilson_interval(10, 10, 1.959_964);
- assert!(close(lo, 0.299, 0.002), "lo={}", lo);
- assert!(close(hi, 0.701, 0.002), "hi={}", hi);
-
- // Zero successes must stay inside [0, 1] (where the normal approx fails).
- let (lo0, hi0) = wilson_interval(0, 10, 1.959_964);
- assert!(lo0 >= 0.0 && hi0 < 0.32, "({}, {})", lo0, hi0);
- }
-
- #[test]
- fn wilson_tightens_with_sample_size() {
- let (lo_small, hi_small) = wilson_interval(5, 5, Z_90);
- let (lo_big, hi_big) = wilson_interval(500, 500, Z_90);
- assert!((hi_small - lo_small) > (hi_big - lo_big) * 8.0);
- }
-
- #[test]
- fn rank_rating_is_monotonic() {
- let iron4 = rank_rating("IRON", "IV", 0).unwrap();
- assert!(close(iron4, RATING_FLOOR, 1e-9));
- // Silver IV should land near the ladder median used for unranked.
- let silver4 = rank_rating("SILVER", "IV", 0).unwrap();
- assert!(
- (silver4 - UNRANKED_RATING).abs() < 150.0,
- "silver4={}",
- silver4
- );
- let gold4 = rank_rating("GOLD", "IV", 0).unwrap();
- let gold1 = rank_rating("GOLD", "I", 75).unwrap();
- let emerald4 = rank_rating("EMERALD", "IV", 0).unwrap();
- let challenger = rank_rating("CHALLENGER", "I", 900).unwrap();
- assert!(iron4 < gold4 && gold4 < gold1 && gold1 < emerald4 && emerald4 < challenger);
- assert!(close(gold4 - iron4, 3.0 * TIER_POINTS, 1e-9));
- assert!(rank_rating("UNRANKED", "", 0).is_none());
- }
-
- #[test]
- fn elo_expectancy_is_symmetric_and_calibrated() {
- assert!(close(elo_expectancy(1500.0, 1500.0), 0.5, 1e-12));
- // A 400-point gap is 10:1 odds by construction.
- assert!(close(elo_expectancy(1900.0, 1500.0), 10.0 / 11.0, 1e-9));
- let p = elo_expectancy(1600.0, 1500.0);
- assert!(close(p + elo_expectancy(1500.0, 1600.0), 1.0, 1e-12));
- }
-
- #[test]
- fn log5_agrees_with_the_logit_path() {
- // Log5 of two rates equals the logistic on their rating deltas.
- let pa = 0.6;
- let pb = 0.45;
- let via_log5 = log5(pa, pb);
- let ra = winrate_rating_delta(pa);
- let rb = winrate_rating_delta(pb);
- let via_elo = elo_expectancy(ra, rb);
- assert!(
- close(via_log5, via_elo, 1e-9),
- "{} vs {}",
- via_log5,
- via_elo
- );
- assert!(close(log5(0.5, 0.5), 0.5, 1e-12));
- }
-
- #[test]
- fn winrate_delta_is_zero_at_the_baseline() {
- assert!(close(winrate_rating_delta(0.5), 0.0, 1e-12));
- assert!(winrate_rating_delta(0.6) > 0.0);
- assert!(winrate_rating_delta(0.4) < 0.0);
- assert!(close(
- winrate_rating_delta(0.6),
- -winrate_rating_delta(0.4),
- 1e-9
- ));
- }
-
- #[test]
- fn sample_size_changes_strength_not_just_confidence() {
- let rank = rank_rating("GOLD", "II", 50);
- // Same 60% rate, very different sample sizes.
- let veteran = player_strength(rank, 600, 400, 12, 8);
- let rookie = player_strength(rank, 6, 4, 6, 4);
- assert!(
- veteran.rating > rookie.rating,
- "1000 games at 60% must outrank 10 games at 60% ({} vs {})",
- veteran.rating,
- rookie.rating
- );
- assert!(
- veteran.sigma < rookie.sigma,
- "the big sample must also be more certain"
- );
- }
-
- #[test]
- fn balanced_teams_land_near_even() {
- let rank = rank_rating("PLATINUM", "II", 40);
- let team: Vec<PlayerStrength> = (0..5)
- .map(|_| player_strength(rank, 100, 100, 10, 10))
- .collect();
- let p = team_win_probability(&team, &team);
- assert!(close(p.probability, 0.5, 1e-9));
- assert!(close(p.rating_gap, 0.0, 1e-9));
- assert_eq!(p.known_players, 10);
- }
-
- #[test]
- fn stronger_team_is_favoured_but_not_absurdly() {
- let high = rank_rating("DIAMOND", "IV", 0);
- let low = rank_rating("GOLD", "IV", 0);
- let allies: Vec<PlayerStrength> = (0..5)
- .map(|_| player_strength(high, 120, 80, 12, 8))
- .collect();
- let enemies: Vec<PlayerStrength> = (0..5)
- .map(|_| player_strength(low, 80, 120, 8, 12))
- .collect();
- let p = team_win_probability(&allies, &enemies);
- assert!(p.probability > 0.8, "got {}", p.probability);
- assert!(p.rating_gap > 0.0);
- assert!(p.low < p.probability && p.high > p.probability);
- }
-
- #[test]
- fn unknown_players_widen_the_interval() {
- let rank = rank_rating("SILVER", "I", 20);
- let known: Vec<PlayerStrength> = (0..5)
- .map(|_| player_strength(rank, 50, 50, 10, 10))
- .collect();
- let mut hidden = known.clone();
- hidden[0] = PlayerStrength::unknown();
- hidden[1] = PlayerStrength::unknown();
-
- let tight = team_win_probability(&known, &known);
- let loose = team_win_probability(&hidden, &known);
- assert!(
- (loose.high - loose.low) > (tight.high - tight.low),
- "hidden profiles must not fake precision"
- );
- assert_eq!(loose.known_players, 8);
- assert_eq!(loose.total_players, 10);
- }
-
- #[test]
- fn probability_stays_inside_the_interval() {
- let a = rank_rating("EMERALD", "III", 60);
- let b = rank_rating("PLATINUM", "I", 90);
- let allies: Vec<PlayerStrength> =
- (0..5).map(|_| player_strength(a, 33, 27, 11, 9)).collect();
- let enemies: Vec<PlayerStrength> =
- (0..5).map(|_| player_strength(b, 40, 40, 10, 10)).collect();
- let p = team_win_probability(&allies, &enemies);
- assert!(p.low <= p.probability && p.probability <= p.high);
- assert!(p.low >= 0.0 && p.high <= 1.0);
- }
-
- #[test]
- fn kda_and_participation_behave() {
- assert!(close(kda(6, 3, 6), 4.0, 1e-12));
- // Zero deaths reports the raw kill+assist count instead of dividing by 0.
- assert!(close(kda(5, 0, 5), 10.0, 1e-12));
- assert!(close(kill_participation(3, 5, 16), 0.5, 1e-12));
- assert!(close(kill_participation(3, 5, 0), 0.0, 1e-12));
- // Participation cannot exceed 100% even with odd inputs.
- assert!(close(kill_participation(10, 10, 5), 1.0, 1e-12));
- }
-
- #[test]
- fn per_minute_and_items_gold_are_exact() {
- // 128 CS in a 28:06 game (1686s) — matches the live-client sample.
- assert!(close(per_minute(128.0, 1686.0), 4.556, 0.001));
- assert!(close(per_minute(9002.0, 1686.0), 320.4, 0.1));
- assert!(close(per_minute(1.0, 0.0), 0.0, 1e-12));
- // Doran's Ring (400) + trinket (0) as reported by the live client.
- assert_eq!(items_gold(&[(400, 1), (0, 1)]), 400);
- assert_eq!(items_gold(&[(1300, 1), (900, 2)]), 3100);
- }
-
- #[test]
- fn contribution_ratio_measures_fair_share() {
- // 20% of the team total in a 5-man team is exactly a fair share.
- assert!(close(contribution_ratio(200.0, 1000.0, 5), 1.0, 1e-12));
- assert!(close(contribution_ratio(400.0, 1000.0, 5), 2.0, 1e-12));
- assert!(close(contribution_ratio(1.0, 0.0, 5), 0.0, 1e-12));
- }
-
- #[test]
- fn kill_damage_efficiency_flags_finishers_and_feeders() {
- // 40% of kills on 20% of the damage: a finisher.
- let ks = kill_damage_efficiency(4, 10, 200.0, 1000.0);
- assert!(close(ks, 2.0, 1e-9), "got {}", ks);
- // Half the damage but only a fifth of the kills: enabling others.
- let dealer = kill_damage_efficiency(2, 10, 500.0, 1000.0);
- assert!(close(dealer, 0.4, 1e-9), "got {}", dealer);
- // Missing data stays neutral instead of exploding.
- assert!(close(kill_damage_efficiency(0, 0, 0.0, 0.0), 1.0, 1e-12));
- }
-
- #[test]
- fn impact_score_separates_a_carry_from_a_passenger() {
- let base = ImpactInput {
- team_kills: 40,
- team_damage: 100_000.0,
- team_damage_taken: 100_000.0,
- team_gold: 60_000.0,
- team_vision: 100.0,
- duration_seconds: 1800.0,
- team_size: 5,
- ..Default::default()
- };
- let carry = ImpactInput {
- kills: 15,
- deaths: 3,
- assists: 10,
- damage_to_champions: 40_000.0,
- damage_taken: 20_000.0,
- gold: 18_000.0,
- cs: 250.0,
- vision_score: 30.0,
- ..base
- };
- let passenger = ImpactInput {
- kills: 1,
- deaths: 9,
- assists: 4,
- damage_to_champions: 8_000.0,
- damage_taken: 12_000.0,
- gold: 8_000.0,
- cs: 90.0,
- vision_score: 10.0,
- ..base
- };
- let cs_score = impact_score(&carry);
- let ps_score = impact_score(&passenger);
- assert!(cs_score > ps_score + 3.0, "{} vs {}", cs_score, ps_score);
- assert!((0.0..=10.0).contains(&cs_score));
- assert!((0.0..=10.0).contains(&ps_score));
- // An empty game must not panic or produce a negative score.
- assert!(close(impact_score(&ImpactInput::default()), 0.0, 1e-12));
- }
-
- #[test]
- fn premade_detection_merges_transitively() {
- // 0-1 and 1-2 both cleared the bar, so all three queued together.
- let pairs = [(0usize, 1usize, 6u32), (1, 2, 5), (3, 4, 1)];
- let groups = premade_groups(5, &pairs, 3);
- assert_eq!(groups, vec![vec![0, 1, 2]]);
- }
-
- #[test]
- fn premade_detection_respects_the_threshold() {
- // Two shared games is noise, not a duo.
- let pairs = [(0usize, 1usize, 2u32)];
- assert!(premade_groups(5, &pairs, 3).is_empty());
- let solo = premade_groups(5, &[], 3);
- assert!(solo.is_empty(), "no pairs means no premades");
- // Out-of-range indices are ignored rather than panicking.
- assert!(premade_groups(2, &[(0, 9, 10)], 3).is_empty());
- }
-
- #[test]
- fn premade_detection_finds_two_separate_duos() {
- let pairs = [(0usize, 1usize, 8u32), (2, 3, 9)];
- let groups = premade_groups(5, &pairs, 5);
- assert_eq!(groups, vec![vec![0, 1], vec![2, 3]]);
- }
-
- fn ids(values: &[&str]) -> Vec<Option<String>> {
- values
- .iter()
- .map(|v| {
- if v.is_empty() {
- None
- } else {
- Some(v.to_string())
- }
- })
- .collect()
- }
-
- #[test]
- fn party_ids_group_a_duo_and_a_trio_and_drop_solos() {
- // Solo queuers each carry their own party id.
- let groups = party_groups(&ids(&["p1", "p2", "p1", "p3", "p2", "p2"]));
- assert_eq!(groups, vec![vec![0, 2], vec![1, 4, 5]]);
- }
-
- #[test]
- fn missing_party_ids_are_never_grouped_together() {
- // Champ select carries no party id: absent must not read as "same party".
- assert!(party_groups(&ids(&["", "", "", "", ""])).is_empty());
- assert!(party_groups(&[]).is_empty());
- let groups = party_groups(&ids(&["", "p9", "", "p9"]));
- assert_eq!(groups, vec![vec![1, 3]]);
- }
-
- #[test]
- fn role_targets_reflect_role_reality() {
- let sup = default_targets("UTILITY");
- let adc = default_targets("BOTTOM");
- assert!(sup.cs_per_min < adc.cs_per_min);
- assert!(sup.vision_per_min > adc.vision_per_min);
- assert!(adc.damage_share > sup.damage_share);
- // Unknown roles fall back to a neutral profile rather than panicking.
- let unknown = default_targets("");
- assert!(unknown.cs_per_min > 0.0);
- }
-
- fn scored(kills: i64, deaths: i64, assists: i64, win: bool) -> ScoredGame {
- ScoredGame {
- queue_id: 420,
- duration: 1800,
- kills,
- deaths,
- assists,
- win,
- support: false,
- }
- }
-
- #[test]
- fn only_ranked_and_normal_games_of_real_length_count() {
- assert!(score_counts(&scored(5, 2, 5, true)));
- let remake = ScoredGame {
- duration: 120,
- ..scored(0, 0, 0, false)
- };
- assert!(!score_counts(&remake));
- let arena = ScoredGame {
- queue_id: 1700,
- ..scored(5, 2, 5, true)
- };
- assert!(!score_counts(&arena));
- }
-
- #[test]
- fn a_clean_win_scores_above_a_fed_loss() {
- let clean = game_score(&scored(8, 4, 8, true));
- let fed = game_score(&scored(2, 22, 1, false));
- assert!(clean > fed);
- assert!(fed < -1.8, "got {}", fed);
- // (8 + 8) / 4 = 4, no penalty, +1 for the win.
- assert!(close(clean, 5.0, 1e-9), "got {}", clean);
- }
-
- #[test]
- fn support_assists_weigh_a_little_more() {
- let carry = game_score(&scored(2, 4, 12, true));
- let support = game_score(&ScoredGame {
- support: true,
- ..scored(2, 4, 12, true)
- });
- assert!(support > carry);
- }
-
- #[test]
- fn a_deathless_game_does_not_divide_by_zero() {
- assert!(game_score(&scored(7, 0, 3, true)).is_finite());
- }
-
- #[test]
- fn no_score_is_reported_below_the_sample_floor() {
- let few: Vec<ScoredGame> = (0..SCORE_MIN_GAMES - 1)
- .map(|_| scored(5, 2, 5, true))
- .collect();
- let (score, games) = player_score(&few);
- assert_eq!(score, None);
- assert_eq!(games, SCORE_MIN_GAMES - 1);
- assert_eq!(player_score(&[]), (None, 0));
- }
-
- #[test]
- fn unusable_games_do_not_count_toward_the_floor() {
- let mut games: Vec<ScoredGame> = (0..5).map(|_| scored(5, 2, 5, true)).collect();
- games.push(ScoredGame {
- duration: 60,
- ..scored(0, 0, 0, false)
- });
- let (score, counted) = player_score(&games);
- assert_eq!(counted, 5);
- assert!(close(
- score.unwrap(),
- game_score(&scored(5, 2, 5, true)),
- 1e-9
- ));
- }
-}
diff --git a/src-tauri/src/commands/league/ws.rs b/src-tauri/src/commands/league/ws.rs
deleted file mode 100644
index a786e4b9..00000000
--- a/src-tauri/src/commands/league/ws.rs
+++ /dev/null
@@ -1,887 +0,0 @@
-use super::{get_client, lcu_get_raw, lcu_post_raw, lcu_send, league_settings, LcuClient};
-use base64::Engine;
-use futures::{SinkExt, StreamExt};
-use once_cell::sync::OnceCell;
-use serde_json::{json, Value};
-use std::sync::atomic::{AtomicBool, Ordering};
-use tauri::{Emitter, Manager};
-use tauri_plugin_notification::NotificationExt;
-use tokio_tungstenite::tungstenite::client::IntoClientRequest;
-use tokio_tungstenite::tungstenite::Message;
-use tokio_tungstenite::Connector;
-
-static APP: OnceCell<tauri::AppHandle> = OnceCell::new();
-static STARTED: AtomicBool = AtomicBool::new(false);
-static WS_CONNECTED: AtomicBool = AtomicBool::new(false);
-static MESSAGE_SENT: AtomicBool = AtomicBool::new(false);
-static ACCEPT_PENDING: AtomicBool = AtomicBool::new(false);
-static NOTIFIED_READY_CHECK: AtomicBool = AtomicBool::new(false);
-#[allow(clippy::type_complexity)]
-static LAST_EMITTED: once_cell::sync::Lazy<
- tokio::sync::Mutex<std::collections::HashMap<&'static str, (String, std::time::Instant)>>,
-> = once_cell::sync::Lazy::new(|| tokio::sync::Mutex::new(std::collections::HashMap::new()));
-static TRADES_HANDLED: once_cell::sync::Lazy<tokio::sync::Mutex<std::collections::HashSet<i64>>> =
- once_cell::sync::Lazy::new(|| tokio::sync::Mutex::new(std::collections::HashSet::new()));
-#[allow(clippy::type_complexity)]
-static SWAPS_HANDLED: once_cell::sync::Lazy<
- tokio::sync::Mutex<std::collections::HashSet<(&'static str, i64)>>,
-> = once_cell::sync::Lazy::new(|| tokio::sync::Mutex::new(std::collections::HashSet::new()));
-
-/// A queue pops after roughly twelve seconds without an answer, so a longer
-/// delay would simply waste the queue slot.
-const MAX_ACCEPT_DELAY: u8 = 11;
-
-pub fn is_connected() -> bool {
- WS_CONNECTED.load(Ordering::Relaxed)
-}
-
-fn pending_ready_check(state: &str) -> bool {
- state == "InProgress"
-}
-
-fn accept_delay_seconds(setting: u8) -> u8 {
- setting.min(MAX_ACCEPT_DELAY)
-}
-
-/// A ready check is only worth accepting while it is still open and the user has
-/// not answered it: an explicit decline must never be overridden.
-fn should_accept_ready_check(state: &str, player_response: &str) -> bool {
- pending_ready_check(state) && player_response == "None"
-}
-
-/// A queue popping while the user looks at another window is exactly the moment
-/// a notification earns its keep; firing one over a focused app would be noise.
-fn notify_ready_check() {
- if !league_settings().notify_ready_check {
- return;
- }
- let Some(app) = APP.get() else { return };
- let focused = app
- .get_webview_window("main")
- .and_then(|w| w.is_focused().ok())
- .unwrap_or(false);
- if focused {
- return;
- }
- if let Err(e) = app
- .notification()
- .builder()
- .title("OmniGet")
- .body("League of Legends: match found")
- .show()
- {
- tracing::debug!("[league] ready check notification failed: {}", e);
- }
-}
-
-async fn accept_ready_check(client: &LcuClient) {
- match lcu_post_raw(client, "/lol-matchmaking/v1/ready-check/accept").await {
- Ok(_) => tracing::info!("[league] ready check accepted"),
- Err(e) => tracing::warn!("[league] auto-accept failed: {}", e),
- }
-}
-
-fn emit(event: &str, payload: Value) {
- if let Some(app) = APP.get() {
- let _ = app.emit(event, payload);
- }
-}
-
-pub fn start(app: tauri::AppHandle) {
- let _ = APP.set(app);
- if STARTED.swap(true, Ordering::SeqCst) {
- return;
- }
- tauri::async_runtime::spawn(async move {
- let mut backoff = 2u64;
- loop {
- if !league_settings().enabled {
- tokio::time::sleep(std::time::Duration::from_secs(10)).await;
- continue;
- }
- let client = match get_client().await {
- Ok(c) => c,
- Err(_) => {
- tokio::time::sleep(std::time::Duration::from_secs(backoff.min(10))).await;
- backoff = (backoff + 2).min(10);
- continue;
- }
- };
- match run_session(&client).await {
- Ok(()) => {
- tracing::info!("[league] websocket closed");
- }
- Err(e) => {
- tracing::debug!("[league] websocket session ended: {}", e);
- }
- }
- if WS_CONNECTED.swap(false, Ordering::SeqCst) {
- emit(
- "league-connected",
- json!({ "connected": false, "port": Value::Null, "region": Value::Null }),
- );
- }
- {
- let mut cached = super::CACHED_CLIENT.lock().await;
- *cached = None;
- }
- // Backend tokens belong to the session that just ended.
- super::sgp::forget_tokens().await;
- backoff = 2;
- tokio::time::sleep(std::time::Duration::from_secs(2)).await;
- }
- });
-}
-
-async fn run_session(client: &LcuClient) -> Result<(), String> {
- let url = format!("wss://127.0.0.1:{}", client.port);
- let mut request = url
- .into_client_request()
- .map_err(|e| format!("bad websocket url: {}", e))?;
- let auth = base64::engine::general_purpose::STANDARD.encode(format!("riot:{}", client.token));
- request.headers_mut().insert(
- "Authorization",
- format!("Basic {}", auth)
- .parse()
- .map_err(|_| "bad auth header".to_string())?,
- );
- let tls = native_tls::TlsConnector::builder()
- .danger_accept_invalid_certs(true)
- .build()
- .map_err(|e| format!("tls setup failed: {}", e))?;
- let (stream, _) = tokio_tungstenite::connect_async_tls_with_config(
- request,
- None,
- false,
- Some(Connector::NativeTls(tls)),
- )
- .await
- .map_err(|e| format!("websocket connect failed: {}", e))?;
-
- let (mut write, mut read) = stream.split();
- write
- .send(Message::Text("[5, \"OnJsonApiEvent\"]".into()))
- .await
- .map_err(|e| format!("subscribe failed: {}", e))?;
-
- WS_CONNECTED.store(true, Ordering::SeqCst);
- tracing::info!("[league] websocket connected on port {}", client.port);
- emit(
- "league-connected",
- json!({ "connected": true, "port": client.port, "region": client.region }),
- );
- seed_state(client).await;
-
- while let Some(message) = read.next().await {
- let message = message.map_err(|e| format!("websocket read failed: {}", e))?;
- match message {
- Message::Text(text) => {
- if text.is_empty() {
- continue;
- }
- // The subscription is the whole firehose, and the client emits from
- // every plugin it runs. Scanning the raw text for a uri we handle is
- // far cheaper than parsing megabytes of JSON we would discard.
- if !is_interesting(&text) {
- continue;
- }
- if let Ok(value) = serde_json::from_str::<Value>(&text) {
- handle_event(client, &value).await;
- }
- }
- Message::Ping(data) => {
- let _ = write.send(Message::Pong(data)).await;
- }
- Message::Close(_) => break,
- _ => {}
- }
- }
- Ok(())
-}
-
-/// Pushes the current phase once after connecting, so automations and the UI
-/// don't have to wait for the next transition to learn where the client is.
-async fn seed_state(client: &LcuClient) {
- if let Ok(phase) = lcu_get_raw(client, "/lol-gameflow/v1/gameflow-phase").await {
- let phase = phase.as_str().unwrap_or("").to_string();
- emit("league-phase", json!(phase));
- on_phase(client, &phase).await;
- }
-}
-
-/// The client republishes the champion select session several times per second —
-/// the phase timer alone changes on every tick. Re-emitting the whole object that
-/// often floods the webview: every event replaces a large state object and forces
-/// each mounted panel to re-render, which is enough to lock the UI thread.
-///
-/// The fingerprint covers what the UI actually reacts to, so a session that only
-/// advanced its clock is dropped. A slower heartbeat still gets through, so a
-/// missed change can never leave the panel stale for long.
-fn champ_select_fingerprint(session: &Value) -> String {
- let mut parts: Vec<String> = Vec::new();
- parts.push(
- session
- .get("localPlayerCellId")
- .and_then(Value::as_i64)
- .unwrap_or(-1)
- .to_string(),
- );
- if let Some(groups) = session.get("actions").and_then(Value::as_array) {
- for group in groups {
- for action in group.as_array().map(|a| a.as_slice()).unwrap_or(&[]) {
- parts.push(format!(
- "a{}:{}:{}:{}",
- action.get("id").and_then(Value::as_i64).unwrap_or(-1),
- action
- .get("championId")
- .and_then(Value::as_i64)
- .unwrap_or(0),
- action
- .get("completed")
- .and_then(Value::as_bool)
- .unwrap_or(false),
- action
- .get("isInProgress")
- .and_then(Value::as_bool)
- .unwrap_or(false),
- ));
- }
- }
- }
- for key in ["myTeam", "theirTeam"] {
- for member in session
- .get(key)
- .and_then(Value::as_array)
- .unwrap_or(&vec![])
- {
- parts.push(format!(
- "m{}:{}:{}",
- member.get("cellId").and_then(Value::as_i64).unwrap_or(-1),
- member
- .get("championId")
- .and_then(Value::as_i64)
- .unwrap_or(0),
- member
- .get("championPickIntent")
- .and_then(Value::as_i64)
- .unwrap_or(0),
- ));
- }
- }
- for key in [
- "benchChampions",
- "trades",
- "positionSwaps",
- "pickOrderSwaps",
- ] {
- for entry in session
- .get(key)
- .and_then(Value::as_array)
- .unwrap_or(&vec![])
- {
- parts.push(format!(
- "{}{}:{}:{}",
- key,
- entry.get("id").and_then(Value::as_i64).unwrap_or(-1),
- entry.get("championId").and_then(Value::as_i64).unwrap_or(0),
- entry.get("state").and_then(Value::as_str).unwrap_or(""),
- ));
- }
- }
- parts.join("|")
-}
-
-/// True when a payload is worth pushing to the UI: its fingerprint changed, or
-/// the heartbeat window elapsed. Every hot event goes through here — the client
-/// republishes lobby and ready-check state as often as champion select, and each
-/// one that reaches the webview forces a re-render.
-async fn should_emit(event: &'static str, fingerprint: String) -> bool {
- const HEARTBEAT: std::time::Duration = std::time::Duration::from_millis(1500);
- let mut seen = LAST_EMITTED.lock().await;
- match seen.get(event) {
- Some((previous, at)) if previous == &fingerprint && at.elapsed() < HEARTBEAT => false,
- _ => {
- seen.insert(event, (fingerprint, std::time::Instant::now()));
- true
- }
- }
-}
-
-/// The lobby republishes on every queue-estimate tick while searching, so the
-/// fingerprint covers the membership and the queue, not the countdown.
-fn lobby_fingerprint(lobby: &Value) -> String {
- let mut parts = vec![
- lobby
- .get("gameConfig")
- .and_then(|c| c.get("queueId"))
- .and_then(Value::as_i64)
- .unwrap_or(-1)
- .to_string(),
- lobby
- .get("localMember")
- .and_then(|m| m.get("isLeader"))
- .and_then(Value::as_bool)
- .unwrap_or(false)
- .to_string(),
- ];
- for member in lobby
- .get("members")
- .and_then(Value::as_array)
- .unwrap_or(&vec![])
- {
- parts.push(format!(
- "{}:{}:{}",
- member
- .get("summonerId")
- .and_then(Value::as_i64)
- .unwrap_or(0),
- member
- .get("firstPositionPreference")
- .and_then(Value::as_str)
- .unwrap_or(""),
- member
- .get("ready")
- .and_then(Value::as_bool)
- .unwrap_or(false),
- ));
- }
- parts.join("|")
-}
-
-/// The ready check ticks its own timer; only the state and the answer matter.
-fn ready_check_fingerprint(data: &Value) -> String {
- format!(
- "{}:{}",
- data.get("state").and_then(Value::as_str).unwrap_or(""),
- data.get("playerResponse")
- .and_then(Value::as_str)
- .unwrap_or(""),
- )
-}
-
-/// Uris this client acts on. Anything else the League client publishes is noise
-/// for us.
-const HANDLED_URIS: [&str; 5] = [
- "/lol-gameflow/v1/gameflow-phase",
- "/lol-matchmaking/v1/ready-check",
- "/lol-champ-select/v1/session",
- "/lol-lobby/v2/lobby",
- "/lol-honor-v2/v1/ballot",
-];
-
-fn is_interesting(text: &str) -> bool {
- HANDLED_URIS.iter().any(|uri| text.contains(uri))
-}
-
-async fn handle_event(client: &LcuClient, value: &Value) {
- let payload = match value.as_array().and_then(|a| a.get(2)) {
- Some(p) => p,
- None => return,
- };
- let uri = payload.get("uri").and_then(Value::as_str).unwrap_or("");
- let event_type = payload
- .get("eventType")
- .and_then(Value::as_str)
- .unwrap_or("");
- let data = payload.get("data").cloned().unwrap_or(Value::Null);
-
- match uri {
- "/lol-gameflow/v1/gameflow-phase" => {
- let phase = data.as_str().unwrap_or("").to_string();
- emit("league-phase", json!(phase));
- on_phase(client, &phase).await;
- }
- "/lol-matchmaking/v1/ready-check" => {
- let state = data.get("state").and_then(Value::as_str).unwrap_or("");
- let response = data
- .get("playerResponse")
- .and_then(Value::as_str)
- .unwrap_or("");
- if should_emit("league-ready-check", ready_check_fingerprint(&data)).await {
- emit("league-ready-check", data.clone());
- }
- if !pending_ready_check(state) {
- ACCEPT_PENDING.store(false, Ordering::SeqCst);
- NOTIFIED_READY_CHECK.store(false, Ordering::SeqCst);
- } else if should_accept_ready_check(state, response)
- && !NOTIFIED_READY_CHECK.swap(true, Ordering::SeqCst)
- {
- notify_ready_check();
- }
- if should_accept_ready_check(state, response)
- && super::AUTO_ACCEPT.load(Ordering::Relaxed)
- {
- let delay = accept_delay_seconds(league_settings().auto_accept_delay);
- if delay == 0 {
- accept_ready_check(client).await;
- } else if !ACCEPT_PENDING.swap(true, Ordering::SeqCst) {
- // The client re-emits the ready check every tick, so the
- // countdown must be started only once.
- let client = client.clone();
- tauri::async_runtime::spawn(async move {
- tokio::time::sleep(std::time::Duration::from_secs(delay as u64)).await;
- ACCEPT_PENDING.store(false, Ordering::SeqCst);
- // The user may have declined during the countdown, so
- // the current state decides, not the event that started it.
- match lcu_get_raw(&client, "/lol-matchmaking/v1/ready-check").await {
- Ok(current) => {
- let state =
- current.get("state").and_then(Value::as_str).unwrap_or("");
- let response = current
- .get("playerResponse")
- .and_then(Value::as_str)
- .unwrap_or("");
- if should_accept_ready_check(state, response) {
- accept_ready_check(&client).await;
- } else {
- tracing::debug!(
- "[league] auto-accept skipped: no longer pending"
- );
- }
- }
- Err(e) => tracing::debug!("[league] ready check re-read failed: {}", e),
- }
- });
- }
- }
- }
- "/lol-champ-select/v1/session" => {
- if event_type == "Delete" {
- super::CS_HANDLED.lock().await.clear();
- super::CS_FIRST_SEEN.lock().await.clear();
- super::CS_DECLARED.lock().await.clear();
- TRADES_HANDLED.lock().await.clear();
- SWAPS_HANDLED.lock().await.clear();
- MESSAGE_SENT.store(false, Ordering::SeqCst);
- super::skins::reset_session().await;
- LAST_EMITTED.lock().await.remove("league-champ-select");
- emit("league-champ-select", Value::Null);
- return;
- }
- if should_emit("league-champ-select", champ_select_fingerprint(&data)).await {
- emit("league-champ-select", data.clone());
- }
- let settings = league_settings();
- if settings.auto_pick || settings.auto_ban {
- if let Err(e) = super::handle_champ_select(client, &settings, &data).await {
- tracing::debug!("[league] champ select handling: {}", e);
- }
- }
- handle_trades(client, &settings, &data).await;
- handle_swaps(client, &settings, &data).await;
- send_auto_message(client, &settings);
- super::skins::on_champ_select(client, &settings, &data).await;
- }
- "/lol-lobby/v2/lobby" => {
- if event_type == "Delete" {
- LAST_EMITTED.lock().await.remove("league-lobby");
- emit("league-lobby", Value::Null);
- } else if should_emit("league-lobby", lobby_fingerprint(&data)).await {
- emit("league-lobby", data.clone());
- }
- }
- "/lol-honor-v2/v1/ballot" => {
- if event_type != "Delete" && league_settings().auto_honor {
- honor_from_ballot(client, &data).await;
- }
- }
- _ => {}
- }
-}
-
-async fn on_phase(client: &LcuClient, phase: &str) {
- let settings = league_settings();
- match phase {
- "Reconnect" => {
- if settings.auto_reconnect {
- match lcu_post_raw(client, "/lol-gameflow/v1/reconnect").await {
- Ok(_) => tracing::info!("[league] reconnected to the game"),
- Err(e) => tracing::warn!("[league] auto-reconnect failed: {}", e),
- }
- }
- }
- "EndOfGame" => {
- if settings.auto_play_again {
- match lcu_post_raw(client, "/lol-lobby/v2/play-again").await {
- Ok(_) => {
- tracing::info!("[league] queued play again");
- if settings.auto_requeue {
- requeue_if_leader(client).await;
- }
- }
- Err(e) => tracing::debug!("[league] auto play-again failed: {}", e),
- }
- }
- }
- "PreEndOfGame" => {
- if settings.auto_honor {
- if let Ok(ballot) = lcu_get_raw(client, "/lol-honor-v2/v1/ballot").await {
- honor_from_ballot(client, &ballot).await;
- }
- }
- }
- _ => {
- if phase != "ChampSelect" {
- super::CS_HANDLED.lock().await.clear();
- super::CS_FIRST_SEEN.lock().await.clear();
- super::CS_DECLARED.lock().await.clear();
- TRADES_HANDLED.lock().await.clear();
- SWAPS_HANDLED.lock().await.clear();
- MESSAGE_SENT.store(false, Ordering::SeqCst);
- super::skins::reset_session().await;
- }
- }
- }
-}
-
-/// Answers incoming champion-trade requests according to the configured
-/// strategy; anything other than "accept" or "decline" leaves them alone.
-async fn handle_trades(
- client: &LcuClient,
- settings: &omniget_core::models::settings::LeagueSettings,
- session: &Value,
-) {
- let strategy = settings.auto_trade.as_str();
- if strategy != "accept" && strategy != "decline" {
- return;
- }
- let trades: Vec<Value> = session
- .get("trades")
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- for trade in trades {
- let state = trade.get("state").and_then(Value::as_str).unwrap_or("");
- let id = trade.get("id").and_then(Value::as_i64).unwrap_or(-1);
- if state != "RECEIVED" || id < 0 {
- continue;
- }
- {
- let handled = TRADES_HANDLED.lock().await;
- if handled.contains(&id) {
- continue;
- }
- }
- let path = format!(
- "/lol-champ-select/v1/session/trades/{}/{}",
- id,
- if strategy == "accept" {
- "accept"
- } else {
- "decline"
- }
- );
- match lcu_post_raw(client, &path).await {
- Ok(_) => {
- TRADES_HANDLED.lock().await.insert(id);
- tracing::info!("[league] trade request {}: {}ed", id, strategy);
- // Without clearing it the client keeps the request pending in the
- // UI even though it was already answered.
- let cleared = lcu_post_raw(
- client,
- &format!("/lol-champ-select/v1/ongoing-trade/{}/clear", id),
- )
- .await;
- if let Err(e) = cleared {
- tracing::debug!("[league] clearing trade {} failed: {}", id, e);
- }
- }
- Err(e) => tracing::debug!("[league] trade {} failed: {}", strategy, e),
- }
- }
-}
-
-/// Starting the search only works for the lobby leader, and the lobby takes a
-/// moment to exist after play-again, hence the short retry.
-async fn requeue_if_leader(client: &LcuClient) {
- for attempt in 0..3 {
- tokio::time::sleep(std::time::Duration::from_millis(700 * (attempt + 1))).await;
- let Ok(lobby) = lcu_get_raw(client, "/lol-lobby/v2/lobby").await else {
- continue;
- };
- if !super::lobby::is_leader(&lobby) {
- tracing::debug!("[league] not the lobby leader, skipping requeue");
- return;
- }
- match lcu_post_raw(client, "/lol-lobby/v2/lobby/matchmaking/search").await {
- Ok(_) => {
- tracing::info!("[league] requeued after play again");
- return;
- }
- Err(e) => tracing::debug!("[league] requeue attempt failed: {}", e),
- }
- }
-}
-
-/// Accepts position and pick-order swap requests, then clears the pending state
-/// so the client stops showing the prompt.
-async fn handle_swaps(
- client: &LcuClient,
- settings: &omniget_core::models::settings::LeagueSettings,
- session: &Value,
-) {
- if !settings.auto_accept_swaps {
- return;
- }
- for (kind, id) in super::lobby::pending_swaps(session) {
- {
- let handled = SWAPS_HANDLED.lock().await;
- if handled.contains(&(kind, id)) {
- continue;
- }
- }
- let path = format!("/lol-champ-select/v1/session/{}/{}/accept", kind, id);
- match lcu_post_raw(client, &path).await {
- Ok(_) => {
- SWAPS_HANDLED.lock().await.insert((kind, id));
- tracing::info!("[league] accepted {} request {}", kind, id);
- let cleared = lcu_post_raw(
- client,
- &format!("/lol-champ-select/v1/ongoing-swap/{}/clear", id),
- )
- .await;
- if let Err(e) = cleared {
- tracing::debug!("[league] clearing swap {} failed: {}", id, e);
- }
- }
- Err(e) => tracing::debug!("[league] accepting {} failed: {}", kind, e),
- }
- }
-}
-
-/// Posts the configured greeting once per champion select. The chat room can
-/// lag behind the session by a few seconds, so the send is retried briefly.
-fn send_auto_message(
- client: &LcuClient,
- settings: &omniget_core::models::settings::LeagueSettings,
-) {
- let text = settings.auto_message.trim().to_string();
- if text.is_empty() || MESSAGE_SENT.swap(true, Ordering::SeqCst) {
- return;
- }
- let client = client.clone();
- tauri::async_runtime::spawn(async move {
- for _ in 0..6 {
- if super::send_champ_select_chat(&client, &text).await.is_ok() {
- tracing::info!("[league] champ select greeting sent");
- return;
- }
- tokio::time::sleep(std::time::Duration::from_secs(2)).await;
- }
- tracing::debug!("[league] champ select greeting never sent");
- });
-}
-
-/// Honors one eligible ally from the end-of-game ballot. The lobby members the
-/// player queued with come first; otherwise the first listed ally is used.
-async fn honor_from_ballot(client: &LcuClient, ballot: &Value) {
- let eligible: Vec<Value> = ballot
- .get("eligibleAllies")
- .or_else(|| ballot.get("eligiblePlayers"))
- .and_then(Value::as_array)
- .cloned()
- .unwrap_or_default();
- if eligible.is_empty() {
- return;
- }
- let already_voted = ballot
- .get("honoredPlayers")
- .and_then(Value::as_array)
- .map(|a| !a.is_empty())
- .unwrap_or(false);
- if already_voted {
- return;
- }
-
- let lobby_members: Vec<String> = lcu_get_raw(client, "/lol-lobby/v2/lobby/members")
- .await
- .ok()
- .and_then(|m| {
- m.as_array().map(|arr| {
- arr.iter()
- .filter_map(|p| p.get("puuid").and_then(Value::as_str).map(String::from))
- .collect()
- })
- })
- .unwrap_or_default();
-
- let choice = eligible
- .iter()
- .find(|p| {
- p.get("puuid")
- .and_then(Value::as_str)
- .map(|id| lobby_members.iter().any(|m| m == id))
- .unwrap_or(false)
- })
- .or_else(|| eligible.first());
- let choice = match choice {
- Some(c) => c,
- None => return,
- };
- let puuid = choice.get("puuid").and_then(Value::as_str).unwrap_or("");
- let summoner_id = choice
- .get("summonerId")
- .and_then(Value::as_i64)
- .unwrap_or(0);
-
- let modern = lcu_send(
- client,
- reqwest::Method::POST,
- "/lol-honor/v1/honor",
- Some(json!({ "recipientPuuid": puuid, "honorType": "HEART" })),
- )
- .await;
- if modern.is_ok() {
- tracing::info!("[league] honored a teammate");
- return;
- }
- let legacy = lcu_send(
- client,
- reqwest::Method::POST,
- "/lol-honor-v2/v1/honor-player",
- Some(json!({ "summonerId": summoner_id, "honorCategory": "HEART" })),
- )
- .await;
- match legacy {
- Ok(_) => tracing::info!("[league] honored a teammate"),
- Err(e) => tracing::debug!("[league] auto-honor failed: {}", e),
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn an_open_and_unanswered_ready_check_is_accepted() {
- assert!(should_accept_ready_check("InProgress", "None"));
- }
-
- #[test]
- fn a_declined_ready_check_is_never_overridden() {
- assert!(!should_accept_ready_check("InProgress", "Declined"));
- assert!(!should_accept_ready_check("InProgress", "Accepted"));
- }
-
- #[test]
- fn a_closed_ready_check_is_left_alone() {
- for state in ["Invalid", "EveryoneReady", "StrangerNotReady", ""] {
- assert!(!should_accept_ready_check(state, "None"), "state {}", state);
- assert!(!pending_ready_check(state), "state {}", state);
- }
- }
-
- #[test]
- fn the_delay_is_capped_below_the_queue_timeout() {
- assert_eq!(accept_delay_seconds(255), MAX_ACCEPT_DELAY);
- assert_eq!(accept_delay_seconds(3), 3);
- assert_eq!(accept_delay_seconds(0), 0);
- }
-
- #[test]
- fn a_session_that_only_advanced_its_clock_has_the_same_fingerprint() {
- let base = json!({
- "localPlayerCellId": 2,
- "timer": { "adjustedTimeLeftInPhase": 27000, "phase": "BAN_PICK" },
- "actions": [[{ "id": 5, "championId": 64, "completed": false, "isInProgress": true }]],
- "myTeam": [{ "cellId": 2, "championId": 64, "championPickIntent": 0 }]
- });
- let mut ticked = base.clone();
- ticked["timer"]["adjustedTimeLeftInPhase"] = json!(100);
- assert_eq!(
- champ_select_fingerprint(&base),
- champ_select_fingerprint(&ticked),
- "the phase clock must not count as a change"
- );
- }
-
- #[test]
- fn anything_the_panels_read_changes_the_fingerprint() {
- let base = json!({
- "localPlayerCellId": 2,
- "actions": [[{ "id": 5, "championId": 64, "completed": false, "isInProgress": true }]],
- "myTeam": [{ "cellId": 2, "championId": 64, "championPickIntent": 0 }],
- "benchChampions": [{ "championId": 12 }],
- "trades": [{ "id": 1, "state": "AVAILABLE" }]
- });
- let fingerprint = champ_select_fingerprint(&base);
-
- let mut locked = base.clone();
- locked["actions"][0][0]["completed"] = json!(true);
- assert_ne!(fingerprint, champ_select_fingerprint(&locked));
-
- let mut hovered = base.clone();
- hovered["myTeam"][0]["championPickIntent"] = json!(99);
- assert_ne!(fingerprint, champ_select_fingerprint(&hovered));
-
- let mut bench = base.clone();
- bench["benchChampions"][0]["championId"] = json!(34);
- assert_ne!(fingerprint, champ_select_fingerprint(&bench));
-
- let mut trade = base.clone();
- trade["trades"][0]["state"] = json!("RECEIVED");
- assert_ne!(fingerprint, champ_select_fingerprint(&trade));
- }
-
- #[test]
- fn an_empty_session_is_fingerprinted_without_panicking() {
- assert!(!champ_select_fingerprint(&json!({})).is_empty());
- assert!(!champ_select_fingerprint(&Value::Null).is_empty());
- }
-
- #[test]
- fn only_messages_for_a_handled_uri_are_parsed() {
- assert!(is_interesting(
- r#"[8,"OnJsonApiEvent",{"uri":"/lol-champ-select/v1/session","eventType":"Update"}]"#
- ));
- assert!(is_interesting(
- r#"[8,"OnJsonApiEvent",{"uri":"/lol-lobby/v2/lobby"}]"#
- ));
- // The client publishes from every plugin it runs; none of this is ours.
- assert!(!is_interesting(
- r#"[8,"OnJsonApiEvent",{"uri":"/lol-hovercard/v1/friend-info/42"}]"#
- ));
- assert!(!is_interesting(
- r#"[8,"OnJsonApiEvent",{"uri":"/lol-loot/v1/player-loot-map"}]"#
- ));
- assert!(!is_interesting(""));
- }
-
- #[test]
- fn the_lobby_fingerprint_ignores_the_queue_countdown() {
- let base = json!({
- "gameConfig": { "queueId": 420 },
- "localMember": { "isLeader": true },
- "members": [{ "summonerId": 7, "firstPositionPreference": "JUNGLE", "ready": true }]
- });
- let mut ticked = base.clone();
- ticked["gameConfig"]["queueEstimate"] = json!(93);
- assert_eq!(lobby_fingerprint(&base), lobby_fingerprint(&ticked));
-
- let mut joined = base.clone();
- joined["members"][0]["summonerId"] = json!(8);
- assert_ne!(lobby_fingerprint(&base), lobby_fingerprint(&joined));
-
- let mut role = base.clone();
- role["members"][0]["firstPositionPreference"] = json!("MIDDLE");
- assert_ne!(lobby_fingerprint(&base), lobby_fingerprint(&role));
- }
-
- #[test]
- fn the_ready_check_fingerprint_tracks_the_answer_not_the_clock() {
- let base = json!({ "state": "InProgress", "playerResponse": "None", "timer": 8.4 });
- let mut ticked = base.clone();
- ticked["timer"] = json!(3.1);
- assert_eq!(
- ready_check_fingerprint(&base),
- ready_check_fingerprint(&ticked)
- );
-
- let mut accepted = base.clone();
- accepted["playerResponse"] = json!("Accepted");
- assert_ne!(
- ready_check_fingerprint(&base),
- ready_check_fingerprint(&accepted)
- );
- }
-}
diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs
index 03a5136e..8c4a1c03 100644
--- a/src-tauri/src/commands/mod.rs
+++ b/src-tauri/src/commands/mod.rs
@@ -11,7 +11,6 @@ pub mod diagnostics;
pub mod downloads;
pub mod host_queue;
pub mod integration;
-pub mod league;
pub mod media_history;
pub mod nami;
pub mod p2p;
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 89f2627f..38338285 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -598,7 +598,6 @@ pub fn run() {
core::channels::init_from_disk();
core::channel_poller::start(app.handle().clone());
core::queue::start_scheduler(app.handle().clone());
- commands::league::start_background(app.handle().clone());
{
let app_handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
@@ -870,78 +869,6 @@ pub fn run() {
.invoke_handler(tauri::generate_handler![
local_bridge::media_stream_url,
commands::auth_webview::open_auth_webview,
- commands::league::league_status,
- commands::league::league_get,
- commands::league::league_install_dir,
- commands::league::league_set_positions,
- commands::league::league_end_of_game_stats,
- commands::league::league_set_icon,
- commands::league::league_set_profile_background,
- commands::league::league_set_status,
- commands::league::league_owned_skins,
- commands::league::league_summoner,
- commands::league::league_ranked,
- commands::league::league_gameflow,
- commands::league::league_match_detail,
- commands::league::league_player_history,
- commands::league::league_perks,
- commands::league::league_match_history,
- commands::league::league_accept_ready_check,
- commands::league::league_auto_accept_set,
- commands::league::league_auto_accept_get,
- commands::league::league_lobby_queues,
- commands::league::league_create_lobby,
- commands::league::league_start_matchmaking,
- commands::league::league_stop_matchmaking,
- commands::league::league_leave_lobby,
- commands::league::league_play_again,
- commands::league::league_champ_select_session,
- commands::league::league_bench_swap,
- commands::league::league_restart_ux,
- commands::league::league_reroll,
- commands::league::league_reroll_keeping_champion,
- commands::league::league_live_game,
- commands::league::league_game_players,
- commands::league::league_player_report,
- commands::league::league_match_analysis,
- commands::league::league_live_events,
- commands::league::league_live_metrics,
- commands::league::league_search_player,
- commands::league::league_duos,
- commands::league::league_jungle_report,
- commands::league::league_apply_runes,
- commands::league::league_send_chat,
- commands::league::league_rune_recommendations,
- commands::league::league_champion_meta,
- commands::league::league_champion_tiers,
- commands::league::league_champion_build,
- commands::league::league_ability_cooldowns,
- commands::league::league_spectate,
- commands::league::league_dodge,
- commands::league::profile::league_profile_state,
- commands::league::profile::league_set_chat_rank,
- commands::league::profile::league_reset_chat_rank,
- commands::league::profile::league_set_challenge_crystal,
- commands::league::profile::league_set_chat_icon,
- commands::league::profile::league_challenges,
- commands::league::profile::league_set_challenge_prefs,
- commands::league::profile::league_set_regalia,
- commands::league::profile::league_friends,
- commands::league::profile::league_remove_friends,
- commands::league::profile::league_random_champion,
- commands::league::profile::league_declare_champion,
- commands::league::skins::league_roll_skin,
- commands::league::skins::league_roll_ward,
- commands::league::skins::league_skin_carousel,
- commands::league::sgp::league_sgp_status,
- commands::league::sgp::league_sgp_match_history,
- commands::league::sgp::league_sgp_ranked,
- commands::league::sgp::league_sgp_summoners,
- commands::league::sgp::league_sgp_download_replay,
- commands::league::coach::league_coach_review,
- commands::league::coach::league_coach_trends,
- commands::league::coach::league_coach_ask,
- commands::league::coach::league_coach_ready,
commands::bilibili_auth::bilibili_qr_generate,
commands::bilibili_auth::bilibili_qr_poll,
commands::bilibili_auth::bilibili_captcha_challenge,
diff --git a/src/components/league/AnalysisTab.svelte b/src/components/league/AnalysisTab.svelte
deleted file mode 100644
index e86d7f4a..00000000
--- a/src/components/league/AnalysisTab.svelte
+++ /dev/null
@@ -1,303 +0,0 @@
-<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
- import { t } from "$lib/i18n";
- import { CDRAGON, TAG_KEYS, type Champion, type RankedEntry, type ScoutPlayer } from "./shared";
- import { markedPlayers, winrateSquad } from "$lib/league-scouting";
- import { availability, featureById, type Platform } from "./registry";
- import { writeText } from "@tauri-apps/plugin-clipboard-manager";
- import Skeleton from "./Skeleton.svelte";
-
- let {
- analysis,
- analysisLoading,
- onRefreshAnalysis,
- phase,
- scoutPlayers,
- scoutReports,
- scoutLoading,
- onRefreshScouting,
- championById,
- notes,
- onSaveNote,
- timesSeenBefore,
- platform,
- clientConnected,
- active,
- }: {
- analysis: any;
- analysisLoading: boolean;
- onRefreshAnalysis: () => void;
- phase: string;
- scoutPlayers: ScoutPlayer[];
- scoutReports: Record<string, any>;
- scoutLoading: boolean;
- onRefreshScouting: () => void;
- championById: Map<number, Champion>;
- notes: Record<string, string>;
- onSaveNote: (puuid: string, text: string) => void;
- timesSeenBefore: (puuid: string) => number;
- platform?: Platform;
- clientConnected?: boolean;
- active?: boolean;
- } = $props();
-
- let analysisFeature = featureById("analysis");
- let analysisAvailability = $derived.by(() => {
- if (!analysisFeature) return { available: true as const };
- return availability(analysisFeature, {
- platform: platform ?? "macos",
- clientConnected: clientConnected ?? true,
- inGame: phase === "ChampSelect" || phase === "InProgress",
- });
- });
-
- let marked = $derived(markedPlayers(scoutPlayers, notes));
- let squadSide = $derived(winrateSquad(scoutPlayers, analysis?.premades ?? [], scoutReports));
-
- let copied = $state("");
-
- async function copyRiotId(player: { gameName?: string; tagLine?: string; puuid?: string }) {
- const id = player.tagLine ? `${player.gameName}#${player.tagLine}` : (player.gameName ?? "");
- if (!id) return;
- try {
- await writeText(id);
- copied = player.puuid ?? id;
- setTimeout(() => { if (copied === (player.puuid ?? id)) copied = ""; }, 1500);
- } catch {
- copied = "";
- }
- }
-
- let openNotes = $state<Record<string, boolean>>({});
- let chatPreview = $state("");
- let chatSending = $state(false);
- let chatError = $state("");
-
- function rankLabel(entry: RankedEntry | undefined): string {
- if (!entry?.tier || entry.tier === "NONE" || entry.tier === "") return $t("league.unranked") as string;
- const tier = entry.tier.charAt(0) + entry.tier.slice(1).toLowerCase();
- return `${tier} ${entry.division ?? ""} · ${entry.leaguePoints ?? 0} LP`;
- }
-
- function scoutGroups(): { label: string; ally: boolean; list: ScoutPlayer[] }[] {
- return [
- { label: $t("league.scout_enemies") as string, ally: false, list: scoutPlayers.filter((p) => !p.isAlly) },
- { label: $t("league.scout_allies") as string, ally: true, list: scoutPlayers.filter((p) => p.isAlly) },
- ];
- }
-
- // Builds the one-line-per-player summary that gets posted to champ select.
- function buildChatSummary(): string {
- const parts: string[] = [];
- for (const p of scoutPlayers.filter((x) => !x.isAlly)) {
- const r = p.puuid ? scoutReports[p.puuid] : null;
- if (!r?.stats?.games) continue;
- const champ = championById.get(p.championId)?.name ?? "";
- parts.push(`${champ || p.gameName}: ${r.stats.winrate}%WR ${r.stats.kda}KDA (${r.stats.games})`);
- }
- return parts.join(" | ");
- }
-
- async function sendChatSummary() {
- const text = chatPreview.trim();
- if (!text || chatSending) return;
- chatSending = true;
- chatError = "";
- try {
- await invoke("league_send_chat", { message: text });
- chatPreview = "";
- } catch (e: any) {
- chatError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- chatSending = false;
- }
- }
-</script>
-
-{#if active !== false}
- {#if analysis}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.win_title")}</h3>
- <button class="button" onclick={onRefreshAnalysis} disabled={analysisLoading}>{$t("league.refresh")}</button>
- </div>
- <div class="winbar-wrap">
- <div class="winbar" role="img" aria-label={`${$t("league.win_allies")} ${analysis.winProbability}%`}>
- <div class="winbar-fill" style={`width:${analysis.winProbability}%`}></div>
- <div class="winbar-range" style={`left:${analysis.winLow}%;width:${Math.max(analysis.winHigh - analysis.winLow, 0)}%`}></div>
- </div>
- <div class="winbar-legend">
- <span class="win-value">{analysis.winProbability}%</span>
- <span class="win-range">{$t("league.win_interval")} {analysis.winLow}%–{analysis.winHigh}%</span>
- </div>
- </div>
- <p class="win-note">
- {$t("league.win_gap")} {analysis.ratingGap > 0 ? "+" : ""}{analysis.ratingGap} · {analysis.knownPlayers}/{analysis.totalPlayers} {$t("league.win_known")}
- </p>
- <p class="win-disclaimer">{$t("league.win_disclaimer")}</p>
- {#if chatError}
- <p class="action-error" role="alert">{chatError}</p>
- {/if}
- <div class="chat-send">
- <input
- class="input-text"
- placeholder={$t("league.chat_placeholder") as string}
- bind:value={chatPreview}
- />
- <button class="button" onclick={() => (chatPreview = buildChatSummary())}>{$t("league.chat_build")}</button>
- <button class="button primary" onclick={sendChatSummary} disabled={chatSending || !chatPreview.trim()}>{$t("league.chat_send")}</button>
- </div>
- {#if analysis.premades?.length}
- <div class="premade-row">
- <span class="bench-label">{$t("league.premades")}</span>
- {#each analysis.premades as group (group.label)}
- <span class="scout-tag">{group.label}: {group.puuids.length} {$t("league.players")}</span>
- {/each}
- <span class="premade-source">
- {analysis.premadeSource === "party"
- ? $t("league.premade_source_party")
- : $t("league.premade_source_history")}
- </span>
- </div>
- {/if}
- </section>
- {:else if analysisLoading}
- <section class="card" aria-busy="true">
- <div class="card-head">
- <h3>{$t("league.win_title")}</h3>
- </div>
- <Skeleton w="100%" h="14px" round="999px" />
- <div class="skeleton-lines">
- <Skeleton w="45%" h="12px" />
- <Skeleton w="60%" h="11px" />
- </div>
- </section>
- {:else}
- <div class="guard-card">
- <p>{analysisAvailability.available ? $t("league.win_unavailable") : $t(analysisAvailability.reasonKey)}</p>
- <button class="button" onclick={onRefreshAnalysis} disabled={analysisLoading}>{$t("league.refresh")}</button>
- </div>
- {/if}
-
- {#if (phase === "ChampSelect" || phase === "InProgress") && scoutPlayers.length === 0 && scoutLoading}
- <section class="card" aria-busy="true">
- <div class="card-head">
- <h3>{$t("league.scout_title")}</h3>
- </div>
- <div class="skeleton-lines">
- {#each Array(4) as _, i (i)}
- <div class="scoreboard-row">
- <Skeleton w="26px" h="26px" round="6px" />
- <Skeleton w="150px" h="12px" />
- <Skeleton w="80px" h="12px" />
- </div>
- {/each}
- </div>
- </section>
- {/if}
-
- {#if (phase === "ChampSelect" || phase === "InProgress") && scoutPlayers.length > 0}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.scout_title")}</h3>
- <button class="button" onclick={onRefreshScouting} disabled={scoutLoading}>{$t("league.refresh")}</button>
- </div>
- <div class="scout-teams">
- {#if marked.ally.length > 0 || marked.enemy.length > 0 || squadSide}
- <div class="scout-notices">
- {#if marked.ally.length > 0}
- <p class="scout-notice">
- {$t("league.marked_in_allies")} <strong>{marked.ally.join(", ")}</strong>
- </p>
- {/if}
- {#if marked.enemy.length > 0}
- <p class="scout-notice">
- {$t("league.marked_in_enemies")} <strong>{marked.enemy.join(", ")}</strong>
- </p>
- {/if}
- {#if squadSide}
- <p class="scout-notice">
- {squadSide === "enemy" ? $t("league.squad_enemy") : $t("league.squad_ally")}
- </p>
- {/if}
- </div>
- {/if}
- {#each scoutGroups() as group (group.label)}
- <div class="scout-team">
- <h4 class="scout-team-title" class:enemy={!group.ally}>{group.label}</h4>
- {#if group.list.length === 0}
- <p class="empty-hint">{$t("league.scout_enemies_hidden")}</p>
- {:else}
- {#each group.list as p (p.puuid || String(p.cellId))}
- {@const r = p.puuid ? scoutReports[p.puuid] : null}
- <div class="scout-row">
- <div class="scout-main">
- {#if p.championId > 0}
- <img class="champ-icon small" src={`${CDRAGON}/champion-icons/${p.championId}.png`} alt="" title={championById.get(p.championId)?.name ?? ""} loading="lazy" />
- {:else}
- <div class="champ-icon small champ-empty" aria-hidden="true"></div>
- {/if}
- <div class="scout-id">
- <span class="scout-name">
- {p.gameName || "—"}{#if p.tagLine}<span class="tag">#{p.tagLine}</span>{/if}
- {#if p.puuid && timesSeenBefore(p.puuid) > 0}
- <span class="seen-badge" title={$t("league.seen_before_hint") as string}>{$t("league.seen_before")} ×{timesSeenBefore(p.puuid)}</span>
- {/if}
- </span>
- <span class="scout-rank">{r ? rankLabel(r.solo) : "…"}</span>
- </div>
- {#if r?.stats?.games > 0}
- <div class="scout-stats">
- <span class="scout-wr" class:good={r.stats.winrate >= 55} class:bad={r.stats.winrate <= 45}>{r.stats.winrate}% WR</span>
- <span class="scout-kda">
- {r.stats.kda} KDA{#if r.impact !== null && r.impact !== undefined} · <span class="impact" title={$t("league.impact_hint") as string}>{r.impact}</span>{/if}
- </span>
- {#if r.stats.score !== null && r.stats.score !== undefined}
- <span class="scout-score" title={`${$t("league.score_hint")} (${r.stats.scoredGames})`}>
- {$t("league.score_label")} {r.stats.score.toFixed(1)}
- </span>
- {/if}
- </div>
- {:else if r?.privateProfile}
- <span class="scout-private">{$t("league.scout_private")}</span>
- {:else if r?.historyUnavailable}
- <span class="scout-private">{$t("league.scout_no_history")}</span>
- {:else if r}
- <span class="scout-private">…</span>
- {/if}
- {#if p.gameName}
- <button class="note-toggle" onclick={() => copyRiotId(p)} aria-label={$t("league.copy_riot_id") as string} title={$t("league.copy_riot_id") as string}>
- {copied === (p.puuid ?? p.gameName) ? "✓" : "⧉"}
- </button>
- {/if}
- {#if p.puuid}
- <button class="note-toggle" class:has-note={(notes[p.puuid] ?? "").trim() !== ""} onclick={() => { openNotes = { ...openNotes, [p.puuid]: !openNotes[p.puuid] }; }} aria-label={$t("league.scout_note_placeholder") as string} aria-expanded={openNotes[p.puuid] ?? false}>✎</button>
- {/if}
- </div>
- {#if r?.stats?.topChampions?.length}
- <div class="scout-champs">
- {#each r.stats.topChampions as tc (tc.championId)}
- <span class="scout-champ">
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${tc.championId}.png`} alt="" title={championById.get(tc.championId)?.name ?? ""} loading="lazy" />
- <span class="scout-champ-record">{tc.wins}/{tc.games}</span>
- </span>
- {/each}
- {#if r?.stats?.insights?.length}
- {#each r.stats.insights as tag (tag)}
- <span class="scout-tag">{$t(TAG_KEYS[tag] ?? tag)}</span>
- {/each}
- {/if}
- </div>
- {/if}
- {#if p.puuid && (openNotes[p.puuid] || (notes[p.puuid] ?? "").trim() !== "")}
- <input class="input-text note-input" placeholder={$t("league.scout_note_placeholder") as string} value={notes[p.puuid] ?? ""} onchange={(e) => onSaveNote(p.puuid, e.currentTarget.value)} />
- {/if}
- </div>
- {/each}
- {/if}
- </div>
- {/each}
- </div>
- </section>
- {/if}
-{/if}
diff --git a/src/components/league/AutomationTab.svelte b/src/components/league/AutomationTab.svelte
deleted file mode 100644
index 9a449818..00000000
--- a/src/components/league/AutomationTab.svelte
+++ /dev/null
@@ -1,407 +0,0 @@
-<script lang="ts">
- import { onMount } from "svelte";
- import { invoke } from "@tauri-apps/api/core";
- import { t } from "$lib/i18n";
- import { getSettings, updateSettings } from "$lib/stores/settings-store.svelte";
- import { CDRAGON, type Champion } from "./shared";
-
- let {
- champions,
- championById,
- active,
- }: {
- champions: Champion[];
- championById: Map<number, Champion>;
- active?: boolean;
- } = $props();
-
- let settings = $derived(getSettings());
- let autoAccept = $state(false);
- let pickSearch = $state("");
- let banSearch = $state("");
-
- let acceptDelay = $derived(settings?.league?.auto_accept_delay ?? 0);
- let banDelay = $derived(settings?.league?.auto_ban_delay ?? 0);
-
- function changeBanDelay(event: Event) {
- const value = Number((event.currentTarget as HTMLInputElement).value);
- updateSettings({ league: { auto_ban_delay: value } });
- }
-
- function changeAcceptDelay(event: Event) {
- const value = Number((event.currentTarget as HTMLInputElement).value);
- updateSettings({ league: { auto_accept_delay: value } });
- }
-
- async function toggleAutoAccept() {
- const next = !autoAccept;
- autoAccept = next;
- updateSettings({ league: { auto_accept: next } });
- try {
- await invoke("league_auto_accept_set", { enabled: next });
- } catch {
- autoAccept = !next;
- }
- }
-
- let pickConfirmMode = $derived(
- settings?.league?.auto_lock_at_timeout
- ? "timeout"
- : settings?.league?.auto_lock
- ? "immediate"
- : "declare",
- );
-
- function setPickConfirm(mode: string) {
- updateSettings({
- league: {
- auto_lock: mode === "immediate",
- auto_lock_at_timeout: mode === "timeout",
- },
- });
- }
-
- function toggleLeagueFlag(field: "auto_pick" | "auto_ban" | "auto_lock" | "auto_honor" | "auto_play_again" | "auto_requeue" | "auto_accept_swaps" | "auto_reconnect" | "notify_ready_check" | "pick_random" | "skin_roulette" | "skin_roulette_include_base" | "ward_roulette" | "sgp_enabled") {
- const fallback = field === "sgp_enabled" || field === "notify_ready_check";
- const current = (settings?.league as any)?.[field] ?? fallback;
- updateSettings({ league: { [field]: !current } });
- }
-
- function listFor(kind: "pick" | "ban"): number[] {
- const l = settings?.league as any;
- return (kind === "pick" ? l?.pick_champions : l?.ban_champions) ?? [];
- }
-
- function saveList(kind: "pick" | "ban", ids: number[]) {
- updateSettings({ league: kind === "pick" ? { pick_champions: ids } : { ban_champions: ids } });
- }
-
- function addToList(kind: "pick" | "ban", id: number) {
- const ids = listFor(kind);
- if (ids.includes(id)) return;
- saveList(kind, [...ids, id]);
- if (kind === "pick") pickSearch = "";
- else banSearch = "";
- }
-
- function removeFromList(kind: "pick" | "ban", id: number) {
- saveList(kind, listFor(kind).filter((x) => x !== id));
- }
-
- function searchResults(query: string, kind: "pick" | "ban"): Champion[] {
- const q = query.trim().toLowerCase();
- if (!q) return [];
- const existing = new Set(listFor(kind));
- return champions
- .filter((c) => !existing.has(c.id))
- .filter((c) => c.name.toLowerCase().includes(q) || c.alias.toLowerCase().includes(q))
- .slice(0, 8);
- }
-
- onMount(() => {
- invoke<boolean>("league_auto_accept_get")
- .then((v) => { autoAccept = v; })
- .catch(() => {});
- });
-</script>
-
-{#if active !== false}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.automation_title")}</h3>
- </div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_accept")}</span>
- <span class="action-hint">{$t("league.auto_accept_desc")}</span>
- </div>
- <button class="toggle" class:on={autoAccept} onclick={toggleAutoAccept} role="switch" aria-checked={autoAccept} aria-label={$t("league.auto_accept") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {#if autoAccept}
- <div class="delay-block">
- <span class="list-label">
- {$t("league.accept_delay")}
- <span class="list-hint">
- {acceptDelay === 0 ? $t("league.accept_delay_instant") : `${acceptDelay}s`}
- </span>
- </span>
- <div class="slider-row">
- <span class="slider-edge">0s</span>
- <input
- type="range"
- min="0"
- max="11"
- step="1"
- value={acceptDelay}
- oninput={changeAcceptDelay}
- aria-label={$t("league.accept_delay") as string}
- />
- <span class="slider-edge">11s</span>
- </div>
- <span class="action-hint">{$t("league.accept_delay_desc")}</span>
- </div>
- {/if}
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.notify_ready")}</span>
- <span class="action-hint">{$t("league.notify_ready_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.notify_ready_check ?? true} onclick={() => toggleLeagueFlag("notify_ready_check")} role="switch" aria-checked={settings?.league?.notify_ready_check ?? true} aria-label={$t("league.notify_ready") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_pick")}</span>
- <span class="action-hint">{$t("league.auto_pick_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_pick} onclick={() => toggleLeagueFlag("auto_pick")} role="switch" aria-checked={settings?.league?.auto_pick ?? false} aria-label={$t("league.auto_pick") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {#if settings?.league?.auto_pick}
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.pick_random")} <span class="feature-badge">{$t("league.badge_experimental")}</span></span>
- <span class="action-hint">{$t("league.pick_random_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.pick_random} onclick={() => toggleLeagueFlag("pick_random")} role="switch" aria-checked={settings?.league?.pick_random ?? false} aria-label={$t("league.pick_random") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {/if}
- {#if settings?.league?.auto_pick && !settings?.league?.pick_random}
- <div class="champ-list-block">
- <span class="list-label">{$t("league.pick_list")} <span class="list-hint">({$t("league.list_hint")})</span></span>
- <div class="champ-chips">
- {#each listFor("pick") as id (id)}
- <span class="champ-chip">
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${id}.png`} alt="" loading="lazy" />
- {championById.get(id)?.name ?? id}
- <button class="chip-remove" onclick={() => removeFromList("pick", id)} aria-label={`${$t("league.remove")} ${championById.get(id)?.name ?? id}`}>×</button>
- </span>
- {/each}
- </div>
- <div class="champ-search">
- <input type="text" class="input-text" placeholder={$t("league.search_champion") as string} bind:value={pickSearch} />
- {#if searchResults(pickSearch, "pick").length > 0}
- <div class="search-results">
- {#each searchResults(pickSearch, "pick") as c (c.id)}
- <button class="search-result" onclick={() => addToList("pick", c.id)}>
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${c.id}.png`} alt="" loading="lazy" />
- {c.name}
- </button>
- {/each}
- </div>
- {/if}
- </div>
- </div>
- {/if}
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_ban")}</span>
- <span class="action-hint">{$t("league.auto_ban_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_ban} onclick={() => toggleLeagueFlag("auto_ban")} role="switch" aria-checked={settings?.league?.auto_ban ?? false} aria-label={$t("league.auto_ban") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {#if settings?.league?.auto_ban}
- <div class="delay-block">
- <span class="list-label">
- {$t("league.ban_delay")}
- <span class="list-hint">
- {banDelay === 0 ? $t("league.accept_delay_instant") : `${banDelay}s`}
- </span>
- </span>
- <div class="slider-row">
- <span class="slider-edge">0s</span>
- <input
- type="range"
- min="0"
- max="25"
- step="1"
- value={banDelay}
- oninput={changeBanDelay}
- aria-label={$t("league.ban_delay") as string}
- />
- <span class="slider-edge">25s</span>
- </div>
- <span class="action-hint">{$t("league.ban_delay_desc")}</span>
- </div>
- <div class="champ-list-block">
- <span class="list-label">{$t("league.ban_list")} <span class="list-hint">({$t("league.list_hint")})</span></span>
- <div class="champ-chips">
- {#each listFor("ban") as id (id)}
- <span class="champ-chip">
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${id}.png`} alt="" loading="lazy" />
- {championById.get(id)?.name ?? id}
- <button class="chip-remove" onclick={() => removeFromList("ban", id)} aria-label={`${$t("league.remove")} ${championById.get(id)?.name ?? id}`}>×</button>
- </span>
- {/each}
- </div>
- <div class="champ-search">
- <input type="text" class="input-text" placeholder={$t("league.search_champion") as string} bind:value={banSearch} />
- {#if searchResults(banSearch, "ban").length > 0}
- <div class="search-results">
- {#each searchResults(banSearch, "ban") as c (c.id)}
- <button class="search-result" onclick={() => addToList("ban", c.id)}>
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${c.id}.png`} alt="" loading="lazy" />
- {c.name}
- </button>
- {/each}
- </div>
- {/if}
- </div>
- </div>
- {/if}
- {#if settings?.league?.auto_pick}
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.pick_confirm")}</span>
- <span class="action-hint">{$t("league.pick_confirm_desc")}</span>
- </div>
- <div class="seg-group" role="radiogroup" aria-label={$t("league.pick_confirm") as string}>
- {#each ["declare", "timeout", "immediate"] as mode (mode)}
- <button
- class="seg"
- class:on={pickConfirmMode === mode}
- role="radio"
- aria-checked={pickConfirmMode === mode}
- onclick={() => setPickConfirm(mode)}
- >{$t(`league.pick_confirm_${mode}`)}</button>
- {/each}
- </div>
- </div>
- {/if}
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_honor")}</span>
- <span class="action-hint">{$t("league.auto_honor_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_honor} onclick={() => toggleLeagueFlag("auto_honor")} role="switch" aria-checked={settings?.league?.auto_honor ?? false} aria-label={$t("league.auto_honor") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_play_again")}</span>
- <span class="action-hint">{$t("league.auto_play_again_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_play_again} onclick={() => toggleLeagueFlag("auto_play_again")} role="switch" aria-checked={settings?.league?.auto_play_again ?? false} aria-label={$t("league.auto_play_again") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_reconnect")}</span>
- <span class="action-hint">{$t("league.auto_reconnect_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_reconnect} onclick={() => toggleLeagueFlag("auto_reconnect")} role="switch" aria-checked={settings?.league?.auto_reconnect ?? false} aria-label={$t("league.auto_reconnect") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_trade")}</span>
- <span class="action-hint">{$t("league.auto_trade_desc")}</span>
- </div>
- <div class="seg-group" role="radiogroup" aria-label={$t("league.auto_trade") as string}>
- {#each [["", "auto_trade_off"], ["accept", "auto_trade_accept"], ["decline", "auto_trade_decline"]] as [value, key] (value)}
- <button
- class="seg"
- class:on={(settings?.league?.auto_trade ?? "") === value}
- role="radio"
- aria-checked={(settings?.league?.auto_trade ?? "") === value}
- onclick={() => updateSettings({ league: { auto_trade: value } })}
- >{$t(`league.${key}`)}</button>
- {/each}
- </div>
- </div>
- {#if settings?.league?.auto_play_again}
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_requeue")}</span>
- <span class="action-hint">{$t("league.auto_requeue_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_requeue} onclick={() => toggleLeagueFlag("auto_requeue")} role="switch" aria-checked={settings?.league?.auto_requeue ?? false} aria-label={$t("league.auto_requeue") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {/if}
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_swaps")}</span>
- <span class="action-hint">{$t("league.auto_swaps_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.auto_accept_swaps} onclick={() => toggleLeagueFlag("auto_accept_swaps")} role="switch" aria-checked={settings?.league?.auto_accept_swaps ?? false} aria-label={$t("league.auto_swaps") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.skin_roulette")} <span class="feature-badge">{$t("league.badge_beta")}</span></span>
- <span class="action-hint">{$t("league.skin_roulette_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.skin_roulette} onclick={() => toggleLeagueFlag("skin_roulette")} role="switch" aria-checked={settings?.league?.skin_roulette ?? false} aria-label={$t("league.skin_roulette") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {#if settings?.league?.skin_roulette}
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.skin_include_base")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.skin_roulette_include_base} onclick={() => toggleLeagueFlag("skin_roulette_include_base")} role="switch" aria-checked={settings?.league?.skin_roulette_include_base ?? false} aria-label={$t("league.skin_include_base") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- {/if}
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.ward_roulette")}</span>
- <span class="action-hint">{$t("league.ward_roulette_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.ward_roulette} onclick={() => toggleLeagueFlag("ward_roulette")} role="switch" aria-checked={settings?.league?.ward_roulette ?? false} aria-label={$t("league.ward_roulette") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.sgp_enabled")} <span class="feature-badge">{$t("league.badge_experimental")}</span></span>
- <span class="action-hint">{$t("league.sgp_enabled_desc")}</span>
- </div>
- <button class="toggle" class:on={settings?.league?.sgp_enabled ?? true} onclick={() => toggleLeagueFlag("sgp_enabled")} role="switch" aria-checked={settings?.league?.sgp_enabled ?? true} aria-label={$t("league.sgp_enabled") as string}>
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="action-row stacked">
- <div class="action-col">
- <span class="action-label">{$t("league.auto_message")}</span>
- <span class="action-hint">{$t("league.auto_message_desc")}</span>
- </div>
- <input
- class="input-text message-input"
- type="text"
- maxlength="120"
- placeholder={$t("league.auto_message_placeholder") as string}
- value={settings?.league?.auto_message ?? ""}
- onchange={(e) => updateSettings({ league: { auto_message: e.currentTarget.value } })}
- />
- </div>
- </section>
-{/if}
diff --git a/src/components/league/CoachTab.svelte b/src/components/league/CoachTab.svelte
deleted file mode 100644
index 74abf26c..00000000
--- a/src/components/league/CoachTab.svelte
+++ /dev/null
@@ -1,245 +0,0 @@
-<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
- import { t, locale } from "$lib/i18n";
- import { getSettings, updateSettings } from "$lib/stores/settings-store.svelte";
- import type { Champion } from "./shared";
-
- let {
- games,
- phase,
- championById,
- active,
- }: {
- games: any[];
- phase: string;
- championById: Map<number, Champion>;
- active?: boolean;
- } = $props();
-
- const LANGUAGE_NAMES: Record<string, string> = {
- en: "English",
- pt: "Brazilian Portuguese",
- es: "Spanish",
- fr: "French",
- it: "Italian",
- ja: "Japanese",
- ru: "Russian",
- el: "Greek",
- zh: "Simplified Chinese",
- "zh-TW": "Traditional Chinese",
- fa: "Persian",
- };
-
- let settings = $derived(getSettings());
- let style = $derived(settings?.league?.coach_style ?? "objective");
- let language = $derived(LANGUAGE_NAMES[$locale ?? "en"] ?? "English");
-
- let ready = $state<boolean | null>(null);
- let checked = false;
- $effect(() => {
- if (active !== false && !checked) {
- checked = true;
- invoke<boolean>("league_coach_ready").then((v) => (ready = v)).catch(() => (ready = false));
- }
- });
-
- let busy = $state<"" | "review" | "trends" | "ask">("");
- let output = $state("");
- let outputTitle = $state("");
- let error = $state("");
- let copied = $state(false);
-
- let selectedGame = $state<number>(0);
- let trendCount = $state(20);
- let question = $state("");
-
- $effect(() => {
- if (selectedGame === 0 && games.length > 0) selectedGame = games[0].gameId;
- });
-
- function errText(e: unknown): string {
- return typeof e === "string" ? e : ((e as any)?.message ?? String(e));
- }
-
- async function run(kind: "review" | "trends" | "ask", title: string, call: () => Promise<string>) {
- if (busy) return;
- busy = kind;
- error = "";
- output = "";
- outputTitle = title;
- try {
- output = await call();
- } catch (e) {
- error = errText(e);
- } finally {
- busy = "";
- }
- }
-
- function review() {
- const game = games.find((g) => g.gameId === selectedGame);
- const label = game ? gameLabel(game) : String(selectedGame);
- run("review", `${$t("league.coach_review_title")} · ${label}`, () =>
- invoke<string>("league_coach_review", { gameId: selectedGame, style, language }),
- );
- }
-
- function trends() {
- run("trends", `${$t("league.coach_trends_title")} · ${trendCount}`, () =>
- invoke<string>("league_coach_trends", { count: trendCount, style, language }),
- );
- }
-
- function ask(text = question) {
- const q = text.trim();
- if (!q) return;
- question = q;
- run("ask", q, () => invoke<string>("league_coach_ask", { question: q, style, language }));
- }
-
- function gameLabel(game: any): string {
- const p = game?.participants?.[0];
- const champ = championById.get(p?.championId ?? 0)?.name ?? "?";
- const s = p?.stats ?? {};
- const result = s.win ? ($t("league.victory") as string) : ($t("league.defeat") as string);
- return `${champ} · ${s.kills ?? 0}/${s.deaths ?? 0}/${s.assists ?? 0} · ${result}`;
- }
-
- async function copy() {
- try {
- await navigator.clipboard.writeText(output);
- copied = true;
- setTimeout(() => (copied = false), 1500);
- } catch {
- copied = false;
- }
- }
-
- const QUICK: { key: string; phases: readonly string[] }[] = [
- { key: "league.coach_quick_draft", phases: ["ChampSelect"] },
- { key: "league.coach_quick_early", phases: ["ChampSelect", "InProgress"] },
- { key: "league.coach_quick_now", phases: ["InProgress"] },
- { key: "league.coach_quick_improve", phases: [] },
- ];
-
- let quickPrompts = $derived(QUICK.filter((q) => q.phases.length === 0 || q.phases.includes(phase)));
-</script>
-
-{#if active !== false}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.coach_title")}</h3>
- <span class="feature-badge">{$t("league.badge_beta")}</span>
- </div>
- <p class="win-disclaimer">{$t("league.coach_desc")}</p>
- {#if ready === false}
- <div class="action-error" role="alert">
- {$t("league.coach_not_configured")}
- <a href="/settings">{$t("league.coach_open_settings")}</a>
- </div>
- {/if}
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.coach_style")}</span>
- </div>
- <div class="seg-group" role="radiogroup" aria-label={$t("league.coach_style") as string}>
- {#each ["objective", "roast", "praise"] as mode (mode)}
- <button
- class="seg"
- class:on={style === mode}
- role="radio"
- aria-checked={style === mode}
- onclick={() => updateSettings({ league: { coach_style: mode } })}
- >{$t(`league.coach_style_${mode}`)}</button>
- {/each}
- </div>
- </div>
- <p class="action-hint">{$t("league.coach_privacy")}</p>
- </section>
-
- <section class="card">
- <div class="card-head"><h3>{$t("league.coach_ask_title")}</h3></div>
- {#if quickPrompts.length > 0}
- <div class="quick-row">
- {#each quickPrompts as q (q.key)}
- <button class="button subtle" disabled={!!busy || ready === false} onclick={() => ask($t(q.key) as string)}>{$t(q.key)}</button>
- {/each}
- </div>
- {/if}
- <form class="search-form" onsubmit={(e) => { e.preventDefault(); ask(); }}>
- <input class="input-text" placeholder={$t("league.coach_ask_placeholder") as string} bind:value={question} maxlength="2000" />
- <button class="button primary" type="submit" disabled={!!busy || ready === false || !question.trim()}>
- {busy === "ask" ? $t("league.coach_working") : $t("league.coach_ask_run")}
- </button>
- </form>
- </section>
-
- <section class="card">
- <div class="card-head"><h3>{$t("league.coach_review_title")}</h3></div>
- {#if games.length === 0}
- <p class="empty-hint">{$t("league.coach_error_no_games")}</p>
- {:else}
- <div class="profile-tool-row">
- <select class="select-role wide" bind:value={selectedGame} aria-label={$t("league.coach_review_pick") as string}>
- {#each games as game (game.gameId)}
- <option value={game.gameId}>{gameLabel(game)}</option>
- {/each}
- </select>
- <button class="button" disabled={!!busy || ready === false} onclick={review}>
- {busy === "review" ? $t("league.coach_working") : $t("league.coach_review_run")}
- </button>
- </div>
- {/if}
- </section>
-
- <section class="card">
- <div class="card-head"><h3>{$t("league.coach_trends_title")}</h3></div>
- <div class="slider-row">
- <span class="slider-edge">5</span>
- <input type="range" min="5" max="40" step="5" bind:value={trendCount} aria-label={$t("league.coach_trends_title") as string} />
- <span class="slider-edge">40</span>
- <span class="list-hint">{trendCount} {$t("league.coach_trends_games")}</span>
- <button class="button" disabled={!!busy || ready === false} onclick={trends}>
- {busy === "trends" ? $t("league.coach_working") : $t("league.coach_trends_run")}
- </button>
- </div>
- </section>
-
- {#if error}
- <p class="action-error" role="alert">{error}</p>
- {/if}
- {#if busy}
- <section class="card" aria-busy="true">
- <p class="dim">{$t("league.coach_working")}</p>
- </section>
- {:else if output}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.coach_result")}</h3>
- <button class="button subtle" onclick={copy}>{copied ? $t("league.coach_copied") : $t("league.coach_copy")}</button>
- </div>
- <p class="dim output-title">{outputTitle}</p>
- <div class="coach-output">{output}</div>
- </section>
- {/if}
-{/if}
-
-<style>
- .quick-row {
- display: flex;
- flex-wrap: wrap;
- gap: 6px;
- }
- .coach-output {
- white-space: pre-wrap;
- line-height: 1.5;
- font-size: 13.5px;
- }
- .output-title {
- font-size: 12px;
- }
- :global(.select-role.wide) {
- flex: 1;
- min-width: 200px;
- }
-</style>
diff --git a/src/components/league/GoalsTab.svelte b/src/components/league/GoalsTab.svelte
deleted file mode 100644
index 5eca433b..00000000
--- a/src/components/league/GoalsTab.svelte
+++ /dev/null
@@ -1,48 +0,0 @@
-<script lang="ts">
- import { t } from "$lib/i18n";
- import { GOAL_FIELDS, ROLES, type GoalKey, type Role } from "./shared";
-
- let {
- goalValue,
- setGoal,
- resetGoals,
- active,
- }: {
- goalValue: (role: Role, key: GoalKey) => number;
- setGoal: (role: Role, key: GoalKey, value: number) => void;
- resetGoals: (role: Role) => void;
- active?: boolean;
- } = $props();
-
- let goalRole = $state<Role>("MIDDLE");
-</script>
-
-{#if active !== false}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.goals_title")}</h3>
- <select class="select-role" bind:value={goalRole} aria-label={$t("league.goals_role") as string}>
- {#each ROLES as r (r)}
- <option value={r}>{$t(`league.role_${r.toLowerCase()}`)}</option>
- {/each}
- </select>
- </div>
- <p class="win-disclaimer">{$t("league.goals_desc")}</p>
- <div class="goal-config">
- {#each GOAL_FIELDS as field (field.key)}
- <label class="goal-field">
- <span class="goal-field-label">{$t(field.labelKey)}</span>
- <input
- type="number"
- class="input-text"
- min="0"
- step={field.step}
- value={goalValue(goalRole, field.key)}
- onchange={(e) => setGoal(goalRole, field.key, Number(e.currentTarget.value))}
- />
- </label>
- {/each}
- </div>
- <button class="button" onclick={() => resetGoals(goalRole)}>{$t("league.goals_reset")}</button>
- </section>
-{/if}
diff --git a/src/components/league/HistoryTab.svelte b/src/components/league/HistoryTab.svelte
deleted file mode 100644
index 0e88707a..00000000
--- a/src/components/league/HistoryTab.svelte
+++ /dev/null
@@ -1,436 +0,0 @@
-<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
- import { t, locale } from "$lib/i18n";
- import timeAgo from "$lib/time-ago";
- import { CDRAGON, assetUrl, type Champion } from "./shared";
- import { filterByQueue, queuesInGames, summarise } from "$lib/league-history";
- import { findTeam, teamBans, teamObjectives } from "$lib/league-match-detail";
- import Skeleton from "./Skeleton.svelte";
-
- let {
- games,
- loading,
- onRefresh,
- championById,
- active,
- }: {
- games: any[];
- loading: boolean;
- onRefresh: () => void;
- championById: Map<number, Champion>;
- active?: boolean;
- } = $props();
-
- const QUEUE_NAMES: Record<number, string> = {
- 420: "Solo/Duo",
- 440: "Flex",
- 400: "Draft",
- 430: "Blind",
- 450: "ARAM",
- 480: "Swiftplay",
- 900: "URF",
- 1700: "Arena",
- };
-
- function queueName(id: number, mode: string): string {
- return QUEUE_NAMES[id] ?? mode ?? "";
- }
-
- let queueFilter = $state<number | null>(null);
- let availableQueues = $derived(queuesInGames(games));
- let visibleGames = $derived(filterByQueue(games, queueFilter));
- let summary = $derived(summarise(visibleGames));
-
- $effect(() => {
- // A filter kept after a refresh that no longer has the queue would show an
- // empty list with no explanation.
- if (queueFilter !== null && !availableQueues.includes(queueFilter)) {
- queueFilter = null;
- }
- });
-
- function playerStats(game: any): { championId: number; kills: number; deaths: number; assists: number; win: boolean } {
- const p = game?.participants?.[0];
- return {
- championId: p?.championId ?? 0,
- kills: p?.stats?.kills ?? 0,
- deaths: p?.stats?.deaths ?? 0,
- assists: p?.stats?.assists ?? 0,
- win: p?.stats?.win ?? false,
- };
- }
-
- let expandedGame = $state<number | null>(null);
- let gameDetails = $state<Record<number, any>>({});
- let gameDetailLoading = $state<number | null>(null);
-
- async function toggleGameDetail(gameId: number) {
- if (expandedGame === gameId) {
- expandedGame = null;
- return;
- }
- expandedGame = gameId;
- if (gameDetails[gameId]) return;
- gameDetailLoading = gameId;
- try {
- const detail = await invoke<any>("league_match_detail", { gameId });
- gameDetails = { ...gameDetails, [gameId]: detail };
- expandedDuration = detail?.gameDuration ?? 0;
- loadPerkIcons();
- } catch {
- gameDetails = { ...gameDetails, [gameId]: null };
- } finally {
- gameDetailLoading = null;
- }
- }
-
- // Replay download (through the backend) and an AI review, per game.
- let replayBusy = $state<number | null>(null);
- let replayNote = $state<Record<number, string>>({});
- let reviewBusy = $state<number | null>(null);
- let reviews = $state<Record<number, string>>({});
-
- async function downloadReplay(gameId: number) {
- if (replayBusy) return;
- replayBusy = gameId;
- try {
- const path = await invoke<string>("league_sgp_download_replay", { gameId });
- replayNote = { ...replayNote, [gameId]: `${$t("league.replay_saved")} ${path}` };
- } catch (e: any) {
- replayNote = { ...replayNote, [gameId]: typeof e === "string" ? e : (e?.message ?? String(e)) };
- } finally {
- replayBusy = null;
- }
- }
-
- async function reviewGame(gameId: number) {
- if (reviewBusy) return;
- reviewBusy = gameId;
- try {
- const text = await invoke<string>("league_coach_review", { gameId, language: languageName($locale ?? "en") });
- reviews = { ...reviews, [gameId]: text };
- } catch (e: any) {
- reviews = { ...reviews, [gameId]: typeof e === "string" ? e : (e?.message ?? String(e)) };
- } finally {
- reviewBusy = null;
- }
- }
-
- function languageName(code: string): string {
- const names: Record<string, string> = { en: "English", pt: "Brazilian Portuguese", es: "Spanish", fr: "French", it: "Italian", ja: "Japanese", ru: "Russian", el: "Greek", zh: "Simplified Chinese", "zh-TW": "Traditional Chinese", fa: "Persian" };
- return names[code] ?? "English";
- }
-
- let perkIcons = $state<Record<number, string>>({});
- let lookupPuuid = $state("");
- let lookupName = $state("");
- let lookupGames = $state<any[]>([]);
- let lookupLoading = $state(false);
- let lookupError = $state("");
-
- async function loadPerkIcons() {
- if (Object.keys(perkIcons).length > 0) return;
- try {
- const res = await invoke<any>("league_perks");
- const map: Record<number, string> = {};
- for (const perk of res?.perks ?? []) {
- if (perk?.id && perk?.iconPath) map[perk.id] = assetUrl(perk.iconPath);
- }
- perkIcons = map;
- } catch {
- perkIcons = {};
- }
- }
-
- async function openPlayer(player: any) {
- if (!player?.puuid) return;
- lookupPuuid = player.puuid;
- lookupName = player.tagLine ? `${player.gameName}#${player.tagLine}` : player.gameName;
- lookupGames = [];
- lookupError = "";
- lookupLoading = true;
- try {
- const res = await invoke<any>("league_player_history", {
- puuid: player.puuid,
- begIndex: 0,
- endIndex: 9,
- });
- lookupGames = res?.games?.games ?? [];
- } catch (e: any) {
- lookupError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- lookupLoading = false;
- }
- }
-
- function closeLookup() {
- lookupPuuid = "";
- lookupGames = [];
- lookupError = "";
- }
-
- function statLine(p: any): { key: string; label: string; value: string }[] {
- const minutes = Math.max((expandedDuration || 1) / 60, 0.1);
- return [
- { key: "dmg", label: "league.stat_damage", value: `${(p.damageToChampions / 1000).toFixed(1)}k` },
- { key: "taken", label: "league.stat_taken", value: `${(p.damageTaken / 1000).toFixed(1)}k` },
- { key: "mitigated", label: "league.stat_mitigated", value: `${(p.damageMitigated / 1000).toFixed(1)}k` },
- { key: "heal", label: "league.stat_healing", value: `${(p.healing / 1000).toFixed(1)}k` },
- { key: "obj", label: "league.stat_objectives", value: `${(p.damageToObjectives / 1000).toFixed(1)}k` },
- { key: "gpm", label: "league.stat_gold_min", value: Math.round(p.gold / minutes).toString() },
- { key: "cspm", label: "league.stat_cs_min", value: (p.cs / minutes).toFixed(1) },
- { key: "vision", label: "league.stat_vision", value: String(p.visionScore) },
- { key: "wards", label: "league.stat_wards", value: `${p.wardsPlaced}/${p.wardsKilled}/${p.controlWards}` },
- { key: "cc", label: "league.stat_cc", value: `${p.ccTime}s` },
- { key: "spree", label: "league.stat_spree", value: String(p.largestSpree) },
- ];
- }
-
- let expandedDuration = $state(0);
-
- function scoreboardTeams(detail: any): { teamId: number; players: any[] }[] {
- const rows: any[] = detail?.participants ?? [];
- const teamIds = [...new Set(rows.map((r) => r.teamId))];
- return teamIds.map((teamId) => ({ teamId, players: rows.filter((r) => r.teamId === teamId) }));
- }
-
- function itemIcon(id: number): string {
- return `${CDRAGON}/../../game/assets/items/icons2d/${id}.png`;
- }
-
- function spellIcon(id: number): string {
- return `${CDRAGON}/summoner-spells/${id}.png`;
- }
-</script>
-
-{#if active !== false}
- <section class="history-section">
- <div class="history-head">
- <h3>{$t("league.history_title")}</h3>
- <button class="button" onclick={onRefresh} disabled={loading}>{$t("league.refresh")}</button>
- </div>
- {#if loading && games.length === 0}
- <div class="game-list" aria-busy="true">
- {#each Array(4) as _, i (i)}
- <div class="game-row-skeleton">
- <Skeleton w="34px" h="34px" round="6px" />
- <div class="game-skeleton-info">
- <Skeleton w="88px" h="13px" />
- <Skeleton w="64px" h="11px" />
- </div>
- <Skeleton w="72px" h="13px" />
- <Skeleton w="56px" h="11px" />
- </div>
- {/each}
- </div>
- {:else if games.length === 0}
- <p class="empty-hint">{$t("league.history_empty")}</p>
- {:else}
- {#if availableQueues.length > 1}
- <div class="queue-filter" role="group" aria-label={$t("league.filter_queue") as string}>
- <button class="queue-chip" class:on={queueFilter === null} onclick={() => (queueFilter = null)} aria-pressed={queueFilter === null}>
- {$t("league.filter_all")}
- </button>
- {#each availableQueues as id (id)}
- <button class="queue-chip" class:on={queueFilter === id} onclick={() => (queueFilter = id)} aria-pressed={queueFilter === id}>
- {queueName(id, "")}
- </button>
- {/each}
- </div>
- {/if}
- <p class="history-summary">
- {summary.counted}
- {$t("league.summary_games")}
- {#if summary.winrate !== null}
- · <strong>{summary.wins}{$t("league.summary_win_short")} {summary.losses}{$t("league.summary_loss_short")}</strong> · {summary.winrate}%
- {/if}
- {#if summary.kda !== null}
- · KDA {summary.kda.toFixed(2)}
- {/if}
- {#if summary.remakes > 0}
- · <span class="dim">{summary.remakes} {$t("league.summary_remakes")}</span>
- {/if}
- </p>
- <div class="game-list">
- {#each visibleGames as game (game.gameId)}
- {@const p = playerStats(game)}
- <button
- class="game-row"
- class:expanded={expandedGame === game.gameId}
- onclick={() => toggleGameDetail(game.gameId)}
- aria-expanded={expandedGame === game.gameId}
- >
- <img class="champ-icon" src={`${CDRAGON}/champion-icons/${p.championId}.png`} alt="" loading="lazy" />
- <div class="game-info">
- <span class="game-result" class:win={p.win} class:loss={!p.win}>{p.win ? $t("league.victory") : $t("league.defeat")}</span>
- <span class="game-mode">{queueName(game.queueId, game.gameMode)}</span>
- </div>
- <span class="game-kda">{p.kills} / {p.deaths} / {p.assists}</span>
- <span class="game-time">{timeAgo(game.gameCreation, $locale)}</span>
- <span class="game-chevron" aria-hidden="true">{expandedGame === game.gameId ? "▾" : "▸"}</span>
- </button>
- {#if expandedGame === game.gameId}
- {#if gameDetailLoading === game.gameId}
- <div class="scoreboard" aria-busy="true">
- {#each Array(2) as _, ti (ti)}
- <div class="scoreboard-team">
- <Skeleton w="72px" h="12px" />
- {#each Array(5) as _, si (si)}
- <div class="scoreboard-row">
- <Skeleton w="22px" h="22px" round="5px" />
- <Skeleton w="120px" h="12px" />
- <Skeleton w="52px" h="12px" />
- </div>
- {/each}
- </div>
- {/each}
- </div>
- {:else if gameDetails[game.gameId]}
- <div class="scoreboard">
- {#each scoreboardTeams(gameDetails[game.gameId]) as team (team.teamId)}
- {@const objectives = teamObjectives(findTeam(gameDetails[game.gameId]?.teams, team.teamId))}
- {@const bans = teamBans(findTeam(gameDetails[game.gameId]?.teams, team.teamId))}
- <div class="scoreboard-team">
- <span class="scoreboard-result" class:win={team.players[0]?.win} class:loss={!team.players[0]?.win}>
- {team.players[0]?.win ? $t("league.victory") : $t("league.defeat")}
- </span>
- {#if objectives}
- <div class="objective-line">
- <span>{$t("league.obj_towers")} <strong>{objectives.towers}</strong></span>
- <span>{$t("league.obj_inhibitors")} <strong>{objectives.inhibitors}</strong></span>
- <span>{$t("league.objective_baron")} <strong>{objectives.barons}</strong></span>
- <span>{$t("league.objective_dragon")} <strong>{objectives.dragons}</strong></span>
- <span>{$t("league.obj_heralds")} <strong>{objectives.heralds}</strong></span>
- </div>
- {/if}
- {#if bans.length > 0}
- <div class="ban-line">
- <span class="dim">{$t("league.obj_bans")}</span>
- {#each bans as banId, i (`${banId}-${i}`)}
- <img
- class="champ-icon tiny"
- src={`${CDRAGON}/champion-icons/${banId}.png`}
- alt=""
- title={championById.get(banId)?.name ?? ""}
- loading="lazy"
- />
- {/each}
- </div>
- {/if}
- {#each team.players as sp (sp.participantId)}
- <div class="scoreboard-row full">
- <div class="sb-identity">
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${sp.championId}.png`} alt="" title={championById.get(sp.championId)?.name ?? ""} loading="lazy" />
- <div class="sb-spells">
- {#each sp.spells ?? [] as spell (spell)}
- <img class="sb-spell" src={spellIcon(spell)} alt="" loading="lazy" onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }} />
- {/each}
- </div>
- {#if sp.runes}
- <div class="sb-runes">
- {#if perkIcons[sp.runes.perks?.[0]]}
- <img class="sb-rune keystone" src={perkIcons[sp.runes.perks[0]]} alt="" loading="lazy" />
- {/if}
- {#if sp.runes.subStyle}
- <img class="sb-rune" src={`${CDRAGON}/perk-images/styles/${sp.runes.subStyle}.png`} alt="" loading="lazy" />
- {/if}
- </div>
- {/if}
- {#if sp.puuid}
- <button class="sb-name link" onclick={() => openPlayer(sp)} title={$t("league.open_player") as string}>
- {sp.gameName || championById.get(sp.championId)?.name || "—"}
- </button>
- {:else}
- <span class="sb-name">{sp.gameName || championById.get(sp.championId)?.name || "—"}</span>
- {/if}
- <span class="scoreboard-kda">{sp.kills}/{sp.deaths}/{sp.assists}</span>
- <span class="dim">{$t("league.stat_level")} {sp.level}</span>
- <span class="scoreboard-cs dim">{sp.cs} CS</span>
- <span class="scoreboard-gold dim">{(sp.gold / 1000).toFixed(1)}k</span>
- </div>
- <div class="sb-items">
- {#each sp.items ?? [] as item, idx (`${idx}-${item}`)}
- {#if item > 0}
- <img class="item-icon tiny" src={itemIcon(item)} alt="" loading="lazy" onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }} />
- {:else}
- <span class="item-empty" aria-hidden="true"></span>
- {/if}
- {/each}
- </div>
- <div class="sb-stats">
- {#each statLine(sp) as stat (stat.key)}
- <span class="sb-stat"><span class="dim">{$t(stat.label)}</span> {stat.value}</span>
- {/each}
- {#if sp.pentaKills > 0}<span class="sb-flag">{$t("league.stat_penta")}</span>{/if}
- {#if sp.quadraKills > 0}<span class="sb-flag">{$t("league.stat_quadra")}</span>{/if}
- {#if sp.tripleKills > 0}<span class="sb-flag">{$t("league.stat_triple")}</span>{/if}
- {#if sp.firstBlood}<span class="sb-flag">{$t("league.stat_first_blood")}</span>{/if}
- {#if sp.firstTower}<span class="sb-flag">{$t("league.stat_first_tower")}</span>{/if}
- </div>
- </div>
- {/each}
- </div>
- {/each}
- </div>
- {:else}
- <p class="empty-hint">{$t("league.match_detail_unavailable")}</p>
- {/if}
- <div class="game-actions">
- <button class="button subtle" onclick={() => downloadReplay(game.gameId)} disabled={replayBusy === game.gameId}>
- {replayBusy === game.gameId ? $t("league.replay_downloading") : $t("league.replay_download")}
- </button>
- <button class="button subtle" onclick={() => reviewGame(game.gameId)} disabled={reviewBusy === game.gameId}>
- {reviewBusy === game.gameId ? $t("league.coach_working") : $t("league.review_ai")}
- </button>
- {#if game.source === "sgp"}
- <span class="dim">{$t("league.history_source_sgp")}</span>
- {/if}
- </div>
- {#if replayNote[game.gameId]}
- <p class="dim replay-note">{replayNote[game.gameId]}</p>
- {/if}
- {#if reviews[game.gameId]}
- <div class="coach-output">{reviews[game.gameId]}</div>
- {/if}
- {/if}
- {/each}
- </div>
- {/if}
- {#if lookupPuuid}
- <div class="lookup-drawer">
- <div class="card-head">
- <h4 class="section-title">{lookupName}</h4>
- <button class="button" onclick={closeLookup}>{$t("league.close")}</button>
- </div>
- {#if lookupLoading}
- <p class="empty-hint">…</p>
- {:else if lookupError}
- <p class="action-error" role="alert">{lookupError}</p>
- {:else if lookupGames.length === 0}
- <p class="empty-hint">{$t("league.history_empty")}</p>
- {:else}
- <div class="game-list">
- {#each lookupGames as g (g.gameId)}
- {@const lp = playerStats(g)}
- <div class="game-row static">
- <img class="champ-icon" src={`${CDRAGON}/champion-icons/${lp.championId}.png`} alt="" loading="lazy" />
- <div class="game-info">
- <span class="game-result" class:win={lp.win} class:loss={!lp.win}>{lp.win ? $t("league.victory") : $t("league.defeat")}</span>
- <span class="game-mode">{queueName(g.queueId, g.gameMode)}</span>
- </div>
- <span class="game-kda">{lp.kills} / {lp.deaths} / {lp.assists}</span>
- <span class="game-time">{timeAgo(g.gameCreation, $locale)}</span>
- </div>
- {/each}
- </div>
- {/if}
- </div>
- {/if}
- </section>
-{/if}
-
-<style>
- .game-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
- .replay-note { font-size: 12px; word-break: break-all; }
- .coach-output { white-space: pre-wrap; line-height: 1.5; font-size: 13px; margin-top: 6px; }
-</style>
diff --git a/src/components/league/LiveTab.svelte b/src/components/league/LiveTab.svelte
deleted file mode 100644
index d27462e0..00000000
--- a/src/components/league/LiveTab.svelte
+++ /dev/null
@@ -1,325 +0,0 @@
-<script lang="ts">
- import { t } from "$lib/i18n";
- import { CDRAGON, ROLES, assetUrl, formatGameTime, type GoalKey, type Role } from "./shared";
- import { availability, featureById, needsBadge, type Platform } from "./registry";
-
- let {
- liveMetrics,
- cooldowns,
- liveEvents,
- goalValue,
- platform,
- clientConnected,
- active,
- }: {
- liveMetrics: any;
- cooldowns: any;
- liveEvents: any;
- goalValue: (role: Role, key: GoalKey) => number;
- platform?: Platform;
- clientConnected?: boolean;
- active?: boolean;
- } = $props();
-
- let context = $derived({
- platform: platform ?? "macos",
- clientConnected: clientConnected ?? true,
- inGame: Boolean(liveMetrics?.players?.length),
- });
-
- let objectivesFeature = featureById("objectives");
- let objectivesAvailability = $derived(
- objectivesFeature ? availability(objectivesFeature, context) : { available: true as const },
- );
-
- let liveFeature = featureById("live-metrics");
- let liveAvailability = $derived(
- liveFeature ? availability(liveFeature, context) : { available: true as const },
- );
-
- let selfRow = $derived(liveMetrics?.players?.find((r: any) => r.isSelf) ?? null);
- let myTeam = $derived(selfRow?.team ?? "ORDER");
- let enemyTeam = $derived(myTeam === "ORDER" ? "CHAOS" : "ORDER");
- let teamGoldLead = $derived(
- (liveMetrics?.teamGold?.[myTeam] ?? 0) - (liveMetrics?.teamGold?.[enemyTeam] ?? 0)
- );
-
- let liveGoals = $derived.by(() => {
- if (!selfRow) return [];
- const role: Role = (ROLES as readonly string[]).includes(selfRow.position)
- ? (selfRow.position as Role)
- : "MIDDLE";
- const minutes = Math.max((liveMetrics?.gameTime ?? 0) / 60, 0.1);
- const visionPerMin = (selfRow.visionScore ?? 0) / minutes;
- return [
- {
- key: "csPerMin",
- labelKey: "league.goal_cs",
- current: (selfRow.csPerMin ?? 0).toFixed(1),
- target: goalValue(role, "csPerMin").toFixed(1),
- ratio: (selfRow.csPerMin ?? 0) / goalValue(role, "csPerMin"),
- },
- {
- key: "goldPerMin",
- labelKey: "league.goal_gold",
- current: String(selfRow.goldPerMin ?? 0),
- target: String(goalValue(role, "goldPerMin")),
- ratio: (selfRow.goldPerMin ?? 0) / goalValue(role, "goldPerMin"),
- },
- {
- key: "kda",
- labelKey: "league.goal_kda",
- current: (selfRow.kda ?? 0).toFixed(2),
- target: goalValue(role, "kda").toFixed(1),
- ratio: (selfRow.kda ?? 0) / goalValue(role, "kda"),
- },
- {
- key: "visionPerMin",
- labelKey: "league.goal_vision",
- current: visionPerMin.toFixed(1),
- target: goalValue(role, "visionPerMin").toFixed(1),
- ratio: visionPerMin / goalValue(role, "visionPerMin"),
- },
- ];
- });
-
- let enemyCooldowns = $derived(
- (cooldowns?.players ?? []).filter((p: any) => p.team && p.team !== myTeam)
- );
-
- let spellTimers = $state<Record<string, number>>({});
- let timerNow = $state(Date.now());
-
- $effect(() => {
- if (Object.keys(spellTimers).length === 0) return;
- const tick = setInterval(() => {
- timerNow = Date.now();
- const expired = Object.entries(spellTimers).filter(([, end]) => end <= Date.now());
- if (expired.length > 0) {
- const next = { ...spellTimers };
- for (const [key] of expired) delete next[key];
- spellTimers = next;
- }
- }, 500);
- return () => clearInterval(tick);
- });
-
- function toggleSpellTimer(riotId: string, spell: any) {
- const key = `${riotId}:${spell.name}`;
- if (spellTimers[key]) {
- const next = { ...spellTimers };
- delete next[key];
- spellTimers = next;
- } else if (spell.cooldown > 0) {
- timerNow = Date.now();
- spellTimers = { ...spellTimers, [key]: Date.now() + spell.cooldown * 1000 };
- }
- }
-
- function spellRemaining(riotId: string, spell: any): number | null {
- const end = spellTimers[`${riotId}:${spell.name}`];
- if (!end) return null;
- return Math.max(0, Math.ceil((end - timerNow) / 1000));
- }
-
- // The objective payload only refreshes every few seconds, so the countdown is
- // continued locally instead of jumping in steps.
- let eventsFetchedAt = $state(Date.now());
- let objectiveNow = $state(Date.now());
-
- $effect(() => {
- void liveEvents;
- eventsFetchedAt = Date.now();
- objectiveNow = Date.now();
- });
-
- $effect(() => {
- if (!liveEvents?.objectives?.length) return;
- const tick = setInterval(() => {
- objectiveNow = Date.now();
- }, 1000);
- return () => clearInterval(tick);
- });
-
- let objectives = $derived.by(() => {
- const elapsed = (objectiveNow - eventsFetchedAt) / 1000;
- return (liveEvents?.objectives ?? [])
- .map((o: any) => ({ ...o, left: Math.max(0, Math.round(o.remaining - elapsed)) }))
- .filter((o: any) => o.left > 0);
- });
-
- const EVENT_LABELS: Record<string, string> = {
- ChampionKill: "league.event_kill",
- TurretKilled: "league.event_turret",
- InhibKilled: "league.event_inhib",
- DragonKill: "league.event_dragon",
- BaronKill: "league.event_baron",
- HeraldKill: "league.event_herald",
- Multikill: "league.event_multikill",
- Ace: "league.event_ace",
- FirstBrick: "league.event_first_turret",
- FirstBlood: "league.event_first_blood",
- };
-
- let feed = $derived(
- (liveEvents?.events ?? []).filter((e: any) => EVENT_LABELS[e.name])
- );
-</script>
-
-{#if active !== false}
- {#if liveMetrics?.players?.length}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.gold_title")}</h3>
- <span class="phase-tag">{formatGameTime(liveMetrics.gameTime ?? 0)}</span>
- </div>
- <p class="win-disclaimer">{$t("league.col_gold_hint")}</p>
- <div class="gold-summary">
- <span class="gold-team">{$t("league.your_team")}: <strong>{liveMetrics.teamGold?.[myTeam] ?? 0}</strong></span>
- <span class="gold-diff" class:good={teamGoldLead > 0} class:bad={teamGoldLead < 0}>
- {teamGoldLead > 0 ? "+" : ""}{teamGoldLead}
- </span>
- <span class="gold-team">{$t("league.enemy_team")}: <strong>{liveMetrics.teamGold?.[enemyTeam] ?? 0}</strong></span>
- </div>
- <div class="metric-table" role="table">
- <div class="metric-head" role="row">
- <span role="columnheader">{$t("league.col_player")}</span>
- <span role="columnheader">KDA</span>
- <span role="columnheader">CS</span>
- <span role="columnheader" title={$t("league.col_gold_hint") as string}>{$t("league.col_gold")}</span>
- <span role="columnheader">{$t("league.col_diff")}</span>
- </div>
- {#each liveMetrics.players as row (row.riotId)}
- <div class="metric-row" role="row" class:self={row.isSelf}>
- <span class="metric-name" role="cell">
- <span class="pos-chip">{(row.position ?? "?").slice(0, 3)}</span>
- {row.championName}
- </span>
- <span role="cell">{row.kills}/{row.deaths}/{row.assists}</span>
- <span role="cell">{row.cs} <span class="dim">({row.csPerMin}/m)</span></span>
- <span role="cell">{row.itemGold}</span>
- <span role="cell" class="diff" class:good={(row.goldDiff ?? 0) > 0} class:bad={(row.goldDiff ?? 0) < 0}>
- {#if row.goldDiff !== undefined && row.goldDiff !== null}
- {row.goldDiff > 0 ? "+" : ""}{row.goldDiff}g
- <span class="dim">{(row.csDiff ?? 0) > 0 ? "+" : ""}{Math.round(row.csDiff ?? 0)}cs</span>
- {:else}—{/if}
- </span>
- </div>
- {/each}
- </div>
- </section>
-
- {#if enemyCooldowns.length > 0}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.cd_title")}</h3>
- <span class="phase-tag">{$t("league.cd_estimated")}</span>
- </div>
- <p class="win-disclaimer">{$t("league.cd_desc")}</p>
- <div class="cd-list">
- {#each enemyCooldowns as p (p.riotId)}
- <div class="cd-row">
- <div class="cd-champ">
- {#if p.championId > 0}
- <img class="champ-icon small" src={`${CDRAGON}/champion-icons/${p.championId}.png`} alt="" loading="lazy" />
- {/if}
- <div class="cd-id">
- <span class="cd-name">{p.championName}</span>
- <span class="dim">{$t("league.cd_haste")} {p.abilityHaste} · lv{p.level}</span>
- </div>
- </div>
- <div class="cd-abilities">
- {#each p.abilities as ab (ab.key)}
- <span class="cd-ability" title={`${ab.name ?? ""} (${ab.key})`}>
- {#if ab.iconPath}
- <img class="ability-icon" src={assetUrl(ab.iconPath)} alt="" loading="lazy" onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }} />
- {/if}
- <span class="cd-key">{ab.key}</span>
- <span class="cd-value">{ab.cooldown > 0 ? `${ab.cooldown}s` : "—"}</span>
- </span>
- {/each}
- {#each p.spellTimers ?? [] as sp (sp.name)}
- {@const remaining = spellRemaining(p.riotId, sp)}
- <button
- class="cd-ability spell-timer"
- class:running={remaining !== null}
- onclick={() => toggleSpellTimer(p.riotId, sp)}
- title={`${sp.name} — ${$t("league.spell_timer_hint")}`}
- aria-pressed={remaining !== null}
- >
- {#if sp.iconPath}
- <img class="ability-icon" src={assetUrl(sp.iconPath)} alt="" loading="lazy" onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }} />
- {/if}
- <span class="cd-value">{remaining !== null ? `${remaining}s` : sp.cooldown > 0 ? `${sp.cooldown}s` : "—"}</span>
- </button>
- {/each}
- </div>
- </div>
- {/each}
- </div>
- </section>
- {/if}
-
- {#if objectives.length > 0 || feed.length > 0}
- <section class="card">
- <div class="card-head">
- <h3>
- {$t("league.objectives_title")}
- {#if objectivesFeature && needsBadge(objectivesFeature)}
- <span class="feature-badge">{$t(`league.badge_${objectivesFeature.state}`)}</span>
- {/if}
- </h3>
- <h3>{$t("league.objectives_title")}</h3>
- </div>
- {#if objectives.length > 0}
- <div class="objective-row">
- {#each objectives as objective (objective.kind)}
- <span class="objective-chip">
- <strong>{$t(`league.objective_${objective.kind}`)}</strong>
- {formatGameTime(objective.left)}
- </span>
- {/each}
- </div>
- <p class="win-disclaimer">{$t("league.objectives_estimate")}</p>
- {/if}
- {#if feed.length > 0}
- <ul class="event-feed">
- {#each feed as event (`${event.id}:${event.at}`)}
- <li class="event-item">
- <span class="event-time">{formatGameTime(event.at)}</span>
- <span class="event-text">
- {$t(EVENT_LABELS[event.name])}
- {#if event.actor}<strong>{event.actor}</strong>{/if}
- {#if event.target}<span class="dim">→ {event.target}</span>{/if}
- {#if event.detail}<span class="dim">({event.detail})</span>{/if}
- </span>
- </li>
- {/each}
- </ul>
- {/if}
- </section>
- {/if}
-
- {#if selfRow}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.goals_live")}</h3>
- <span class="phase-tag">{selfRow.position ?? "?"}</span>
- </div>
- <div class="goal-list">
- {#each liveGoals as goal (goal.key)}
- <div class="goal-row">
- <span class="goal-name">{$t(goal.labelKey)}</span>
- <div class="goal-bar"><div class="goal-fill" class:met={goal.ratio >= 1} style={`width:${Math.min(goal.ratio * 100, 100)}%`}></div></div>
- <span class="goal-value" class:met={goal.ratio >= 1}>{goal.current} <span class="dim">/ {goal.target}</span></span>
- </div>
- {/each}
- </div>
- </section>
- {/if}
- {:else}
- <div class="guard-card">
- <p>{liveAvailability.available ? $t("league.gold_unavailable") : $t(liveAvailability.reasonKey)}</p>
- </div>
- {/if}
-{/if}
diff --git a/src/components/league/MetaTab.svelte b/src/components/league/MetaTab.svelte
deleted file mode 100644
index 10f6ae32..00000000
--- a/src/components/league/MetaTab.svelte
+++ /dev/null
@@ -1,437 +0,0 @@
-<script lang="ts">
- import { onMount } from "svelte";
- import { invoke } from "@tauri-apps/api/core";
- import { t } from "$lib/i18n";
- import { translateBackendError } from "$lib/error-translate";
- import { featureById, needsBadge } from "./registry";
- import { getSettings, updateSettings } from "$lib/stores/settings-store.svelte";
- import { CDRAGON, type Champion } from "./shared";
-
- let {
- champSelectChampionId,
- myAssignedPosition,
- championById,
- champions,
- region,
- active,
- }: {
- champSelectChampionId: number;
- myAssignedPosition: string;
- championById: Map<number, Champion>;
- champions: Champion[];
- region: string | null;
- active?: boolean;
- } = $props();
-
- let settings = $derived(getSettings());
-
- function toggleAutoRunes() {
- const current = settings?.league?.auto_runes ?? false;
- updateSettings({ league: { auto_runes: !current } });
- }
-
- let runePages = $state<any[]>([]);
- let runeApplying = $state(false);
- let runeError = $state("");
- let appliedRuneIndex = $state<number | null>(null);
- let lastRuneChampion = 0;
-
- let perkMeta = $state<Record<number, string>>({});
- let spellMeta = $state<Record<number, string>>({});
-
- function perkName(id: number): string {
- return perkMeta[id] ?? String(id);
- }
-
- function spellName(id: number): string {
- return spellMeta[id] ?? String(id);
- }
-
- async function loadPerkMeta() {
- try {
- const perks = await invoke<any[]>("league_get", { path: "/lol-perks/v1/perks" });
- const map: Record<number, string> = {};
- for (const p of perks ?? []) map[p.id] = p.name;
- perkMeta = map;
- } catch {
- perkMeta = {};
- }
- try {
- const spells = await invoke<any[]>("league_get", {
- path: "/lol-game-data/assets/v1/summoner-spells.json",
- });
- const map: Record<number, string> = {};
- for (const s of spells ?? []) map[s.id] = s.name;
- spellMeta = map;
- } catch {
- spellMeta = {};
- }
- }
-
- async function loadRunes(championId: number) {
- if (championId <= 0) {
- runePages = [];
- return;
- }
- runeError = "";
- try {
- const result = await invoke<any>("league_rune_recommendations", {
- championId,
- position: myAssignedPosition || null,
- });
- runePages = result?.pages ?? [];
- appliedRuneIndex = null;
- } catch (e: any) {
- runePages = [];
- runeError = translateBackendError(typeof e === "string" ? e : (e?.message ?? String(e)), (k) => $t(k) as string);
- }
- }
-
- async function applyRunePage(index: number) {
- const page = runePages[index];
- if (!page || runeApplying) return;
- runeApplying = true;
- runeError = "";
- try {
- const champName = championById.get(champSelectChampionId)?.name ?? "";
- await invoke("league_apply_runes", {
- name: `${champName} ${page.keystoneName ?? ""}`.trim(),
- primaryStyleId: page.primaryStyleId,
- subStyleId: page.subStyleId,
- selectedPerkIds: page.selectedPerkIds,
- spell1: page.summonerSpellIds?.[0] ?? null,
- spell2: page.summonerSpellIds?.[1] ?? null,
- });
- appliedRuneIndex = index;
- } catch (e: any) {
- runeError = translateBackendError(typeof e === "string" ? e : (e?.message ?? String(e)), (k) => $t(k) as string);
- } finally {
- runeApplying = false;
- }
- }
-
- // Load recommendations when the locked champion changes; apply the first one
- // automatically only when the user asked for it. This component stays mounted
- // even while its panel is hidden, so auto-apply works from any tab.
- $effect(() => {
- const champ = champSelectChampionId;
- if (champ > 0 && champ !== lastRuneChampion) {
- lastRuneChampion = champ;
- loadRunes(champ).then(() => {
- if (settings?.league?.auto_runes && runePages.length > 0) {
- applyRunePage(0);
- }
- });
- } else if (champ === 0 && lastRuneChampion !== 0) {
- lastRuneChampion = 0;
- runePages = [];
- }
- });
-
- const buildFeature = featureById("build-reference");
- let metaInfo = $state<any>(null);
- let metaLoading = $state(false);
- let metaError = $state("");
-
- async function loadMeta(championId: number) {
- if (championId <= 0 || metaLoading) return;
- metaLoading = true;
- metaError = "";
- try {
- metaInfo = await invoke<any>("league_champion_meta", {
- championId,
- position: myAssignedPosition ? opggPosition(myAssignedPosition) : undefined,
- });
- } catch (e: any) {
- metaInfo = null;
- metaError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- metaLoading = false;
- }
- }
-
- // op.gg names positions differently from the client.
- function opggPosition(position: string): string {
- const map: Record<string, string> = {
- TOP: "top",
- JUNGLE: "jungle",
- MIDDLE: "mid",
- BOTTOM: "adc",
- UTILITY: "support",
- };
- return map[position] ?? "mid";
- }
-
- function itemIcon(id: number): string {
- return `${CDRAGON}/../../game/assets/items/icons2d/${id}.png`;
- }
-
- let buildChampionId = $state<number>(0);
- let buildInfo = $state<any>(null);
- let buildLoading = $state(false);
-
- async function loadBuild(championId: number) {
- if (championId <= 0 || buildLoading) return;
- buildLoading = true;
- try {
- buildInfo = await invoke<any>("league_champion_build", { championId, sample: 20 });
- } catch {
- buildInfo = null;
- } finally {
- buildLoading = false;
- }
- }
-
- const TIER_POSITIONS = ["TOP", "JUNGLE", "MID", "ADC", "SUPPORT"] as const;
- let tierPosition = $state<string>("JUNGLE");
- let tiers = $state<any>(null);
- let tiersLoading = $state(false);
- let tiersError = $state("");
-
- // op.gg encodes tiers as 1 = best; the labels mirror what their site shows.
- function tierLabel(tier: number): string {
- if (tier <= 1) return "S+";
- if (tier === 2) return "S";
- if (tier === 3) return "A";
- if (tier === 4) return "B";
- if (tier === 5) return "C";
- return "D";
- }
-
- let tierRows = $derived.by(() => {
- const wanted = tierPosition;
- const rows: any[] = [];
- for (const champ of tiers?.champions ?? []) {
- const entry = (champ.positions ?? []).find((p: any) => (p.position ?? "").toUpperCase() === wanted);
- if (!entry || entry.tier === null || entry.tier === undefined) continue;
- rows.push({
- championId: champ.championId,
- tier: entry.tier,
- rank: entry.rank ?? 999,
- winRate: Math.round((entry.winRate ?? 0) * 1000) / 10,
- pickRate: Math.round((entry.pickRate ?? 0) * 1000) / 10,
- banRate: Math.round((entry.banRate ?? 0) * 1000) / 10,
- });
- }
- rows.sort((a, b) => a.tier - b.tier || a.rank - b.rank);
- return rows.slice(0, 40);
- });
-
- async function loadTiers() {
- if (tiersLoading) return;
- tiersLoading = true;
- tiersError = "";
- try {
- tiers = await invoke<any>("league_champion_tiers", {
- region: (region ?? "br").toLowerCase(),
- });
- } catch (e: any) {
- tiers = null;
- tiersError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- tiersLoading = false;
- }
- }
-
- onMount(() => {
- loadPerkMeta();
- });
-</script>
-
-{#if active !== false}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.runes_title")}</h3>
- {#if champSelectChampionId > 0}
- <span class="phase-tag">{championById.get(champSelectChampionId)?.name ?? champSelectChampionId}</span>
- {/if}
- </div>
- <p class="win-disclaimer">{$t("league.runes_desc")}</p>
- <div class="action-row">
- <div class="action-col">
- <span class="action-label">{$t("league.runes_auto")}</span>
- <span class="action-hint">{$t("league.runes_auto_desc")}</span>
- </div>
- <button
- class="toggle"
- class:on={settings?.league?.auto_runes}
- onclick={toggleAutoRunes}
- role="switch"
- aria-checked={settings?.league?.auto_runes ?? false}
- aria-label={$t("league.runes_auto") as string}
- >
- <span class="toggle-knob"></span>
- </button>
- </div>
- {#if runeError}
- <p class="action-error" role="alert">{runeError}</p>
- {/if}
- {#if runePages.length > 0}
- <div class="rune-list">
- {#each runePages as page, i (page.recommendationId ?? i)}
- <div class="rune-card" class:applied={appliedRuneIndex === i}>
- <div class="rune-head">
- <span class="rune-keystone">{page.keystoneName ?? page.keystoneId}</span>
- {#if page.isDefault}
- <span class="scout-tag">{$t("league.runes_default")}</span>
- {/if}
- </div>
- <div class="rune-perks">
- {#each page.selectedPerkIds as perkId (perkId)}
- <img
- class="perk-icon"
- src={`${CDRAGON}/perk-images/styles/${perkId}.png`}
- alt=""
- title={perkName(perkId)}
- loading="lazy"
- onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }}
- />
- {/each}
- </div>
- <div class="rune-foot">
- <span class="dim">{$t("league.runes_spells")}: {(page.summonerSpellIds ?? []).map(spellName).join(" + ")}</span>
- <button class="button" onclick={() => applyRunePage(i)} disabled={runeApplying}>
- {$t("league.runes_apply")}
- </button>
- </div>
- </div>
- {/each}
- </div>
- {:else}
- <p class="empty-hint">{$t("league.runes_empty")}</p>
- {/if}
- </section>
-
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.build_title")}</h3>
- <button
- class="button"
- onclick={() => loadBuild(champSelectChampionId || (buildChampionId ?? 0))}
- disabled={buildLoading || (!champSelectChampionId && !buildChampionId)}
- >{$t("league.refresh")}</button>
- </div>
- <p class="win-disclaimer">{$t("league.build_desc")}</p>
- <div class="build-picker">
- <select class="select-role" bind:value={buildChampionId} aria-label={$t("league.build_champion") as string}>
- <option value={0}>{$t("league.build_champion")}</option>
- {#each champions as ch (ch.id)}
- <option value={ch.id}>{ch.name}</option>
- {/each}
- </select>
- </div>
- {#if buildInfo && buildInfo.gamesSeen > 0}
- <p class="win-note">
- {buildInfo.gamesSeen} {$t("league.build_samples")} · {buildInfo.winrate}% {$t("league.stat_winrate")}
- </p>
- <div class="build-items">
- {#each buildInfo.items as it (it.itemId)}
- <span class="build-item">
- <img class="item-icon" src={`${CDRAGON}/../../game/assets/items/icons2d/${it.itemId}.png`} alt="" loading="lazy" onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }} />
- <span class="dim">{it.pickRate}%</span>
- </span>
- {/each}
- </div>
- {#if buildInfo.spells?.length}
- <p class="win-note">{$t("league.runes_spells")}: {buildInfo.spells.map((s: any) => s.spellIds.map(spellName).join(" + ")).join(" / ")}</p>
- {/if}
- {:else if buildInfo}
- <p class="empty-hint">{$t("league.build_empty")}</p>
- {/if}
- <div class="divider"></div>
- <div class="card-head">
- <h4 class="section-title">
- {$t("league.meta_reference")}
- {#if buildFeature && needsBadge(buildFeature)}
- <span class="feature-badge">{$t(`league.badge_${buildFeature.state}`)}</span>
- {/if}
- </h4>
- <h4 class="section-title">{$t("league.meta_reference")}</h4>
- <button
- class="button"
- onclick={() => loadMeta(champSelectChampionId || (buildChampionId ?? 0))}
- disabled={metaLoading || (!champSelectChampionId && !buildChampionId)}
- >{$t("league.refresh")}</button>
- </div>
- {#if metaError}
- <p class="action-error" role="alert">{metaError}</p>
- {:else if metaLoading}
- <p class="empty-hint">…</p>
- {:else if metaInfo}
- {#if metaInfo.skillPriority?.length}
- <p class="win-note">
- {$t("league.skill_priority")}: <strong>{metaInfo.skillPriority.join(" › ")}</strong>
- </p>
- <div class="skill-order">
- {#each metaInfo.skillOrder as skill, i (`${i}-${skill}`)}
- <span class="skill-step" class:ult={skill === "R"}>{skill}</span>
- {/each}
- </div>
- {/if}
- {#each [["starterItems", "items_starter"], ["coreItems", "items_core"], ["boots", "items_boots"], ["lastItems", "items_last"]] as [key, label] (key)}
- {#if metaInfo[key]?.ids?.length}
- <div class="build-phase">
- <span class="list-label">{$t(`league.${label}`)}</span>
- <div class="build-items">
- {#each metaInfo[key].ids as id (id)}
- <span class="build-item">
- <img class="item-icon" src={itemIcon(id)} alt="" loading="lazy" onerror={(e) => { (e.currentTarget as HTMLImageElement).style.visibility = "hidden"; }} />
- </span>
- {/each}
- {#if metaInfo[key].winrate !== null && metaInfo[key].winrate !== undefined}
- <span class="dim">{metaInfo[key].winrate}%</span>
- {/if}
- </div>
- </div>
- {/if}
- {/each}
- {#if metaInfo.counters?.length}
- <div class="build-phase">
- <span class="list-label">{$t("league.counters")}</span>
- <div class="build-items">
- {#each metaInfo.counters.slice(0, 6) as c (c.championId)}
- <span class="build-item">
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${c.championId}.png`} alt="" title={championById.get(c.championId)?.name ?? ""} loading="lazy" />
- <span class="dim">{c.winrate}%</span>
- </span>
- {/each}
- </div>
- </div>
- {/if}
- <p class="win-disclaimer">{$t("league.meta_source")}</p>
- {/if}
- </section>
-
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.tiers_title")}</h3>
- <div class="tier-controls">
- <select class="select-role" bind:value={tierPosition} aria-label={$t("league.tiers_position") as string}>
- {#each TIER_POSITIONS as pos (pos)}
- <option value={pos}>{$t(`league.role_${pos.toLowerCase()}`)}</option>
- {/each}
- </select>
- <button class="button" onclick={loadTiers} disabled={tiersLoading}>{$t("league.refresh")}</button>
- </div>
- </div>
- <p class="win-disclaimer">{$t("league.tiers_desc")}</p>
- {#if tiersError}
- <p class="action-error" role="alert">{tiersError}</p>
- {:else if tierRows.length > 0}
- <div class="champ-table">
- {#each tierRows as row (row.championId)}
- <div class="champ-row">
- <span class={`tier-badge tier-${row.tier}`}>{tierLabel(row.tier)}</span>
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${row.championId}.png`} alt="" loading="lazy" />
- <span class="champ-row-name">{championById.get(row.championId)?.name ?? row.championId}</span>
- <span class="champ-row-wr" class:good={row.winRate >= 52} class:bad={row.winRate <= 48}>{row.winRate}%</span>
- <span class="champ-row-games dim">{$t("league.tiers_pick")} {row.pickRate}%</span>
- <span class="champ-row-kda dim">{$t("league.tiers_ban")} {row.banRate}%</span>
- </div>
- {/each}
- </div>
- {:else}
- <p class="empty-hint">{tiersLoading ? $t("league.searching_player") : $t("league.tiers_empty")}</p>
- {/if}
- </section>
-{/if}
diff --git a/src/components/league/OverviewTab.svelte b/src/components/league/OverviewTab.svelte
deleted file mode 100644
index 459808ff..00000000
--- a/src/components/league/OverviewTab.svelte
+++ /dev/null
@@ -1,476 +0,0 @@
-<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
- import { t } from "$lib/i18n";
- import { CDRAGON, formatGameTime, type Champion, type RankedEntry, type LobbyQueue } from "./shared";
- import { CHAMPION_CLASSES, drawLane, secondaryLane, type Lane } from "$lib/league-raffle";
- import Skeleton from "./Skeleton.svelte";
-
- let {
- summoner,
- profileLoading = false,
- ranked,
- phase,
- champSelect,
- liveGame,
- lobby,
- queues,
- actionError,
- champions,
- championById,
- championByAlias,
- onAction,
- active,
- }: {
- summoner: any;
- profileLoading?: boolean;
- ranked: Record<string, RankedEntry>;
- phase: string;
- champSelect: any;
- liveGame: any;
- lobby: any;
- queues: LobbyQueue[];
- actionError: string;
- champions: Champion[];
- championById: Map<number, Champion>;
- championByAlias: Map<string, Champion>;
- onAction: (cmd: string, args?: Record<string, unknown>) => void;
- active?: boolean;
- } = $props();
-
- const PHASE_KEYS: Record<string, string> = {
- Lobby: "league.phase_lobby",
- Matchmaking: "league.phase_matchmaking",
- ReadyCheck: "league.phase_ready_check",
- ChampSelect: "league.phase_champ_select",
- GameStart: "league.phase_in_progress",
- InProgress: "league.phase_in_progress",
- WaitingForStats: "league.phase_end_of_game",
- PreEndOfGame: "league.phase_end_of_game",
- EndOfGame: "league.phase_end_of_game",
- };
-
- function phaseLabel(p: string): string {
- const key = PHASE_KEYS[p];
- return key ? ($t(key) as string) : p;
- }
-
- function rankLabel(entry: RankedEntry | undefined): string {
- if (!entry?.tier || entry.tier === "NONE" || entry.tier === "") return $t("league.unranked") as string;
- const tier = entry.tier.charAt(0) + entry.tier.slice(1).toLowerCase();
- return `${tier} ${entry.division ?? ""} · ${entry.leaguePoints ?? 0} LP`;
- }
-
- function myTeamPicks(session: any): { cellId: number; championId: number }[] {
- return (session?.myTeam ?? []).map((m: any) => ({ cellId: m.cellId, championId: m.championId }));
- }
-
- function liveChampionId(player: any): number | null {
- const raw: string = player?.rawChampionName ?? "";
- const alias = raw.split("_").pop() ?? "";
- return championByAlias.get(alias.toLowerCase())?.id ?? null;
- }
-
- function liveTeams(players: any[]): { order: any[]; chaos: any[] } {
- return {
- order: players.filter((p) => p.team === "ORDER"),
- chaos: players.filter((p) => p.team === "CHAOS"),
- };
- }
-
- const LOBBY_ROLES = ["TOP", "JUNGLE", "MIDDLE", "BOTTOM", "UTILITY", "FILL"] as const;
- let firstRole = $state("FILL");
- let secondRole = $state("FILL");
- let roleError = $state("");
-
- async function saveRoles() {
- roleError = "";
- try {
- await invoke("league_set_positions", { first: firstRole, second: secondRole });
- } catch (e: any) {
- roleError = typeof e === "string" ? e : (e?.message ?? String(e));
- }
- }
-
- // Raffles: a lane, a champion, a skin. Small, honest randomness for the
- // player who wants the queue itself to decide.
- let drawnLane = $state<Lane | null>(null);
- let drawnSecond = $state<Lane | "FILL" | null>(null);
- let raffleError = $state("");
- let raffleClass = $state<string>("");
- let drawnChampion = $state<{ id: number; name: string; candidates: number } | null>(null);
- let drawingChampion = $state(false);
-
- function drawLaneNow() {
- drawnLane = drawLane(drawnLane);
- drawnSecond = secondaryLane(drawnLane);
- }
-
- async function applyDrawnLane() {
- if (!drawnLane) return;
- raffleError = "";
- try {
- await invoke("league_set_positions", { first: drawnLane, second: drawnSecond ?? "FILL" });
- firstRole = drawnLane;
- secondRole = drawnSecond ?? "FILL";
- } catch (e: any) {
- raffleError = typeof e === "string" ? e : (e?.message ?? String(e));
- }
- }
-
- async function drawChampion() {
- if (drawingChampion) return;
- drawingChampion = true;
- raffleError = "";
- try {
- const res = await invoke<any>("league_random_champion", { class: raffleClass || null });
- drawnChampion = { id: res.id, name: res.name, candidates: res.candidates };
- } catch (e: any) {
- raffleError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- drawingChampion = false;
- }
- }
-
- async function declareDrawn(lock: boolean) {
- if (!drawnChampion) return;
- raffleError = "";
- try {
- await invoke("league_declare_champion", { championId: drawnChampion.id, lock });
- } catch (e: any) {
- raffleError = typeof e === "string" ? e : (e?.message ?? String(e));
- }
- }
-
- let skinRoll = $state<{ skin_name: string; chroma_name: string | null } | null>(null);
- let skinError = $state("");
- let skinBusy = $state(false);
-
- async function rollSkin() {
- if (skinBusy) return;
- skinBusy = true;
- skinError = "";
- try {
- skinRoll = await invoke<any>("league_roll_skin", {});
- } catch (e: any) {
- const raw = typeof e === "string" ? e : (e?.message ?? String(e));
- skinError = raw.includes("lock a champion") ? ($t("league.skin_lock_first") as string) : raw;
- } finally {
- skinBusy = false;
- }
- }
-
- async function rollWard() {
- if (skinBusy) return;
- skinBusy = true;
- skinError = "";
- try {
- await invoke("league_roll_ward");
- skinRoll = { skin_name: $t("league.skin_roll_ward") as string, chroma_name: null };
- } catch (e: any) {
- skinError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- skinBusy = false;
- }
- }
-
- let myLockedChampion = $derived.by(() => {
- const cell = champSelect?.localPlayerCellId;
- const me = (champSelect?.myTeam ?? []).find((m: any) => m.cellId === cell);
- return me?.championId ?? 0;
- });
-
- let restartConfirming = $state(false);
- let restartLoading = $state(false);
- let restartError = $state("");
-
- async function restartClientUx() {
- if (restartLoading) return;
- restartLoading = true;
- restartError = "";
- try {
- await invoke("league_restart_ux");
- } catch (e: any) {
- restartError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- restartLoading = false;
- restartConfirming = false;
- }
- }
-
- let dodgeConfirming = $state(false);
- let dodgeLoading = $state(false);
- let dodgeError = $state("");
-
- async function dodgeChampSelect() {
- if (dodgeLoading) return;
- dodgeLoading = true;
- dodgeError = "";
- try {
- await invoke("league_dodge");
- } catch (e: any) {
- dodgeError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- dodgeLoading = false;
- dodgeConfirming = false;
- }
- }
-</script>
-
-{#if active !== false}
- {#if !summoner && profileLoading}
- <section class="profile-card" aria-busy="true">
- <Skeleton w="56px" h="56px" round="50%" />
- <div class="profile-info">
- <Skeleton w="150px" h="16px" />
- <Skeleton w="76px" h="12px" />
- </div>
- <div class="ranked-chips">
- <Skeleton w="118px" h="42px" round="8px" />
- <Skeleton w="118px" h="42px" round="8px" />
- </div>
- </section>
- {:else if summoner}
- <section class="profile-card">
- <img
- class="profile-icon"
- src={`${CDRAGON}/profile-icons/${summoner.profileIconId}.jpg`}
- alt=""
- loading="lazy"
- />
- <div class="profile-info">
- <span class="profile-name">
- {summoner.gameName ?? summoner.displayName}{#if summoner.tagLine}<span class="tag">#{summoner.tagLine}</span>{/if}
- </span>
- <span class="profile-level">{$t("league.level")} {summoner.summonerLevel}</span>
- </div>
- <div class="ranked-chips">
- <div class="ranked-chip">
- <span class="ranked-queue">{$t("league.ranked_solo")}</span>
- <span class="ranked-value">{rankLabel(ranked?.RANKED_SOLO_5x5)}</span>
- </div>
- <div class="ranked-chip">
- <span class="ranked-queue">{$t("league.ranked_flex")}</span>
- <span class="ranked-value">{rankLabel(ranked?.RANKED_FLEX_SR)}</span>
- </div>
- </div>
- </section>
- {/if}
- {#if actionError}
- <div class="action-error" role="alert">{actionError}</div>
- {/if}
- {#if restartError}
- <div class="action-error" role="alert">{restartError}</div>
- {/if}
- <div class="repair-row">
- {#if restartConfirming}
- <span class="repair-note">{$t("league.restart_ux_warning")}</span>
- <button class="button" onclick={() => (restartConfirming = false)}>{$t("league.dodge_cancel")}</button>
- <button class="button" onclick={restartClientUx} disabled={restartLoading}>{$t("league.restart_ux_confirm")}</button>
- {:else}
- <button class="button subtle" onclick={() => (restartConfirming = true)}>{$t("league.restart_ux")}</button>
- {/if}
- </div>
- {#if phase === "ChampSelect" && champSelect}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.champ_select_title")}</h3>
- <span class="phase-tag">{phaseLabel(phase)}</span>
- </div>
- <div class="team-picks">
- {#each myTeamPicks(champSelect) as pick (pick.cellId)}
- {#if pick.championId > 0}
- <img class="champ-icon" src={`${CDRAGON}/champion-icons/${pick.championId}.png`} alt={championById.get(pick.championId)?.name ?? ""} title={championById.get(pick.championId)?.name ?? ""} loading="lazy" />
- {:else}
- <div class="champ-icon champ-empty" aria-hidden="true"></div>
- {/if}
- {/each}
- </div>
- {#if champSelect.benchEnabled}
- <div class="bench-row">
- <span class="bench-label">{$t("league.bench_title")}</span>
- <div class="bench-champs">
- {#each champSelect.benchChampions ?? [] as bc (bc.championId)}
- <button
- class="bench-swap"
- onclick={() => onAction("league_bench_swap", { championId: bc.championId })}
- title={championById.get(bc.championId)?.name ?? ""}
- aria-label={`${$t("league.swap")} ${championById.get(bc.championId)?.name ?? bc.championId}`}
- >
- <img class="champ-icon" src={`${CDRAGON}/champion-icons/${bc.championId}.png`} alt="" loading="lazy" />
- </button>
- {/each}
- </div>
- <div class="reroll-actions">
- <button class="button" onclick={() => onAction("league_reroll")}>{$t("league.reroll")}</button>
- <button class="button" onclick={() => onAction("league_reroll_keeping_champion")} title={$t("league.reroll_keep_hint") as string}>
- {$t("league.reroll_keep")}
- </button>
- </div>
- </div>
- {/if}
- <div class="skin-row">
- <span class="bench-label">{$t("league.skin_title")}</span>
- <button class="button" onclick={rollSkin} disabled={skinBusy || myLockedChampion <= 0} title={myLockedChampion <= 0 ? ($t("league.skin_lock_first") as string) : ""}>{$t("league.skin_roll")}</button>
- <button class="button subtle" onclick={rollWard} disabled={skinBusy}>{$t("league.skin_roll_ward")}</button>
- {#if skinRoll}
- <span class="dim">{$t("league.skin_rolled")}: {skinRoll.skin_name}{skinRoll.chroma_name ? ` · ${skinRoll.chroma_name}` : ""}</span>
- {/if}
- </div>
- {#if skinError}
- <p class="action-error" role="alert">{skinError}</p>
- {/if}
- {#if myLockedChampion <= 0}
- <div class="skin-row">
- <span class="bench-label">{$t("league.raffle_champion")}</span>
- <select class="select-role" bind:value={raffleClass} aria-label={$t("league.raffle_champion") as string}>
- <option value="">{$t("league.raffle_class_any")}</option>
- {#each CHAMPION_CLASSES as cls (cls)}
- <option value={cls}>{$t(`league.raffle_class_${cls}`)}</option>
- {/each}
- </select>
- <button class="button" onclick={drawChampion} disabled={drawingChampion}>{drawnChampion ? $t("league.raffle_again") : $t("league.raffle_champion")}</button>
- {#if drawnChampion}
- <img class="champ-icon small" src={`${CDRAGON}/champion-icons/${drawnChampion.id}.png`} alt="" loading="lazy" />
- <strong>{drawnChampion.name}</strong>
- <button class="button subtle" onclick={() => declareDrawn(false)}>{$t("league.raffle_declare")}</button>
- <button class="button primary" onclick={() => declareDrawn(true)}>{$t("league.raffle_lock")}</button>
- {/if}
- </div>
- {#if raffleError}
- <p class="action-error" role="alert">{raffleError}</p>
- {/if}
- {/if}
- {#if dodgeError}
- <p class="action-error" role="alert">{dodgeError}</p>
- {/if}
- <div class="dodge-row">
- {#if dodgeConfirming}
- <span class="dodge-warning">{$t("league.dodge_warning")}</span>
- <button class="button" onclick={() => (dodgeConfirming = false)}>{$t("league.dodge_cancel")}</button>
- <button class="button danger" onclick={dodgeChampSelect} disabled={dodgeLoading}>{$t("league.dodge_confirm")}</button>
- {:else}
- <button class="button subtle-danger" onclick={() => (dodgeConfirming = true)}>{$t("league.dodge")}</button>
- {/if}
- </div>
- </section>
- {:else if phase === "InProgress" && liveGame?.stats}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.live_title")}</h3>
- <span class="phase-tag">{formatGameTime(liveGame.stats.gameTime ?? 0)}</span>
- </div>
- {#if Array.isArray(liveGame.players)}
- {@const teams = liveTeams(liveGame.players)}
- <div class="live-teams">
- {#each [teams.order, teams.chaos] as team, ti (ti)}
- <div class="live-team">
- {#each team as p (p.riotId ?? p.summonerName ?? p.championName)}
- {@const cid = liveChampionId(p)}
- <div class="live-row" class:me={(p.riotId ?? p.summonerName) === liveGame.activePlayer}>
- {#if cid}
- <img class="champ-icon small" src={`${CDRAGON}/champion-icons/${cid}.png`} alt="" loading="lazy" />
- {:else}
- <div class="champ-icon small champ-empty" aria-hidden="true"></div>
- {/if}
- <span class="live-name">{p.championName}</span>
- <span class="live-kda">{p.scores?.kills ?? 0}/{p.scores?.deaths ?? 0}/{p.scores?.assists ?? 0}</span>
- {#if p.isDead && p.respawnTimer > 0}
- <span class="live-respawn">{$t("league.respawn_in")} {Math.ceil(p.respawnTimer)}s</span>
- {/if}
- </div>
- {/each}
- </div>
- {/each}
- </div>
- {/if}
- </section>
- {:else}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.lobby_title")}</h3>
- {#if phase && phase !== "None"}
- <span class="phase-tag">{phaseLabel(phase)}</span>
- {/if}
- </div>
- {#if phase === "ReadyCheck"}
- <div class="lobby-actions">
- <button class="button primary" onclick={() => onAction("league_accept_ready_check")}>{$t("league.accept_now")}</button>
- </div>
- {:else if phase === "Matchmaking"}
- <div class="lobby-actions">
- <span class="searching-hint">{$t("league.searching")}</span>
- <button class="button" onclick={() => onAction("league_stop_matchmaking")}>{$t("league.stop_queue")}</button>
- </div>
- {:else if phase === "Lobby" && lobby}
- <div class="lobby-actions">
- <button class="button primary" onclick={() => onAction("league_start_matchmaking")}>{$t("league.start_queue")}</button>
- <button class="button" onclick={() => onAction("league_leave_lobby")}>{$t("league.leave_lobby")}</button>
- </div>
- {#if roleError}
- <p class="action-error" role="alert">{roleError}</p>
- {/if}
- <div class="profile-tool-row">
- <span class="list-label">{$t("league.role_preference")}</span>
- <select class="select-role" bind:value={firstRole} aria-label={$t("league.role_first") as string}>
- {#each LOBBY_ROLES as role (role)}
- <option value={role}>{$t(`league.role_${role.toLowerCase()}`)}</option>
- {/each}
- </select>
- <select class="select-role" bind:value={secondRole} aria-label={$t("league.role_second") as string}>
- {#each LOBBY_ROLES as role (role)}
- <option value={role}>{$t(`league.role_${role.toLowerCase()}`)}</option>
- {/each}
- </select>
- <button class="button" onclick={saveRoles}>{$t("league.apply")}</button>
- </div>
- <div class="profile-tool-row">
- <span class="list-label">{$t("league.raffle_title")}</span>
- <button class="button" onclick={drawLaneNow}>{$t("league.raffle_lane")}</button>
- {#if drawnLane}
- <span class="pos-chip">{$t(`league.role_${drawnLane.toLowerCase()}`)}</span>
- <span class="dim">+ {drawnSecond === "FILL" ? $t("league.role_fill") : $t(`league.role_${(drawnSecond ?? "fill").toLowerCase()}`)}</span>
- <button class="button subtle" onclick={applyDrawnLane}>{$t("league.raffle_lane_apply")}</button>
- {/if}
- </div>
- <div class="profile-tool-row">
- <select class="select-role" bind:value={raffleClass} aria-label={$t("league.raffle_champion") as string}>
- <option value="">{$t("league.raffle_class_any")}</option>
- {#each CHAMPION_CLASSES as cls (cls)}
- <option value={cls}>{$t(`league.raffle_class_${cls}`)}</option>
- {/each}
- </select>
- <button class="button" onclick={drawChampion} disabled={drawingChampion}>{drawnChampion ? $t("league.raffle_again") : $t("league.raffle_champion")}</button>
- {#if drawnChampion}
- <img class="champ-icon small" src={`${CDRAGON}/champion-icons/${drawnChampion.id}.png`} alt="" loading="lazy" />
- <strong>{drawnChampion.name}</strong>
- <span class="dim">({drawnChampion.candidates} {$t("league.raffle_pool")})</span>
- {/if}
- </div>
- {#if raffleError}
- <p class="action-error" role="alert">{raffleError}</p>
- {/if}
- {:else if phase === "EndOfGame" || phase === "PreEndOfGame" || phase === "WaitingForStats"}
- <div class="lobby-actions">
- <button class="button primary" onclick={() => onAction("league_play_again")}>{$t("league.play_again")}</button>
- </div>
- {:else if queues.length > 0}
- <div class="queue-grid">
- {#each queues as q (q.id)}
- <button class="button" onclick={() => onAction("league_create_lobby", { queueId: q.id })}>{q.shortName || q.name}</button>
- {/each}
- </div>
- {:else}
- <p class="empty-hint">{$t("league.lobby_hint")}</p>
- {/if}
- </section>
- {/if}
-{/if}
-
-<style>
- .skin-row {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 8px;
- }
-</style>
diff --git a/src/components/league/ProfileTab.svelte b/src/components/league/ProfileTab.svelte
deleted file mode 100644
index 6820759c..00000000
--- a/src/components/league/ProfileTab.svelte
+++ /dev/null
@@ -1,604 +0,0 @@
-<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
- import { t } from "$lib/i18n";
- import { CDRAGON, assetUrl, type Champion } from "./shared";
-
- let {
- summoner,
- champions,
- active,
- }: {
- summoner: any;
- champions: Champion[];
- active?: boolean;
- } = $props();
-
- type ProfileState = {
- availability: string | null;
- statusMessage: string | null;
- chatIcon: number | null;
- rank: { queue: string | null; tier: string | null; division: string | null };
- challengeCrystal: { level: string | null; points: number | null };
- tokens: number[];
- title: string;
- bannerAccent: string;
- backgroundSkinId: number | null;
- wallet: { rp: number | null; blueEssence: number | null };
- friendsCount: number;
- };
-
- const QUEUES = ["RANKED_SOLO_5x5", "RANKED_FLEX_SR", "RANKED_TFT"] as const;
- const TIERS = ["UNRANKED", "IRON", "BRONZE", "SILVER", "GOLD", "PLATINUM", "EMERALD", "DIAMOND", "MASTER", "GRANDMASTER", "CHALLENGER"] as const;
- const DIVISIONS = ["I", "II", "III", "IV"] as const;
- const AVAILABILITIES = ["chat", "away", "dnd", "offline", "mobile"] as const;
- const STATUS_MAX = 255;
-
- let profile = $state<ProfileState | null>(null);
- let loading = $state(false);
- let loaded = false;
- let error = $state("");
- let saved = $state("");
-
- function errText(e: unknown): string {
- return typeof e === "string" ? e : ((e as any)?.message ?? String(e));
- }
-
- async function run(action: () => Promise<unknown>, label: string) {
- error = "";
- saved = "";
- try {
- await action();
- saved = label;
- setTimeout(() => { if (saved === label) saved = ""; }, 2500);
- await load(true);
- } catch (e) {
- error = errText(e);
- }
- }
-
- async function load(silent = false) {
- if (!silent) loading = true;
- try {
- profile = await invoke<ProfileState>("league_profile_state");
- statusMessage = profile.statusMessage ?? "";
- rankQueue = profile.rank.queue ?? "RANKED_SOLO_5x5";
- rankTier = profile.rank.tier && profile.rank.tier !== "" ? profile.rank.tier : "UNRANKED";
- rankDivision = DIVISIONS.includes(profile.rank.division as any) ? (profile.rank.division as string) : "I";
- crystalLevel = profile.challengeCrystal.level && profile.challengeCrystal.level !== "" ? profile.challengeCrystal.level : "UNRANKED";
- crystalPoints = profile.challengeCrystal.points ?? 0;
- slots = [profile.tokens[0] ?? 0, profile.tokens[1] ?? 0, profile.tokens[2] ?? 0];
- titleId = profile.title ?? "";
- bannerId = profile.bannerAccent ?? "1";
- loaded = true;
- } catch (e) {
- if (!silent) error = errText(e);
- } finally {
- loading = false;
- }
- }
-
- $effect(() => {
- if (active !== false && summoner && !loaded) load();
- });
-
- // Presence
- let statusMessage = $state("");
-
- // Rank shown in chat
- let rankQueue = $state<string>("RANKED_SOLO_5x5");
- let rankTier = $state<string>("UNRANKED");
- let rankDivision = $state<string>("I");
- let apex = $derived(["MASTER", "GRANDMASTER", "CHALLENGER", "UNRANKED"].includes(rankTier));
-
- // Challenge crystal
- let crystalLevel = $state<string>("UNRANKED");
- let crystalPoints = $state<number>(0);
-
- // Tokens, title, banner
- type Token = { id: number; name: string; level: string; iconPath: string; description: string };
- let tokens = $state<Token[]>([]);
- let titles = $state<{ id: string; name: string }[]>([]);
- let banners = $state<{ id: string; name: string }[]>([]);
- let challengesLoaded = $state(false);
- let slots = $state<number[]>([0, 0, 0]);
- let titleId = $state("");
- let bannerId = $state("1");
- let tokenSearch = $state("");
- let tokensByName = $derived(
- tokens.filter((tk) => !tokenSearch.trim() || tk.name.toLowerCase().includes(tokenSearch.trim().toLowerCase())),
- );
- let tokenById = $derived(new Map(tokens.map((tk) => [tk.id, tk])));
-
- async function loadChallenges() {
- if (challengesLoaded) return;
- challengesLoaded = true;
- try {
- const res = await invoke<any>("league_challenges");
- tokens = res?.tokens ?? [];
- titles = res?.titles ?? [];
- } catch (e) {
- error = errText(e);
- }
- try {
- const res = await fetch(`${CDRAGON}/regalia.json`);
- const data = (await res.json()) as any[];
- const list = data
- .filter((r) => r?.regaliaType === "kBanner" && r?.isSelectable && r?.id !== undefined)
- .map((r) => ({ id: String(r.id), name: r.localizedName || `#${r.id}` }));
- if (!list.some((b) => b.id === "1")) list.unshift({ id: "1", name: $t("league.banner_none") as string });
- banners = list.sort((a, b) => (a.id === "1" ? -1 : b.id === "1" ? 1 : a.name.localeCompare(b.name)));
- } catch {
- banners = [{ id: "1", name: $t("league.banner_none") as string }];
- }
- }
-
- function setSlot(index: number, id: number) {
- const next = [...slots];
- next[index] = id;
- slots = next;
- }
-
- function applyPrefs() {
- run(
- () =>
- invoke("league_set_challenge_prefs", {
- challengeIds: slots.filter((id) => id > 0),
- title: titleId,
- bannerAccent: bannerId,
- }),
- $t("league.tokens_saved") as string,
- );
- }
-
- // Icons
- type Icon = { id: number; title: string };
- let icons = $state<Icon[]>([]);
- let iconsLoaded = false;
- let iconSearch = $state("");
- let iconResults = $derived.by(() => {
- const q = iconSearch.trim().toLowerCase();
- if (!q) return icons.slice(0, 24);
- const asNumber = Number(q);
- return icons
- .filter((i) => i.title.toLowerCase().includes(q) || (Number.isFinite(asNumber) && i.id === asNumber))
- .slice(0, 40);
- });
-
- async function loadIcons() {
- if (iconsLoaded) return;
- iconsLoaded = true;
- try {
- const res = await fetch(`${CDRAGON}/summoner-icons.json`);
- const data = (await res.json()) as any[];
- icons = data
- .filter((i) => typeof i?.id === "number")
- .map((i) => ({ id: i.id, title: i.title || i.descriptions?.[0]?.description || `#${i.id}` }))
- .sort((a, b) => b.id - a.id);
- } catch {
- icons = [];
- }
- }
-
- // Background
- let bgChampion = $state<number>(0);
- let ownedSkins = $state<{ id: number; name: string }[]>([]);
-
- async function loadOwnedSkins(championId: number) {
- ownedSkins = [];
- if (championId <= 0) return;
- try {
- const res = await invoke<any>("league_owned_skins", { championId });
- ownedSkins = res?.skins ?? [];
- } catch {
- ownedSkins = [];
- }
- }
-
- // Friends
- type Friend = { id: string; gameName: string; gameTag: string; name: string; availability: string; icon: number; note: string; groupName: string };
- let friends = $state<Friend[]>([]);
- let friendsLoading = $state(false);
- let friendSearch = $state("");
- let selected = $state<Set<string>>(new Set());
- let confirmingRemove = $state(false);
- let removing = $state(false);
- let visibleFriends = $derived.by(() => {
- const q = friendSearch.trim().toLowerCase();
- return friends.filter((f) => !q || `${f.gameName}#${f.gameTag}`.toLowerCase().includes(q) || f.name.toLowerCase().includes(q));
- });
-
- async function loadFriends() {
- friendsLoading = true;
- error = "";
- try {
- const res = await invoke<any>("league_friends");
- friends = (res?.friends ?? []).sort((a: Friend, b: Friend) => a.gameName.localeCompare(b.gameName));
- selected = new Set();
- } catch (e) {
- error = errText(e);
- } finally {
- friendsLoading = false;
- }
- }
-
- function toggleFriend(id: string) {
- const next = new Set(selected);
- if (next.has(id)) next.delete(id);
- else next.add(id);
- selected = next;
- }
-
- function selectVisible() {
- selected = new Set(visibleFriends.map((f) => f.id));
- }
-
- async function removeSelected() {
- if (removing || selected.size === 0) return;
- removing = true;
- error = "";
- try {
- const res = await invoke<any>("league_remove_friends", { ids: [...selected] });
- saved = `${$t("league.friends_removed")}: ${res?.removed ?? 0}`;
- confirmingRemove = false;
- await loadFriends();
- await load(true);
- } catch (e) {
- error = errText(e);
- } finally {
- removing = false;
- }
- }
-</script>
-
-{#if active !== false}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.profile_title")}</h3>
- <span class="feature-badge">{$t("league.badge_beta")}</span>
- </div>
- <p class="win-disclaimer">{$t("league.profile_desc")}</p>
- {#if error}
- <p class="action-error" role="alert">{error}</p>
- {/if}
- {#if saved}
- <p class="profile-saved">{saved}</p>
- {/if}
- {#if loading && !profile}
- <p class="dim">…</p>
- {/if}
- {#if profile}
- <div class="wallet-row">
- <span class="queue-chip">{$t("league.wallet_rp")} <strong>{profile.wallet.rp ?? "—"}</strong></span>
- <span class="queue-chip">{$t("league.wallet_be")} <strong>{profile.wallet.blueEssence ?? "—"}</strong></span>
- <span class="queue-chip">{$t("league.friends_count")} <strong>{profile.friendsCount}</strong></span>
- </div>
- {/if}
- </section>
-
- <!-- Presence -->
- <section class="card">
- <div class="card-head"><h3>{$t("league.profile_section_presence")}</h3></div>
- <div class="profile-tool-row">
- <span class="list-label">{$t("league.profile_status")}</span>
- <div class="seg-group" role="radiogroup" aria-label={$t("league.profile_status") as string}>
- {#each AVAILABILITIES as value (value)}
- <button
- class="seg"
- class:on={profile?.availability === value}
- role="radio"
- aria-checked={profile?.availability === value}
- onclick={() => run(() => invoke("league_set_status", { availability: value }), $t("league.profile_status_saved") as string)}
- >{$t(`league.status_${value}`)}</button>
- {/each}
- </div>
- </div>
- <div class="profile-tool-row stacked">
- <span class="list-label">{$t("league.profile_message")} <span class="list-hint">{statusMessage.length}/{STATUS_MAX}</span></span>
- <textarea class="input-text status-area" maxlength={STATUS_MAX} rows="3" bind:value={statusMessage} placeholder={$t("league.profile_message") as string}></textarea>
- <span class="action-hint">{$t("league.profile_message_hint")}</span>
- <div class="inline-actions">
- <button class="button" onclick={() => run(() => invoke("league_set_status", { message: statusMessage }), $t("league.profile_message_saved") as string)}>{$t("league.apply")}</button>
- <button class="button subtle" onclick={() => { statusMessage = ""; run(() => invoke("league_set_status", { message: "" }), $t("league.profile_message_saved") as string); }}>{$t("league.tokens_clear")}</button>
- </div>
- </div>
- </section>
-
- <!-- Icons -->
- <section class="card">
- <div class="card-head"><h3>{$t("league.profile_section_icon")}</h3></div>
- <span class="action-hint">{$t("league.profile_icon_hint")}</span>
- <div class="profile-tool-row">
- <input
- class="input-text"
- placeholder={$t("league.profile_icon_search") as string}
- bind:value={iconSearch}
- onfocus={loadIcons}
- oninput={loadIcons}
- />
- </div>
- {#if icons.length > 0}
- <div class="icon-grid">
- {#each iconResults as icon (icon.id)}
- <div class="icon-cell" class:current={summoner?.profileIconId === icon.id}>
- <img src={`${CDRAGON}/profile-icons/${icon.id}.jpg`} alt="" loading="lazy" />
- <span class="icon-title" title={icon.title}>{icon.title}</span>
- <div class="icon-actions">
- <button class="button subtle tiny" onclick={() => run(() => invoke("league_set_icon", { iconId: icon.id }), $t("league.profile_icon_saved") as string)}>{$t("league.profile_icon")}</button>
- <button class="button subtle tiny" onclick={() => run(() => invoke("league_set_chat_icon", { iconId: icon.id }), $t("league.profile_icon_chat_saved") as string)}>{$t("league.profile_icon_chat")}</button>
- </div>
- </div>
- {/each}
- </div>
- {/if}
- </section>
-
- <!-- Rank in chat -->
- <section class="card">
- <div class="card-head"><h3>{$t("league.profile_section_rank")}</h3></div>
- <span class="action-hint">{$t("league.rank_hint")}</span>
- <div class="profile-tool-row">
- <select class="select-role" bind:value={rankQueue} aria-label={$t("league.rank_queue") as string}>
- {#each QUEUES as q (q)}
- <option value={q}>{q === "RANKED_SOLO_5x5" ? $t("league.ranked_solo") : q === "RANKED_FLEX_SR" ? $t("league.ranked_flex") : "TFT"}</option>
- {/each}
- </select>
- <select class="select-role" bind:value={rankTier} aria-label={$t("league.rank_tier") as string}>
- {#each TIERS as tier (tier)}
- <option value={tier}>{tier === "UNRANKED" ? $t("league.unranked") : tier.charAt(0) + tier.slice(1).toLowerCase()}</option>
- {/each}
- </select>
- <select class="select-role" bind:value={rankDivision} disabled={apex} aria-label={$t("league.rank_division") as string}>
- {#each DIVISIONS as d (d)}
- <option value={d}>{d}</option>
- {/each}
- </select>
- <button class="button" onclick={() => run(() => invoke("league_set_chat_rank", { queue: rankQueue, tier: rankTier, division: apex ? "NA" : rankDivision }), $t("league.rank_saved") as string)}>{$t("league.apply")}</button>
- <button class="button subtle" onclick={() => run(() => invoke("league_reset_chat_rank"), $t("league.rank_saved") as string)}>{$t("league.rank_reset")}</button>
- </div>
- <div class="profile-tool-row">
- <span class="list-label">{$t("league.crystal_title")}</span>
- <select class="select-role" bind:value={crystalLevel} aria-label={$t("league.crystal_level") as string}>
- {#each TIERS as tier (tier)}
- <option value={tier}>{tier === "UNRANKED" ? $t("league.unranked") : tier.charAt(0) + tier.slice(1).toLowerCase()}</option>
- {/each}
- </select>
- <input class="input-text tiny-input" type="number" min="0" max="1000000" bind:value={crystalPoints} aria-label={$t("league.crystal_points") as string} />
- <button class="button" onclick={() => run(() => invoke("league_set_challenge_crystal", { level: crystalLevel, points: Number(crystalPoints) || 0 }), $t("league.crystal_saved") as string)}>{$t("league.apply")}</button>
- </div>
- </section>
-
- <!-- Tokens, title, banner -->
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.tokens_title")}</h3>
- {#if !challengesLoaded || tokens.length === 0}
- <button class="button subtle" onclick={loadChallenges}>{$t("league.friends_load")}</button>
- {/if}
- </div>
- <span class="action-hint">{$t("league.tokens_desc")}</span>
- {#if tokens.length > 0 || titles.length > 0}
- <div class="token-slots">
- {#each [0, 1, 2] as index (index)}
- {@const current = tokenById.get(slots[index])}
- <div class="token-slot">
- {#if current?.iconPath}
- <img class="token-icon" src={assetUrl(current.iconPath)} alt="" loading="lazy" />
- {:else}
- <div class="token-icon empty" aria-hidden="true"></div>
- {/if}
- <span class="dim">{$t("league.tokens_slot")} {index + 1}</span>
- <select class="select-role" value={slots[index]} onchange={(e) => setSlot(index, Number(e.currentTarget.value))} aria-label={`${$t("league.tokens_slot")} ${index + 1}`}>
- <option value={0}>{$t("league.tokens_none")}</option>
- {#each tokensByName as tk (tk.id)}
- <option value={tk.id}>{tk.name} · {tk.level.charAt(0) + tk.level.slice(1).toLowerCase()}</option>
- {/each}
- </select>
- </div>
- {/each}
- </div>
- <div class="profile-tool-row">
- <input class="input-text" placeholder={$t("league.tokens_search") as string} bind:value={tokenSearch} />
- </div>
- <div class="profile-tool-row">
- <span class="list-label">{$t("league.title_label")}</span>
- <select class="select-role" bind:value={titleId} aria-label={$t("league.title_label") as string}>
- <option value="">{$t("league.title_none")}</option>
- {#each titles as title (title.id)}
- <option value={title.id}>{title.name}</option>
- {/each}
- </select>
- </div>
- <div class="profile-tool-row">
- <span class="list-label">{$t("league.banner_label")}</span>
- <select class="select-role" bind:value={bannerId} aria-label={$t("league.banner_label") as string}>
- {#each banners as banner (banner.id)}
- <option value={banner.id}>{banner.name}</option>
- {/each}
- </select>
- </div>
- <div class="inline-actions">
- <button class="button" onclick={applyPrefs}>{$t("league.apply")}</button>
- <button class="button subtle" onclick={() => { slots = [0, 0, 0]; applyPrefs(); }}>{$t("league.tokens_clear")}</button>
- </div>
- {:else if challengesLoaded}
- <p class="empty-hint">{$t("league.tokens_empty")}</p>
- {/if}
- </section>
-
- <!-- Background -->
- <section class="card">
- <div class="card-head"><h3>{$t("league.profile_background")}</h3></div>
- <div class="profile-tool-row">
- <select class="select-role" bind:value={bgChampion} onchange={() => loadOwnedSkins(bgChampion)} aria-label={$t("league.profile_background") as string}>
- <option value={0}>{$t("league.build_champion")}</option>
- {#each champions as ch (ch.id)}
- <option value={ch.id}>{ch.name}</option>
- {/each}
- </select>
- {#if ownedSkins.length > 0}
- <div class="skin-options">
- {#each ownedSkins as skin (skin.id)}
- <button class="button subtle" class:on={profile?.backgroundSkinId === skin.id} onclick={() => run(() => invoke("league_set_profile_background", { skinId: skin.id }), $t("league.profile_background_saved") as string)}>{skin.name}</button>
- {/each}
- </div>
- {:else if bgChampion > 0}
- <span class="dim">{$t("league.profile_no_skins")}</span>
- {/if}
- </div>
- </section>
-
- <!-- Friends -->
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.friends_title")}</h3>
- <button class="button subtle" onclick={loadFriends} disabled={friendsLoading}>{$t("league.friends_load")}</button>
- </div>
- <span class="action-hint">{$t("league.friends_desc")}</span>
- {#if friends.length > 0}
- <div class="profile-tool-row">
- <input class="input-text" placeholder={$t("league.search_placeholder") as string} bind:value={friendSearch} />
- <button class="button subtle" onclick={selectVisible}>{$t("league.friends_select_all")}</button>
- <button class="button subtle" onclick={() => (selected = new Set())}>{$t("league.friends_clear_selection")}</button>
- </div>
- <div class="friend-list">
- {#each visibleFriends as friend (friend.id)}
- <label class="friend-row" class:picked={selected.has(friend.id)}>
- <input type="checkbox" checked={selected.has(friend.id)} onchange={() => toggleFriend(friend.id)} />
- <img class="friend-icon" src={`${CDRAGON}/profile-icons/${friend.icon}.jpg`} alt="" loading="lazy" />
- <span class="friend-name">{friend.gameName}<span class="tag">#{friend.gameTag}</span></span>
- <span class="friend-meta dim">{friend.availability}{friend.groupName ? ` · ${friend.groupName}` : ""}</span>
- </label>
- {/each}
- </div>
- <div class="inline-actions">
- {#if confirmingRemove}
- <span class="dodge-warning">{$t("league.friends_remove_confirm")}</span>
- <button class="button" onclick={() => (confirmingRemove = false)}>{$t("league.dodge_cancel")}</button>
- <button class="button danger" onclick={removeSelected} disabled={removing}>{$t("league.friends_remove_go")} ({selected.size})</button>
- {:else}
- <button class="button subtle-danger" disabled={selected.size === 0} onclick={() => (confirmingRemove = true)}>{$t("league.friends_remove")} ({selected.size})</button>
- {/if}
- </div>
- {:else if friendsLoading}
- <p class="dim">…</p>
- {/if}
- </section>
-{/if}
-
-<style>
- .wallet-row {
- display: flex;
- flex-wrap: wrap;
- gap: 8px;
- }
- .status-area {
- width: 100%;
- resize: vertical;
- font: inherit;
- }
- .profile-tool-row.stacked {
- flex-direction: column;
- align-items: stretch;
- }
- .inline-actions {
- display: flex;
- flex-wrap: wrap;
- gap: 8px;
- align-items: center;
- }
- .icon-grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
- gap: 8px;
- }
- .icon-cell {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
- padding: 6px;
- border-radius: 10px;
- background: color-mix(in srgb, var(--surface) 70%, transparent);
- }
- .icon-cell.current {
- outline: 2px solid currentColor;
- }
- .icon-cell img {
- width: 56px;
- height: 56px;
- border-radius: 50%;
- }
- .icon-title {
- font-size: 11px;
- text-align: center;
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .icon-actions {
- display: flex;
- gap: 4px;
- }
- .token-slots {
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 8px;
- }
- .token-slot {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 4px;
- }
- .token-slot :global(.select-role) {
- width: 100%;
- max-width: 100%;
- }
- .token-icon {
- width: 48px;
- height: 48px;
- }
- .token-icon.empty {
- border-radius: 50%;
- border: 1px dashed currentColor;
- opacity: 0.4;
- }
- .friend-list {
- display: flex;
- flex-direction: column;
- gap: 2px;
- max-height: 320px;
- overflow: auto;
- }
- .friend-row {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 4px 6px;
- border-radius: 8px;
- cursor: pointer;
- }
- .friend-row.picked {
- background: color-mix(in srgb, var(--surface) 60%, transparent);
- }
- .friend-icon {
- width: 22px;
- height: 22px;
- border-radius: 50%;
- }
- .friend-name {
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .friend-meta {
- font-size: 11px;
- }
- @media (max-width: 520px) {
- .token-slots {
- grid-template-columns: 1fr;
- }
- }
-</style>
diff --git a/src/components/league/SearchTab.svelte b/src/components/league/SearchTab.svelte
deleted file mode 100644
index e4ef3b5b..00000000
--- a/src/components/league/SearchTab.svelte
+++ /dev/null
@@ -1,269 +0,0 @@
-<script lang="ts">
- import { invoke } from "@tauri-apps/api/core";
- import { t } from "$lib/i18n";
- import { CDRAGON, TAG_KEYS, type Champion, type RankedEntry } from "./shared";
-
- let {
- championById,
- active,
- }: {
- championById: Map<number, Champion>;
- active?: boolean;
- } = $props();
-
- let searchQuery = $state("");
- let searchResult = $state<any>(null);
- let searchLoading = $state(false);
- let searchError = $state("");
- let jungleReport = $state<any>(null);
- let duos = $state<any>(null);
- let duosLoading = $state(false);
-
- function rankLabel(entry: RankedEntry | undefined): string {
- if (!entry?.tier || entry.tier === "NONE" || entry.tier === "") return $t("league.unranked") as string;
- const tier = entry.tier.charAt(0) + entry.tier.slice(1).toLowerCase();
- return `${tier} ${entry.division ?? ""} · ${entry.leaguePoints ?? 0} LP`;
- }
-
- async function runSearch() {
- const raw = searchQuery.trim();
- if (!raw || searchLoading) return;
- const [namePart, tagPart = ""] = raw.split("#");
- searchLoading = true;
- searchError = "";
- jungleReport = null;
- try {
- searchResult = await invoke<any>("league_search_player", {
- gameName: namePart.trim(),
- tagLine: tagPart.trim(),
- });
- const puuid = searchResult?.summoner?.puuid;
- if (puuid) {
- invoke<any>("league_jungle_report", { puuid, sample: 8 })
- .then((r) => { jungleReport = r; })
- .catch(() => { jungleReport = null; });
- }
- } catch (e: any) {
- searchResult = null;
- searchError = typeof e === "string" ? e : (e?.message ?? String(e));
- } finally {
- searchLoading = false;
- }
- }
-
- let spectateLoading = $state(false);
- let spectateError = $state("");
-
- async function spectateSearched() {
- const s = searchResult?.summoner;
- if (!s?.puuid || spectateLoading) return;
- spectateLoading = true;
- spectateError = "";
- try {
- await invoke("league_spectate", {
- puuid: s.puuid,
- riotId: `${s.gameName}#${s.tagLine}`,
- });
- } catch (e: any) {
- const raw = typeof e === "string" ? e : (e?.message ?? String(e));
- spectateError = raw.includes(" 404") || raw.includes("not in")
- ? ($t("league.spectate_not_in_game") as string)
- : raw;
- } finally {
- spectateLoading = false;
- }
- }
-
- async function loadDuos() {
- if (duosLoading) return;
- duosLoading = true;
- try {
- duos = await invoke<any>("league_duos", { sample: 20 });
- } catch {
- duos = { duos: [] };
- } finally {
- duosLoading = false;
- }
- }
-</script>
-
-{#if active !== false}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.search_title")}</h3>
- </div>
- <form class="search-form" onsubmit={(e) => { e.preventDefault(); runSearch(); }}>
- <input
- class="input-text"
- placeholder={$t("league.search_placeholder") as string}
- bind:value={searchQuery}
- spellcheck="false"
- />
- <button class="button primary" type="submit" disabled={searchLoading}>
- {searchLoading ? $t("league.searching_player") : $t("league.search_button")}
- </button>
- </form>
- {#if searchError}
- <p class="action-error" role="alert">{searchError}</p>
- {:else}
- <p class="win-disclaimer">{$t("league.search_hint")}</p>
- {/if}
- </section>
-
- {#if searchResult}
- {@const s = searchResult.summoner}
- {@const r = searchResult.report}
- {#if r?.sgpUsed}
- <p class="win-disclaimer">{$t("league.search_source_sgp")}</p>
- {/if}
- <section class="profile-card">
- <img class="profile-icon" src={`${CDRAGON}/profile-icons/${s.profileIconId}.jpg`} alt="" loading="lazy" />
- <div class="profile-info">
- <span class="profile-name">{s.gameName}<span class="tag">#{s.tagLine}</span></span>
- <span class="profile-level">{$t("league.level")} {s.summonerLevel ?? "—"}</span>
- </div>
- <div class="ranked-chips">
- <div class="ranked-chip">
- <span class="ranked-queue">{$t("league.ranked_solo")}</span>
- <span class="ranked-value">{rankLabel(r?.solo)}</span>
- </div>
- <div class="ranked-chip">
- <span class="ranked-queue">{$t("league.ranked_flex")}</span>
- <span class="ranked-value">{rankLabel(r?.flex)}</span>
- </div>
- </div>
- <button class="button" onclick={spectateSearched} disabled={spectateLoading}>
- {spectateLoading ? $t("league.spectate_loading") : $t("league.spectate")}
- </button>
- </section>
- {#if spectateError}
- <p class="action-error">{spectateError}</p>
- {/if}
-
- {#if r?.stats?.games > 0}
- <section class="card">
- <div class="card-head"><h3>{$t("league.search_recent")}</h3></div>
- <div class="stat-grid">
- <div class="stat-cell">
- <span class="stat-value" class:good={r.stats.winrate >= 55} class:bad={r.stats.winrate <= 45}>{r.stats.winrate}%</span>
- <span class="stat-label">{$t("league.stat_winrate")} ({r.stats.games})</span>
- </div>
- <div class="stat-cell">
- <span class="stat-value">{r.stats.kda}</span>
- <span class="stat-label">KDA</span>
- </div>
- <div class="stat-cell">
- <span class="stat-value">{r.stats.streak?.length ?? 0}</span>
- <span class="stat-label">{r.stats.streak?.win ? $t("league.tag_hot_streak") : $t("league.tag_cold_streak")}</span>
- </div>
- {#if r.impact !== null && r.impact !== undefined}
- <div class="stat-cell">
- <span class="stat-value">{r.impact}<span class="dim">/10</span></span>
- <span class="stat-label">{$t("league.impact_label")} ({r.impactGames})</span>
- </div>
- {/if}
- {#if searchResult.deep}
- <div class="stat-cell">
- <span class="stat-value">{searchResult.deep.soloKillsPerGame}</span>
- <span class="stat-label">{$t("league.solo_kills_label")} ({searchResult.deep.analysedGames})</span>
- </div>
- <div class="stat-cell">
- <span class="stat-value">{searchResult.deep.earlyDeathsPerGame}</span>
- <span class="stat-label">{$t("league.early_deaths_label")} ({searchResult.deep.analysedGames})</span>
- </div>
- {/if}
- </div>
- {#if r.stats.insights?.length}
- <div class="scout-champs">
- {#each r.stats.insights as tagId (tagId)}
- <span class="scout-tag">{$t(TAG_KEYS[tagId] ?? tagId)}</span>
- {/each}
- </div>
- {/if}
- </section>
- {/if}
-
- {#if searchResult.champions?.length}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.search_champions")}</h3>
- <span class="phase-tag">{$t("league.search_champions_hint")}</span>
- </div>
- <div class="champ-table">
- {#each searchResult.champions as ch (ch.championId)}
- <div class="champ-row">
- <img class="champ-icon small" src={`${CDRAGON}/champion-icons/${ch.championId}.png`} alt="" loading="lazy" />
- <span class="champ-row-name">{championById.get(ch.championId)?.name ?? ch.championId}</span>
- <span class="champ-row-games">{ch.games} {$t("league.games_short")}</span>
- <span class="champ-row-wr" class:good={ch.winrate >= 55} class:bad={ch.winrate <= 45}>{ch.winrate}%</span>
- <span class="champ-row-kda">{ch.kda} KDA</span>
- <span class="champ-row-cs dim">{ch.csPerMin}/m</span>
- </div>
- {/each}
- </div>
- </section>
- {/if}
-
- {#if r?.mastery?.length}
- <section class="card">
- <div class="card-head"><h3>{$t("league.search_mastery")}</h3></div>
- <div class="scout-champs">
- {#each r.mastery as m (m.championId)}
- <span class="champ-chip">
- <img class="champ-icon tiny" src={`${CDRAGON}/champion-icons/${m.championId}.png`} alt="" loading="lazy" />
- {championById.get(m.championId)?.name ?? m.championId}
- <span class="dim">M{m.championLevel} · {Math.round((m.championPoints ?? 0) / 1000)}k</span>
- </span>
- {/each}
- </div>
- </section>
- {/if}
-
- {#if jungleReport}
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.jungle_title")}</h3>
- <span class="phase-tag">{jungleReport.analysedGames} {$t("league.games_short")}</span>
- </div>
- {#if jungleReport.analysedGames > 0}
- <div class="zone-bars">
- {#each [["top", jungleReport.zones.top], ["mid", jungleReport.zones.mid], ["bot", jungleReport.zones.bot]] as [zone, pct] (zone)}
- <div class="zone-row">
- <span class="zone-name">{$t(`league.zone_${zone}`)}</span>
- <div class="goal-bar"><div class="goal-fill" style={`width:${pct}%`}></div></div>
- <span class="goal-value">{pct}%</span>
- </div>
- {/each}
- </div>
- <p class="win-note">
- {$t(`league.pref_${jungleReport.preference}`)} · {$t("league.jungle_invade")} {jungleReport.invadeRate}% · {$t("league.jungle_gank3")} {jungleReport.level3GankRate}%
- </p>
- {:else}
- <p class="empty-hint">{$t("league.jungle_empty")}</p>
- {/if}
- </section>
- {/if}
- {/if}
-
- <section class="card">
- <div class="card-head">
- <h3>{$t("league.duos_title")}</h3>
- <button class="button" onclick={loadDuos} disabled={duosLoading}>{$t("league.refresh")}</button>
- </div>
- <p class="win-disclaimer">{$t("league.duos_desc")}</p>
- {#if duos?.duos?.length}
- <div class="champ-table">
- {#each duos.duos as d (d.puuid)}
- <div class="champ-row">
- <span class="champ-row-name">{d.gameName ?? "—"}{#if d.tagLine}<span class="dim">#{d.tagLine}</span>{/if}</span>
- <span class="champ-row-games">{d.games} {$t("league.games_short")}</span>
- <span class="champ-row-wr" class:good={d.winrate >= 55} class:bad={d.winrate <= 45}>{d.winrate}%</span>
- <span class="champ-row-kda dim">{$t("league.duos_score")} {d.score}%</span>
- </div>
- {/each}
- </div>
- {:else if duos}
- <p class="empty-hint">{$t("league.duos_empty")}</p>
- {/if}
- </section>
-{/if}
diff --git a/src/components/league/Skeleton.svelte b/src/components/league/Skeleton.svelte
deleted file mode 100644
index bb34cf69..00000000
--- a/src/components/league/Skeleton.svelte
+++ /dev/null
@@ -1,44 +0,0 @@
-<script lang="ts">
- let {
- w = "100%",
- h = "14px",
- round = "6px",
- }: {
- w?: string;
- h?: string;
- round?: string;
- } = $props();
-</script>
-
-<span class="skeleton" style={`width:${w};height:${h};border-radius:${round}`} aria-hidden="true"></span>
-
-<style>
- .skeleton {
- display: inline-block;
- flex-shrink: 0;
- background: linear-gradient(
- 100deg,
- var(--button) 40%,
- var(--border) 50%,
- var(--button) 60%
- );
- background-size: 200% 100%;
- animation: skeleton-shimmer 1.4s ease-in-out infinite;
- }
-
- @media (prefers-reduced-motion: reduce) {
- .skeleton {
- animation: none;
- background: var(--button);
- }
- }
-
- @keyframes skeleton-shimmer {
- from {
- background-position: 200% 0;
- }
- to {
- background-position: -100% 0;
- }
- }
-</style>
diff --git a/src/components/league/registry.test.ts b/src/components/league/registry.test.ts
deleted file mode 100644
index 8d0a828d..00000000
--- a/src/components/league/registry.test.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import { describe, it, expect } from "vitest";
-import {
- availability,
- featureById,
- LEAGUE_FEATURES,
- needsBadge,
- type Feature,
-} from "./registry";
-
-const online = { platform: "macos" as const, clientConnected: true, inGame: true };
-
-describe("availability", () => {
- const feature: Feature = {
- id: "x",
- labelKey: "k",
- state: "stable",
- platforms: ["windows", "macos"],
- requiresClient: true,
- requiresGame: true,
- };
-
- it("clears a feature whose requirements are all met", () => {
- expect(availability(feature, online)).toEqual({ available: true });
- });
-
- it("reports the platform first, because nothing else can fix it", () => {
- const result = availability(feature, { ...online, platform: "linux", clientConnected: false });
- expect(result).toEqual({ available: false, reasonKey: "league.unavailable_platform" });
- });
-
- it("reports the client before the game", () => {
- expect(availability(feature, { ...online, clientConnected: false, inGame: false })).toEqual({
- available: false,
- reasonKey: "league.unavailable_client",
- });
- });
-
- it("reports the game when only that is missing", () => {
- expect(availability(feature, { ...online, inGame: false })).toEqual({
- available: false,
- reasonKey: "league.unavailable_game",
- });
- });
-
- it("lets a feature with no requirements run anywhere it is supported", () => {
- const anywhere: Feature = { id: "y", labelKey: "k", state: "stable", platforms: ["linux"] };
- expect(availability(anywhere, { platform: "linux", clientConnected: false, inGame: false })).toEqual({
- available: true,
- });
- });
-});
-
-describe("the registry itself", () => {
- it("has unique ids", () => {
- const ids = LEAGUE_FEATURES.map((f) => f.id);
- expect(new Set(ids).size).toBe(ids.length);
- });
-
- it("looks features up by id", () => {
- expect(featureById("auto-accept")?.flag).toBe("auto_accept");
- expect(featureById("nope")).toBeUndefined();
- });
-
- it("marks only beta and experimental features", () => {
- expect(needsBadge({ id: "a", labelKey: "k", state: "beta", platforms: [] })).toBe(true);
- expect(needsBadge({ id: "a", labelKey: "k", state: "experimental", platforms: [] })).toBe(true);
- expect(needsBadge({ id: "a", labelKey: "k", state: "stable", platforms: [] })).toBe(false);
- });
-
- it("never claims a client-only feature works without the client", () => {
- for (const feature of LEAGUE_FEATURES.filter((f) => f.requiresGame)) {
- expect(feature.requiresGame).toBe(true);
- const result = availability(feature, { ...online, inGame: false });
- expect(result.available).toBe(false);
- }
- });
-});
diff --git a/src/components/league/registry.ts b/src/components/league/registry.ts
deleted file mode 100644
index de67aa29..00000000
--- a/src/components/league/registry.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-/// What the user can expect from a feature. `experimental` and `beta` are marked
-/// in the UI with a discreet badge; `unavailable` renders an explanation of why
-/// instead of a broken control.
-export type FeatureState = "stable" | "beta" | "experimental" | "unavailable";
-
-export type Platform = "windows" | "macos" | "linux";
-
-export type Feature = {
- id: string;
- /// i18n key for the human-readable name.
- labelKey: string;
- state: FeatureState;
- platforms: Platform[];
- /// Key under `settings.league` that switches it off, when there is one.
- flag?: string;
- /// Reason the feature cannot run, as an i18n key. Only meaningful together
- /// with the checks below.
- requiresClient?: boolean;
- requiresGame?: boolean;
-};
-
-/// Single place that records what each league surface needs to work, so a
-/// disabled control can always explain itself instead of silently failing.
-export const LEAGUE_FEATURES: readonly Feature[] = [
- { id: "scouting", labelKey: "league.scout_title", state: "stable", platforms: ["windows", "macos"], requiresClient: true },
- { id: "analysis", labelKey: "league.win_title", state: "stable", platforms: ["windows", "macos"], requiresClient: true },
- { id: "build-reference", labelKey: "league.meta_reference", state: "beta", platforms: ["windows", "macos", "linux"] },
- { id: "tier-list", labelKey: "league.tiers_title", state: "stable", platforms: ["windows", "macos", "linux"] },
- { id: "live-metrics", labelKey: "league.gold_title", state: "stable", platforms: ["windows", "macos"], requiresGame: true },
- { id: "objectives", labelKey: "league.objectives_title", state: "beta", platforms: ["windows", "macos"], requiresGame: true },
- { id: "profile-tools", labelKey: "league.profile_tools", state: "beta", platforms: ["windows", "macos"], requiresClient: true },
- { id: "restart-ux", labelKey: "league.restart_ux", state: "stable", platforms: ["windows", "macos"], requiresClient: true },
- { id: "auto-accept", labelKey: "league.auto_accept", state: "stable", platforms: ["windows", "macos"], flag: "auto_accept", requiresClient: true },
- { id: "auto-pick", labelKey: "league.auto_pick", state: "stable", platforms: ["windows", "macos"], flag: "auto_pick", requiresClient: true },
- { id: "auto-ban", labelKey: "league.auto_ban", state: "stable", platforms: ["windows", "macos"], flag: "auto_ban", requiresClient: true },
- { id: "auto-swaps", labelKey: "league.auto_swaps", state: "experimental", platforms: ["windows", "macos"], flag: "auto_accept_swaps", requiresClient: true },
- { id: "auto-requeue", labelKey: "league.auto_requeue", state: "experimental", platforms: ["windows", "macos"], flag: "auto_requeue", requiresClient: true },
- { id: "profile-editor", labelKey: "league.profile_title", state: "beta", platforms: ["windows", "macos"], requiresClient: true },
- { id: "skin-roulette", labelKey: "league.skin_roulette", state: "beta", platforms: ["windows", "macos"], flag: "skin_roulette", requiresClient: true },
- { id: "champion-raffle", labelKey: "league.raffle_title", state: "stable", platforms: ["windows", "macos"], requiresClient: true },
- { id: "pick-random", labelKey: "league.pick_random", state: "experimental", platforms: ["windows", "macos"], flag: "pick_random", requiresClient: true },
- { id: "sgp-history", labelKey: "league.sgp_enabled", state: "experimental", platforms: ["windows", "macos"], flag: "sgp_enabled", requiresClient: true },
- { id: "coach", labelKey: "league.coach_title", state: "beta", platforms: ["windows", "macos"], requiresClient: true },
-];
-
-export type Availability =
- | { available: true }
- | { available: false; reasonKey: string };
-
-export type Context = {
- platform: Platform;
- clientConnected: boolean;
- inGame: boolean;
-};
-
-/// Why a feature cannot be used right now, in the order the user can act on:
-/// platform first (nothing to do about it), then the client, then the game.
-export function availability(feature: Feature, context: Context): Availability {
- if (!feature.platforms.includes(context.platform)) {
- return { available: false, reasonKey: "league.unavailable_platform" };
- }
- if (feature.requiresClient && !context.clientConnected) {
- return { available: false, reasonKey: "league.unavailable_client" };
- }
- if (feature.requiresGame && !context.inGame) {
- return { available: false, reasonKey: "league.unavailable_game" };
- }
- return { available: true };
-}
-
-export function featureById(id: string): Feature | undefined {
- return LEAGUE_FEATURES.find((feature) => feature.id === id);
-}
-
-/// Features worth marking in the UI, so a badge is never guesswork.
-export function needsBadge(feature: Feature): boolean {
- return feature.state === "beta" || feature.state === "experimental";
-}
diff --git a/src/components/league/shared.ts b/src/components/league/shared.ts
deleted file mode 100644
index 495b8b33..00000000
--- a/src/components/league/shared.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-export const CDRAGON = "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1";
-export const RAW_CDRAGON = "https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default";
-
-// The client returns icon paths rooted at /lol-game-data/assets; the public
-// mirror serves the same files lowercased under its own prefix.
-export function assetUrl(path: string | null | undefined): string {
- if (!path) return "";
- const clean = path.replace(/^\/lol-game-data\/assets/i, "").toLowerCase();
- return `${RAW_CDRAGON}${clean}`;
-}
-
-export function formatGameTime(seconds: number): string {
- const m = Math.floor(seconds / 60);
- const s = Math.floor(seconds % 60);
- return `${m}:${String(s).padStart(2, "0")}`;
-}
-
-export const TAG_KEYS: Record<string, string> = {
- hot_streak: "league.tag_hot_streak",
- cold_streak: "league.tag_cold_streak",
- high_winrate: "league.tag_high_winrate",
- low_winrate: "league.tag_low_winrate",
- one_trick: "league.tag_one_trick",
- high_kda: "league.tag_high_kda",
- low_kda: "league.tag_low_kda",
- flash_swap: "league.tag_flash_swap",
- high_damage_efficiency: "league.tag_high_damage_efficiency",
- low_damage_efficiency: "league.tag_low_damage_efficiency",
-};
-
-export const ROLES = ["TOP", "JUNGLE", "MIDDLE", "BOTTOM", "UTILITY"] as const;
-export type Role = (typeof ROLES)[number];
-
-export const GOAL_FIELDS = [
- { key: "csPerMin", labelKey: "league.goal_cs", step: 0.1 },
- { key: "goldPerMin", labelKey: "league.goal_gold", step: 10 },
- { key: "kda", labelKey: "league.goal_kda", step: 0.1 },
- { key: "visionPerMin", labelKey: "league.goal_vision", step: 0.1 },
-] as const;
-export type GoalKey = (typeof GOAL_FIELDS)[number]["key"];
-
-export type Champion = { id: number; name: string; alias: string };
-export type RankedEntry = {
- tier?: string;
- division?: string;
- leaguePoints?: number;
- wins?: number;
- losses?: number;
-};
-export type ScoutPlayer = {
- puuid: string;
- gameName: string;
- tagLine: string;
- championId: number;
- cellId: number | null;
- isAlly: boolean;
- summonerLevel?: number;
-};
-export type LobbyQueue = { id: number; name: string; shortName: string; gameMode: string };
diff --git a/src/components/settings/SettingsAdvanced.svelte b/src/components/settings/SettingsAdvanced.svelte
index bff643a7..c2c480d5 100644
--- a/src/components/settings/SettingsAdvanced.svelte
+++ b/src/components/settings/SettingsAdvanced.svelte
@@ -16,7 +16,7 @@
searchActive?: boolean;
} = $props();
- type AdvancedDrill = "performance" | "torrent" | "expert" | "league" | "debug";
+ type AdvancedDrill = "performance" | "torrent" | "expert" | "debug";
let subView = $state<AdvancedDrill | null>(null);
let settings = $derived(getSettings());
@@ -25,7 +25,6 @@
{ id: "performance", titleKey: "settings.advanced.section_performance", hintKey: "settings.advanced.section_performance_desc" },
{ id: "torrent", titleKey: "settings.advanced.section_torrent", hintKey: "settings.advanced.section_torrent_desc" },
{ id: "expert", titleKey: "settings.advanced.section_expert", hintKey: "settings.advanced.section_expert_desc" },
- { id: "league", titleKey: "league.settings_title", hintKey: "league.settings_desc" },
{ id: "debug", titleKey: "settings.advanced.section_debug", hintKey: "settings.advanced.section_debug_desc" },
];
@@ -301,26 +300,6 @@
<input type="text" class="input-text" placeholder={$t('settings.advanced.user_agent_placeholder')} value={settings.advanced?.user_agent ?? ""} onchange={(e) => updateSettings({ advanced: { user_agent: (e.target as HTMLInputElement).value.trim() } })} />
</div>
</div>
- {:else if subView === "league"}
- <div class="card">
- <div class="setting-row">
- <div class="setting-col">
- <span class="setting-label">{$t('league.settings_enable')}</span>
- <span class="setting-path">{$t('league.settings_enable_desc')}</span>
- </div>
- <button class="toggle" class:on={settings.league?.enabled ?? true} onclick={() => updateSettings({ league: { enabled: !(settings.league?.enabled ?? true) } })} role="switch" aria-checked={settings.league?.enabled ?? true} aria-label={$t('league.settings_enable') as string}><span class="toggle-knob"></span></button>
- </div>
- {#if settings.league?.enabled ?? true}
- <div class="divider"></div>
- <div class="setting-row">
- <div class="setting-col">
- <span class="setting-label">{$t('league.settings_auto_accept')}</span>
- <span class="setting-path">{$t('league.settings_auto_accept_desc')}</span>
- </div>
- <button class="toggle" class:on={settings.league?.auto_accept} onclick={() => { const next = !(settings.league?.auto_accept ?? false); updateSettings({ league: { auto_accept: next } }); invoke("league_auto_accept_set", { enabled: next }).catch(() => {}); }} role="switch" aria-checked={settings.league?.auto_accept ?? false} aria-label={$t('league.settings_auto_accept') as string}><span class="toggle-knob"></span></button>
- </div>
- {/if}
- </div>
{:else if subView === "debug"}
<div class="card">
<div class="setting-row">
diff --git a/src/components/shell/AppToolbar.svelte b/src/components/shell/AppToolbar.svelte
index 993541eb..97a70127 100644
--- a/src/components/shell/AppToolbar.svelte
+++ b/src/components/shell/AppToolbar.svelte
@@ -15,7 +15,6 @@
if (path.startsWith("/marketplace")) return $t("nav.marketplace");
if (path.startsWith("/settings")) return $t("nav.settings");
if (path.startsWith("/about")) return $t("nav.about");
- if (path.startsWith("/league")) return $t("league.nav");
if (path.startsWith("/courses")) return $t("courses.title");
if (path.startsWith("/convert")) return $t("convert.title");
if (path.startsWith("/telegram")) return $t("telegram.title");
diff --git a/src/components/shell/NavIcon.svelte b/src/components/shell/NavIcon.svelte
index 92d9072c..f481218f 100644
--- a/src/components/shell/NavIcon.svelte
+++ b/src/components/shell/NavIcon.svelte
@@ -31,7 +31,6 @@
marketplace: { glyph: "storefront", from: "#6E8CFF", to: "#3D5BF0" },
settings: { glyph: "gear-six", from: "#A3A3A8", to: "#6F6F75" },
about: { glyph: "info", from: "#5AA9FF", to: "#1E6FE8" },
- league: { glyph: "sword", from: "#E8B84A", to: "#B8860B" },
courses: { glyph: "graduation-cap", from: "#C77DFF", to: "#8E3FD8" },
telegram: { glyph: "paper-plane-tilt", from: "#55C2FF", to: "#1F8FE0" },
convert: { glyph: "arrows-clockwise", from: "#FF7A7A", to: "#E33A3A" },
diff --git a/src/lib/error-translate.ts b/src/lib/error-translate.ts
index 4beee3dc..aabf680d 100644
--- a/src/lib/error-translate.ts
+++ b/src/lib/error-translate.ts
@@ -4,7 +4,6 @@
*/
const BACKEND_ERROR_MAP: Record<string, string> = {
- "rune pages are full": "league.runes_full",
"Video requires login. Use browser cookies or try another URL.":
"errors.login_required",
"This video requires login. Import cookies for this site in Settings → Cookies, then retry.":
diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.json
index 77e84c5f..196d0ad8 100644
--- a/src/lib/i18n/el.json
+++ b/src/lib/i18n/el.json
@@ -54,422 +54,6 @@
"nav_home": "Μετάβαση στην Αρχική",
"nav_downloads": "Μετάβαση στις Λήψεις"
},
- "league": {
- "cd_title": "Cooldown αντιπάλων",
- "cd_desc": "Βασικά cooldown από τα δεδομένα ηρώων του ίδιου του παιχνιδιού, διαιρεμένα με το ability haste των αντικειμένων τους. Τα ranks εκτιμώνται από το level, οπότε είναι προσεγγιστικά.",
- "cd_estimated": "εκτίμηση",
- "cd_haste": "haste",
- "col_gold_hint": "Ο χρυσός που φαίνεται είναι όσα κουβαλά ο κάθε παίκτης σε αντικείμενα, με τιμές από τα δεδομένα του παιχνιδιού — ο μόνος οικονομικός δείκτης ορατός για άλλους παίκτες.",
- "scout_no_history": "Χωρίς πρόσφατους αγώνες",
- "build_title": "Build αντικειμένων",
- "build_desc": "Υπολογίζεται από τους αγώνες αυτού του ήρωα μέσα στο δικό σου πρόσφατο ιστορικό — χωρίς site build τρίτων, οπότε το δείγμα είναι μικρό και δηλώνεται.",
- "build_champion": "Διάλεξε ήρωα",
- "build_samples": "αγώνες",
- "meta_reference": "Αναφορά build",
- "meta_source": "Συγκεντρωτικά δημόσια δεδομένα op.gg για το τρέχον patch. Εμφανίζεται ως αναφορά· τίποτα δεν εφαρμόζεται αυτόματα.",
- "skill_priority": "Προτεραιότητα δεξιοτήτων",
- "items_starter": "Αρχικά αντικείμενα",
- "items_core": "Βασικά αντικείμενα",
- "items_boots": "Μπότες",
- "items_last": "Αντικείμενα τέλους",
- "counters": "Δυσκολεύεται εναντίον",
- "runes_full": "Οι σελίδες rune είναι γεμάτες. Σβήσε μία στον client για να δημιουργήσει τη δική του το OmniGet.",
- "build_empty": "Δεν υπάρχουν ακόμα αγώνες με αυτόν τον ήρωα στο δείγμα.",
- "tab_meta": "Μέτα",
- "runes_title": "Runes",
- "runes_desc": "Σελίδες runes και summoner spells που προτείνει ο ίδιος ο client του παιχνιδιού για τον ήρωα που κλείδωσες, πάντα στο τρέχον patch.",
- "runes_auto": "Αυτόματη εφαρμογή runes",
- "runes_auto_desc": "Όταν κλειδώνεις ήρωα, η πρώτη προτεινόμενη σελίδα δημιουργείται και επιλέγεται.",
- "runes_apply": "Εφαρμογή",
- "runes_default": "προεπιλογή",
- "runes_spells": "Spells",
- "runes_empty": "Κλείδωσε έναν ήρωα στην επιλογή για να δεις προτεινόμενες σελίδες.",
- "tiers_title": "Tiers ηρώων",
- "tiers_desc": "Κατάταξη ανά ρόλο με ποσοστά νίκης, επιλογής και ban. Δεδομένα από op.gg.",
- "tiers_position": "Θέση",
- "tiers_pick": "επιλογή",
- "tiers_ban": "ban",
- "tiers_empty": "Η λίστα tier δεν είναι διαθέσιμη τώρα.",
- "impact_label": "Επίδραση",
- "score_label": "Βαθμός",
- "score_hint": "Μέσος όρος πρόσφατων ranked και normal παιχνιδιών. Κρύβεται κάτω από πέντε έγκυρα παιχνίδια.",
- "copy_riot_id": "Αντιγραφή Riot ID",
- "impact_hint": "Σύνθεση KDA, συμμετοχής σε kills, ζημιάς, ζημιάς που δέχτηκε, χρυσού, vision και CS, σε κλίμακα 0-10",
- "tab_search": "Αναζήτηση",
- "search_title": "Εύρεση παίκτη",
- "search_placeholder": "Riot ID, π.χ. Faker#KR1",
- "search_button": "Αναζήτηση",
- "searching_player": "Αναζήτηση…",
- "search_hint": "Γράψε ένα Riot ID με το tag για να δεις βαθμίδα, πρόσφατη φόρμα και απόδοση ανά ήρωα.",
- "search_recent": "Πρόσφατη φόρμα",
- "search_champions": "Ήρωες",
- "search_champions_hint": "2+ αγώνες, πρώτα οι πιο παιγμένοι",
- "search_mastery": "Mastery",
- "stat_winrate": "Νίκες",
- "games_short": "αγώνες",
- "duos_title": "Καλύτερα δίδυμα",
- "duos_desc": "Συμπαίκτες με τους οποίους κερδίζεις περισσότερο, από πρόσφατους αγώνες. Η βαθμολογία συρρικνώνει μικρά δείγματα ώστε ένα τυχερό δίδυμο να μην κορυφώνει τη λίστα.",
- "duos_empty": "Δεν υπάρχουν επαναλαμβανόμενοι συμπαίκτες ακόμα.",
- "duos_score": "βαθμολογία",
- "jungle_title": "Πρώιμη διαδρομή jungle",
- "jungle_empty": "Δεν υπάρχουν δεδομένα timeline για αυτούς τους αγώνες.",
- "jungle_invade": "invade",
- "jungle_gank3": "gank επιπέδου 3",
- "zone_top": "Top",
- "zone_mid": "Mid",
- "zone_bot": "Bot",
- "pref_top": "εστίαση στο top",
- "pref_mid": "εστίαση στο mid",
- "pref_bot": "εστίαση στο bot",
- "pref_top_mid": "εστίαση σε top και mid",
- "pref_mid_bot": "εστίαση σε mid και bot",
- "pref_balanced": "ισορροπημένη διαδρομή",
- "pref_unknown": "ανεπαρκή δεδομένα",
- "chat_placeholder": "Μήνυμα για αποστολή στην επιλογή",
- "chat_build": "Δημιουργία σύνοψης",
- "chat_send": "Αποστολή",
- "tab_overview": "Επισκόπηση",
- "tab_analysis": "Ανάλυση",
- "tab_live": "Ζωντανά",
- "tab_goals": "Στόχοι",
- "tab_automation": "Αυτοματισμός",
- "tab_history": "Ιστορικό",
- "win_title": "Πιθανότητα νίκης",
- "win_allies": "Η ομάδα σου",
- "win_interval": "εύρος 90%",
- "win_gap": "Διαφορά rating",
- "win_known": "παίκτες με δεδομένα",
- "win_disclaimer": "Το matchmaking φτιάχνει αγώνες με προσδοκία 50%, οπότε οι τίμιες εκτιμήσεις μένουν κοντά στο ισόπαλο. Δες το ως τάση, όχι ετυμηγορία.",
- "win_unavailable": "Διαθέσιμο στην επιλογή ηρώων και εντός αγώνα.",
- "premades": "Ομάδες (premade)",
- "premade_source_party": "Από τα δεδομένα του παιχνιδιού",
- "premade_source_history": "Εκτίμηση από κοινό ιστορικό",
- "players": "παίκτες",
- "objectives_title": "Στόχοι και συμβάντα",
- "objectives_estimate": "Οι χρόνοι επανεμφάνισης είναι εκτιμήσεις για το τρέχον patch, όχι τιμές από το παιχνίδι.",
- "objective_baron": "Βαρόνος",
- "objective_dragon": "Δράκος",
- "objective_inhibitor": "Αναστολέας",
- "event_kill": "Εξόντωση:",
- "event_turret": "Πύργος έπεσε:",
- "event_inhib": "Αναστολέας έπεσε:",
- "event_dragon": "Δράκος από",
- "event_baron": "Βαρόνος από",
- "event_herald": "Herald από",
- "event_multikill": "Πολλαπλή εξόντωση:",
- "event_ace": "Ace από",
- "event_first_turret": "Πρώτος πύργος:",
- "event_first_blood": "Πρώτο αίμα:",
- "gold_title": "Ζωντανή οικονομία",
- "gold_unavailable": "Μπες σε αγώνα για να δεις χρυσό και διαφορές lane.",
- "your_team": "Η ομάδα σου",
- "enemy_team": "Αντίπαλη ομάδα",
- "col_player": "Παίκτης",
- "col_gold": "Χρυσός",
- "col_diff": "vs αντίπαλο lane",
- "goals_live": "Οι στόχοι σου σε αυτόν τον αγώνα",
- "goals_title": "Στόχοι απόδοσης",
- "goals_role": "Ρόλος",
- "goals_desc": "Στόχοι ανά ρόλο για την αξιολόγηση του τρέχοντος αγώνα. Προσάρμοσέ τους στο επίπεδό σου.",
- "goals_reset": "Επαναφορά",
- "goal_cs": "CS ανά λεπτό",
- "goal_gold": "Χρυσός ανά λεπτό",
- "goal_kda": "KDA",
- "goal_vision": "Vision ανά λεπτό",
- "role_top": "Top",
- "role_jungle": "Jungle",
- "role_middle": "Mid",
- "role_bottom": "Bot",
- "role_utility": "Support",
- "role_fill": "Fill",
- "role_preference": "Προτίμηση ρόλου",
- "role_first": "Κύριος ρόλος",
- "role_second": "Δεύτερος ρόλος",
- "scout_title": "Ανάλυση αγώνα",
- "scout_allies": "Σύμμαχοι",
- "scout_enemies": "Αντίπαλοι",
- "scout_enemies_hidden": "Οι αντίπαλοι αποκαλύπτονται όταν ξεκινήσει ο αγώνας.",
- "scout_note_placeholder": "Προσωπική σημείωση για αυτόν τον παίκτη…",
- "marked_in_allies": "Έχεις σημειώσεις στην ομάδα σου:",
- "marked_in_enemies": "Έχεις σημειώσεις στην αντίπαλη ομάδα:",
- "squad_enemy": "Οι πέντε αντίπαλοι μπήκαν μαζί στην ουρά και όλα τα προφίλ είναι κρυφά.",
- "squad_ally": "Μπήκατε και οι πέντε μαζί στην ουρά και όλα τα προφίλ είναι κρυφά.",
- "scout_private": "Ιδιωτικό προφίλ",
- "tag_hot_streak": "σερί νικών",
- "tag_cold_streak": "σερί ηττών",
- "tag_high_winrate": "υψηλό winrate",
- "tag_low_winrate": "χαμηλό winrate",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "υψηλό KDA",
- "tag_low_kda": "χαμηλό KDA",
- "lobby_title": "Παίξε",
- "lobby_hint": "Οι ενέργειες του λόμπι εμφανίζονται εδώ όταν ο πελάτης είναι έτοιμος.",
- "searching": "Αναζήτηση αγώνα…",
- "start_queue": "Εύρεση αγώνα",
- "stop_queue": "Ακύρωση αναζήτησης",
- "leave_lobby": "Έξοδος από το λόμπι",
- "play_again": "Παίξε ξανά",
- "champ_select_title": "Επιλογή ηρώων",
- "bench_title": "Πάγκος",
- "reroll": "Reroll",
- "reroll_keep": "Reroll διατηρώντας τον ήρωα",
- "reroll_keep_hint": "Ξοδεύει το reroll για να διευρύνει τον πάγκο και επαναφέρει τον ήρωά σου.",
- "swap": "Αλλαγή σε",
- "remove": "Αφαίρεση",
- "live_title": "Ζωντανός αγώνας",
- "respawn_in": "επανεμφάνιση σε",
- "automation_title": "Αυτοματισμός",
- "notify_ready": "Ειδοποίηση όταν βρεθεί παιχνίδι",
- "notify_ready_desc": "Στέλνει ειδοποίηση συστήματος μόνο όταν το παράθυρο του OmniGet δεν είναι σε εστίαση.",
- "auto_pick": "Αυτόματο pick",
- "auto_pick_desc": "Επιλέγει τον πρώτο διαθέσιμο ήρωα από τη λίστα σας όταν είναι η σειρά σας.",
- "auto_ban": "Αυτόματο ban",
- "auto_ban_desc": "Κάνει ban τον πρώτο διαθέσιμο ήρωα από τη λίστα ban σας.",
- "pick_confirm": "Πώς ολοκληρώνεται το pick",
- "pick_confirm_desc": "Η δήλωση δείχνει τον ήρωα στην ομάδα χωρίς να σου αφαιρεί την απόφαση.",
- "pick_confirm_declare": "Μόνο δήλωση",
- "pick_confirm_timeout": "Κλείδωμα στο τέλος",
- "pick_confirm_immediate": "Άμεσο κλείδωμα",
- "auto_lock": "Αυτόματο κλείδωμα",
- "auto_lock_desc": "Ανενεργό = δείχνει μόνο την πρόθεση· επιβεβαιώνετε εσείς το pick.",
- "auto_honor": "Αυτόματη τιμή",
- "auto_honor_desc": "Τιμά έναν σύμμαχο μετά το παιχνίδι, προτιμώντας όσους μπήκαν στην ουρά μαζί σου.",
- "auto_play_again": "Αυτόματο ξαναπαίξιμο",
- "auto_play_again_desc": "Επιστρέφει στο λόμπι μόλις εμφανιστεί η οθόνη τέλους παιχνιδιού.",
- "auto_requeue": "Νέα αναζήτηση αμέσως μετά",
- "auto_requeue_desc": "Ξεκινά την αναζήτηση όταν επιστρέψει το lobby, μόνο όταν είσαι ο leader.",
- "auto_swaps": "Αποδοχή αλλαγής θέσης και σειράς",
- "auto_swaps_desc": "Αποδέχεται συμμάχους που ζητούν αλλαγή ρόλου ή σειράς επιλογής.",
- "auto_reconnect": "Αυτόματη επανασύνδεση",
- "auto_reconnect_desc": "Επανασυνδέεται αυτόματα στο παιχνίδι αν αποσυνδεθεί ο client.",
- "spectate": "Παρακολούθηση παιχνιδιού",
- "spectate_loading": "Εκκίνηση θεατή…",
- "spectate_not_in_game": "Αυτός ο παίκτης δεν βρίσκεται σε παιχνίδι αυτήν τη στιγμή.",
- "dodge": "Dodge",
- "dodge_warning": "Αν φύγεις τώρα μετράει ως dodge: χάνεις LP και παίρνεις καθυστέρηση ουράς.",
- "dodge_confirm": "Φύγε ούτως ή άλλως",
- "unavailable_platform": "Μη διαθέσιμο σε αυτό το σύστημα.",
- "unavailable_client": "Άνοιξε τον client του League of Legends για να το χρησιμοποιήσεις.",
- "unavailable_game": "Διαθέσιμο κατά τη διάρκεια παιχνιδιού.",
- "badge_beta": "beta",
- "badge_experimental": "πειραματικό",
- "profile_tools": "Προσαρμογή προφίλ",
- "profile_icon": "Εικονίδιο summoner",
- "profile_icon_saved": "Το εικονίδιο ενημερώθηκε.",
- "profile_status": "Διαθεσιμότητα",
- "profile_status_saved": "Η διαθεσιμότητα ενημερώθηκε.",
- "status_chat": "Συνδεδεμένος",
- "status_away": "Απών",
- "status_dnd": "Απασχολημένος",
- "profile_message": "Μήνυμα κατάστασης",
- "profile_message_saved": "Το μήνυμα ενημερώθηκε.",
- "profile_background": "Φόντο προφίλ",
- "profile_background_saved": "Το φόντο ενημερώθηκε.",
- "profile_no_skins": "Δεν υπάρχουν skins αυτού του ήρωα στον λογαριασμό.",
- "apply": "Εφαρμογή",
- "restart_ux": "Επανεκκίνηση διεπαφής πελάτη",
- "restart_ux_warning": "Φορτώνει ξανά τη διεπαφή του client. Η θέση στην ουρά και η επιλογή ηρώων διατηρούνται.",
- "restart_ux_confirm": "Επανεκκίνηση διεπαφής",
- "dodge_cancel": "Μείνε",
- "auto_trade": "Ανταλλαγές ηρώων",
- "auto_trade_desc": "Πώς να απαντώνται τα αιτήματα ανταλλαγής κατά την επιλογή ηρώων.",
- "auto_trade_off": "Ρώτησέ με",
- "auto_trade_accept": "Αποδοχή όλων",
- "auto_trade_decline": "Απόρριψη όλων",
- "auto_message": "Χαιρετισμός στην επιλογή",
- "auto_message_desc": "Στέλνεται μία φορά στη συνομιλία της ομάδας όταν αρχίζει η επιλογή. Κενό = ανενεργό.",
- "auto_message_placeholder": "π.χ. glhf :)",
- "tag_flash_swap": "Η θέση του Flash αλλάζει",
- "tag_high_damage_efficiency": "Υψηλή ζημιά ανά χρυσό",
- "tag_low_damage_efficiency": "Χαμηλή ζημιά ανά χρυσό",
- "solo_kills_label": "Μοναχικά kills/παιχνίδι",
- "early_deaths_label": "Θάνατοι πριν τα 15 λεπτά/παιχνίδι",
- "seen_before": "ξαναϊδωμένος",
- "seen_before_hint": "Έχεις ξαναπαίξει με ή εναντίον αυτού του παίκτη.",
- "spell_timer_hint": "Κάνε κλικ όταν χρησιμοποιηθεί το ξόρκι για να ξεκινήσει ο χρονομετρητής.",
- "obj_towers": "Πύργοι",
- "obj_inhibitors": "Αναστολείς",
- "obj_heralds": "Heralds",
- "obj_bans": "Bans",
- "open_player": "Δες τα πρόσφατα παιχνίδια του παίκτη",
- "close": "Κλείσιμο",
- "stat_level": "Επ",
- "stat_damage": "Ζημιά",
- "stat_taken": "Δέχτηκε",
- "stat_mitigated": "Μειώθηκε",
- "stat_healing": "Θεραπεία",
- "stat_objectives": "Στόχοι",
- "stat_gold_min": "Χρυσός/λεπτό",
- "stat_cs_min": "CS/λεπτό",
- "stat_vision": "Όραση",
- "stat_wards": "Wards τ/κ/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Καλύτερο σερί",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "Πρώτο αίμα",
- "stat_first_tower": "Πρώτος πύργος",
- "match_damage": "ζημιά",
- "match_detail_unavailable": "Οι λεπτομέρειες του αγώνα δεν είναι διαθέσιμες.",
- "pick_list": "Προτεραιότητα pick",
- "ban_delay": "Αναμονή πριν το ban",
- "ban_delay_desc": "Καθυστερεί το ban και παρακάμπτει ήρωες που έχει δηλώσει σύμμαχος.",
- "ban_list": "Προτεραιότητα ban",
- "list_hint": "η σειρά μετράει",
- "search_champion": "Αναζήτηση ήρωα…",
- "phase_lobby": "Στο λόμπι",
- "phase_matchmaking": "Στην ουρά",
- "phase_ready_check": "Βρέθηκε αγώνας!",
- "phase_champ_select": "Επιλογή ηρώων",
- "phase_in_progress": "Σε αγώνα",
- "phase_end_of_game": "Τέλος αγώνα",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Προαιρετικό μενού πελάτη League. Απενεργοποιημένο από προεπιλογή.",
- "settings_enable": "Ενεργοποίηση μενού League",
- "settings_enable_desc": "Προσθέτει μενού League of Legends με εργαλεία πελάτη. Απαιτεί τον πελάτη League σε λειτουργία.",
- "settings_auto_accept": "Αυτόματη αποδοχή αγώνων",
- "settings_auto_accept_desc": "Αποδέχεται αυτόματα τον έλεγχο ετοιμότητας όταν βρεθεί αγώνας.",
- "disabled_title": "Το μενού League είναι απενεργοποιημένο",
- "disabled_body": "Ενεργοποιήστε το στις Ρυθμίσεις → Για προχωρημένους → League of Legends. Τίποτα δεν εκτελείται μέχρι να το ενεργοποιήσετε.",
- "open_settings": "Άνοιγμα Ρυθμίσεων",
- "connected": "Συνδεδεμένο",
- "disconnected_title": "Ο πελάτης δεν εντοπίστηκε",
- "disconnected_body": "Ανοίξτε τον πελάτη League of Legends και αυτή η σελίδα θα συνδεθεί αυτόματα.",
- "level": "Επίπεδο",
- "phase_label": "Κατάσταση πελάτη",
- "accept_now": "Αποδοχή αγώνα",
- "auto_accept": "Αυτόματη αποδοχή αγώνων",
- "auto_accept_desc": "Αποδέχεται τον αγώνα για εσάς μόλις εμφανιστεί.",
- "accept_delay": "Αναμονή πριν την αποδοχή",
- "accept_delay_instant": "αμέσως",
- "accept_delay_desc": "Σου αφήνει χρόνο να αρνηθείς. Η άρνηση κατά την αναμονή ακυρώνει την αυτόματη αποδοχή.",
- "ranked_solo": "Κατάταξη Solo/Duo",
- "ranked_flex": "Κατάταξη Flex",
- "unranked": "Χωρίς κατάταξη",
- "history_title": "Πρόσφατοι αγώνες",
- "filter_queue": "Φίλτρο ανά ουρά",
- "filter_all": "Όλες",
- "summary_games": "παιχνίδια",
- "summary_win_short": "Ν",
- "summary_loss_short": "Η",
- "summary_remakes": "τα remakes δεν μετρούν",
- "history_empty": "Δεν βρέθηκαν αγώνες ακόμα.",
- "refresh": "Ανανέωση",
- "victory": "Νίκη",
- "defeat": "Ήττα",
- "tab_profile": "Προφίλ",
- "tab_coach": "Προπονητής",
- "profile_title": "Επεξεργασία προφίλ",
- "profile_desc": "Ό,τι επιτρέπει ο client να αλλάξεις στο πώς σε βλέπουν οι άλλοι. Τίποτα εδώ δεν αγγίζει το παιχνίδι.",
- "profile_section_presence": "Παρουσία",
- "status_offline": "Εκτός σύνδεσης",
- "status_mobile": "Κινητό",
- "profile_message_hint": "Έως 255 χαρακτήρες. Το πεδίο του client σταματά στους 140.",
- "profile_section_icon": "Εικονίδια",
- "profile_icon_search": "Αναζήτηση εικονιδίου με όνομα ή id",
- "profile_icon_chat": "Εικονίδιο chat",
- "profile_icon_chat_saved": "Το εικονίδιο chat ενημερώθηκε",
- "profile_icon_hint": "Το εικονίδιο προφίλ πρέπει να σου ανήκει. Το εικονίδιο chat (hovercard και λίστα φίλων) δέχεται οποιοδήποτε.",
- "profile_section_rank": "Κατάταξη στο chat",
- "rank_queue": "Ουρά",
- "rank_tier": "Βαθμίδα",
- "rank_division": "Διαίρεση",
- "rank_reset": "Επαναφορά πραγματικής κατάταξης",
- "rank_saved": "Η κατάταξη στο chat ενημερώθηκε",
- "rank_hint": "Αλλάζουν μόνο το hovercard και οι κοινωνικές κάρτες. Η κατάταξή σου μένει άθικτη.",
- "crystal_title": "Κρύσταλλος προκλήσεων",
- "crystal_level": "Επίπεδο",
- "crystal_points": "Πόντοι",
- "crystal_saved": "Ο κρύσταλλος ενημερώθηκε",
- "tokens_title": "Μετάλλια, τίτλος και λάβαρο",
- "tokens_desc": "Διάλεξε έως τρία μετάλλια προκλήσεων για το προφίλ. Το ίδιο μετάλλιο μπορεί να γεμίσει κάθε θέση.",
- "tokens_slot": "Θέση",
- "tokens_empty": "Δεν υπάρχουν μετάλλια ακόμα",
- "tokens_none": "Κανένα",
- "tokens_clear": "Καθαρισμός",
- "tokens_saved": "Οι προτιμήσεις προφίλ ενημερώθηκαν",
- "tokens_search": "Φιλτράρισμα μεταλλίων",
- "title_label": "Τίτλος",
- "title_none": "Χωρίς τίτλο",
- "banner_label": "Λάβαρο",
- "banner_none": "Χωρίς λάβαρο",
- "friends_title": "Φίλοι",
- "friends_desc": "Φόρτωσε τη λίστα, τσέκαρε ποιους θα αφαιρέσεις, επιβεβαίωσε. Η αφαίρεση είναι οριστική.",
- "friends_load": "Φόρτωση",
- "friends_select_all": "Επιλογή ορατών",
- "friends_clear_selection": "Καθαρισμός επιλογής",
- "friends_remove": "Αφαίρεση επιλεγμένων",
- "friends_remove_confirm": "Φεύγουν οριστικά από τη λίστα φίλων σου.",
- "friends_remove_go": "Αφαίρεση",
- "friends_removed": "Αφαιρέθηκαν",
- "friends_count": "Φίλοι",
- "wallet_rp": "RP",
- "wallet_be": "Μπλε Ουσία",
- "raffle_title": "Κλήρωση",
- "raffle_lane": "Κλήρωση λωρίδας",
- "raffle_lane_apply": "Ορισμός ως προτίμηση",
- "raffle_champion": "Κλήρωση ήρωα",
- "raffle_class_any": "Οποιαδήποτε κλάση",
- "raffle_class_fighter": "Μαχητής",
- "raffle_class_mage": "Μάγος",
- "raffle_class_assassin": "Δολοφόνος",
- "raffle_class_marksman": "Σκοπευτής",
- "raffle_class_support": "Υποστήριξη",
- "raffle_class_tank": "Tank",
- "raffle_declare": "Δήλωση",
- "raffle_lock": "Κλείδωμα",
- "raffle_again": "Ξανά",
- "raffle_pool": "ήρωες στην κληρωτίδα",
- "skin_title": "Ρουλέτα skin",
- "skin_roll": "Κλήρωση skin",
- "skin_roll_ward": "Κλήρωση ward",
- "skin_rolled": "Βγήκε",
- "skin_lock_first": "Κλείδωσε πρώτα έναν ήρωα",
- "pick_random": "Τυχαίος ήρωας",
- "pick_random_desc": "Αγνοεί τη λίστα και κλειδώνει έναν τυχαίο επιτρεπόμενο ήρωα, και στο ranked. Ήρωες που δηλώνουν σύμμαχοι αποφεύγονται.",
- "skin_roulette": "Ρουλέτα skin",
- "skin_roulette_desc": "Μόλις κλειδώσεις ήρωα, εφαρμόζεται τυχαίο skin και chroma που κατέχεις. Οι πρόσφατες κληρώσεις παραλείπονται.",
- "skin_include_base": "Να περιλαμβάνεται το βασικό skin",
- "ward_roulette": "Ρουλέτα ward",
- "ward_roulette_desc": "Επιλέγει επίσης τυχαίο ward skin στο κλείδωμα.",
- "sgp_enabled": "Δεδομένα backend (SGP)",
- "sgp_enabled_desc": "Όταν το τοπικό ιστορικό είναι λίγο ή κρυφό, ρωτά απευθείας το backend της Riot με τα tokens του client. Ενεργοποιεί και τη λήψη replay.",
- "coach_title": "Προπονητής AI",
- "coach_desc": "Το ρυθμισμένο μοντέλο AI διαβάζει τα δεδομένα των αγώνων σου και τα meta δεδομένα του OP.GG και απαντά ως προπονητής.",
- "coach_not_configured": "Ρύθμισε πρώτα έναν πάροχο AI.",
- "coach_open_settings": "Άνοιγμα ρυθμίσεων",
- "coach_style": "Ύφος",
- "coach_style_objective": "Αντικειμενικό",
- "coach_style_roast": "Καυστικό",
- "coach_style_praise": "Ενθαρρυντικό",
- "coach_review_title": "Ανασκόπηση αγώνα",
- "coach_review_pick": "Διάλεξε πρόσφατο αγώνα",
- "coach_review_run": "Ανασκόπηση",
- "coach_trends_title": "Τάσεις",
- "coach_trends_games": "αγώνες",
- "coach_trends_run": "Ανάλυση",
- "coach_ask_title": "Ρώτα τον προπονητή",
- "coach_ask_placeholder": "Ρώτα για το draft, τον αγώνα ή την πρόσφατη φόρμα σου",
- "coach_ask_run": "Ρώτα",
- "coach_quick_draft": "Ανάλυσε αυτό το draft και δώσε μου πλάνο",
- "coach_quick_early": "Πώς πρέπει να είναι τα πρώτα 10 λεπτά μου;",
- "coach_quick_now": "Τι να κάνω τώρα;",
- "coach_quick_improve": "Τι να διορθώσω πρώτα;",
- "coach_working": "Σκέφτομαι…",
- "coach_result": "Προπονητής",
- "coach_copy": "Αντιγραφή",
- "coach_copied": "Αντιγράφηκε",
- "coach_error_no_games": "Δεν υπάρχουν πρόσφατοι αγώνες για ανάλυση",
- "coach_privacy": "Τα δεδομένα αγώνα και, όπου χρειάζεται, τα meta δεδομένα του OP.GG στέλνονται στον ρυθμισμένο πάροχο AI.",
- "replay_download": "Λήψη replay",
- "replay_downloading": "Λήψη…",
- "replay_saved": "Το replay αποθηκεύτηκε σε",
- "review_ai": "Ανασκόπηση με AI",
- "history_source_sgp": "μέσω backend",
- "search_source_sgp": "Το ιστορικό ήρθε από το backend της Riot (SGP), αφού ο client το έκρυψε."
- },
"nav": {
"home": "Αρχική",
"downloads": "Λήψεις",
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index 467732d3..e9534f49 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -54,422 +54,6 @@
"nav_home": "Go to Home",
"nav_downloads": "Go to Downloads"
},
- "league": {
- "cd_title": "Enemy cooldowns",
- "cd_desc": "Base cooldowns from the game's own champion data, divided by the ability haste their items give them. Ability ranks are estimated from level, so treat these as close, not exact.",
- "cd_estimated": "estimated",
- "cd_haste": "haste",
- "col_gold_hint": "Gold shown is what each player is carrying in items, priced from the game's own item data — the only economy number visible for other players.",
- "scout_no_history": "No recent games",
- "build_title": "Item build",
- "build_desc": "Built from the champion's games inside your own recent matches — no third-party build site involved, so the sample is small and honest about it.",
- "build_champion": "Pick a champion",
- "build_samples": "games seen",
- "meta_reference": "Build reference",
- "meta_source": "Aggregated from public op.gg data for the current patch. Shown for reference; nothing is applied automatically.",
- "skill_priority": "Skill priority",
- "items_starter": "Starting items",
- "items_core": "Core items",
- "items_boots": "Boots",
- "items_last": "Late items",
- "counters": "Struggles against",
- "runes_full": "Your rune pages are full. Delete one in the client to let OmniGet create its page.",
- "build_empty": "No games with this champion in the sample yet.",
- "tab_meta": "Meta",
- "runes_title": "Runes",
- "runes_desc": "Rune pages and summoner spells recommended by the game client itself for the champion you locked, so they always match the current patch.",
- "runes_auto": "Apply runes automatically",
- "runes_auto_desc": "When you lock a champion, the first recommended page is created and selected for you.",
- "runes_apply": "Apply",
- "runes_default": "default",
- "runes_spells": "Spells",
- "runes_empty": "Lock a champion in champion select to see recommended pages.",
- "tiers_title": "Champion tiers",
- "tiers_desc": "Ranking by role, with win, pick and ban rates. Data from op.gg.",
- "tiers_position": "Position",
- "tiers_pick": "pick",
- "tiers_ban": "ban",
- "tiers_empty": "Tier list unavailable right now.",
- "impact_label": "Impact",
- "score_label": "Score",
- "score_hint": "Average of recent ranked and normal games. Hidden below five usable games.",
- "copy_riot_id": "Copy Riot ID",
- "impact_hint": "Composite of KDA, kill participation, damage, damage taken, gold, vision and CS share, scored 0-10",
- "tab_search": "Search",
- "search_title": "Find a player",
- "search_placeholder": "Riot ID, e.g. Faker#KR1",
- "search_button": "Search",
- "searching_player": "Searching…",
- "search_hint": "Type a Riot ID with its tag to see rank, recent form and champion record.",
- "search_recent": "Recent form",
- "search_champions": "Champions",
- "search_champions_hint": "2+ games, most played first",
- "search_mastery": "Mastery",
- "stat_winrate": "Win rate",
- "games_short": "games",
- "duos_title": "Best duos",
- "duos_desc": "Teammates you win the most with, from your recent games. The score shrinks small samples so a lucky pair of games does not top the list.",
- "duos_empty": "No repeated teammates in the sample yet.",
- "duos_score": "score",
- "jungle_title": "Early jungle path",
- "jungle_empty": "No timeline data for these games.",
- "jungle_invade": "invade",
- "jungle_gank3": "lv3 gank",
- "zone_top": "Top",
- "zone_mid": "Mid",
- "zone_bot": "Bot",
- "pref_top": "top focused",
- "pref_mid": "mid focused",
- "pref_bot": "bot focused",
- "pref_top_mid": "top and mid focused",
- "pref_mid_bot": "mid and bot focused",
- "pref_balanced": "balanced path",
- "pref_unknown": "not enough data",
- "chat_placeholder": "Message to send in champion select",
- "chat_build": "Build summary",
- "chat_send": "Send",
- "tab_overview": "Overview",
- "tab_analysis": "Analysis",
- "tab_live": "Live",
- "tab_goals": "Goals",
- "tab_automation": "Automation",
- "tab_history": "History",
- "win_title": "Win probability",
- "win_allies": "Your team",
- "win_interval": "90% range",
- "win_gap": "Rating gap",
- "win_known": "players with data",
- "win_disclaimer": "Matchmaking builds games around a 50% expectation, so honest estimates stay close to even. Treat this as a lean, not a verdict.",
- "win_unavailable": "Available during champion select and in game.",
- "premades": "Premade groups",
- "premade_source_party": "Reported by the game",
- "premade_source_history": "Estimated from shared history",
- "players": "players",
- "objectives_title": "Objectives and events",
- "objectives_estimate": "Respawn windows are estimates based on the current patch, not values reported by the game.",
- "objective_baron": "Baron",
- "objective_dragon": "Dragon",
- "objective_inhibitor": "Inhibitor",
- "event_kill": "Kill:",
- "event_turret": "Turret down:",
- "event_inhib": "Inhibitor down:",
- "event_dragon": "Dragon taken by",
- "event_baron": "Baron taken by",
- "event_herald": "Herald taken by",
- "event_multikill": "Multikill:",
- "event_ace": "Ace by",
- "event_first_turret": "First turret:",
- "event_first_blood": "First blood:",
- "gold_title": "Live economy",
- "gold_unavailable": "Open a game to see live gold and lane differences.",
- "your_team": "Your team",
- "enemy_team": "Enemy team",
- "col_player": "Player",
- "col_gold": "Gold",
- "col_diff": "vs lane opponent",
- "goals_live": "Your goals this game",
- "goals_title": "Performance goals",
- "goals_role": "Role",
- "goals_desc": "Targets per role, used to grade your live game. Adjust them to your own level.",
- "goals_reset": "Reset to defaults",
- "goal_cs": "CS per minute",
- "goal_gold": "Gold per minute",
- "goal_kda": "KDA",
- "goal_vision": "Vision per minute",
- "role_top": "Top",
- "role_jungle": "Jungle",
- "role_middle": "Mid",
- "role_bottom": "Bot",
- "role_utility": "Support",
- "role_fill": "Fill",
- "role_preference": "Role preference",
- "role_first": "Primary role",
- "role_second": "Secondary role",
- "scout_title": "Match scouting",
- "scout_allies": "Allies",
- "scout_enemies": "Enemies",
- "scout_enemies_hidden": "Enemies are revealed once the game starts.",
- "scout_note_placeholder": "Personal note about this player…",
- "marked_in_allies": "You have notes on your side:",
- "marked_in_enemies": "You have notes on the enemy side:",
- "squad_enemy": "All five enemies queued together and every profile is hidden.",
- "squad_ally": "All five of you queued together and every profile is hidden.",
- "scout_private": "Private profile",
- "tag_hot_streak": "win streak",
- "tag_cold_streak": "loss streak",
- "tag_high_winrate": "high winrate",
- "tag_low_winrate": "low winrate",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "high KDA",
- "tag_low_kda": "low KDA",
- "lobby_title": "Play",
- "lobby_hint": "Lobby actions appear here once the client is ready.",
- "searching": "Searching for a match…",
- "start_queue": "Find match",
- "stop_queue": "Cancel search",
- "leave_lobby": "Leave lobby",
- "play_again": "Play again",
- "champ_select_title": "Champion select",
- "bench_title": "Bench",
- "reroll": "Reroll",
- "reroll_keep": "Reroll, keep champion",
- "reroll_keep_hint": "Spends the reroll to widen the bench and swaps your current champion back in.",
- "swap": "Swap to",
- "remove": "Remove",
- "live_title": "Live game",
- "respawn_in": "respawns in",
- "automation_title": "Automation",
- "notify_ready": "Notify when a match is found",
- "notify_ready_desc": "Sends a desktop notification only while the OmniGet window is not in focus.",
- "auto_pick": "Auto pick",
- "auto_pick_desc": "Picks the first available champion from your list when it's your turn.",
- "auto_ban": "Auto ban",
- "auto_ban_desc": "Bans the first available champion from your ban list.",
- "pick_confirm": "How to finish the pick",
- "pick_confirm_desc": "Declaring shows your champion to the team without taking the decision away from you.",
- "pick_confirm_declare": "Declare only",
- "pick_confirm_timeout": "Lock at the end",
- "pick_confirm_immediate": "Lock right away",
- "auto_lock": "Lock in automatically",
- "auto_lock_desc": "Off = only shows your intent; you still confirm the pick yourself.",
- "auto_honor": "Auto honor",
- "auto_honor_desc": "Honors a teammate after the game, preferring whoever you queued with.",
- "auto_play_again": "Auto play again",
- "auto_play_again_desc": "Returns to the lobby as soon as the end-of-game screen appears.",
- "auto_requeue": "Search again right after",
- "auto_requeue_desc": "Starts the search once the lobby is back, only when you are the lobby leader.",
- "auto_swaps": "Accept position and pick order swaps",
- "auto_swaps_desc": "Accepts teammates asking to trade roles or pick order during champion select.",
- "auto_reconnect": "Auto reconnect",
- "auto_reconnect_desc": "Rejoins the game automatically if the client disconnects.",
- "spectate": "Watch game",
- "spectate_loading": "Launching spectator…",
- "spectate_not_in_game": "This player is not in a game right now.",
- "dodge": "Dodge",
- "dodge_warning": "Leaving now counts as a dodge: you lose LP and get a queue delay.",
- "dodge_confirm": "Dodge anyway",
- "unavailable_platform": "Not available on this system.",
- "unavailable_client": "Open the League of Legends client to use this.",
- "unavailable_game": "Available while a match is running.",
- "badge_beta": "beta",
- "badge_experimental": "experimental",
- "profile_tools": "Customise profile",
- "profile_icon": "Summoner icon",
- "profile_icon_saved": "Icon updated.",
- "profile_status": "Availability",
- "profile_status_saved": "Availability updated.",
- "status_chat": "Online",
- "status_away": "Away",
- "status_dnd": "Busy",
- "profile_message": "Status message",
- "profile_message_saved": "Status message updated.",
- "profile_background": "Profile background",
- "profile_background_saved": "Background updated.",
- "profile_no_skins": "No owned skins for this champion.",
- "apply": "Apply",
- "restart_ux": "Restart client interface",
- "restart_ux_warning": "Reloads the client's interface. Your queue spot and champion select are kept.",
- "restart_ux_confirm": "Restart interface",
- "dodge_cancel": "Stay",
- "auto_trade": "Champion trades",
- "auto_trade_desc": "How to answer trade requests from teammates during champion select.",
- "auto_trade_off": "Ask me",
- "auto_trade_accept": "Accept all",
- "auto_trade_decline": "Decline all",
- "auto_message": "Champ select greeting",
- "auto_message_desc": "Sent once to the team chat when champion select starts. Leave empty to disable.",
- "auto_message_placeholder": "e.g. glhf :)",
- "tag_flash_swap": "Flash key varies",
- "tag_high_damage_efficiency": "High damage per gold",
- "tag_low_damage_efficiency": "Low damage per gold",
- "solo_kills_label": "Solo kills/game",
- "early_deaths_label": "Deaths before 15min/game",
- "seen_before": "seen before",
- "seen_before_hint": "You have played with or against this player before.",
- "spell_timer_hint": "Click when the spell is used to start the timer.",
- "obj_towers": "Towers",
- "obj_inhibitors": "Inhibitors",
- "obj_heralds": "Heralds",
- "obj_bans": "Bans",
- "open_player": "See this player's recent matches",
- "close": "Close",
- "stat_level": "Lvl",
- "stat_damage": "Dealt",
- "stat_taken": "Taken",
- "stat_mitigated": "Mitigated",
- "stat_healing": "Healing",
- "stat_objectives": "Objectives",
- "stat_gold_min": "Gold/min",
- "stat_cs_min": "CS/min",
- "stat_vision": "Vision",
- "stat_wards": "Wards p/k/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Best spree",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "First blood",
- "stat_first_tower": "First tower",
- "match_damage": "dmg",
- "match_detail_unavailable": "Match details unavailable.",
- "pick_list": "Pick priority",
- "ban_delay": "Wait before banning",
- "ban_delay_desc": "Holds the ban for a moment and skips champions a teammate has already declared.",
- "ban_list": "Ban priority",
- "list_hint": "order matters",
- "search_champion": "Search champion…",
- "phase_lobby": "In lobby",
- "phase_matchmaking": "In queue",
- "phase_ready_check": "Match found!",
- "phase_champ_select": "Champion select",
- "phase_in_progress": "In game",
- "phase_end_of_game": "Game over",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Optional League client menu. Off by default.",
- "settings_enable": "Enable League menu",
- "settings_enable_desc": "Adds a League of Legends menu with client tools. Requires the League client running.",
- "settings_auto_accept": "Auto-accept matches",
- "settings_auto_accept_desc": "Automatically accepts the ready check when a match is found.",
- "disabled_title": "The League menu is off",
- "disabled_body": "Enable it in Settings → Advanced → League of Legends. Nothing runs until you turn it on.",
- "open_settings": "Open Settings",
- "connected": "Connected",
- "disconnected_title": "Client not detected",
- "disconnected_body": "Open the League of Legends client and this page will connect automatically.",
- "level": "Level",
- "phase_label": "Client status",
- "accept_now": "Accept match",
- "auto_accept": "Auto-accept matches",
- "auto_accept_desc": "Accepts the ready check for you the moment a match pops.",
- "accept_delay": "Wait before accepting",
- "accept_delay_instant": "immediately",
- "accept_delay_desc": "Leaves you a moment to decline yourself. Declining during the wait cancels the automatic accept.",
- "ranked_solo": "Ranked Solo/Duo",
- "ranked_flex": "Ranked Flex",
- "unranked": "Unranked",
- "history_title": "Recent matches",
- "filter_queue": "Filter by queue",
- "filter_all": "All",
- "summary_games": "games",
- "summary_win_short": "W",
- "summary_loss_short": "L",
- "summary_remakes": "remakes not counted",
- "history_empty": "No matches found yet.",
- "refresh": "Refresh",
- "victory": "Victory",
- "defeat": "Defeat",
- "tab_profile": "Profile",
- "tab_coach": "Coach",
- "profile_title": "Profile editor",
- "profile_desc": "Everything the client lets you change about how you look to others. Nothing here touches the game itself.",
- "profile_section_presence": "Presence",
- "status_offline": "Offline",
- "status_mobile": "Mobile",
- "profile_message_hint": "Up to 255 characters. The client's own box stops at 140.",
- "profile_section_icon": "Icons",
- "profile_icon_search": "Search icons by name or id",
- "profile_icon_chat": "Chat icon",
- "profile_icon_chat_saved": "Chat icon updated",
- "profile_icon_hint": "The profile icon must be owned. The chat icon (hovercard and friends list) accepts any icon.",
- "profile_section_rank": "Rank shown in chat",
- "rank_queue": "Queue",
- "rank_tier": "Tier",
- "rank_division": "Division",
- "rank_reset": "Restore real rank",
- "rank_saved": "Chat rank updated",
- "rank_hint": "Only the hovercard and social cards change. Your ranked standing is untouched.",
- "crystal_title": "Challenge crystal",
- "crystal_level": "Level",
- "crystal_points": "Points",
- "crystal_saved": "Crystal updated",
- "tokens_title": "Medals, title and banner",
- "tokens_desc": "Pick up to three challenge medals for your profile. The same medal can fill every slot.",
- "tokens_slot": "Slot",
- "tokens_empty": "No medals earned yet",
- "tokens_none": "None",
- "tokens_clear": "Clear",
- "tokens_saved": "Profile preferences updated",
- "tokens_search": "Filter medals",
- "title_label": "Title",
- "title_none": "No title",
- "banner_label": "Banner",
- "banner_none": "No banner",
- "friends_title": "Friends",
- "friends_desc": "Load the list, tick the ones to remove, confirm. Removal is permanent.",
- "friends_load": "Load",
- "friends_select_all": "Select shown",
- "friends_clear_selection": "Clear selection",
- "friends_remove": "Remove selected",
- "friends_remove_confirm": "They are removed from your friends list for good.",
- "friends_remove_go": "Remove",
- "friends_removed": "Removed",
- "friends_count": "Friends",
- "wallet_rp": "RP",
- "wallet_be": "Blue Essence",
- "raffle_title": "Raffle",
- "raffle_lane": "Draw a lane",
- "raffle_lane_apply": "Use as preference",
- "raffle_champion": "Draw a champion",
- "raffle_class_any": "Any class",
- "raffle_class_fighter": "Fighter",
- "raffle_class_mage": "Mage",
- "raffle_class_assassin": "Assassin",
- "raffle_class_marksman": "Marksman",
- "raffle_class_support": "Support",
- "raffle_class_tank": "Tank",
- "raffle_declare": "Hover it",
- "raffle_lock": "Lock it",
- "raffle_again": "Draw again",
- "raffle_pool": "champions in the pool",
- "skin_title": "Skin roulette",
- "skin_roll": "Roll a skin",
- "skin_roll_ward": "Roll a ward",
- "skin_rolled": "Rolled",
- "skin_lock_first": "Lock a champion first",
- "pick_random": "Random champion",
- "pick_random_desc": "Ignores the list and locks a random legal champion, in ranked too. Teammates' hovered champions are avoided.",
- "skin_roulette": "Skin roulette",
- "skin_roulette_desc": "The moment you lock a champion, a random owned skin and chroma is applied. Recent rolls are skipped.",
- "skin_include_base": "Include the base skin",
- "ward_roulette": "Ward roulette",
- "ward_roulette_desc": "Also picks a random owned ward skin on lock-in.",
- "sgp_enabled": "Backend data (SGP)",
- "sgp_enabled_desc": "When the client's local history is thin or hidden, ask Riot's backend directly with the client's own tokens. Also enables replay downloads.",
- "coach_title": "AI coach",
- "coach_desc": "Your configured AI model reads your own match data, plus OP.GG meta data, and answers as a coach.",
- "coach_not_configured": "Configure an AI provider first.",
- "coach_open_settings": "Open settings",
- "coach_style": "Tone",
- "coach_style_objective": "Objective",
- "coach_style_roast": "Roast",
- "coach_style_praise": "Encouraging",
- "coach_review_title": "Review a game",
- "coach_review_pick": "Pick a recent game",
- "coach_review_run": "Review",
- "coach_trends_title": "Trends",
- "coach_trends_games": "games",
- "coach_trends_run": "Analyse",
- "coach_ask_title": "Ask the coach",
- "coach_ask_placeholder": "Ask anything about the current draft, game or your recent form",
- "coach_ask_run": "Ask",
- "coach_quick_draft": "Analyse this draft and give me a plan",
- "coach_quick_early": "What should my first 10 minutes look like?",
- "coach_quick_now": "What should I do right now?",
- "coach_quick_improve": "What should I fix first?",
- "coach_working": "Thinking…",
- "coach_result": "Coach",
- "coach_copy": "Copy",
- "coach_copied": "Copied",
- "coach_error_no_games": "No recent games to analyse",
- "coach_privacy": "Match data and, when relevant, OP.GG meta data are sent to your configured AI provider.",
- "replay_download": "Download replay",
- "replay_downloading": "Downloading…",
- "replay_saved": "Replay saved to",
- "review_ai": "Review with AI",
- "history_source_sgp": "via backend",
- "search_source_sgp": "History fetched from Riot's backend (SGP), since the client hid it."
- },
"nav": {
"home": "Home",
"downloads": "Downloads",
diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.json
index bd597a22..4d6cee53 100644
--- a/src/lib/i18n/es.json
+++ b/src/lib/i18n/es.json
@@ -54,422 +54,6 @@
"nav_home": "Ir a Inicio",
"nav_downloads": "Ir a Descargas"
},
- "league": {
- "cd_title": "Enfriamientos enemigos",
- "cd_desc": "Enfriamientos base de los propios datos de campeón del juego, divididos por la aceleración de habilidad que le dan sus objetos. Los rangos se estiman por nivel, así que tómalos como aproximados.",
- "cd_estimated": "estimado",
- "cd_haste": "aceleración",
- "col_gold_hint": "El oro mostrado es lo que cada jugador lleva en objetos, valorado con los datos de objetos del juego: es el único número de economía visible para los demás.",
- "scout_no_history": "Sin partidas recientes",
- "build_title": "Build de objetos",
- "build_desc": "Construida con las partidas de ese campeón dentro de tu propio historial reciente — sin sitios de builds de terceros, así que la muestra es pequeña y se indica.",
- "build_champion": "Elige un campeón",
- "build_samples": "partidas vistas",
- "meta_reference": "Referencia de build",
- "meta_source": "Agregado de datos públicos de op.gg para el parche actual. Se muestra como referencia; nada se aplica automáticamente.",
- "skill_priority": "Prioridad de habilidades",
- "items_starter": "Objetos iniciales",
- "items_core": "Objetos principales",
- "items_boots": "Botas",
- "items_last": "Objetos finales",
- "counters": "Tiene dificultades contra",
- "runes_full": "Tus páginas de runas están llenas. Borra una en el cliente para que OmniGet cree la suya.",
- "build_empty": "Aún no hay partidas con este campeón en la muestra.",
- "tab_meta": "Meta",
- "runes_title": "Runas",
- "runes_desc": "Páginas de runas y hechizos recomendados por el propio cliente del juego para el campeón que bloqueaste, siempre del parche actual.",
- "runes_auto": "Aplicar runas automáticamente",
- "runes_auto_desc": "Al bloquear un campeón, se crea y selecciona la primera página recomendada.",
- "runes_apply": "Aplicar",
- "runes_default": "predeterminada",
- "runes_spells": "Hechizos",
- "runes_empty": "Bloquea un campeón en la selección para ver las páginas recomendadas.",
- "tiers_title": "Tiers de campeones",
- "tiers_desc": "Ranking por rol, con tasas de victoria, elección y baneo. Datos de op.gg.",
- "tiers_position": "Posición",
- "tiers_pick": "elección",
- "tiers_ban": "baneo",
- "tiers_empty": "Lista de tiers no disponible ahora.",
- "impact_label": "Impacto",
- "score_label": "Nota",
- "score_hint": "Promedio de partidas clasificatorias y normales recientes. Oculta con menos de cinco partidas válidas.",
- "copy_riot_id": "Copiar Riot ID",
- "impact_hint": "Compuesto de KDA, participación en asesinatos, daño, daño recibido, oro, visión y CS, en escala 0-10",
- "tab_search": "Buscar",
- "search_title": "Buscar jugador",
- "search_placeholder": "Riot ID, p. ej. Faker#KR1",
- "search_button": "Buscar",
- "searching_player": "Buscando…",
- "search_hint": "Escribe un Riot ID con su tag para ver el rango, la forma reciente y el rendimiento por campeón.",
- "search_recent": "Forma reciente",
- "search_champions": "Campeones",
- "search_champions_hint": "2+ partidas, más jugados primero",
- "search_mastery": "Maestría",
- "stat_winrate": "Victorias",
- "games_short": "partidas",
- "duos_title": "Mejores dúos",
- "duos_desc": "Compañeros con los que más ganas, según tus partidas recientes. La puntuación reduce las muestras pequeñas para que un dúo con suerte no encabece la lista.",
- "duos_empty": "Aún no hay compañeros repetidos en la muestra.",
- "duos_score": "puntuación",
- "jungle_title": "Ruta inicial de jungla",
- "jungle_empty": "Sin datos de línea temporal en estas partidas.",
- "jungle_invade": "invadir",
- "jungle_gank3": "gank nivel 3",
- "zone_top": "Superior",
- "zone_mid": "Central",
- "zone_bot": "Inferior",
- "pref_top": "enfoque superior",
- "pref_mid": "enfoque central",
- "pref_bot": "enfoque inferior",
- "pref_top_mid": "enfoque superior y central",
- "pref_mid_bot": "enfoque central e inferior",
- "pref_balanced": "ruta equilibrada",
- "pref_unknown": "datos insuficientes",
- "chat_placeholder": "Mensaje para enviar en la selección",
- "chat_build": "Crear resumen",
- "chat_send": "Enviar",
- "tab_overview": "Resumen",
- "tab_analysis": "Análisis",
- "tab_live": "En vivo",
- "tab_goals": "Metas",
- "tab_automation": "Automatización",
- "tab_history": "Historial",
- "win_title": "Probabilidad de victoria",
- "win_allies": "Tu equipo",
- "win_interval": "rango del 90%",
- "win_gap": "Diferencia de rating",
- "win_known": "jugadores con datos",
- "win_disclaimer": "El emparejamiento crea partidas con una expectativa del 50%, así que las estimaciones honestas quedan cerca del empate. Tómalo como una tendencia, no un veredicto.",
- "win_unavailable": "Disponible en la selección de campeones y en partida.",
- "premades": "Grupos (premades)",
- "premade_source_party": "Informado por el juego",
- "premade_source_history": "Estimado por el historial compartido",
- "players": "jugadores",
- "objectives_title": "Objetivos y eventos",
- "objectives_estimate": "Los tiempos de reaparición son estimaciones del parche actual, no valores informados por el juego.",
- "objective_baron": "Barón",
- "objective_dragon": "Dragón",
- "objective_inhibitor": "Inhibidor",
- "event_kill": "Baja:",
- "event_turret": "Torre destruida:",
- "event_inhib": "Inhibidor destruido:",
- "event_dragon": "Dragón derrotado por",
- "event_baron": "Barón derrotado por",
- "event_herald": "Heraldo derrotado por",
- "event_multikill": "Multiasesinato:",
- "event_ace": "Ace de",
- "event_first_turret": "Primera torre:",
- "event_first_blood": "Primera sangre:",
- "gold_title": "Economía en vivo",
- "gold_unavailable": "Entra en una partida para ver el oro y las diferencias de línea.",
- "your_team": "Tu equipo",
- "enemy_team": "Equipo enemigo",
- "col_player": "Jugador",
- "col_gold": "Oro",
- "col_diff": "vs rival de línea",
- "goals_live": "Tus metas en esta partida",
- "goals_title": "Metas de rendimiento",
- "goals_role": "Rol",
- "goals_desc": "Metas por rol, usadas para evaluar tu partida en vivo. Ajústalas a tu nivel.",
- "goals_reset": "Restaurar valores",
- "goal_cs": "CS por minuto",
- "goal_gold": "Oro por minuto",
- "goal_kda": "KDA",
- "goal_vision": "Visión por minuto",
- "role_top": "Superior",
- "role_jungle": "Jungla",
- "role_middle": "Central",
- "role_bottom": "Tirador",
- "role_utility": "Soporte",
- "role_fill": "Rellenar",
- "role_preference": "Preferencia de rol",
- "role_first": "Rol principal",
- "role_second": "Rol secundario",
- "scout_title": "Análisis de la partida",
- "scout_allies": "Aliados",
- "scout_enemies": "Enemigos",
- "scout_enemies_hidden": "Los enemigos se revelan cuando empieza la partida.",
- "scout_note_placeholder": "Nota personal sobre este jugador…",
- "marked_in_allies": "Tienes notas en tu equipo:",
- "marked_in_enemies": "Tienes notas en el equipo enemigo:",
- "squad_enemy": "Los cinco enemigos entraron en cola juntos y todos los perfiles están ocultos.",
- "squad_ally": "Los cinco entraron en cola juntos y todos los perfiles están ocultos.",
- "scout_private": "Perfil privado",
- "tag_hot_streak": "racha de victorias",
- "tag_cold_streak": "racha de derrotas",
- "tag_high_winrate": "winrate alto",
- "tag_low_winrate": "winrate bajo",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "KDA alto",
- "tag_low_kda": "KDA bajo",
- "lobby_title": "Jugar",
- "lobby_hint": "Las acciones de sala aparecen aquí cuando el cliente esté listo.",
- "searching": "Buscando partida…",
- "start_queue": "Buscar partida",
- "stop_queue": "Cancelar búsqueda",
- "leave_lobby": "Salir de la sala",
- "play_again": "Jugar de nuevo",
- "champ_select_title": "Selección de campeones",
- "bench_title": "Banco",
- "reroll": "Reroll",
- "reroll_keep": "Rerollear y mantener campeón",
- "reroll_keep_hint": "Gasta el reroll para ampliar el banquillo y recupera tu campeón actual.",
- "swap": "Cambiar a",
- "remove": "Quitar",
- "live_title": "Partida en vivo",
- "respawn_in": "reaparece en",
- "automation_title": "Automatización",
- "notify_ready": "Avisar cuando se encuentre partida",
- "notify_ready_desc": "Envía una notificación del sistema solo cuando la ventana de OmniGet no está enfocada.",
- "auto_pick": "Pick automático",
- "auto_pick_desc": "Elige el primer campeón disponible de tu lista cuando sea tu turno.",
- "auto_ban": "Baneo automático",
- "auto_ban_desc": "Banea el primer campeón disponible de tu lista de baneos.",
- "pick_confirm": "Cómo terminar la selección",
- "pick_confirm_desc": "Declarar muestra tu campeón al equipo sin quitarte la decisión.",
- "pick_confirm_declare": "Solo declarar",
- "pick_confirm_timeout": "Bloquear al final",
- "pick_confirm_immediate": "Bloquear al instante",
- "auto_lock": "Confirmar automáticamente",
- "auto_lock_desc": "Apagado = solo muestra la intención; tú confirmas el pick.",
- "auto_honor": "Honor automático",
- "auto_honor_desc": "Honra a un compañero al final de la partida, priorizando a quien hizo cola contigo.",
- "auto_play_again": "Jugar de nuevo automáticamente",
- "auto_play_again_desc": "Vuelve a la sala en cuanto aparece la pantalla de fin de partida.",
- "auto_requeue": "Buscar partida a continuación",
- "auto_requeue_desc": "Inicia la búsqueda cuando vuelve la sala, solo si eres el líder.",
- "auto_swaps": "Aceptar cambios de posición y de orden",
- "auto_swaps_desc": "Acepta a los aliados que piden cambiar de rol u orden de selección.",
- "auto_reconnect": "Reconexión automática",
- "auto_reconnect_desc": "Vuelve a entrar en la partida automáticamente si el cliente se desconecta.",
- "spectate": "Ver partida",
- "spectate_loading": "Abriendo espectador…",
- "spectate_not_in_game": "Este jugador no está en partida ahora mismo.",
- "dodge": "Dodge",
- "dodge_warning": "Salir ahora cuenta como dodge: pierdes PL y recibes retraso de cola.",
- "dodge_confirm": "Salir igualmente",
- "unavailable_platform": "No disponible en este sistema.",
- "unavailable_client": "Abre el cliente de League of Legends para usar esto.",
- "unavailable_game": "Disponible durante una partida.",
- "badge_beta": "beta",
- "badge_experimental": "experimental",
- "profile_tools": "Personalizar perfil",
- "profile_icon": "Icono de invocador",
- "profile_icon_saved": "Icono actualizado.",
- "profile_status": "Disponibilidad",
- "profile_status_saved": "Disponibilidad actualizada.",
- "status_chat": "En línea",
- "status_away": "Ausente",
- "status_dnd": "Ocupado",
- "profile_message": "Mensaje de estado",
- "profile_message_saved": "Mensaje actualizado.",
- "profile_background": "Fondo del perfil",
- "profile_background_saved": "Fondo actualizado.",
- "profile_no_skins": "No tienes aspectos de este campeón.",
- "apply": "Aplicar",
- "restart_ux": "Reiniciar la interfaz del cliente",
- "restart_ux_warning": "Recarga la interfaz del cliente. Se mantiene tu lugar en la cola y la selección de campeones.",
- "restart_ux_confirm": "Reiniciar interfaz",
- "dodge_cancel": "Quedarme",
- "auto_trade": "Intercambios de campeón",
- "auto_trade_desc": "Cómo responder a las solicitudes de intercambio durante la selección de campeones.",
- "auto_trade_off": "Preguntarme",
- "auto_trade_accept": "Aceptar todas",
- "auto_trade_decline": "Rechazar todas",
- "auto_message": "Saludo en la selección",
- "auto_message_desc": "Se envía una vez al chat del equipo cuando empieza la selección. Vacío = desactivado.",
- "auto_message_placeholder": "p. ej. glhf :)",
- "tag_flash_swap": "La posición del Flash varía",
- "tag_high_damage_efficiency": "Mucho daño por oro",
- "tag_low_damage_efficiency": "Poco daño por oro",
- "solo_kills_label": "Asesinatos en solitario/partida",
- "early_deaths_label": "Muertes antes del min 15/partida",
- "seen_before": "visto antes",
- "seen_before_hint": "Ya has jugado con o contra este jugador.",
- "spell_timer_hint": "Haz clic cuando use el hechizo para iniciar el temporizador.",
- "obj_towers": "Torres",
- "obj_inhibitors": "Inhibidores",
- "obj_heralds": "Heraldos",
- "obj_bans": "Baneos",
- "open_player": "Ver las partidas recientes de este jugador",
- "close": "Cerrar",
- "stat_level": "Nv",
- "stat_damage": "Infligido",
- "stat_taken": "Recibido",
- "stat_mitigated": "Mitigado",
- "stat_healing": "Curación",
- "stat_objectives": "Objetivos",
- "stat_gold_min": "Oro/min",
- "stat_cs_min": "CS/min",
- "stat_vision": "Visión",
- "stat_wards": "Guardianes p/d/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Mejor racha",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "Primera sangre",
- "stat_first_tower": "Primera torre",
- "match_damage": "daño",
- "match_detail_unavailable": "Detalles de la partida no disponibles.",
- "pick_list": "Prioridad de picks",
- "ban_delay": "Esperar antes de banear",
- "ban_delay_desc": "Retiene el baneo un momento y omite campeones que un aliado ya declaró.",
- "ban_list": "Prioridad de baneos",
- "list_hint": "el orden importa",
- "search_champion": "Buscar campeón…",
- "phase_lobby": "En la sala",
- "phase_matchmaking": "En cola",
- "phase_ready_check": "¡Partida encontrada!",
- "phase_champ_select": "Selección de campeones",
- "phase_in_progress": "En partida",
- "phase_end_of_game": "Fin de la partida",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Menú opcional del cliente de League. Desactivado por defecto.",
- "settings_enable": "Activar menú de League",
- "settings_enable_desc": "Añade un menú de League of Legends con herramientas del cliente. Requiere el cliente de League abierto.",
- "settings_auto_accept": "Aceptar partidas automáticamente",
- "settings_auto_accept_desc": "Acepta automáticamente la comprobación de preparación cuando se encuentra una partida.",
- "disabled_title": "El menú de League está desactivado",
- "disabled_body": "Actívalo en Ajustes → Avanzado → League of Legends. Nada se ejecuta hasta que lo actives.",
- "open_settings": "Abrir Ajustes",
- "connected": "Conectado",
- "disconnected_title": "Cliente no detectado",
- "disconnected_body": "Abre el cliente de League of Legends y esta página se conectará automáticamente.",
- "level": "Nivel",
- "phase_label": "Estado del cliente",
- "accept_now": "Aceptar partida",
- "auto_accept": "Aceptar partidas automáticamente",
- "auto_accept_desc": "Acepta la partida por ti en cuanto aparezca.",
- "accept_delay": "Esperar antes de aceptar",
- "accept_delay_instant": "inmediatamente",
- "accept_delay_desc": "Te deja un momento para rechazar. Rechazar durante la espera cancela la aceptación automática.",
- "ranked_solo": "Clasificatoria Solo/Dúo",
- "ranked_flex": "Clasificatoria Flexible",
- "unranked": "Sin clasificar",
- "history_title": "Partidas recientes",
- "filter_queue": "Filtrar por cola",
- "filter_all": "Todas",
- "summary_games": "partidas",
- "summary_win_short": "V",
- "summary_loss_short": "D",
- "summary_remakes": "remakes no contados",
- "history_empty": "Aún no se han encontrado partidas.",
- "refresh": "Actualizar",
- "victory": "Victoria",
- "defeat": "Derrota",
- "tab_profile": "Perfil",
- "tab_coach": "Coach",
- "profile_title": "Editor de perfil",
- "profile_desc": "Todo lo que el cliente permite cambiar sobre cómo te ven los demás. Nada de esto toca el juego.",
- "profile_section_presence": "Presencia",
- "status_offline": "Desconectado",
- "status_mobile": "Móvil",
- "profile_message_hint": "Hasta 255 caracteres. La caja del cliente se detiene en 140.",
- "profile_section_icon": "Iconos",
- "profile_icon_search": "Buscar icono por nombre o id",
- "profile_icon_chat": "Icono del chat",
- "profile_icon_chat_saved": "Icono del chat actualizado",
- "profile_icon_hint": "El icono de perfil debe ser tuyo. El icono del chat (hovercard y lista de amigos) acepta cualquiera.",
- "profile_section_rank": "Rango mostrado en el chat",
- "rank_queue": "Cola",
- "rank_tier": "Rango",
- "rank_division": "División",
- "rank_reset": "Restaurar rango real",
- "rank_saved": "Rango del chat actualizado",
- "rank_hint": "Solo cambian el hovercard y las tarjetas sociales. Tu clasificatoria no se toca.",
- "crystal_title": "Cristal de desafíos",
- "crystal_level": "Nivel",
- "crystal_points": "Puntos",
- "crystal_saved": "Cristal actualizado",
- "tokens_title": "Medallas, título y estandarte",
- "tokens_desc": "Elige hasta tres medallas de desafío para tu perfil. La misma medalla puede ocupar todos los espacios.",
- "tokens_slot": "Espacio",
- "tokens_empty": "Aún no tienes medallas",
- "tokens_none": "Ninguna",
- "tokens_clear": "Limpiar",
- "tokens_saved": "Preferencias del perfil actualizadas",
- "tokens_search": "Filtrar medallas",
- "title_label": "Título",
- "title_none": "Sin título",
- "banner_label": "Estandarte",
- "banner_none": "Sin estandarte",
- "friends_title": "Amigos",
- "friends_desc": "Carga la lista, marca a quién eliminar y confirma. La eliminación es definitiva.",
- "friends_load": "Cargar",
- "friends_select_all": "Seleccionar visibles",
- "friends_clear_selection": "Limpiar selección",
- "friends_remove": "Eliminar seleccionados",
- "friends_remove_confirm": "Salen de tu lista de amigos para siempre.",
- "friends_remove_go": "Eliminar",
- "friends_removed": "Eliminados",
- "friends_count": "Amigos",
- "wallet_rp": "RP",
- "wallet_be": "Esencia Azul",
- "raffle_title": "Sorteo",
- "raffle_lane": "Sortear línea",
- "raffle_lane_apply": "Usar como preferencia",
- "raffle_champion": "Sortear campeón",
- "raffle_class_any": "Cualquier clase",
- "raffle_class_fighter": "Luchador",
- "raffle_class_mage": "Mago",
- "raffle_class_assassin": "Asesino",
- "raffle_class_marksman": "Tirador",
- "raffle_class_support": "Apoyo",
- "raffle_class_tank": "Tanque",
- "raffle_declare": "Declarar",
- "raffle_lock": "Bloquear",
- "raffle_again": "Sortear de nuevo",
- "raffle_pool": "campeones en el bombo",
- "skin_title": "Ruleta de aspectos",
- "skin_roll": "Sortear aspecto",
- "skin_roll_ward": "Sortear guardián",
- "skin_rolled": "Salió",
- "skin_lock_first": "Bloquea un campeón primero",
- "pick_random": "Campeón aleatorio",
- "pick_random_desc": "Ignora la lista y bloquea un campeón aleatorio permitido, también en clasificatoria. Se evitan los campeones que los aliados están declarando.",
- "skin_roulette": "Ruleta de aspectos",
- "skin_roulette_desc": "Al bloquear el campeón se aplica al azar un aspecto y un croma que posees. Se omiten los sorteos recientes.",
- "skin_include_base": "Incluir el aspecto base",
- "ward_roulette": "Ruleta de guardianes",
- "ward_roulette_desc": "También sortea un aspecto de guardián tuyo al bloquear.",
- "sgp_enabled": "Datos del backend (SGP)",
- "sgp_enabled_desc": "Cuando el historial local es corto u oculto, consulta directamente al backend de Riot con los tokens del cliente. También permite descargar repeticiones.",
- "coach_title": "Coach de IA",
- "coach_desc": "El modelo de IA configurado lee tus datos de partida, más datos de meta de OP.GG, y responde como un coach.",
- "coach_not_configured": "Configura primero un proveedor de IA.",
- "coach_open_settings": "Abrir ajustes",
- "coach_style": "Tono",
- "coach_style_objective": "Objetivo",
- "coach_style_roast": "Burla",
- "coach_style_praise": "Alentador",
- "coach_review_title": "Revisar una partida",
- "coach_review_pick": "Elige una partida reciente",
- "coach_review_run": "Revisar",
- "coach_trends_title": "Tendencias",
- "coach_trends_games": "partidas",
- "coach_trends_run": "Analizar",
- "coach_ask_title": "Pregunta al coach",
- "coach_ask_placeholder": "Pregunta sobre el draft actual, la partida o tu forma reciente",
- "coach_ask_run": "Preguntar",
- "coach_quick_draft": "Analiza este draft y dame un plan",
- "coach_quick_early": "¿Cómo deben ser mis primeros 10 minutos?",
- "coach_quick_now": "¿Qué hago ahora mismo?",
- "coach_quick_improve": "¿Qué debo corregir primero?",
- "coach_working": "Pensando…",
- "coach_result": "Coach",
- "coach_copy": "Copiar",
- "coach_copied": "Copiado",
- "coach_error_no_games": "No hay partidas recientes para analizar",
- "coach_privacy": "Los datos de la partida y, cuando corresponde, los datos de meta de OP.GG se envían al proveedor de IA configurado.",
- "replay_download": "Descargar repetición",
- "replay_downloading": "Descargando…",
- "replay_saved": "Repetición guardada en",
- "review_ai": "Revisar con IA",
- "history_source_sgp": "vía backend",
- "search_source_sgp": "Historial obtenido del backend de Riot (SGP), porque el cliente lo ocultó."
- },
"nav": {
"home": "Inicio",
"downloads": "Descargas",
diff --git a/src/lib/i18n/fa.json b/src/lib/i18n/fa.json
index 9191d6eb..d298d92a 100644
--- a/src/lib/i18n/fa.json
+++ b/src/lib/i18n/fa.json
@@ -54,422 +54,6 @@
"nav_home": "Go to Home",
"nav_downloads": "Go to Downloads"
},
- "league": {
- "cd_title": "Enemy cooldowns",
- "cd_desc": "Base cooldowns from the game's own champion data, divided by the ability haste their items give them. Ability ranks are estimated from level, so treat these as close, not exact.",
- "cd_estimated": "estimated",
- "cd_haste": "haste",
- "col_gold_hint": "Gold shown is what each player is carrying in items, priced from the game's own item data — the only economy number visible for other players.",
- "scout_no_history": "No recent games",
- "build_title": "Item build",
- "build_desc": "Built from the champion's games inside your own recent matches — no third-party build site involved, so the sample is small and honest about it.",
- "build_champion": "Pick a champion",
- "build_samples": "games seen",
- "meta_reference": "Build reference",
- "meta_source": "Aggregated from public op.gg data for the current patch. Shown for reference; nothing is applied automatically.",
- "skill_priority": "Skill priority",
- "items_starter": "Starting items",
- "items_core": "Core items",
- "items_boots": "Boots",
- "items_last": "Late items",
- "counters": "Struggles against",
- "runes_full": "Your rune pages are full. Delete one in the client to let OmniGet create its page.",
- "build_empty": "No games with this champion in the sample yet.",
- "tab_meta": "Meta",
- "runes_title": "Runes",
- "runes_desc": "Rune pages and summoner spells recommended by the game client itself for the champion you locked, so they always match the current patch.",
- "runes_auto": "Apply runes automatically",
- "runes_auto_desc": "When you lock a champion, the first recommended page is created and selected for you.",
- "runes_apply": "Apply",
- "runes_default": "default",
- "runes_spells": "Spells",
- "runes_empty": "Lock a champion in champion select to see recommended pages.",
- "tiers_title": "Champion tiers",
- "tiers_desc": "Ranking by role, with win, pick and ban rates. Data from op.gg.",
- "tiers_position": "Position",
- "tiers_pick": "pick",
- "tiers_ban": "ban",
- "tiers_empty": "Tier list unavailable right now.",
- "impact_label": "Impact",
- "score_label": "Score",
- "score_hint": "Average of recent ranked and normal games. Hidden below five usable games.",
- "copy_riot_id": "Copy Riot ID",
- "impact_hint": "Composite of KDA, kill participation, damage, damage taken, gold, vision and CS share, scored 0-10",
- "tab_search": "Search",
- "search_title": "Find a player",
- "search_placeholder": "Riot ID, e.g. Faker#KR1",
- "search_button": "Search",
- "searching_player": "Searching…",
- "search_hint": "Type a Riot ID with its tag to see rank, recent form and champion record.",
- "search_recent": "Recent form",
- "search_champions": "Champions",
- "search_champions_hint": "2+ games, most played first",
- "search_mastery": "Mastery",
- "stat_winrate": "Win rate",
- "games_short": "games",
- "duos_title": "Best duos",
- "duos_desc": "Teammates you win the most with, from your recent games. The score shrinks small samples so a lucky pair of games does not top the list.",
- "duos_empty": "No repeated teammates in the sample yet.",
- "duos_score": "score",
- "jungle_title": "Early jungle path",
- "jungle_empty": "No timeline data for these games.",
- "jungle_invade": "invade",
- "jungle_gank3": "lv3 gank",
- "zone_top": "Top",
- "zone_mid": "Mid",
- "zone_bot": "Bot",
- "pref_top": "top focused",
- "pref_mid": "mid focused",
- "pref_bot": "bot focused",
- "pref_top_mid": "top and mid focused",
- "pref_mid_bot": "mid and bot focused",
- "pref_balanced": "balanced path",
- "pref_unknown": "not enough data",
- "chat_placeholder": "Message to send in champion select",
- "chat_build": "Build summary",
- "chat_send": "Send",
- "tab_overview": "Overview",
- "tab_analysis": "Analysis",
- "tab_live": "Live",
- "tab_goals": "Goals",
- "tab_automation": "Automation",
- "tab_history": "History",
- "win_title": "Win probability",
- "win_allies": "Your team",
- "win_interval": "90% range",
- "win_gap": "Rating gap",
- "win_known": "players with data",
- "win_disclaimer": "Matchmaking builds games around a 50% expectation, so honest estimates stay close to even. Treat this as a lean, not a verdict.",
- "win_unavailable": "Available during champion select and in game.",
- "premades": "Premade groups",
- "premade_source_party": "Reported by the game",
- "premade_source_history": "Estimated from shared history",
- "players": "players",
- "objectives_title": "Objectives and events",
- "objectives_estimate": "Respawn windows are estimates based on the current patch, not values reported by the game.",
- "objective_baron": "Baron",
- "objective_dragon": "Dragon",
- "objective_inhibitor": "Inhibitor",
- "event_kill": "Kill:",
- "event_turret": "Turret down:",
- "event_inhib": "Inhibitor down:",
- "event_dragon": "Dragon taken by",
- "event_baron": "Baron taken by",
- "event_herald": "Herald taken by",
- "event_multikill": "Multikill:",
- "event_ace": "Ace by",
- "event_first_turret": "First turret:",
- "event_first_blood": "First blood:",
- "gold_title": "Live economy",
- "gold_unavailable": "Open a game to see live gold and lane differences.",
- "your_team": "Your team",
- "enemy_team": "Enemy team",
- "col_player": "Player",
- "col_gold": "Gold",
- "col_diff": "vs lane opponent",
- "goals_live": "Your goals this game",
- "goals_title": "Performance goals",
- "goals_role": "Role",
- "goals_desc": "Targets per role, used to grade your live game. Adjust them to your own level.",
- "goals_reset": "Reset to defaults",
- "goal_cs": "CS per minute",
- "goal_gold": "Gold per minute",
- "goal_kda": "KDA",
- "goal_vision": "Vision per minute",
- "role_top": "Top",
- "role_jungle": "Jungle",
- "role_middle": "Mid",
- "role_bottom": "Bot",
- "role_utility": "Support",
- "role_fill": "Fill",
- "role_preference": "Role preference",
- "role_first": "Primary role",
- "role_second": "Secondary role",
- "scout_title": "Match scouting",
- "scout_allies": "Allies",
- "scout_enemies": "Enemies",
- "scout_enemies_hidden": "Enemies are revealed once the game starts.",
- "scout_note_placeholder": "Personal note about this player…",
- "marked_in_allies": "You have notes on your side:",
- "marked_in_enemies": "You have notes on the enemy side:",
- "squad_enemy": "All five enemies queued together and every profile is hidden.",
- "squad_ally": "All five of you queued together and every profile is hidden.",
- "scout_private": "Private profile",
- "tag_hot_streak": "win streak",
- "tag_cold_streak": "loss streak",
- "tag_high_winrate": "high winrate",
- "tag_low_winrate": "low winrate",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "high KDA",
- "tag_low_kda": "low KDA",
- "lobby_title": "Play",
- "lobby_hint": "Lobby actions appear here once the client is ready.",
- "searching": "Searching for a match…",
- "start_queue": "Find match",
- "stop_queue": "Cancel search",
- "leave_lobby": "Leave lobby",
- "play_again": "Play again",
- "champ_select_title": "Champion select",
- "bench_title": "Bench",
- "reroll": "Reroll",
- "reroll_keep": "Reroll, keep champion",
- "reroll_keep_hint": "Spends the reroll to widen the bench and swaps your current champion back in.",
- "swap": "Swap to",
- "remove": "Remove",
- "live_title": "Live game",
- "respawn_in": "respawns in",
- "automation_title": "Automation",
- "notify_ready": "Notify when a match is found",
- "notify_ready_desc": "Sends a desktop notification only while the OmniGet window is not in focus.",
- "auto_pick": "Auto pick",
- "auto_pick_desc": "Picks the first available champion from your list when it's your turn.",
- "auto_ban": "Auto ban",
- "auto_ban_desc": "Bans the first available champion from your ban list.",
- "pick_confirm": "How to finish the pick",
- "pick_confirm_desc": "Declaring shows your champion to the team without taking the decision away from you.",
- "pick_confirm_declare": "Declare only",
- "pick_confirm_timeout": "Lock at the end",
- "pick_confirm_immediate": "Lock right away",
- "auto_lock": "Lock in automatically",
- "auto_lock_desc": "Off = only shows your intent; you still confirm the pick yourself.",
- "auto_honor": "Auto honor",
- "auto_honor_desc": "Honors a teammate after the game, preferring whoever you queued with.",
- "auto_play_again": "Auto play again",
- "auto_play_again_desc": "Returns to the lobby as soon as the end-of-game screen appears.",
- "auto_requeue": "Search again right after",
- "auto_requeue_desc": "Starts the search once the lobby is back, only when you are the lobby leader.",
- "auto_swaps": "Accept position and pick order swaps",
- "auto_swaps_desc": "Accepts teammates asking to trade roles or pick order during champion select.",
- "auto_reconnect": "Auto reconnect",
- "auto_reconnect_desc": "Rejoins the game automatically if the client disconnects.",
- "spectate": "Watch game",
- "spectate_loading": "Launching spectator…",
- "spectate_not_in_game": "This player is not in a game right now.",
- "dodge": "Dodge",
- "dodge_warning": "Leaving now counts as a dodge: you lose LP and get a queue delay.",
- "dodge_confirm": "Dodge anyway",
- "unavailable_platform": "Not available on this system.",
- "unavailable_client": "Open the League of Legends client to use this.",
- "unavailable_game": "Available while a match is running.",
- "badge_beta": "beta",
- "badge_experimental": "experimental",
- "profile_tools": "Customise profile",
- "profile_icon": "Summoner icon",
- "profile_icon_saved": "Icon updated.",
- "profile_status": "Availability",
- "profile_status_saved": "Availability updated.",
- "status_chat": "Online",
- "status_away": "Away",
- "status_dnd": "Busy",
- "profile_message": "Status message",
- "profile_message_saved": "Status message updated.",
- "profile_background": "Profile background",
- "profile_background_saved": "Background updated.",
- "profile_no_skins": "No owned skins for this champion.",
- "apply": "Apply",
- "restart_ux": "Restart client interface",
- "restart_ux_warning": "Reloads the client's interface. Your queue spot and champion select are kept.",
- "restart_ux_confirm": "Restart interface",
- "dodge_cancel": "Stay",
- "auto_trade": "Champion trades",
- "auto_trade_desc": "How to answer trade requests from teammates during champion select.",
- "auto_trade_off": "Ask me",
- "auto_trade_accept": "Accept all",
- "auto_trade_decline": "Decline all",
- "auto_message": "Champ select greeting",
- "auto_message_desc": "Sent once to the team chat when champion select starts. Leave empty to disable.",
- "auto_message_placeholder": "e.g. glhf :)",
- "tag_flash_swap": "Flash key varies",
- "tag_high_damage_efficiency": "High damage per gold",
- "tag_low_damage_efficiency": "Low damage per gold",
- "solo_kills_label": "Solo kills/game",
- "early_deaths_label": "Deaths before 15min/game",
- "seen_before": "seen before",
- "seen_before_hint": "You have played with or against this player before.",
- "spell_timer_hint": "Click when the spell is used to start the timer.",
- "obj_towers": "Towers",
- "obj_inhibitors": "Inhibitors",
- "obj_heralds": "Heralds",
- "obj_bans": "Bans",
- "open_player": "See this player's recent matches",
- "close": "Close",
- "stat_level": "Lvl",
- "stat_damage": "Dealt",
- "stat_taken": "Taken",
- "stat_mitigated": "Mitigated",
- "stat_healing": "Healing",
- "stat_objectives": "Objectives",
- "stat_gold_min": "Gold/min",
- "stat_cs_min": "CS/min",
- "stat_vision": "Vision",
- "stat_wards": "Wards p/k/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Best spree",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "First blood",
- "stat_first_tower": "First tower",
- "match_damage": "dmg",
- "match_detail_unavailable": "Match details unavailable.",
- "pick_list": "Pick priority",
- "ban_delay": "Wait before banning",
- "ban_delay_desc": "Holds the ban for a moment and skips champions a teammate has already declared.",
- "ban_list": "Ban priority",
- "list_hint": "order matters",
- "search_champion": "Search champion…",
- "phase_lobby": "In lobby",
- "phase_matchmaking": "In queue",
- "phase_ready_check": "Match found!",
- "phase_champ_select": "Champion select",
- "phase_in_progress": "In game",
- "phase_end_of_game": "Game over",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Optional League client menu. Off by default.",
- "settings_enable": "Enable League menu",
- "settings_enable_desc": "Adds a League of Legends menu with client tools. Requires the League client running.",
- "settings_auto_accept": "Auto-accept matches",
- "settings_auto_accept_desc": "Automatically accepts the ready check when a match is found.",
- "disabled_title": "The League menu is off",
- "disabled_body": "Enable it in Settings → Advanced → League of Legends. Nothing runs until you turn it on.",
- "open_settings": "Open Settings",
- "connected": "Connected",
- "disconnected_title": "Client not detected",
- "disconnected_body": "Open the League of Legends client and this page will connect automatically.",
- "level": "Level",
- "phase_label": "Client status",
- "accept_now": "Accept match",
- "auto_accept": "Auto-accept matches",
- "auto_accept_desc": "Accepts the ready check for you the moment a match pops.",
- "accept_delay": "Wait before accepting",
- "accept_delay_instant": "immediately",
- "accept_delay_desc": "Leaves you a moment to decline yourself. Declining during the wait cancels the automatic accept.",
- "ranked_solo": "Ranked Solo/Duo",
- "ranked_flex": "Ranked Flex",
- "unranked": "Unranked",
- "history_title": "Recent matches",
- "filter_queue": "Filter by queue",
- "filter_all": "All",
- "summary_games": "games",
- "summary_win_short": "W",
- "summary_loss_short": "L",
- "summary_remakes": "remakes not counted",
- "history_empty": "No matches found yet.",
- "refresh": "Refresh",
- "victory": "Victory",
- "defeat": "Defeat",
- "tab_profile": "پروفایل",
- "tab_coach": "مربی",
- "profile_title": "ویرایشگر پروفایل",
- "profile_desc": "هر چیزی که کلاینت اجازه می‌دهد در نحوه دیده شدنت توسط دیگران تغییر دهی. هیچ‌چیز اینجا به خود بازی دست نمی‌زند.",
- "profile_section_presence": "وضعیت حضور",
- "status_offline": "آفلاین",
- "status_mobile": "موبایل",
- "profile_message_hint": "حداکثر ۲۵۵ نویسه. کادر خود کلاینت در ۱۴۰ متوقف می‌شود.",
- "profile_section_icon": "آیکون‌ها",
- "profile_icon_search": "جستجوی آیکون با نام یا شناسه",
- "profile_icon_chat": "آیکون چت",
- "profile_icon_chat_saved": "آیکون چت به‌روز شد",
- "profile_icon_hint": "آیکون پروفایل باید متعلق به تو باشد. آیکون چت (کارت شناور و فهرست دوستان) هر آیکونی را می‌پذیرد.",
- "profile_section_rank": "رتبه نمایش‌داده‌شده در چت",
- "rank_queue": "صف",
- "rank_tier": "رده",
- "rank_division": "بخش",
- "rank_reset": "بازگرداندن رتبه واقعی",
- "rank_saved": "رتبه چت به‌روز شد",
- "rank_hint": "فقط کارت شناور و کارت‌های اجتماعی تغییر می‌کنند. رتبه واقعی‌ات دست‌نخورده می‌ماند.",
- "crystal_title": "کریستال چالش",
- "crystal_level": "سطح",
- "crystal_points": "امتیاز",
- "crystal_saved": "کریستال به‌روز شد",
- "tokens_title": "مدال‌ها، عنوان و پرچم",
- "tokens_desc": "تا سه مدال چالش برای پروفایل انتخاب کن. یک مدال می‌تواند همه جایگاه‌ها را پر کند.",
- "tokens_slot": "جایگاه",
- "tokens_empty": "هنوز مدالی نداری",
- "tokens_none": "هیچ",
- "tokens_clear": "پاک کردن",
- "tokens_saved": "تنظیمات پروفایل به‌روز شد",
- "tokens_search": "فیلتر مدال‌ها",
- "title_label": "عنوان",
- "title_none": "بدون عنوان",
- "banner_label": "پرچم",
- "banner_none": "بدون پرچم",
- "friends_title": "دوستان",
- "friends_desc": "فهرست را بارگذاری کن، کسانی را که می‌خواهی حذف کنی علامت بزن و تأیید کن. حذف دائمی است.",
- "friends_load": "بارگذاری",
- "friends_select_all": "انتخاب موارد نمایان",
- "friends_clear_selection": "لغو انتخاب",
- "friends_remove": "حذف انتخاب‌شده‌ها",
- "friends_remove_confirm": "برای همیشه از فهرست دوستانت حذف می‌شوند.",
- "friends_remove_go": "حذف",
- "friends_removed": "حذف شد",
- "friends_count": "دوستان",
- "wallet_rp": "RP",
- "wallet_be": "جوهر آبی",
- "raffle_title": "قرعه‌کشی",
- "raffle_lane": "قرعه لِین",
- "raffle_lane_apply": "به‌عنوان ترجیح",
- "raffle_champion": "قرعه قهرمان",
- "raffle_class_any": "هر کلاسی",
- "raffle_class_fighter": "جنگجو",
- "raffle_class_mage": "جادوگر",
- "raffle_class_assassin": "آدم‌کش",
- "raffle_class_marksman": "تیرانداز",
- "raffle_class_support": "پشتیبان",
- "raffle_class_tank": "تانک",
- "raffle_declare": "اعلام",
- "raffle_lock": "قفل",
- "raffle_again": "دوباره",
- "raffle_pool": "قهرمان در گردونه",
- "skin_title": "رولت اسکین",
- "skin_roll": "قرعه اسکین",
- "skin_roll_ward": "قرعه وارد",
- "skin_rolled": "درآمد",
- "skin_lock_first": "اول یک قهرمان قفل کن",
- "pick_random": "قهرمان تصادفی",
- "pick_random_desc": "فهرست را نادیده می‌گیرد و یک قهرمان مجاز تصادفی قفل می‌کند، حتی در رنک. قهرمان‌هایی که هم‌تیمی‌ها اعلام کرده‌اند کنار گذاشته می‌شوند.",
- "skin_roulette": "رولت اسکین",
- "skin_roulette_desc": "لحظه قفل کردن قهرمان، یک اسکین و کروما که داری تصادفی اعمال می‌شود. قرعه‌های اخیر رد می‌شوند.",
- "skin_include_base": "اسکین پایه هم باشد",
- "ward_roulette": "رولت وارد",
- "ward_roulette_desc": "هنگام قفل، یک اسکین وارد را هم تصادفی انتخاب می‌کند.",
- "sgp_enabled": "داده‌های بک‌اند (SGP)",
- "sgp_enabled_desc": "وقتی تاریخچه محلی کلاینت کم یا پنهان است، مستقیماً با توکن‌های خود کلاینت از بک‌اند رایوت می‌پرسد. دانلود ریپلی را هم فعال می‌کند.",
- "coach_title": "مربی هوش مصنوعی",
- "coach_desc": "مدل هوش مصنوعی پیکربندی‌شده داده‌های بازی‌های خودت و داده‌های متا از OP.GG را می‌خواند و مثل یک مربی پاسخ می‌دهد.",
- "coach_not_configured": "اول یک ارائه‌دهنده هوش مصنوعی پیکربندی کن.",
- "coach_open_settings": "باز کردن تنظیمات",
- "coach_style": "لحن",
- "coach_style_objective": "بی‌طرف",
- "coach_style_roast": "تند",
- "coach_style_praise": "دلگرم‌کننده",
- "coach_review_title": "بازبینی یک بازی",
- "coach_review_pick": "یک بازی اخیر انتخاب کن",
- "coach_review_run": "بازبینی",
- "coach_trends_title": "روندها",
- "coach_trends_games": "بازی",
- "coach_trends_run": "تحلیل",
- "coach_ask_title": "از مربی بپرس",
- "coach_ask_placeholder": "هر سؤالی درباره درفت فعلی، بازی یا فرم اخیرت",
- "coach_ask_run": "بپرس",
- "coach_quick_draft": "این درفت را تحلیل کن و یک برنامه بده",
- "coach_quick_early": "ده دقیقه اولم باید چطور باشد؟",
- "coach_quick_now": "همین حالا چه کار کنم؟",
- "coach_quick_improve": "اول چه چیزی را درست کنم؟",
- "coach_working": "در حال فکر…",
- "coach_result": "مربی",
- "coach_copy": "کپی",
- "coach_copied": "کپی شد",
- "coach_error_no_games": "بازی اخیری برای تحلیل نیست",
- "coach_privacy": "داده‌های بازی و در صورت نیاز داده‌های متای OP.GG به ارائه‌دهنده هوش مصنوعی پیکربندی‌شده ارسال می‌شوند.",
- "replay_download": "دانلود ریپلی",
- "replay_downloading": "در حال دانلود…",
- "replay_saved": "ریپلی ذخیره شد در",
- "review_ai": "بازبینی با هوش مصنوعی",
- "history_source_sgp": "از بک‌اند",
- "search_source_sgp": "کلاینت تاریخچه را پنهان کرده بود؛ از بک‌اند رایوت (SGP) گرفته شد."
- },
"nav": {
"home": "خانه",
"downloads": "دانلودها",
diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json
index 3797a5ca..3518191f 100644
--- a/src/lib/i18n/fr.json
+++ b/src/lib/i18n/fr.json
@@ -54,422 +54,6 @@
"nav_home": "Aller à l'Accueil",
"nav_downloads": "Aller aux Téléchargements"
},
- "league": {
- "cd_title": "Temps de recharge ennemis",
- "cd_desc": "Temps de recharge de base issus des données de champion du jeu, divisés par l'accélération de compétence de leurs objets. Les rangs sont estimés d'après le niveau, donc à prendre comme approximatifs.",
- "cd_estimated": "estimé",
- "cd_haste": "accélération",
- "col_gold_hint": "L'or affiché est ce que chaque joueur porte en objets, valorisé avec les données d'objets du jeu — le seul chiffre d'économie visible pour les autres.",
- "scout_no_history": "Aucune partie récente",
- "build_title": "Build d'objets",
- "build_desc": "Construite à partir des parties de ce champion dans votre propre historique récent — sans site de build tiers, donc l'échantillon est petit et annoncé comme tel.",
- "build_champion": "Choisir un champion",
- "build_samples": "parties vues",
- "meta_reference": "Référence de build",
- "meta_source": "Agrégat de données publiques op.gg pour le patch actuel. Affiché à titre de référence ; rien n'est appliqué automatiquement.",
- "skill_priority": "Priorité des compétences",
- "items_starter": "Objets de départ",
- "items_core": "Objets principaux",
- "items_boots": "Bottes",
- "items_last": "Objets de fin",
- "counters": "En difficulté contre",
- "runes_full": "Vos pages de runes sont pleines. Supprimez-en une dans le client pour qu'OmniGet crée la sienne.",
- "build_empty": "Aucune partie avec ce champion dans l'échantillon.",
- "tab_meta": "Méta",
- "runes_title": "Runes",
- "runes_desc": "Pages de runes et sorts recommandés par le client du jeu lui-même pour le champion verrouillé, toujours au patch actuel.",
- "runes_auto": "Appliquer les runes automatiquement",
- "runes_auto_desc": "Au verrouillage d'un champion, la première page recommandée est créée et sélectionnée.",
- "runes_apply": "Appliquer",
- "runes_default": "par défaut",
- "runes_spells": "Sorts",
- "runes_empty": "Verrouillez un champion en sélection pour voir les pages recommandées.",
- "tiers_title": "Tiers des champions",
- "tiers_desc": "Classement par rôle, avec taux de victoire, de sélection et de bannissement. Données op.gg.",
- "tiers_position": "Position",
- "tiers_pick": "sélection",
- "tiers_ban": "ban",
- "tiers_empty": "Liste de tiers indisponible pour le moment.",
- "impact_label": "Impact",
- "score_label": "Note",
- "score_hint": "Moyenne des parties classées et normales récentes. Masquée en dessous de cinq parties valides.",
- "copy_riot_id": "Copier le Riot ID",
- "impact_hint": "Composite de KDA, participation aux kills, dégâts, dégâts subis, or, vision et CS, noté de 0 à 10",
- "tab_search": "Rechercher",
- "search_title": "Trouver un joueur",
- "search_placeholder": "Riot ID, ex. Faker#KR1",
- "search_button": "Rechercher",
- "searching_player": "Recherche…",
- "search_hint": "Saisissez un Riot ID avec son tag pour voir le rang, la forme récente et les performances par champion.",
- "search_recent": "Forme récente",
- "search_champions": "Champions",
- "search_champions_hint": "2+ parties, les plus jouées d'abord",
- "search_mastery": "Maîtrise",
- "stat_winrate": "Victoires",
- "games_short": "parties",
- "duos_title": "Meilleurs duos",
- "duos_desc": "Coéquipiers avec qui vous gagnez le plus, d'après vos parties récentes. Le score réduit les petits échantillons pour qu'un duo chanceux ne domine pas la liste.",
- "duos_empty": "Aucun coéquipier récurrent dans l'échantillon.",
- "duos_score": "score",
- "jungle_title": "Trajet de jungle initial",
- "jungle_empty": "Pas de données de timeline pour ces parties.",
- "jungle_invade": "invasion",
- "jungle_gank3": "gank niveau 3",
- "zone_top": "Top",
- "zone_mid": "Milieu",
- "zone_bot": "Bot",
- "pref_top": "axé top",
- "pref_mid": "axé milieu",
- "pref_bot": "axé bot",
- "pref_top_mid": "axé top et milieu",
- "pref_mid_bot": "axé milieu et bot",
- "pref_balanced": "trajet équilibré",
- "pref_unknown": "données insuffisantes",
- "chat_placeholder": "Message à envoyer en sélection",
- "chat_build": "Créer le résumé",
- "chat_send": "Envoyer",
- "tab_overview": "Aperçu",
- "tab_analysis": "Analyse",
- "tab_live": "En direct",
- "tab_goals": "Objectifs",
- "tab_automation": "Automatisation",
- "tab_history": "Historique",
- "win_title": "Probabilité de victoire",
- "win_allies": "Votre équipe",
- "win_interval": "plage 90%",
- "win_gap": "Écart de rating",
- "win_known": "joueurs avec données",
- "win_disclaimer": "Le matchmaking crée des parties avec une attente de 50%, donc les estimations honnêtes restent proches de l'égalité. À prendre comme une tendance, pas un verdict.",
- "win_unavailable": "Disponible pendant la sélection et en partie.",
- "premades": "Groupes (premades)",
- "premade_source_party": "Indiqué par le jeu",
- "premade_source_history": "Estimé d'après l'historique commun",
- "players": "joueurs",
- "objectives_title": "Objectifs et événements",
- "objectives_estimate": "Les temps de réapparition sont des estimations basées sur le patch actuel, pas des valeurs fournies par le jeu.",
- "objective_baron": "Baron",
- "objective_dragon": "Dragon",
- "objective_inhibitor": "Inhibiteur",
- "event_kill": "Élimination :",
- "event_turret": "Tourelle détruite :",
- "event_inhib": "Inhibiteur détruit :",
- "event_dragon": "Dragon tué par",
- "event_baron": "Baron tué par",
- "event_herald": "Héraut tué par",
- "event_multikill": "Multi-kill :",
- "event_ace": "Ace de",
- "event_first_turret": "Première tourelle :",
- "event_first_blood": "Premier sang :",
- "gold_title": "Économie en direct",
- "gold_unavailable": "Lancez une partie pour voir l'or et les écarts de voie.",
- "your_team": "Votre équipe",
- "enemy_team": "Équipe ennemie",
- "col_player": "Joueur",
- "col_gold": "Or",
- "col_diff": "vs adversaire de voie",
- "goals_live": "Vos objectifs cette partie",
- "goals_title": "Objectifs de performance",
- "goals_role": "Rôle",
- "goals_desc": "Objectifs par rôle, utilisés pour évaluer votre partie en direct. Ajustez-les à votre niveau.",
- "goals_reset": "Réinitialiser",
- "goal_cs": "CS par minute",
- "goal_gold": "Or par minute",
- "goal_kda": "KDA",
- "goal_vision": "Vision par minute",
- "role_top": "Top",
- "role_jungle": "Jungle",
- "role_middle": "Milieu",
- "role_bottom": "Tireur",
- "role_utility": "Support",
- "role_fill": "Remplissage",
- "role_preference": "Préférence de rôle",
- "role_first": "Rôle principal",
- "role_second": "Rôle secondaire",
- "scout_title": "Analyse de la partie",
- "scout_allies": "Alliés",
- "scout_enemies": "Ennemis",
- "scout_enemies_hidden": "Les ennemis sont révélés au début de la partie.",
- "scout_note_placeholder": "Note personnelle sur ce joueur…",
- "marked_in_allies": "Vous avez des notes dans votre équipe :",
- "marked_in_enemies": "Vous avez des notes dans l'équipe adverse :",
- "squad_enemy": "Les cinq adversaires ont fait la queue ensemble et tous les profils sont masqués.",
- "squad_ally": "Vous avez tous les cinq fait la queue ensemble et tous les profils sont masqués.",
- "scout_private": "Profil privé",
- "tag_hot_streak": "série de victoires",
- "tag_cold_streak": "série de défaites",
- "tag_high_winrate": "winrate élevé",
- "tag_low_winrate": "winrate faible",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "KDA élevé",
- "tag_low_kda": "KDA faible",
- "lobby_title": "Jouer",
- "lobby_hint": "Les actions de salon apparaissent ici quand le client est prêt.",
- "searching": "Recherche d'une partie…",
- "start_queue": "Lancer la recherche",
- "stop_queue": "Annuler la recherche",
- "leave_lobby": "Quitter le salon",
- "play_again": "Rejouer",
- "champ_select_title": "Sélection des champions",
- "bench_title": "Banc",
- "reroll": "Relancer",
- "reroll_keep": "Relancer en gardant le champion",
- "reroll_keep_hint": "Utilise la relance pour élargir le banc et récupère votre champion actuel.",
- "swap": "Échanger contre",
- "remove": "Retirer",
- "live_title": "Partie en direct",
- "respawn_in": "réapparaît dans",
- "automation_title": "Automatisation",
- "notify_ready": "Prévenir quand une partie est trouvée",
- "notify_ready_desc": "Envoie une notification système uniquement lorsque la fenêtre d'OmniGet n'est pas au premier plan.",
- "auto_pick": "Pick automatique",
- "auto_pick_desc": "Choisit le premier champion disponible de votre liste quand c'est votre tour.",
- "auto_ban": "Ban automatique",
- "auto_ban_desc": "Bannit le premier champion disponible de votre liste de bans.",
- "pick_confirm": "Comment finaliser la sélection",
- "pick_confirm_desc": "Déclarer montre votre champion à l'équipe sans vous retirer la décision.",
- "pick_confirm_declare": "Déclarer seulement",
- "pick_confirm_timeout": "Verrouiller à la fin",
- "pick_confirm_immediate": "Verrouiller aussitôt",
- "auto_lock": "Verrouiller automatiquement",
- "auto_lock_desc": "Désactivé = montre seulement l'intention ; vous confirmez le pick vous-même.",
- "auto_honor": "Honneur automatique",
- "auto_honor_desc": "Honore un coéquipier après la partie, en privilégiant ceux de votre file.",
- "auto_play_again": "Rejouer automatiquement",
- "auto_play_again_desc": "Retourne au salon dès que l'écran de fin de partie apparaît.",
- "auto_requeue": "Rechercher une partie ensuite",
- "auto_requeue_desc": "Lance la recherche dès que le salon revient, uniquement si vous êtes le chef.",
- "auto_swaps": "Accepter les échanges de poste et d'ordre",
- "auto_swaps_desc": "Accepte les alliés qui demandent d'échanger de rôle ou d'ordre de sélection.",
- "auto_reconnect": "Reconnexion automatique",
- "auto_reconnect_desc": "Rejoint automatiquement la partie si le client se déconnecte.",
- "spectate": "Regarder la partie",
- "spectate_loading": "Lancement du spectateur…",
- "spectate_not_in_game": "Ce joueur n'est pas en partie actuellement.",
- "dodge": "Dodge",
- "dodge_warning": "Quitter maintenant compte comme un dodge : perte de PL et délai de file.",
- "dodge_confirm": "Quitter quand même",
- "unavailable_platform": "Non disponible sur ce système.",
- "unavailable_client": "Ouvrez le client League of Legends pour l'utiliser.",
- "unavailable_game": "Disponible pendant une partie.",
- "badge_beta": "bêta",
- "badge_experimental": "expérimental",
- "profile_tools": "Personnaliser le profil",
- "profile_icon": "Icône d'invocateur",
- "profile_icon_saved": "Icône mise à jour.",
- "profile_status": "Disponibilité",
- "profile_status_saved": "Disponibilité mise à jour.",
- "status_chat": "En ligne",
- "status_away": "Absent",
- "status_dnd": "Occupé",
- "profile_message": "Message de statut",
- "profile_message_saved": "Message mis à jour.",
- "profile_background": "Fond du profil",
- "profile_background_saved": "Fond mis à jour.",
- "profile_no_skins": "Aucun skin de ce champion sur le compte.",
- "apply": "Appliquer",
- "restart_ux": "Redémarrer l'interface du client",
- "restart_ux_warning": "Recharge l'interface du client. Votre place dans la file et la sélection des champions sont conservées.",
- "restart_ux_confirm": "Redémarrer l'interface",
- "dodge_cancel": "Rester",
- "auto_trade": "Échanges de champions",
- "auto_trade_desc": "Comment répondre aux demandes d'échange pendant la sélection des champions.",
- "auto_trade_off": "Me demander",
- "auto_trade_accept": "Tout accepter",
- "auto_trade_decline": "Tout refuser",
- "auto_message": "Message de sélection",
- "auto_message_desc": "Envoyé une fois dans le chat d'équipe au début de la sélection. Vide = désactivé.",
- "auto_message_placeholder": "ex. : glhf :)",
- "tag_flash_swap": "Position du Flash variable",
- "tag_high_damage_efficiency": "Dégâts élevés par or",
- "tag_low_damage_efficiency": "Dégâts faibles par or",
- "solo_kills_label": "Éliminations solo/partie",
- "early_deaths_label": "Morts avant 15 min/partie",
- "seen_before": "déjà vu",
- "seen_before_hint": "Vous avez déjà joué avec ou contre ce joueur.",
- "spell_timer_hint": "Cliquez quand le sort est utilisé pour lancer le minuteur.",
- "obj_towers": "Tourelles",
- "obj_inhibitors": "Inhibiteurs",
- "obj_heralds": "Hérauts",
- "obj_bans": "Bannissements",
- "open_player": "Voir les parties récentes de ce joueur",
- "close": "Fermer",
- "stat_level": "Nv",
- "stat_damage": "Infligés",
- "stat_taken": "Subis",
- "stat_mitigated": "Atténués",
- "stat_healing": "Soins",
- "stat_objectives": "Objectifs",
- "stat_gold_min": "Or/min",
- "stat_cs_min": "CS/min",
- "stat_vision": "Vision",
- "stat_wards": "Balises p/d/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Meilleure série",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "Premier sang",
- "stat_first_tower": "Première tourelle",
- "match_damage": "dégâts",
- "match_detail_unavailable": "Détails de la partie indisponibles.",
- "pick_list": "Priorité de picks",
- "ban_delay": "Attendre avant de bannir",
- "ban_delay_desc": "Retient le bannissement un instant et évite les champions déjà déclarés par un allié.",
- "ban_list": "Priorité de bans",
- "list_hint": "l'ordre compte",
- "search_champion": "Chercher un champion…",
- "phase_lobby": "Dans le salon",
- "phase_matchmaking": "En file",
- "phase_ready_check": "Partie trouvée !",
- "phase_champ_select": "Sélection des champions",
- "phase_in_progress": "En partie",
- "phase_end_of_game": "Fin de partie",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Menu optionnel du client League. Désactivé par défaut.",
- "settings_enable": "Activer le menu League",
- "settings_enable_desc": "Ajoute un menu League of Legends avec des outils du client. Nécessite le client League ouvert.",
- "settings_auto_accept": "Accepter les parties automatiquement",
- "settings_auto_accept_desc": "Accepte automatiquement la vérification quand une partie est trouvée.",
- "disabled_title": "Le menu League est désactivé",
- "disabled_body": "Activez-le dans Paramètres → Avancé → League of Legends. Rien ne s'exécute tant que vous ne l'activez pas.",
- "open_settings": "Ouvrir les Paramètres",
- "connected": "Connecté",
- "disconnected_title": "Client non détecté",
- "disconnected_body": "Ouvrez le client League of Legends et cette page se connectera automatiquement.",
- "level": "Niveau",
- "phase_label": "État du client",
- "accept_now": "Accepter la partie",
- "auto_accept": "Accepter les parties automatiquement",
- "auto_accept_desc": "Accepte la partie pour vous dès qu'elle apparaît.",
- "accept_delay": "Attendre avant d'accepter",
- "accept_delay_instant": "immédiatement",
- "accept_delay_desc": "Vous laisse un instant pour refuser. Refuser pendant l'attente annule l'acceptation automatique.",
- "ranked_solo": "Classée Solo/Duo",
- "ranked_flex": "Classée Flexible",
- "unranked": "Non classé",
- "history_title": "Parties récentes",
- "filter_queue": "Filtrer par file",
- "filter_all": "Toutes",
- "summary_games": "parties",
- "summary_win_short": "V",
- "summary_loss_short": "D",
- "summary_remakes": "remakes non comptés",
- "history_empty": "Aucune partie trouvée pour l'instant.",
- "refresh": "Actualiser",
- "victory": "Victoire",
- "defeat": "Défaite",
- "tab_profile": "Profil",
- "tab_coach": "Coach",
- "profile_title": "Éditeur de profil",
- "profile_desc": "Tout ce que le client laisse modifier dans la façon dont les autres vous voient. Rien ici ne touche au jeu.",
- "profile_section_presence": "Présence",
- "status_offline": "Hors ligne",
- "status_mobile": "Mobile",
- "profile_message_hint": "Jusqu'à 255 caractères. La zone du client s'arrête à 140.",
- "profile_section_icon": "Icônes",
- "profile_icon_search": "Chercher une icône par nom ou id",
- "profile_icon_chat": "Icône du chat",
- "profile_icon_chat_saved": "Icône du chat mise à jour",
- "profile_icon_hint": "L'icône de profil doit vous appartenir. L'icône du chat (hovercard et liste d'amis) accepte n'importe laquelle.",
- "profile_section_rank": "Rang affiché dans le chat",
- "rank_queue": "File",
- "rank_tier": "Rang",
- "rank_division": "Division",
- "rank_reset": "Rétablir le vrai rang",
- "rank_saved": "Rang du chat mis à jour",
- "rank_hint": "Seuls le hovercard et les cartes sociales changent. Votre classement réel reste intact.",
- "crystal_title": "Cristal des défis",
- "crystal_level": "Niveau",
- "crystal_points": "Points",
- "crystal_saved": "Cristal mis à jour",
- "tokens_title": "Médailles, titre et bannière",
- "tokens_desc": "Choisissez jusqu'à trois médailles de défi pour votre profil. La même médaille peut remplir chaque emplacement.",
- "tokens_slot": "Emplacement",
- "tokens_empty": "Aucune médaille obtenue pour l'instant",
- "tokens_none": "Aucune",
- "tokens_clear": "Effacer",
- "tokens_saved": "Préférences du profil mises à jour",
- "tokens_search": "Filtrer les médailles",
- "title_label": "Titre",
- "title_none": "Sans titre",
- "banner_label": "Bannière",
- "banner_none": "Sans bannière",
- "friends_title": "Amis",
- "friends_desc": "Chargez la liste, cochez ceux à retirer, confirmez. La suppression est définitive.",
- "friends_load": "Charger",
- "friends_select_all": "Sélectionner les visibles",
- "friends_clear_selection": "Vider la sélection",
- "friends_remove": "Retirer la sélection",
- "friends_remove_confirm": "Ils quittent votre liste d'amis pour de bon.",
- "friends_remove_go": "Retirer",
- "friends_removed": "Retirés",
- "friends_count": "Amis",
- "wallet_rp": "RP",
- "wallet_be": "Essence bleue",
- "raffle_title": "Tirage",
- "raffle_lane": "Tirer une voie",
- "raffle_lane_apply": "Utiliser comme préférence",
- "raffle_champion": "Tirer un champion",
- "raffle_class_any": "Toute classe",
- "raffle_class_fighter": "Combattant",
- "raffle_class_mage": "Mage",
- "raffle_class_assassin": "Assassin",
- "raffle_class_marksman": "Tireur",
- "raffle_class_support": "Support",
- "raffle_class_tank": "Tank",
- "raffle_declare": "Déclarer",
- "raffle_lock": "Verrouiller",
- "raffle_again": "Retirer",
- "raffle_pool": "champions dans l'urne",
- "skin_title": "Roulette de skins",
- "skin_roll": "Tirer un skin",
- "skin_roll_ward": "Tirer une balise",
- "skin_rolled": "Tiré",
- "skin_lock_first": "Verrouillez d'abord un champion",
- "pick_random": "Champion aléatoire",
- "pick_random_desc": "Ignore la liste et verrouille un champion aléatoire autorisé, même en classée. Les champions déclarés par les alliés sont évités.",
- "skin_roulette": "Roulette de skins",
- "skin_roulette_desc": "Dès que vous verrouillez un champion, un skin et un chroma que vous possédez sont appliqués au hasard. Les tirages récents sont ignorés.",
- "skin_include_base": "Inclure le skin de base",
- "ward_roulette": "Roulette de balises",
- "ward_roulette_desc": "Tire aussi un skin de balise au verrouillage.",
- "sgp_enabled": "Données du backend (SGP)",
- "sgp_enabled_desc": "Quand l'historique local est court ou masqué, interroge directement le backend de Riot avec les jetons du client. Permet aussi de télécharger les replays.",
- "coach_title": "Coach IA",
- "coach_desc": "Le modèle d'IA configuré lit vos propres données de partie, plus les données de méta d'OP.GG, et répond comme un coach.",
- "coach_not_configured": "Configurez d'abord un fournisseur d'IA.",
- "coach_open_settings": "Ouvrir les réglages",
- "coach_style": "Ton",
- "coach_style_objective": "Objectif",
- "coach_style_roast": "Moquerie",
- "coach_style_praise": "Encourageant",
- "coach_review_title": "Revoir une partie",
- "coach_review_pick": "Choisir une partie récente",
- "coach_review_run": "Revoir",
- "coach_trends_title": "Tendances",
- "coach_trends_games": "parties",
- "coach_trends_run": "Analyser",
- "coach_ask_title": "Demander au coach",
- "coach_ask_placeholder": "Posez une question sur le draft, la partie ou votre forme récente",
- "coach_ask_run": "Demander",
- "coach_quick_draft": "Analyse ce draft et donne-moi un plan",
- "coach_quick_early": "À quoi doivent ressembler mes 10 premières minutes ?",
- "coach_quick_now": "Que dois-je faire maintenant ?",
- "coach_quick_improve": "Que dois-je corriger en premier ?",
- "coach_working": "Réflexion…",
- "coach_result": "Coach",
- "coach_copy": "Copier",
- "coach_copied": "Copié",
- "coach_error_no_games": "Aucune partie récente à analyser",
- "coach_privacy": "Les données de partie et, si utile, les données de méta d'OP.GG sont envoyées au fournisseur d'IA configuré.",
- "replay_download": "Télécharger le replay",
- "replay_downloading": "Téléchargement…",
- "replay_saved": "Replay enregistré dans",
- "review_ai": "Revoir avec l'IA",
- "history_source_sgp": "via backend",
- "search_source_sgp": "Historique récupéré depuis le backend de Riot (SGP), le client l'ayant masqué."
- },
"nav": {
"home": "Accueil",
"downloads": "Téléchargements",
diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.json
index 49404bf6..9fea22d0 100644
--- a/src/lib/i18n/it.json
+++ b/src/lib/i18n/it.json
@@ -54,422 +54,6 @@
"nav_home": "Vai alla Home",
"nav_downloads": "Vai ai Download"
},
- "league": {
- "cd_title": "Ricariche nemiche",
- "cd_desc": "Ricariche base dai dati campione del gioco, divise per l'accelerazione abilità dei loro oggetti. I ranghi sono stimati dal livello, quindi consideralo approssimativo.",
- "cd_estimated": "stimato",
- "cd_haste": "accelerazione",
- "col_gold_hint": "L'oro mostrato è quello che ogni giocatore porta negli oggetti, valorizzato con i dati oggetti del gioco: è l'unico dato economico visibile per gli altri.",
- "scout_no_history": "Nessuna partita recente",
- "build_title": "Build di oggetti",
- "build_desc": "Costruita dalle partite di quel campione nella tua cronologia recente — nessun sito di build di terze parti, quindi il campione è piccolo e dichiarato.",
- "build_champion": "Scegli un campione",
- "build_samples": "partite viste",
- "meta_reference": "Riferimento build",
- "meta_source": "Aggregato da dati pubblici di op.gg per la patch attuale. Mostrato come riferimento; nulla viene applicato automaticamente.",
- "skill_priority": "Priorità abilità",
- "items_starter": "Oggetti iniziali",
- "items_core": "Oggetti principali",
- "items_boots": "Stivali",
- "items_last": "Oggetti finali",
- "counters": "Fa fatica contro",
- "runes_full": "Le tue pagine rune sono piene. Eliminane una nel client perché OmniGet crei la sua.",
- "build_empty": "Nessuna partita con questo campione nel campione.",
- "tab_meta": "Meta",
- "runes_title": "Rune",
- "runes_desc": "Pagine rune e incantesimi consigliati dal client del gioco per il campione bloccato, sempre alla patch corrente.",
- "runes_auto": "Applica rune automaticamente",
- "runes_auto_desc": "Quando blocchi un campione, la prima pagina consigliata viene creata e selezionata.",
- "runes_apply": "Applica",
- "runes_default": "predefinita",
- "runes_spells": "Incantesimi",
- "runes_empty": "Blocca un campione nella selezione per vedere le pagine consigliate.",
- "tiers_title": "Tier dei campioni",
- "tiers_desc": "Classifica per ruolo, con percentuali di vittoria, scelta e ban. Dati da op.gg.",
- "tiers_position": "Posizione",
- "tiers_pick": "scelta",
- "tiers_ban": "ban",
- "tiers_empty": "Tier list non disponibile al momento.",
- "impact_label": "Impatto",
- "score_label": "Punteggio",
- "score_hint": "Media delle partite classificate e normali recenti. Nascosto sotto cinque partite valide.",
- "copy_riot_id": "Copia Riot ID",
- "impact_hint": "Composto di KDA, partecipazione alle uccisioni, danni, danni subiti, oro, visione e CS, su scala 0-10",
- "tab_search": "Cerca",
- "search_title": "Trova giocatore",
- "search_placeholder": "Riot ID, es. Faker#KR1",
- "search_button": "Cerca",
- "searching_player": "Ricerca…",
- "search_hint": "Inserisci un Riot ID con il tag per vedere grado, forma recente e rendimento per campione.",
- "search_recent": "Forma recente",
- "search_champions": "Campioni",
- "search_champions_hint": "2+ partite, più giocati prima",
- "search_mastery": "Maestria",
- "stat_winrate": "Vittorie",
- "games_short": "partite",
- "duos_title": "Migliori duo",
- "duos_desc": "Compagni con cui vinci di più, dalle tue partite recenti. Il punteggio riduce i campioni piccoli così un duo fortunato non guida la lista.",
- "duos_empty": "Nessun compagno ripetuto nel campione.",
- "duos_score": "punteggio",
- "jungle_title": "Percorso iniziale in giungla",
- "jungle_empty": "Nessun dato di timeline per queste partite.",
- "jungle_invade": "invasione",
- "jungle_gank3": "gank livello 3",
- "zone_top": "Top",
- "zone_mid": "Mid",
- "zone_bot": "Bot",
- "pref_top": "focus top",
- "pref_mid": "focus mid",
- "pref_bot": "focus bot",
- "pref_top_mid": "focus top e mid",
- "pref_mid_bot": "focus mid e bot",
- "pref_balanced": "percorso equilibrato",
- "pref_unknown": "dati insufficienti",
- "chat_placeholder": "Messaggio da inviare in selezione",
- "chat_build": "Crea riepilogo",
- "chat_send": "Invia",
- "tab_overview": "Panoramica",
- "tab_analysis": "Analisi",
- "tab_live": "In diretta",
- "tab_goals": "Obiettivi",
- "tab_automation": "Automazione",
- "tab_history": "Cronologia",
- "win_title": "Probabilità di vittoria",
- "win_allies": "La tua squadra",
- "win_interval": "intervallo 90%",
- "win_gap": "Differenza di rating",
- "win_known": "giocatori con dati",
- "win_disclaimer": "Il matchmaking crea partite con un'aspettativa del 50%, quindi le stime oneste restano vicine alla parità. Consideralo un'inclinazione, non un verdetto.",
- "win_unavailable": "Disponibile durante la selezione e in partita.",
- "premades": "Gruppi (premade)",
- "premade_source_party": "Riportato dal gioco",
- "premade_source_history": "Stimato dalla cronologia condivisa",
- "players": "giocatori",
- "objectives_title": "Obiettivi ed eventi",
- "objectives_estimate": "I tempi di ricomparsa sono stime basate sulla patch attuale, non valori forniti dal gioco.",
- "objective_baron": "Barone",
- "objective_dragon": "Drago",
- "objective_inhibitor": "Inibitore",
- "event_kill": "Uccisione:",
- "event_turret": "Torre distrutta:",
- "event_inhib": "Inibitore distrutto:",
- "event_dragon": "Drago preso da",
- "event_baron": "Barone preso da",
- "event_herald": "Araldo preso da",
- "event_multikill": "Multiuccisione:",
- "event_ace": "Ace di",
- "event_first_turret": "Prima torre:",
- "event_first_blood": "Primo sangue:",
- "gold_title": "Economia in diretta",
- "gold_unavailable": "Entra in partita per vedere oro e differenze di corsia.",
- "your_team": "La tua squadra",
- "enemy_team": "Squadra nemica",
- "col_player": "Giocatore",
- "col_gold": "Oro",
- "col_diff": "vs avversario di corsia",
- "goals_live": "I tuoi obiettivi in questa partita",
- "goals_title": "Obiettivi di rendimento",
- "goals_role": "Ruolo",
- "goals_desc": "Obiettivi per ruolo, usati per valutare la partita in diretta. Adattali al tuo livello.",
- "goals_reset": "Ripristina",
- "goal_cs": "CS al minuto",
- "goal_gold": "Oro al minuto",
- "goal_kda": "KDA",
- "goal_vision": "Visione al minuto",
- "role_top": "Top",
- "role_jungle": "Giungla",
- "role_middle": "Mid",
- "role_bottom": "Tiratore",
- "role_utility": "Supporto",
- "role_fill": "Riempimento",
- "role_preference": "Preferenza di ruolo",
- "role_first": "Ruolo principale",
- "role_second": "Ruolo secondario",
- "scout_title": "Analisi della partita",
- "scout_allies": "Alleati",
- "scout_enemies": "Nemici",
- "scout_enemies_hidden": "I nemici vengono rivelati quando inizia la partita.",
- "scout_note_placeholder": "Nota personale su questo giocatore…",
- "marked_in_allies": "Hai note nella tua squadra:",
- "marked_in_enemies": "Hai note nella squadra nemica:",
- "squad_enemy": "I cinque nemici sono entrati in coda insieme e tutti i profili sono nascosti.",
- "squad_ally": "Voi cinque siete entrati in coda insieme e tutti i profili sono nascosti.",
- "scout_private": "Profilo privato",
- "tag_hot_streak": "serie di vittorie",
- "tag_cold_streak": "serie di sconfitte",
- "tag_high_winrate": "winrate alto",
- "tag_low_winrate": "winrate basso",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "KDA alto",
- "tag_low_kda": "KDA basso",
- "lobby_title": "Gioca",
- "lobby_hint": "Le azioni della lobby appaiono qui quando il client è pronto.",
- "searching": "Ricerca partita…",
- "start_queue": "Trova partita",
- "stop_queue": "Annulla ricerca",
- "leave_lobby": "Lascia la lobby",
- "play_again": "Gioca ancora",
- "champ_select_title": "Selezione campioni",
- "bench_title": "Panchina",
- "reroll": "Reroll",
- "reroll_keep": "Reroll mantenendo il campione",
- "reroll_keep_hint": "Spende il reroll per ampliare la panchina e rimette il tuo campione attuale.",
- "swap": "Scambia con",
- "remove": "Rimuovi",
- "live_title": "Partita in corso",
- "respawn_in": "rinasce tra",
- "automation_title": "Automazione",
- "notify_ready": "Avvisa quando la partita è trovata",
- "notify_ready_desc": "Invia una notifica di sistema solo quando la finestra di OmniGet non è in primo piano.",
- "auto_pick": "Pick automatico",
- "auto_pick_desc": "Sceglie il primo campione disponibile della tua lista quando è il tuo turno.",
- "auto_ban": "Ban automatico",
- "auto_ban_desc": "Banna il primo campione disponibile della tua lista di ban.",
- "pick_confirm": "Come concludere la scelta",
- "pick_confirm_desc": "Dichiarare mostra il campione alla squadra senza togliervi la decisione.",
- "pick_confirm_declare": "Solo dichiarare",
- "pick_confirm_timeout": "Blocca alla fine",
- "pick_confirm_immediate": "Blocca subito",
- "auto_lock": "Conferma automaticamente",
- "auto_lock_desc": "Spento = mostra solo l'intenzione; confermi tu il pick.",
- "auto_honor": "Onore automatico",
- "auto_honor_desc": "Onora un compagno a fine partita, preferendo chi era in coda con te.",
- "auto_play_again": "Gioca di nuovo automaticamente",
- "auto_play_again_desc": "Torna alla lobby appena appare la schermata di fine partita.",
- "auto_requeue": "Cerca subito un'altra partita",
- "auto_requeue_desc": "Avvia la ricerca quando la lobby torna, solo se sei il leader.",
- "auto_swaps": "Accetta scambi di posizione e ordine",
- "auto_swaps_desc": "Accetta i compagni che chiedono di scambiare ruolo o ordine di scelta.",
- "auto_reconnect": "Riconnessione automatica",
- "auto_reconnect_desc": "Rientra automaticamente in partita se il client si disconnette.",
- "spectate": "Guarda la partita",
- "spectate_loading": "Avvio dello spettatore…",
- "spectate_not_in_game": "Questo giocatore non è in partita al momento.",
- "dodge": "Dodge",
- "dodge_warning": "Uscire ora conta come dodge: perdi PL e subisci un ritardo in coda.",
- "dodge_confirm": "Esci comunque",
- "unavailable_platform": "Non disponibile su questo sistema.",
- "unavailable_client": "Apri il client di League of Legends per usarlo.",
- "unavailable_game": "Disponibile durante una partita.",
- "badge_beta": "beta",
- "badge_experimental": "sperimentale",
- "profile_tools": "Personalizza profilo",
- "profile_icon": "Icona evocatore",
- "profile_icon_saved": "Icona aggiornata.",
- "profile_status": "Disponibilità",
- "profile_status_saved": "Disponibilità aggiornata.",
- "status_chat": "Online",
- "status_away": "Assente",
- "status_dnd": "Occupato",
- "profile_message": "Messaggio di stato",
- "profile_message_saved": "Messaggio aggiornato.",
- "profile_background": "Sfondo del profilo",
- "profile_background_saved": "Sfondo aggiornato.",
- "profile_no_skins": "Nessuna skin di questo campione sull'account.",
- "apply": "Applica",
- "restart_ux": "Riavvia l'interfaccia del client",
- "restart_ux_warning": "Ricarica l'interfaccia del client. La posizione in coda e la selezione dei campioni vengono mantenute.",
- "restart_ux_confirm": "Riavvia interfaccia",
- "dodge_cancel": "Resta",
- "auto_trade": "Scambi di campioni",
- "auto_trade_desc": "Come rispondere alle richieste di scambio durante la selezione dei campioni.",
- "auto_trade_off": "Chiedimi",
- "auto_trade_accept": "Accetta tutte",
- "auto_trade_decline": "Rifiuta tutte",
- "auto_message": "Saluto in selezione",
- "auto_message_desc": "Inviato una volta nella chat di squadra all'inizio della selezione. Vuoto = disattivato.",
- "auto_message_placeholder": "es.: glhf :)",
- "tag_flash_swap": "Posizione del Flash variabile",
- "tag_high_damage_efficiency": "Molti danni per oro",
- "tag_low_damage_efficiency": "Pochi danni per oro",
- "solo_kills_label": "Uccisioni solitarie/partita",
- "early_deaths_label": "Morti prima dei 15 min/partita",
- "seen_before": "già visto",
- "seen_before_hint": "Hai già giocato con o contro questo giocatore.",
- "spell_timer_hint": "Clicca quando l'incantesimo viene usato per avviare il timer.",
- "obj_towers": "Torri",
- "obj_inhibitors": "Inibitori",
- "obj_heralds": "Araldi",
- "obj_bans": "Ban",
- "open_player": "Vedi le partite recenti di questo giocatore",
- "close": "Chiudi",
- "stat_level": "Lv",
- "stat_damage": "Inflitti",
- "stat_taken": "Subiti",
- "stat_mitigated": "Mitigati",
- "stat_healing": "Cure",
- "stat_objectives": "Obiettivi",
- "stat_gold_min": "Oro/min",
- "stat_cs_min": "CS/min",
- "stat_vision": "Visione",
- "stat_wards": "Ward p/d/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Serie migliore",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "Primo sangue",
- "stat_first_tower": "Prima torre",
- "match_damage": "danni",
- "match_detail_unavailable": "Dettagli della partita non disponibili.",
- "pick_list": "Priorità pick",
- "ban_delay": "Attendi prima di bannare",
- "ban_delay_desc": "Trattiene il ban un momento e salta i campioni già dichiarati da un alleato.",
- "ban_list": "Priorità ban",
- "list_hint": "l'ordine conta",
- "search_champion": "Cerca campione…",
- "phase_lobby": "In lobby",
- "phase_matchmaking": "In coda",
- "phase_ready_check": "Partita trovata!",
- "phase_champ_select": "Selezione campioni",
- "phase_in_progress": "In partita",
- "phase_end_of_game": "Fine partita",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Menu opzionale del client di League. Disattivato per impostazione predefinita.",
- "settings_enable": "Attiva menu League",
- "settings_enable_desc": "Aggiunge un menu di League of Legends con strumenti del client. Richiede il client di League aperto.",
- "settings_auto_accept": "Accetta partite automaticamente",
- "settings_auto_accept_desc": "Accetta automaticamente il controllo di prontezza quando viene trovata una partita.",
- "disabled_title": "Il menu League è disattivato",
- "disabled_body": "Attivalo in Impostazioni → Avanzate → League of Legends. Nulla viene eseguito finché non lo attivi.",
- "open_settings": "Apri Impostazioni",
- "connected": "Connesso",
- "disconnected_title": "Client non rilevato",
- "disconnected_body": "Apri il client di League of Legends e questa pagina si connetterà automaticamente.",
- "level": "Livello",
- "phase_label": "Stato del client",
- "accept_now": "Accetta partita",
- "auto_accept": "Accetta partite automaticamente",
- "auto_accept_desc": "Accetta la partita per te appena appare.",
- "accept_delay": "Attendi prima di accettare",
- "accept_delay_instant": "immediatamente",
- "accept_delay_desc": "Ti lascia un momento per rifiutare. Rifiutare durante l'attesa annulla l'accettazione automatica.",
- "ranked_solo": "Classificata Solo/Duo",
- "ranked_flex": "Classificata Flessibile",
- "unranked": "Non classificato",
- "history_title": "Partite recenti",
- "filter_queue": "Filtra per coda",
- "filter_all": "Tutte",
- "summary_games": "partite",
- "summary_win_short": "V",
- "summary_loss_short": "S",
- "summary_remakes": "remake non conteggiati",
- "history_empty": "Nessuna partita trovata finora.",
- "refresh": "Aggiorna",
- "victory": "Vittoria",
- "defeat": "Sconfitta",
- "tab_profile": "Profilo",
- "tab_coach": "Coach",
- "profile_title": "Editor del profilo",
- "profile_desc": "Tutto ciò che il client lascia cambiare su come ti vedono gli altri. Niente qui tocca il gioco.",
- "profile_section_presence": "Presenza",
- "status_offline": "Offline",
- "status_mobile": "Mobile",
- "profile_message_hint": "Fino a 255 caratteri. La casella del client si ferma a 140.",
- "profile_section_icon": "Icone",
- "profile_icon_search": "Cerca icona per nome o id",
- "profile_icon_chat": "Icona della chat",
- "profile_icon_chat_saved": "Icona della chat aggiornata",
- "profile_icon_hint": "L'icona del profilo deve essere tua. L'icona della chat (hovercard e lista amici) accetta qualsiasi icona.",
- "profile_section_rank": "Rango mostrato in chat",
- "rank_queue": "Coda",
- "rank_tier": "Rango",
- "rank_division": "Divisione",
- "rank_reset": "Ripristina rango reale",
- "rank_saved": "Rango della chat aggiornato",
- "rank_hint": "Cambiano solo l'hovercard e le schede social. La tua classificata resta intatta.",
- "crystal_title": "Cristallo delle sfide",
- "crystal_level": "Livello",
- "crystal_points": "Punti",
- "crystal_saved": "Cristallo aggiornato",
- "tokens_title": "Medaglie, titolo e stendardo",
- "tokens_desc": "Scegli fino a tre medaglie delle sfide per il profilo. La stessa medaglia può riempire ogni slot.",
- "tokens_slot": "Slot",
- "tokens_empty": "Nessuna medaglia ottenuta",
- "tokens_none": "Nessuna",
- "tokens_clear": "Svuota",
- "tokens_saved": "Preferenze del profilo aggiornate",
- "tokens_search": "Filtra medaglie",
- "title_label": "Titolo",
- "title_none": "Nessun titolo",
- "banner_label": "Stendardo",
- "banner_none": "Nessuno stendardo",
- "friends_title": "Amici",
- "friends_desc": "Carica la lista, spunta chi rimuovere, conferma. La rimozione è definitiva.",
- "friends_load": "Carica",
- "friends_select_all": "Seleziona visibili",
- "friends_clear_selection": "Azzera selezione",
- "friends_remove": "Rimuovi selezionati",
- "friends_remove_confirm": "Escono dalla tua lista amici per sempre.",
- "friends_remove_go": "Rimuovi",
- "friends_removed": "Rimossi",
- "friends_count": "Amici",
- "wallet_rp": "RP",
- "wallet_be": "Essenza Blu",
- "raffle_title": "Sorteggio",
- "raffle_lane": "Sorteggia corsia",
- "raffle_lane_apply": "Usa come preferenza",
- "raffle_champion": "Sorteggia campione",
- "raffle_class_any": "Qualsiasi classe",
- "raffle_class_fighter": "Combattente",
- "raffle_class_mage": "Mago",
- "raffle_class_assassin": "Assassino",
- "raffle_class_marksman": "Tiratore",
- "raffle_class_support": "Supporto",
- "raffle_class_tank": "Tank",
- "raffle_declare": "Dichiara",
- "raffle_lock": "Blocca",
- "raffle_again": "Sorteggia ancora",
- "raffle_pool": "campioni nell'urna",
- "skin_title": "Roulette delle skin",
- "skin_roll": "Sorteggia skin",
- "skin_roll_ward": "Sorteggia sentinella",
- "skin_rolled": "Uscita",
- "skin_lock_first": "Blocca prima un campione",
- "pick_random": "Campione casuale",
- "pick_random_desc": "Ignora la lista e blocca un campione casuale consentito, anche in classificata. I campioni dichiarati dagli alleati vengono evitati.",
- "skin_roulette": "Roulette delle skin",
- "skin_roulette_desc": "Appena blocchi il campione, vengono applicati a caso una skin e un chroma che possiedi. I sorteggi recenti vengono saltati.",
- "skin_include_base": "Includi la skin base",
- "ward_roulette": "Roulette delle sentinelle",
- "ward_roulette_desc": "Sorteggia anche una skin sentinella al blocco.",
- "sgp_enabled": "Dati del backend (SGP)",
- "sgp_enabled_desc": "Quando la cronologia locale è scarsa o nascosta, interroga direttamente il backend di Riot con i token del client. Abilita anche il download dei replay.",
- "coach_title": "Coach IA",
- "coach_desc": "Il modello IA configurato legge i tuoi dati di partita, più i dati meta di OP.GG, e risponde come un coach.",
- "coach_not_configured": "Configura prima un provider IA.",
- "coach_open_settings": "Apri impostazioni",
- "coach_style": "Tono",
- "coach_style_objective": "Obiettivo",
- "coach_style_roast": "Sfottò",
- "coach_style_praise": "Incoraggiante",
- "coach_review_title": "Rivedi una partita",
- "coach_review_pick": "Scegli una partita recente",
- "coach_review_run": "Rivedi",
- "coach_trends_title": "Tendenze",
- "coach_trends_games": "partite",
- "coach_trends_run": "Analizza",
- "coach_ask_title": "Chiedi al coach",
- "coach_ask_placeholder": "Chiedi del draft attuale, della partita o della tua forma recente",
- "coach_ask_run": "Chiedi",
- "coach_quick_draft": "Analizza questo draft e dammi un piano",
- "coach_quick_early": "Come dovrebbero essere i miei primi 10 minuti?",
- "coach_quick_now": "Cosa dovrei fare adesso?",
- "coach_quick_improve": "Cosa dovrei correggere per primo?",
- "coach_working": "Sto pensando…",
- "coach_result": "Coach",
- "coach_copy": "Copia",
- "coach_copied": "Copiato",
- "coach_error_no_games": "Nessuna partita recente da analizzare",
- "coach_privacy": "I dati della partita e, quando utile, i dati meta di OP.GG vengono inviati al provider IA configurato.",
- "replay_download": "Scarica replay",
- "replay_downloading": "Download…",
- "replay_saved": "Replay salvato in",
- "review_ai": "Rivedi con l'IA",
- "history_source_sgp": "via backend",
- "search_source_sgp": "Cronologia presa dal backend di Riot (SGP), perché il client l'ha nascosta."
- },
"nav": {
"home": "Home",
"downloads": "Download",
diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.json
index 149bc082..13845cd8 100644
--- a/src/lib/i18n/ja.json
+++ b/src/lib/i18n/ja.json
@@ -54,422 +54,6 @@
"nav_home": "ホームへ移動",
"nav_downloads": "ダウンロードへ移動"
},
- "league": {
- "cd_title": "敵のクールダウン",
- "cd_desc": "ゲーム本体のチャンピオンデータの基本クールダウンを、装備によるアビリティヘイストで割った値です。ランクはレベルからの推定なので、目安として見てください。",
- "cd_estimated": "推定",
- "cd_haste": "ヘイスト",
- "col_gold_hint": "表示ゴールドは各プレイヤーが装備に投じた額で、ゲーム本体のアイテムデータで算出しています。他プレイヤーについて見える唯一の経済指標です。",
- "scout_no_history": "直近の試合なし",
- "build_title": "アイテムビルド",
- "build_desc": "あなた自身の直近の試合に含まれるそのチャンピオンの試合から算出。外部ビルドサイトは使っていないため、サンプルは小さくその旨を明示します。",
- "build_champion": "チャンピオンを選択",
- "build_samples": "試合を参照",
- "meta_reference": "ビルドの参考",
- "meta_source": "現行パッチの op.gg 公開データの集計です。参考表示のみで、自動適用はしません。",
- "skill_priority": "スキル優先度",
- "items_starter": "初期アイテム",
- "items_core": "コアアイテム",
- "items_boots": "ブーツ",
- "items_last": "後期アイテム",
- "counters": "苦手な相手",
- "runes_full": "ルーンページが満杯です。クライアントで1つ削除すると OmniGet がページを作成できます。",
- "build_empty": "サンプル内にこのチャンピオンの試合がまだありません。",
- "tab_meta": "メタ",
- "runes_title": "ルーン",
- "runes_desc": "ロックしたチャンピオン向けにゲームクライアント自身が推奨するルーンページとサモナースペル。常に現行パッチ準拠です。",
- "runes_auto": "ルーンを自動適用",
- "runes_auto_desc": "チャンピオンをロックすると、最初の推奨ページが作成され選択されます。",
- "runes_apply": "適用",
- "runes_default": "既定",
- "runes_spells": "スペル",
- "runes_empty": "チャンピオン選択でロックすると推奨ページが表示されます。",
- "tiers_title": "チャンピオンティア",
- "tiers_desc": "ロール別ランキング(勝率・ピック率・バン率)。データ提供: op.gg。",
- "tiers_position": "ポジション",
- "tiers_pick": "ピック",
- "tiers_ban": "バン",
- "tiers_empty": "ティアリストは現在利用できません。",
- "impact_label": "インパクト",
- "score_label": "スコア",
- "score_hint": "直近のランクおよびノーマルの平均。有効な試合が5未満なら非表示。",
- "copy_riot_id": "Riot IDをコピー",
- "impact_hint": "KDA・キル関与・与ダメージ・被ダメージ・ゴールド・視界・CSの合成指標(0〜10)",
- "tab_search": "検索",
- "search_title": "プレイヤー検索",
- "search_placeholder": "Riot ID(例: Faker#KR1)",
- "search_button": "検索",
- "searching_player": "検索中…",
- "search_hint": "タグ付きのRiot IDを入力すると、ランク・直近の調子・チャンピオン別成績が表示されます。",
- "search_recent": "直近の調子",
- "search_champions": "チャンピオン",
- "search_champions_hint": "2試合以上、使用回数順",
- "search_mastery": "マスタリー",
- "stat_winrate": "勝率",
- "games_short": "試合",
- "duos_title": "ベストデュオ",
- "duos_desc": "直近の試合で最も勝率が高い味方。少ないサンプルは縮小されるため、まぐれの2試合が上位に来ません。",
- "duos_empty": "サンプル内に繰り返しの味方はまだいません。",
- "duos_score": "スコア",
- "jungle_title": "序盤のジャングル動線",
- "jungle_empty": "これらの試合のタイムラインデータがありません。",
- "jungle_invade": "侵入",
- "jungle_gank3": "レベル3ガンク",
- "zone_top": "トップ",
- "zone_mid": "ミッド",
- "zone_bot": "ボット",
- "pref_top": "トップ寄り",
- "pref_mid": "ミッド寄り",
- "pref_bot": "ボット寄り",
- "pref_top_mid": "トップ・ミッド寄り",
- "pref_mid_bot": "ミッド・ボット寄り",
- "pref_balanced": "バランス型",
- "pref_unknown": "データ不足",
- "chat_placeholder": "チャンピオン選択で送るメッセージ",
- "chat_build": "要約を作成",
- "chat_send": "送信",
- "tab_overview": "概要",
- "tab_analysis": "分析",
- "tab_live": "ライブ",
- "tab_goals": "目標",
- "tab_automation": "自動化",
- "tab_history": "履歴",
- "win_title": "勝率予測",
- "win_allies": "自チーム",
- "win_interval": "90%範囲",
- "win_gap": "レーティング差",
- "win_known": "人のデータあり",
- "win_disclaimer": "マッチメイキングは勝率50%を目標に組まれるため、誠実な推定は互角付近に留まります。傾向として見てください。",
- "win_unavailable": "チャンピオン選択中と試合中に利用できます。",
- "premades": "パーティー",
- "premade_source_party": "ゲームからの情報",
- "premade_source_history": "共通の試合履歴からの推定",
- "players": "人",
- "objectives_title": "オブジェクトとイベント",
- "objectives_estimate": "リスポーン時間は現行パッチに基づく推定値で、ゲームから提供された値ではありません。",
- "objective_baron": "バロン",
- "objective_dragon": "ドラゴン",
- "objective_inhibitor": "インヒビター",
- "event_kill": "キル:",
- "event_turret": "タワー破壊:",
- "event_inhib": "インヒビター破壊:",
- "event_dragon": "ドラゴン討伐",
- "event_baron": "バロン討伐",
- "event_herald": "ヘラルド討伐",
- "event_multikill": "マルチキル:",
- "event_ace": "エース",
- "event_first_turret": "ファーストタワー:",
- "event_first_blood": "ファーストブラッド:",
- "gold_title": "ライブ経済",
- "gold_unavailable": "試合に入るとゴールドとレーン差が表示されます。",
- "your_team": "自チーム",
- "enemy_team": "敵チーム",
- "col_player": "プレイヤー",
- "col_gold": "ゴールド",
- "col_diff": "対面との差",
- "goals_live": "この試合の目標",
- "goals_title": "パフォーマンス目標",
- "goals_role": "ロール",
- "goals_desc": "ロール別の目標値。試合中の評価に使われます。自分のレベルに合わせて調整してください。",
- "goals_reset": "初期値に戻す",
- "goal_cs": "CS/分",
- "goal_gold": "ゴールド/分",
- "goal_kda": "KDA",
- "goal_vision": "視界スコア/分",
- "role_top": "トップ",
- "role_jungle": "ジャングル",
- "role_middle": "ミッド",
- "role_bottom": "ボット",
- "role_utility": "サポート",
- "role_fill": "おまかせ",
- "role_preference": "ロール希望",
- "role_first": "第1ロール",
- "role_second": "第2ロール",
- "scout_title": "マッチ分析",
- "scout_allies": "味方",
- "scout_enemies": "敵",
- "scout_enemies_hidden": "敵はゲーム開始後に表示されます。",
- "scout_note_placeholder": "このプレイヤーへの個人メモ…",
- "marked_in_allies": "味方にメモがあります:",
- "marked_in_enemies": "敵にメモがあります:",
- "squad_enemy": "敵5人が一緒にキューへ入り、全員のプロフィールが非公開です。",
- "squad_ally": "5人全員が一緒にキューへ入り、全員のプロフィールが非公開です。",
- "scout_private": "非公開プロフィール",
- "tag_hot_streak": "連勝中",
- "tag_cold_streak": "連敗中",
- "tag_high_winrate": "高勝率",
- "tag_low_winrate": "低勝率",
- "tag_one_trick": "ワントリック",
- "tag_high_kda": "高KDA",
- "tag_low_kda": "低KDA",
- "lobby_title": "プレイ",
- "lobby_hint": "クライアントの準備ができるとロビー操作がここに表示されます。",
- "searching": "マッチを検索中…",
- "start_queue": "マッチを探す",
- "stop_queue": "検索をキャンセル",
- "leave_lobby": "ロビーを退出",
- "play_again": "もう一度プレイ",
- "champ_select_title": "チャンピオン選択",
- "bench_title": "ベンチ",
- "reroll": "リロール",
- "reroll_keep": "リロールしてチャンピオンを維持",
- "reroll_keep_hint": "リロールを消費してベンチを広げ、今のチャンピオンを戻します。",
- "swap": "交換",
- "remove": "削除",
- "live_title": "進行中のゲーム",
- "respawn_in": "リスポーンまで",
- "automation_title": "自動化",
- "notify_ready": "マッチが見つかったら通知",
- "notify_ready_desc": "OmniGet のウィンドウが前面にないときだけデスクトップ通知を送ります。",
- "auto_pick": "自動ピック",
- "auto_pick_desc": "自分の番になるとリストから利用可能な最初のチャンピオンをピックします。",
- "auto_ban": "自動バン",
- "auto_ban_desc": "バンリストから利用可能な最初のチャンピオンをバンします。",
- "pick_confirm": "ピックの確定方法",
- "pick_confirm_desc": "宣言はチャンピオンを味方に見せつつ、決定はあなたに残します。",
- "pick_confirm_declare": "宣言のみ",
- "pick_confirm_timeout": "終了間際に確定",
- "pick_confirm_immediate": "すぐ確定",
- "auto_lock": "自動ロックイン",
- "auto_lock_desc": "オフ = 意思表示のみ。確定は自分で行います。",
- "auto_honor": "自動オナー",
- "auto_honor_desc": "試合終了後に味方をオナーします。一緒にキューに入った人を優先します。",
- "auto_play_again": "自動でもう一度プレイ",
- "auto_play_again_desc": "試合終了画面が表示されたらすぐロビーに戻ります。",
- "auto_requeue": "続けてマッチを検索",
- "auto_requeue_desc": "ロビーが戻ったら検索を開始します(ロビーリーダーのときだけ)。",
- "auto_swaps": "ポジションとピック順の交換を承諾",
- "auto_swaps_desc": "チャンピオン選択でのロールやピック順の交換要求を承諾します。",
- "auto_reconnect": "自動再接続",
- "auto_reconnect_desc": "クライアントが切断された場合、自動で試合に再接続します。",
- "spectate": "観戦する",
- "spectate_loading": "観戦を起動中…",
- "spectate_not_in_game": "このプレイヤーは現在試合中ではありません。",
- "dodge": "ドッジ",
- "dodge_warning": "今退出するとドッジ扱いになり、LPを失いキュー制限を受けます。",
- "dodge_confirm": "それでも退出",
- "unavailable_platform": "このシステムでは利用できません。",
- "unavailable_client": "League of Legends クライアントを起動してください。",
- "unavailable_game": "試合中に利用できます。",
- "badge_beta": "ベータ",
- "badge_experimental": "実験的",
- "profile_tools": "プロフィールを設定",
- "profile_icon": "サモナーアイコン",
- "profile_icon_saved": "アイコンを更新しました。",
- "profile_status": "ステータス",
- "profile_status_saved": "ステータスを更新しました。",
- "status_chat": "オンライン",
- "status_away": "離席中",
- "status_dnd": "取り込み中",
- "profile_message": "ステータスメッセージ",
- "profile_message_saved": "メッセージを更新しました。",
- "profile_background": "プロフィール背景",
- "profile_background_saved": "背景を更新しました。",
- "profile_no_skins": "このチャンピオンの所持スキンがありません。",
- "apply": "適用",
- "restart_ux": "クライアントのUIを再起動",
- "restart_ux_warning": "クライアントのUIを再読み込みします。キューの順番とチャンピオン選択は保持されます。",
- "restart_ux_confirm": "UIを再起動",
- "dodge_cancel": "残る",
- "auto_trade": "チャンピオン交換",
- "auto_trade_desc": "チャンピオン選択中の交換リクエストへの対応方法。",
- "auto_trade_off": "確認する",
- "auto_trade_accept": "すべて承認",
- "auto_trade_decline": "すべて拒否",
- "auto_message": "選択時のあいさつ",
- "auto_message_desc": "チャンピオン選択開始時にチームチャットへ一度だけ送信されます。空欄で無効。",
- "auto_message_placeholder": "例: glhf :)",
- "tag_flash_swap": "フラッシュの位置が変わる",
- "tag_high_damage_efficiency": "ゴールドあたりのダメージが高い",
- "tag_low_damage_efficiency": "ゴールドあたりのダメージが低い",
- "solo_kills_label": "ソロキル/試合",
- "early_deaths_label": "15分前のデス/試合",
- "seen_before": "遭遇済み",
- "seen_before_hint": "このプレイヤーとは以前に対戦または協力したことがあります。",
- "spell_timer_hint": "スペルが使われたらクリックしてタイマーを開始。",
- "obj_towers": "タワー",
- "obj_inhibitors": "インヒビター",
- "obj_heralds": "ヘラルド",
- "obj_bans": "BAN",
- "open_player": "このプレイヤーの直近の試合を見る",
- "close": "閉じる",
- "stat_level": "Lv",
- "stat_damage": "与ダメ",
- "stat_taken": "被ダメ",
- "stat_mitigated": "軽減",
- "stat_healing": "回復",
- "stat_objectives": "オブジェクト",
- "stat_gold_min": "ゴールド/分",
- "stat_cs_min": "CS/分",
- "stat_vision": "視界",
- "stat_wards": "ワード 設置/破壊/コントロール",
- "stat_cc": "CC",
- "stat_spree": "最大連続キル",
- "stat_penta": "ペンタキル",
- "stat_quadra": "クアドラキル",
- "stat_triple": "トリプルキル",
- "stat_first_blood": "ファーストブラッド",
- "stat_first_tower": "ファーストタワー",
- "match_damage": "ダメージ",
- "match_detail_unavailable": "試合の詳細を取得できません。",
- "pick_list": "ピック優先度",
- "ban_delay": "BANまでの待機時間",
- "ban_delay_desc": "BANを少し遅らせ、味方が宣言済みのチャンピオンを避けます。",
- "ban_list": "バン優先度",
- "list_hint": "順序が重要",
- "search_champion": "チャンピオンを検索…",
- "phase_lobby": "ロビー",
- "phase_matchmaking": "キュー中",
- "phase_ready_check": "マッチが見つかりました!",
- "phase_champ_select": "チャンピオン選択",
- "phase_in_progress": "ゲーム中",
- "phase_end_of_game": "ゲーム終了",
- "nav": "リーグ・オブ・レジェンド",
- "settings_title": "リーグ・オブ・レジェンド",
- "settings_desc": "オプションのLeagueクライアントメニュー。デフォルトはオフです。",
- "settings_enable": "Leagueメニューを有効化",
- "settings_enable_desc": "クライアントツール付きのLeague of Legendsメニューを追加します。Leagueクライアントの起動が必要です。",
- "settings_auto_accept": "マッチを自動承認",
- "settings_auto_accept_desc": "マッチが見つかったとき、準備確認を自動的に承認します。",
- "disabled_title": "Leagueメニューはオフです",
- "disabled_body": "設定 → 詳細 → リーグ・オブ・レジェンドで有効にしてください。有効にするまで何も実行されません。",
- "open_settings": "設定を開く",
- "connected": "接続済み",
- "disconnected_title": "クライアントが見つかりません",
- "disconnected_body": "League of Legendsクライアントを起動すると、このページは自動的に接続します。",
- "level": "レベル",
- "phase_label": "クライアントの状態",
- "accept_now": "マッチを承認",
- "auto_accept": "マッチを自動承認",
- "auto_accept_desc": "マッチが見つかった瞬間に自動で承認します。",
- "accept_delay": "承諾までの待機時間",
- "accept_delay_instant": "すぐに",
- "accept_delay_desc": "自分で辞退する余地を残します。待機中に辞退すると自動承諾は取り消されます。",
- "ranked_solo": "ランク ソロ/デュオ",
- "ranked_flex": "ランク フレックス",
- "unranked": "アンランク",
- "history_title": "最近のマッチ",
- "filter_queue": "キューで絞り込む",
- "filter_all": "すべて",
- "summary_games": "試合",
- "summary_win_short": "勝",
- "summary_loss_short": "敗",
- "summary_remakes": "リメイクは除外",
- "history_empty": "まだマッチが見つかりません。",
- "refresh": "更新",
- "victory": "勝利",
- "defeat": "敗北",
- "tab_profile": "プロフィール",
- "tab_coach": "コーチ",
- "profile_title": "プロフィール編集",
- "profile_desc": "他人からの見え方のうち、クライアントが変更を許しているものすべて。ゲーム本体には触れません。",
- "profile_section_presence": "プレゼンス",
- "status_offline": "オフライン",
- "status_mobile": "モバイル",
- "profile_message_hint": "最大255文字。クライアント側の入力欄は140文字で止まります。",
- "profile_section_icon": "アイコン",
- "profile_icon_search": "名前かIDでアイコンを検索",
- "profile_icon_chat": "チャットアイコン",
- "profile_icon_chat_saved": "チャットアイコンを更新しました",
- "profile_icon_hint": "プロフィールアイコンは所持品のみ。チャットアイコン(ホバーカードとフレンドリスト)はどれでも使えます。",
- "profile_section_rank": "チャットに表示するランク",
- "rank_queue": "キュー",
- "rank_tier": "ティア",
- "rank_division": "ディビジョン",
- "rank_reset": "実際のランクに戻す",
- "rank_saved": "チャットのランクを更新しました",
- "rank_hint": "変わるのはホバーカードとソーシャルカードだけ。ランク戦の成績はそのままです。",
- "crystal_title": "チャレンジクリスタル",
- "crystal_level": "レベル",
- "crystal_points": "ポイント",
- "crystal_saved": "クリスタルを更新しました",
- "tokens_title": "メダル・称号・バナー",
- "tokens_desc": "プロフィールに載せるチャレンジメダルを最大3つ選びます。同じメダルを全枠に入れても構いません。",
- "tokens_slot": "枠",
- "tokens_empty": "まだメダルがありません",
- "tokens_none": "なし",
- "tokens_clear": "クリア",
- "tokens_saved": "プロフィール設定を更新しました",
- "tokens_search": "メダルを絞り込む",
- "title_label": "称号",
- "title_none": "称号なし",
- "banner_label": "バナー",
- "banner_none": "バナーなし",
- "friends_title": "フレンド",
- "friends_desc": "リストを読み込み、外す相手にチェックして確定。削除は元に戻せません。",
- "friends_load": "読み込む",
- "friends_select_all": "表示中を選択",
- "friends_clear_selection": "選択解除",
- "friends_remove": "選択を削除",
- "friends_remove_confirm": "フレンドリストから完全に削除されます。",
- "friends_remove_go": "削除",
- "friends_removed": "削除済み",
- "friends_count": "フレンド",
- "wallet_rp": "RP",
- "wallet_be": "ブルーエッセンス",
- "raffle_title": "抽選",
- "raffle_lane": "レーンを抽選",
- "raffle_lane_apply": "希望として設定",
- "raffle_champion": "チャンピオンを抽選",
- "raffle_class_any": "全クラス",
- "raffle_class_fighter": "ファイター",
- "raffle_class_mage": "メイジ",
- "raffle_class_assassin": "アサシン",
- "raffle_class_marksman": "マークスマン",
- "raffle_class_support": "サポート",
- "raffle_class_tank": "タンク",
- "raffle_declare": "宣言する",
- "raffle_lock": "ロックする",
- "raffle_again": "もう一度",
- "raffle_pool": "体が候補",
- "skin_title": "スキンルーレット",
- "skin_roll": "スキンを抽選",
- "skin_roll_ward": "ワードを抽選",
- "skin_rolled": "結果",
- "skin_lock_first": "先にチャンピオンをロックしてください",
- "pick_random": "ランダムチャンピオン",
- "pick_random_desc": "リストを無視して使用可能なチャンピオンをランダムにロックします。ランク戦でも動きます。味方が宣言中のチャンピオンは避けます。",
- "skin_roulette": "スキンルーレット",
- "skin_roulette_desc": "チャンピオンをロックした瞬間、所持スキンとクロマをランダムに適用します。最近出たものは除外されます。",
- "skin_include_base": "ベーススキンも含める",
- "ward_roulette": "ワードルーレット",
- "ward_roulette_desc": "ロック時に所持ワードスキンもランダムに選びます。",
- "sgp_enabled": "バックエンドデータ (SGP)",
- "sgp_enabled_desc": "クライアントのローカル履歴が少ない・隠れている時、クライアント自身のトークンでRiotのバックエンドに直接問い合わせます。リプレイのダウンロードも有効になります。",
- "coach_title": "AIコーチ",
- "coach_desc": "設定済みのAIモデルがあなたの対戦データとOP.GGのメタデータを読み、コーチとして答えます。",
- "coach_not_configured": "先にAIプロバイダーを設定してください。",
- "coach_open_settings": "設定を開く",
- "coach_style": "口調",
- "coach_style_objective": "客観的",
- "coach_style_roast": "辛口",
- "coach_style_praise": "励まし",
- "coach_review_title": "試合を振り返る",
- "coach_review_pick": "最近の試合を選ぶ",
- "coach_review_run": "振り返る",
- "coach_trends_title": "傾向",
- "coach_trends_games": "試合",
- "coach_trends_run": "分析",
- "coach_ask_title": "コーチに聞く",
- "coach_ask_placeholder": "今のドラフト、試合、最近の調子について何でも",
- "coach_ask_run": "聞く",
- "coach_quick_draft": "このドラフトを分析してプランをください",
- "coach_quick_early": "最初の10分はどう動くべき?",
- "coach_quick_now": "今すぐ何をすべき?",
- "coach_quick_improve": "最初に直すべきことは?",
- "coach_working": "考え中…",
- "coach_result": "コーチ",
- "coach_copy": "コピー",
- "coach_copied": "コピーしました",
- "coach_error_no_games": "分析できる最近の試合がありません",
- "coach_privacy": "対戦データと、必要に応じてOP.GGのメタデータが、設定済みのAIプロバイダーへ送られます。",
- "replay_download": "リプレイをダウンロード",
- "replay_downloading": "ダウンロード中…",
- "replay_saved": "リプレイの保存先",
- "review_ai": "AIで振り返る",
- "history_source_sgp": "バックエンド経由",
- "search_source_sgp": "クライアントが隠したため、履歴はRiotのバックエンド (SGP) から取得しました。"
- },
"nav": {
"home": "ホーム",
"downloads": "ダウンロード",
diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.ts
index d7e9430d..9e5cd888 100644
--- a/src/lib/i18n/keys.ts
+++ b/src/lib/i18n/keys.ts
@@ -461,421 +461,6 @@ export type TranslationKeys =
| 'hotmart.unavailable'
| 'hotmart.unknown_error'
- | 'league.accept_delay'
- | 'league.accept_delay_desc'
- | 'league.accept_delay_instant'
- | 'league.accept_now'
- | 'league.apply'
- | 'league.auto_accept'
- | 'league.auto_accept_desc'
- | 'league.auto_ban'
- | 'league.auto_ban_desc'
- | 'league.auto_honor'
- | 'league.auto_honor_desc'
- | 'league.auto_lock'
- | 'league.auto_lock_desc'
- | 'league.auto_message'
- | 'league.auto_message_desc'
- | 'league.auto_message_placeholder'
- | 'league.auto_pick'
- | 'league.auto_pick_desc'
- | 'league.auto_play_again'
- | 'league.auto_play_again_desc'
- | 'league.auto_reconnect'
- | 'league.auto_reconnect_desc'
- | 'league.auto_requeue'
- | 'league.auto_requeue_desc'
- | 'league.auto_swaps'
- | 'league.auto_swaps_desc'
- | 'league.auto_trade'
- | 'league.auto_trade_accept'
- | 'league.auto_trade_decline'
- | 'league.auto_trade_desc'
- | 'league.auto_trade_off'
- | 'league.automation_title'
- | 'league.badge_beta'
- | 'league.badge_experimental'
- | 'league.ban_delay'
- | 'league.ban_delay_desc'
- | 'league.ban_list'
- | 'league.banner_label'
- | 'league.banner_none'
- | 'league.bench_title'
- | 'league.build_champion'
- | 'league.build_desc'
- | 'league.build_empty'
- | 'league.build_samples'
- | 'league.build_title'
- | 'league.cd_desc'
- | 'league.cd_estimated'
- | 'league.cd_haste'
- | 'league.cd_title'
- | 'league.champ_select_title'
- | 'league.chat_build'
- | 'league.chat_placeholder'
- | 'league.chat_send'
- | 'league.close'
- | 'league.coach_ask_placeholder'
- | 'league.coach_ask_run'
- | 'league.coach_ask_title'
- | 'league.coach_copied'
- | 'league.coach_copy'
- | 'league.coach_desc'
- | 'league.coach_error_no_games'
- | 'league.coach_not_configured'
- | 'league.coach_open_settings'
- | 'league.coach_privacy'
- | 'league.coach_quick_draft'
- | 'league.coach_quick_early'
- | 'league.coach_quick_improve'
- | 'league.coach_quick_now'
- | 'league.coach_result'
- | 'league.coach_review_pick'
- | 'league.coach_review_run'
- | 'league.coach_review_title'
- | 'league.coach_style'
- | 'league.coach_style_objective'
- | 'league.coach_style_praise'
- | 'league.coach_style_roast'
- | 'league.coach_title'
- | 'league.coach_trends_games'
- | 'league.coach_trends_run'
- | 'league.coach_trends_title'
- | 'league.coach_working'
- | 'league.col_diff'
- | 'league.col_gold'
- | 'league.col_gold_hint'
- | 'league.col_player'
- | 'league.connected'
- | 'league.copy_riot_id'
- | 'league.counters'
- | 'league.crystal_level'
- | 'league.crystal_points'
- | 'league.crystal_saved'
- | 'league.crystal_title'
- | 'league.defeat'
- | 'league.disabled_body'
- | 'league.disabled_title'
- | 'league.disconnected_body'
- | 'league.disconnected_title'
- | 'league.dodge'
- | 'league.dodge_cancel'
- | 'league.dodge_confirm'
- | 'league.dodge_warning'
- | 'league.duos_desc'
- | 'league.duos_empty'
- | 'league.duos_score'
- | 'league.duos_title'
- | 'league.early_deaths_label'
- | 'league.enemy_team'
- | 'league.event_ace'
- | 'league.event_baron'
- | 'league.event_dragon'
- | 'league.event_first_blood'
- | 'league.event_first_turret'
- | 'league.event_herald'
- | 'league.event_inhib'
- | 'league.event_kill'
- | 'league.event_multikill'
- | 'league.event_turret'
- | 'league.filter_all'
- | 'league.filter_queue'
- | 'league.friends_clear_selection'
- | 'league.friends_count'
- | 'league.friends_desc'
- | 'league.friends_load'
- | 'league.friends_remove'
- | 'league.friends_remove_confirm'
- | 'league.friends_remove_go'
- | 'league.friends_removed'
- | 'league.friends_select_all'
- | 'league.friends_title'
- | 'league.games_short'
- | 'league.goal_cs'
- | 'league.goal_gold'
- | 'league.goal_kda'
- | 'league.goal_vision'
- | 'league.goals_desc'
- | 'league.goals_live'
- | 'league.goals_reset'
- | 'league.goals_role'
- | 'league.goals_title'
- | 'league.gold_title'
- | 'league.gold_unavailable'
- | 'league.history_empty'
- | 'league.history_source_sgp'
- | 'league.history_title'
- | 'league.impact_hint'
- | 'league.impact_label'
- | 'league.items_boots'
- | 'league.items_core'
- | 'league.items_last'
- | 'league.items_starter'
- | 'league.jungle_empty'
- | 'league.jungle_gank3'
- | 'league.jungle_invade'
- | 'league.jungle_title'
- | 'league.leave_lobby'
- | 'league.level'
- | 'league.list_hint'
- | 'league.live_title'
- | 'league.lobby_hint'
- | 'league.lobby_title'
- | 'league.marked_in_allies'
- | 'league.marked_in_enemies'
- | 'league.match_damage'
- | 'league.match_detail_unavailable'
- | 'league.meta_reference'
- | 'league.meta_source'
- | 'league.nav'
- | 'league.notify_ready'
- | 'league.notify_ready_desc'
- | 'league.obj_bans'
- | 'league.obj_heralds'
- | 'league.obj_inhibitors'
- | 'league.obj_towers'
- | 'league.objective_baron'
- | 'league.objective_dragon'
- | 'league.objective_inhibitor'
- | 'league.objectives_estimate'
- | 'league.objectives_title'
- | 'league.open_player'
- | 'league.open_settings'
- | 'league.phase_champ_select'
- | 'league.phase_end_of_game'
- | 'league.phase_in_progress'
- | 'league.phase_label'
- | 'league.phase_lobby'
- | 'league.phase_matchmaking'
- | 'league.phase_ready_check'
- | 'league.pick_confirm'
- | 'league.pick_confirm_declare'
- | 'league.pick_confirm_desc'
- | 'league.pick_confirm_immediate'
- | 'league.pick_confirm_timeout'
- | 'league.pick_list'
- | 'league.pick_random'
- | 'league.pick_random_desc'
- | 'league.play_again'
- | 'league.players'
- | 'league.pref_balanced'
- | 'league.pref_bot'
- | 'league.pref_mid'
- | 'league.pref_mid_bot'
- | 'league.pref_top'
- | 'league.pref_top_mid'
- | 'league.pref_unknown'
- | 'league.premade_source_history'
- | 'league.premade_source_party'
- | 'league.premades'
- | 'league.profile_background'
- | 'league.profile_background_saved'
- | 'league.profile_desc'
- | 'league.profile_icon'
- | 'league.profile_icon_chat'
- | 'league.profile_icon_chat_saved'
- | 'league.profile_icon_hint'
- | 'league.profile_icon_saved'
- | 'league.profile_icon_search'
- | 'league.profile_message'
- | 'league.profile_message_hint'
- | 'league.profile_message_saved'
- | 'league.profile_no_skins'
- | 'league.profile_section_icon'
- | 'league.profile_section_presence'
- | 'league.profile_section_rank'
- | 'league.profile_status'
- | 'league.profile_status_saved'
- | 'league.profile_title'
- | 'league.profile_tools'
- | 'league.raffle_again'
- | 'league.raffle_champion'
- | 'league.raffle_class_any'
- | 'league.raffle_class_assassin'
- | 'league.raffle_class_fighter'
- | 'league.raffle_class_mage'
- | 'league.raffle_class_marksman'
- | 'league.raffle_class_support'
- | 'league.raffle_class_tank'
- | 'league.raffle_declare'
- | 'league.raffle_lane'
- | 'league.raffle_lane_apply'
- | 'league.raffle_lock'
- | 'league.raffle_pool'
- | 'league.raffle_title'
- | 'league.rank_division'
- | 'league.rank_hint'
- | 'league.rank_queue'
- | 'league.rank_reset'
- | 'league.rank_saved'
- | 'league.rank_tier'
- | 'league.ranked_flex'
- | 'league.ranked_solo'
- | 'league.refresh'
- | 'league.remove'
- | 'league.replay_download'
- | 'league.replay_downloading'
- | 'league.replay_saved'
- | 'league.reroll'
- | 'league.reroll_keep'
- | 'league.reroll_keep_hint'
- | 'league.respawn_in'
- | 'league.restart_ux'
- | 'league.restart_ux_confirm'
- | 'league.restart_ux_warning'
- | 'league.review_ai'
- | 'league.role_bottom'
- | 'league.role_fill'
- | 'league.role_first'
- | 'league.role_jungle'
- | 'league.role_middle'
- | 'league.role_preference'
- | 'league.role_second'
- | 'league.role_top'
- | 'league.role_utility'
- | 'league.runes_apply'
- | 'league.runes_auto'
- | 'league.runes_auto_desc'
- | 'league.runes_default'
- | 'league.runes_desc'
- | 'league.runes_empty'
- | 'league.runes_full'
- | 'league.runes_spells'
- | 'league.runes_title'
- | 'league.score_hint'
- | 'league.score_label'
- | 'league.scout_allies'
- | 'league.scout_enemies'
- | 'league.scout_enemies_hidden'
- | 'league.scout_no_history'
- | 'league.scout_note_placeholder'
- | 'league.scout_private'
- | 'league.scout_title'
- | 'league.search_button'
- | 'league.search_champion'
- | 'league.search_champions'
- | 'league.search_champions_hint'
- | 'league.search_hint'
- | 'league.search_mastery'
- | 'league.search_placeholder'
- | 'league.search_recent'
- | 'league.search_source_sgp'
- | 'league.search_title'
- | 'league.searching'
- | 'league.searching_player'
- | 'league.seen_before'
- | 'league.seen_before_hint'
- | 'league.settings_auto_accept'
- | 'league.settings_auto_accept_desc'
- | 'league.settings_desc'
- | 'league.settings_enable'
- | 'league.settings_enable_desc'
- | 'league.settings_title'
- | 'league.sgp_enabled'
- | 'league.sgp_enabled_desc'
- | 'league.skill_priority'
- | 'league.skin_include_base'
- | 'league.skin_lock_first'
- | 'league.skin_roll'
- | 'league.skin_roll_ward'
- | 'league.skin_rolled'
- | 'league.skin_roulette'
- | 'league.skin_roulette_desc'
- | 'league.skin_title'
- | 'league.solo_kills_label'
- | 'league.spectate'
- | 'league.spectate_loading'
- | 'league.spectate_not_in_game'
- | 'league.spell_timer_hint'
- | 'league.squad_ally'
- | 'league.squad_enemy'
- | 'league.start_queue'
- | 'league.stat_cc'
- | 'league.stat_cs_min'
- | 'league.stat_damage'
- | 'league.stat_first_blood'
- | 'league.stat_first_tower'
- | 'league.stat_gold_min'
- | 'league.stat_healing'
- | 'league.stat_level'
- | 'league.stat_mitigated'
- | 'league.stat_objectives'
- | 'league.stat_penta'
- | 'league.stat_quadra'
- | 'league.stat_spree'
- | 'league.stat_taken'
- | 'league.stat_triple'
- | 'league.stat_vision'
- | 'league.stat_wards'
- | 'league.stat_winrate'
- | 'league.status_away'
- | 'league.status_chat'
- | 'league.status_dnd'
- | 'league.status_mobile'
- | 'league.status_offline'
- | 'league.stop_queue'
- | 'league.summary_games'
- | 'league.summary_loss_short'
- | 'league.summary_remakes'
- | 'league.summary_win_short'
- | 'league.swap'
- | 'league.tab_analysis'
- | 'league.tab_automation'
- | 'league.tab_coach'
- | 'league.tab_goals'
- | 'league.tab_history'
- | 'league.tab_live'
- | 'league.tab_meta'
- | 'league.tab_overview'
- | 'league.tab_profile'
- | 'league.tab_search'
- | 'league.tag_cold_streak'
- | 'league.tag_flash_swap'
- | 'league.tag_high_damage_efficiency'
- | 'league.tag_high_kda'
- | 'league.tag_high_winrate'
- | 'league.tag_hot_streak'
- | 'league.tag_low_damage_efficiency'
- | 'league.tag_low_kda'
- | 'league.tag_low_winrate'
- | 'league.tag_one_trick'
- | 'league.tiers_ban'
- | 'league.tiers_desc'
- | 'league.tiers_empty'
- | 'league.tiers_pick'
- | 'league.tiers_position'
- | 'league.tiers_title'
- | 'league.title_label'
- | 'league.title_none'
- | 'league.tokens_clear'
- | 'league.tokens_desc'
- | 'league.tokens_empty'
- | 'league.tokens_none'
- | 'league.tokens_saved'
- | 'league.tokens_search'
- | 'league.tokens_slot'
- | 'league.tokens_title'
- | 'league.unavailable_client'
- | 'league.unavailable_game'
- | 'league.unavailable_platform'
- | 'league.unranked'
- | 'league.victory'
- | 'league.wallet_be'
- | 'league.wallet_rp'
- | 'league.ward_roulette'
- | 'league.ward_roulette_desc'
- | 'league.win_allies'
- | 'league.win_disclaimer'
- | 'league.win_gap'
- | 'league.win_interval'
- | 'league.win_known'
- | 'league.win_title'
- | 'league.win_unavailable'
- | 'league.your_team'
- | 'league.zone_bot'
- | 'league.zone_mid'
- | 'league.zone_top'
-
| 'legal.acknowledge'
| 'legal.body_paragraph_1'
| 'legal.body_paragraph_2'
diff --git a/src/lib/i18n/lo.json b/src/lib/i18n/lo.json
index f6aa8cb3..75c13203 100644
--- a/src/lib/i18n/lo.json
+++ b/src/lib/i18n/lo.json
@@ -54,422 +54,6 @@
"nav_home": "ໄປໜ້າຫຼັກ",
"nav_downloads": "ໄປທີ່ການດາວໂຫຼດ"
},
- "league": {
- "cd_title": "ຄູລດາວນ໌ຂອງສັດຕູ",
- "cd_desc": "ຄູລດາວນ໌ພື້ນຖານຈາກຂໍ້ມູນແຊມປ້ຽນຂອງເກມເອງ, ຫານດ້ວຍ ability haste ຈາກໄອເທັມຂອງພວກເຂົາ. ລະດັບສະກິວປະເມີນຈາກເລເວວ, ສະນັ້ນຖືວ່າໃກ້ຄຽງ, ບໍ່ແມ່ນຄ່າທີ່ແນ່ນອນ.",
- "cd_estimated": "ປະເມີນ",
- "cd_haste": "haste",
- "col_gold_hint": "ຄຳທີ່ສະແດງແມ່ນມູນຄ່າໄອເທັມທີ່ຜູ້ຫຼິ້ນແຕ່ລະຄົນຖືຢູ່, ຄິດລາຄາຈາກຂໍ້ມູນໄອເທັມຂອງເກມເອງ — ເປັນຕົວເລກເສດຖະກິດດຽວທີ່ເຫັນໄດ້ຂອງຜູ້ຫຼິ້ນອື່ນ.",
- "scout_no_history": "ບໍ່ມີເກມຫຼ້າສຸດ",
- "build_title": "ບິວໄອເທັມ",
- "build_desc": "ສ້າງຈາກເກມຂອງແຊມປ້ຽນນີ້ໃນແມັດຫຼ້າສຸດຂອງທ່ານເອງ — ບໍ່ໃຊ້ເວັບໄຊບິວຂອງພາກສ່ວນທີສາມ, ສະນັ້ນຕົວຢ່າງມີໜ້ອຍ ແລະ ບອກຕາມຈິງ.",
- "build_champion": "ເລືອກແຊມປ້ຽນ",
- "build_samples": "ເກມທີ່ພົບ",
- "meta_reference": "ບິວອ້າງອີງ",
- "meta_source": "ລວບລວມຈາກຂໍ້ມູນສາທາລະນະຂອງ op.gg ສຳລັບແພັດປັດຈຸບັນ. ສະແດງເພື່ອອ້າງອີງ; ບໍ່ມີຫຍັງຖືກນຳໃຊ້ອັດຕະໂນມັດ.",
- "skill_priority": "ລຳດັບສະກິວ",
- "items_starter": "ໄອເທັມເລີ່ມຕົ້ນ",
- "items_core": "ໄອເທັມຫຼັກ",
- "items_boots": "ເກີບ",
- "items_last": "ໄອເທັມທ້າຍເກມ",
- "counters": "ຫຼິ້ນຍາກເມື່ອພົບ",
- "runes_full": "ໜ້າຣູນຂອງທ່ານເຕັມແລ້ວ. ລຶບໜ້າໜຶ່ງໃນໄຄລເອັນເພື່ອໃຫ້ OmniGet ສ້າງໜ້າຂອງມັນ.",
- "build_empty": "ຍັງບໍ່ມີເກມກັບແຊມປ້ຽນນີ້ໃນຕົວຢ່າງ.",
- "tab_meta": "ເມຕາ",
- "runes_title": "ຣູນ",
- "runes_desc": "ໜ້າຣູນ ແລະ ສະເປວທີ່ໄຄລເອັນເກມແນະນຳສຳລັບແຊມປ້ຽນທີ່ທ່ານລັອກ, ສະນັ້ນກົງກັບແພັດປັດຈຸບັນສະເໝີ.",
- "runes_auto": "ນຳໃຊ້ຣູນອັດຕະໂນມັດ",
- "runes_auto_desc": "ເມື່ອທ່ານລັອກແຊມປ້ຽນ, ໜ້າທີ່ແນະນຳອັນທຳອິດຈະຖືກສ້າງ ແລະ ເລືອກໃຫ້ທ່ານ.",
- "runes_apply": "ນຳໃຊ້",
- "runes_default": "ຄ່າເລີ່ມຕົ້ນ",
- "runes_spells": "ສະເປວ",
- "runes_empty": "ລັອກແຊມປ້ຽນໃນໜ້າເລືອກແຊມປ້ຽນເພື່ອເບິ່ງໜ້າທີ່ແນະນຳ.",
- "tiers_title": "ລະດັບແຊມປ້ຽນ",
- "tiers_desc": "ຈັດອັນດັບຕາມຕຳແໜ່ງ, ພ້ອມອັດຕາຊະນະ, ເລືອກ ແລະ ແບນ. ຂໍ້ມູນຈາກ op.gg.",
- "tiers_position": "ຕຳແໜ່ງ",
- "tiers_pick": "ເລືອກ",
- "tiers_ban": "ແບນ",
- "tiers_empty": "ຕອນນີ້ບໍ່ມີລາຍການລະດັບ.",
- "impact_label": "ຜົນກະທົບ",
- "score_label": "ຄະແນນ",
- "score_hint": "ຄ່າສະເລ່ຍຂອງເກມແຣງ ແລະ ເກມທຳມະດາຫຼ້າສຸດ. ຊ່ອນໄວ້ຖ້າມີໜ້ອຍກວ່າຫ້າເກມທີ່ໃຊ້ໄດ້.",
- "copy_riot_id": "ສຳເນົາ Riot ID",
- "impact_hint": "ລວມ KDA, ການມີສ່ວນຮ່ວມໃນການຂ້າ, ຄວາມເສຍຫາຍ, ຄວາມເສຍຫາຍທີ່ໄດ້ຮັບ, ຄຳ, ວິໄສທັດ ແລະ ສ່ວນແບ່ງ CS, ໃຫ້ຄະແນນ 0-10",
- "tab_search": "ຄົ້ນຫາ",
- "search_title": "ຊອກຫາຜູ້ຫຼິ້ນ",
- "search_placeholder": "Riot ID, ເຊັ່ນ Faker#KR1",
- "search_button": "ຄົ້ນຫາ",
- "searching_player": "ກຳລັງຄົ້ນຫາ…",
- "search_hint": "ພິມ Riot ID ພ້ອມແທັກເພື່ອເບິ່ງແຣງ, ຟອມຫຼ້າສຸດ ແລະ ສະຖິຕິແຊມປ້ຽນ.",
- "search_recent": "ຟອມຫຼ້າສຸດ",
- "search_champions": "ແຊມປ້ຽນ",
- "search_champions_hint": "2+ ເກມ, ຫຼິ້ນຫຼາຍທີ່ສຸດກ່ອນ",
- "search_mastery": "ຄວາມຊຳນານ",
- "stat_winrate": "ອັດຕາຊະນະ",
- "games_short": "ເກມ",
- "duos_title": "ຄູ່ດູໂອທີ່ດີທີ່ສຸດ",
- "duos_desc": "ເພື່ອນຮ່ວມທີມທີ່ທ່ານຊະນະນຳຫຼາຍທີ່ສຸດ, ຈາກເກມຫຼ້າສຸດຂອງທ່ານ. ຄະແນນຈະຫຼຸດລົງສຳລັບຕົວຢ່າງນ້ອຍ ເພື່ອບໍ່ໃຫ້ຄູ່ທີ່ໂຊກດີສອງເກມຂຶ້ນອັນດັບຕົ້ນ.",
- "duos_empty": "ຍັງບໍ່ມີເພື່ອນຮ່ວມທີມທີ່ຊ້ຳກັນໃນຕົວຢ່າງ.",
- "duos_score": "ຄະແນນ",
- "jungle_title": "ເສັ້ນທາງປ່າຊ່ວງຕົ້ນເກມ",
- "jungle_empty": "ບໍ່ມີຂໍ້ມູນໄທມ໌ລາຍສຳລັບເກມເຫຼົ່ານີ້.",
- "jungle_invade": "ບຸກປ່າ",
- "jungle_gank3": "ແກັງເລເວວ 3",
- "zone_top": "Top",
- "zone_mid": "Mid",
- "zone_bot": "Bot",
- "pref_top": "ເນັ້ນ top",
- "pref_mid": "ເນັ້ນ mid",
- "pref_bot": "ເນັ້ນ bot",
- "pref_top_mid": "ເນັ້ນ top ແລະ mid",
- "pref_mid_bot": "ເນັ້ນ mid ແລະ bot",
- "pref_balanced": "ເສັ້ນທາງສົມດຸນ",
- "pref_unknown": "ຂໍ້ມູນບໍ່ພຽງພໍ",
- "chat_placeholder": "ຂໍ້ຄວາມທີ່ຈະສົ່ງໃນໜ້າເລືອກແຊມປ້ຽນ",
- "chat_build": "ສະຫຼຸບບິວ",
- "chat_send": "ສົ່ງ",
- "tab_overview": "ພາບລວມ",
- "tab_analysis": "ການວິເຄາະ",
- "tab_live": "ສົດ",
- "tab_goals": "ເປົ້າໝາຍ",
- "tab_automation": "ອັດຕະໂນມັດ",
- "tab_history": "ປະຫວັດ",
- "win_title": "ໂອກາດຊະນະ",
- "win_allies": "ທີມຂອງທ່ານ",
- "win_interval": "ຊ່ວງ 90%",
- "win_gap": "ຄວາມຕ່າງຂອງເຣດຕິ້ງ",
- "win_known": "ຜູ້ຫຼິ້ນທີ່ມີຂໍ້ມູນ",
- "win_disclaimer": "ລະບົບຈັບຄູ່ສ້າງເກມໂດຍຄາດໝາຍ 50%, ສະນັ້ນການປະເມີນທີ່ຊື່ສັດຈະໃກ້ຄຽງກັນ. ຖືວ່າເປັນແນວໂນ້ມ, ບໍ່ແມ່ນຄຳຕັດສິນ.",
- "win_unavailable": "ໃຊ້ໄດ້ໃນໜ້າເລືອກແຊມປ້ຽນ ແລະ ໃນເກມ.",
- "premades": "ກຸ່ມພຣີເມດ",
- "premade_source_party": "ລາຍງານໂດຍເກມ",
- "premade_source_history": "ປະເມີນຈາກປະຫວັດຮ່ວມກັນ",
- "players": "ຜູ້ຫຼິ້ນ",
- "objectives_title": "ເປົ້າໝາຍ ແລະ ເຫດການ",
- "objectives_estimate": "ຊ່ວງເວລາເກີດໃໝ່ເປັນການປະເມີນຕາມແພັດປັດຈຸບັນ, ບໍ່ແມ່ນຄ່າທີ່ເກມລາຍງານ.",
- "objective_baron": "Baron",
- "objective_dragon": "Dragon",
- "objective_inhibitor": "Inhibitor",
- "event_kill": "ຂ້າ:",
- "event_turret": "ປ້ອມຖືກທຳລາຍ:",
- "event_inhib": "Inhibitor ຖືກທຳລາຍ:",
- "event_dragon": "Dragon ຖືກເອົາໂດຍ",
- "event_baron": "Baron ຖືກເອົາໂດຍ",
- "event_herald": "Herald ຖືກເອົາໂດຍ",
- "event_multikill": "ມັລຕິຄິວ:",
- "event_ace": "Ace ໂດຍ",
- "event_first_turret": "ປ້ອມທຳອິດ:",
- "event_first_blood": "ເລືອດທຳອິດ:",
- "gold_title": "ເສດຖະກິດສົດ",
- "gold_unavailable": "ເປີດເກມເພື່ອເບິ່ງຄຳ ແລະ ຄວາມຕ່າງໃນເລນແບບສົດ.",
- "your_team": "ທີມຂອງທ່ານ",
- "enemy_team": "ທີມສັດຕູ",
- "col_player": "ຜູ້ຫຼິ້ນ",
- "col_gold": "ຄຳ",
- "col_diff": "ທຽບກັບຄູ່ແຂ່ງໃນເລນ",
- "goals_live": "ເປົ້າໝາຍຂອງທ່ານໃນເກມນີ້",
- "goals_title": "ເປົ້າໝາຍຜົນງານ",
- "goals_role": "ຕຳແໜ່ງ",
- "goals_desc": "ເປົ້າໝາຍຕໍ່ຕຳແໜ່ງ, ໃຊ້ໃຫ້ຄະແນນເກມສົດຂອງທ່ານ. ປັບໃຫ້ເໝາະກັບລະດັບຂອງທ່ານ.",
- "goals_reset": "ຣີເຊັດເປັນຄ່າເລີ່ມຕົ້ນ",
- "goal_cs": "CS ຕໍ່ນາທີ",
- "goal_gold": "ຄຳຕໍ່ນາທີ",
- "goal_kda": "KDA",
- "goal_vision": "ວິໄສທັດຕໍ່ນາທີ",
- "role_top": "Top",
- "role_jungle": "Jungle",
- "role_middle": "Mid",
- "role_bottom": "Bot",
- "role_utility": "Support",
- "role_fill": "Fill",
- "role_preference": "ຕຳແໜ່ງທີ່ຕ້ອງການ",
- "role_first": "ຕຳແໜ່ງຫຼັກ",
- "role_second": "ຕຳແໜ່ງສຳຮອງ",
- "scout_title": "ສອດແນມແມັດ",
- "scout_allies": "ພັນທະມິດ",
- "scout_enemies": "ສັດຕູ",
- "scout_enemies_hidden": "ສັດຕູຈະເປີດເຜີຍເມື່ອເກມເລີ່ມ.",
- "scout_note_placeholder": "ບັນທຶກສ່ວນຕົວກ່ຽວກັບຜູ້ຫຼິ້ນນີ້…",
- "marked_in_allies": "ທ່ານມີບັນທຶກຢູ່ຝ່າຍທ່ານ:",
- "marked_in_enemies": "ທ່ານມີບັນທຶກຢູ່ຝ່າຍສັດຕູ:",
- "squad_enemy": "ສັດຕູທັງຫ້າຄົນເຂົ້າຄິວນຳກັນ ແລະ ທຸກໂປຣໄຟລ໌ຖືກຊ່ອນ.",
- "squad_ally": "ພວກທ່ານທັງຫ້າຄົນເຂົ້າຄິວນຳກັນ ແລະ ທຸກໂປຣໄຟລ໌ຖືກຊ່ອນ.",
- "scout_private": "ໂປຣໄຟລ໌ສ່ວນຕົວ",
- "tag_hot_streak": "ຊະນະຕິດຕໍ່",
- "tag_cold_streak": "ແພ້ຕິດຕໍ່",
- "tag_high_winrate": "ອັດຕາຊະນະສູງ",
- "tag_low_winrate": "ອັດຕາຊະນະຕ່ຳ",
- "tag_one_trick": "ຫຼິ້ນຕົວດຽວ",
- "tag_high_kda": "KDA ສູງ",
- "tag_low_kda": "KDA ຕ່ຳ",
- "lobby_title": "ຫຼິ້ນ",
- "lobby_hint": "ການດຳເນີນການໃນລັອບບີ້ຈະສະແດງຢູ່ນີ້ເມື່ອໄຄລເອັນພ້ອມ.",
- "searching": "ກຳລັງຊອກຫາແມັດ…",
- "start_queue": "ຊອກຫາແມັດ",
- "stop_queue": "ຍົກເລີກການຊອກຫາ",
- "leave_lobby": "ອອກຈາກລັອບບີ້",
- "play_again": "ຫຼິ້ນອີກຄັ້ງ",
- "champ_select_title": "ເລືອກແຊມປ້ຽນ",
- "bench_title": "ບ່ອນນັ່ງສຳຮອງ",
- "reroll": "ສຸ່ມໃໝ່",
- "reroll_keep": "ສຸ່ມໃໝ່, ເກັບແຊມປ້ຽນໄວ້",
- "reroll_keep_hint": "ໃຊ້ການສຸ່ມໃໝ່ເພື່ອເພີ່ມຕົວເລືອກໃນບ່ອນນັ່ງສຳຮອງ ແລ້ວສະຫຼັບແຊມປ້ຽນປັດຈຸບັນກັບຄືນມາ.",
- "swap": "ສະຫຼັບເປັນ",
- "remove": "ເອົາອອກ",
- "live_title": "ເກມສົດ",
- "respawn_in": "ເກີດໃໝ່ໃນ",
- "automation_title": "ອັດຕະໂນມັດ",
- "notify_ready": "ແຈ້ງເຕືອນເມື່ອພົບແມັດ",
- "notify_ready_desc": "ສົ່ງການແຈ້ງເຕືອນເດັສທັອບສະເພາະເມື່ອໜ້າຕ່າງ OmniGet ບໍ່ໄດ້ຢູ່ດ້ານໜ້າ.",
- "auto_pick": "ເລືອກອັດຕະໂນມັດ",
- "auto_pick_desc": "ເລືອກແຊມປ້ຽນທຳອິດທີ່ມີໃນລາຍການຂອງທ່ານເມື່ອຮອດຕາທ່ານ.",
- "auto_ban": "ແບນອັດຕະໂນມັດ",
- "auto_ban_desc": "ແບນແຊມປ້ຽນທຳອິດທີ່ມີໃນລາຍການແບນຂອງທ່ານ.",
- "pick_confirm": "ວິທີສຳເລັດການເລືອກ",
- "pick_confirm_desc": "ການປະກາດຈະສະແດງແຊມປ້ຽນຂອງທ່ານໃຫ້ທີມເຫັນໂດຍບໍ່ຕັດສິນໃຈແທນທ່ານ.",
- "pick_confirm_declare": "ປະກາດເທົ່ານັ້ນ",
- "pick_confirm_timeout": "ລັອກຕອນໝົດເວລາ",
- "pick_confirm_immediate": "ລັອກທັນທີ",
- "auto_lock": "ລັອກອັດຕະໂນມັດ",
- "auto_lock_desc": "ປິດ = ສະແດງພຽງຄວາມຕັ້ງໃຈ; ທ່ານຍັງຕ້ອງຢືນຢັນການເລືອກເອງ.",
- "auto_honor": "ໃຫ້ Honor ອັດຕະໂນມັດ",
- "auto_honor_desc": "ໃຫ້ Honor ເພື່ອນຮ່ວມທີມຫຼັງເກມ, ເລືອກຄົນທີ່ທ່ານເຂົ້າຄິວນຳກ່ອນ.",
- "auto_play_again": "ຫຼິ້ນອີກຄັ້ງອັດຕະໂນມັດ",
- "auto_play_again_desc": "ກັບຄືນລັອບບີ້ທັນທີເມື່ອໜ້າຈໍຈົບເກມປາກົດ.",
- "auto_requeue": "ຊອກຫາອີກຄັ້ງທັນທີ",
- "auto_requeue_desc": "ເລີ່ມຊອກຫາເມື່ອກັບຄືນລັອບບີ້, ສະເພາະເມື່ອທ່ານເປັນຫົວໜ້າລັອບບີ້.",
- "auto_swaps": "ຮັບການສະຫຼັບຕຳແໜ່ງ ແລະ ລຳດັບການເລືອກ",
- "auto_swaps_desc": "ຮັບຄຳຂໍຈາກເພື່ອນຮ່ວມທີມທີ່ຕ້ອງການແລກຕຳແໜ່ງ ຫຼື ລຳດັບການເລືອກໃນໜ້າເລືອກແຊມປ້ຽນ.",
- "auto_reconnect": "ເຊື່ອມຕໍ່ຄືນອັດຕະໂນມັດ",
- "auto_reconnect_desc": "ເຂົ້າເກມຄືນອັດຕະໂນມັດຖ້າໄຄລເອັນຂາດການເຊື່ອມຕໍ່.",
- "spectate": "ເບິ່ງເກມ",
- "spectate_loading": "ກຳລັງເປີດໂໝດຜູ້ຊົມ…",
- "spectate_not_in_game": "ຜູ້ຫຼິ້ນນີ້ບໍ່ໄດ້ຢູ່ໃນເກມຕອນນີ້.",
- "dodge": "ດອດຈ໌",
- "dodge_warning": "ການອອກຕອນນີ້ນັບເປັນການດອດຈ໌: ທ່ານຈະເສຍ LP ແລະ ຖືກຈຳກັດເວລາເຂົ້າຄິວ.",
- "dodge_confirm": "ດອດຈ໌ເລີຍ",
- "unavailable_platform": "ບໍ່ຮອງຮັບໃນລະບົບນີ້.",
- "unavailable_client": "ເປີດໄຄລເອັນ League of Legends ເພື່ອໃຊ້ຟີເຈີນີ້.",
- "unavailable_game": "ໃຊ້ໄດ້ໃນຂະນະທີ່ແມັດກຳລັງດຳເນີນຢູ່.",
- "badge_beta": "ເບຕ້າ",
- "badge_experimental": "ທົດລອງ",
- "profile_tools": "ປັບແຕ່ງໂປຣໄຟລ໌",
- "profile_icon": "ໄອຄອນຊຳມອນເນີ",
- "profile_icon_saved": "ອັບເດດໄອຄອນແລ້ວ.",
- "profile_status": "ສະຖານະ",
- "profile_status_saved": "ອັບເດດສະຖານະແລ້ວ.",
- "status_chat": "ອອນລາຍ",
- "status_away": "ບໍ່ຢູ່",
- "status_dnd": "ບໍ່ຫວ່າງ",
- "profile_message": "ຂໍ້ຄວາມສະຖານະ",
- "profile_message_saved": "ອັບເດດຂໍ້ຄວາມສະຖານະແລ້ວ.",
- "profile_background": "ພື້ນຫຼັງໂປຣໄຟລ໌",
- "profile_background_saved": "ອັບເດດພື້ນຫຼັງແລ້ວ.",
- "profile_no_skins": "ບໍ່ມີສະກິນຂອງແຊມປ້ຽນນີ້.",
- "apply": "ນຳໃຊ້",
- "restart_ux": "ຣີສະຕາດອິນເຕີເຟດໄຄລເອັນ",
- "restart_ux_warning": "ໂຫຼດອິນເຕີເຟດຂອງໄຄລເອັນຄືນໃໝ່. ບ່ອນໃນຄິວ ແລະ ການເລືອກແຊມປ້ຽນຈະຍັງຄົງຢູ່.",
- "restart_ux_confirm": "ຣີສະຕາດອິນເຕີເຟດ",
- "dodge_cancel": "ຢູ່ຕໍ່",
- "auto_trade": "ການແລກແຊມປ້ຽນ",
- "auto_trade_desc": "ວິທີຕອບຄຳຂໍແລກຈາກເພື່ອນຮ່ວມທີມໃນໜ້າເລືອກແຊມປ້ຽນ.",
- "auto_trade_off": "ຖາມຂ້ອຍ",
- "auto_trade_accept": "ຮັບທັງໝົດ",
- "auto_trade_decline": "ປະຕິເສດທັງໝົດ",
- "auto_message": "ຄຳທັກທາຍໃນໜ້າເລືອກແຊມປ້ຽນ",
- "auto_message_desc": "ສົ່ງເທື່ອດຽວໄປທີ່ແຊັດທີມເມື່ອເລີ່ມເລືອກແຊມປ້ຽນ. ປ່ອຍວ່າງເພື່ອປິດໃຊ້.",
- "auto_message_placeholder": "ເຊັ່ນ glhf :)",
- "tag_flash_swap": "ປຸ່ມ Flash ບໍ່ຄົງທີ່",
- "tag_high_damage_efficiency": "ຄວາມເສຍຫາຍຕໍ່ຄຳສູງ",
- "tag_low_damage_efficiency": "ຄວາມເສຍຫາຍຕໍ່ຄຳຕ່ຳ",
- "solo_kills_label": "ໂຊໂລຄິວ/ເກມ",
- "early_deaths_label": "ຕາຍກ່ອນ 15 ນາທີ/ເກມ",
- "seen_before": "ເຄີຍພົບ",
- "seen_before_hint": "ທ່ານເຄີຍຫຼິ້ນນຳ ຫຼື ຫຼິ້ນຕ້ານຜູ້ຫຼິ້ນນີ້ມາກ່ອນ.",
- "spell_timer_hint": "ຄລິກເມື່ອສະເປວຖືກໃຊ້ເພື່ອເລີ່ມຈັບເວລາ.",
- "obj_towers": "ປ້ອມ",
- "obj_inhibitors": "Inhibitor",
- "obj_heralds": "Herald",
- "obj_bans": "ແບນ",
- "open_player": "ເບິ່ງແມັດຫຼ້າສຸດຂອງຜູ້ຫຼິ້ນນີ້",
- "close": "ປິດ",
- "stat_level": "Lv",
- "stat_damage": "ສ້າງ",
- "stat_taken": "ໄດ້ຮັບ",
- "stat_mitigated": "ຫຼຸດຜ່ອນ",
- "stat_healing": "ຮັກສາ",
- "stat_objectives": "ເປົ້າໝາຍ",
- "stat_gold_min": "ຄຳ/ນາທີ",
- "stat_cs_min": "CS/ນາທີ",
- "stat_vision": "ວິໄສທັດ",
- "stat_wards": "ວອດ ວາງ/ທຳລາຍ/ຄວບຄຸມ",
- "stat_cc": "CC",
- "stat_spree": "ຂ້າຕິດຕໍ່ສູງສຸດ",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "ເລືອດທຳອິດ",
- "stat_first_tower": "ປ້ອມທຳອິດ",
- "match_damage": "dmg",
- "match_detail_unavailable": "ບໍ່ມີລາຍລະອຽດແມັດ.",
- "pick_list": "ລຳດັບການເລືອກ",
- "ban_delay": "ລໍຖ້າກ່ອນແບນ",
- "ban_delay_desc": "ລໍຖ້າຈັກໜ່ອຍກ່ອນແບນ ແລະ ຂ້າມແຊມປ້ຽນທີ່ເພື່ອນຮ່ວມທີມປະກາດແລ້ວ.",
- "ban_list": "ລຳດັບການແບນ",
- "list_hint": "ລຳດັບມີຜົນ",
- "search_champion": "ຄົ້ນຫາແຊມປ້ຽນ…",
- "phase_lobby": "ຢູ່ໃນລັອບບີ້",
- "phase_matchmaking": "ຢູ່ໃນຄິວ",
- "phase_ready_check": "ພົບແມັດແລ້ວ!",
- "phase_champ_select": "ເລືອກແຊມປ້ຽນ",
- "phase_in_progress": "ຢູ່ໃນເກມ",
- "phase_end_of_game": "ຈົບເກມ",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "ເມນູໄຄລເອັນ League ແບບເລືອກໄດ້. ປິດໄວ້ຕາມຄ່າເລີ່ມຕົ້ນ.",
- "settings_enable": "ເປີດໃຊ້ເມນູ League",
- "settings_enable_desc": "ເພີ່ມເມນູ League of Legends ພ້ອມເຄື່ອງມືໄຄລເອັນ. ຕ້ອງເປີດໄຄລເອັນ League ໄວ້.",
- "settings_auto_accept": "ຮັບແມັດອັດຕະໂນມັດ",
- "settings_auto_accept_desc": "ຮັບການກວດຄວາມພ້ອມອັດຕະໂນມັດເມື່ອພົບແມັດ.",
- "disabled_title": "ເມນູ League ຖືກປິດຢູ່",
- "disabled_body": "ເປີດໃຊ້ໄດ້ທີ່ ການຕັ້ງຄ່າ → ຂັ້ນສູງ → League of Legends. ບໍ່ມີຫຍັງເຮັດວຽກຈົນກວ່າທ່ານຈະເປີດ.",
- "open_settings": "ເປີດການຕັ້ງຄ່າ",
- "connected": "ເຊື່ອມຕໍ່ແລ້ວ",
- "disconnected_title": "ບໍ່ພົບໄຄລເອັນ",
- "disconnected_body": "ເປີດໄຄລເອັນ League of Legends ແລ້ວໜ້ານີ້ຈະເຊື່ອມຕໍ່ອັດຕະໂນມັດ.",
- "level": "ເລເວວ",
- "phase_label": "ສະຖານະໄຄລເອັນ",
- "accept_now": "ຮັບແມັດ",
- "auto_accept": "ຮັບແມັດອັດຕະໂນມັດ",
- "auto_accept_desc": "ຮັບການກວດຄວາມພ້ອມໃຫ້ທ່ານທັນທີທີ່ພົບແມັດ.",
- "accept_delay": "ລໍຖ້າກ່ອນຮັບ",
- "accept_delay_instant": "ທັນທີ",
- "accept_delay_desc": "ໃຫ້ເວລາທ່ານຈັກໜ່ອຍເພື່ອປະຕິເສດເອງ. ການປະຕິເສດໃນຊ່ວງລໍຖ້າຈະຍົກເລີກການຮັບອັດຕະໂນມັດ.",
- "ranked_solo": "Ranked Solo/Duo",
- "ranked_flex": "Ranked Flex",
- "unranked": "ບໍ່ມີແຣງ",
- "history_title": "ແມັດຫຼ້າສຸດ",
- "filter_queue": "ກັ່ນຕອງຕາມຄິວ",
- "filter_all": "ທັງໝົດ",
- "summary_games": "ເກມ",
- "summary_win_short": "ຊ",
- "summary_loss_short": "ພ",
- "summary_remakes": "ບໍ່ນັບເກມ remake",
- "history_empty": "ຍັງບໍ່ພົບແມັດ.",
- "refresh": "ໂຫຼດຄືນ",
- "victory": "ຊະນະ",
- "defeat": "ແພ້",
- "tab_profile": "ໂປຣໄຟລ໌",
- "tab_coach": "ໂຄ້ຊ",
- "profile_title": "ຕົວແກ້ໄຂໂປຣໄຟລ໌",
- "profile_desc": "ທຸກຢ່າງທີ່ໄຄລເອັນອະນຸຍາດໃຫ້ປ່ຽນກ່ຽວກັບຮູບລັກຂອງທ່ານຕໍ່ຄົນອື່ນ. ບໍ່ມີຫຍັງຢູ່ນີ້ແຕະຕ້ອງເກມເອງ.",
- "profile_section_presence": "ການສະແດງຕົນ",
- "status_offline": "ອອບລາຍ",
- "status_mobile": "ມືຖື",
- "profile_message_hint": "ສູງສຸດ 255 ຕົວອັກສອນ. ກ່ອງຂອງໄຄລເອັນເອງຈຳກັດທີ່ 140.",
- "profile_section_icon": "ໄອຄອນ",
- "profile_icon_search": "ຄົ້ນຫາໄອຄອນຕາມຊື່ ຫຼື id",
- "profile_icon_chat": "ໄອຄອນແຊັດ",
- "profile_icon_chat_saved": "ອັບເດດໄອຄອນແຊັດແລ້ວ",
- "profile_icon_hint": "ໄອຄອນໂປຣໄຟລ໌ຕ້ອງເປັນຂອງທ່ານ. ໄອຄອນແຊັດ (hovercard ແລະ ລາຍຊື່ໝູ່) ໃຊ້ໄອຄອນໃດກໍໄດ້.",
- "profile_section_rank": "ແຣງທີ່ສະແດງໃນແຊັດ",
- "rank_queue": "ຄິວ",
- "rank_tier": "ລະດັບ",
- "rank_division": "ດິວິຊັນ",
- "rank_reset": "ກູ້ຄືນແຣງຈິງ",
- "rank_saved": "ອັບເດດແຣງໃນແຊັດແລ້ວ",
- "rank_hint": "ປ່ຽນສະເພາະ hovercard ແລະ ບັດໂຊຊຽວ. ອັນດັບແຣງຂອງທ່ານບໍ່ຖືກແຕະຕ້ອງ.",
- "crystal_title": "ຄຣິສຕັລຊາເລນ",
- "crystal_level": "ລະດັບ",
- "crystal_points": "ຄະແນນ",
- "crystal_saved": "ອັບເດດຄຣິສຕັລແລ້ວ",
- "tokens_title": "ຫຼຽນ, ຕຳແໜ່ງ ແລະ ແບນເນີ",
- "tokens_desc": "ເລືອກຫຼຽນຊາເລນໄດ້ສູງສຸດສາມອັນສຳລັບໂປຣໄຟລ໌ຂອງທ່ານ. ຫຼຽນດຽວກັນໃສ່ໄດ້ທຸກຊ່ອງ.",
- "tokens_slot": "ຊ່ອງ",
- "tokens_empty": "ຍັງບໍ່ໄດ້ຮັບຫຼຽນ",
- "tokens_none": "ບໍ່ມີ",
- "tokens_clear": "ລ້າງ",
- "tokens_saved": "ອັບເດດການຕັ້ງຄ່າໂປຣໄຟລ໌ແລ້ວ",
- "tokens_search": "ກັ່ນຕອງຫຼຽນ",
- "title_label": "ຕຳແໜ່ງ",
- "title_none": "ບໍ່ມີຕຳແໜ່ງ",
- "banner_label": "ແບນເນີ",
- "banner_none": "ບໍ່ມີແບນເນີ",
- "friends_title": "ໝູ່",
- "friends_desc": "ໂຫຼດລາຍຊື່, ໝາຍຄົນທີ່ຈະເອົາອອກ, ແລ້ວຢືນຢັນ. ການເອົາອອກເປັນການຖາວອນ.",
- "friends_load": "ໂຫຼດ",
- "friends_select_all": "ເລືອກທີ່ສະແດງຢູ່",
- "friends_clear_selection": "ລ້າງການເລືອກ",
- "friends_remove": "ເອົາທີ່ເລືອກອອກ",
- "friends_remove_confirm": "ພວກເຂົາຈະຖືກເອົາອອກຈາກລາຍຊື່ໝູ່ຂອງທ່ານຖາວອນ.",
- "friends_remove_go": "ເອົາອອກ",
- "friends_removed": "ເອົາອອກແລ້ວ",
- "friends_count": "ໝູ່",
- "wallet_rp": "RP",
- "wallet_be": "Blue Essence",
- "raffle_title": "ສຸ່ມ",
- "raffle_lane": "ສຸ່ມເລນ",
- "raffle_lane_apply": "ໃຊ້ເປັນຕຳແໜ່ງທີ່ຕ້ອງການ",
- "raffle_champion": "ສຸ່ມແຊມປ້ຽນ",
- "raffle_class_any": "ທຸກຄລາສ",
- "raffle_class_fighter": "Fighter",
- "raffle_class_mage": "Mage",
- "raffle_class_assassin": "Assassin",
- "raffle_class_marksman": "Marksman",
- "raffle_class_support": "Support",
- "raffle_class_tank": "Tank",
- "raffle_declare": "ປະກາດ",
- "raffle_lock": "ລັອກ",
- "raffle_again": "ສຸ່ມອີກຄັ້ງ",
- "raffle_pool": "ແຊມປ້ຽນໃນກຸ່ມສຸ່ມ",
- "skin_title": "ສຸ່ມສະກິນ",
- "skin_roll": "ສຸ່ມສະກິນ",
- "skin_roll_ward": "ສຸ່ມວອດ",
- "skin_rolled": "ສຸ່ມໄດ້",
- "skin_lock_first": "ລັອກແຊມປ້ຽນກ່ອນ",
- "pick_random": "ແຊມປ້ຽນແບບສຸ່ມ",
- "pick_random_desc": "ບໍ່ສົນລາຍການ ແລະ ລັອກແຊມປ້ຽນທີ່ເລືອກໄດ້ແບບສຸ່ມ, ລວມທັງໃນແຣງ. ຫຼີກລ່ຽງແຊມປ້ຽນທີ່ເພື່ອນຮ່ວມທີມກຳລັງເລືອກ.",
- "skin_roulette": "ສຸ່ມສະກິນ",
- "skin_roulette_desc": "ທັນທີທີ່ທ່ານລັອກແຊມປ້ຽນ, ສະກິນ ແລະ ໂຄຣມາທີ່ທ່ານມີຈະຖືກສຸ່ມນຳໃຊ້. ຂ້າມອັນທີ່ສຸ່ມໄດ້ບໍ່ດົນມານີ້.",
- "skin_include_base": "ລວມສະກິນພື້ນຖານ",
- "ward_roulette": "ສຸ່ມວອດ",
- "ward_roulette_desc": "ສຸ່ມສະກິນວອດທີ່ທ່ານມີເມື່ອລັອກນຳ.",
- "sgp_enabled": "ຂໍ້ມູນຈາກເຊີບເວີ (SGP)",
- "sgp_enabled_desc": "ເມື່ອປະຫວັດໃນເຄື່ອງຂອງໄຄລເອັນມີໜ້ອຍ ຫຼື ຖືກຊ່ອນ, ຈະຂໍຈາກເຊີບເວີຂອງ Riot ໂດຍກົງດ້ວຍໂທເຄັນຂອງໄຄລເອັນເອງ. ຍັງເປີດໃຊ້ການດາວໂຫຼດຣີເພລນຳ.",
- "coach_title": "ໂຄ້ຊ AI",
- "coach_desc": "ໂມເດວ AI ທີ່ທ່ານຕັ້ງຄ່າໄວ້ຈະອ່ານຂໍ້ມູນແມັດຂອງທ່ານ ພ້ອມຂໍ້ມູນເມຕາຈາກ OP.GG ແລ້ວຕອບແບບໂຄ້ຊ.",
- "coach_not_configured": "ຕັ້ງຄ່າຜູ້ໃຫ້ບໍລິການ AI ກ່ອນ.",
- "coach_open_settings": "ເປີດການຕັ້ງຄ່າ",
- "coach_style": "ນ້ຳສຽງ",
- "coach_style_objective": "ເປັນກາງ",
- "coach_style_roast": "ແຊວແຮງ",
- "coach_style_praise": "ໃຫ້ກຳລັງໃຈ",
- "coach_review_title": "ທົບທວນເກມ",
- "coach_review_pick": "ເລືອກເກມຫຼ້າສຸດ",
- "coach_review_run": "ທົບທວນ",
- "coach_trends_title": "ແນວໂນ້ມ",
- "coach_trends_games": "ເກມ",
- "coach_trends_run": "ວິເຄາະ",
- "coach_ask_title": "ຖາມໂຄ້ຊ",
- "coach_ask_placeholder": "ຖາມຫຍັງກໍໄດ້ກ່ຽວກັບດຣາຟປັດຈຸບັນ, ເກມ ຫຼື ຟອມຫຼ້າສຸດຂອງທ່ານ",
- "coach_ask_run": "ຖາມ",
- "coach_quick_draft": "ວິເຄາະດຣາຟນີ້ ແລະ ໃຫ້ແຜນແກ່ຂ້ອຍ",
- "coach_quick_early": "10 ນາທີທຳອິດຂອງຂ້ອຍຄວນເປັນແນວໃດ?",
- "coach_quick_now": "ຕອນນີ້ຂ້ອຍຄວນເຮັດຫຍັງ?",
- "coach_quick_improve": "ຂ້ອຍຄວນແກ້ໄຂຫຍັງກ່ອນ?",
- "coach_working": "ກຳລັງຄິດ…",
- "coach_result": "ໂຄ້ຊ",
- "coach_copy": "ສຳເນົາ",
- "coach_copied": "ສຳເນົາແລ້ວ",
- "coach_error_no_games": "ບໍ່ມີເກມຫຼ້າສຸດໃຫ້ວິເຄາະ",
- "coach_privacy": "ຂໍ້ມູນແມັດ ແລະ ຂໍ້ມູນເມຕາຈາກ OP.GG (ເມື່ອກ່ຽວຂ້ອງ) ຈະຖືກສົ່ງໄປຫາຜູ້ໃຫ້ບໍລິການ AI ທີ່ທ່ານຕັ້ງຄ່າໄວ້.",
- "replay_download": "ດາວໂຫຼດຣີເພລ",
- "replay_downloading": "ກຳລັງດາວໂຫຼດ…",
- "replay_saved": "ບັນທຶກຣີເພລໄວ້ທີ່",
- "review_ai": "ທົບທວນດ້ວຍ AI",
- "history_source_sgp": "ຜ່ານເຊີບເວີ",
- "search_source_sgp": "ດຶງປະຫວັດຈາກເຊີບເວີຂອງ Riot (SGP), ເພາະໄຄລເອັນຊ່ອນໄວ້."
- },
"nav": {
"home": "ໜ້າຫຼັກ",
"downloads": "ການດາວໂຫຼດ",
diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.json
index 56d633bd..803438c0 100644
--- a/src/lib/i18n/pt.json
+++ b/src/lib/i18n/pt.json
@@ -54,422 +54,6 @@
"nav_home": "Ir para Início",
"nav_downloads": "Ir para Downloads"
},
- "league": {
- "cd_title": "Cooldowns inimigos",
- "cd_desc": "Cooldowns base vindos dos dados de campeão do próprio jogo, divididos pela aceleração de habilidade que os itens dele dão. Os ranks das habilidades são estimados pelo nível, então trate como aproximado, não exato.",
- "cd_estimated": "estimado",
- "cd_haste": "aceleração",
- "col_gold_hint": "O ouro mostrado é o que cada jogador carrega em itens, precificado pelos dados de item do próprio jogo — é o único número de economia visível para os outros jogadores.",
- "scout_no_history": "Sem partidas recentes",
- "build_title": "Build de itens",
- "build_desc": "Montada a partir das partidas desse campeão dentro do seu próprio histórico recente — sem site de build de terceiros, então a amostra é pequena e assumida como tal.",
- "build_champion": "Escolha um campeão",
- "build_samples": "partidas vistas",
- "meta_reference": "Referência de build",
- "meta_source": "Agregado de dados públicos do op.gg para o patch atual. Exibido como referência; nada é aplicado automaticamente.",
- "skill_priority": "Prioridade de habilidades",
- "items_starter": "Itens iniciais",
- "items_core": "Itens principais",
- "items_boots": "Botas",
- "items_last": "Itens finais",
- "counters": "Tem dificuldade contra",
- "runes_full": "Suas páginas de runas estão cheias. Apague uma no cliente para o OmniGet criar a dele.",
- "build_empty": "Nenhuma partida com esse campeão na amostra ainda.",
- "tab_meta": "Meta",
- "runes_title": "Runas",
- "runes_desc": "Páginas de runas e feitiços recomendados pelo próprio cliente do jogo para o campeão que você travou, sempre no patch atual.",
- "runes_auto": "Aplicar runas automaticamente",
- "runes_auto_desc": "Ao travar um campeão, a primeira página recomendada é criada e selecionada para você.",
- "runes_apply": "Aplicar",
- "runes_default": "padrão",
- "runes_spells": "Feitiços",
- "runes_empty": "Trave um campeão na seleção para ver as páginas recomendadas.",
- "tiers_title": "Tiers de campeões",
- "tiers_desc": "Ranking por função, com taxas de vitória, escolha e banimento. Dados do op.gg.",
- "tiers_position": "Posição",
- "tiers_pick": "escolha",
- "tiers_ban": "ban",
- "tiers_empty": "Tier list indisponível no momento.",
- "impact_label": "Impacto",
- "score_label": "Nota",
- "score_hint": "Média das partidas ranqueadas e normais recentes. Escondida abaixo de cinco partidas válidas.",
- "copy_riot_id": "Copiar Riot ID",
- "impact_hint": "Composto de KDA, participação em abates, dano, dano recebido, ouro, visão e CS, numa escala de 0 a 10",
- "tab_search": "Buscar",
- "search_title": "Procurar jogador",
- "search_placeholder": "Riot ID, ex.: Faker#KR1",
- "search_button": "Buscar",
- "searching_player": "Buscando…",
- "search_hint": "Digite um Riot ID com a tag para ver elo, forma recente e desempenho por campeão.",
- "search_recent": "Forma recente",
- "search_champions": "Campeões",
- "search_champions_hint": "2+ partidas, mais jogados primeiro",
- "search_mastery": "Maestria",
- "stat_winrate": "Vitórias",
- "games_short": "partidas",
- "duos_title": "Melhores duos",
- "duos_desc": "Companheiros com quem você mais vence, das suas partidas recentes. A pontuação encolhe amostras pequenas para uma dupla de sorte não liderar a lista.",
- "duos_empty": "Nenhum companheiro repetido na amostra ainda.",
- "duos_score": "pontuação",
- "jungle_title": "Rota inicial da selva",
- "jungle_empty": "Sem dados de timeline nessas partidas.",
- "jungle_invade": "invade",
- "jungle_gank3": "gank nível 3",
- "zone_top": "Topo",
- "zone_mid": "Meio",
- "zone_bot": "Base",
- "pref_top": "foco no topo",
- "pref_mid": "foco no meio",
- "pref_bot": "foco na base",
- "pref_top_mid": "foco em topo e meio",
- "pref_mid_bot": "foco em meio e base",
- "pref_balanced": "rota equilibrada",
- "pref_unknown": "dados insuficientes",
- "chat_placeholder": "Mensagem para enviar na seleção",
- "chat_build": "Montar resumo",
- "chat_send": "Enviar",
- "tab_overview": "Visão geral",
- "tab_analysis": "Análise",
- "tab_live": "Ao vivo",
- "tab_goals": "Metas",
- "tab_automation": "Automação",
- "tab_history": "Histórico",
- "win_title": "Chance de vitória",
- "win_allies": "Seu time",
- "win_interval": "faixa de 90%",
- "win_gap": "Diferença de rating",
- "win_known": "jogadores com dados",
- "win_disclaimer": "O emparelhamento monta partidas com expectativa de 50%, então estimativas honestas ficam perto do empate. Trate como uma tendência, não como veredito.",
- "win_unavailable": "Disponível na seleção de campeões e em partida.",
- "premades": "Grupos (premades)",
- "premade_source_party": "Informado pelo jogo",
- "premade_source_history": "Estimado pelo histórico em comum",
- "players": "jogadores",
- "objectives_title": "Objetivos e eventos",
- "objectives_estimate": "Os tempos de renascimento são estimativas do patch atual, não valores informados pelo jogo.",
- "objective_baron": "Barão",
- "objective_dragon": "Dragão",
- "objective_inhibitor": "Inibidor",
- "event_kill": "Abate:",
- "event_turret": "Torre destruída:",
- "event_inhib": "Inibidor destruído:",
- "event_dragon": "Dragão morto por",
- "event_baron": "Barão morto por",
- "event_herald": "Arauto morto por",
- "event_multikill": "Multi-abate:",
- "event_ace": "Ace de",
- "event_first_turret": "Primeira torre:",
- "event_first_blood": "Primeiro abate:",
- "gold_title": "Economia ao vivo",
- "gold_unavailable": "Entre em uma partida para ver ouro e diferenças de lane.",
- "your_team": "Seu time",
- "enemy_team": "Time inimigo",
- "col_player": "Jogador",
- "col_gold": "Ouro",
- "col_diff": "vs oponente de lane",
- "goals_live": "Suas metas nesta partida",
- "goals_title": "Metas de desempenho",
- "goals_role": "Função",
- "goals_desc": "Metas por função, usadas para avaliar sua partida ao vivo. Ajuste ao seu nível.",
- "goals_reset": "Restaurar padrões",
- "goal_cs": "CS por minuto",
- "goal_gold": "Ouro por minuto",
- "goal_kda": "KDA",
- "goal_vision": "Visão por minuto",
- "role_top": "Topo",
- "role_jungle": "Selva",
- "role_middle": "Meio",
- "role_bottom": "Atirador",
- "role_utility": "Suporte",
- "role_fill": "Preencher",
- "role_preference": "Preferência de rota",
- "role_first": "Rota principal",
- "role_second": "Rota secundária",
- "scout_title": "Análise da partida",
- "scout_allies": "Aliados",
- "scout_enemies": "Inimigos",
- "scout_enemies_hidden": "Os inimigos são revelados quando a partida começa.",
- "scout_note_placeholder": "Anotação pessoal sobre este jogador…",
- "marked_in_allies": "Você tem anotações no seu time:",
- "marked_in_enemies": "Você tem anotações no time inimigo:",
- "squad_enemy": "Os cinco inimigos entraram na fila juntos e todos os perfis estão ocultos.",
- "squad_ally": "Vocês cinco entraram na fila juntos e todos os perfis estão ocultos.",
- "scout_private": "Perfil privado",
- "tag_hot_streak": "sequência de vitórias",
- "tag_cold_streak": "sequência de derrotas",
- "tag_high_winrate": "winrate alto",
- "tag_low_winrate": "winrate baixo",
- "tag_one_trick": "one-trick",
- "tag_high_kda": "KDA alto",
- "tag_low_kda": "KDA baixo",
- "lobby_title": "Jogar",
- "lobby_hint": "As ações de lobby aparecem aqui quando o cliente estiver pronto.",
- "searching": "Procurando partida…",
- "start_queue": "Buscar partida",
- "stop_queue": "Cancelar busca",
- "leave_lobby": "Sair do lobby",
- "play_again": "Jogar de novo",
- "champ_select_title": "Seleção de campeões",
- "bench_title": "Banco",
- "reroll": "Rerolar",
- "reroll_keep": "Rerollar mantendo o campeão",
- "reroll_keep_hint": "Gasta o reroll para ampliar o banco e devolve o seu campeão atual.",
- "swap": "Trocar para",
- "remove": "Remover",
- "live_title": "Partida ao vivo",
- "respawn_in": "renasce em",
- "automation_title": "Automação",
- "notify_ready": "Avisar quando a partida for encontrada",
- "notify_ready_desc": "Envia uma notificação do sistema apenas quando a janela do OmniGet não está em foco.",
- "auto_pick": "Pick automático",
- "auto_pick_desc": "Escolhe o primeiro campeão disponível da sua lista quando for a sua vez.",
- "auto_ban": "Ban automático",
- "auto_ban_desc": "Bane o primeiro campeão disponível da sua lista de bans.",
- "pick_confirm": "Como concluir o pick",
- "pick_confirm_desc": "Declarar mostra seu campeão ao time sem tirar a decisão de você.",
- "pick_confirm_declare": "Só declarar",
- "pick_confirm_timeout": "Travar no fim",
- "pick_confirm_immediate": "Travar na hora",
- "auto_lock": "Confirmar automaticamente",
- "auto_lock_desc": "Desligado = só mostra a intenção; você ainda confirma o pick.",
- "auto_honor": "Honra automática",
- "auto_honor_desc": "Honra um colega ao fim da partida, priorizando quem entrou na fila com você.",
- "auto_play_again": "Jogar de novo automaticamente",
- "auto_play_again_desc": "Volta para o lobby assim que a tela de fim de partida aparecer.",
- "auto_requeue": "Buscar partida em seguida",
- "auto_requeue_desc": "Inicia a busca quando o lobby volta, só quando você é o líder do lobby.",
- "auto_swaps": "Aceitar trocas de posição e de ordem de pick",
- "auto_swaps_desc": "Aceita pedidos de aliados para trocar de rota ou de ordem de escolha no champ select.",
- "auto_reconnect": "Reconectar automaticamente",
- "auto_reconnect_desc": "Reentra na partida automaticamente se o cliente desconectar.",
- "spectate": "Assistir partida",
- "spectate_loading": "Abrindo espectador…",
- "spectate_not_in_game": "Este jogador não está em partida agora.",
- "dodge": "Dodge",
- "dodge_warning": "Sair agora conta como dodge: você perde PDL e pega atraso de fila.",
- "dodge_confirm": "Sair mesmo assim",
- "unavailable_platform": "Não disponível neste sistema.",
- "unavailable_client": "Abra o cliente de League of Legends para usar isto.",
- "unavailable_game": "Disponível durante uma partida.",
- "badge_beta": "beta",
- "badge_experimental": "experimental",
- "profile_tools": "Personalizar perfil",
- "profile_icon": "Ícone de invocador",
- "profile_icon_saved": "Ícone atualizado.",
- "profile_status": "Disponibilidade",
- "profile_status_saved": "Disponibilidade atualizada.",
- "status_chat": "Online",
- "status_away": "Ausente",
- "status_dnd": "Ocupado",
- "profile_message": "Mensagem de status",
- "profile_message_saved": "Mensagem atualizada.",
- "profile_background": "Fundo do perfil",
- "profile_background_saved": "Fundo atualizado.",
- "profile_no_skins": "Nenhuma skin deste campeão na conta.",
- "apply": "Aplicar",
- "restart_ux": "Reiniciar a interface do cliente",
- "restart_ux_warning": "Recarrega a interface do cliente. Sua posição na fila e a seleção de campeões são preservadas.",
- "restart_ux_confirm": "Reiniciar interface",
- "dodge_cancel": "Ficar",
- "auto_trade": "Trocas de campeão",
- "auto_trade_desc": "Como responder pedidos de troca dos colegas durante a seleção de campeões.",
- "auto_trade_off": "Perguntar",
- "auto_trade_accept": "Aceitar todas",
- "auto_trade_decline": "Recusar todas",
- "auto_message": "Saudação na seleção",
- "auto_message_desc": "Enviada uma vez no chat do time quando a seleção começa. Vazio = desligado.",
- "auto_message_placeholder": "ex.: glhf :)",
- "tag_flash_swap": "Posição do Flash varia",
- "tag_high_damage_efficiency": "Muito dano por ouro",
- "tag_low_damage_efficiency": "Pouco dano por ouro",
- "solo_kills_label": "Abates solo/jogo",
- "early_deaths_label": "Mortes antes dos 15min/jogo",
- "seen_before": "já visto",
- "seen_before_hint": "Você já jogou com ou contra este jogador antes.",
- "spell_timer_hint": "Clique quando o feitiço for usado para iniciar o timer.",
- "obj_towers": "Torres",
- "obj_inhibitors": "Inibidores",
- "obj_heralds": "Arautos",
- "obj_bans": "Bans",
- "open_player": "Ver as partidas recentes deste jogador",
- "close": "Fechar",
- "stat_level": "Nv",
- "stat_damage": "Causado",
- "stat_taken": "Recebido",
- "stat_mitigated": "Mitigado",
- "stat_healing": "Cura",
- "stat_objectives": "Objetivos",
- "stat_gold_min": "Ouro/min",
- "stat_cs_min": "CS/min",
- "stat_vision": "Visão",
- "stat_wards": "Wards p/d/ctrl",
- "stat_cc": "CC",
- "stat_spree": "Melhor sequência",
- "stat_penta": "Pentakill",
- "stat_quadra": "Quadrakill",
- "stat_triple": "Triple kill",
- "stat_first_blood": "First blood",
- "stat_first_tower": "Primeira torre",
- "match_damage": "dano",
- "match_detail_unavailable": "Detalhes da partida indisponíveis.",
- "pick_list": "Prioridade de pick",
- "ban_delay": "Esperar antes de banir",
- "ban_delay_desc": "Segura o ban por um instante e pula campeões que um aliado já declarou.",
- "ban_list": "Prioridade de ban",
- "list_hint": "a ordem importa",
- "search_champion": "Buscar campeão…",
- "phase_lobby": "No lobby",
- "phase_matchmaking": "Na fila",
- "phase_ready_check": "Partida encontrada!",
- "phase_champ_select": "Seleção de campeões",
- "phase_in_progress": "Em partida",
- "phase_end_of_game": "Fim de jogo",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Menu opcional do cliente do League. Desligado por padrão.",
- "settings_enable": "Ativar menu do League",
- "settings_enable_desc": "Adiciona um menu do League of Legends com ferramentas do cliente. Requer o cliente do League aberto.",
- "settings_auto_accept": "Aceitar partidas automaticamente",
- "settings_auto_accept_desc": "Aceita automaticamente a verificação de prontidão quando uma partida é encontrada.",
- "disabled_title": "O menu do League está desligado",
- "disabled_body": "Ative em Configurações → Avançado → League of Legends. Nada roda até você ligar.",
- "open_settings": "Abrir Configurações",
- "connected": "Conectado",
- "disconnected_title": "Cliente não detectado",
- "disconnected_body": "Abra o cliente do League of Legends e esta página conecta automaticamente.",
- "level": "Nível",
- "phase_label": "Status do cliente",
- "accept_now": "Aceitar partida",
- "auto_accept": "Aceitar partidas automaticamente",
- "auto_accept_desc": "Aceita a partida por você assim que ela aparecer.",
- "accept_delay": "Esperar antes de aceitar",
- "accept_delay_instant": "imediatamente",
- "accept_delay_desc": "Deixa um instante para você recusar. Recusar durante a espera cancela o aceite automático.",
- "ranked_solo": "Ranqueada Solo/Duo",
- "ranked_flex": "Ranqueada Flexível",
- "unranked": "Sem ranque",
- "history_title": "Partidas recentes",
- "filter_queue": "Filtrar por fila",
- "filter_all": "Todas",
- "summary_games": "partidas",
- "summary_win_short": "V",
- "summary_loss_short": "D",
- "summary_remakes": "remakes não contados",
- "history_empty": "Nenhuma partida encontrada ainda.",
- "refresh": "Atualizar",
- "victory": "Vitória",
- "defeat": "Derrota",
- "tab_profile": "Perfil",
- "tab_coach": "Coach",
- "profile_title": "Editor de perfil",
- "profile_desc": "Tudo que o cliente deixa mudar em como você aparece para os outros. Nada aqui mexe no jogo em si.",
- "profile_section_presence": "Presença",
- "status_offline": "Offline",
- "status_mobile": "Celular",
- "profile_message_hint": "Até 255 caracteres. A caixa do próprio cliente para em 140.",
- "profile_section_icon": "Ícones",
- "profile_icon_search": "Buscar ícone por nome ou id",
- "profile_icon_chat": "Ícone do chat",
- "profile_icon_chat_saved": "Ícone do chat atualizado",
- "profile_icon_hint": "O ícone de perfil precisa ser seu. O ícone do chat (hovercard e lista de amigos) aceita qualquer um.",
- "profile_section_rank": "Elo mostrado no chat",
- "rank_queue": "Fila",
- "rank_tier": "Elo",
- "rank_division": "Divisão",
- "rank_reset": "Restaurar elo real",
- "rank_saved": "Elo do chat atualizado",
- "rank_hint": "Só o hovercard e os cartões sociais mudam. Sua ranqueada continua igual.",
- "crystal_title": "Cristal de desafios",
- "crystal_level": "Nível",
- "crystal_points": "Pontos",
- "crystal_saved": "Cristal atualizado",
- "tokens_title": "Medalhas, título e banner",
- "tokens_desc": "Escolha até três medalhas de desafio para o perfil. A mesma medalha pode ocupar todos os espaços.",
- "tokens_slot": "Espaço",
- "tokens_empty": "Nenhuma medalha conquistada ainda",
- "tokens_none": "Nenhuma",
- "tokens_clear": "Limpar",
- "tokens_saved": "Preferências do perfil atualizadas",
- "tokens_search": "Filtrar medalhas",
- "title_label": "Título",
- "title_none": "Sem título",
- "banner_label": "Banner",
- "banner_none": "Sem banner",
- "friends_title": "Amigos",
- "friends_desc": "Carregue a lista, marque quem remover e confirme. A remoção é definitiva.",
- "friends_load": "Carregar",
- "friends_select_all": "Selecionar visíveis",
- "friends_clear_selection": "Limpar seleção",
- "friends_remove": "Remover selecionados",
- "friends_remove_confirm": "Eles saem da sua lista de amigos de vez.",
- "friends_remove_go": "Remover",
- "friends_removed": "Removidos",
- "friends_count": "Amigos",
- "wallet_rp": "RP",
- "wallet_be": "Essência Azul",
- "raffle_title": "Sorteio",
- "raffle_lane": "Sortear lane",
- "raffle_lane_apply": "Usar como preferência",
- "raffle_champion": "Sortear campeão",
- "raffle_class_any": "Qualquer classe",
- "raffle_class_fighter": "Lutador",
- "raffle_class_mage": "Mago",
- "raffle_class_assassin": "Assassino",
- "raffle_class_marksman": "Atirador",
- "raffle_class_support": "Suporte",
- "raffle_class_tank": "Tanque",
- "raffle_declare": "Declarar",
- "raffle_lock": "Travar",
- "raffle_again": "Sortear de novo",
- "raffle_pool": "campeões no bolo",
- "skin_title": "Roleta de skin",
- "skin_roll": "Sortear skin",
- "skin_roll_ward": "Sortear sentinela",
- "skin_rolled": "Saiu",
- "skin_lock_first": "Trave um campeão primeiro",
- "pick_random": "Campeão aleatório",
- "pick_random_desc": "Ignora a lista e trava um campeão aleatório permitido, inclusive na ranqueada. Campeões que aliados estão declarando são evitados.",
- "skin_roulette": "Roleta de skin",
- "skin_roulette_desc": "Na hora que você trava o campeão, uma skin e chroma que você possui são aplicados ao acaso. Sorteios recentes são pulados.",
- "skin_include_base": "Incluir a skin base",
- "ward_roulette": "Roleta de sentinela",
- "ward_roulette_desc": "Também sorteia uma skin de sentinela sua ao travar.",
- "sgp_enabled": "Dados do backend (SGP)",
- "sgp_enabled_desc": "Quando o histórico local do cliente vem curto ou escondido, pergunta direto ao backend da Riot com os tokens do próprio cliente. Também habilita baixar replays.",
- "coach_title": "Coach de IA",
- "coach_desc": "O modelo de IA configurado lê seus próprios dados de partida, mais dados de meta do OP.GG, e responde como um coach.",
- "coach_not_configured": "Configure um provedor de IA primeiro.",
- "coach_open_settings": "Abrir ajustes",
- "coach_style": "Tom",
- "coach_style_objective": "Objetivo",
- "coach_style_roast": "Zoeira",
- "coach_style_praise": "Encorajador",
- "coach_review_title": "Revisar uma partida",
- "coach_review_pick": "Escolha uma partida recente",
- "coach_review_run": "Revisar",
- "coach_trends_title": "Tendências",
- "coach_trends_games": "partidas",
- "coach_trends_run": "Analisar",
- "coach_ask_title": "Pergunte ao coach",
- "coach_ask_placeholder": "Pergunte sobre o draft atual, a partida ou sua fase recente",
- "coach_ask_run": "Perguntar",
- "coach_quick_draft": "Analise este draft e me dê um plano",
- "coach_quick_early": "Como devem ser meus primeiros 10 minutos?",
- "coach_quick_now": "O que eu faço agora?",
- "coach_quick_improve": "O que eu devo corrigir primeiro?",
- "coach_working": "Pensando…",
- "coach_result": "Coach",
- "coach_copy": "Copiar",
- "coach_copied": "Copiado",
- "coach_error_no_games": "Sem partidas recentes para analisar",
- "coach_privacy": "Dados da partida e, quando fizer sentido, dados de meta do OP.GG são enviados ao provedor de IA configurado.",
- "replay_download": "Baixar replay",
- "replay_downloading": "Baixando…",
- "replay_saved": "Replay salvo em",
- "review_ai": "Revisar com IA",
- "history_source_sgp": "via backend",
- "search_source_sgp": "Histórico buscado no backend da Riot (SGP), porque o cliente escondeu."
- },
"nav": {
"home": "Início",
"downloads": "Downloads",
diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.json
index c9dd4084..eb3cf0b5 100644
--- a/src/lib/i18n/ru.json
+++ b/src/lib/i18n/ru.json
@@ -54,422 +54,6 @@
"nav_home": "Перейти на главную",
"nav_downloads": "Перейти к загрузкам"
},
- "league": {
- "cd_title": "Перезарядки противников",
- "cd_desc": "Базовые перезарядки из данных чемпионов самой игры, делённые на ускорение умений от их предметов. Ранги оцениваются по уровню, так что считайте это приближением.",
- "cd_estimated": "оценка",
- "cd_haste": "ускорение",
- "col_gold_hint": "Показано золото, вложенное в предметы, по ценам из данных самой игры — это единственный экономический показатель, видимый для других игроков.",
- "scout_no_history": "Нет недавних игр",
- "build_title": "Сборка предметов",
- "build_desc": "Собрана по играм этого чемпиона в вашей недавней истории — без сторонних сайтов сборок, поэтому выборка мала и это указано честно.",
- "build_champion": "Выберите чемпиона",
- "build_samples": "игр учтено",
- "meta_reference": "Ориентир по сборке",
- "meta_source": "Сводка публичных данных op.gg для текущего патча. Показано как справка; ничего не применяется автоматически.",
- "skill_priority": "Приоритет умений",
- "items_starter": "Стартовые предметы",
- "items_core": "Основные предметы",
- "items_boots": "Обувь",
- "items_last": "Поздние предметы",
- "counters": "Тяжело против",
- "runes_full": "Страницы рун заполнены. Удалите одну в клиенте, чтобы OmniGet создал свою.",
- "build_empty": "Игр с этим чемпионом в выборке пока нет.",
- "tab_meta": "Мета",
- "runes_title": "Руны",
- "runes_desc": "Страницы рун и заклинания, рекомендованные самим клиентом игры для выбранного чемпиона — всегда для текущего патча.",
- "runes_auto": "Применять руны автоматически",
- "runes_auto_desc": "При выборе чемпиона первая рекомендованная страница создаётся и активируется автоматически.",
- "runes_apply": "Применить",
- "runes_default": "по умолчанию",
- "runes_spells": "Заклинания",
- "runes_empty": "Выберите чемпиона, чтобы увидеть рекомендованные страницы.",
- "tiers_title": "Тиры чемпионов",
- "tiers_desc": "Рейтинг по ролям с процентами побед, выборов и банов. Данные op.gg.",
- "tiers_position": "Позиция",
- "tiers_pick": "выбор",
- "tiers_ban": "бан",
- "tiers_empty": "Тир-лист сейчас недоступен.",
- "impact_label": "Влияние",
- "score_label": "Оценка",
- "score_hint": "Среднее по недавним рейтинговым и обычным играм. Скрыта, если меньше пяти пригодных игр.",
- "copy_riot_id": "Копировать Riot ID",
- "impact_hint": "Composite: KDA, участие в убийствах, урон, полученный урон, золото, обзор и CS по шкале 0-10",
- "tab_search": "Поиск",
- "search_title": "Найти игрока",
- "search_placeholder": "Riot ID, напр. Faker#KR1",
- "search_button": "Найти",
- "searching_player": "Поиск…",
- "search_hint": "Введите Riot ID с тегом, чтобы увидеть ранг, текущую форму и статистику по чемпионам.",
- "search_recent": "Текущая форма",
- "search_champions": "Чемпионы",
- "search_champions_hint": "2+ игр, сначала популярные",
- "search_mastery": "Мастерство",
- "stat_winrate": "Победы",
- "games_short": "игр",
- "duos_title": "Лучшие дуо",
- "duos_desc": "Союзники, с которыми вы чаще побеждаете, по недавним играм. Оценка сжимает малые выборки, чтобы удачная пара игр не возглавила список.",
- "duos_empty": "Повторяющихся союзников пока нет.",
- "duos_score": "оценка",
- "jungle_title": "Ранний маршрут в лесу",
- "jungle_empty": "Нет данных таймлайна для этих игр.",
- "jungle_invade": "вторжение",
- "jungle_gank3": "ганк 3 ур.",
- "zone_top": "Топ",
- "zone_mid": "Мид",
- "zone_bot": "Бот",
- "pref_top": "фокус на топ",
- "pref_mid": "фокус на мид",
- "pref_bot": "фокус на бот",
- "pref_top_mid": "фокус на топ и мид",
- "pref_mid_bot": "фокус на мид и бот",
- "pref_balanced": "сбалансированный маршрут",
- "pref_unknown": "мало данных",
- "chat_placeholder": "Сообщение для отправки в выборе",
- "chat_build": "Собрать сводку",
- "chat_send": "Отправить",
- "tab_overview": "Обзор",
- "tab_analysis": "Анализ",
- "tab_live": "В игре",
- "tab_goals": "Цели",
- "tab_automation": "Автоматизация",
- "tab_history": "История",
- "win_title": "Вероятность победы",
- "win_allies": "Ваша команда",
- "win_interval": "диапазон 90%",
- "win_gap": "Разрыв рейтинга",
- "win_known": "игроков с данными",
- "win_disclaimer": "Подбор строит матчи с ожиданием 50%, поэтому честные оценки держатся около равенства. Считайте это склонностью, а не приговором.",
- "win_unavailable": "Доступно при выборе чемпионов и в игре.",
- "premades": "Группы (пати)",
- "premade_source_party": "По данным игры",
- "premade_source_history": "Оценка по общей истории матчей",
- "players": "игроков",
- "objectives_title": "Цели и события",
- "objectives_estimate": "Время возрождения — оценка по текущему патчу, а не значение от игры.",
- "objective_baron": "Барон",
- "objective_dragon": "Дракон",
- "objective_inhibitor": "Ингибитор",
- "event_kill": "Убийство:",
- "event_turret": "Башня разрушена:",
- "event_inhib": "Ингибитор разрушен:",
- "event_dragon": "Дракона забрал",
- "event_baron": "Барона забрал",
- "event_herald": "Вестника забрал",
- "event_multikill": "Мультиубийство:",
- "event_ace": "Эйс от",
- "event_first_turret": "Первая башня:",
- "event_first_blood": "Первая кровь:",
- "gold_title": "Экономика в игре",
- "gold_unavailable": "Зайдите в игру, чтобы увидеть золото и разницу на линии.",
- "your_team": "Ваша команда",
- "enemy_team": "Команда противника",
- "col_player": "Игрок",
- "col_gold": "Золото",
- "col_diff": "против оппонента",
- "goals_live": "Ваши цели в этой игре",
- "goals_title": "Цели по показателям",
- "goals_role": "Роль",
- "goals_desc": "Цели по ролям для оценки текущей игры. Настройте под свой уровень.",
- "goals_reset": "Сбросить",
- "goal_cs": "CS в минуту",
- "goal_gold": "Золото в минуту",
- "goal_kda": "KDA",
- "goal_vision": "Обзор в минуту",
- "role_top": "Топ",
- "role_jungle": "Лес",
- "role_middle": "Мид",
- "role_bottom": "Бот",
- "role_utility": "Саппорт",
- "role_fill": "Любая",
- "role_preference": "Предпочтение роли",
- "role_first": "Основная роль",
- "role_second": "Вторая роль",
- "scout_title": "Разведка матча",
- "scout_allies": "Союзники",
- "scout_enemies": "Противники",
- "scout_enemies_hidden": "Противники раскрываются после начала игры.",
- "scout_note_placeholder": "Личная заметка об этом игроке…",
- "marked_in_allies": "У вас есть заметки о союзниках:",
- "marked_in_enemies": "У вас есть заметки о противниках:",
- "squad_enemy": "Все пять противников встали в очередь вместе, и все профили скрыты.",
- "squad_ally": "Вы все пятеро встали в очередь вместе, и все профили скрыты.",
- "scout_private": "Скрытый профиль",
- "tag_hot_streak": "серия побед",
- "tag_cold_streak": "серия поражений",
- "tag_high_winrate": "высокий винрейт",
- "tag_low_winrate": "низкий винрейт",
- "tag_one_trick": "уан-трик",
- "tag_high_kda": "высокий KDA",
- "tag_low_kda": "низкий KDA",
- "lobby_title": "Играть",
- "lobby_hint": "Действия лобби появятся здесь, когда клиент будет готов.",
- "searching": "Поиск матча…",
- "start_queue": "Найти матч",
- "stop_queue": "Отменить поиск",
- "leave_lobby": "Покинуть лобби",
- "play_again": "Играть снова",
- "champ_select_title": "Выбор чемпионов",
- "bench_title": "Скамейка",
- "reroll": "Реролл",
- "reroll_keep": "Реролл с сохранением чемпиона",
- "reroll_keep_hint": "Тратит реролл, чтобы расширить скамейку, и возвращает вашего текущего чемпиона.",
- "swap": "Взять",
- "remove": "Убрать",
- "live_title": "Текущая игра",
- "respawn_in": "возродится через",
- "automation_title": "Автоматизация",
- "notify_ready": "Уведомлять о найденном матче",
- "notify_ready_desc": "Отправляет системное уведомление, только когда окно OmniGet не в фокусе.",
- "auto_pick": "Автопик",
- "auto_pick_desc": "Выбирает первого доступного чемпиона из вашего списка, когда наступает ваш ход.",
- "auto_ban": "Автобан",
- "auto_ban_desc": "Банит первого доступного чемпиона из вашего списка банов.",
- "pick_confirm": "Как завершать пик",
- "pick_confirm_desc": "Заявка показывает чемпиона команде, не отнимая у вас решение.",
- "pick_confirm_declare": "Только заявить",
- "pick_confirm_timeout": "Взять в конце",
- "pick_confirm_immediate": "Взять сразу",
- "auto_lock": "Подтверждать автоматически",
- "auto_lock_desc": "Выкл. = только показывает намерение; пик подтверждаете вы.",
- "auto_honor": "Автопохвала",
- "auto_honor_desc": "Хвалит союзника после игры, отдавая предпочтение тем, с кем вы были в очереди.",
- "auto_play_again": "Автоматически играть снова",
- "auto_play_again_desc": "Возвращает в лобби, как только появляется экран конца игры.",
- "auto_requeue": "Сразу искать снова",
- "auto_requeue_desc": "Запускает поиск, когда лобби вернулось, и только если вы лидер лобби.",
- "auto_swaps": "Принимать смену позиции и порядка пика",
- "auto_swaps_desc": "Принимает просьбы союзников поменяться ролью или порядком выбора.",
- "auto_reconnect": "Автопереподключение",
- "auto_reconnect_desc": "Автоматически возвращает в игру при отключении клиента.",
- "spectate": "Смотреть игру",
- "spectate_loading": "Запуск наблюдателя…",
- "spectate_not_in_game": "Этот игрок сейчас не в игре.",
- "dodge": "Додж",
- "dodge_warning": "Выход сейчас считается доджем: вы потеряете LP и получите задержку очереди.",
- "dodge_confirm": "Всё равно выйти",
- "unavailable_platform": "Недоступно в этой системе.",
- "unavailable_client": "Откройте клиент League of Legends, чтобы это использовать.",
- "unavailable_game": "Доступно во время матча.",
- "badge_beta": "бета",
- "badge_experimental": "экспериментально",
- "profile_tools": "Настроить профиль",
- "profile_icon": "Иконка призывателя",
- "profile_icon_saved": "Иконка обновлена.",
- "profile_status": "Доступность",
- "profile_status_saved": "Доступность обновлена.",
- "status_chat": "В сети",
- "status_away": "Отошёл",
- "status_dnd": "Занят",
- "profile_message": "Сообщение статуса",
- "profile_message_saved": "Сообщение обновлено.",
- "profile_background": "Фон профиля",
- "profile_background_saved": "Фон обновлён.",
- "profile_no_skins": "Нет облики этого чемпиона на аккаунте.",
- "apply": "Применить",
- "restart_ux": "Перезапустить интерфейс клиента",
- "restart_ux_warning": "Перезагружает интерфейс клиента. Место в очереди и выбор чемпионов сохраняются.",
- "restart_ux_confirm": "Перезапустить интерфейс",
- "dodge_cancel": "Остаться",
- "auto_trade": "Обмены чемпионами",
- "auto_trade_desc": "Как отвечать на запросы обмена во время выбора чемпионов.",
- "auto_trade_off": "Спрашивать",
- "auto_trade_accept": "Принимать все",
- "auto_trade_decline": "Отклонять все",
- "auto_message": "Приветствие при выборе",
- "auto_message_desc": "Отправляется один раз в чат команды в начале выбора чемпионов. Пусто = выключено.",
- "auto_message_placeholder": "напр.: glhf :)",
- "tag_flash_swap": "Позиция флэша меняется",
- "tag_high_damage_efficiency": "Высокий урон за золото",
- "tag_low_damage_efficiency": "Низкий урон за золото",
- "solo_kills_label": "Сольные убийства/игра",
- "early_deaths_label": "Смерти до 15 мин/игра",
- "seen_before": "уже встречался",
- "seen_before_hint": "Вы уже играли с этим игроком или против него.",
- "spell_timer_hint": "Нажмите, когда заклинание использовано, чтобы запустить таймер.",
- "obj_towers": "Башни",
- "obj_inhibitors": "Ингибиторы",
- "obj_heralds": "Вестники",
- "obj_bans": "Баны",
- "open_player": "Посмотреть последние матчи игрока",
- "close": "Закрыть",
- "stat_level": "Ур",
- "stat_damage": "Нанесено",
- "stat_taken": "Получено",
- "stat_mitigated": "Смягчено",
- "stat_healing": "Лечение",
- "stat_objectives": "Объекты",
- "stat_gold_min": "Золото/мин",
- "stat_cs_min": "CS/мин",
- "stat_vision": "Обзор",
- "stat_wards": "Варды п/у/контр",
- "stat_cc": "Контроль",
- "stat_spree": "Лучшая серия",
- "stat_penta": "Пентакилл",
- "stat_quadra": "Квадракилл",
- "stat_triple": "Тройное убийство",
- "stat_first_blood": "Первая кровь",
- "stat_first_tower": "Первая башня",
- "match_damage": "урон",
- "match_detail_unavailable": "Детали матча недоступны.",
- "pick_list": "Приоритет пиков",
- "ban_delay": "Пауза перед баном",
- "ban_delay_desc": "Задерживает бан и пропускает чемпионов, которых уже заявил союзник.",
- "ban_list": "Приоритет банов",
- "list_hint": "порядок важен",
- "search_champion": "Поиск чемпиона…",
- "phase_lobby": "В лобби",
- "phase_matchmaking": "В очереди",
- "phase_ready_check": "Матч найден!",
- "phase_champ_select": "Выбор чемпионов",
- "phase_in_progress": "В игре",
- "phase_end_of_game": "Игра окончена",
- "nav": "League of Legends",
- "settings_title": "League of Legends",
- "settings_desc": "Опциональное меню клиента League. По умолчанию выключено.",
- "settings_enable": "Включить меню League",
- "settings_enable_desc": "Добавляет меню League of Legends с инструментами клиента. Требуется запущенный клиент League.",
- "settings_auto_accept": "Автопринятие матчей",
- "settings_auto_accept_desc": "Автоматически принимает проверку готовности, когда матч найден.",
- "disabled_title": "Меню League выключено",
- "disabled_body": "Включите его в Настройки → Дополнительно → League of Legends. Ничего не запускается, пока вы его не включите.",
- "open_settings": "Открыть настройки",
- "connected": "Подключено",
- "disconnected_title": "Клиент не обнаружен",
- "disconnected_body": "Откройте клиент League of Legends — эта страница подключится автоматически.",
- "level": "Уровень",
- "phase_label": "Статус клиента",
- "accept_now": "Принять матч",
- "auto_accept": "Автопринятие матчей",
- "auto_accept_desc": "Принимает матч за вас, как только он найден.",
- "accept_delay": "Пауза перед принятием",
- "accept_delay_instant": "сразу",
- "accept_delay_desc": "Оставляет время отказаться самому. Отказ во время паузы отменяет автопринятие.",
- "ranked_solo": "Ранговая Соло/Дуо",
- "ranked_flex": "Ранговая Флекс",
- "unranked": "Без ранга",
- "history_title": "Недавние матчи",
- "filter_queue": "Фильтр по режиму",
- "filter_all": "Все",
- "summary_games": "матчей",
- "summary_win_short": "П",
- "summary_loss_short": "Пр",
- "summary_remakes": "переигровки не учтены",
- "history_empty": "Матчи пока не найдены.",
- "refresh": "Обновить",
- "victory": "Победа",
- "defeat": "Поражение",
- "tab_profile": "Профиль",
- "tab_coach": "Тренер",
- "profile_title": "Редактор профиля",
- "profile_desc": "Всё, что клиент позволяет менять в том, как вас видят другие. Сама игра здесь не затрагивается.",
- "profile_section_presence": "Статус",
- "status_offline": "Не в сети",
- "status_mobile": "Мобильный",
- "profile_message_hint": "До 255 символов. Поле в самом клиенте останавливается на 140.",
- "profile_section_icon": "Значки",
- "profile_icon_search": "Поиск значка по названию или id",
- "profile_icon_chat": "Значок чата",
- "profile_icon_chat_saved": "Значок чата обновлён",
- "profile_icon_hint": "Значок профиля должен быть в вашей коллекции. Значок чата (карточка и список друзей) принимает любой.",
- "profile_section_rank": "Ранг в чате",
- "rank_queue": "Очередь",
- "rank_tier": "Ранг",
- "rank_division": "Дивизион",
- "rank_reset": "Вернуть настоящий ранг",
- "rank_saved": "Ранг в чате обновлён",
- "rank_hint": "Меняются только карточка и социальные карточки. Ваш рейтинг не трогается.",
- "crystal_title": "Кристалл испытаний",
- "crystal_level": "Уровень",
- "crystal_points": "Очки",
- "crystal_saved": "Кристалл обновлён",
- "tokens_title": "Медали, титул и знамя",
- "tokens_desc": "Выберите до трёх медалей испытаний для профиля. Одна медаль может занимать все ячейки.",
- "tokens_slot": "Ячейка",
- "tokens_empty": "Медалей пока нет",
- "tokens_none": "Нет",
- "tokens_clear": "Очистить",
- "tokens_saved": "Настройки профиля обновлены",
- "tokens_search": "Фильтр медалей",
- "title_label": "Титул",
- "title_none": "Без титула",
- "banner_label": "Знамя",
- "banner_none": "Без знамени",
- "friends_title": "Друзья",
- "friends_desc": "Загрузите список, отметьте кого удалить, подтвердите. Удаление необратимо.",
- "friends_load": "Загрузить",
- "friends_select_all": "Выбрать видимых",
- "friends_clear_selection": "Снять выбор",
- "friends_remove": "Удалить выбранных",
- "friends_remove_confirm": "Они навсегда исчезнут из вашего списка друзей.",
- "friends_remove_go": "Удалить",
- "friends_removed": "Удалено",
- "friends_count": "Друзья",
- "wallet_rp": "RP",
- "wallet_be": "Синяя эссенция",
- "raffle_title": "Жеребьёвка",
- "raffle_lane": "Выбрать линию",
- "raffle_lane_apply": "Сделать предпочтением",
- "raffle_champion": "Выбрать чемпиона",
- "raffle_class_any": "Любой класс",
- "raffle_class_fighter": "Боец",
- "raffle_class_mage": "Маг",
- "raffle_class_assassin": "Убийца",
- "raffle_class_marksman": "Стрелок",
- "raffle_class_support": "Поддержка",
- "raffle_class_tank": "Танк",
- "raffle_declare": "Заявить",
- "raffle_lock": "Закрепить",
- "raffle_again": "Ещё раз",
- "raffle_pool": "чемпионов в барабане",
- "skin_title": "Рулетка образов",
- "skin_roll": "Случайный образ",
- "skin_roll_ward": "Случайный тотем",
- "skin_rolled": "Выпало",
- "skin_lock_first": "Сначала закрепите чемпиона",
- "pick_random": "Случайный чемпион",
- "pick_random_desc": "Игнорирует список и закрепляет случайного доступного чемпиона, в том числе в рейтинге. Чемпионы, заявленные союзниками, не берутся.",
- "skin_roulette": "Рулетка образов",
- "skin_roulette_desc": "В момент закрепления чемпиона применяется случайный образ и хрома из вашей коллекции. Недавние результаты пропускаются.",
- "skin_include_base": "Включать базовый образ",
- "ward_roulette": "Рулетка тотемов",
- "ward_roulette_desc": "При закреплении также выбирает случайный образ тотема.",
- "sgp_enabled": "Данные бэкенда (SGP)",
- "sgp_enabled_desc": "Когда локальная история клиента скудна или скрыта, запрос идёт напрямую к бэкенду Riot с токенами самого клиента. Также включает загрузку повторов.",
- "coach_title": "ИИ-тренер",
- "coach_desc": "Настроенная модель ИИ читает ваши данные матчей и мета-данные OP.GG и отвечает как тренер.",
- "coach_not_configured": "Сначала настройте провайдера ИИ.",
- "coach_open_settings": "Открыть настройки",
- "coach_style": "Тон",
- "coach_style_objective": "Объективно",
- "coach_style_roast": "Жёстко",
- "coach_style_praise": "Ободряюще",
- "coach_review_title": "Разбор матча",
- "coach_review_pick": "Выберите недавний матч",
- "coach_review_run": "Разобрать",
- "coach_trends_title": "Тенденции",
- "coach_trends_games": "матчей",
- "coach_trends_run": "Проанализировать",
- "coach_ask_title": "Спросить тренера",
- "coach_ask_placeholder": "Спросите о текущем драфте, матче или вашей форме",
- "coach_ask_run": "Спросить",
- "coach_quick_draft": "Разбери этот драфт и дай план",
- "coach_quick_early": "Какими должны быть мои первые 10 минут?",
- "coach_quick_now": "Что мне делать прямо сейчас?",
- "coach_quick_improve": "Что исправить в первую очередь?",
- "coach_working": "Думаю…",
- "coach_result": "Тренер",
- "coach_copy": "Копировать",
- "coach_copied": "Скопировано",
- "coach_error_no_games": "Нет недавних матчей для анализа",
- "coach_privacy": "Данные матча и, при необходимости, мета-данные OP.GG отправляются настроенному провайдеру ИИ.",
- "replay_download": "Скачать повтор",
- "replay_downloading": "Загрузка…",
- "replay_saved": "Повтор сохранён в",
- "review_ai": "Разобрать с ИИ",
- "history_source_sgp": "через бэкенд",
- "search_source_sgp": "История получена из бэкенда Riot (SGP), так как клиент её скрыл."
- },
"nav": {
"home": "Главная",
"downloads": "Загрузки",
diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.json
index 5c0e817d..30f05126 100644
--- a/src/lib/i18n/zh-TW.json
+++ b/src/lib/i18n/zh-TW.json
@@ -54,422 +54,6 @@
"nav_home": "前往首頁",
"nav_downloads": "前往下載"
},
- "league": {
- "cd_title": "敵方冷卻",
- "cd_desc": "基礎冷卻取自遊戲本身的英雄資料,再除以其裝備提供的技能急速。技能等級由角色等級推算,因此為近似值。",
- "cd_estimated": "估算",
- "cd_haste": "急速",
- "col_gold_hint": "顯示的金幣是每位玩家裝備上的價值,依遊戲自身的物品資料計價——這是其他玩家唯一可見的經濟數據。",
- "scout_no_history": "沒有近期對戰",
- "build_title": "出裝",
- "build_desc": "根據你自己近期對戰中該英雄的出裝統計得出——不使用第三方出裝網站,因此樣本較小且如實標註。",
- "build_champion": "選擇英雄",
- "build_samples": "場對戰",
- "meta_reference": "出裝參考",
- "meta_source": "根據目前版本的 op.gg 公開資料彙總。僅作參考,不會自動套用。",
- "skill_priority": "技能加點優先順序",
- "items_starter": "初始裝備",
- "items_core": "核心裝備",
- "items_boots": "鞋子",
- "items_last": "後期裝備",
- "counters": "苦手對手",
- "runes_full": "符文頁已滿。請在客戶端刪除一頁,讓 OmniGet 建立自己的頁面。",
- "build_empty": "樣本中還沒有該英雄的對戰。",
- "tab_meta": "版本",
- "runes_title": "符文",
- "runes_desc": "由遊戲客戶端本身為你鎖定的英雄推薦的符文頁與召喚師技能,始終對應目前版本。",
- "runes_auto": "自動套用符文",
- "runes_auto_desc": "鎖定英雄後,自動建立並選取第一個推薦符文頁。",
- "runes_apply": "套用",
- "runes_default": "預設",
- "runes_spells": "召喚師技能",
- "runes_empty": "在英雄選擇中鎖定英雄即可查看推薦符文頁。",
- "tiers_title": "英雄強度榜",
- "tiers_desc": "依位置排名,含勝率、選用率與禁用率。資料來自 op.gg。",
- "tiers_position": "位置",
- "tiers_pick": "選用",
- "tiers_ban": "禁用",
- "tiers_empty": "強度榜暫時無法使用。",
- "impact_label": "影響力",
- "score_label": "評分",
- "score_hint": "近期排位與一般對局的平均值。有效對局少於五場時隱藏。",
- "copy_riot_id": "複製 Riot ID",
- "impact_hint": "由 KDA、參團率、輸出、承傷、經濟、視野與補兵合成的 0-10 分指標",
- "tab_search": "搜尋",
- "search_title": "尋找玩家",
- "search_placeholder": "Riot ID,例如 Faker#KR1",
- "search_button": "搜尋",
- "searching_player": "搜尋中…",
- "search_hint": "輸入帶標籤的 Riot ID,查看段位、近期狀態與各英雄表現。",
- "search_recent": "近期狀態",
- "search_champions": "英雄",
- "search_champions_hint": "2 場以上,依場次排序",
- "search_mastery": "熟練度",
- "stat_winrate": "勝率",
- "games_short": "場",
- "duos_title": "最佳雙排",
- "duos_desc": "根據近期對戰,與你勝率最高的隊友。評分會壓縮小樣本,避免運氣好的兩場登頂。",
- "duos_empty": "樣本中還沒有重複出現的隊友。",
- "duos_score": "評分",
- "jungle_title": "前期打野路線",
- "jungle_empty": "這些對戰沒有時間軸資料。",
- "jungle_invade": "入侵",
- "jungle_gank3": "3 等 gank",
- "zone_top": "上路",
- "zone_mid": "中路",
- "zone_bot": "下路",
- "pref_top": "偏上路",
- "pref_mid": "偏中路",
- "pref_bot": "偏下路",
- "pref_top_mid": "偏上中路",
- "pref_mid_bot": "偏中下路",
- "pref_balanced": "路線均衡",
- "pref_unknown": "資料不足",
- "chat_placeholder": "在英雄選擇中傳送的訊息",
- "chat_build": "產生摘要",
- "chat_send": "傳送",
- "tab_overview": "總覽",
- "tab_analysis": "分析",
- "tab_live": "即時",
- "tab_goals": "目標",
- "tab_automation": "自動化",
- "tab_history": "歷史",
- "win_title": "勝率預測",
- "win_allies": "我方",
- "win_interval": "90% 區間",
- "win_gap": "評分差",
- "win_known": "名玩家有資料",
- "win_disclaimer": "配對系統以 50% 勝率組建對戰,因此誠實的估計都接近五五開。請當作傾向參考,而非定論。",
- "win_unavailable": "在英雄選擇與對戰中可用。",
- "premades": "開黑小隊",
- "premade_source_party": "遊戲提供的資訊",
- "premade_source_history": "根據共同戰績推測",
- "players": "名玩家",
- "objectives_title": "目標與事件",
- "objectives_estimate": "重生時間是根據目前版本的估算,並非遊戲提供的數值。",
- "objective_baron": "納什男爵",
- "objective_dragon": "巨龍",
- "objective_inhibitor": "水晶兵營",
- "event_kill": "擊殺:",
- "event_turret": "防禦塔被摧毀:",
- "event_inhib": "水晶兵營被摧毀:",
- "event_dragon": "擊殺巨龍",
- "event_baron": "擊殺男爵",
- "event_herald": "擊殺峽谷先鋒",
- "event_multikill": "多殺:",
- "event_ace": "團滅方",
- "event_first_turret": "首塔:",
- "event_first_blood": "一血:",
- "gold_title": "即時經濟",
- "gold_unavailable": "進入對戰後可查看經濟與對線差距。",
- "your_team": "我方",
- "enemy_team": "敵方",
- "col_player": "玩家",
- "col_gold": "金幣",
- "col_diff": "對線差",
- "goals_live": "本場目標",
- "goals_title": "表現目標",
- "goals_role": "位置",
- "goals_desc": "依位置設定的目標,用於評估當前對戰。可依自己的水準調整。",
- "goals_reset": "恢復預設",
- "goal_cs": "每分鐘補兵",
- "goal_gold": "每分鐘金幣",
- "goal_kda": "KDA",
- "goal_vision": "每分鐘視野",
- "role_top": "上路",
- "role_jungle": "打野",
- "role_middle": "中路",
- "role_bottom": "射手",
- "role_utility": "輔助",
- "role_fill": "補位",
- "role_preference": "分路偏好",
- "role_first": "主選分路",
- "role_second": "副選分路",
- "scout_title": "對戰分析",
- "scout_allies": "隊友",
- "scout_enemies": "敵方",
- "scout_enemies_hidden": "對戰開始後才會顯示敵方玩家。",
- "scout_note_placeholder": "關於該玩家的個人備註…",
- "marked_in_allies": "你對己方有備註:",
- "marked_in_enemies": "你對敵方有備註:",
- "squad_enemy": "五名敵人一起排隊,且所有生涯都已隱藏。",
- "squad_ally": "你們五人一起排隊,且所有生涯都已隱藏。",
- "scout_private": "隱私資料",
- "tag_hot_streak": "連勝中",
- "tag_cold_streak": "連敗中",
- "tag_high_winrate": "高勝率",
- "tag_low_winrate": "低勝率",
- "tag_one_trick": "絕活哥",
- "tag_high_kda": "高KDA",
- "tag_low_kda": "低KDA",
- "lobby_title": "開始遊戲",
- "lobby_hint": "客戶端就緒後,房間操作會顯示在這裡。",
- "searching": "正在尋找對戰…",
- "start_queue": "尋找對戰",
- "stop_queue": "取消尋找",
- "leave_lobby": "離開房間",
- "play_again": "再來一場",
- "champ_select_title": "英雄選擇",
- "bench_title": "候補席",
- "reroll": "重骰",
- "reroll_keep": "重隨但保留英雄",
- "reroll_keep_hint": "花費重隨擴充備選席,並把你目前的英雄換回來。",
- "swap": "交換",
- "remove": "移除",
- "live_title": "進行中的對戰",
- "respawn_in": "復活倒數",
- "automation_title": "自動化",
- "notify_ready": "找到對局時通知",
- "notify_ready_desc": "僅在 OmniGet 視窗未取得焦點時發送系統通知。",
- "auto_pick": "自動選角",
- "auto_pick_desc": "輪到你時自動選擇清單中第一個可用的英雄。",
- "auto_ban": "自動禁用",
- "auto_ban_desc": "自動禁用禁用清單中第一個可用的英雄。",
- "pick_confirm": "如何完成選擇",
- "pick_confirm_desc": "預選會把英雄展示給隊友,同時把決定權留給你。",
- "pick_confirm_declare": "僅預選",
- "pick_confirm_timeout": "最後鎖定",
- "pick_confirm_immediate": "立即鎖定",
- "auto_lock": "自動鎖定",
- "auto_lock_desc": "關閉 = 僅顯示意向,由你自己確認鎖定。",
- "auto_honor": "自動點讚",
- "auto_honor_desc": "對局結束後自動點讚隊友,優先選擇與你一同排隊的人。",
- "auto_play_again": "自動再來一場",
- "auto_play_again_desc": "結算畫面出現後立即返回房間。",
- "auto_requeue": "隨後繼續尋找對局",
- "auto_requeue_desc": "大廳恢復後開始尋找,僅當你是房主時。",
- "auto_swaps": "接受位置與選擇順序交換",
- "auto_swaps_desc": "接受隊友在英雄選擇中請求交換分路或選擇順序。",
- "auto_reconnect": "自動重新連線",
- "auto_reconnect_desc": "客戶端斷線時自動重新連線對局。",
- "spectate": "觀戰",
- "spectate_loading": "正在啟動觀戰…",
- "spectate_not_in_game": "該玩家目前不在對局中。",
- "dodge": "閃退",
- "dodge_warning": "現在退出將視為閃退:你會失去積分並受到排隊延遲。",
- "dodge_confirm": "仍要退出",
- "unavailable_platform": "此系統不支援。",
- "unavailable_client": "請開啟英雄聯盟客戶端後使用。",
- "unavailable_game": "對局進行中可用。",
- "badge_beta": "測試版",
- "badge_experimental": "實驗性",
- "profile_tools": "自訂個人檔案",
- "profile_icon": "召喚師頭像",
- "profile_icon_saved": "頭像已更新。",
- "profile_status": "上線狀態",
- "profile_status_saved": "上線狀態已更新。",
- "status_chat": "上線",
- "status_away": "離開",
- "status_dnd": "忙碌",
- "profile_message": "狀態訊息",
- "profile_message_saved": "狀態訊息已更新。",
- "profile_background": "生涯背景",
- "profile_background_saved": "背景已更新。",
- "profile_no_skins": "帳號沒有該英雄的造型。",
- "apply": "套用",
- "restart_ux": "重啟客戶端介面",
- "restart_ux_warning": "重新載入客戶端介面。你的排隊位置與英雄選擇會保留。",
- "restart_ux_confirm": "重啟介面",
- "dodge_cancel": "留下",
- "auto_trade": "英雄交換",
- "auto_trade_desc": "如何回應選角階段隊友的交換請求。",
- "auto_trade_off": "詢問我",
- "auto_trade_accept": "全部接受",
- "auto_trade_decline": "全部拒絕",
- "auto_message": "選角問候語",
- "auto_message_desc": "選角開始時向隊伍聊天發送一次。留空則關閉。",
- "auto_message_placeholder": "例如:glhf :)",
- "tag_flash_swap": "閃現鍵位不固定",
- "tag_high_damage_efficiency": "每金幣傷害高",
- "tag_low_damage_efficiency": "每金幣傷害低",
- "solo_kills_label": "單殺/場",
- "early_deaths_label": "15分鐘前死亡/場",
- "seen_before": "遇過",
- "seen_before_hint": "你之前與該玩家同隊或對戰過。",
- "spell_timer_hint": "對方使用召喚師技能時點擊開始計時。",
- "obj_towers": "防禦塔",
- "obj_inhibitors": "水晶兵營",
- "obj_heralds": "峽谷先鋒",
- "obj_bans": "禁用",
- "open_player": "查看該玩家的近期對局",
- "close": "關閉",
- "stat_level": "等級",
- "stat_damage": "造成",
- "stat_taken": "承受",
- "stat_mitigated": "減免",
- "stat_healing": "治療",
- "stat_objectives": "目標",
- "stat_gold_min": "金幣/分",
- "stat_cs_min": "補刀/分",
- "stat_vision": "視野",
- "stat_wards": "眼位 放/排/控",
- "stat_cc": "控制",
- "stat_spree": "最高連殺",
- "stat_penta": "五殺",
- "stat_quadra": "四殺",
- "stat_triple": "三殺",
- "stat_first_blood": "一血",
- "stat_first_tower": "首塔",
- "match_damage": "傷害",
- "match_detail_unavailable": "無法取得對局詳情。",
- "pick_list": "選角優先序",
- "ban_delay": "禁用前等待",
- "ban_delay_desc": "延後禁用,並跳過隊友已經預選的英雄。",
- "ban_list": "禁用優先序",
- "list_hint": "順序有影響",
- "search_champion": "搜尋英雄…",
- "phase_lobby": "房間中",
- "phase_matchmaking": "列隊中",
- "phase_ready_check": "找到對戰!",
- "phase_champ_select": "英雄選擇",
- "phase_in_progress": "對戰中",
- "phase_end_of_game": "對戰結束",
- "nav": "英雄聯盟",
- "settings_title": "英雄聯盟",
- "settings_desc": "可選的 League 客戶端選單。預設關閉。",
- "settings_enable": "啟用英雄聯盟選單",
- "settings_enable_desc": "新增帶有客戶端工具的英雄聯盟選單。需要 League 客戶端運行中。",
- "settings_auto_accept": "自動接受對戰",
- "settings_auto_accept_desc": "找到對戰時自動接受準備確認。",
- "disabled_title": "英雄聯盟選單已關閉",
- "disabled_body": "在 設定 → 進階 → 英雄聯盟 中啟用。啟用之前不會執行任何內容。",
- "open_settings": "開啟設定",
- "connected": "已連線",
- "disconnected_title": "未偵測到客戶端",
- "disconnected_body": "開啟英雄聯盟客戶端後,此頁面會自動連線。",
- "level": "等級",
- "phase_label": "客戶端狀態",
- "accept_now": "接受對戰",
- "auto_accept": "自動接受對戰",
- "auto_accept_desc": "對戰跳出的瞬間自動幫你接受。",
- "accept_delay": "接受前等待",
- "accept_delay_instant": "立即",
- "accept_delay_desc": "留出時間讓你自己拒絕。等待期間拒絕會取消自動接受。",
- "ranked_solo": "單雙積分",
- "ranked_flex": "彈性積分",
- "unranked": "未定位",
- "history_title": "最近對戰",
- "filter_queue": "依隊列篩選",
- "filter_all": "全部",
- "summary_games": "場對局",
- "summary_win_short": "勝",
- "summary_loss_short": "敗",
- "summary_remakes": "重開局未計入",
- "history_empty": "尚未找到對戰。",
- "refresh": "重新整理",
- "victory": "勝利",
- "defeat": "敗北",
- "tab_profile": "個人資料",
- "tab_coach": "教練",
- "profile_title": "資料編輯器",
- "profile_desc": "客戶端允許你修改的、別人看到你的一切。這裡不會碰到遊戲本身。",
- "profile_section_presence": "線上狀態",
- "status_offline": "離線",
- "status_mobile": "手機",
- "profile_message_hint": "最多 255 個字元。客戶端自己的輸入框只到 140。",
- "profile_section_icon": "頭像",
- "profile_icon_search": "以名稱或 id 搜尋頭像",
- "profile_icon_chat": "聊天頭像",
- "profile_icon_chat_saved": "聊天頭像已更新",
- "profile_icon_hint": "資料頭像必須是你擁有的。聊天頭像(懸浮卡與好友列表)可用任意頭像。",
- "profile_section_rank": "聊天中顯示的牌位",
- "rank_queue": "佇列",
- "rank_tier": "牌位",
- "rank_division": "階級",
- "rank_reset": "恢復真實牌位",
- "rank_saved": "聊天牌位已更新",
- "rank_hint": "只有懸浮卡與社交卡片會變。你的積分成績不受影響。",
- "crystal_title": "挑戰水晶",
- "crystal_level": "等級",
- "crystal_points": "點數",
- "crystal_saved": "水晶已更新",
- "tokens_title": "徽章、稱號與旗幟",
- "tokens_desc": "為資料選擇最多三枚挑戰徽章。同一枚徽章可以填滿所有位置。",
- "tokens_slot": "位置",
- "tokens_empty": "還沒有獲得徽章",
- "tokens_none": "無",
- "tokens_clear": "清空",
- "tokens_saved": "資料偏好已更新",
- "tokens_search": "篩選徽章",
- "title_label": "稱號",
- "title_none": "無稱號",
- "banner_label": "旗幟",
- "banner_none": "無旗幟",
- "friends_title": "好友",
- "friends_desc": "載入列表,勾選要刪除的人,確認。刪除無法復原。",
- "friends_load": "載入",
- "friends_select_all": "選取可見項",
- "friends_clear_selection": "清除選取",
- "friends_remove": "刪除所選",
- "friends_remove_confirm": "他們將永久從你的好友列表移除。",
- "friends_remove_go": "刪除",
- "friends_removed": "已刪除",
- "friends_count": "好友",
- "wallet_rp": "RP",
- "wallet_be": "藍色精萃",
- "raffle_title": "抽籤",
- "raffle_lane": "抽一條路",
- "raffle_lane_apply": "設為偏好",
- "raffle_champion": "抽一個英雄",
- "raffle_class_any": "任意職業",
- "raffle_class_fighter": "戰士",
- "raffle_class_mage": "法師",
- "raffle_class_assassin": "刺客",
- "raffle_class_marksman": "射手",
- "raffle_class_support": "輔助",
- "raffle_class_tank": "坦克",
- "raffle_declare": "預選",
- "raffle_lock": "鎖定",
- "raffle_again": "再抽一次",
- "raffle_pool": "個英雄在池中",
- "skin_title": "造型輪盤",
- "skin_roll": "抽造型",
- "skin_roll_ward": "抽守衛",
- "skin_rolled": "抽到",
- "skin_lock_first": "先鎖定一個英雄",
- "pick_random": "隨機英雄",
- "pick_random_desc": "忽略列表,鎖定一個隨機可用英雄,積分也生效。會避開隊友正在預選的英雄。",
- "skin_roulette": "造型輪盤",
- "skin_roulette_desc": "鎖定英雄的瞬間,隨機套用一款你擁有的造型與炫彩。最近抽到的會被跳過。",
- "skin_include_base": "包含原始造型",
- "ward_roulette": "守衛輪盤",
- "ward_roulette_desc": "鎖定時也隨機選一款你擁有的守衛造型。",
- "sgp_enabled": "後端資料 (SGP)",
- "sgp_enabled_desc": "當客戶端本機戰績很少或被隱藏時,用客戶端自己的令牌直接詢問 Riot 後端。同時啟用重播下載。",
- "coach_title": "AI 教練",
- "coach_desc": "已設定的 AI 模型讀取你自己的對戰資料以及 OP.GG 的版本資料,以教練身分回答。",
- "coach_not_configured": "請先設定 AI 提供者。",
- "coach_open_settings": "開啟設定",
- "coach_style": "語氣",
- "coach_style_objective": "客觀",
- "coach_style_roast": "毒舌",
- "coach_style_praise": "鼓勵",
- "coach_review_title": "復盤一場",
- "coach_review_pick": "選擇最近一場",
- "coach_review_run": "復盤",
- "coach_trends_title": "趨勢",
- "coach_trends_games": "場",
- "coach_trends_run": "分析",
- "coach_ask_title": "問教練",
- "coach_ask_placeholder": "關於目前選角、對戰或你最近狀態的任何問題",
- "coach_ask_run": "提問",
- "coach_quick_draft": "分析這個陣容並給我一個計畫",
- "coach_quick_early": "我的前 10 分鐘該怎麼打?",
- "coach_quick_now": "我現在該做什麼?",
- "coach_quick_improve": "我該先改什麼?",
- "coach_working": "思考中…",
- "coach_result": "教練",
- "coach_copy": "複製",
- "coach_copied": "已複製",
- "coach_error_no_games": "沒有可分析的最近對戰",
- "coach_privacy": "對戰資料以及必要時的 OP.GG 版本資料會傳送給你設定的 AI 提供者。",
- "replay_download": "下載重播",
- "replay_downloading": "下載中…",
- "replay_saved": "重播已儲存到",
- "review_ai": "用 AI 復盤",
- "history_source_sgp": "來自後端",
- "search_source_sgp": "客戶端隱藏了戰績,已改從 Riot 後端 (SGP) 取得。"
- },
"nav": {
"home": "首頁",
"downloads": "下載",
diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.json
index 119e298b..5460611f 100644
--- a/src/lib/i18n/zh.json
+++ b/src/lib/i18n/zh.json
@@ -54,422 +54,6 @@
"nav_home": "前往首页",
"nav_downloads": "前往下载"
},
- "league": {
- "cd_title": "敌方冷却",
- "cd_desc": "基础冷却取自游戏本身的英雄数据,再除以其装备提供的技能急速。技能等级由角色等级推算,因此为近似值。",
- "cd_estimated": "估算",
- "cd_haste": "急速",
- "col_gold_hint": "显示的金币是每位玩家装备上的价值,按游戏自身的物品数据计价——这是其他玩家唯一可见的经济数据。",
- "scout_no_history": "没有近期对局",
- "build_title": "出装",
- "build_desc": "根据你自己近期对局中该英雄的出装统计得出——不使用第三方出装网站,因此样本较小且如实标注。",
- "build_champion": "选择英雄",
- "build_samples": "场对局",
- "meta_reference": "出装参考",
- "meta_source": "根据当前版本的 op.gg 公开数据汇总。仅作参考,不会自动应用。",
- "skill_priority": "技能加点优先级",
- "items_starter": "初始装备",
- "items_core": "核心装备",
- "items_boots": "鞋子",
- "items_last": "后期装备",
- "counters": "苦手对手",
- "runes_full": "符文页已满。请在客户端删除一页,让 OmniGet 创建自己的页面。",
- "build_empty": "样本中还没有该英雄的对局。",
- "tab_meta": "版本",
- "runes_title": "符文",
- "runes_desc": "由游戏客户端本身为你锁定的英雄推荐的符文页与召唤师技能,始终对应当前版本。",
- "runes_auto": "自动应用符文",
- "runes_auto_desc": "锁定英雄后,自动创建并选中第一个推荐符文页。",
- "runes_apply": "应用",
- "runes_default": "默认",
- "runes_spells": "召唤师技能",
- "runes_empty": "在英雄选择中锁定英雄即可查看推荐符文页。",
- "tiers_title": "英雄强度榜",
- "tiers_desc": "按位置排名,含胜率、登场率与禁用率。数据来自 op.gg。",
- "tiers_position": "位置",
- "tiers_pick": "登场",
- "tiers_ban": "禁用",
- "tiers_empty": "强度榜暂时不可用。",
- "impact_label": "影响力",
- "score_label": "评分",
- "score_hint": "近期排位与普通对局的平均值。有效对局少于五场时隐藏。",
- "copy_riot_id": "复制 Riot ID",
- "impact_hint": "由 KDA、参团率、输出、承伤、经济、视野和补刀合成的 0-10 分指标",
- "tab_search": "搜索",
- "search_title": "查找玩家",
- "search_placeholder": "Riot ID,例如 Faker#KR1",
- "search_button": "搜索",
- "searching_player": "搜索中…",
- "search_hint": "输入带标签的 Riot ID,查看段位、近期状态和各英雄表现。",
- "search_recent": "近期状态",
- "search_champions": "英雄",
- "search_champions_hint": "2 场以上,按场次排序",
- "search_mastery": "熟练度",
- "stat_winrate": "胜率",
- "games_short": "场",
- "duos_title": "最佳双排",
- "duos_desc": "根据近期对局,与你胜率最高的队友。评分会压缩小样本,避免运气好的两场登顶。",
- "duos_empty": "样本中还没有重复出现的队友。",
- "duos_score": "评分",
- "jungle_title": "前期打野路线",
- "jungle_empty": "这些对局没有时间轴数据。",
- "jungle_invade": "入侵",
- "jungle_gank3": "3 级 gank",
- "zone_top": "上路",
- "zone_mid": "中路",
- "zone_bot": "下路",
- "pref_top": "偏上路",
- "pref_mid": "偏中路",
- "pref_bot": "偏下路",
- "pref_top_mid": "偏上中路",
- "pref_mid_bot": "偏中下路",
- "pref_balanced": "路线均衡",
- "pref_unknown": "数据不足",
- "chat_placeholder": "在英雄选择中发送的消息",
- "chat_build": "生成摘要",
- "chat_send": "发送",
- "tab_overview": "总览",
- "tab_analysis": "分析",
- "tab_live": "实时",
- "tab_goals": "目标",
- "tab_automation": "自动化",
- "tab_history": "历史",
- "win_title": "胜率预测",
- "win_allies": "我方",
- "win_interval": "90% 区间",
- "win_gap": "评分差",
- "win_known": "名玩家有数据",
- "win_disclaimer": "匹配系统按 50% 胜率组建对局,因此诚实的估计都接近五五开。请当作倾向参考,而非定论。",
- "win_unavailable": "在英雄选择和对局中可用。",
- "premades": "开黑小队",
- "premade_source_party": "游戏提供的信息",
- "premade_source_history": "根据共同战绩推测",
- "players": "名玩家",
- "objectives_title": "目标与事件",
- "objectives_estimate": "重生时间是基于当前版本的估算,并非游戏提供的数值。",
- "objective_baron": "纳什男爵",
- "objective_dragon": "巨龙",
- "objective_inhibitor": "水晶兵营",
- "event_kill": "击杀:",
- "event_turret": "防御塔被摧毁:",
- "event_inhib": "水晶兵营被摧毁:",
- "event_dragon": "击杀巨龙",
- "event_baron": "击杀男爵",
- "event_herald": "击杀峡谷先锋",
- "event_multikill": "多杀:",
- "event_ace": "团灭方",
- "event_first_turret": "首塔:",
- "event_first_blood": "一血:",
- "gold_title": "实时经济",
- "gold_unavailable": "进入对局后可查看经济与对线差距。",
- "your_team": "我方",
- "enemy_team": "敌方",
- "col_player": "玩家",
- "col_gold": "金币",
- "col_diff": "对线差",
- "goals_live": "本局目标",
- "goals_title": "表现目标",
- "goals_role": "位置",
- "goals_desc": "按位置设定的目标,用于评估当前对局。可根据自己的水平调整。",
- "goals_reset": "恢复默认",
- "goal_cs": "每分钟补刀",
- "goal_gold": "每分钟金币",
- "goal_kda": "KDA",
- "goal_vision": "每分钟视野",
- "role_top": "上单",
- "role_jungle": "打野",
- "role_middle": "中单",
- "role_bottom": "射手",
- "role_utility": "辅助",
- "role_fill": "补位",
- "role_preference": "分路偏好",
- "role_first": "主选分路",
- "role_second": "副选分路",
- "scout_title": "对局分析",
- "scout_allies": "队友",
- "scout_enemies": "敌方",
- "scout_enemies_hidden": "对局开始后才会显示敌方玩家。",
- "scout_note_placeholder": "关于该玩家的个人备注…",
- "marked_in_allies": "你对己方有备注:",
- "marked_in_enemies": "你对敌方有备注:",
- "squad_enemy": "五名敌人一起排队,且所有生涯都已隐藏。",
- "squad_ally": "你们五人一起排队,且所有生涯都已隐藏。",
- "scout_private": "隐私资料",
- "tag_hot_streak": "连胜中",
- "tag_cold_streak": "连败中",
- "tag_high_winrate": "高胜率",
- "tag_low_winrate": "低胜率",
- "tag_one_trick": "绝活哥",
- "tag_high_kda": "高KDA",
- "tag_low_kda": "低KDA",
- "lobby_title": "开始游戏",
- "lobby_hint": "客户端就绪后,房间操作会显示在这里。",
- "searching": "正在寻找对局…",
- "start_queue": "寻找对局",
- "stop_queue": "取消寻找",
- "leave_lobby": "离开房间",
- "play_again": "再来一局",
- "champ_select_title": "英雄选择",
- "bench_title": "候选席",
- "reroll": "重随",
- "reroll_keep": "重随但保留英雄",
- "reroll_keep_hint": "花费重随扩充备选席,并把你当前的英雄换回来。",
- "swap": "交换",
- "remove": "移除",
- "live_title": "进行中的对局",
- "respawn_in": "复活倒计时",
- "automation_title": "自动化",
- "notify_ready": "找到对局时通知",
- "notify_ready_desc": "仅在 OmniGet 窗口未获得焦点时发送系统通知。",
- "auto_pick": "自动选英雄",
- "auto_pick_desc": "轮到你时自动选择列表中第一个可用的英雄。",
- "auto_ban": "自动禁用",
- "auto_ban_desc": "自动禁用禁用列表中第一个可用的英雄。",
- "pick_confirm": "如何完成选择",
- "pick_confirm_desc": "预选会把英雄展示给队友,同时把决定权留给你。",
- "pick_confirm_declare": "仅预选",
- "pick_confirm_timeout": "最后锁定",
- "pick_confirm_immediate": "立即锁定",
- "auto_lock": "自动锁定",
- "auto_lock_desc": "关闭 = 仅亮出意向,由你自己确认锁定。",
- "auto_honor": "自动点赞",
- "auto_honor_desc": "对局结束后自动点赞队友,优先选择与你一同排队的人。",
- "auto_play_again": "自动再来一局",
- "auto_play_again_desc": "结算界面出现后立即返回房间。",
- "auto_requeue": "随后继续寻找对局",
- "auto_requeue_desc": "大厅恢复后开始寻找,仅当你是房主时。",
- "auto_swaps": "接受位置与选择顺序交换",
- "auto_swaps_desc": "接受队友在英雄选择中请求交换分路或选择顺序。",
- "auto_reconnect": "自动重连",
- "auto_reconnect_desc": "客户端掉线时自动重新连接对局。",
- "spectate": "观战",
- "spectate_loading": "正在启动观战…",
- "spectate_not_in_game": "该玩家当前不在对局中。",
- "dodge": "秒退",
- "dodge_warning": "现在退出将视为秒退:你会扣除胜点并受到排队惩罚。",
- "dodge_confirm": "仍要退出",
- "unavailable_platform": "此系统不支持。",
- "unavailable_client": "请打开英雄联盟客户端后使用。",
- "unavailable_game": "对局进行中可用。",
- "badge_beta": "测试版",
- "badge_experimental": "实验性",
- "profile_tools": "自定义资料",
- "profile_icon": "召唤师图标",
- "profile_icon_saved": "图标已更新。",
- "profile_status": "在线状态",
- "profile_status_saved": "在线状态已更新。",
- "status_chat": "在线",
- "status_away": "离开",
- "status_dnd": "忙碌",
- "profile_message": "状态信息",
- "profile_message_saved": "状态信息已更新。",
- "profile_background": "生涯背景",
- "profile_background_saved": "背景已更新。",
- "profile_no_skins": "账号没有该英雄的皮肤。",
- "apply": "应用",
- "restart_ux": "重启客户端界面",
- "restart_ux_warning": "重新加载客户端界面。你的排队位置和英雄选择会保留。",
- "restart_ux_confirm": "重启界面",
- "dodge_cancel": "留下",
- "auto_trade": "英雄交换",
- "auto_trade_desc": "如何回应选人阶段队友的交换请求。",
- "auto_trade_off": "询问我",
- "auto_trade_accept": "全部接受",
- "auto_trade_decline": "全部拒绝",
- "auto_message": "选人问候语",
- "auto_message_desc": "选人开始时向队伍聊天发送一次。留空则关闭。",
- "auto_message_placeholder": "例如:glhf :)",
- "tag_flash_swap": "闪现键位不固定",
- "tag_high_damage_efficiency": "每金币伤害高",
- "tag_low_damage_efficiency": "每金币伤害低",
- "solo_kills_label": "单杀/场",
- "early_deaths_label": "15分钟前死亡/场",
- "seen_before": "遇到过",
- "seen_before_hint": "你之前与该玩家同队或对阵过。",
- "spell_timer_hint": "对方使用召唤师技能时点击开始计时。",
- "obj_towers": "防御塔",
- "obj_inhibitors": "水晶兵营",
- "obj_heralds": "峡谷先锋",
- "obj_bans": "禁用",
- "open_player": "查看该玩家的近期对局",
- "close": "关闭",
- "stat_level": "等级",
- "stat_damage": "造成",
- "stat_taken": "承受",
- "stat_mitigated": "减免",
- "stat_healing": "治疗",
- "stat_objectives": "目标",
- "stat_gold_min": "金币/分",
- "stat_cs_min": "补刀/分",
- "stat_vision": "视野",
- "stat_wards": "眼位 放/排/控",
- "stat_cc": "控制",
- "stat_spree": "最高连杀",
- "stat_penta": "五杀",
- "stat_quadra": "四杀",
- "stat_triple": "三杀",
- "stat_first_blood": "一血",
- "stat_first_tower": "首塔",
- "match_damage": "伤害",
- "match_detail_unavailable": "无法获取对局详情。",
- "pick_list": "选用优先级",
- "ban_delay": "禁用前等待",
- "ban_delay_desc": "延后禁用,并跳过队友已经预选的英雄。",
- "ban_list": "禁用优先级",
- "list_hint": "顺序有影响",
- "search_champion": "搜索英雄…",
- "phase_lobby": "房间中",
- "phase_matchmaking": "队列中",
- "phase_ready_check": "找到对局!",
- "phase_champ_select": "英雄选择",
- "phase_in_progress": "对局中",
- "phase_end_of_game": "对局结束",
- "nav": "英雄联盟",
- "settings_title": "英雄联盟",
- "settings_desc": "可选的 League 客户端菜单。默认关闭。",
- "settings_enable": "启用英雄联盟菜单",
- "settings_enable_desc": "添加带有客户端工具的英雄联盟菜单。需要 League 客户端处于运行状态。",
- "settings_auto_accept": "自动接受对局",
- "settings_auto_accept_desc": "找到对局时自动接受准备确认。",
- "disabled_title": "英雄联盟菜单已关闭",
- "disabled_body": "在 设置 → 高级 → 英雄联盟 中启用。启用之前不会运行任何内容。",
- "open_settings": "打开设置",
- "connected": "已连接",
- "disconnected_title": "未检测到客户端",
- "disconnected_body": "打开英雄联盟客户端后,此页面会自动连接。",
- "level": "等级",
- "phase_label": "客户端状态",
- "accept_now": "接受对局",
- "auto_accept": "自动接受对局",
- "auto_accept_desc": "对局弹出的瞬间自动帮你接受。",
- "accept_delay": "接受前等待",
- "accept_delay_instant": "立即",
- "accept_delay_desc": "留出时间让你自己拒绝。等待期间拒绝会取消自动接受。",
- "ranked_solo": "单双排位",
- "ranked_flex": "灵活排位",
- "unranked": "未定级",
- "history_title": "最近对局",
- "filter_queue": "按队列筛选",
- "filter_all": "全部",
- "summary_games": "场对局",
- "summary_win_short": "胜",
- "summary_loss_short": "负",
- "summary_remakes": "重开局未计入",
- "history_empty": "暂未找到对局。",
- "refresh": "刷新",
- "victory": "胜利",
- "defeat": "失败",
- "tab_profile": "个人资料",
- "tab_coach": "教练",
- "profile_title": "资料编辑器",
- "profile_desc": "客户端允许你修改的、别人看到你的一切。这里不会触碰游戏本身。",
- "profile_section_presence": "在线状态",
- "status_offline": "离线",
- "status_mobile": "手机",
- "profile_message_hint": "最多 255 个字符。客户端自己的输入框只到 140。",
- "profile_section_icon": "头像",
- "profile_icon_search": "按名称或 id 搜索头像",
- "profile_icon_chat": "聊天头像",
- "profile_icon_chat_saved": "聊天头像已更新",
- "profile_icon_hint": "资料头像必须是你拥有的。聊天头像(悬浮卡和好友列表)可以用任意头像。",
- "profile_section_rank": "聊天中显示的段位",
- "rank_queue": "队列",
- "rank_tier": "段位",
- "rank_division": "小段",
- "rank_reset": "恢复真实段位",
- "rank_saved": "聊天段位已更新",
- "rank_hint": "只有悬浮卡和社交卡片会变。你的排位成绩不受影响。",
- "crystal_title": "挑战水晶",
- "crystal_level": "等级",
- "crystal_points": "点数",
- "crystal_saved": "水晶已更新",
- "tokens_title": "徽章、称号和旗帜",
- "tokens_desc": "为资料选择最多三枚挑战徽章。同一枚徽章可以填满所有位置。",
- "tokens_slot": "位置",
- "tokens_empty": "还没有获得徽章",
- "tokens_none": "无",
- "tokens_clear": "清空",
- "tokens_saved": "资料偏好已更新",
- "tokens_search": "筛选徽章",
- "title_label": "称号",
- "title_none": "无称号",
- "banner_label": "旗帜",
- "banner_none": "无旗帜",
- "friends_title": "好友",
- "friends_desc": "加载列表,勾选要删除的人,确认。删除不可恢复。",
- "friends_load": "加载",
- "friends_select_all": "选中可见项",
- "friends_clear_selection": "清除选择",
- "friends_remove": "删除所选",
- "friends_remove_confirm": "他们将永久从你的好友列表中移除。",
- "friends_remove_go": "删除",
- "friends_removed": "已删除",
- "friends_count": "好友",
- "wallet_rp": "RP",
- "wallet_be": "蓝色精萃",
- "raffle_title": "抽签",
- "raffle_lane": "抽一条路",
- "raffle_lane_apply": "设为偏好",
- "raffle_champion": "抽一个英雄",
- "raffle_class_any": "任意职业",
- "raffle_class_fighter": "战士",
- "raffle_class_mage": "法师",
- "raffle_class_assassin": "刺客",
- "raffle_class_marksman": "射手",
- "raffle_class_support": "辅助",
- "raffle_class_tank": "坦克",
- "raffle_declare": "预选",
- "raffle_lock": "锁定",
- "raffle_again": "再抽一次",
- "raffle_pool": "个英雄在池中",
- "skin_title": "皮肤轮盘",
- "skin_roll": "抽皮肤",
- "skin_roll_ward": "抽守卫",
- "skin_rolled": "抽到",
- "skin_lock_first": "先锁定一个英雄",
- "pick_random": "随机英雄",
- "pick_random_desc": "忽略列表,锁定一个随机可用英雄,排位也生效。会避开队友正在预选的英雄。",
- "skin_roulette": "皮肤轮盘",
- "skin_roulette_desc": "锁定英雄的瞬间,随机套用一款你拥有的皮肤和炫彩。最近抽到的会被跳过。",
- "skin_include_base": "包含原皮",
- "ward_roulette": "守卫轮盘",
- "ward_roulette_desc": "锁定时也随机选一款你拥有的守卫皮肤。",
- "sgp_enabled": "后端数据 (SGP)",
- "sgp_enabled_desc": "当客户端本地战绩很少或被隐藏时,用客户端自己的令牌直接询问 Riot 后端。同时启用回放下载。",
- "coach_title": "AI 教练",
- "coach_desc": "已配置的 AI 模型读取你自己的对局数据以及 OP.GG 的版本数据,以教练身份作答。",
- "coach_not_configured": "请先配置 AI 提供方。",
- "coach_open_settings": "打开设置",
- "coach_style": "语气",
- "coach_style_objective": "客观",
- "coach_style_roast": "毒舌",
- "coach_style_praise": "鼓励",
- "coach_review_title": "复盘一局",
- "coach_review_pick": "选择最近一局",
- "coach_review_run": "复盘",
- "coach_trends_title": "趋势",
- "coach_trends_games": "局",
- "coach_trends_run": "分析",
- "coach_ask_title": "问教练",
- "coach_ask_placeholder": "关于当前选人、对局或你最近状态的任何问题",
- "coach_ask_run": "提问",
- "coach_quick_draft": "分析这个阵容并给我一个计划",
- "coach_quick_early": "我的前 10 分钟该怎么打?",
- "coach_quick_now": "我现在该做什么?",
- "coach_quick_improve": "我该先改什么?",
- "coach_working": "思考中…",
- "coach_result": "教练",
- "coach_copy": "复制",
- "coach_copied": "已复制",
- "coach_error_no_games": "没有可分析的最近对局",
- "coach_privacy": "对局数据以及必要时的 OP.GG 版本数据会发送给你配置的 AI 提供方。",
- "replay_download": "下载回放",
- "replay_downloading": "下载中…",
- "replay_saved": "回放已保存到",
- "review_ai": "用 AI 复盘",
- "history_source_sgp": "来自后端",
- "search_source_sgp": "客户端隐藏了战绩,已改从 Riot 后端 (SGP) 获取。"
- },
"nav": {
"home": "首页",
"downloads": "下载",
diff --git a/src/lib/league-history.test.ts b/src/lib/league-history.test.ts
deleted file mode 100644
index 81b77348..00000000
--- a/src/lib/league-history.test.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { describe, it, expect } from "vitest";
-import {
- filterByQueue,
- isRemake,
- queuesInGames,
- summarise,
- type HistoryGame,
-} from "./league-history";
-
-function game(
- queueId: number,
- win: boolean,
- kda: [number, number, number] = [5, 2, 5],
- gameDuration = 1800,
-): HistoryGame {
- return {
- queueId,
- gameDuration,
- participants: [{ stats: { kills: kda[0], deaths: kda[1], assists: kda[2], win } }],
- };
-}
-
-describe("queuesInGames", () => {
- it("lists each queue once, most played first", () => {
- const games = [game(420, true), game(450, false), game(420, false), game(440, true)];
- expect(queuesInGames(games)).toEqual([420, 440, 450]);
- });
-
- it("ignores games without a usable queue id", () => {
- expect(queuesInGames([{ queueId: 0 }, {}, { queueId: -1 }])).toEqual([]);
- expect(queuesInGames([])).toEqual([]);
- });
-});
-
-describe("filterByQueue", () => {
- it("returns everything when no queue is selected", () => {
- const games = [game(420, true), game(450, false)];
- expect(filterByQueue(games, null)).toHaveLength(2);
- });
-
- it("keeps only the selected queue", () => {
- const games = [game(420, true), game(450, false), game(420, false)];
- expect(filterByQueue(games, 420)).toHaveLength(2);
- expect(filterByQueue(games, 900)).toHaveLength(0);
- });
-});
-
-describe("summarise", () => {
- it("counts wins, losses and the aggregate KDA", () => {
- const summary = summarise([
- game(420, true, [10, 2, 4]),
- game(420, false, [2, 6, 2]),
- game(420, true, [6, 2, 6]),
- ]);
- expect(summary).toMatchObject({ total: 3, counted: 3, wins: 2, losses: 1, winrate: 67 });
- // (18 kills + 12 assists) / 10 deaths
- expect(summary.kda).toBeCloseTo(3, 5);
- });
-
- it("leaves remakes out of the aggregates but still counts them", () => {
- const summary = summarise([game(420, true), game(420, false, [0, 0, 0], 120)]);
- expect(summary).toMatchObject({ total: 2, counted: 1, wins: 1, losses: 0, remakes: 1 });
- expect(isRemake(game(420, true, [0, 0, 0], 120))).toBe(true);
- expect(isRemake(game(420, true))).toBe(false);
- });
-
- it("reports nothing instead of dividing by zero on an empty set", () => {
- expect(summarise([])).toMatchObject({ total: 0, counted: 0, winrate: null, kda: null });
- });
-
- it("falls back to the raw sum when the player never died", () => {
- const summary = summarise([game(420, true, [7, 0, 3])]);
- expect(summary.kda).toBe(10);
- });
-
- it("survives games with no participant data", () => {
- const summary = summarise([{ queueId: 420, gameDuration: 1800 }]);
- expect(summary).toMatchObject({ total: 1, counted: 0, winrate: null });
- });
-});
diff --git a/src/lib/league-history.ts b/src/lib/league-history.ts
deleted file mode 100644
index 3ba82f61..00000000
--- a/src/lib/league-history.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-export type HistoryGame = {
- gameId?: number;
- queueId?: number;
- gameMode?: string;
- gameDuration?: number;
- participants?: { stats?: { kills?: number; deaths?: number; assists?: number; win?: boolean } }[];
-};
-
-export type HistorySummary = {
- total: number;
- counted: number;
- wins: number;
- losses: number;
- winrate: number | null;
- kda: number | null;
- remakes: number;
-};
-
-/// A game that ended before this mark was a remake: it carries no result worth
-/// averaging, so it is listed but kept out of the aggregates.
-const REMAKE_SECONDS = 180;
-
-export function isRemake(game: HistoryGame): boolean {
- return (game.gameDuration ?? 0) < REMAKE_SECONDS;
-}
-
-export function queuesInGames(games: readonly HistoryGame[]): number[] {
- const counts = new Map<number, number>();
- for (const game of games) {
- const id = game.queueId;
- if (typeof id !== "number" || id <= 0) continue;
- counts.set(id, (counts.get(id) ?? 0) + 1);
- }
- return [...counts.entries()]
- .sort((a, b) => b[1] - a[1] || a[0] - b[0])
- .map(([id]) => id);
-}
-
-export function filterByQueue<T extends HistoryGame>(games: readonly T[], queueId: number | null): T[] {
- if (queueId === null) return [...games];
- return games.filter((game) => game.queueId === queueId);
-}
-
-export function summarise(games: readonly HistoryGame[]): HistorySummary {
- let wins = 0;
- let losses = 0;
- let kills = 0;
- let deaths = 0;
- let assists = 0;
- let remakes = 0;
-
- for (const game of games) {
- if (isRemake(game)) {
- remakes += 1;
- continue;
- }
- const stats = game.participants?.[0]?.stats;
- if (!stats) continue;
- if (stats.win) wins += 1;
- else losses += 1;
- kills += stats.kills ?? 0;
- deaths += stats.deaths ?? 0;
- assists += stats.assists ?? 0;
- }
-
- const counted = wins + losses;
- return {
- total: games.length,
- counted,
- wins,
- losses,
- winrate: counted > 0 ? Math.round((wins / counted) * 100) : null,
- // A deathless streak has no ratio to report, so it falls back to the sum.
- kda: counted > 0 ? (deaths > 0 ? (kills + assists) / deaths : kills + assists) : null,
- remakes,
- };
-}
diff --git a/src/lib/league-match-detail.test.ts b/src/lib/league-match-detail.test.ts
deleted file mode 100644
index 23c555f7..00000000
--- a/src/lib/league-match-detail.test.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-import { describe, it, expect } from "vitest";
-import { findTeam, teamBans, teamObjectives } from "./league-match-detail";
-
-const blue = {
- teamId: 100,
- towerKills: 9,
- inhibitorKills: 2,
- baronKills: 1,
- dragonKills: 3,
- riftHeraldKills: 1,
- bans: [
- { championId: 55, pickTurn: 3 },
- { championId: 22, pickTurn: 1 },
- { championId: -1, pickTurn: 5 },
- ],
-};
-
-describe("teamObjectives", () => {
- it("reads every objective count", () => {
- expect(teamObjectives(blue)).toEqual({
- teamId: 100,
- towers: 9,
- inhibitors: 2,
- barons: 1,
- dragons: 3,
- heralds: 1,
- });
- });
-
- it("treats missing counts as zero rather than blank", () => {
- expect(teamObjectives({ teamId: 200 })).toEqual({
- teamId: 200,
- towers: 0,
- inhibitors: 0,
- barons: 0,
- dragons: 0,
- heralds: 0,
- });
- });
-
- it("returns nothing for a team without an id", () => {
- expect(teamObjectives(undefined)).toBeNull();
- expect(teamObjectives({})).toBeNull();
- });
-});
-
-describe("teamBans", () => {
- it("orders by pick turn and drops empty bans", () => {
- expect(teamBans(blue)).toEqual([22, 55]);
- });
-
- it("handles a team that banned nothing", () => {
- expect(teamBans({ teamId: 100 })).toEqual([]);
- expect(teamBans({ teamId: 100, bans: [] })).toEqual([]);
- expect(teamBans(undefined)).toEqual([]);
- });
-
- it("does not mutate the source array", () => {
- const team = { teamId: 100, bans: [{ championId: 2, pickTurn: 2 }, { championId: 1, pickTurn: 1 }] };
- teamBans(team);
- expect(team.bans[0].championId).toBe(2);
- });
-});
-
-describe("findTeam", () => {
- it("finds by id and tolerates missing data", () => {
- expect(findTeam([blue], 100)).toBe(blue);
- expect(findTeam([blue], 200)).toBeUndefined();
- expect(findTeam(undefined, 100)).toBeUndefined();
- });
-});
diff --git a/src/lib/league-match-detail.ts b/src/lib/league-match-detail.ts
deleted file mode 100644
index fc8f183f..00000000
--- a/src/lib/league-match-detail.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-export type MatchTeam = {
- teamId?: number;
- towerKills?: number;
- inhibitorKills?: number;
- baronKills?: number;
- dragonKills?: number;
- riftHeraldKills?: number;
- bans?: { championId?: number; pickTurn?: number }[];
-};
-
-export type TeamObjectives = {
- teamId: number;
- towers: number;
- inhibitors: number;
- barons: number;
- dragons: number;
- heralds: number;
-};
-
-/// Objective counts as the match detail reports them. A team with no objective at
-/// all is still returned, because "zero towers" is information.
-export function teamObjectives(team: MatchTeam | undefined): TeamObjectives | null {
- if (!team || typeof team.teamId !== "number") return null;
- return {
- teamId: team.teamId,
- towers: team.towerKills ?? 0,
- inhibitors: team.inhibitorKills ?? 0,
- barons: team.baronKills ?? 0,
- dragons: team.dragonKills ?? 0,
- heralds: team.riftHeraldKills ?? 0,
- };
-}
-
-/// Bans in the order they were made. Entries with no champion are the empty bans
-/// the client reports as -1 when a player let the timer run out.
-export function teamBans(team: MatchTeam | undefined): number[] {
- return (team?.bans ?? [])
- .slice()
- .sort((a, b) => (a.pickTurn ?? 0) - (b.pickTurn ?? 0))
- .map((ban) => ban.championId ?? -1)
- .filter((id) => id > 0);
-}
-
-export function findTeam(teams: readonly MatchTeam[] | undefined, teamId: number): MatchTeam | undefined {
- return (teams ?? []).find((team) => team.teamId === teamId);
-}
diff --git a/src/lib/league-raffle.test.ts b/src/lib/league-raffle.test.ts
deleted file mode 100644
index 237aa047..00000000
--- a/src/lib/league-raffle.test.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { describe, it, expect } from "vitest";
-import { CHAMPION_CLASSES, LANES, drawLane, secondaryLane } from "./league-raffle";
-
-describe("drawLane", () => {
- it("never repeats the previous lane when there is a choice", () => {
- for (let i = 0; i < 200; i++) {
- expect(drawLane("TOP")).not.toBe("TOP");
- }
- });
-
- it("reaches every lane", () => {
- const seen = new Set<string>();
- for (let i = 0; i < 500; i++) seen.add(drawLane(null));
- expect([...seen].sort()).toEqual([...LANES].sort());
- });
-
- it("is deterministic given the random source", () => {
- expect(drawLane(null, () => 0)).toBe("TOP");
- expect(drawLane(null, () => 0.999)).toBe("UTILITY");
- // The previous lane is removed from the pool before indexing.
- expect(drawLane("TOP", () => 0)).toBe("JUNGLE");
- });
-});
-
-describe("secondaryLane", () => {
- it("fills half the time and otherwise draws a different lane", () => {
- expect(secondaryLane("MIDDLE", () => 0.2)).toBe("FILL");
- const second = secondaryLane("MIDDLE", () => 0.9);
- expect(second).not.toBe("FILL");
- expect(second).not.toBe("MIDDLE");
- });
-});
-
-describe("champion classes", () => {
- it("match the tags the client uses", () => {
- expect(CHAMPION_CLASSES).toContain("marksman");
- expect(CHAMPION_CLASSES).toHaveLength(6);
- });
-});
diff --git a/src/lib/league-raffle.ts b/src/lib/league-raffle.ts
deleted file mode 100644
index e0bf8363..00000000
--- a/src/lib/league-raffle.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Pure helpers behind the lane and champion raffles, kept out of the
- * components so the odds can be tested without a client.
- */
-
-export const LANES = ["TOP", "JUNGLE", "MIDDLE", "BOTTOM", "UTILITY"] as const;
-export type Lane = (typeof LANES)[number];
-
-/** Champion classes as the client tags them in `roles`. */
-export const CHAMPION_CLASSES = ["fighter", "mage", "assassin", "marksman", "support", "tank"] as const;
-export type ChampionClass = (typeof CHAMPION_CLASSES)[number];
-
-/**
- * Draws a lane, never the one just drawn when there is a choice, so hitting
- * the button twice feels like a new draw instead of a stuck one.
- */
-export function drawLane(previous: Lane | null, random: () => number = Math.random): Lane {
- const pool = previous ? LANES.filter((l) => l !== previous) : [...LANES];
- const index = Math.min(pool.length - 1, Math.max(0, Math.floor(random() * pool.length)));
- return pool[index];
-}
-
-/** The second preference that pairs with a drawn lane: another draw or fill. */
-export function secondaryLane(first: Lane, random: () => number = Math.random): Lane | "FILL" {
- // Fill half the time keeps queues short; the other half is a real second lane.
- if (random() < 0.5) return "FILL";
- return drawLane(first, random);
-}
diff --git a/src/lib/league-scouting.test.ts b/src/lib/league-scouting.test.ts
deleted file mode 100644
index 570c23cd..00000000
--- a/src/lib/league-scouting.test.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { describe, it, expect } from "vitest";
-import { markedPlayers, winrateSquad, type ScoutedPlayer } from "./league-scouting";
-
-const team = (ally: boolean, count: number, offset = 0): ScoutedPlayer[] =>
- Array.from({ length: count }, (_, i) => ({
- puuid: `p${offset + i}`,
- isAlly: ally,
- gameName: `Player${offset + i}`,
- }));
-
-describe("markedPlayers", () => {
- it("splits marked players by side and prefers the display name", () => {
- const players = [...team(true, 2), ...team(false, 2, 10)];
- const marked = markedPlayers(players, { p0: "smurf", p10: "trolled last game" });
- expect(marked).toEqual({ ally: ["Player0"], enemy: ["Player10"] });
- });
-
- it("treats a blank note as no note", () => {
- const marked = markedPlayers(team(true, 2), { p0: " ", p1: "" });
- expect(marked).toEqual({ ally: [], enemy: [] });
- });
-
- it("falls back to a short puuid when the name is missing", () => {
- const marked = markedPlayers([{ puuid: "abcdefghijkl", isAlly: false }], {
- abcdefghijkl: "note",
- });
- expect(marked.enemy).toEqual(["abcdefgh"]);
- });
-
- it("ignores players without a puuid", () => {
- expect(markedPlayers([{ isAlly: true, gameName: "Ghost" }], {})).toEqual({
- ally: [],
- enemy: [],
- });
- });
-});
-
-describe("winrateSquad", () => {
- const five = team(false, 5);
- const allPrivate = Object.fromEntries(five.map((p) => [p.puuid!, { privateProfile: true }]));
-
- it("flags a five-stack whose profiles are all hidden", () => {
- const premades = [{ label: "A", puuids: five.map((p) => p.puuid!) }];
- expect(winrateSquad(five, premades, allPrivate)).toBe("enemy");
- });
-
- it("says nothing when one profile is visible", () => {
- const reports = { ...allPrivate, p2: { privateProfile: false } };
- const premades = [{ label: "A", puuids: five.map((p) => p.puuid!) }];
- expect(winrateSquad(five, premades, reports)).toBeNull();
- });
-
- it("says nothing for a group smaller than five", () => {
- const premades = [{ label: "A", puuids: ["p0", "p1"] }];
- expect(winrateSquad(five, premades, allPrivate)).toBeNull();
- });
-
- it("reports the ally side when it is the user's own stack", () => {
- const allies = team(true, 5);
- const reports = Object.fromEntries(allies.map((p) => [p.puuid!, { privateProfile: true }]));
- const premades = [{ label: "A", puuids: allies.map((p) => p.puuid!) }];
- expect(winrateSquad(allies, premades, reports)).toBe("ally");
- });
-
- it("ignores a group that spans both teams or has unknown members", () => {
- const mixed = [...team(true, 3), ...team(false, 2, 3)];
- const reports = Object.fromEntries(mixed.map((p) => [p.puuid!, { privateProfile: true }]));
- const premades = [{ puuids: mixed.map((p) => p.puuid!) }];
- expect(winrateSquad(mixed, premades, reports)).toBeNull();
- expect(winrateSquad([], [{ puuids: ["x", "y", "z", "w", "v"] }], {})).toBeNull();
- });
-
- it("handles missing or malformed premade payloads", () => {
- expect(winrateSquad(five, [], allPrivate)).toBeNull();
- expect(winrateSquad(five, [{}], allPrivate)).toBeNull();
- expect(winrateSquad(five, [{ puuids: [null, "", "p0", "p1", "p2", "p3", "p4"] }], allPrivate)).toBe(
- "enemy",
- );
- });
-});
diff --git a/src/lib/league-scouting.ts b/src/lib/league-scouting.ts
deleted file mode 100644
index 2410fac5..00000000
--- a/src/lib/league-scouting.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-export type ScoutedPlayer = { puuid?: string; isAlly?: boolean; gameName?: string };
-export type PremadeGroup = { label?: string; puuids?: (string | null)[] };
-export type ScoutReport = { privateProfile?: boolean } | null | undefined;
-
-export type MarkedPlayers = { ally: string[]; enemy: string[] };
-
-/// Players the user already wrote a note about. An empty or whitespace-only note
-/// is not a mark: it is a note the user started and abandoned.
-export function markedPlayers(
- players: readonly ScoutedPlayer[],
- notes: Record<string, string>,
-): MarkedPlayers {
- const marked: MarkedPlayers = { ally: [], enemy: [] };
- for (const player of players) {
- const puuid = player.puuid;
- if (!puuid) continue;
- if ((notes[puuid] ?? "").trim() === "") continue;
- const label = player.gameName?.trim() || puuid.slice(0, 8);
- (player.isAlly ? marked.ally : marked.enemy).push(label);
- }
- return marked;
-}
-
-function sideOf(players: readonly ScoutedPlayer[], puuids: readonly string[]): boolean | null {
- const sides = new Set(
- puuids
- .map((puuid) => players.find((p) => p.puuid === puuid)?.isAlly)
- .filter((side): side is boolean => typeof side === "boolean"),
- );
- return sides.size === 1 ? [...sides][0] : null;
-}
-
-/// A five-player group whose profiles are all hidden is the shape of a squad
-/// queueing together to farm wins. It is reported as an observation, never as an
-/// accusation: both halves have to hold, and neither is proof on its own.
-export function winrateSquad(
- players: readonly ScoutedPlayer[],
- premades: readonly PremadeGroup[],
- reports: Record<string, ScoutReport>,
-): "ally" | "enemy" | null {
- for (const group of premades) {
- const puuids = (group.puuids ?? []).filter((p): p is string => typeof p === "string" && p !== "");
- if (puuids.length < 5) continue;
- const side = sideOf(players, puuids);
- if (side === null) continue;
- const allHidden = puuids.every((puuid) => reports[puuid]?.privateProfile === true);
- if (allHidden) return side ? "ally" : "enemy";
- }
- return null;
-}
diff --git a/src/lib/stores/settings-store.svelte.ts b/src/lib/stores/settings-store.svelte.ts
index a6f1e3f8..e9314eeb 100644
--- a/src/lib/stores/settings-store.svelte.ts
+++ b/src/lib/stores/settings-store.svelte.ts
@@ -91,33 +91,6 @@ export type AppSettings = {
app_id: string;
large_image_key: string;
};
- league?: {
- enabled?: boolean;
- auto_accept?: boolean;
- auto_accept_delay?: number;
- notify_ready_check?: boolean;
- auto_pick?: boolean;
- auto_ban?: boolean;
- auto_ban_delay?: number;
- auto_lock?: boolean;
- auto_lock_at_timeout?: boolean;
- auto_runes?: boolean;
- auto_honor?: boolean;
- auto_play_again?: boolean;
- auto_requeue?: boolean;
- auto_accept_swaps?: boolean;
- auto_reconnect?: boolean;
- auto_trade?: string;
- auto_message?: string;
- pick_champions?: number[];
- ban_champions?: number[];
- pick_random?: boolean;
- skin_roulette?: boolean;
- skin_roulette_include_base?: boolean;
- ward_roulette?: boolean;
- sgp_enabled?: boolean;
- coach_style?: "objective" | "roast" | "praise";
- };
onboarding_completed: boolean;
start_with_system: boolean;
start_minimized: boolean;
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 0e23b7e6..5cada5e3 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -40,15 +40,9 @@
let pluginNavItems = $state<NavItem[]>([]);
- let leagueNavItems = $derived<NavItem[]>(
- (getSettings()?.league?.enabled ?? true)
- ? [{ href: "/league", labelKey: "league.nav", icon: "league", group: "app", order: 45 }]
- : []
- );
-
let coreNavItems = $derived(CORE_NAV_ITEMS);
- let allNav = $derived([...coreNavItems, ...leagueNavItems, ...pluginNavItems].sort((a, b) => (a.order ?? 50) - (b.order ?? 50)));
+ let allNav = $derived([...coreNavItems, ...pluginNavItems].sort((a, b) => (a.order ?? 50) - (b.order ?? 50)));
let primaryNav = $derived(allNav.filter((item) => item.group === "primary"));
let appNav = $derived(allNav.filter((item) => item.group === "app"));
let pluginNav = $derived(allNav.filter((item) => item.group === "plugins"));
@@ -70,7 +64,6 @@
page.url.pathname.startsWith("/downloads") ||
page.url.pathname.startsWith("/settings") ||
page.url.pathname.startsWith("/marketplace") ||
- page.url.pathname.startsWith("/league") ||
page.url.pathname.startsWith("/about") ||
page.url.pathname.startsWith("/nami"),
);
@@ -132,9 +125,8 @@
onMount(() => {
initDownloadListener();
- // If `get_settings` failed while the shell was booting, the sidebar has no
- // League entry and Settings spins forever. Retry a few times instead of
- // leaving the app half-configured until the next restart.
+ // If `get_settings` failed while the shell was booting, Settings spins forever.
+ // Retry a few times instead of leaving the app half-configured until the next restart.
if (!getSettings()) {
let attempts = 0;
const retry = () => {
diff --git a/src/routes/league/+page.svelte b/src/routes/league/+page.svelte
deleted file mode 100644
index 65e3a3c0..00000000
--- a/src/routes/league/+page.svelte
+++ /dev/null
@@ -1,2415 +0,0 @@
-<script lang="ts" module>
- // Survives remounts so the same lobby is not counted as a new encounter
- // every time the page is opened.
- const recordedEncounters = new Set<string>();
-</script>
-
-<script lang="ts">
- import { onMount, onDestroy } from "svelte";
- import { goto } from "$app/navigation";
- import { invoke } from "@tauri-apps/api/core";
- import { listen, type UnlistenFn } from "@tauri-apps/api/event";
- import { t } from "$lib/i18n";
- import { getSettings } from "$lib/stores/settings-store.svelte";
- import OverviewTab from "$components/league/OverviewTab.svelte";
- import AnalysisTab from "$components/league/AnalysisTab.svelte";
- import MetaTab from "$components/league/MetaTab.svelte";
- import SearchTab from "$components/league/SearchTab.svelte";
- import LiveTab from "$components/league/LiveTab.svelte";
- import GoalsTab from "$components/league/GoalsTab.svelte";
- import AutomationTab from "$components/league/AutomationTab.svelte";
- import HistoryTab from "$components/league/HistoryTab.svelte";
- import ProfileTab from "$components/league/ProfileTab.svelte";
- import CoachTab from "$components/league/CoachTab.svelte";
- import type { Champion, GoalKey, LobbyQueue, RankedEntry, Role, ScoutPlayer } from "$components/league/shared";
- import type { Platform } from "$components/league/registry";
-
- type LeagueStatus = { connected: boolean; port: number | null; region: string | null };
-
- let settings = $derived(getSettings());
- let enabled = $derived(settings?.league?.enabled ?? true);
-
- let status = $state<LeagueStatus>({ connected: false, port: null, region: null });
- let summoner = $state<any>(null);
- let ranked = $state<Record<string, RankedEntry>>({});
- let phase = $state<string>("");
- let games = $state<any[]>([]);
- let loadingHistory = $state(false);
- let profileLoading = $state(false);
- let liveTimer: ReturnType<typeof setInterval> | null = null;
- let unlisteners: UnlistenFn[] = [];
-
- let champions = $state<Champion[]>([]);
- let championById = $derived(new Map(champions.map((c) => [c.id, c])));
- let championByAlias = $derived(new Map(champions.map((c) => [c.alias.toLowerCase(), c])));
-
- let queues = $state<LobbyQueue[]>([]);
- let lobby = $state<any>(null);
- let champSelect = $state<any>(null);
- let liveGame = $state<any>(null);
- let actionError = $state("");
-
- let scoutPlayers = $state<ScoutPlayer[]>([]);
- let scoutReports = $state<Record<string, any>>({});
- let scoutLoading = $state(false);
- let notes = $state<Record<string, string>>({});
-
- const NOTES_KEY = "league-player-notes";
- const ENCOUNTERS_KEY = "league-encounters";
-
- type Encounter = { count: number; lastSeen: number; name?: string };
- let encounters = $state<Record<string, Encounter>>({});
-
- function loadNotes() {
- try {
- notes = JSON.parse(localStorage.getItem(NOTES_KEY) ?? "{}");
- } catch {
- notes = {};
- }
- }
-
- function saveNote(puuid: string, text: string) {
- notes = { ...notes, [puuid]: text };
- const clean = Object.fromEntries(Object.entries(notes).filter(([, v]) => (v as string).trim() !== ""));
- localStorage.setItem(NOTES_KEY, JSON.stringify(clean));
- }
-
- function loadEncounters() {
- try {
- encounters = JSON.parse(localStorage.getItem(ENCOUNTERS_KEY) ?? "{}");
- } catch {
- encounters = {};
- }
- }
-
- function recordEncounters(players: ScoutPlayer[]) {
- const myPuuid = summoner?.puuid ?? "";
- let changed = false;
- const next = { ...encounters };
- for (const p of players) {
- if (!p.puuid || p.puuid === myPuuid || recordedEncounters.has(p.puuid)) continue;
- recordedEncounters.add(p.puuid);
- const e = next[p.puuid] ?? { count: 0, lastSeen: 0 };
- next[p.puuid] = {
- count: e.count + 1,
- lastSeen: Date.now(),
- name: p.gameName ? `${p.gameName}#${p.tagLine}` : e.name,
- };
- changed = true;
- }
- if (changed) {
- encounters = next;
- localStorage.setItem(ENCOUNTERS_KEY, JSON.stringify(next));
- }
- }
-
- function timesSeenBefore(puuid: string): number {
- const e = encounters[puuid];
- if (!e) return 0;
- return recordedEncounters.has(puuid) ? e.count - 1 : e.count;
- }
-
- async function loadScouting() {
- if (scoutLoading) return;
- scoutLoading = true;
- try {
- const data = await invoke<any>("league_game_players");
- scoutPlayers = (data?.players ?? []).filter((p: any) => p);
- recordEncounters(scoutPlayers);
- for (const p of scoutPlayers) {
- if (!p.puuid || scoutReports[p.puuid]) continue;
- invoke<any>("league_player_report", { puuid: p.puuid, withImpact: false })
- .then((r) => {
- scoutReports = { ...scoutReports, [p.puuid]: r };
- })
- .catch(() => {});
- }
- } catch {
- scoutPlayers = [];
- } finally {
- scoutLoading = false;
- }
- }
-
- const TAB_IDS = ["overview", "profile", "analysis", "meta", "search", "live", "goals", "automation", "coach", "history"] as const;
- type Tab = (typeof TAB_IDS)[number];
- let tab = $state<Tab>("overview");
-
- let analysis = $state<any>(null);
- let analysisLoading = $state(false);
- let liveMetrics = $state<any>(null);
- let cooldowns = $state<any>(null);
- let liveEvents = $state<any>(null);
-
- // The registry needs to know where it runs to explain platform limits.
- let platform = $derived<Platform>(
- navigator.userAgent.includes("Windows")
- ? "windows"
- : navigator.userAgent.includes("Mac")
- ? "macos"
- : "linux",
- );
-
- const GOALS_KEY = "league-role-goals";
-
- // Baselines mirror the Rust defaults; a support is not judged on CS.
- const DEFAULT_GOALS: Record<Role, Record<GoalKey, number>> = {
- TOP: { csPerMin: 7.0, goldPerMin: 380, kda: 2.5, visionPerMin: 0.6 },
- JUNGLE: { csPerMin: 5.5, goldPerMin: 360, kda: 3.0, visionPerMin: 1.0 },
- MIDDLE: { csPerMin: 7.5, goldPerMin: 400, kda: 3.0, visionPerMin: 0.7 },
- BOTTOM: { csPerMin: 8.0, goldPerMin: 420, kda: 3.0, visionPerMin: 0.6 },
- UTILITY: { csPerMin: 1.5, goldPerMin: 260, kda: 3.0, visionPerMin: 2.0 },
- };
-
- let goals = $state<Record<string, Record<string, number>>>({});
-
- function loadGoals() {
- try {
- goals = JSON.parse(localStorage.getItem(GOALS_KEY) ?? "{}");
- } catch {
- goals = {};
- }
- }
-
- function goalValue(role: Role, key: GoalKey): number {
- return goals[role]?.[key] ?? DEFAULT_GOALS[role][key];
- }
-
- function setGoal(role: Role, key: GoalKey, value: number) {
- if (!Number.isFinite(value) || value < 0) return;
- goals = { ...goals, [role]: { ...(goals[role] ?? {}), [key]: value } };
- localStorage.setItem(GOALS_KEY, JSON.stringify(goals));
- }
-
- function resetGoals(role: Role) {
- const next = { ...goals };
- delete next[role];
- goals = next;
- localStorage.setItem(GOALS_KEY, JSON.stringify(goals));
- }
-
- async function loadAnalysis() {
- if (analysisLoading) return;
- analysisLoading = true;
- try {
- analysis = await invoke<any>("league_match_analysis");
- } catch {
- analysis = null;
- } finally {
- analysisLoading = false;
- }
- }
-
- // Without these guards a slow client lets every 4s tick queue another round of
- // requests; the replies pile up on the UI thread and freeze the whole window.
- let liveMetricsInFlight = false;
- let liveEventsInFlight = false;
- let cooldownsInFlight = false;
- let refreshInFlight = false;
-
- async function loadLiveMetrics() {
- if (liveMetricsInFlight) return;
- liveMetricsInFlight = true;
- try {
- liveMetrics = await invoke<any>("league_live_metrics");
- } catch {
- liveMetrics = null;
- } finally {
- liveMetricsInFlight = false;
- }
- }
-
- async function loadLiveEvents() {
- if (liveEventsInFlight) return;
- liveEventsInFlight = true;
- try {
- liveEvents = await invoke<any>("league_live_events");
- } catch {
- liveEvents = null;
- } finally {
- liveEventsInFlight = false;
- }
- }
-
- async function loadCooldowns() {
- if (cooldownsInFlight) return;
- cooldownsInFlight = true;
- try {
- cooldowns = await invoke<any>("league_ability_cooldowns");
- } catch {
- cooldowns = null;
- } finally {
- cooldownsInFlight = false;
- }
- }
-
- // Champion the local player has locked in (or hovered) during champ select.
- let champSelectChampionId = $derived.by(() => {
- const cell = champSelect?.localPlayerCellId;
- if (cell === undefined || cell === null) return 0;
- const me = (champSelect?.myTeam ?? []).find((m: any) => m.cellId === cell);
- return me?.championId ?? 0;
- });
-
- let myAssignedPosition = $derived.by(() => {
- const cell = champSelect?.localPlayerCellId;
- const me = (champSelect?.myTeam ?? []).find((m: any) => m.cellId === cell);
- return (me?.assignedPosition ?? "").toUpperCase();
- });
-
- async function refreshStatus() {
- try {
- status = await invoke<LeagueStatus>("league_status");
- } catch {
- status = { connected: false, port: null, region: null };
- }
- if (!status.connected) {
- summoner = null;
- phase = "";
- lobby = null;
- champSelect = null;
- liveGame = null;
- return;
- }
- try {
- phase = await invoke<string>("league_gameflow");
- } catch {
- phase = "";
- }
- if (!summoner) {
- await loadProfile();
- }
- if (champions.length === 0) {
- loadChampions();
- }
- if (queues.length === 0) {
- loadQueues();
- }
- refreshPhaseData();
- }
-
- async function refreshPhaseData() {
- // A tick that arrives while the previous one is still running is dropped
- // rather than queued: the client is the slow part, and stacking rounds of
- // requests is what makes the window stop responding.
- if (refreshInFlight) return;
- refreshInFlight = true;
- try {
- await refreshPhaseDataInner();
- } finally {
- refreshInFlight = false;
- }
- }
-
- async function refreshPhaseDataInner() {
- if (phase === "ChampSelect") {
- try {
- champSelect = await invoke<any>("league_champ_select_session");
- } catch {
- champSelect = null;
- }
- } else {
- champSelect = null;
- }
- if (phase === "InProgress") {
- try {
- liveGame = await invoke<any>("league_live_game");
- } catch {
- liveGame = null;
- }
- } else {
- liveGame = null;
- }
- if (phase === "ChampSelect" || phase === "InProgress") {
- if (scoutPlayers.length === 0) loadScouting();
- if (!analysis && !analysisLoading) loadAnalysis();
- } else if (scoutPlayers.length > 0) {
- scoutPlayers = [];
- analysis = null;
- }
- if (phase === "InProgress") {
- loadLiveMetrics();
- loadCooldowns();
- loadLiveEvents();
- } else if (liveMetrics) {
- liveMetrics = null;
- cooldowns = null;
- liveEvents = null;
- }
- if (phase === "Lobby" || phase === "Matchmaking") {
- try {
- lobby = await invoke<any>("league_get", { path: "/lol-lobby/v2/lobby" });
- } catch {
- lobby = null;
- }
- } else {
- lobby = null;
- }
- }
-
- async function loadProfile() {
- profileLoading = true;
- try {
- summoner = await invoke<any>("league_summoner");
- } catch {
- summoner = null;
- profileLoading = false;
- return;
- }
- try {
- const stats = await invoke<any>("league_ranked");
- ranked = stats?.queueMap ?? {};
- } catch {
- ranked = {};
- } finally {
- profileLoading = false;
- }
- loadHistory();
- }
-
- async function loadChampions() {
- try {
- const data = await invoke<any[]>("league_get", { path: "/lol-game-data/assets/v1/champion-summary.json" });
- champions = (data ?? [])
- .filter((c) => c.id > 0)
- .map((c) => ({ id: c.id, name: c.name, alias: c.alias }))
- .sort((a, b) => a.name.localeCompare(b.name));
- } catch {
- champions = [];
- }
- }
-
- async function loadQueues() {
- try {
- queues = await invoke<LobbyQueue[]>("league_lobby_queues");
- } catch {
- queues = [];
- }
- }
-
- async function loadHistory() {
- if (loadingHistory) return;
- loadingHistory = true;
- try {
- const data = await invoke<any>("league_match_history", { begIndex: 0, endIndex: 12 });
- games = data?.games?.games ?? [];
- } catch {
- games = [];
- } finally {
- loadingHistory = false;
- }
- }
-
- async function action(cmd: string, args?: Record<string, unknown>) {
- actionError = "";
- try {
- await invoke(cmd, args ?? {});
- refreshStatus();
- } catch (e: any) {
- actionError = typeof e === "string" ? e : e.message ?? String(e);
- }
- }
-
- // The backend keeps a websocket to the client and pushes changes; the only
- // thing still polled is the in-game data server, which has no push channel.
- $effect(() => {
- if (phase === "InProgress") {
- liveTimer = setInterval(refreshPhaseData, 4000);
- return () => {
- if (liveTimer) clearInterval(liveTimer);
- liveTimer = null;
- };
- }
- });
-
- onMount(() => {
- if (!enabled) return;
- loadNotes();
- loadGoals();
- loadEncounters();
- refreshStatus();
- listen<any>("league-connected", (e) => {
- status = {
- connected: e.payload?.connected ?? false,
- port: e.payload?.port ?? null,
- region: e.payload?.region ?? null,
- };
- if (status.connected) {
- refreshStatus();
- } else {
- summoner = null;
- phase = "";
- lobby = null;
- champSelect = null;
- liveGame = null;
- }
- }).then((u) => unlisteners.push(u));
- listen<string>("league-phase", (e) => {
- const next = e.payload ?? "";
- // The client repeats the current phase on reconnects and on its own
- // heartbeat; refreshing again for the same phase re-fetches everything for
- // nothing.
- if (next === phase) return;
- phase = next;
- refreshPhaseData();
- }).then((u) => unlisteners.push(u));
- listen<any>("league-champ-select", (e) => {
- if (phase === "ChampSelect") champSelect = e.payload;
- }).then((u) => unlisteners.push(u));
- listen<any>("league-lobby", (e) => {
- if (phase === "Lobby" || phase === "Matchmaking") lobby = e.payload;
- }).then((u) => unlisteners.push(u));
- });
-
- onDestroy(() => {
- if (liveTimer) clearInterval(liveTimer);
- for (const u of unlisteners) u();
- unlisteners = [];
- });
-</script>
-
-<div class="league-page">
- {#if !enabled}
- <div class="guard-card">
- <h2>{$t("league.disabled_title")}</h2>
- <p>{$t("league.disabled_body")}</p>
- <button class="button primary" onclick={() => goto("/settings")}>{$t("league.open_settings")}</button>
- </div>
- {:else}
- <header class="league-header">
- <h2>{$t("league.nav")}</h2>
- <div class="status-chip" class:connected={status.connected}>
- <span class="dot"></span>
- {status.connected ? $t("league.connected") : $t("league.disconnected_title")}
- {#if status.connected && status.region}
- <span class="region">{status.region}</span>
- {/if}
- </div>
- </header>
-
- {#if !status.connected}
- <div class="guard-card">
- <p>{$t("league.disconnected_body")}</p>
- </div>
- {:else}
- <nav class="league-tabs" aria-label={$t("league.nav") as string}>
- {#each TAB_IDS as id (id)}
- <button class="league-tab" class:on={tab === id} onclick={() => (tab = id)} aria-current={tab === id}>
- {$t(`league.tab_${id}`)}
- </button>
- {/each}
- </nav>
-
- <!-- Panels stay mounted while hidden so tab state (search results, spell
- timers, expanded games) survives switching, and the meta tab's
- auto-rune effect keeps working from any tab. -->
- <div class="tab-panel" class:active={tab === "overview"}>
- <OverviewTab {summoner} {profileLoading} {ranked} {phase} {champSelect} {liveGame} {lobby} {queues} {actionError} {champions} {championById} {championByAlias} onAction={action} active={tab === "overview"} />
- </div>
- <div class="tab-panel" class:active={tab === "profile"}>
- <ProfileTab {summoner} {champions} active={tab === "profile"} />
- </div>
- <div class="tab-panel" class:active={tab === "analysis"}>
- <AnalysisTab {analysis} {analysisLoading} onRefreshAnalysis={loadAnalysis} {phase} {scoutPlayers} {scoutReports} {scoutLoading} onRefreshScouting={loadScouting} {championById} {notes} onSaveNote={saveNote} {timesSeenBefore} {platform} clientConnected={status.connected} active={tab === "analysis"} />
- </div>
- <div class="tab-panel" class:active={tab === "meta"}>
- <MetaTab {champSelectChampionId} {myAssignedPosition} {championById} {champions} region={status.region} active={tab === "meta"} />
- </div>
- <div class="tab-panel" class:active={tab === "search"}>
- <SearchTab {championById} active={tab === "search"} />
- </div>
- <div class="tab-panel" class:active={tab === "live"}>
- <LiveTab {liveMetrics} {cooldowns} {liveEvents} {goalValue} {platform} clientConnected={status.connected} active={tab === "live"} />
- </div>
- <div class="tab-panel" class:active={tab === "goals"}>
- <GoalsTab {goalValue} {setGoal} {resetGoals} active={tab === "goals"} />
- </div>
- <div class="tab-panel" class:active={tab === "automation"}>
- <AutomationTab {champions} {championById} active={tab === "automation"} />
- </div>
- <div class="tab-panel" class:active={tab === "coach"}>
- <CoachTab {games} {phase} {championById} active={tab === "coach"} />
- </div>
- <div class="tab-panel" class:active={tab === "history"}>
- <HistoryTab {games} loading={loadingHistory} onRefresh={loadHistory} {championById} active={tab === "history"} />
- </div>
- {/if}
- {/if}
-</div>
-
-<style>
- .league-page {
- display: flex;
- flex-direction: column;
- gap: var(--padding);
- padding: var(--padding);
- max-width: 720px;
- margin: 0 auto;
- width: 100%;
- }
-
- .league-page :global(.tab-panel) {
- display: none;
- }
-
- .league-page :global(.tab-panel.active) {
- display: flex;
- flex-direction: column;
- gap: var(--padding);
- }
-
- .league-page :global(.guard-card) {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 10px;
- padding: calc(var(--padding) * 2);
- background: var(--surface);
- border: none;
- border-radius: var(--border-radius);
- }
-
- .league-page :global(.guard-card h2) {
- margin: 0;
- font-size: 18px;
- }
-
- .league-page :global(.guard-card p) {
- margin: 0;
- color: var(--gray);
- font-size: 13.5px;
- }
-
- .league-page :global(.league-header) {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- }
-
- .league-page :global(.league-header h2) {
- margin: 0;
- font-size: 20px;
- }
-
- .league-page :global(.status-chip) {
- display: inline-flex;
- align-items: center;
- gap: 7px;
- padding: 5px 12px;
- font-size: 12.5px;
- color: var(--gray);
- background: var(--surface);
- border: none;
- border-radius: 999px;
- }
-
- .league-page :global(.status-chip .dot) {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: var(--gray);
- }
-
- .league-page :global(.status-chip.connected) {
- color: var(--text);
- }
-
- .league-page :global(.status-chip.connected .dot) {
- background: var(--success);
- }
-
- .league-page :global(.status-chip .region) {
- color: var(--gray);
- text-transform: uppercase;
- }
-
- .league-page :global(.profile-card) {
- display: flex;
- align-items: center;
- gap: 14px;
- padding: var(--padding);
- background: var(--surface);
- border: none;
- border-radius: var(--border-radius);
- }
-
- .league-page :global(.profile-icon) {
- width: 56px;
- height: 56px;
- border-radius: 50%;
- border: none;
- object-fit: cover;
- }
-
- .league-page :global(.profile-info) {
- display: flex;
- flex-direction: column;
- gap: 2px;
- min-width: 0;
- }
-
- .league-page :global(.profile-name) {
- font-size: 16px;
- font-weight: 600;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .league-page :global(.profile-name .tag) {
- color: var(--gray);
- font-weight: 400;
- }
-
- .league-page :global(.profile-level) {
- font-size: 12.5px;
- color: var(--gray);
- }
-
- .league-page :global(.ranked-chips) {
- display: flex;
- gap: 8px;
- margin-left: auto;
- flex-wrap: wrap;
- }
-
- .league-page :global(.ranked-chip) {
- display: flex;
- flex-direction: column;
- gap: 2px;
- padding: 7px 12px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- }
-
- .league-page :global(.ranked-queue) {
- font-size: 11px;
- color: var(--gray);
- text-transform: uppercase;
- letter-spacing: 0.04em;
- }
-
- .league-page :global(.ranked-value) {
- font-size: 13px;
- }
-
- .league-page :global(.card) {
- display: flex;
- flex-direction: column;
- padding: var(--padding);
- background: var(--surface);
- border: none;
- border-radius: var(--border-radius);
- }
-
- .league-page :global(.card-head) {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10px;
- }
-
- .league-page :global(.card-head h3) {
- margin: 0;
- font-size: 15px;
- }
-
- .league-page :global(.phase-tag) {
- font-size: 12px;
- color: var(--gray);
- padding: 3px 10px;
- background: var(--button);
- border: none;
- border-radius: 999px;
- }
-
- .league-page :global(.action-error) {
- font-size: 12.5px;
- color: var(--danger);
- padding: 8px 12px;
- background: var(--surface);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- }
-
- .league-page :global(.lobby-actions) {
- display: flex;
- align-items: center;
- gap: 8px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.searching-hint) {
- font-size: 13px;
- color: var(--gray);
- }
-
- .league-page :global(.queue-grid) {
- display: flex;
- gap: 8px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.empty-hint) {
- color: var(--gray);
- font-size: 13px;
- margin: 0;
- }
-
- .league-page :global(.team-picks) {
- display: flex;
- gap: 8px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.bench-row) {
- display: flex;
- align-items: center;
- gap: 10px;
- margin-top: 12px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.bench-label) {
- font-size: 12.5px;
- color: var(--gray);
- }
-
- .league-page :global(.bench-champs) {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.bench-swap) {
- padding: 0;
- background: none;
- border: 2px solid transparent;
- border-radius: 8px;
- cursor: pointer;
- line-height: 0;
- }
-
- .league-page :global(.bench-swap:hover),
- .league-page :global(.bench-swap:focus-visible) {
- border-color: var(--accent);
- outline: none;
- }
-
- .league-page :global(.live-teams) {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 12px;
- }
-
- @media (max-width: 560px) {
- .league-page :global(.live-teams) {
- grid-template-columns: 1fr;
- }
- }
-
- .league-page :global(.live-team) {
- display: flex;
- flex-direction: column;
- gap: 4px;
- min-width: 0;
- }
-
- .league-page :global(.live-row) {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 4px 8px;
- border-radius: calc(var(--border-radius) - 4px);
- min-width: 0;
- }
-
- .league-page :global(.live-row.me) {
- background: var(--accent-soft, var(--button));
- }
-
- .league-page :global(.live-name) {
- font-size: 12.5px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- min-width: 0;
- }
-
- .league-page :global(.live-kda) {
- margin-left: auto;
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- color: var(--gray);
- }
-
- .league-page :global(.live-respawn) {
- font-size: 11.5px;
- color: var(--danger);
- }
-
- .league-page :global(.action-row) {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- }
-
- .league-page :global(.action-col) {
- display: flex;
- flex-direction: column;
- gap: 2px;
- min-width: 0;
- }
-
- .league-page :global(.action-label) {
- font-size: 14px;
- }
-
- .league-page :global(.action-hint) {
- font-size: 12.5px;
- color: var(--gray);
- }
-
- .league-page :global(.divider) {
- height: 1px;
- background: var(--border);
- margin: 10px 0;
- }
-
- .league-page :global(.champ-list-block) {
- display: flex;
- flex-direction: column;
- gap: 8px;
- margin-top: 10px;
- }
-
- .league-page :global(.list-label) {
- font-size: 12.5px;
- color: var(--gray);
- }
-
- .league-page :global(.scout-notices) {
- display: flex;
- flex-direction: column;
- gap: 4px;
- margin-bottom: 10px;
- padding: 8px 10px;
- border: none;
- border-radius: var(--border-radius);
- background: var(--surface-hover);
- }
-
- .league-page :global(.scout-notice) {
- margin: 0;
- font-size: 12.5px;
- color: var(--text-secondary);
- }
-
- .league-page :global(.reroll-actions) {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.queue-filter) {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- margin-bottom: 8px;
- }
-
- .league-page :global(.queue-chip) {
- padding: 3px 10px;
- border: none;
- border-radius: 999px;
- background: transparent;
- color: var(--text-secondary);
- font-size: 12px;
- cursor: pointer;
- }
-
- .league-page :global(.queue-chip:hover) {
- background: var(--surface-hover);
- }
-
- .league-page :global(.queue-chip.on) {
- border-color: var(--accent);
- color: var(--text);
- }
-
- .league-page :global(.history-summary) {
- font-size: 12.5px;
- color: var(--text-secondary);
- margin: 0 0 10px;
- }
-
- .league-page :global(.objective-row) {
- display: flex;
- gap: 8px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.objective-chip) {
- display: inline-flex;
- align-items: baseline;
- gap: 6px;
- padding: 4px 8px;
- border: none;
- border-radius: var(--border-radius);
- font-variant-numeric: tabular-nums;
- font-size: 12.5px;
- }
-
- .league-page :global(.event-feed) {
- list-style: none;
- margin: 12px 0 0;
- padding: 0;
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
-
- .league-page :global(.event-item) {
- display: flex;
- gap: 8px;
- font-size: 12.5px;
- }
-
- .league-page :global(.event-time) {
- color: var(--gray);
- font-variant-numeric: tabular-nums;
- min-width: 42px;
- }
-
- .league-page :global(.event-text) {
- display: flex;
- gap: 4px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.delay-block) {
- display: flex;
- flex-direction: column;
- gap: 6px;
- margin-top: 10px;
- }
-
- .league-page :global(.slider-row) {
- display: flex;
- align-items: center;
- gap: 10px;
- }
-
- .league-page :global(.slider-row input[type="range"]) {
- flex: 1;
- accent-color: var(--accent);
- }
-
- .league-page :global(.slider-edge) {
- font-size: 11.5px;
- color: var(--gray);
- min-width: 26px;
- }
-
- .league-page :global(.list-hint) {
- font-size: 11.5px;
- }
-
- .league-page :global(.champ-chips) {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.champ-chip) {
- display: inline-flex;
- align-items: center;
- gap: 6px;
- padding: 3px 6px 3px 3px;
- font-size: 12.5px;
- background: var(--button);
- border: none;
- border-radius: 999px;
- }
-
- .league-page :global(.chip-remove) {
- background: none;
- border: none;
- color: var(--gray);
- font-size: 14px;
- cursor: pointer;
- padding: 0 3px;
- line-height: 1;
- }
-
- .league-page :global(.chip-remove:hover),
- .league-page :global(.chip-remove:focus-visible) {
- color: var(--danger);
- outline: none;
- }
-
- .league-page :global(.champ-search) {
- position: relative;
- max-width: 260px;
- }
-
- .league-page :global(.input-text) {
- width: 100%;
- padding: 7px 10px;
- font-size: 13px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- color: var(--text);
- }
-
- .league-page :global(.input-text:focus-visible) {
- border-color: var(--accent);
- outline: none;
- }
-
- .league-page :global(.search-results) {
- position: absolute;
- top: calc(100% + 4px);
- left: 0;
- right: 0;
- z-index: 10;
- display: flex;
- flex-direction: column;
- background: var(--surface);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- overflow: hidden;
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
- }
-
- .league-page :global(.search-result) {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 6px 10px;
- font-size: 13px;
- background: none;
- border: none;
- color: var(--text);
- cursor: pointer;
- text-align: left;
- }
-
- .league-page :global(.search-result:hover),
- .league-page :global(.search-result:focus-visible) {
- background: var(--button);
- outline: none;
- }
-
- .league-page :global(.league-tabs) {
- display: flex;
- gap: 4px;
- flex-wrap: wrap;
- padding-bottom: 2px;
- border-bottom: none;
- }
-
- .league-page :global(.league-tab) {
- padding: 6px 12px;
- font-size: 12.5px;
- background: none;
- border: none;
- border-bottom: 2px solid transparent;
- color: var(--gray);
- cursor: pointer;
- }
-
- .league-page :global(.league-tab:hover) {
- color: var(--text);
- }
-
- .league-page :global(.league-tab.on) {
- color: var(--text);
- border-bottom-color: var(--accent);
- }
-
- .league-page :global(.league-tab:focus-visible) {
- outline: 1px solid var(--accent);
- outline-offset: -1px;
- }
-
- .league-page :global(.winbar-wrap) {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
-
- .league-page :global(.winbar) {
- position: relative;
- height: 12px;
- border-radius: 999px;
- background: var(--button);
- border: none;
- overflow: hidden;
- }
-
- .league-page :global(.winbar-fill) {
- height: 100%;
- background: var(--accent);
- }
-
- .league-page :global(.winbar-range) {
- position: absolute;
- top: 0;
- height: 100%;
- background: var(--accent);
- opacity: 0.25;
- }
-
- .league-page :global(.winbar-legend) {
- display: flex;
- align-items: baseline;
- gap: 10px;
- }
-
- .league-page :global(.win-value) {
- font-size: 22px;
- font-weight: 600;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.win-range),
- .league-page :global(.win-note) {
- font-size: 12px;
- color: var(--gray);
- }
-
- .league-page :global(.win-note) {
- margin: 8px 0 0;
- }
-
- .league-page :global(.win-disclaimer) {
- margin: 4px 0 0;
- font-size: 11.5px;
- color: var(--gray);
- line-height: 1.45;
- }
-
- .league-page :global(.premade-row) {
- display: flex;
- align-items: center;
- gap: 6px;
- flex-wrap: wrap;
- margin-top: 10px;
- }
-
- .league-page :global(.premade-source) {
- font-size: 0.75rem;
- color: var(--text-muted);
- }
-
- .league-page :global(.gold-summary) {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 14px;
- margin-bottom: 10px;
- font-size: 13px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.gold-team) {
- color: var(--gray);
- }
-
- .league-page :global(.gold-diff) {
- font-size: 17px;
- font-weight: 600;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.gold-diff.good),
- .league-page :global(.diff.good) {
- color: var(--success);
- }
-
- .league-page :global(.gold-diff.bad),
- .league-page :global(.diff.bad) {
- color: var(--danger);
- }
-
- .league-page :global(.metric-table) {
- display: flex;
- flex-direction: column;
- gap: 2px;
- overflow-x: auto;
- }
-
- .league-page :global(.metric-head),
- .league-page :global(.metric-row) {
- display: grid;
- grid-template-columns: minmax(120px, 1.6fr) 68px 92px 64px minmax(110px, 1fr);
- gap: 8px;
- align-items: center;
- padding: 5px 7px;
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- min-width: 460px;
- }
-
- .league-page :global(.metric-head) {
- color: var(--gray);
- font-size: 11px;
- text-transform: uppercase;
- letter-spacing: 0.04em;
- }
-
- .league-page :global(.metric-row) {
- border-radius: calc(var(--border-radius) - 4px);
- background: var(--button);
- }
-
- .league-page :global(.metric-row.self) {
- background: var(--accent-soft, var(--surface));
- }
-
- .league-page :global(.metric-name) {
- display: flex;
- align-items: center;
- gap: 6px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .league-page :global(.pos-chip) {
- font-size: 9.5px;
- padding: 1px 5px;
- border-radius: 4px;
- background: var(--surface);
- color: var(--gray);
- letter-spacing: 0.03em;
- }
-
- .league-page :global(.dim) {
- color: var(--gray);
- }
-
- .league-page :global(.goal-list) {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
-
- .league-page :global(.goal-row) {
- display: grid;
- grid-template-columns: minmax(80px, 1fr) minmax(90px, 2fr) minmax(90px, 1fr);
- gap: 10px;
- align-items: center;
- font-size: 12.5px;
- }
-
- .league-page :global(.goal-name) {
- color: var(--gray);
- }
-
- .league-page :global(.goal-bar) {
- height: 8px;
- border-radius: 999px;
- background: var(--button);
- border: none;
- overflow: hidden;
- }
-
- .league-page :global(.goal-fill) {
- height: 100%;
- background: var(--gray);
- }
-
- .league-page :global(.goal-fill.met) {
- background: var(--success);
- }
-
- .league-page :global(.goal-value) {
- text-align: right;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.goal-value.met) {
- color: var(--success);
- }
-
- .league-page :global(.goal-config) {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
- gap: 10px;
- margin: 10px 0;
- }
-
- .league-page :global(.goal-field) {
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
-
- .league-page :global(.goal-field-label) {
- font-size: 12px;
- color: var(--gray);
- }
-
- .league-page :global(.select-role) {
- padding: 5px 10px;
- font-size: 12.5px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- color: var(--text);
- }
-
- .league-page :global(.search-form) {
- display: flex;
- gap: 8px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.search-form .input-text) {
- flex: 1;
- min-width: 180px;
- }
-
- .league-page :global(.stat-grid) {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
- gap: 10px;
- }
-
- .league-page :global(.stat-cell) {
- display: flex;
- flex-direction: column;
- gap: 2px;
- padding: 10px 12px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- }
-
- .league-page :global(.stat-value) {
- font-size: 19px;
- font-weight: 600;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.stat-value.good) {
- color: var(--success);
- }
-
- .league-page :global(.stat-value.bad) {
- color: var(--danger);
- }
-
- .league-page :global(.stat-label) {
- font-size: 11.5px;
- color: var(--gray);
- }
-
- .league-page :global(.champ-table) {
- display: flex;
- flex-direction: column;
- gap: 3px;
- }
-
- .league-page :global(.champ-row) {
- display: flex;
- align-items: center;
- gap: 10px;
- padding: 6px 8px;
- background: var(--button);
- border-radius: calc(var(--border-radius) - 4px);
- font-size: 12.5px;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.champ-row-name) {
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .league-page :global(.champ-row-games),
- .league-page :global(.champ-row-kda),
- .league-page :global(.champ-row-cs) {
- color: var(--gray);
- flex-shrink: 0;
- }
-
- .league-page :global(.champ-row-wr) {
- flex-shrink: 0;
- font-weight: 600;
- }
-
- .league-page :global(.champ-row-wr.good) {
- color: var(--success);
- }
-
- .league-page :global(.champ-row-wr.bad) {
- color: var(--danger);
- }
-
- .league-page :global(.zone-bars) {
- display: flex;
- flex-direction: column;
- gap: 7px;
- }
-
- .league-page :global(.zone-row) {
- display: grid;
- grid-template-columns: 60px 1fr 52px;
- gap: 10px;
- align-items: center;
- font-size: 12.5px;
- }
-
- .league-page :global(.zone-name) {
- color: var(--gray);
- }
-
- .league-page :global(.chat-send) {
- display: flex;
- gap: 8px;
- margin-top: 12px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.chat-send .input-text) {
- flex: 1;
- min-width: 180px;
- }
-
- .league-page :global(.impact) {
- color: var(--accent);
- font-weight: 600;
- }
-
- .league-page :global(.rune-list) {
- display: flex;
- flex-direction: column;
- gap: 8px;
- margin-top: 10px;
- }
-
- .league-page :global(.rune-card) {
- display: flex;
- flex-direction: column;
- gap: 7px;
- padding: 9px 11px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- }
-
- .league-page :global(.rune-card.applied) {
- border-color: var(--accent);
- }
-
- .league-page :global(.rune-head) {
- display: flex;
- align-items: center;
- gap: 8px;
- }
-
- .league-page :global(.rune-keystone) {
- font-size: 13px;
- font-weight: 600;
- }
-
- .league-page :global(.rune-perks) {
- display: flex;
- gap: 5px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.perk-icon) {
- width: 26px;
- height: 26px;
- border-radius: 50%;
- background: var(--surface);
- }
-
- .league-page :global(.rune-foot) {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 10px;
- font-size: 12px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.tier-controls) {
- display: flex;
- gap: 6px;
- align-items: center;
- }
-
- .league-page :global(.tier-badge) {
- flex-shrink: 0;
- min-width: 30px;
- text-align: center;
- padding: 2px 6px;
- border-radius: 4px;
- font-size: 11px;
- font-weight: 700;
- background: var(--surface);
- border: none;
- }
-
- .league-page :global(.tier-badge.tier-1) {
- color: var(--on-accent);
- background: var(--accent);
- border-color: transparent;
- }
-
- .league-page :global(.tier-badge.tier-2) {
- color: var(--success);
- border-color: var(--success);
- }
-
- .league-page :global(.tier-badge.tier-3) {
- color: var(--text);
- }
-
- .league-page :global(.build-picker) {
- margin: 8px 0;
- }
-
- .league-page :global(.build-items) {
- display: flex;
- gap: 8px;
- flex-wrap: wrap;
- margin: 8px 0;
- }
-
- .league-page :global(.build-item) {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 2px;
- font-size: 10.5px;
- }
-
- .league-page :global(.item-icon) {
- width: 34px;
- height: 34px;
- border-radius: 6px;
- background: var(--button);
- }
-
- .league-page :global(.cd-list) {
- display: flex;
- flex-direction: column;
- gap: 5px;
- }
-
- .league-page :global(.cd-row) {
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 6px 8px;
- background: var(--button);
- border-radius: calc(var(--border-radius) - 4px);
- flex-wrap: wrap;
- }
-
- .league-page :global(.cd-champ) {
- display: flex;
- align-items: center;
- gap: 8px;
- min-width: 130px;
- }
-
- .league-page :global(.cd-id) {
- display: flex;
- flex-direction: column;
- gap: 1px;
- font-size: 11.5px;
- }
-
- .league-page :global(.cd-name) {
- font-size: 12.5px;
- font-weight: 600;
- }
-
- .league-page :global(.cd-abilities) {
- display: flex;
- gap: 8px;
- margin-left: auto;
- flex-wrap: wrap;
- }
-
- .league-page :global(.cd-ability) {
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 1px;
- min-width: 38px;
- }
-
- .league-page :global(.ability-icon) {
- width: 26px;
- height: 26px;
- border-radius: 5px;
- background: var(--surface);
- }
-
- .league-page :global(.cd-key) {
- font-size: 9.5px;
- color: var(--gray);
- letter-spacing: 0.05em;
- }
-
- .league-page :global(.cd-value) {
- font-size: 11.5px;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.scout-teams) {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 14px;
- }
-
- @media (max-width: 620px) {
- .league-page :global(.scout-teams) {
- grid-template-columns: 1fr;
- }
- }
-
- .league-page :global(.scout-team) {
- display: flex;
- flex-direction: column;
- gap: 6px;
- min-width: 0;
- }
-
- .league-page :global(.scout-team-title) {
- margin: 0 0 2px;
- font-size: 11.5px;
- font-weight: 600;
- text-transform: uppercase;
- letter-spacing: 0.05em;
- color: var(--gray);
- }
-
- .league-page :global(.scout-team-title.enemy) {
- color: var(--danger);
- }
-
- .league-page :global(.scout-row) {
- display: flex;
- flex-direction: column;
- gap: 5px;
- padding: 7px 9px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 3px);
- }
-
- .league-page :global(.scout-main) {
- display: flex;
- align-items: center;
- gap: 8px;
- min-width: 0;
- }
-
- .league-page :global(.scout-id) {
- display: flex;
- flex-direction: column;
- gap: 1px;
- min-width: 0;
- flex: 1;
- }
-
- .league-page :global(.scout-name) {
- font-size: 12.5px;
- font-weight: 600;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .league-page :global(.scout-name .tag) {
- color: var(--gray);
- font-weight: 400;
- }
-
- .league-page :global(.scout-rank) {
- font-size: 11px;
- color: var(--gray);
- }
-
- .league-page :global(.scout-stats) {
- display: flex;
- flex-direction: column;
- gap: 1px;
- align-items: flex-end;
- flex-shrink: 0;
- }
-
- .league-page :global(.scout-wr) {
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.scout-wr.good) {
- color: var(--success);
- }
-
- .league-page :global(.scout-wr.bad) {
- color: var(--danger);
- }
-
- .league-page :global(.scout-kda) {
- font-size: 11px;
- color: var(--gray);
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.scout-private) {
- font-size: 11.5px;
- color: var(--gray);
- flex-shrink: 0;
- }
-
- .league-page :global(.note-toggle) {
- background: none;
- border: none;
- color: var(--gray);
- font-size: 13px;
- cursor: pointer;
- padding: 2px 4px;
- border-radius: 4px;
- flex-shrink: 0;
- }
-
- .league-page :global(.note-toggle.has-note),
- .league-page :global(.note-toggle:hover),
- .league-page :global(.note-toggle:focus-visible) {
- color: var(--accent);
- outline: none;
- }
-
- .league-page :global(.scout-champs) {
- display: flex;
- align-items: center;
- gap: 6px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.scout-champ) {
- display: inline-flex;
- align-items: center;
- gap: 3px;
- }
-
- .league-page :global(.scout-champ-record) {
- font-size: 10.5px;
- color: var(--gray);
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.scout-tag) {
- font-size: 10.5px;
- padding: 2px 7px;
- border-radius: 999px;
- background: var(--surface);
- border: none;
- color: var(--text);
- }
-
- .league-page :global(.note-input) {
- font-size: 12px;
- padding: 5px 8px;
- }
-
- .league-page :global(.history-section) {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
-
- .league-page :global(.history-head) {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
-
- .league-page :global(.history-head h3) {
- margin: 0;
- font-size: 15px;
- }
-
- .league-page :global(.game-list) {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
-
- .league-page :global(.game-row) {
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 9px 12px;
- background: var(--surface);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- font: inherit;
- color: inherit;
- text-align: left;
- width: 100%;
- cursor: pointer;
- }
-
- .league-page :global(.game-row:hover),
- .league-page :global(.game-row.expanded) {
- border-color: var(--accent);
- }
-
- .league-page :global(.game-row-skeleton) {
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 9px 12px;
- background: var(--surface);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- }
-
- .league-page :global(.game-skeleton-info) {
- display: flex;
- flex-direction: column;
- gap: 5px;
- flex: 1;
- }
-
- .league-page :global(.skeleton-lines) {
- display: flex;
- flex-direction: column;
- gap: 8px;
- margin-top: 10px;
- }
-
- .league-page :global(.champ-icon) {
- width: 34px;
- height: 34px;
- border-radius: 6px;
- object-fit: cover;
- background: var(--button);
- }
-
- .league-page :global(.champ-icon.small) {
- width: 24px;
- height: 24px;
- border-radius: 5px;
- }
-
- .league-page :global(.champ-icon.tiny) {
- width: 20px;
- height: 20px;
- border-radius: 4px;
- }
-
- .league-page :global(.champ-empty) {
- border: none;
- }
-
- .league-page :global(.game-info) {
- display: flex;
- flex-direction: column;
- gap: 1px;
- min-width: 0;
- }
-
- .league-page :global(.game-result) {
- font-size: 13px;
- font-weight: 600;
- }
-
- .league-page :global(.game-result.win) {
- color: var(--success);
- }
-
- .league-page :global(.game-result.loss) {
- color: var(--danger);
- }
-
- .league-page :global(.game-mode) {
- font-size: 11.5px;
- color: var(--gray);
- }
-
- .league-page :global(.game-kda) {
- margin-left: auto;
- font-size: 13px;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.game-time) {
- font-size: 11.5px;
- color: var(--gray);
- min-width: 70px;
- text-align: right;
- }
-
- .league-page :global(.button) {
- padding: 6px 14px;
- font-size: 13px;
- background: var(--button);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- color: var(--text);
- cursor: pointer;
- }
-
- .league-page :global(.button:hover) {
- background: var(--button-elevated, var(--button));
- }
-
- .league-page :global(.button:focus-visible) {
- border-color: var(--accent);
- outline: none;
- }
-
- .league-page :global(.button.primary) {
- background: var(--accent);
- color: var(--on-accent);
- border-color: transparent;
- }
-
- .league-page :global(.button:disabled) {
- opacity: 0.6;
- cursor: default;
- }
-
- .league-page :global(.button.danger) {
- background: var(--danger);
- color: var(--on-status, var(--on-accent));
- border-color: transparent;
- }
-
- .league-page :global(.button.subtle) {
- color: var(--text-secondary);
- background: transparent;
- }
-
- .league-page :global(.button.subtle:hover) {
- color: var(--text);
- background: var(--surface-hover);
- }
-
- .league-page :global(.scoreboard-row.full) {
- display: flex;
- flex-direction: column;
- gap: 4px;
- padding: 6px 0;
- border-bottom: none;
- }
-
- .league-page :global(.sb-identity) {
- display: flex;
- align-items: center;
- gap: 6px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.sb-spells),
- .league-page :global(.sb-runes) {
- display: flex;
- gap: 2px;
- }
-
- .league-page :global(.sb-spell),
- .league-page :global(.sb-rune) {
- width: 14px;
- height: 14px;
- border-radius: 3px;
- }
-
- .league-page :global(.sb-rune.keystone) {
- width: 16px;
- height: 16px;
- }
-
- .league-page :global(.sb-name) {
- font-size: 12.5px;
- min-width: 110px;
- }
-
- .league-page :global(.sb-name.link) {
- background: none;
- border: none;
- padding: 0;
- color: var(--text);
- cursor: pointer;
- text-align: left;
- }
-
- .league-page :global(.sb-name.link:hover) {
- color: var(--accent);
- text-decoration: underline;
- }
-
- .league-page :global(.sb-items) {
- display: flex;
- gap: 2px;
- }
-
- .league-page :global(.item-icon.tiny),
- .league-page :global(.item-empty) {
- width: 16px;
- height: 16px;
- border-radius: 3px;
- }
-
- .league-page :global(.item-empty) {
- border: none;
- display: inline-block;
- }
-
- .league-page :global(.sb-stats) {
- display: flex;
- gap: 10px;
- flex-wrap: wrap;
- font-size: 11px;
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.sb-flag) {
- font-size: 10.5px;
- color: var(--accent);
- }
-
- .league-page :global(.lookup-drawer) {
- margin-top: 12px;
- padding-top: 10px;
- border-top: none;
- }
-
- .league-page :global(.game-row.static) {
- display: flex;
- align-items: center;
- gap: 8px;
- cursor: default;
- }
-
- .league-page :global(.feature-badge) {
- font-size: 10px;
- font-weight: 400;
- color: var(--text-muted);
- border: none;
- border-radius: 999px;
- padding: 1px 6px;
- margin-left: 6px;
- vertical-align: middle;
- }
-
- .league-page :global(.profile-tools) {
- margin-bottom: 10px;
- }
-
- .league-page :global(.profile-tools summary) {
- cursor: pointer;
- font-size: 12.5px;
- color: var(--text-secondary);
- padding: 4px 0;
- }
-
- .league-page :global(.profile-tool-row) {
- display: flex;
- align-items: center;
- gap: 8px;
- flex-wrap: wrap;
- margin: 8px 0;
- }
-
- .league-page :global(.tiny-input) {
- max-width: 96px;
- }
-
- .league-page :global(.skin-options) {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- }
-
- .league-page :global(.profile-saved) {
- font-size: 12px;
- color: var(--success);
- margin: 4px 0;
- }
-
- .league-page :global(.skill-order) {
- display: flex;
- gap: 3px;
- flex-wrap: wrap;
- margin: 6px 0 10px;
- }
-
- .league-page :global(.skill-step) {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- width: 18px;
- height: 18px;
- border: none;
- border-radius: 4px;
- font-size: 10.5px;
- color: var(--text-secondary);
- }
-
- .league-page :global(.skill-step.ult) {
- border-color: var(--accent);
- color: var(--text);
- }
-
- .league-page :global(.build-phase) {
- display: flex;
- flex-direction: column;
- gap: 4px;
- margin-bottom: 8px;
- }
-
- .league-page :global(.scout-score) {
- font-size: 11.5px;
- color: var(--text-secondary);
- font-variant-numeric: tabular-nums;
- }
-
- .league-page :global(.objective-line) {
- display: flex;
- gap: 12px;
- flex-wrap: wrap;
- font-size: 11.5px;
- color: var(--text-secondary);
- margin: 4px 0;
- }
-
- .league-page :global(.ban-line) {
- display: flex;
- align-items: center;
- gap: 4px;
- flex-wrap: wrap;
- font-size: 11.5px;
- margin-bottom: 6px;
- }
-
- .league-page :global(.repair-row) {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- gap: 8px;
- flex-wrap: wrap;
- margin-bottom: 10px;
- }
-
- .league-page :global(.repair-note) {
- font-size: 12px;
- color: var(--text-secondary);
- }
-
- .league-page :global(.button.subtle-danger) {
- color: var(--danger);
- border-color: color-mix(in oklab, var(--danger) 35%, transparent);
- background: transparent;
- }
-
- .league-page :global(.button.subtle-danger:hover) {
- background: color-mix(in oklab, var(--danger) 10%, transparent);
- }
-
- .league-page :global(.dodge-row) {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- gap: 8px;
- margin-top: 10px;
- }
-
- .league-page :global(.dodge-warning) {
- font-size: 12.5px;
- color: var(--text-secondary, var(--text));
- margin-right: auto;
- }
-
- .league-page :global(.seg-group) {
- display: flex;
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- overflow: hidden;
- }
-
- .league-page :global(.seg) {
- padding: 5px 12px;
- font-size: 12.5px;
- background: transparent;
- border: none;
- color: var(--text-secondary, var(--text));
- cursor: pointer;
- }
-
- .league-page :global(.seg + .seg) {
- border-left: none;
- }
-
- .league-page :global(.seg.on) {
- background: var(--accent);
- color: var(--on-accent);
- }
-
- .league-page :global(.action-row.stacked) {
- flex-direction: column;
- align-items: stretch;
- gap: 8px;
- }
-
- .league-page :global(.message-input) {
- width: 100%;
- }
-
- .league-page :global(.seen-badge) {
- font-size: 11px;
- padding: 1px 6px;
- border-radius: 999px;
- background: color-mix(in oklab, var(--accent) 14%, transparent);
- color: var(--accent);
- margin-left: 6px;
- white-space: nowrap;
- }
-
- .league-page :global(.spell-timer) {
- cursor: pointer;
- border: none;
- background: var(--surface);
- font: inherit;
- color: inherit;
- }
-
- .league-page :global(.spell-timer.running) {
- border-color: var(--accent);
- background: color-mix(in oklab, var(--accent) 12%, transparent);
- }
-
- .league-page :global(.spell-timer.running .cd-value) {
- color: var(--accent);
- font-weight: 600;
- }
-
- .league-page :global(.game-chevron) {
- color: var(--text-secondary, var(--text));
- font-size: 12px;
- }
-
- .league-page :global(.scoreboard) {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 10px;
- padding: 10px 12px;
- background: var(--surface);
- border: none;
- border-radius: calc(var(--border-radius) - 2px);
- }
-
- .league-page :global(.scoreboard-team) {
- display: flex;
- flex-direction: column;
- gap: 4px;
- min-width: 0;
- }
-
- .league-page :global(.scoreboard-result) {
- font-size: 12px;
- font-weight: 600;
- }
-
- .league-page :global(.scoreboard-result.win) {
- color: var(--success, var(--accent));
- }
-
- .league-page :global(.scoreboard-result.loss) {
- color: var(--danger);
- }
-
- .league-page :global(.scoreboard-row) {
- display: flex;
- align-items: center;
- gap: 6px;
- font-size: 12px;
- min-width: 0;
- }
-
- .league-page :global(.scoreboard-name) {
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .league-page :global(.scoreboard-kda) {
- white-space: nowrap;
- }
-
- .league-page :global(.scoreboard-cs),
- .league-page :global(.scoreboard-gold),
- .league-page :global(.scoreboard-dmg) {
- white-space: nowrap;
- }
-
- @media (max-width: 560px) {
- .league-page :global(.scoreboard) {
- grid-template-columns: 1fr;
- }
-
- .league-page :global(.scoreboard-cs),
- .league-page :global(.scoreboard-dmg) {
- display: none;
- }
- }
-
- .league-page :global(.toggle) {
- position: relative;
- width: 40px;
- height: 22px;
- border-radius: 999px;
- background: var(--button);
- border: none;
- cursor: pointer;
- flex-shrink: 0;
- }
-
- .league-page :global(.toggle:focus-visible) {
- border-color: var(--accent);
- outline: none;
- }
-
- .league-page :global(.toggle .toggle-knob) {
- position: absolute;
- top: 2px;
- left: 2px;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- background: var(--gray);
- transition: transform 0.15s ease, background 0.15s ease;
- }
-
- .league-page :global(.toggle.on .toggle-knob) {
- transform: translateX(18px);
- background: var(--accent);
- }
-
- @media (prefers-reduced-motion: reduce) {
- .league-page :global(.toggle .toggle-knob) {
- transition: none;
- }
- }
-</style>