Upload via GUI (324 Dateien)
This commit is contained in:
+53
-1
@@ -4100,12 +4100,15 @@ async function pollForMinecraftWindow() {
|
||||
} else if (sources.length > 1) {
|
||||
clearInterval(mcSearchTimer);
|
||||
showRecordingPicker(sources);
|
||||
// per Stream Deck gestartet: das Fenster ist unsichtbar, die Auswahl braucht aber dich
|
||||
if (sdAusstehend) { window.api.streamdeckFensterZeigen(); sdMeldung('Aufnahme', 'Bitte Spielfenster wählen'); }
|
||||
} else {
|
||||
mcSearchElapsed += 1000;
|
||||
if (mcSearchElapsed >= 30000) {
|
||||
clearInterval(mcSearchTimer);
|
||||
el('record-search-text').textContent = 'Kein Spielfenster gefunden. Läuft Minecraft und ist es nicht minimiert?';
|
||||
el('record-search-retry').classList.remove('hidden');
|
||||
if (sdAusstehend) { sdAusstehend = null; sdMeldung('Aufnahme', 'Kein Spielfenster gefunden', true); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4137,11 +4140,47 @@ async function selectRecordingSource(source) {
|
||||
await Promise.all([populateMicList(), checkGameAudioAvailability()]);
|
||||
updateAudioSummary();
|
||||
updateVideoSummary();
|
||||
if (sdAusstehend) { const art = sdAusstehend; sdAusstehend = null; fuehreSdAktionAus(art); }
|
||||
} catch (err) {
|
||||
hide('record-stage');
|
||||
show('record-search');
|
||||
el('record-search-text').textContent = 'Vorschau fehlgeschlagen: ' + err.message;
|
||||
el('record-search-retry').classList.remove('hidden');
|
||||
if (sdAusstehend) { sdAusstehend = null; sdMeldung('Aufnahme', 'Spielfenster nicht erfasst', true); }
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Stream-Deck-Aktionen ----------
|
||||
// Nach erfolgreichem Start verschwindet das Fenster wieder (Clip-Modus und Aufnahme laufen im Hintergrund weiter);
|
||||
// bei einem Fehler bleibt es offen, damit man die Meldung sieht
|
||||
let sdAusstehend = null; // 'aufnahme' | 'clipmodus': nach der Fenstersuche noch auszuführen
|
||||
|
||||
function sdMeldung(titel, text, fehler) {
|
||||
window.api.streamdeckMeldung(titel, text, fehler);
|
||||
// Fehler zeigt der Hauptprozess im Hauptfenster - das Aufnahme-Fenster selbst hätte ohne offenes Modal nur eine leere Fläche
|
||||
|
||||
}
|
||||
|
||||
function sdFensterWegNachErfolg() { setTimeout(() => window.api.popoutHide(), 2000); }
|
||||
|
||||
async function fuehreSdAktionAus(art) {
|
||||
try {
|
||||
if (art === 'clipmodus') {
|
||||
if (clipAktiv) { stoppeClipModus(); sdMeldung('Clip-Modus', 'Aus'); }
|
||||
else if (recordingActive()) sdMeldung('Clip-Modus', 'Aufnahme läuft', true);
|
||||
else { await starteClipModus(); if (clipAktiv) { sdMeldung('Clip-Modus', 'An'); sdFensterWegNachErfolg(); } }
|
||||
} else if (recordingActive()) {
|
||||
sdMeldung('Aufnahme', 'Wird gespeichert …');
|
||||
await stopMcRecording();
|
||||
} else {
|
||||
// Aufnahme und Clip-Modus teilen sich Bildquelle und Ton -> läuft der Clip-Modus, wird er für die Aufnahme beendet
|
||||
const clipWarAn = clipAktiv;
|
||||
if (clipAktiv) stoppeClipModus();
|
||||
await startMcRecording();
|
||||
if (recordingActive()) { sdMeldung('Aufnahme', clipWarAn ? 'Läuft (Clip-Modus aus)' : 'Läuft'); sdFensterWegNachErfolg(); }
|
||||
}
|
||||
} catch (err) {
|
||||
sdMeldung(art === 'clipmodus' ? 'Clip-Modus' : 'Aufnahme', 'Fehler: ' + err.message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4553,7 +4592,7 @@ async function startMcRecording() {
|
||||
mcRecorder.onstop = onMcRecordingStopped;
|
||||
mcRecorder.start(1000);
|
||||
|
||||
window.api.recordingSetGuard(true);
|
||||
window.api.recordingSetGuard(true, currentDetailId);
|
||||
mcStartedAt = Date.now();
|
||||
el('record-live-badge').classList.remove('hidden');
|
||||
el('record-toggle').textContent = 'Aufnahme stoppen';
|
||||
@@ -6136,6 +6175,7 @@ async function openSettings(pane) {
|
||||
el('s-bedrock').checked = s.bedrockEnabled !== false;
|
||||
el('s-beta').checked = s.betaTeilnahme === true;
|
||||
el('s-notify').checked = s.desktopNotifications !== false;
|
||||
el('s-streamdeck').checked = s.streamdeckEnabled === true;
|
||||
el('s-friends').checked = s.friendsEnabled !== false;
|
||||
el('s-friends-server').checked = s.friendsShareServer !== false;
|
||||
el('s-auto-mod-updates').checked = !!s.autoModUpdates;
|
||||
@@ -6275,6 +6315,7 @@ async function saveSettings() {
|
||||
bedrockEnabled: el('s-bedrock').checked,
|
||||
betaTeilnahme: el('s-beta').checked,
|
||||
desktopNotifications: el('s-notify').checked,
|
||||
streamdeckEnabled: el('s-streamdeck').checked,
|
||||
friendsEnabled: el('s-friends').checked,
|
||||
friendsShareServer: el('s-friends-server').checked,
|
||||
autoModUpdates: el('s-auto-mod-updates').checked,
|
||||
@@ -7494,6 +7535,9 @@ function wire() {
|
||||
});
|
||||
}
|
||||
|
||||
// Stream-Deck-Plugin von Hand (neu) installieren; die Rückmeldung kommt als Hinweis aus dem Hauptprozess
|
||||
if (el('s-streamdeck-plugin')) el('s-streamdeck-plugin').addEventListener('click', () => { window.api.streamdeckInstalliere(); });
|
||||
|
||||
// Microsoft-Login / Kontoverwaltung
|
||||
el('btn-account').addEventListener('click', (e) => { e.stopPropagation(); oeffneKontoMenue(); });
|
||||
el('login-add').addEventListener('click', addAccount);
|
||||
@@ -7693,6 +7737,7 @@ const POPOUT_OPENERS = {
|
||||
function popoutBoot(params) {
|
||||
const p = params || {};
|
||||
if (p.instanceId) currentDetailId = p.instanceId;
|
||||
if (POPOUT === 'record' && (p.sd === 'aufnahme' || p.sd === 'clipmodus')) sdAusstehend = p.sd;
|
||||
const opener = POPOUT_OPENERS[POPOUT];
|
||||
if (opener) opener(p);
|
||||
}
|
||||
@@ -7718,6 +7763,13 @@ window.addEventListener('DOMContentLoaded', async () => {
|
||||
if (POPOUT === 'record') window.api.onRecordCloseAttempt(() => confirmStopAndCloseRecording());
|
||||
if (POPOUT === 'record') {
|
||||
window.api.onClipHotkey(() => speichereClip());
|
||||
// Stream-Deck-Tasten "Aufnahme" und "Clip-Modus": ist das Spielfenster schon erfasst, gleich
|
||||
// ausführen, sonst erst die Suche starten (siehe sdAusstehend in selectRecordingSource)
|
||||
window.api.onStreamdeckAktion((d) => {
|
||||
if (d && d.instanceId && !clipAktiv && !recordingActive()) currentDetailId = d.instanceId;
|
||||
if (mcVideoStream || clipAktiv) fuehreSdAktionAus(d.art);
|
||||
else { sdAusstehend = d.art; openRecording(); }
|
||||
});
|
||||
// Spiel beendet -> Clip-Modus ist ohne Bildquelle sinnlos
|
||||
window.api.onLaunchProgress((evt) => {
|
||||
if (evt.phase === 'exit' && evt.id === currentDetailId && clipAktiv) {
|
||||
|
||||
Reference in New Issue
Block a user