FAForever / FAForever/fa

Add support to disable all paintings from players when observing

Open
#6,780 0 comments 0 reactions 0 assignees View on GitHub
feature: painting
Dominant language
Lua
Stars
264
Forks
260
Avg merge
3d 2h
Merged PRs (30d)
21

Description

### Description

Extends #6726

At the moment you will always see all paintings when observing. There's no option to turn off the paintings from players. This may especially be useful when creating recordings of trainer and tutorial-like content based on actual replays.

It would be two game options:

- One game option when observing a game.
- One game option when observing a replay (of a game).

### Course of Action

Create the two new game options.

Extend the abstract `PaintingCanvasAdapter` class a new function called `SkipEventByCallback`. It returns `false` by default. Extend the `SubscribeToCallback` function to call `SkipEventByCallback` and skip the shared brush stroke of it is true.

Extend the abstract class `PaintingCanvasForObservers` and override the `SkipEventByCallback` to check for the game option when observing a game.

Extend the abstract class `PaintingCanvasAdapterForReplays` and override the `SkipEventByCallback` to check for the game option when observing a replay.

This setup allows you to dynamically toggle the game option. You can use `GetOption` to check the game option.

Open to suggestions for a better name for `SkipEventByCallback` 😄 !

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.