Context click code module
Created by: ComicIronic
Added a system for contextual attack-selfing on items. This on its own permits hooks into various uses, but the one majorly supported is buttons. You can define inbuilt context buttons, or create attachable buttons for other items. The remote datum is not tied to the remote item, which is just an example of how you would implement its functionality.
Context-clicking:
- The return_clicked_id can be set to give custom IDs given an x and y position on the icon
- return_clicked_id_by_params does all the messy work of converting params into a valid x and y click for return_clicked ID
- action() can be set for custom behaviour, passed an item or not
Buttons:
- Remote datums allow the use of button devices, as well as adding them or removing them
- Buttons have an on_press functionality
- This allows you to make remotes for anything using, for example, a signaller button (space garage doors ho!)
- No truly functional buttons exist - all the current ones just play sounds, for testing purposes
- Buttons adapt to their remote - the remote passes the shape a button icon has to be, and its displacement
- New buttons follow the base shape for remotes, and then can be attached anywhere
Moved code around, split the datum into a subtype to clarify its functionality.