mobile support part 2

This commit is contained in:
kone 2023-04-19 08:31:03 -04:00
parent 45aefb0e47
commit eced02835b
2 changed files with 297 additions and 0 deletions

View File

@ -109,6 +109,10 @@
let tooLate = false; let tooLate = false;
let patchNumber; let patchNumber;
if (localStorage.getItem("isTabSettingsModEnabled") == null){
localStorage.setItem("isTabSettingsModEnabled", false);
}
if (localStorage.getItem("isTabSettingsModEnabled")){ if (localStorage.getItem("isTabSettingsModEnabled")){
document.title = localStorage.getItem("tabTitle"); document.title = localStorage.getItem("tabTitle");
document.getElementById("favicon").href = localStorage.getItem("imageBase64"); document.getElementById("favicon").href = localStorage.getItem("imageBase64");
@ -315,6 +319,21 @@
} }
}); });
</script> </script>
<script>
function doMobileStuff() {
document.body.style.overflowX = "hidden";
document.body.style.overflowY = "scroll";
document.body.style.width = "85vw";
document.body.style.height = "85vh";
document.getElementById("fakeCursor").style.display = "block";
document.body.addEventListener("click", (e) => {
document.getElementById("fakeCursor").style.top = e.offsetY;
console.log("asdasd");
});
}
</script>
</head> </head>
<body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame"> <body style="margin:0px;width:100vw;height:100vh;overflow:hidden;" id="game_frame">
<div id = "dividk"> <div id = "dividk">
@ -328,7 +347,279 @@
<div id="meter"> <div id="meter">
<span style="width: 0%" id="progress"></span> <span style="width: 0%" id="progress"></span>
</div> </div>
</div> </div>
<img id="fakeCursor" style="position: absolute; z-index: 100; width: 25px; display: none;" src="data:image/png;base64,iV
BORw0KGgoAAAANSUhEUgAAAE
4AAAB6CAYAAAARQWWmAAAAAX
NSR0IArs4c6QAAAARnQU1BAA
Cxjwv8YQUAAAAJcEhZcwAADs
MAAA7DAcdvqGQAABJ7SURBVH
he7Z1/cFTlucdXgkoUhEsvXB
VRykXhoiAKoi0/ChR6Iy2iFo
ugVEsveu1FC9c7U4W2gB30Dx
VQ8QqjjKOx1dFBBwNmFOwgxF
HBiPwYjaj8aBQxFhRIQgJJts
9n+zxw3t2z2bM/wm5IvjPf2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PlatformRuntime {
throw new RuntimeInitializationFailureException("Exception while registering window event handlers", t); throw new RuntimeInitializationFailureException("Exception while registering window event handlers", t);
} }
try { try {
doc.exitPointerLock(); doc.exitPointerLock();
} catch (Throwable t) { } catch (Throwable t) {
doMobileStuff();
isMobile = true; isMobile = true;
//throw new PlatformIncompatibleException("Mouse cursor lock is not available on this device!"); //throw new PlatformIncompatibleException("Mouse cursor lock is not available on this device!");
} }
@ -189,6 +192,9 @@ public class PlatformRuntime {
logger.info("Platform initialization complete"); logger.info("Platform initialization complete");
} }
@JSBody(params = { }, script = "doMobileStuff()")
public static native void doMobileStuff();
@JSBody(params = { "event", "epkSize" }, script = "setBarProg(event, epkSize)") @JSBody(params = { "event", "epkSize" }, script = "setBarProg(event, epkSize)")
public static native void setBarProgress(Event event, int epkSize); public static native void setBarProgress(Event event, int epkSize);