mirror of
https://gitea.shironeko-all.duckdns.org/shironeko/Hytale-F2P-2.git
synced 2026-02-26 02:31:46 -03:00
fix
This commit is contained in:
22
GUI/js/ui.js
22
GUI/js/ui.js
@@ -501,7 +501,10 @@ function setupUI() {
|
|||||||
setupAnimations();
|
setupAnimations();
|
||||||
setupFirstLaunchHandlers();
|
setupFirstLaunchHandlers();
|
||||||
loadLauncherVersion();
|
loadLauncherVersion();
|
||||||
checkGameInstallation();
|
checkGameInstallation().catch(err => {
|
||||||
|
console.error('Critical error in checkGameInstallation:', err);
|
||||||
|
lockPlayButton(false);
|
||||||
|
});
|
||||||
|
|
||||||
document.body.focus();
|
document.body.focus();
|
||||||
}
|
}
|
||||||
@@ -526,6 +529,13 @@ async function checkGameInstallation() {
|
|||||||
try {
|
try {
|
||||||
console.log('Checking game installation status...');
|
console.log('Checking game installation status...');
|
||||||
|
|
||||||
|
// Verify electronAPI is available
|
||||||
|
if (!window.electronAPI || !window.electronAPI.isGameInstalled) {
|
||||||
|
console.error('electronAPI not available, unlocking play button as fallback');
|
||||||
|
lockPlayButton(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if game is installed
|
// Check if game is installed
|
||||||
const isInstalled = await window.electronAPI.isGameInstalled();
|
const isInstalled = await window.electronAPI.isGameInstalled();
|
||||||
|
|
||||||
@@ -537,7 +547,9 @@ async function checkGameInstallation() {
|
|||||||
|
|
||||||
console.log(`Game installed: ${isInstalled}, version_client: ${versionClient}`);
|
console.log(`Game installed: ${isInstalled}, version_client: ${versionClient}`);
|
||||||
|
|
||||||
// If version_client is null and game is not installed, trigger installation
|
lockPlayButton(false);
|
||||||
|
|
||||||
|
// If version_client is null and game is not installed, show install page
|
||||||
if (versionClient === null && !isInstalled) {
|
if (versionClient === null && !isInstalled) {
|
||||||
console.log('Game not installed and version_client is null, showing install page...');
|
console.log('Game not installed and version_client is null, showing install page...');
|
||||||
|
|
||||||
@@ -550,13 +562,7 @@ async function checkGameInstallation() {
|
|||||||
installPage.style.display = 'block';
|
installPage.style.display = 'block';
|
||||||
if (launcher) launcher.style.display = 'none';
|
if (launcher) launcher.style.display = 'none';
|
||||||
if (sidebar) sidebar.style.pointerEvents = '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) {
|
} catch (error) {
|
||||||
console.error('Error checking game installation:', error);
|
console.error('Error checking game installation:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user