Change report flag

- Add icon on video
- Permit to have a modal with comment
This commit is contained in:
Gregoire Parant 2020-10-13 19:56:42 +02:00
parent 65406f844e
commit dbaf44e814
9 changed files with 164 additions and 37 deletions

View file

@ -8,7 +8,6 @@ import {Sprite} from "./Sprite";
*/
export class RemotePlayer extends Character {
userId: number;
private report: Sprite;
constructor(
userId: number,
@ -24,28 +23,6 @@ export class RemotePlayer extends Character {
//set data
this.userId = userId;
this.report = new Sprite(Scene, 20, -10, 'report_flag', 3);
this.report.setInteractive();
this.report.visible = false;
this.report.on('pointerup', () => {
//this.scene.events.emit('reportUser', {reportedUserId: userId, reportComment: comment});
this.scene.events.emit('reportUser', {reportedUserId: this.userId, reportComment: 'test'});
this.report.visible = false;
});
this.add(this.report);
this.sprites.forEach((sprite: Sprite) => {
sprite.on('pointerover', () => {
this.report.visible = true;
});
sprite.on('pointerup', () => {
this.report.visible = true;
});
})
//the current player model should be push away by other players to prevent conflict
//this.setImmovable(false);
}
updatePosition(position: PointInterface): void {