From 9ce7e99e263a0a47e78ff9449ff80688225aeb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20D=C3=B6rre?= Date: Sun, 18 Apr 2021 11:58:49 +0200 Subject: [PATCH] add Butto to navigate to source code to comply with AGPL --- front/dist/resources/html/gameMenu.html | 3 +++ front/src/Enum/EnvironmentVariable.ts | 2 ++ front/src/Phaser/Menu/MenuScene.ts | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/front/dist/resources/html/gameMenu.html b/front/dist/resources/html/gameMenu.html index 73c62918..e1cc2b31 100644 --- a/front/dist/resources/html/gameMenu.html +++ b/front/dist/resources/html/gameMenu.html @@ -67,6 +67,9 @@
+
+ +
diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index 0bb6145a..d38a142c 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -10,6 +10,7 @@ const START_ROOM_URL: string = const PUSHER_URL = process.env.PUSHER_URL || window.waconfig.PUSHER_URL || "//pusher.workadventure.localhost"; export const ADMIN_URL = process.env.ADMIN_URL || "//workadventu.re"; const UPLOADER_URL = process.env.UPLOADER_URL || "//uploader.workadventure.localhost"; +const SOURCE_URL = window.waconfig.SOURCE_URL || '//github.com/thecodingmachine/workadventure'; const STUN_SERVER: string = process.env.STUN_SERVER || window.waconfig.STUN_SERVER || "stun:stun.l.google.com:19302"; const TURN_SERVER: string = process.env.TURN_SERVER || window.waconfig.TURN_SERVER || ""; const SKIP_RENDER_OPTIMIZATIONS: boolean = process.env.SKIP_RENDER_OPTIMIZATIONS == "true"; @@ -32,6 +33,7 @@ export { SKIP_RENDER_OPTIMIZATIONS, DISABLE_NOTIFICATIONS, PUSHER_URL, + SOURCE_URL, UPLOADER_URL, POSITION_DELAY, MAX_EXTRAPOLATION_TIME, diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 8270dada..35f6aa75 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -20,6 +20,7 @@ import { playersStore } from "../../Stores/PlayersStore"; import { mediaManager } from "../../WebRtc/MediaManager"; import { chatVisibilityStore } from "../../Stores/ChatStore"; import { ADMIN_URL } from "../../Enum/EnvironmentVariable"; +import {SOURCE_URL} from "../../Enum/EnvironmentVariable"; export const MenuSceneName = "MenuScene"; const gameMenuKey = "gameMenu"; @@ -327,6 +328,9 @@ export class MenuScene extends Phaser.Scene { case "sparkButton": this.gotToCreateMapPage(); break; + case "sourceButton": + this.goToSourcePage(); + break; case "changeSkinButton": this.closeSideMenu(); gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene()); @@ -384,6 +388,10 @@ export class MenuScene extends Phaser.Scene { this.closeGameQualityMenu(); } + private goToSourcePage() { + window.open(SOURCE_URL, '_blank'); + } + private gotToCreateMapPage() { //const sparkHost = 'https://'+window.location.host.replace('play.', '')+'/choose-map.html'; //TODO fix me: this button can to send us on WorkAdventure BO.