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): escolher como o pick automatico e concluido (#258)

antonioe47e45d5ce4a
diff --git a/src-tauri/omniget-core/src/models/settings.rs b/src-tauri/omniget-core/src/models/settings.rs
index d4e4da5e..abcc1edf 100644
--- a/src-tauri/omniget-core/src/models/settings.rs
+++ b/src-tauri/omniget-core/src/models/settings.rs
@@ -64,12 +64,18 @@ pub struct LeagueSettings {
#[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,
@@ -100,9 +106,12 @@ impl Default for LeagueSettings {
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(),
diff --git a/src-tauri/src/commands/league/champ_select.rs b/src-tauri/src/commands/league/champ_select.rs
index 5167ebd0..7f51a716 100644
--- a/src-tauri/src/commands/league/champ_select.rs
+++ b/src-tauri/src/commands/league/champ_select.rs
@@ -47,6 +47,50 @@ pub fn choose_champion(
.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),
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;
@@ -111,4 +155,40 @@ mod tests {
// 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);
+ }
}
diff --git a/src-tauri/src/commands/league/lobby.rs b/src-tauri/src/commands/league/lobby.rs
new file mode 100644
index 00000000..3a6f7939
--- /dev/null
+++ b/src-tauri/src/commands/league/lobby.rs
@@ -0,0 +1,79 @@
+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/mod.rs b/src-tauri/src/commands/league/mod.rs
index 0927417b..8b824cb6 100644
--- a/src-tauri/src/commands/league/mod.rs
+++ b/src-tauri/src/commands/league/mod.rs
@@ -1,6 +1,7 @@
pub mod analysis;
pub mod champ_select;
pub mod live;
+pub mod lobby;
pub mod locator;
pub mod stats;
pub mod ws;
@@ -31,6 +32,7 @@ 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?;
@@ -2975,13 +2977,31 @@ async fn handle_champ_select(
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 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 });
match lcu_send(client, reqwest::Method::PATCH, &path, Some(body)).await {
Ok(_) => {
- let mut handled = CS_HANDLED.lock().await;
- handled.insert(action_id);
+ 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,
diff --git a/src-tauri/src/commands/league/ws.rs b/src-tauri/src/commands/league/ws.rs
index 1baa5d15..2cdcb3ef 100644
--- a/src-tauri/src/commands/league/ws.rs
+++ b/src-tauri/src/commands/league/ws.rs
@@ -18,6 +18,10 @@ static ACCEPT_PENDING: AtomicBool = AtomicBool::new(false);
static NOTIFIED_READY_CHECK: AtomicBool = AtomicBool::new(false);
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.
@@ -267,7 +271,9 @@ async fn handle_event(client: &LcuClient, value: &Value) {
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);
emit("league-champ-select", Value::Null);
return;
@@ -280,6 +286,7 @@ async fn handle_event(client: &LcuClient, value: &Value) {
}
}
handle_trades(client, &settings, &data).await;
+ handle_swaps(client, &settings, &data).await;
send_auto_message(client, &settings);
}
"/lol-lobby/v2/lobby" => {
@@ -315,7 +322,12 @@ async fn on_phase(client: &LcuClient, phase: &str) {
"EndOfGame" => {
if settings.auto_play_again {
match lcu_post_raw(client, "/lol-lobby/v2/play-again").await {
- Ok(_) => tracing::info!("[league] queued play again"),
+ 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),
}
}
@@ -331,7 +343,9 @@ async fn on_phase(client: &LcuClient, phase: &str) {
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);
}
}
@@ -395,6 +409,64 @@ async fn handle_trades(
}
}
+/// 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(
diff --git a/src/components/league/AutomationTab.svelte b/src/components/league/AutomationTab.svelte
index 1fe01b33..b053e234 100644
--- a/src/components/league/AutomationTab.svelte
+++ b/src/components/league/AutomationTab.svelte
@@ -42,6 +42,24 @@
}
}
+ 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_honor" | "auto_play_again" | "auto_requeue" | "auto_accept_swaps" | "auto_reconnect" | "notify_ready_check") {
function toggleLeagueFlag(field: "auto_pick" | "auto_ban" | "auto_lock" | "auto_honor" | "auto_play_again" | "auto_reconnect" | "notify_ready_check") {
const current = (settings?.league as any)?.[field] ?? false;
updateSettings({ league: { [field]: !current } });
@@ -232,12 +250,20 @@
<div class="divider"></div>
<div class="action-row">
<div class="action-col">
- <span class="action-label">{$t("league.auto_lock")}</span>
- <span class="action-hint">{$t("league.auto_lock_desc")}</span>
+ <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>
- <button class="toggle" class:on={settings?.league?.auto_lock} onclick={() => toggleLeagueFlag("auto_lock")} role="switch" aria-checked={settings?.league?.auto_lock ?? false} aria-label={$t("league.auto_lock") as string}>
- <span class="toggle-knob"></span>
- </button>
</div>
{/if}
<div class="divider"></div>
@@ -288,6 +314,27 @@
{/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 stacked">
<div class="action-col">
diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.json
index 1fc5aa24..29d94139 100644
--- a/src/lib/i18n/el.json
+++ b/src/lib/i18n/el.json
@@ -191,12 +191,21 @@
"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": "Παρακολούθηση παιχνιδιού",
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index 383ffae7..3ef8da8e 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -209,12 +209,21 @@
"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",
diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.json
index f6824ed5..bf04bd43 100644
--- a/src/lib/i18n/es.json
+++ b/src/lib/i18n/es.json
@@ -191,12 +191,21 @@
"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",
diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json
index 1b0ce1ac..76ad3417 100644
--- a/src/lib/i18n/fr.json
+++ b/src/lib/i18n/fr.json
@@ -191,12 +191,21 @@
"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",
diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.json
index 5e42acec..502d5517 100644
--- a/src/lib/i18n/it.json
+++ b/src/lib/i18n/it.json
@@ -191,12 +191,21 @@
"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",
diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.json
index 719e5475..c490a704 100644
--- a/src/lib/i18n/ja.json
+++ b/src/lib/i18n/ja.json
@@ -191,12 +191,21 @@
"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": "観戦する",
diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.ts
index 08349a5d..0475821f 100644
--- a/src/lib/i18n/keys.ts
+++ b/src/lib/i18n/keys.ts
@@ -412,6 +412,10 @@ export type TranslationKeys =
| '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'
@@ -517,6 +521,11 @@ export type TranslationKeys =
| '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.play_again'
| 'league.players'
diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.json
index f88ee6b3..8d83c7f4 100644
--- a/src/lib/i18n/pt.json
+++ b/src/lib/i18n/pt.json
@@ -191,12 +191,21 @@
"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",
diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.json
index ae0d8577..06d38967 100644
--- a/src/lib/i18n/ru.json
+++ b/src/lib/i18n/ru.json
@@ -191,12 +191,21 @@
"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": "Смотреть игру",
diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.json
index 32c7a993..f465c0b9 100644
--- a/src/lib/i18n/zh-TW.json
+++ b/src/lib/i18n/zh-TW.json
@@ -191,12 +191,21 @@
"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": "觀戰",
diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.json
index 967f950a..f4bb6b60 100644
--- a/src/lib/i18n/zh.json
+++ b/src/lib/i18n/zh.json
@@ -191,12 +191,21 @@
"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": "观战",
diff --git a/src/lib/stores/settings-store.svelte.ts b/src/lib/stores/settings-store.svelte.ts
index a55dcc43..9035d5b5 100644
--- a/src/lib/stores/settings-store.svelte.ts
+++ b/src/lib/stores/settings-store.svelte.ts
@@ -99,9 +99,12 @@ export type AppSettings = {
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;