This adds a global "Dirty" flag at the Game level and sets it each time the ScaleManager is modified.
This fixes a bug where the game was not redrawn when a CoWebsite was opening/closing.
Turning the "importsNotUsedAsValues" TS config value to "error".
This will require us to use `import type` instead of `import` when we are importing a value that is only used as a type (and therefore that is dropped by the Typescript compiler).
Why this change?
This is a requirement to be able to use Svelte in the future. See https://github.com/sveltejs/svelte-preprocess/issues/206#issuecomment-663193798
When stepping in Jitsi, the game webcam (from mediaManager) was not shut down.
And when enabling/disabling the webcam in Jitsi, the webcam in mediaManager was also
enabled/disabled. This PR fixes those issues.
It also fixes a race condition when closing a Jitsi where the mic/cam would be enabled at the same time.
Using the "visiblitychange" event instead of relying on a "trick" related to RAF being disabled when a window is not open allows us to have cleaner code.
Bonus: the recursive call to "setTimeout" is gone, so the stacktrace growing indefinitely is gone too.
This should make the application a bit more stable.
For each requested animation frame (RAF) in Phaser, Phaser calls the "update" method, then the "render" method of each scenes.
The "render" method takes some time (and energy) to perform the rendering.
The fact is we probably don't need to call "render" if nothing changed on the screen (which happens most of the frames in a typical WorkAdventure game).
This commit is therefore overloading the "Game" class of Phaser to add a "dirty" flag.
Scenes can now add a "isDirty()" method. If all displayed scenes are pristine (not dirty), Phaser will skip rendering the frame altogether.
This saves "a lot" of energy, resulting in laptops that are not overheating when using WorkAdventure \o/
* Improvment circle discussion
- Change to lissen start event of WebRTC connection
* Update help allow navigator and waring message
- Show warning message.
- Use help camera allow setting to show modal and help user.
- Change feature to show the modal only when user have need the information on allow navigator access
* Create soud for video discussion
I honestly don't believe text objects look good on map, and in real maps, I think text should be written on tiles.
However, for a variety of use cases (like in test maps in the /maps/test directory, it can be useful to be
able to display some text easily on a map.
This PR adds the ability to display this text.
Note: the "font" support cannot work correctly, as Tiled is listing fonts from the local
system, and those fonts are not available in a browser.
This class iterates recursively over layers, flattening groups.
This enables us to simplify the code when we iterate layers. We can remove all recursive function calls in the GameScene code (it is delegated to the LayersIterator)