mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 09:24:48 +00:00
go to /play, remember last version
This commit is contained in:
parent
7830ed53e5
commit
8503fd083f
22
public/play/index.html
Normal file
22
public/play/index.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script>
|
||||||
|
const storage = {
|
||||||
|
session: {
|
||||||
|
get: function (key) {
|
||||||
|
const item = sessionStorage.getItem('minexlauncher');
|
||||||
|
if (item !== null) {
|
||||||
|
const json = JSON.parse(item);
|
||||||
|
if (json[key] !== undefined) {
|
||||||
|
return json[key];
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
window.location.href = storage.session.get('lastGame') ?? '/';
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
</html>
|
@ -22,6 +22,6 @@ window.addEventListener('load', function () {
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
window.eaglercraftOpts.joinServer = urlParams.get('server') ?? undefined;
|
window.eaglercraftOpts.joinServer = urlParams.get('server') ?? undefined;
|
||||||
|
|
||||||
history.replaceState({}, '', '/');
|
history.replaceState({}, '', '/play');
|
||||||
main();
|
main();
|
||||||
});
|
});
|
||||||
|
@ -40,6 +40,6 @@ window.addEventListener('load', () => {
|
|||||||
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
||||||
window.eaglercraftXOpts.Mods = storage.local.get('mods') ?? [];
|
window.eaglercraftXOpts.Mods = storage.local.get('mods') ?? [];
|
||||||
|
|
||||||
history.replaceState({}, '', '/');
|
history.replaceState({}, '', '/play');
|
||||||
main();
|
main();
|
||||||
});
|
});
|
||||||
|
@ -21,6 +21,6 @@ window.addEventListener('load', () => {
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
||||||
|
|
||||||
history.replaceState({}, '', '/');
|
history.replaceState({}, '', '/play');
|
||||||
main();
|
main();
|
||||||
});
|
});
|
||||||
|
@ -16,6 +16,6 @@ window.addEventListener('load', () => {
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
window.eaglercraftXOpts.joinServer = urlParams.get('server') ?? undefined;
|
||||||
|
|
||||||
history.replaceState({}, '', '/');
|
history.replaceState({}, '', '/play');
|
||||||
main();
|
main();
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,6 @@ window.addEventListener('load', function () {
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
window.minecraftOpts.push(urlParams.get('server') ?? undefined);
|
window.minecraftOpts.push(urlParams.get('server') ?? undefined);
|
||||||
|
|
||||||
history.replaceState({}, '', '/');
|
history.replaceState({}, '', '/play');
|
||||||
main();
|
main();
|
||||||
});
|
});
|
||||||
|
@ -54,10 +54,12 @@ const game = {
|
|||||||
play: function (version?: string) {
|
play: function (version?: string) {
|
||||||
if (version) {
|
if (version) {
|
||||||
document.body.style.display = 'none';
|
document.body.style.display = 'none';
|
||||||
|
storage.session.set('lastGame', version);
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
window.top.location.href = version;
|
window.top.location.href = version;
|
||||||
} else if (selectedVersion) {
|
} else if (selectedVersion) {
|
||||||
document.body.style.display = 'none';
|
document.body.style.display = 'none';
|
||||||
|
storage.session.set('lastPage', selectedVersion);
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
window.top.location.href = selectedVersion;
|
window.top.location.href = selectedVersion;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user