textlog overlap

This commit is contained in:
landgreen
2019-11-07 06:05:42 -08:00
parent c835488f63
commit 1a5366fa9c
5 changed files with 24 additions and 7 deletions

View File

@@ -172,14 +172,18 @@ const game = {
}
document.getElementById("mods").innerHTML = text
},
replaceTextLog: true,
makeTextLog(text, time = 180) {
document.getElementById("text-log").innerHTML = text;
document.getElementById("text-log").style.opacity = 1;
game.lastLogTime = mech.cycle + time;
if (game.replaceTextLog) {
document.getElementById("text-log").innerHTML = text;
document.getElementById("text-log").style.opacity = 1;
game.lastLogTime = mech.cycle + time;
}
},
textLog() {
if (game.lastLogTime && game.lastLogTime < mech.cycle) {
game.lastLogTime = 0;
game.replaceTextLog = true
// document.getElementById("text-log").innerHTML = " ";
document.getElementById("text-log").style.opacity = 0;
}
@@ -269,6 +273,7 @@ const game = {
requestAnimationFrame(cycle);
} else {
game.paused = true;
game.replaceTextLog = true;
game.makeTextLog("<h1>PAUSED</h1>", 1);
// let text = "<h1>PAUSED</h1><br><div style='font-size: 85%;'>"
// //output current mod, field, and gun info when paused