User Interface - kxgames/seacow GitHub Wiki
The Stack
The basic idea is to allow users to queue up action that they can't yet afford, and to have the game automatically process those actions as the necessary resources become available. This frees up the player from having to remember which actions they want to take as they save up resource.
- When a player clicks on any "action" (e.g. new building/unit/technology), the action goes onto a stack.
- When the player has enough resource, the game will automatically pop the first item off the stack and begin to "process" (e.g. construct/train/research) it.
- Players can have multiple stacks, and allocate a different fraction of their resources to each one. This way, players can prevent a single expensive action from holding up a bunch of cheap ones.
- Actions can have instructions to add themselves back onto the stack after they complete. This could repeat forever (e.g. to make infinite queues) or until the action has been repeated a certain number of times, or until a certain amount of money has been spent.
- The player can always view and edit their stacks. Edits include:
- Rearranging the actions.
- Moving actions between stacks.
- Adding/changing action metadata (e.g. how many times to loop, how much to pay for variable-price techs, etc.)
- Players can have as many stacks as them want.
- We'll need a nice UI for specifying which queue to add new actions to.
- There should probably be various ways to specify default queues, e.g. for military actions, economic actions, actions at different cities, user-programmed sets of actions, etc.
- Single-clicking on an action will just add it to the default stack, so users don't need to think about this if they don't want to. But there should be some way to a way to specify more information (e.g. double click of the action button, and a small UI will pop up with more options).