добавил отправку в vMix дополнительного времени
This commit is contained in:
@@ -353,6 +353,17 @@ function startTimer() {
|
|||||||
saveMatchState();
|
saveMatchState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function triggerVmixExtraTimeAction(minutes, half) {
|
||||||
|
const title = "ДОБАВЛЕННОЕ ВРЕМЯ ДЛЯ ВЕРХНЕГО СЧЕТА"
|
||||||
|
|
||||||
|
const commands = [
|
||||||
|
vmixCmd(`Function=SetText&Input=${encodeURIComponent(title)}&SelectedName=Добавленное.Text&Value=+${minutes}`),
|
||||||
|
vmixCmd(`Function=PreviewInput&Input=${encodeURIComponent(title)}`)
|
||||||
|
];
|
||||||
|
|
||||||
|
await sendDirectVmixCommands(commands);
|
||||||
|
}
|
||||||
|
|
||||||
function applyExtraTime() {
|
function applyExtraTime() {
|
||||||
const input = document.getElementById("extraTimeMinutes");
|
const input = document.getElementById("extraTimeMinutes");
|
||||||
const value = Math.max(0, Number(input ? input.value : 0));
|
const value = Math.max(0, Number(input ? input.value : 0));
|
||||||
@@ -371,6 +382,7 @@ function applyExtraTime() {
|
|||||||
`Добавлено ${value} мин. к 1-му тайму`,
|
`Добавлено ${value} мин. к 1-му тайму`,
|
||||||
matchClockSeconds
|
matchClockSeconds
|
||||||
);
|
);
|
||||||
|
triggerVmixExtraTimeAction(value, "first");
|
||||||
} else if (currentPeriod === "2H" || currentPeriod === "FT") {
|
} else if (currentPeriod === "2H" || currentPeriod === "FT") {
|
||||||
extraTimeMinutes.second = value;
|
extraTimeMinutes.second = value;
|
||||||
updatePeriodBadge(`2-й тайм +${value}`);
|
updatePeriodBadge(`2-й тайм +${value}`);
|
||||||
@@ -380,6 +392,7 @@ function applyExtraTime() {
|
|||||||
`Добавлено ${value} мин. ко 2-му тайму`,
|
`Добавлено ${value} мин. ко 2-му тайму`,
|
||||||
matchClockSeconds
|
matchClockSeconds
|
||||||
);
|
);
|
||||||
|
triggerVmixExtraTimeAction(value, "second");
|
||||||
}
|
}
|
||||||
|
|
||||||
saveMatchState();
|
saveMatchState();
|
||||||
|
|||||||
Reference in New Issue
Block a user