From 4f1dc64d5df4aa0b24286b97b236ac468e17fe43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Fri, 15 May 2026 12:00:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D0=B1=D1=80=D0=BE=D1=81=20=D0=B8=D0=BD=D0=BF?= =?UTF-8?q?=D1=83=D1=82=D0=BE=D0=B2=20=D0=BD=D0=B0=20=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=D1=85=20(?= =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/script.js | 67 +++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/static/script.js b/static/script.js index 263c3e5..802925f 100644 --- a/static/script.js +++ b/static/script.js @@ -2285,52 +2285,48 @@ function convertPitchYToPan(y) { } + // function buildVmixCommandsFromFormation(side) { // const players = Array.isArray(formationState[side]) ? formationState[side] : []; -// const inputName = getFormationVmixInputName(side); // const commands = []; // const playerPrefix = side === "home" ? "HOME" : "AWAY"; +// const inputName = side === "home" ? "РАССТАНОВКА - ХОЗЯЕВА" : "РАССТАНОВКА - ГОСТИ"; + // if (players.length < 2) { // return []; // } -// // Сбрасываем только свою сторону -// for (let i = 1; i <= 10; i++) { -// commands.push( -// vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(`${playerPrefix} - Игрок${i}`)}`) -// ); -// } - -// commands.push( -// vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(inputName)}`) -// ); - // // Вратарь players[0], полевые players[1..10] // players.slice(1, 11).forEach((player, index) => { -// const layer = index + 1; +// const playerNumber = index + 1; +// const playerInputName = `${playerPrefix} - Игрок${playerNumber}`; + // const x = convertPitchXToPan(player.x).toFixed(3); // const y = convertPitchYToPan(player.y).toFixed(3); + +// for (let i = 1; i <= 10; i++) { // commands.push( -// vmixCmd(`Function=SetLayer${layer}PanX&Input=${encodeURIComponent(inputName)}&Value=${x}`) +// vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(`${playerPrefix} - Игрок${i}`)}`) // ); +// }; + // commands.push( -// vmixCmd(`Function=SetLayer${layer}PanX&Input=${encodeURIComponent(inputName)}&Value=${x}`) +// vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(inputName)}`) +// ); + + + +// commands.push( +// vmixCmd(`Function=SetPanX&Input=${encodeURIComponent(playerInputName)}&Value=${x}`) // ); // commands.push( -// vmixCmd(`Function=SetLayer${layer}PanY&Input=${encodeURIComponent(inputName)}&Value=${y}`) -// ); -// commands.push( -// vmixCmd(`Function=SetLayer${layer}PanY&Input=${encodeURIComponent(inputName)}&Value=${y}`) +// vmixCmd(`Function=SetPanY&Input=${encodeURIComponent(playerInputName)}&Value=${y}`) // ); // }); -// commands.push( -// vmixCmd(`Function=PreviewInput&Input=${encodeURIComponent(inputName)}`) -// ); - // return commands; // } @@ -2340,12 +2336,20 @@ function buildVmixCommandsFromFormation(side) { const playerPrefix = side === "home" ? "HOME" : "AWAY"; const inputName = side === "home" ? "РАССТАНОВКА - ХОЗЯЕВА" : "РАССТАНОВКА - ГОСТИ"; - if (players.length < 2) { return []; } - // Вратарь players[0], полевые players[1..10] + for (let i = 1; i <= 10; i++) { + commands.push( + vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(`${playerPrefix} - Игрок${i}`)}`) + ); + } + + commands.push( + vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(inputName)}`) + ); + players.slice(1, 11).forEach((player, index) => { const playerNumber = index + 1; const playerInputName = `${playerPrefix} - Игрок${playerNumber}`; @@ -2353,19 +2357,6 @@ function buildVmixCommandsFromFormation(side) { const x = convertPitchXToPan(player.x).toFixed(3); const y = convertPitchYToPan(player.y).toFixed(3); - - for (let i = 1; i <= 10; i++) { - commands.push( - vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(`${playerPrefix} - Игрок${i}`)}`) - ); - }; - - commands.push( - vmixCmd(`Function=ResetInput&Input=${encodeURIComponent(inputName)}`) - ); - - - commands.push( vmixCmd(`Function=SetPanX&Input=${encodeURIComponent(playerInputName)}&Value=${x}`) );