add Butto to navigate to source code to comply with AGPL

This commit is contained in:
Felix Dörre 2021-04-18 11:58:49 +02:00
parent 5eba160aa5
commit 9ce7e99e26
3 changed files with 13 additions and 0 deletions

View File

@ -67,6 +67,9 @@
<section>
<button id="sparkButton">Create map</button>
</section>
<section>
<button id="sourceButton">Browse Source Code</button>
</section>
<section id="adminConsoleSection" hidden>
<button id="adminConsoleButton">Admin console</button>
</section>

View File

@ -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,

View File

@ -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.