Change colours based on final roll result

Changed text colour to grey while bouncing, changing to white on final bounce except for critical rolls. Critical hit is red text on black, critical miss is black text on red.
pull/598/head
Fscked-In-The-Head 2020-11-17 20:38:58 -08:00 committed by GitHub
parent 5fc5b83102
commit d74c9d86ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -14,12 +14,18 @@ function getDie() {
}
function setColors(lastBounce) {
if (lastBounce) {
bgColor = 0xFFFF;
if (lastBounce && face == getDie()) {
bgColor = 0x0000; // Critical Hit
fgColor = 0xF800;
} else if (lastBounce && face == 1){
bgColor = 0xF800; // Critical Miss
fgColor = 0x0000;
} else {
bgColor = 0x0000
} else if (lastBounce){
bgColor = 0x0000; // Other Result
fgColor = 0xFFFF;
} else {
bgColor = 0x0000; // Still Rolling
fgColor = 0x7BEF;
}
}