Merge branch 'develop' of github.com:thecodingmachine/workadventure into develop

This commit is contained in:
_Bastler
2022-05-12 09:02:34 +02:00
12 changed files with 722 additions and 10 deletions
@@ -12,6 +12,7 @@ export class PlayerStatusDot extends Phaser.GameObjects.Container {
[AvailabilityStatus.ONLINE]: { filling: 0x8cc43f, outline: 0x427a25 },
[AvailabilityStatus.SILENT]: { filling: 0xe74c3c, outline: 0xc0392b },
[AvailabilityStatus.JITSI]: { filling: 0x8cc43f, outline: 0x427a25 },
[AvailabilityStatus.DENY_PROXIMITY_MEETING]: { filling: 0xffffff, outline: 0x404040 },
[AvailabilityStatus.UNRECOGNIZED]: { filling: 0xffffff, outline: 0xffffff },
[AvailabilityStatus.UNCHANGED]: { filling: 0xffffff, outline: 0xffffff },
};
+4 -5
View File
@@ -93,7 +93,7 @@ import { followUsersColorStore } from "../../Stores/FollowStore";
import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler";
import { i18nJson } from "../../i18n/locales";
import LL, { locale } from "../../i18n/i18n-svelte";
import { availabilityStatusStore, localVolumeStore } from "../../Stores/MediaStore";
import { availabilityStatusStore, denyProximityMeetingStore, localVolumeStore } from "../../Stores/MediaStore";
import { StringUtils } from "../../Utils/StringUtils";
import { startLayerNamesStore } from "../../Stores/StartLayerNamesStore";
import { JitsiCoWebsite } from "../../WebRtc/CoWebsite/JitsiCoWebsite";
@@ -228,7 +228,6 @@ export class GameScene extends DirtyScene {
private jitsiDominantSpeaker: boolean = false;
private jitsiParticipantsCount: number = 0;
public readonly superLoad: SuperLoaderPlugin;
private allowProximityMeeting: boolean = true;
constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) {
super({
@@ -1147,14 +1146,14 @@ export class GameScene extends DirtyScene {
this.iframeSubscriptionList.push(
iframeListener.disablePlayerProximityMeetingStream.subscribe(() => {
this.allowProximityMeeting = false;
denyProximityMeetingStore.set(true);
this.disableMediaBehaviors();
})
);
this.iframeSubscriptionList.push(
iframeListener.enablePlayerProximityMeetingStream.subscribe(() => {
this.allowProximityMeeting = true;
denyProximityMeetingStore.set(false);
this.enableMediaBehaviors();
})
);
@@ -2225,7 +2224,7 @@ export class GameScene extends DirtyScene {
}
public enableMediaBehaviors() {
if (this.allowProximityMeeting) {
if (!get(denyProximityMeetingStore)) {
mediaManager.showMyCamera();
}
}
@@ -59,6 +59,8 @@ class UIWebsiteManager {
website.margin.right = websiteEvent.margin.right;
}
}
uiWebsitesStore.update(website);
});
}
@@ -30,6 +30,10 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
return;
}
if (!this.gameScene.userInputManager.isControlsEnabled) {
return;
}
for (const object of gameObjects) {
if (object instanceof Player || object instanceof RemotePlayer) {
return;
@@ -176,7 +176,6 @@ export class UserInputManager {
this.scene.input.keyboard.removeAllListeners();
}
//todo: should we also disable the joystick?
disableControls() {
this.scene.input.keyboard.removeAllKeys();
this.isInputDisabled = true;
@@ -186,6 +185,11 @@ export class UserInputManager {
this.initKeyBoardEvent();
this.isInputDisabled = false;
}
get isControlsEnabled() {
return !this.isInputDisabled;
}
getEventListForGameTick(): ActiveEventList {
const eventsMap = new ActiveEventList();
if (this.isInputDisabled) {
@@ -266,7 +270,7 @@ export class UserInputManager {
this.scene.input.on(
Phaser.Input.Events.POINTER_DOWN,
(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]) => {
if (!pointer.wasTouch) {
if (!pointer.wasTouch || this.isInputDisabled) {
return;
}
this.userInputHandler.handlePointerDownEvent(pointer, gameObjects);
+8 -3
View File
@@ -182,11 +182,13 @@ function createVideoConstraintStore() {
export const inJitsiStore = writable(false);
export const silentStore = writable(false);
export const denyProximityMeetingStore = writable(false);
export const availabilityStatusStore = derived(
[inJitsiStore, silentStore, privacyShutdownStore],
([$inJitsiStore, $silentStore, $privacyShutdownStore]) => {
[inJitsiStore, silentStore, privacyShutdownStore, denyProximityMeetingStore],
([$inJitsiStore, $silentStore, $privacyShutdownStore, $denyProximityMeetingStore]) => {
if ($inJitsiStore) return AvailabilityStatus.JITSI;
if ($denyProximityMeetingStore) return AvailabilityStatus.DENY_PROXIMITY_MEETING;
if ($silentStore) return AvailabilityStatus.SILENT;
if ($privacyShutdownStore) return AvailabilityStatus.AWAY;
return AvailabilityStatus.ONLINE;
@@ -320,7 +322,10 @@ export const mediaStreamConstraintsStore = derived(
//currentAudioConstraint = false;
}
if ($availabilityStatusStore === AvailabilityStatus.SILENT) {
if (
$availabilityStatusStore === AvailabilityStatus.DENY_PROXIMITY_MEETING ||
$availabilityStatusStore === AvailabilityStatus.SILENT
) {
currentVideoConstraint = false;
currentAudioConstraint = false;
}
+5
View File
@@ -11,6 +11,11 @@ function createUIWebsiteStore() {
add: (uiWebsite: UIWebsite) => {
update((currentArray) => [...currentArray, uiWebsite]);
},
update: (uiWebsite: UIWebsite) => {
update((currentArray) =>
currentArray.map((currentWebsite) => (currentWebsite.id === uiWebsite.id ? uiWebsite : currentWebsite))
);
},
remove: (uiWebsite: UIWebsite) => {
update((currentArray) => currentArray.filter((currentWebsite) => currentWebsite.id !== uiWebsite.id));
},