removed overlay installation

This commit is contained in:
AMIAY
2026-01-24 13:32:36 +01:00
parent 679799c074
commit ca8ed171d1
4 changed files with 34 additions and 119 deletions

View File

@@ -40,18 +40,6 @@ export function setupInstallation() {
});
}
// Setup installation effects listeners
if (window.electronAPI && window.electronAPI.onInstallationStart) {
window.electronAPI.onInstallationStart(() => {
showInstallationEffects();
});
}
if (window.electronAPI && window.electronAPI.onInstallationEnd) {
window.electronAPI.onInstallationEnd(() => {
hideInstallationEffects();
});
}
}
export async function installGame() {
@@ -67,6 +55,7 @@ export async function installGame() {
if (window.LauncherUI) window.LauncherUI.showProgress();
isDownloading = true;
lockInstallForm();
if (installBtn) {
installBtn.disabled = true;
installText.textContent = window.i18n ? window.i18n.t('install.installing') : 'INSTALLING...';
@@ -97,12 +86,7 @@ export async function installGame() {
} catch (error) {
const errorMsg = window.i18n ? window.i18n.t('progress.installationFailed').replace('{error}', error.message) : `Installation failed: ${error.message}`;
// Hide installation effects on error
if (window.hideInstallationEffects) {
window.hideInstallationEffects();
}
// Reset button state on error
// Reset button state and unlock form on error
resetInstallButton();
if (window.LauncherUI) {
@@ -157,6 +141,35 @@ function resetInstallButton() {
installBtn.disabled = false;
installText.textContent = 'INSTALL HYTALE';
}
unlockInstallForm();
}
function lockInstallForm() {
const playerNameInput = document.getElementById('installPlayerName');
const installPathInput = document.getElementById('installPath');
const customCheckbox = document.getElementById('installCustomCheck');
const branchRadios = document.querySelectorAll('input[name="installBranch"]');
const browseBtn = document.querySelector('.browse-btn');
if (playerNameInput) playerNameInput.disabled = true;
if (installPathInput) installPathInput.disabled = true;
if (customCheckbox) customCheckbox.disabled = true;
if (browseBtn) browseBtn.disabled = true;
branchRadios.forEach(radio => radio.disabled = true);
}
function unlockInstallForm() {
const playerNameInput = document.getElementById('installPlayerName');
const installPathInput = document.getElementById('installPath');
const customCheckbox = document.getElementById('installCustomCheck');
const branchRadios = document.querySelectorAll('input[name="installBranch"]');
const browseBtn = document.querySelector('.browse-btn');
if (playerNameInput) playerNameInput.disabled = false;
if (installPathInput) installPathInput.disabled = false;
if (customCheckbox) customCheckbox.disabled = false;
if (browseBtn) browseBtn.disabled = false;
branchRadios.forEach(radio => radio.disabled = false);
}
export async function browseInstallPath() {

View File

@@ -581,8 +581,7 @@ window.LauncherUI = {
};
// Make installation effects globally available
window.showInstallationEffects = showInstallationEffects;
window.hideInstallationEffects = hideInstallationEffects;
// Draggable progress bar functionality
function setupProgressDrag() {
@@ -642,21 +641,6 @@ function setupProgressDrag() {
}
}
// Show/hide installation effects
function showInstallationEffects() {
const installationEffects = document.getElementById('installationEffects');
if (installationEffects) {
installationEffects.style.display = 'block';
}
}
function hideInstallationEffects() {
const installationEffects = document.getElementById('installationEffects');
if (installationEffects) {
installationEffects.style.display = 'none';
}
}
// Toggle maximize/restore window function
function toggleMaximize() {
if (window.electronAPI && window.electronAPI.maximizeWindow) {