Merge pull request #837 from thecodingmachine/fixCameraHelpPopup
FIX: help camera settings popup now only show up once
This commit is contained in:
commit
dc1a5da175
@ -8,6 +8,7 @@ const gameQualityKey = 'gameQuality';
|
|||||||
const videoQualityKey = 'videoQuality';
|
const videoQualityKey = 'videoQuality';
|
||||||
const audioPlayerVolumeKey = 'audioVolume';
|
const audioPlayerVolumeKey = 'audioVolume';
|
||||||
const audioPlayerMuteKey = 'audioMute';
|
const audioPlayerMuteKey = 'audioMute';
|
||||||
|
const helpCameraSettingsShown = 'helpCameraSettingsShown';
|
||||||
|
|
||||||
class LocalUserStore {
|
class LocalUserStore {
|
||||||
saveUser(localUser: LocalUser) {
|
saveUser(localUser: LocalUser) {
|
||||||
@ -73,6 +74,13 @@ class LocalUserStore {
|
|||||||
getAudioPlayerMuted(): boolean {
|
getAudioPlayerMuted(): boolean {
|
||||||
return localStorage.getItem(audioPlayerMuteKey) === 'true';
|
return localStorage.getItem(audioPlayerMuteKey) === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setHelpCameraSettingsShown(): void {
|
||||||
|
localStorage.setItem(helpCameraSettingsShown, '1');
|
||||||
|
}
|
||||||
|
getHelpCameraSettingsShown(): boolean {
|
||||||
|
return localStorage.getItem(helpCameraSettingsShown) === '1';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const localUserStore = new LocalUserStore();
|
export const localUserStore = new LocalUserStore();
|
||||||
|
@ -79,8 +79,11 @@ export class GameManager {
|
|||||||
console.log('starting '+ (this.currentGameSceneName || this.startRoom.id))
|
console.log('starting '+ (this.currentGameSceneName || this.startRoom.id))
|
||||||
scenePlugin.start(this.currentGameSceneName || this.startRoom.id);
|
scenePlugin.start(this.currentGameSceneName || this.startRoom.id);
|
||||||
scenePlugin.launch(MenuSceneName);
|
scenePlugin.launch(MenuSceneName);
|
||||||
|
|
||||||
|
if (!localUserStore.getHelpCameraSettingsShown()) {
|
||||||
scenePlugin.launch(HelpCameraSettingsSceneName);//700
|
scenePlugin.launch(HelpCameraSettingsSceneName);//700
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public gameSceneIsCreated(scene: GameScene) {
|
public gameSceneIsCreated(scene: GameScene) {
|
||||||
this.currentGameSceneName = scene.scene.key;
|
this.currentGameSceneName = scene.scene.key;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import {mediaManager} from "../../WebRtc/MediaManager";
|
import {mediaManager} from "../../WebRtc/MediaManager";
|
||||||
import {HtmlUtils} from "../../WebRtc/HtmlUtils";
|
import {HtmlUtils} from "../../WebRtc/HtmlUtils";
|
||||||
|
import {localUserStore} from "../../Connexion/LocalUserStore";
|
||||||
|
|
||||||
export const HelpCameraSettingsSceneName = 'HelpCameraSettingsScene';
|
export const HelpCameraSettingsSceneName = 'HelpCameraSettingsScene';
|
||||||
const helpCameraSettings = 'helpCameraSettings';
|
const helpCameraSettings = 'helpCameraSettings';
|
||||||
@ -19,6 +20,7 @@ export class HelpCameraSettingsScene extends Phaser.Scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create(){
|
create(){
|
||||||
|
localUserStore.setHelpCameraSettingsShown();
|
||||||
this.createHelpCameraSettings();
|
this.createHelpCameraSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user