kellyelton/OCTGN — Issue #137: Allow game definitions to create new buttons on the GUI
Author: db0
Created: 2012-02-13 10:15:10+00:00
State: open

This is a natural continuation of many ideas, such as being able to [assign functions to buttons](https://github.com/kellyelton/OCTGN/issues/26), being able to [have global turns](https://github.com/kellyelton/OCTGN/issues/105) and being able to [add custom buttons](https://www.skylabsonline.com/forum/discussion/124/customisable-buttons)

What I would like is the ability to define my own buttons for the GUI, to add functions that should be in that form but now have to be in a sub-optimal form.

For example, in my games which primarily have global rounds (rather than player rounds), the "end turn" button on each players tab is fairly useless as it is. I would like to modify it, but I would also like to create a button, either on the top, or like the end turn button, but on the global/shared tab, which would call my nextPhase() script. I would also like to create a drop-down list with all the available phases, for the players to select one and jump straight to it.

Right now, for functions like these, I have to create a table group action "group" and then stick them in that (to avoid clutter) and notify about them via normal notifications. This is both unwieldy and unintuitive (it requires more game-engine training upfront for new players) and also makes these kinds of actions which affect the state of the game for all players more difficult to distinguish than the ones that affect a single player.

Buttons are also easier to notice than context-menu actions, so necessary actions for my games will be easier for new players to notice, when I'm not around to explain the game-engine use.

Here are some more functions (that I'm currently using) that deserve to be in a GUI button, rather than in an obscure table group action.

* The ability to "Pass" on one's turn.
* Perform an comprehensive automated act for a phase. Such as the nightfall phase in Doomtown where you "untap" all your cards on the table and refill you hand to its maximum size form your deck.
* Flip a coin. I would then put this on a neutral part of the GUI, such as beside the player tabs, or on the top with the other ribbon buttons.
* Buy/Sell global resources (which would increase a counter for the player and decrease a shared counter by specific calculations)

The best way to do this would be to allow the definition for these buttons to be on the game definition, along with the player actions, and allow a python function to be attached to them like everything else.