Enabling Outline back on actionable objects

Actionable objects (still a prototype) were outlined when you walk next to them.
The OutlinePipeline was broken when moving in Phaser 3.50+.

This PR completely removes the custom OutlinePipeline and replaces it with the rexOutlinePipelinePlugin
that is provided by a third party library and that works great \o/
This commit is contained in:
David Négrier 2021-06-22 16:35:57 +02:00
parent 37893936b9
commit e9dd7ebdd9
4 changed files with 29 additions and 72 deletions

View file

@ -10,6 +10,7 @@ import {SelectCompanionScene} from "./Phaser/Login/SelectCompanionScene";
import {EnableCameraScene} from "./Phaser/Login/EnableCameraScene";
import {CustomizeScene} from "./Phaser/Login/CustomizeScene";
import WebFontLoaderPlugin from 'phaser3-rex-plugins/plugins/webfontloader-plugin.js';
import OutlinePipelinePlugin from 'phaser3-rex-plugins/plugins/outlinepipeline-plugin.js';
import {EntryScene} from "./Phaser/Login/EntryScene";
import {coWebsiteManager} from "./WebRtc/CoWebsiteManager";
import {MenuScene} from "./Phaser/Menu/MenuScene";
@ -22,6 +23,8 @@ import {waScaleManager} from "./Phaser/Services/WaScaleManager";
import {Game} from "./Phaser/Game/Game";
import App from './Components/App.svelte';
import {HtmlUtils} from "./WebRtc/HtmlUtils";
import WebGLRenderer = Phaser.Renderer.WebGL.WebGLRenderer;
const {width, height} = coWebsiteManager.getGameSize();
@ -123,11 +126,11 @@ const config: GameConfig = {
powerPreference: "low-power",
callbacks: {
postBoot: game => {
// Commented out to try to fix MacOS bug
/*const renderer = game.renderer;
// Install rexOutlinePipeline only if the renderer is WebGL.
const renderer = game.renderer;
if (renderer instanceof WebGLRenderer) {
renderer.pipelines.add(OutlinePipeline.KEY, new OutlinePipeline(game));
}*/
game.plugins.install('rexOutlinePipeline', OutlinePipelinePlugin, true);
}
}
}
};