mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 08:01:46 -03:00
Display launcher version in UI
Adds a version display element to the bottom right of the UI, fetching the version from package.json via a new IPC handler. Updates main.js, preload.js, and ui.js to support retrieving and displaying the version, and adds relevant styles in style.css.
This commit is contained in:
16
GUI/js/ui.js
16
GUI/js/ui.js
@@ -500,10 +500,26 @@ function setupUI() {
|
||||
setupSidebarLogo();
|
||||
setupAnimations();
|
||||
setupFirstLaunchHandlers();
|
||||
loadLauncherVersion();
|
||||
|
||||
document.body.focus();
|
||||
}
|
||||
|
||||
// Load launcher version from package.json
|
||||
async function loadLauncherVersion() {
|
||||
try {
|
||||
if (window.electronAPI && window.electronAPI.getVersion) {
|
||||
const version = await window.electronAPI.getVersion();
|
||||
const versionElement = document.getElementById('launcherVersion');
|
||||
if (versionElement) {
|
||||
versionElement.textContent = `v${version}`;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load launcher version:', error);
|
||||
}
|
||||
}
|
||||
|
||||
window.LauncherUI = {
|
||||
showPage,
|
||||
setActiveNav,
|
||||
|
||||
Reference in New Issue
Block a user