@@ -1044,32 +1044,6 @@ function escapeVmixValue(value) {
return String ( value ? ? "" ) . trim ( ) ;
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 ) {
function buildVmixCommandsFromEvent ( payload ) {
const eventType = String ( payload ? . event _type || "" ) ;
const eventType = String ( payload ? . event _type || "" ) ;
@@ -2285,52 +2259,48 @@ function convertPitchYToPan(y) {
}
}
// function buildVmixCommandsFromFormation(side) {
// function buildVmixCommandsFromFormation(side) {
// const players = Array.isArray(formationState[side]) ? formationState[side] : [];
// const players = Array.isArray(formationState[side]) ? formationState[side] : [];
// const inputName = getFormationVmixInputName(side);
// const commands = [];
// const commands = [];
// const playerPrefix = side === "home" ? "HOME" : "AWAY";
// const playerPrefix = side === "home" ? "HOME" : "AWAY";
// const inputName = side === "home" ? "Р А С С Т А Н О В К А - ХОЗЯЕВА" : "Р А С С Т А Н О В К А - ГОСТИ";
// if (players.length < 2) {
// if (players.length < 2) {
// return [];
// 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[0], полевые players[1..10]
// players.slice(1, 11).forEach((player, index) => {
// players.slice(1, 11).forEach((player, index) => {
// const layer = index + 1;
// const p layerNumber = index + 1;
// const playerInputName = `${playerPrefix} - Игрок${playerNumber}`;
// const x = convertPitchXToPan(player.x).toFixed(3);
// const x = convertPitchXToPan(player.x).toFixed(3);
// const y = convertPitchYToPan(player.y).toFixed(3);
// const y = convertPitchYToPan(player.y).toFixed(3);
// for (let i = 1; i <= 10; i++) {
// commands.push(
// commands.push(
// vmixCmd(`Function=SetLayer${layer}PanX &Input=${encodeURIComponent(inputName)}&Value=${x }`)
// vmixCmd(`Function=ResetInput &Input=${encodeURIComponent(`${playerPrefix} - Игрок${i}`) }`)
// );
// );
// };
// commands.push(
// 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(
// commands.push(
// vmixCmd(`Function=SetLayer${layer} PanY&Input=${encodeURIComponent(i nputName)}&Value=${y}`)
// vmixCmd(`Function=SetPanY&Input=${encodeURIComponent(playerI nputName)}&Value=${y}`)
// );
// commands.push(
// vmixCmd(`Function=SetLayer${layer}PanY&Input=${encodeURIComponent(inputName)}&Value=${y}`)
// );
// );
// });
// });
// commands.push(
// vmixCmd(`Function=PreviewInput&Input=${encodeURIComponent(inputName)}`)
// );
// return commands;
// return commands;
// }
// }
@@ -2340,12 +2310,20 @@ function buildVmixCommandsFromFormation(side) {
const playerPrefix = side === "home" ? "HOME" : "AWAY" ;
const playerPrefix = side === "home" ? "HOME" : "AWAY" ;
const inputName = side === "home" ? "Р А С С Т А Н О В К А - ХОЗЯЕВА" : "Р А С С Т А Н О В К А - ГОСТИ" ;
const inputName = side === "home" ? "Р А С С Т А Н О В К А - ХОЗЯЕВА" : "Р А С С Т А Н О В К А - ГОСТИ" ;
if ( players . length < 2 ) {
if ( players . length < 2 ) {
return [ ] ;
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 ) => {
players . slice ( 1 , 11 ) . forEach ( ( player , index ) => {
const playerNumber = index + 1 ;
const playerNumber = index + 1 ;
const playerInputName = ` ${ playerPrefix } - Игрок ${ playerNumber } ` ;
const playerInputName = ` ${ playerPrefix } - Игрок ${ playerNumber } ` ;
@@ -2353,19 +2331,6 @@ function buildVmixCommandsFromFormation(side) {
const x = convertPitchXToPan ( player . x ) . toFixed ( 3 ) ;
const x = convertPitchXToPan ( player . x ) . toFixed ( 3 ) ;
const y = convertPitchYToPan ( player . y ) . 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 (
commands . push (
vmixCmd ( ` Function=SetPanX&Input= ${ encodeURIComponent ( playerInputName ) } &Value= ${ x } ` )
vmixCmd ( ` Function=SetPanX&Input= ${ encodeURIComponent ( playerInputName ) } &Value= ${ x } ` )
) ;
) ;