Currently, the onScriptingButtonUp and onScriptingButtonDown events only provide index and player_color arguments.
With a full Player class instead of just a color reference, it would be possible to utilize scripting buttons for individual spectators instead of the current all-or-nothing approach.
To maintain existing functionality, Player could just be added as a third argument.
Can spectators press buttons?
Yes, spectators can press scripting buttons and interact with custom UI elements (e.g. the UI class and XML stuff).
They are only restricted from interacting with game objects and classic UI buttons/inputs.
Ideally, add it as a 3rd argument for the event. This addition shouldn’t break previous mods that use onScriptiongButtonUp
and onScriptiongButtonDown