mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-15 19:45:57 +00:00
Add support for colored patterns (#2062)
## Description: Add support for colored territory patterns/skins * Refactored & updated territory pattern rendering to render colored skins * rename public from pattern to skin (keep pattern name internally, too difficult to rename) * Moved all territory color logic to PlayerView * Updated WinModal to show colored skins * Refactored decode logic into a separate function: decodePatternData * Refactored/updated how cosmetics are sent to server. Players now send a PlayerCosmeticRefsSchema in the ClientJoinMessage. PlayerCosmeticRefsSchema just contains names of the cosmetics, and the server replaces the names/references with actual cosmetic data * Refactored PastelThemeDark: have it extend Pastel theme so duplicate logic can be removed. * ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -171,10 +171,9 @@ export const getColoredSprite = (
|
||||
customTerritoryColor?: Colord,
|
||||
customBorderColor?: Colord,
|
||||
): HTMLCanvasElement => {
|
||||
const owner = unit.owner();
|
||||
const territoryColor: Colord =
|
||||
customTerritoryColor ?? theme.territoryColor(owner);
|
||||
const borderColor: Colord = customBorderColor ?? theme.borderColor(owner);
|
||||
customTerritoryColor ?? unit.owner().territoryColor();
|
||||
const borderColor: Colord = customBorderColor ?? unit.owner().borderColor();
|
||||
const spawnHighlightColor = theme.spawnHighlightColor();
|
||||
const key = computeSpriteKey(unit, territoryColor, borderColor);
|
||||
if (coloredSpriteCache.has(key)) {
|
||||
|
||||
Reference in New Issue
Block a user