Compare commits

...

14 commits

Author SHA1 Message Date
Ludwig Behm f175a7c8ed
front: replace main menu icon with kraut world icon 2022-02-04 01:05:23 +01:00
Ludwig Behm 0cd0f5acc0
Merge branch 'develop' of https://github.com/thecodingmachine/workadventure into develop 2022-02-04 00:41:26 +01:00
Ludwig Behm 2c1b5a90ea
front: remove instance name from jitsi room names if global 2022-02-04 00:35:53 +01:00
Alexis Faizeau 2232f7caf4
Merge pull request #1819 from thecodingmachine/fix-cowebsite
Fix display of co-website thumbnail
2022-02-03 18:20:50 +01:00
Alexis Faizeau 137bd831a9 Fix main cowebsite switcher 2022-02-03 15:20:30 +01:00
Alexis Faizeau b91de4a91d Replace favicon by meet icon on jitsi cowebsite thumbnail 2022-02-03 15:03:42 +01:00
Alexis Faizeau 1b93bf666f Remove translate from warning message 2022-02-03 14:38:53 +01:00
David Négrier c34ee73448
Merge pull request #1813 from thecodingmachine/fix-cowebsite
Fix mozaic layout
2022-02-03 11:44:23 +01:00
Alexis Faizeau 7e9343f1b7 Fix mozaic layout 2022-02-03 11:17:11 +01:00
Alexis Faizeau 4a9cc57d60 Cancelable companion resource 2022-02-03 11:17:11 +01:00
David Négrier 9696b0ab04
Merge pull request #1818 from thecodingmachine/fix-character-collider
applied proper offset for circle collider of Character
2022-02-03 10:25:42 +01:00
David Négrier be2727f5c4
Merge pull request #1817 from thecodingmachine/fix-interaction
fixed actions-menu not appearing
2022-02-03 10:13:36 +01:00
Hanusiak Piotr 010c176708 applied proper offset for circle collider of Character 2022-02-03 10:13:17 +01:00
Hanusiak Piotr be60d0ef03 fixed actions-menu not appearing 2022-02-03 09:50:52 +01:00
12 changed files with 91 additions and 16 deletions

49
front/dist/resources/logos/meet.svg vendored Normal file
View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="452.388px" height="452.388px" viewBox="0 0 452.388 452.388" style="enable-background:new 0 0 452.388 452.388;"
xml:space="preserve">
<g>
<g id="Layer_8_38_">
<path d="M441.677,43.643H10.687C4.785,43.643,0,48.427,0,54.329v297.425c0,5.898,4.785,10.676,10.687,10.676h162.069v25.631
c0,0.38,0.074,0.722,0.112,1.089h-23.257c-5.407,0-9.796,4.389-9.796,9.795c0,5.408,4.389,9.801,9.796,9.801h158.506
c5.406,0,9.795-4.389,9.795-9.801c0-5.406-4.389-9.795-9.795-9.795h-23.256c0.032-0.355,0.115-0.709,0.115-1.089V362.43H441.7
c5.898,0,10.688-4.782,10.688-10.676V54.329C452.37,48.427,447.589,43.643,441.677,43.643z M422.089,305.133
c0,5.903-4.784,10.687-10.683,10.687H40.96c-5.898,0-10.684-4.783-10.684-10.687V79.615c0-5.898,4.786-10.684,10.684-10.684
h370.446c5.898,0,10.683,4.785,10.683,10.684V305.133z M303.942,290.648H154.025c0-29.872,17.472-55.661,42.753-67.706
c-15.987-10.501-26.546-28.571-26.546-49.13c0-32.449,26.306-58.755,58.755-58.755c32.448,0,58.753,26.307,58.753,58.755
c0,20.553-10.562,38.629-26.545,49.13C286.475,234.987,303.942,260.781,303.942,290.648z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -19,7 +19,9 @@
const urlObject = new URL(coWebsiteUrl); const urlObject = new URL(coWebsiteUrl);
onMount(() => { onMount(() => {
icon.src = `${ICON_URL}/icon?url=${urlObject.hostname}&size=64..96..256&fallback_icon_color=14304c`; icon.src = coWebsite.jitsi
? "/resources/logos/meet.svg"
: `${ICON_URL}/icon?url=${urlObject.hostname}&size=64..96..256&fallback_icon_color=14304c`;
icon.alt = coWebsite.altMessage ?? urlObject.hostname; icon.alt = coWebsite.altMessage ?? urlObject.hostname;
icon.onload = () => { icon.onload = () => {
iconLoaded = true; iconLoaded = true;
@ -34,7 +36,7 @@
const coWebsites = $coWebsitesNotAsleep; const coWebsites = $coWebsitesNotAsleep;
const newMain = $highlightedEmbedScreen ?? coWebsites.length > 1 ? coWebsites[1] : undefined; const newMain = $highlightedEmbedScreen ?? coWebsites.length > 1 ? coWebsites[1] : undefined;
if (newMain) { if (newMain) {
coWebsiteManager.goToMain(coWebsite); coWebsiteManager.goToMain(newMain);
} }
} else { } else {
highlightedEmbedScreen.toggleHighlight({ highlightedEmbedScreen.toggleHighlight({
@ -79,6 +81,7 @@
<img <img
class="cowebsite-icon noselect nes-pointer" class="cowebsite-icon noselect nes-pointer"
class:hide={!iconLoaded} class:hide={!iconLoaded}
class:jitsi={coWebsite.jitsi}
bind:this={icon} bind:this={icon}
on:dragstart|preventDefault={noDrag} on:dragstart|preventDefault={noDrag}
alt="" alt=""
@ -308,6 +311,12 @@
&.hide { &.hide {
display: none; display: none;
} }
&.jitsi {
filter: invert(100%);
-webkit-filter: invert(100%);
padding: 7px;
}
} }
} }
</style> </style>

View file

@ -23,8 +23,9 @@
{#each [...$streamableCollectionStore.values()] as peer (peer.uniqueId)} {#each [...$streamableCollectionStore.values()] as peer (peer.uniqueId)}
<MediaBox <MediaBox
streamable={peer} streamable={peer}
mozaicSolo={$streamableCollectionStore.size === 1}
mozaicFullWidth={$streamableCollectionStore.size === 1 || $streamableCollectionStore.size === 2} mozaicFullWidth={$streamableCollectionStore.size === 1 || $streamableCollectionStore.size === 2}
mozaicQuarter={$streamableCollectionStore.size === 3 || $streamableCollectionStore.size === 4} mozaicQuarter={$streamableCollectionStore.size === 3 || $streamableCollectionStore.size >= 4}
/> />
{/each} {/each}
</div> </div>

View file

@ -9,6 +9,7 @@
export let streamable: Streamable; export let streamable: Streamable;
export let isHightlighted = false; export let isHightlighted = false;
export let isClickable = false; export let isClickable = false;
export let mozaicSolo = false;
export let mozaicFullWidth = false; export let mozaicFullWidth = false;
export let mozaicQuarter = false; export let mozaicQuarter = false;
</script> </script>
@ -16,6 +17,7 @@
<div <div
class="media-container nes-container is-rounded {isHightlighted ? 'hightlighted' : ''}" class="media-container nes-container is-rounded {isHightlighted ? 'hightlighted' : ''}"
class:clickable={isClickable} class:clickable={isClickable}
class:mozaic-solo={mozaicSolo}
class:mozaic-full-width={mozaicFullWidth} class:mozaic-full-width={mozaicFullWidth}
class:mozaic-quarter={mozaicQuarter} class:mozaic-quarter={mozaicQuarter}
> >
@ -66,6 +68,11 @@
} }
} }
&.mozaic-solo {
max-height: inherit !important;
width: 90% !important;
}
&.mozaic-full-width { &.mozaic-full-width {
width: 95%; width: 95%;
max-width: 95%; max-width: 95%;
@ -73,6 +80,7 @@
margin-right: 3%; margin-right: 3%;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
max-height: 95%;
&:hover { &:hover {
margin-top: auto; margin-top: auto;
@ -85,6 +93,7 @@
max-width: 95%; max-width: 95%;
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
max-height: 95%;
&:hover { &:hover {
margin-top: auto; margin-top: auto;

View file

@ -38,7 +38,6 @@
right: 0; right: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
transform: translate(-50%, 0);
font-family: Lato; font-family: Lato;
min-width: 300px; min-width: 300px;
opacity: 0.9; opacity: 0.9;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -4,6 +4,7 @@ import { PlayerAnimationDirections, PlayerAnimationTypes } from "../Player/Anima
import { TexturesHelper } from "../Helpers/TexturesHelper"; import { TexturesHelper } from "../Helpers/TexturesHelper";
import { Writable, writable } from "svelte/store"; import { Writable, writable } from "svelte/store";
import type { PictureStore } from "../../Stores/PictureStore"; import type { PictureStore } from "../../Stores/PictureStore";
import type CancelablePromise from "cancelable-promise";
export interface CompanionStatus { export interface CompanionStatus {
x: number; x: number;
@ -25,8 +26,9 @@ export class Companion extends Container {
private direction: PlayerAnimationDirections; private direction: PlayerAnimationDirections;
private animationType: PlayerAnimationTypes; private animationType: PlayerAnimationTypes;
private readonly _pictureStore: Writable<string | undefined>; private readonly _pictureStore: Writable<string | undefined>;
private texturePromise: CancelablePromise<string | void> | undefined;
constructor(scene: Phaser.Scene, x: number, y: number, name: string, texturePromise: Promise<string>) { constructor(scene: Phaser.Scene, x: number, y: number, name: string, texturePromise: CancelablePromise<string>) {
super(scene, x + 14, y + 4); super(scene, x + 14, y + 4);
this.sprites = new Map<string, Sprite>(); this.sprites = new Map<string, Sprite>();
@ -41,7 +43,7 @@ export class Companion extends Container {
this.companionName = name; this.companionName = name;
this._pictureStore = writable(undefined); this._pictureStore = writable(undefined);
texturePromise this.texturePromise = texturePromise
.then((resource) => { .then((resource) => {
this.addResource(resource); this.addResource(resource);
this.invisible = false; this.invisible = false;
@ -234,6 +236,7 @@ export class Companion extends Container {
} }
public destroy(): void { public destroy(): void {
this.texturePromise?.cancel();
for (const sprite of this.sprites.values()) { for (const sprite of this.sprites.values()) {
if (this.scene) { if (this.scene) {
this.scene.sys.updateList.remove(sprite); this.scene.sys.updateList.remove(sprite);

View file

@ -1,5 +1,6 @@
import LoaderPlugin = Phaser.Loader.LoaderPlugin; import LoaderPlugin = Phaser.Loader.LoaderPlugin;
import { COMPANION_RESOURCES, CompanionResourceDescriptionInterface } from "./CompanionTextures"; import { COMPANION_RESOURCES, CompanionResourceDescriptionInterface } from "./CompanionTextures";
import CancelablePromise from "cancelable-promise";
export const getAllCompanionResources = (loader: LoaderPlugin): CompanionResourceDescriptionInterface[] => { export const getAllCompanionResources = (loader: LoaderPlugin): CompanionResourceDescriptionInterface[] => {
COMPANION_RESOURCES.forEach((resource: CompanionResourceDescriptionInterface) => { COMPANION_RESOURCES.forEach((resource: CompanionResourceDescriptionInterface) => {
@ -9,8 +10,12 @@ export const getAllCompanionResources = (loader: LoaderPlugin): CompanionResourc
return COMPANION_RESOURCES; return COMPANION_RESOURCES;
}; };
export const lazyLoadCompanionResource = (loader: LoaderPlugin, name: string): Promise<string> => { export const lazyLoadCompanionResource = (loader: LoaderPlugin, name: string): CancelablePromise<string> => {
return new Promise((resolve, reject) => { return new CancelablePromise((resolve, reject, cancel) => {
cancel(() => {
return;
});
const resource = COMPANION_RESOURCES.find((item) => item.name === name); const resource = COMPANION_RESOURCES.find((item) => item.name === name);
if (typeof resource === "undefined") { if (typeof resource === "undefined") {

View file

@ -59,7 +59,7 @@ export abstract class Character extends Container implements OutlineableInterfac
frame: string | number, frame: string | number,
isClickable: boolean, isClickable: boolean,
companion: string | null, companion: string | null,
companionTexturePromise?: Promise<string> companionTexturePromise?: CancelablePromise<string>
) { ) {
super(scene, x, y /*, texture, frame*/); super(scene, x, y /*, texture, frame*/);
this.scene = scene; this.scene = scene;
@ -142,7 +142,7 @@ export abstract class Character extends Container implements OutlineableInterfac
this.clickable = clickable; this.clickable = clickable;
if (clickable) { if (clickable) {
this.setInteractive({ this.setInteractive({
hitArea: new Phaser.Geom.Circle(0, 0, interactiveRadius), hitArea: new Phaser.Geom.Circle(8, 8, interactiveRadius),
hitAreaCallback: Phaser.Geom.Circle.Contains, //eslint-disable-line @typescript-eslint/unbound-method hitAreaCallback: Phaser.Geom.Circle.Contains, //eslint-disable-line @typescript-eslint/unbound-method
useHandCursor: true, useHandCursor: true,
}); });
@ -179,7 +179,7 @@ export abstract class Character extends Container implements OutlineableInterfac
}); });
} }
public addCompanion(name: string, texturePromise?: Promise<string>): void { public addCompanion(name: string, texturePromise?: CancelablePromise<string>): void {
if (typeof texturePromise !== "undefined") { if (typeof texturePromise !== "undefined") {
this.companion = new Companion(this.scene, this.x, this.y, name, texturePromise); this.companion = new Companion(this.scene, this.x, this.y, name, texturePromise);
} }

View file

@ -31,18 +31,18 @@ export class RemotePlayer extends Character implements ActivatableInterface {
moving: boolean, moving: boolean,
visitCardUrl: string | null, visitCardUrl: string | null,
companion: string | null, companion: string | null,
companionTexturePromise?: Promise<string>, companionTexturePromise?: CancelablePromise<string>,
activationRadius?: number activationRadius?: number
) { ) {
super(Scene, x, y, texturesPromise, name, direction, moving, 1, true, companion, companionTexturePromise); super(Scene, x, y, texturesPromise, name, direction, moving, 1, true, companion, companionTexturePromise);
//set data //set data
this.userId = userId; this.userId = userId;
this.visitCardUrl = visitCardUrl;
this.registeredActions = []; this.registeredActions = [];
this.registerDefaultActionsMenuActions(); this.registerDefaultActionsMenuActions();
this.setClickable(this.registeredActions.length > 0); this.setClickable(this.registeredActions.length > 0);
this.activationRadius = activationRadius ?? 96; this.activationRadius = activationRadius ?? 96;
this.visitCardUrl = visitCardUrl;
this.actionsMenuStoreUnsubscriber = actionsMenuStore.subscribe((value: ActionsMenuData | undefined) => { this.actionsMenuStoreUnsubscriber = actionsMenuStore.subscribe((value: ActionsMenuData | undefined) => {
this.isActionsMenuInitialized = value ? true : false; this.isActionsMenuInitialized = value ? true : false;
}); });
@ -118,7 +118,7 @@ export class RemotePlayer extends Character implements ActivatableInterface {
private bindEventHandlers(): void { private bindEventHandlers(): void {
this.on(Phaser.Input.Events.POINTER_DOWN, (event: Phaser.Input.Pointer) => { this.on(Phaser.Input.Events.POINTER_DOWN, (event: Phaser.Input.Pointer) => {
if (event.downElement.nodeName === "CANVAS") { if (event.downElement.nodeName === "CANVAS" && event.leftButtonDown()) {
this.toggleActionsMenu(); this.toggleActionsMenu();
} }
}); });

View file

@ -25,7 +25,7 @@ export class Player extends Character {
direction: PlayerAnimationDirections, direction: PlayerAnimationDirections,
moving: boolean, moving: boolean,
companion: string | null, companion: string | null,
companionTexturePromise?: Promise<string> companionTexturePromise?: CancelablePromise<string>
) { ) {
super(Scene, x, y, texturesPromise, name, direction, moving, 1, true, companion, companionTexturePromise); super(Scene, x, y, texturesPromise, name, direction, moving, 1, true, companion, companionTexturePromise);

View file

@ -131,7 +131,7 @@ class JitsiFactory {
* Slugifies the room name and prepends the room name with the instance * Slugifies the room name and prepends the room name with the instance
*/ */
public getRoomName(roomName: string, instance: string): string { public getRoomName(roomName: string, instance: string): string {
return slugify(instance.replace("/", "-") + "-" + roomName); return slugify((instance !== 'global') ? instance.replace("/", "-") + "-" + roomName : roomName);
} }
public async start( public async start(