Skip to content
Snippets Groups Projects
Commit 6b764307 authored by svornost's avatar svornost
Browse files

Add some basic information to the end-week loading animation.

parent b221bff8
No related branches found
No related tags found
1 merge request!6670Add some basic information to the end-week loading animation.
#init-screen > div.endweek-titleblock {
display: block;
margin-top: 5%;
}
div.endweek-maintitle {
display: block;
margin-bottom: 0.5em;
}
div.endweek-subtitle {
display: block;
font-size: smaller;
font-weight: lighter;
}
......@@ -331,7 +331,7 @@ window.endWeek = (function() {
function confirmEndWeek() {
if (!V.sideBarOptions.confirmWeekEnd || confirm("Are you sure you want to end the week?")) {
window.LoadLockID = LoadScreen.lock();
App.UI.EndWeekAnim.start();
setTimeout(doEndWeek, 0); // execute immediately, but after the event loop runs, so the loading screen gets shown
}
}
......
App.UI.EndWeekAnim = (function() {
let loadLockID = -1;
let infoDiv = null;
function makeInfoDiv() {
infoDiv = $(`
<div class="endweek-titleblock">
<div class="endweek-maintitle">Processing week ${V.week}...</div>
<div class="endweek-subtitle">${V.arcologies[0].name} | ${V.slaves.length} slaves</div>
</div>
`);
}
function start() {
if (loadLockID === -1) {
makeInfoDiv();
$("#init-screen").append(infoDiv);
loadLockID = LoadScreen.lock();
}
}
function end() {
debugger;
if (loadLockID !== -1) {
infoDiv.remove();
infoDiv = null;
setTimeout(LoadScreen.unlock(loadLockID), 0);
loadLockID = -1;
}
}
return {
start,
end
};
})();
......@@ -1125,4 +1125,4 @@ $sexDemandResult.topClass = Math.trunc((($NPCSexSupply.topClass + $slaveJobValue
<</if>>
/* release loading screen as soon as the event loop can run */
<<run setTimeout(LoadScreen.unlock, 0, window.LoadLockID)>>
<<run App.UI.EndWeekAnim.end()>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment