Expose render splitscreen to lua
Simply exposes the variable r_splitscreen
, the variable keeping track of the amount of display players on screen at any point, not just on regular splitscreen/replay splitscreen views, to the lua interface.
As of currently, there is no general good way of getting the amount of display players on the screen without atleast exposing this. I've tried numerous solutions, including:
- Checking for
splitscreen
(only works with local player splitscreen, and not for replay splitscreen) - Iterating through
displayplayers
viadisplayplayers.iterate
(causes a notorious freeze withdisplayplayers
being filled with copies of display player 1) - Iterating through
displayplayers
via normal for-loop (prevents the freeze, but will return 4 due to the copies of display player 1) - Saving the biggest value of
c.pnum
(You can switch the view numbers at any time, so this will stay at 4 even if you switch to 2 views after having 4 views previously...)