This commit is contained in:
kharhamel 2021-07-13 10:54:53 +02:00
parent fecbc8a018
commit 50f3af81e4
3 changed files with 15 additions and 15 deletions

View file

@ -38,6 +38,6 @@ export class EnableCameraScene extends ResizableScene {
enableCameraSceneVisibilityStore.hideEnableCameraScene(); enableCameraSceneVisibilityStore.hideEnableCameraScene();
this.scene.sleep(EnableCameraSceneName); this.scene.sleep(EnableCameraSceneName);
gameManager.goToStartingMap(); gameManager.goToStartingMap(this.scene);
} }
} }

View file

@ -119,7 +119,7 @@ export class MenuScene extends Phaser.Scene {
showReportScreenStore.subscribe((user) => { showReportScreenStore.subscribe((user) => {
if (user !== null) { if (user !== null) {
this.closeAll(); this.closeAll();
this.gameReportElement.open(user.userId, user.userName); //this.gameReportElement.open(user., user.userName);
} }
}); });
@ -330,18 +330,18 @@ export class MenuScene extends Phaser.Scene {
switch ((event?.target as HTMLInputElement).id) { switch ((event?.target as HTMLInputElement).id) {
case "changeNameButton": case "changeNameButton":
this.closeSideMenu(); this.closeSideMenu();
gameManager.leaveGame(LoginSceneName, new LoginScene()); gameManager.leaveGame(this, LoginSceneName, new LoginScene());
break; break;
case "sparkButton": case "sparkButton":
this.gotToCreateMapPage(); this.gotToCreateMapPage();
break; break;
case "changeSkinButton": case "changeSkinButton":
this.closeSideMenu(); this.closeSideMenu();
gameManager.leaveGame(SelectCharacterSceneName, new SelectCharacterScene()); gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene());
break; break;
case "changeCompanionButton": case "changeCompanionButton":
this.closeSideMenu(); this.closeSideMenu();
gameManager.leaveGame(SelectCompanionSceneName, new SelectCompanionScene()); gameManager.leaveGame(this, SelectCompanionSceneName, new SelectCompanionScene());
break; break;
case "closeButton": case "closeButton":
this.closeSideMenu(); this.closeSideMenu();

View file

@ -8,7 +8,7 @@ export const gameReportRessource = "resources/html/gameReport.html";
export class ReportMenu extends Phaser.GameObjects.DOMElement { export class ReportMenu extends Phaser.GameObjects.DOMElement {
private opened: boolean = false; private opened: boolean = false;
private userId!: number; private userUuid!: string;
private userName!: string | undefined; private userName!: string | undefined;
private anonymous: boolean; private anonymous: boolean;
@ -40,13 +40,13 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement {
}); });
} }
public open(userId: number, userName: string | undefined): void { public open(userUuid: string, userName: string | undefined): void {
if (this.opened) { if (this.opened) {
this.close(); this.close();
return; return;
} }
this.userId = userId; this.userUuid = userUuid;
this.userName = userName; this.userName = userName;
const mainEl = this.getChildByID("gameReport") as HTMLElement; const mainEl = this.getChildByID("gameReport") as HTMLElement;
@ -57,11 +57,11 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement {
gameTitleReport.innerText = userName || ""; gameTitleReport.innerText = userName || "";
const blockButton = this.getChildByID("toggleBlockButton") as HTMLElement; const blockButton = this.getChildByID("toggleBlockButton") as HTMLElement;
blockButton.innerText = blackListManager.isBlackListed(this.userId) ? "Unblock this user" : "Block this user"; blockButton.innerText = blackListManager.isBlackListed(this.userUuid) ? "Unblock this user" : "Block this user";
this.opened = true; this.opened = true;
gameManager.getCurrentGameScene().userInputManager.disableControls(); //gameManager.getCurrentGameScene().userInputManager.disableControls();
this.scene.tweens.add({ this.scene.tweens.add({
targets: this, targets: this,
@ -72,7 +72,7 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement {
} }
public close(): void { public close(): void {
gameManager.getCurrentGameScene().userInputManager.restoreControls(); //gameManager.getCurrentGameScene().userInputManager.restoreControls();
this.opened = false; this.opened = false;
const mainEl = this.getChildByID("gameReport") as HTMLElement; const mainEl = this.getChildByID("gameReport") as HTMLElement;
this.scene.tweens.add({ this.scene.tweens.add({
@ -95,9 +95,9 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement {
} }
private toggleBlock(): void { private toggleBlock(): void {
!blackListManager.isBlackListed(this.userId) !blackListManager.isBlackListed(this.userUuid)
? blackListManager.blackList(this.userId) ? blackListManager.blackList(this.userUuid)
: blackListManager.cancelBlackList(this.userId); : blackListManager.cancelBlackList(this.userUuid);
this.close(); this.close();
} }
@ -111,7 +111,7 @@ export class ReportMenu extends Phaser.GameObjects.DOMElement {
gamePError.style.display = "block"; gamePError.style.display = "block";
return; return;
} }
gameManager.getCurrentGameScene().connection?.emitReportPlayerMessage(this.userId, gameTextArea.value); //gameManager.getCurrentGameScene().connection?.emitReportPlayerMessage(this.userId, gameTextArea.value);
this.close(); this.close();
} }
} }