Rename sprite part constants

This commit is contained in:
Idrees Hassan
2025-10-26 13:52:54 -04:00
parent b1a4dfac7c
commit a9f386b6bd
7 changed files with 376 additions and 376 deletions

View File

@@ -3,7 +3,7 @@ import {
} from './sharedConstants.js';
import {
Sprite,
SPRITE,
SPRITE_SHEET_COLOR_MAP,
SPECIES,
BirdType
@@ -184,7 +184,7 @@ function loadSpriteSheetPixels(dataUri, templateColors = true) {
const b = pixels[index + 2];
const a = pixels[index + 3];
if (a === 0) {
row.push(Sprite.TRANSPARENT);
row.push(SPRITE.TRANSPARENT);
continue;
}
const hex = `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
@@ -194,7 +194,7 @@ function loadSpriteSheetPixels(dataUri, templateColors = true) {
}
if (SPRITE_SHEET_COLOR_MAP[hex] === undefined) {
error(`Unknown color: ${hex}`);
row.push(Sprite.TRANSPARENT);
row.push(SPRITE.TRANSPARENT);
}
row.push(SPRITE_SHEET_COLOR_MAP[hex]);
}
@@ -1129,7 +1129,7 @@ Promise.all([
function switchSpecies(type) {
currentSpecies = type;
// Update CSS variable --birb-highlight to be wing color
document.documentElement.style.setProperty("--birb-highlight", SPECIES[type].colors[Sprite.THEME_HIGHLIGHT]);
document.documentElement.style.setProperty("--birb-highlight", SPECIES[type].colors[SPRITE.THEME_HIGHLIGHT]);
save();
}