Merge pull request #1 from Fscked-In-The-Head/criticalrollcolour

Changed rpgdice text/background colour based on roll results
master
Fscked-In-The-Head 2020-11-17 20:42:38 -08:00 committed by GitHub
commit a6fec55315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -1 +1,2 @@
0.01: First release
0.02: Colour changes dependent on roll result

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;
}
}