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.

feat(league): rerollar o ARAM sem perder o campeao e limpar a troca respondida (#256)

antonio8262f7a5d79a
diff --git a/src-tauri/omniget-core/src/models/settings.rs b/src-tauri/omniget-core/src/models/settings.rs
index 8b64b986..d4e4da5e 100644
--- a/src-tauri/omniget-core/src/models/settings.rs
+++ b/src-tauri/omniget-core/src/models/settings.rs
@@ -60,6 +60,8 @@ pub struct LeagueSettings {
#[serde(default)]
pub auto_ban: bool,
#[serde(default)]
+ pub auto_ban_delay: u8,
+ #[serde(default)]
pub auto_lock: bool,
#[serde(default)]
pub auto_runes: bool,
@@ -96,6 +98,7 @@ impl Default for LeagueSettings {
notify_ready_check: default_notify_ready_check(),
auto_pick: false,
auto_ban: false,
+ auto_ban_delay: 0,
auto_lock: false,
auto_runes: false,
auto_honor: false,
diff --git a/src-tauri/src/commands/league/champ_select.rs b/src-tauri/src/commands/league/champ_select.rs
new file mode 100644
index 00000000..5167ebd0
--- /dev/null
+++ b/src-tauri/src/commands/league/champ_select.rs
@@ -0,0 +1,114 @@
+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()
+}
+
+#[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));
+ }
+}
diff --git a/src-tauri/src/commands/league/mod.rs b/src-tauri/src/commands/league/mod.rs
index 4541c853..5c7fbf9f 100644
--- a/src-tauri/src/commands/league/mod.rs
+++ b/src-tauri/src/commands/league/mod.rs
@@ -1,4 +1,5 @@
pub mod analysis;
+pub mod champ_select;
pub mod live;
pub mod locator;
pub mod stats;
@@ -28,6 +29,8 @@ pub struct LeagueStatus {
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()));
async fn discover_client() -> Option<LcuClient> {
let (credentials, source) = locator::discover().await?;
@@ -476,6 +479,33 @@ pub async fn league_reroll() -> Result<(), String> {
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()?;
@@ -2842,6 +2872,8 @@ async fn handle_champ_select(
}
}
+ let ally_intents = champ_select::ally_pick_intents(session, cell);
+
let mut pickable: Option<HashSet<i64>> = None;
let mut bannable: Option<HashSet<i64>> = None;
@@ -2910,14 +2942,28 @@ async fn handle_champ_select(
Some(p) => p,
None => continue,
};
- let choice = list
- .iter()
- .find(|c| pool.contains(c) && !taken.contains(c))
- .copied();
- let choice = match choice {
+ let avoid: HashSet<i64> = if action_type == "ban" {
+ ally_intents.clone()
+ } else {
+ HashSet::new()
+ };
+ let choice = match champ_select::choose_champion(&list, pool, &taken, &avoid) {
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;
+ }
+ }
let complete_action = settings.auto_lock || action_type == "ban";
let path = format!("/lol-champ-select/v1/session/actions/{}", action_id);
let body = json!({ "championId": choice, "completed": complete_action });
diff --git a/src-tauri/src/commands/league/ws.rs b/src-tauri/src/commands/league/ws.rs
index e6f4cd1c..1baa5d15 100644
--- a/src-tauri/src/commands/league/ws.rs
+++ b/src-tauri/src/commands/league/ws.rs
@@ -266,6 +266,7 @@ async fn handle_event(client: &LcuClient, value: &Value) {
"/lol-champ-select/v1/session" => {
if event_type == "Delete" {
super::CS_HANDLED.lock().await.clear();
+ super::CS_FIRST_SEEN.lock().await.clear();
TRADES_HANDLED.lock().await.clear();
MESSAGE_SENT.store(false, Ordering::SeqCst);
emit("league-champ-select", Value::Null);
@@ -329,6 +330,7 @@ async fn on_phase(client: &LcuClient, phase: &str) {
_ => {
if phase != "ChampSelect" {
super::CS_HANDLED.lock().await.clear();
+ super::CS_FIRST_SEEN.lock().await.clear();
TRADES_HANDLED.lock().await.clear();
MESSAGE_SENT.store(false, Ordering::SeqCst);
}
@@ -377,6 +379,16 @@ async fn handle_trades(
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),
}
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 5389cbd5..975d1bf2 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -825,6 +825,7 @@ pub fn run() {
commands::league::league_champ_select_session,
commands::league::league_bench_swap,
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,
diff --git a/src/components/league/AutomationTab.svelte b/src/components/league/AutomationTab.svelte
index d5838d27..1fe01b33 100644
--- a/src/components/league/AutomationTab.svelte
+++ b/src/components/league/AutomationTab.svelte
@@ -19,6 +19,12 @@
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);
@@ -174,6 +180,28 @@
</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">
diff --git a/src/components/league/OverviewTab.svelte b/src/components/league/OverviewTab.svelte
index 6ffb10e3..651023c4 100644
--- a/src/components/league/OverviewTab.svelte
+++ b/src/components/league/OverviewTab.svelte
@@ -147,7 +147,12 @@
</button>
{/each}
</div>
- <button class="button" onclick={() => onAction("league_reroll")}>{$t("league.reroll")}</button>
+ <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}
{#if dodgeError}
diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.json
index 09dc745f..f6c25c83 100644
--- a/src/lib/i18n/el.json
+++ b/src/lib/i18n/el.json
@@ -178,6 +178,8 @@
"champ_select_title": "Επιλογή ηρώων",
"bench_title": "Πάγκος",
"reroll": "Reroll",
+ "reroll_keep": "Reroll διατηρώντας τον ήρωα",
+ "reroll_keep_hint": "Ξοδεύει το reroll για να διευρύνει τον πάγκο και επαναφέρει τον ήρωά σου.",
"swap": "Αλλαγή σε",
"remove": "Αφαίρεση",
"live_title": "Ζωντανός αγώνας",
@@ -223,6 +225,8 @@
"match_damage": "ζημιά",
"match_detail_unavailable": "Οι λεπτομέρειες του αγώνα δεν είναι διαθέσιμες.",
"pick_list": "Προτεραιότητα pick",
+ "ban_delay": "Αναμονή πριν το ban",
+ "ban_delay_desc": "Καθυστερεί το ban και παρακάμπτει ήρωες που έχει δηλώσει σύμμαχος.",
"ban_list": "Προτεραιότητα ban",
"list_hint": "η σειρά μετράει",
"search_champion": "Αναζήτηση ήρωα…",
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index e11126b1..fe710cbb 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -196,6 +196,8 @@
"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",
@@ -241,6 +243,8 @@
"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…",
diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.json
index 0be8704b..e30c4241 100644
--- a/src/lib/i18n/es.json
+++ b/src/lib/i18n/es.json
@@ -178,6 +178,8 @@
"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",
@@ -223,6 +225,8 @@
"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…",
diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json
index 65ef4726..2cebec33 100644
--- a/src/lib/i18n/fr.json
+++ b/src/lib/i18n/fr.json
@@ -178,6 +178,8 @@
"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",
@@ -223,6 +225,8 @@
"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…",
diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.json
index ba406965..e5231ee8 100644
--- a/src/lib/i18n/it.json
+++ b/src/lib/i18n/it.json
@@ -178,6 +178,8 @@
"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",
@@ -223,6 +225,8 @@
"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…",
diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.json
index b9580f7f..d349cd83 100644
--- a/src/lib/i18n/ja.json
+++ b/src/lib/i18n/ja.json
@@ -178,6 +178,8 @@
"champ_select_title": "チャンピオン選択",
"bench_title": "ベンチ",
"reroll": "リロール",
+ "reroll_keep": "リロールしてチャンピオンを維持",
+ "reroll_keep_hint": "リロールを消費してベンチを広げ、今のチャンピオンを戻します。",
"swap": "交換",
"remove": "削除",
"live_title": "進行中のゲーム",
@@ -223,6 +225,8 @@
"match_damage": "ダメージ",
"match_detail_unavailable": "試合の詳細を取得できません。",
"pick_list": "ピック優先度",
+ "ban_delay": "BANまでの待機時間",
+ "ban_delay_desc": "BANを少し遅らせ、味方が宣言済みのチャンピオンを避けます。",
"ban_list": "バン優先度",
"list_hint": "順序が重要",
"search_champion": "チャンピオンを検索…",
diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.ts
index db002602..80ef3b00 100644
--- a/src/lib/i18n/keys.ts
+++ b/src/lib/i18n/keys.ts
@@ -418,6 +418,8 @@ export type TranslationKeys =
| 'league.auto_trade_desc'
| 'league.auto_trade_off'
| 'league.automation_title'
+ | 'league.ban_delay'
+ | 'league.ban_delay_desc'
| 'league.ban_list'
| 'league.bench_title'
| 'league.build_champion'
@@ -529,6 +531,8 @@ export type TranslationKeys =
| 'league.refresh'
| 'league.remove'
| 'league.reroll'
+ | 'league.reroll_keep'
+ | 'league.reroll_keep_hint'
| 'league.respawn_in'
| 'league.role_bottom'
| 'league.role_jungle'
diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.json
index 86e263aa..3033568a 100644
--- a/src/lib/i18n/pt.json
+++ b/src/lib/i18n/pt.json
@@ -178,6 +178,8 @@
"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",
@@ -223,6 +225,8 @@
"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…",
diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.json
index 30ad6fcf..b7bcd7e3 100644
--- a/src/lib/i18n/ru.json
+++ b/src/lib/i18n/ru.json
@@ -178,6 +178,8 @@
"champ_select_title": "Выбор чемпионов",
"bench_title": "Скамейка",
"reroll": "Реролл",
+ "reroll_keep": "Реролл с сохранением чемпиона",
+ "reroll_keep_hint": "Тратит реролл, чтобы расширить скамейку, и возвращает вашего текущего чемпиона.",
"swap": "Взять",
"remove": "Убрать",
"live_title": "Текущая игра",
@@ -223,6 +225,8 @@
"match_damage": "урон",
"match_detail_unavailable": "Детали матча недоступны.",
"pick_list": "Приоритет пиков",
+ "ban_delay": "Пауза перед баном",
+ "ban_delay_desc": "Задерживает бан и пропускает чемпионов, которых уже заявил союзник.",
"ban_list": "Приоритет банов",
"list_hint": "порядок важен",
"search_champion": "Поиск чемпиона…",
diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.json
index fd77a3f3..2488a1bf 100644
--- a/src/lib/i18n/zh-TW.json
+++ b/src/lib/i18n/zh-TW.json
@@ -178,6 +178,8 @@
"champ_select_title": "英雄選擇",
"bench_title": "候補席",
"reroll": "重骰",
+ "reroll_keep": "重隨但保留英雄",
+ "reroll_keep_hint": "花費重隨擴充備選席,並把你目前的英雄換回來。",
"swap": "交換",
"remove": "移除",
"live_title": "進行中的對戰",
@@ -223,6 +225,8 @@
"match_damage": "傷害",
"match_detail_unavailable": "無法取得對局詳情。",
"pick_list": "選角優先序",
+ "ban_delay": "禁用前等待",
+ "ban_delay_desc": "延後禁用,並跳過隊友已經預選的英雄。",
"ban_list": "禁用優先序",
"list_hint": "順序有影響",
"search_champion": "搜尋英雄…",
diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.json
index 8ca89542..f5faae95 100644
--- a/src/lib/i18n/zh.json
+++ b/src/lib/i18n/zh.json
@@ -178,6 +178,8 @@
"champ_select_title": "英雄选择",
"bench_title": "候选席",
"reroll": "重随",
+ "reroll_keep": "重随但保留英雄",
+ "reroll_keep_hint": "花费重随扩充备选席,并把你当前的英雄换回来。",
"swap": "交换",
"remove": "移除",
"live_title": "进行中的对局",
@@ -223,6 +225,8 @@
"match_damage": "伤害",
"match_detail_unavailable": "无法获取对局详情。",
"pick_list": "选用优先级",
+ "ban_delay": "禁用前等待",
+ "ban_delay_desc": "延后禁用,并跳过队友已经预选的英雄。",
"ban_list": "禁用优先级",
"list_hint": "顺序有影响",
"search_champion": "搜索英雄…",
diff --git a/src/lib/stores/settings-store.svelte.ts b/src/lib/stores/settings-store.svelte.ts
index 6697f3fc..a55dcc43 100644
--- a/src/lib/stores/settings-store.svelte.ts
+++ b/src/lib/stores/settings-store.svelte.ts
@@ -97,6 +97,7 @@ export type AppSettings = {
notify_ready_check?: boolean;
auto_pick?: boolean;
auto_ban?: boolean;
+ auto_ban_delay?: number;
auto_lock?: boolean;
auto_runes?: boolean;
auto_honor?: boolean;
diff --git a/src/routes/league/+page.svelte b/src/routes/league/+page.svelte
index 2365ab84..180721cd 100644
--- a/src/routes/league/+page.svelte
+++ b/src/routes/league/+page.svelte
@@ -848,6 +848,12 @@
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;