mirror of
https://git.sanhost.net/sanasol/hytale-f2p.git
synced 2026-02-26 06:41:47 -03:00
Add files via upload
This commit is contained in:
29
GUI/js/ui.js
29
GUI/js/ui.js
@@ -196,8 +196,26 @@ function setupFirstLaunchHandlers() {
|
||||
updateProgress(data);
|
||||
});
|
||||
|
||||
let lockButtonTimeout = null;
|
||||
|
||||
window.electronAPI.onLockPlayButton((locked) => {
|
||||
lockPlayButton(locked);
|
||||
|
||||
if (locked) {
|
||||
if (lockButtonTimeout) {
|
||||
clearTimeout(lockButtonTimeout);
|
||||
}
|
||||
lockButtonTimeout = setTimeout(() => {
|
||||
console.warn('Play button has been locked for too long, forcing unlock');
|
||||
lockPlayButton(false);
|
||||
lockButtonTimeout = null;
|
||||
}, 20000);
|
||||
} else {
|
||||
if (lockButtonTimeout) {
|
||||
clearTimeout(lockButtonTimeout);
|
||||
lockButtonTimeout = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -448,6 +466,17 @@ function setupUI() {
|
||||
|
||||
lockPlayButton(true);
|
||||
|
||||
setTimeout(() => {
|
||||
const playButton = document.getElementById('homePlayBtn');
|
||||
if (playButton && playButton.getAttribute('data-locked') === 'true') {
|
||||
const spanElement = playButton.querySelector('span');
|
||||
if (spanElement && spanElement.textContent === 'CHECKING...') {
|
||||
console.warn('Play button still locked after startup timeout, forcing unlock');
|
||||
lockPlayButton(false);
|
||||
}
|
||||
}
|
||||
}, 25000);
|
||||
|
||||
handleNavigation();
|
||||
setupWindowControls();
|
||||
setupSidebarLogo();
|
||||
|
||||
Reference in New Issue
Block a user