pre-release & release game version [to check]

This commit is contained in:
AMIAY
2026-01-23 17:54:57 +01:00
parent 08c2218cf8
commit 3983fdb1bc
19 changed files with 888 additions and 302 deletions

View File

@@ -501,6 +501,7 @@ function setupUI() {
setupAnimations();
setupFirstLaunchHandlers();
loadLauncherVersion();
checkGameInstallation();
document.body.focus();
}
@@ -520,6 +521,50 @@ async function loadLauncherVersion() {
}
}
// Check game installation status on startup
async function checkGameInstallation() {
try {
console.log('Checking game installation status...');
// Check if game is installed
const isInstalled = await window.electronAPI.isGameInstalled();
// Load version_client from config
let versionClient = null;
if (window.electronAPI.loadVersionClient) {
versionClient = await window.electronAPI.loadVersionClient();
}
console.log(`Game installed: ${isInstalled}, version_client: ${versionClient}`);
// If version_client is null and game is not installed, trigger installation
if (versionClient === null && !isInstalled) {
console.log('Game not installed and version_client is null, showing install page...');
// Show installation page
const installPage = document.getElementById('install-page');
const launcher = document.getElementById('launcher-container');
const sidebar = document.querySelector('.sidebar');
if (installPage) {
installPage.style.display = 'block';
if (launcher) launcher.style.display = 'none';
if (sidebar) sidebar.style.pointerEvents = 'none';
// Unlock play button since we're in install mode
lockPlayButton(false);
}
} else {
// Game is installed or version is set, unlock play button
lockPlayButton(false);
}
} catch (error) {
console.error('Error checking game installation:', error);
// Unlock on error to prevent permanent lock
lockPlayButton(false);
}
}
window.LauncherUI = {
showPage,
setActiveNav,