HexManiacAdvance/src/HexManiac.Core/Models/Code/hma.py
haven1433 2634ff50e8 Add python button capability for tables
Adding a field `name|python=function` to a table will add a button to the table. Clicking the button will run a python function from `hma.py`. The function is expected to have one element, which will be the current selected element of the table as a `ModelArrayElement`. This python code still has access to the entire rom and the print() function.
The button's text is based on the name of the field, and therefore cannot have a spaces or special characters, just letters / numbers.
The button will get tooltip that is based on the comment of the chosen function.
2023-06-26 21:24:13 -05:00

7 lines
244 B
Python

# these fuctions are loaded automatically and are available
# from the python automation tool or python table buttons
# if running from a table button, the argument will be the
# current element in the current table as a ModelArrayElement