Hello,
I have 2 issues on the latest version:
It's not possible to add custom vue plugins
I got such code:
import { RpgClientEngine, RpgClientEngineHooks } from "@rpgjs/client"
import FloatingVue from 'floating-vue'
import Draggable from 'vuedraggable'
const client: RpgClientEngineHooks = {
onStart(engine: RpgClientEngine) {
engine.vueApp.use(FloatingVue, {
container: '#tooltips',
disposeTimeout: 0,
})
engine.vueApp.component('Draggable', Draggable)
},
}
export default client
previously it worked perfectly, but now I got this error on the client side:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'use')
at onStart (client.ts:9:23)
at PluginSystem.emit (EventEmitter.ts:32:31)
at RpgClientEngine.start (RpgClientEngine.ts:314:48)
maybe related to the latest react introduction?
On-click event does not work for stage scene
I got such code to trigger an event on click:
import { RpgSceneMapHooks, RpgSceneMap } from '@rpgjs/client'
const sceneMap: RpgSceneMapHooks = {
onAfterLoading(scene: RpgSceneMap) {
scene.viewport?.setZoom(1.4);
scene.on('click', (e) => {
scene.game.clientEngine.socket.emit('shoot-bullet', e);
});
}
}
export default sceneMap;
but I discovered that in some of the latest versions new element occurred in the HTML that is the parent of the stage (?) and it makes the scene not clickable.
Edit: I see that this element has pointer-events: none
, but when I change version to 4.0.2 then it works and this element is gone.