mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:00:44 +00:00
Remove dead color code (#3613)
## Description: Remove dead code relating to colors. ## 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: DISCORD_USERNAME babyboucher
This commit is contained in:
@@ -240,7 +240,6 @@ export async function getPlayerCosmeticsRefs(): Promise<PlayerCosmeticRefs> {
|
||||
|
||||
return {
|
||||
flag: flag ?? undefined,
|
||||
color: userSettings.getSelectedColor() ?? undefined,
|
||||
patternName: pattern?.name ?? undefined,
|
||||
patternColorPaletteName: pattern?.colorPalette?.name ?? undefined,
|
||||
};
|
||||
@@ -256,10 +255,6 @@ export async function getPlayerCosmetics(): Promise<PlayerCosmetics> {
|
||||
result.flag = await resolveFlagUrl(refs.flag);
|
||||
}
|
||||
|
||||
if (refs.color) {
|
||||
result.color = { color: refs.color };
|
||||
}
|
||||
|
||||
if (refs.patternName && cosmetics) {
|
||||
const pattern = cosmetics.patterns[refs.patternName];
|
||||
|
||||
|
||||
@@ -267,7 +267,6 @@ export class StoreModal extends BaseModal {
|
||||
|
||||
private selectPattern(pattern: PlayerPattern | null) {
|
||||
this.selectedColor = null;
|
||||
this.userSettings.setSelectedColor(undefined);
|
||||
if (pattern === null) {
|
||||
this.userSettings.setSelectedPatternName(undefined);
|
||||
} else {
|
||||
|
||||
@@ -215,7 +215,6 @@ export class TerritoryPatternsModal extends BaseModal {
|
||||
|
||||
private selectPattern(pattern: PlayerPattern | null) {
|
||||
this.selectedColor = null;
|
||||
this.userSettings.setSelectedColor(undefined);
|
||||
if (pattern === null) {
|
||||
this.userSettings.setSelectedPatternName(undefined);
|
||||
} else {
|
||||
|
||||
@@ -229,18 +229,6 @@ export class UserSettings {
|
||||
}
|
||||
}
|
||||
|
||||
getSelectedColor(): string | undefined {
|
||||
return this.getCached(COLOR_KEY) ?? undefined;
|
||||
}
|
||||
|
||||
setSelectedColor(color: string | undefined): void {
|
||||
if (color === undefined) {
|
||||
this.removeCached(COLOR_KEY);
|
||||
} else {
|
||||
this.setCached(COLOR_KEY, color);
|
||||
}
|
||||
}
|
||||
|
||||
getFlag(): string | null {
|
||||
let flag = this.getCached(FLAG_KEY);
|
||||
if (!flag) return null;
|
||||
|
||||
Reference in New Issue
Block a user