Handle new people sprites

* change the palette in the Paint editor to have more skin tones (6)
* Add new assets to the localizations for later translation
* Add handling for a new section of the Media json for legacy sprites.

Existing projects may use current library sprites, so they need to be in the app media keys even if they are no longer displayed in the library by default.
This commit is contained in:
Chris Garrity 2021-08-12 16:08:17 -04:00
parent ce9200b2f1
commit 1ec553e197
3 changed files with 36 additions and 4 deletions

View file

@ -213,6 +213,23 @@
"CHARACTER_Whale.svg": "Whale", "CHARACTER_Whale.svg": "Whale",
"CHARACTER_Penguin.svg": "Penguin", "CHARACTER_Penguin.svg": "Penguin",
"CHARACTER_PolarBear.svg": "Polar Bear", "CHARACTER_PolarBear.svg": "Polar Bear",
"CHARACTER_Girl1V2.svg": "Child",
"CHARACTER_Girl2V2.svg": "Child",
"CHARACTER_Girl3V2.svg": "Child",
"CHARACTER_Boy1V2.svg": "Child",
"CHARACTER_Boy2V2.svg": "Child",
"CHARACTER_Boy3V2.svg": "Child",
"CHARACTER_TeenGirl1V2.svg": "Person",
"CHARACTER_TeenGirl2V2.svg": "Person",
"CHARACTER_TeenGirl3V2.svg": "Person",
"CHARACTER_TeenBoy1V2.svg": "Person",
"CHARACTER_TeenBoy2V2.svg": "Person",
"CHARACTER_TeenBoy3V2.svg": "Person",
"CHARACTER_BabyV2.svg": "Baby",
"CHARACTER_MotherV2.svg": "Person",
"CHARACTER_FatherV2.svg": "Person",
"CHARACTER_GrandmotherV2.svg": "Person",
"CHARACTER_GrandfatherV2.svg": "Person",
"CHARACTER_Girl1.svg": "Child", "CHARACTER_Girl1.svg": "Child",
"CHARACTER_Girl2.svg": "Child", "CHARACTER_Girl2.svg": "Child",
"CHARACTER_Girl3.svg": "Child", "CHARACTER_Girl3.svg": "Child",

View file

@ -988,15 +988,15 @@ export default class Paint {
'#2BBF8A', // new green '#2BBF8A', // new green
'#027607', '#114D24', //greens '#027607', '#114D24', //greens
'#FFFFFF', '#CCDDE7', '#61787C', '#1C1C1C', // grays '#FFFFFF', '#CCDDE7', '#61787C', '#1C1C1C', // grays
'#D830A3', // sarah's pink shoes border // '#D830A3', // sarah's pink shoes border
'#FF64E9', // purple pinks '#FF64E9', // purple pinks
'#D999FF', ' #A159D3', // vilote '#D999FF', ' #A159D3', // vilote
'#722696', // sarah's violet '#722696', // sarah's violet
'#141463', '#003399', '#1D40ED', '#141463', '#003399', '#1D40ED',
'#0079D3', '#009EFF', '#76C8FF', '#0079D3', '#009EFF', '#76C8FF',
'#ACE0FD', '#11B7BC', '#21F9F3', '#C3FCFC', '#54311E', '#ACE0FD', '#11B7BC', '#21F9F3', '#C3FCFC',
'#8E572A', '#E4B69D', '#FFCDA4', '#FFEDD7' // skin colors // '#54311E', '#8E572A', '#E4B69D', '#FFCDA4', '#FFEDD7' // skin colors
'#FDDBB4', '#E4B681', '#BF8C5C', '#955D31', '#6B3D1F', '#482D18' // new skin colors
]; ];
} }

View file

@ -5,6 +5,7 @@ let path;
let samples; let samples;
let backgrounds; let backgrounds;
let sprites; let sprites;
let legacySprites;
let sounds; let sounds;
let keys = {}; let keys = {};
@ -39,6 +40,7 @@ export default class MediaLib {
path = parsedResult.path; path = parsedResult.path;
samples = parsedResult.samples; samples = parsedResult.samples;
sprites = parsedResult.sprites; sprites = parsedResult.sprites;
legacySprites = parsedResult.legacySprites;
backgrounds = parsedResult.backgrounds; backgrounds = parsedResult.backgrounds;
sounds = parsedResult.sounds; sounds = parsedResult.sounds;
@ -59,6 +61,11 @@ export default class MediaLib {
for (let i = 0; i < backgrounds.length; i++) { for (let i = 0; i < backgrounds.length; i++) {
backgrounds[i].name = Localization.localize('BACKGROUND_' + backgrounds[i].md5); backgrounds[i].name = Localization.localize('BACKGROUND_' + backgrounds[i].md5);
} }
// Localize names of legacy sprites
for (let i = 0; i < legacySprites.length; i++) {
legacySprites[i].name = Localization.localize('CHARACTER_' + legacySprites[i].md5);
}
} }
static generateKeys () { static generateKeys () {
@ -71,5 +78,13 @@ export default class MediaLib {
var spr = sprites[i]; var spr = sprites[i];
keys[spr.md5] = {width: spr.width, height: spr.height, name: spr.name}; keys[spr.md5] = {width: spr.width, height: spr.height, name: spr.name};
} }
// when we change sprites (or remove them) the old ones still need to be in keys
// for projects that were created before the change
console.log('add legacy sprites to the keys');
for (let i = 0; i < legacySprites.length; i++) {
var legacySpr = legacySprites[i];
keys[legacySpr.md5] = {width: legacySpr.width, height: legacySpr.height, name: legacySpr.name};
}
} }
} }