Compare commits

...

2 Commits

2 changed files with 32 additions and 70 deletions

View File

@@ -1044,32 +1044,6 @@ function escapeVmixValue(value) {
return String(value ?? "").trim();
}
function getVmixTeamLogo(teamName) {
const basePath = "D:\\Графика\\ФУТБОЛ\\Женская Суперлига 2026\\Teams Logos";
let clean = String(teamName || "").replaceAll("«", "").replaceAll("»", "").trim();
if (clean === "Зенит" || clean === "Динамо") {
clean += "_Синий";
}
return `${basePath}\\${clean}.png`;
}
function getScoreSum() {
return Number(scoreState?.home || 0) + Number(scoreState?.away || 0);
}
function getSubOutName(payload) {
const raw = String(payload.player_name || "");
if (raw.includes("→")) return raw.split("→")[0].trim();
return String(payload.player_name_out || "").trim();
}
function getSubInName(payload) {
const raw = String(payload.player_name || "");
if (raw.includes("→")) return raw.split("→")[1].trim();
return String(payload.player_name_in || "").trim();
}
function buildVmixCommandsFromEvent(payload) {
const eventType = String(payload?.event_type || "");
@@ -2285,52 +2259,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 +2310,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 +2331,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}`)
);

View File

@@ -66,6 +66,9 @@
font-family: Arial, sans-serif;
letter-spacing: 0.02em;
box-shadow: 0 0 10px rgba(123, 97, 255, 0.28);
object-fit: contain; /* чтобы не растягивалась */
display: block;
}
.vmix-btn {
display: inline-flex;
@@ -84,12 +87,6 @@
background: #222;
}
.vmix-icon {
width: 1em; /* подгоняешь под стиль кнопок */
height: 1em;
object-fit: contain; /* чтобы не растягивалась */
display: block;
}
</style>