Merge pull request #1584 from thecodingmachine/fixes

Fixes
This commit is contained in:
David Négrier 2021-11-24 15:55:33 +01:00 committed by GitHub
commit 6c5f330b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 14 deletions

View file

@ -107,7 +107,8 @@ export class Room {
this._mapUrl = data.mapUrl; this._mapUrl = data.mapUrl;
this._textures = data.textures; this._textures = data.textures;
this._group = data.group; this._group = data.group;
this._authenticationMandatory = data.authenticationMandatory || DISABLE_ANONYMOUS; this._authenticationMandatory =
data.authenticationMandatory != null ? data.authenticationMandatory : DISABLE_ANONYMOUS;
this._iframeAuthentication = data.iframeAuthentication || OPID_LOGIN_SCREEN_PROVIDER; this._iframeAuthentication = data.iframeAuthentication || OPID_LOGIN_SCREEN_PROVIDER;
this._contactPage = data.contactPage || CONTACT_URL; this._contactPage = data.contactPage || CONTACT_URL;
return new MapDetail(data.mapUrl, data.textures); return new MapDetail(data.mapUrl, data.textures);

View file

@ -128,6 +128,10 @@ export abstract class Character extends Container {
} }
public addTextures(textures: string[], frame?: string | number): void { public addTextures(textures: string[], frame?: string | number): void {
if (textures.length < 1) {
throw new TextureError("no texture given");
}
for (const texture of textures) { for (const texture of textures) {
if (this.scene && !this.scene.textures.exists(texture)) { if (this.scene && !this.scene.textures.exists(texture)) {
throw new TextureError("texture not found"); throw new TextureError("texture not found");

View file

@ -69,13 +69,11 @@ export const lazyLoadPlayerCharacterTextures = (
} }
//If the loading fail, we render the default model instead. //If the loading fail, we render the default model instead.
return returnPromise return returnPromise.then((keys) =>
.then((keys) => keys.map((key) => {
keys.map((key) => { return typeof key !== "string" ? key.name : key;
return typeof key !== "string" ? key.name : key; })
}) );
)
.catch(() => lazyLoadPlayerCharacterTextures(loadPlugin, ["color_22", "eyes_23"]));
}; };
export const getRessourceDescriptor = ( export const getRessourceDescriptor = (

View file

@ -27,7 +27,7 @@ export class GameMapPropertiesListener {
constructor(private scene: GameScene, private gameMap: GameMap) {} constructor(private scene: GameScene, private gameMap: GameMap) {}
register() { register() {
this.gameMap.onPropertyChange(GameMapProperties.OPEN_TAB, (newValue, oldvalue, allProps) => { this.gameMap.onPropertyChange(GameMapProperties.OPEN_TAB, (newValue, oldValue, allProps) => {
if (newValue === undefined) { if (newValue === undefined) {
layoutManagerActionStore.removeAction("openTab"); layoutManagerActionStore.removeAction("openTab");
} }
@ -192,11 +192,6 @@ export class GameMapPropertiesListener {
if (coWebsiteOpen.state === OpenCoWebsiteState.LOADING) { if (coWebsiteOpen.state === OpenCoWebsiteState.LOADING) {
coWebsiteOpen.state = OpenCoWebsiteState.MUST_BE_CLOSE; coWebsiteOpen.state = OpenCoWebsiteState.MUST_BE_CLOSE;
return;
}
if (coWebsiteOpen.state !== OpenCoWebsiteState.OPENED) {
return;
} }
if (coWebsiteOpen.coWebsite !== undefined) { if (coWebsiteOpen.coWebsite !== undefined) {