Merge pull request #870 from joberthel/feature/player-companion

Added companion (pet) to player
This commit is contained in:
Kharhamel
2021-04-12 18:11:07 +02:00
committed by GitHub
25 changed files with 643 additions and 23 deletions
+17
View File
@@ -4,6 +4,7 @@ const playerNameKey = 'playerName';
const selectedPlayerKey = 'selectedPlayer';
const customCursorPositionKey = 'customCursorPosition';
const characterLayersKey = 'characterLayers';
const companionKey = 'companion';
const gameQualityKey = 'gameQuality';
const videoQualityKey = 'videoQuality';
const audioPlayerVolumeKey = 'audioVolume';
@@ -49,6 +50,22 @@ class LocalUserStore {
return areCharacterLayersValid(value) ? value : null;
}
setCompanion(companion: string|null): void {
return localStorage.setItem(companionKey, JSON.stringify(companion));
}
getCompanion(): string|null {
const companion = JSON.parse(localStorage.getItem(companionKey) || "null");
if (typeof companion !== "string" || companion === "") {
return null;
}
return companion;
}
wasCompanionSet(): boolean {
return localStorage.getItem(companionKey) ? true : false;
}
setGameQualityValue(value: number): void {
localStorage.setItem(gameQualityKey, '' + value);
}