Social network link anonymous connexion

In menu, add social newtork link when user is connected in anonymous mode
This commit is contained in:
Gregoire Parant 2021-02-03 23:14:31 +01:00
parent c41c058fb0
commit 59b4b168e9
4 changed files with 21 additions and 0 deletions

View file

@ -4,6 +4,8 @@ import {gameManager} from "../Game/GameManager";
import {localUserStore} from "../../Connexion/LocalUserStore";
import {mediaManager, ReportCallback, ShowReportCallBack} from "../../WebRtc/MediaManager";
import {coWebsiteManager} from "../../WebRtc/CoWebsiteManager";
import {GameConnexionTypes} from "../../Url/UrlManager";
import {connectionManager} from "../../Connexion/ConnectionManager";
export const MenuSceneName = 'MenuScene';
const gameMenuKey = 'gameMenu';
@ -115,6 +117,10 @@ export class MenuScene extends Phaser.Scene {
const adminSection = this.menuElement.getChildByID('adminConsoleSection') as HTMLElement;
adminSection.hidden = false;
}
if (connectionManager.getConnexionType === GameConnexionTypes.anonymous){
const adminSection = this.menuElement.getChildByID('socialLinks') as HTMLElement;
adminSection.hidden = false;
}
this.tweens.add({
targets: this.menuElement,
x: openedSideMenuX,
@ -304,6 +310,9 @@ export class MenuScene extends Phaser.Scene {
}
private onMenuClick(event:MouseEvent) {
if((event?.target as HTMLInputElement).classList.contains('not-button')){
return;
}
event.preventDefault();
switch ((event?.target as HTMLInputElement).id) {