offline version fix

This commit is contained in:
ParadoxGitHub 2023-03-13 21:20:47 -04:00
parent bab1b81a9d
commit 94a1b9022a
5 changed files with 3374 additions and 3359 deletions

View File

@ -72,6 +72,13 @@ Compile it yourself here: https://gitlab.com/lax1dude/eaglercraftx-1.8/
margin-left: -1.3vw; margin-left: -1.3vw;
} }
#ratio {
position: relative;
top: 13vh;
font-size: 2vh;
font-family: sans-serif;
}
#meter { #meter {
width: 80vw; width: 80vw;
margin:auto; margin:auto;
@ -93,8 +100,8 @@ Compile it yourself here: https://gitlab.com/lax1dude/eaglercraftx-1.8/
} }
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
function updateTextProgress(progress, total){ function updateTextProgress(event, epkSize){
document.getElementById("progresstext").innerText = Math.round(progress/total*100) + "%" + "(" + progress + "MB" + "/" + total + "MB )"; document.getElementById("progresstext").innerText = Math.round(event.loaded/epkSize*10000)/100 + "%" + "(" + Math.round(event.loaded/1024/1024) + "MB" + "/" + Math.round(epkSize/1024/1024) + "MB )";
} }
function setVersion(version){ function setVersion(version){
@ -105,7 +112,7 @@ Compile it yourself here: https://gitlab.com/lax1dude/eaglercraftx-1.8/
let progress = Math.round(event.loaded/1024/1024); let progress = Math.round(event.loaded/1024/1024);
let size = Math.round(epkSize/1024/1024); let size = Math.round(epkSize/1024/1024);
document.getElementById("progress").style.width = (Math.round(progress/size*100)+4)+"%"; document.getElementById("progress").style.width = (Math.round(progress/size*100)+4)+"%";
updateTextProgress(progress, size); updateTextProgress(event, epkSize);
} }
function die(){ function die(){
@ -140,6 +147,13 @@ window.addEventListener("load", () => {
<div id = "dividk"> <div id = "dividk">
<h1 id="clienttitle">Resent Client</h1> <h1 id="clienttitle">Resent Client</h1>
<h2 id="clientversion">3.6</h2> <h2 id="clientversion">3.6</h2>
<p id="progresstext">0%</p>
<p id="ratio">use <a href="./badwifi/index.html">this link</a> if your internet is bad</p>
<div id="meter">
<span style="width: 0%" id="progress"></span>
</div>
</div>
</body> </body>
</html> </html>

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -78,6 +78,7 @@ public class PlatformRuntime {
static WebGLFramebuffer mainFramebuffer = null; static WebGLFramebuffer mainFramebuffer = null;
public static void create() { public static void create() {
setClientVersion(ClientInfo.version);
win = Window.current(); win = Window.current();
doc = win.getDocument(); doc = win.getDocument();
@ -304,7 +305,7 @@ public class PlatformRuntime {
int epkSize = Integer.parseInt(request.getResponseHeader("content-length")); int epkSize = Integer.parseInt(request.getResponseHeader("content-length"));
Event event = evt; Event event = evt;
setClientVersion(ClientInfo.version);
setBarProgress(event, epkSize); setBarProgress(event, epkSize);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();