Magic Combat Data Button Group
If possible, use org.magiclib.combatgui.MagicCombatGuiBase.addButtonGroup rather than using this class directly!
This class provides an inheritance-based option to create your buttons, whereas org.magiclib.combatgui.MagicCombatGuiBase.addButtonGroup instead allows you to pass actions for creating/refreshing buttons and the action to execute.
base class defining a group of buttons with each button representing a possible date and the whole group representing a data set defined by the sum of data of all active buttons.
In other words, this represents a row (or column) of buttons. All buttons in that row perform the same action when clicked. When a button is clicked, that action is performed with the data of all active buttons.
buttons get activated/deactivated by the user by clicking on them when a button is clicked, executeAction gets called with the sum of data of all active buttons
If, for instance, we have two buttons with corresponding data 1 and respectively, and the user activates the first button, [1]
will be passed as data to the groupAction and 1 as triggeringButtonData. If the user then clicks the second button [1, 2]
, will be passed as data and 2 as triggeringButtonData.
Extend this class by implementing createButtons, refresh and executeAction
Author
Jannes
Since
1.3.0
Parameters
LazyFont object
text to be rendered above the group
defines where/how the group gets rendered
Constructors
Functions
Override me! Gets called on construction. Create all buttons belonging to this group in the implementation of this method. Check MagicCombatCreateSimpleButtons for an example implementation.
Disable (i.e. grey out and make un-clickable) button with given title/text/name
Hopefully self-explanatory =)
Override me! Gets called whenever a button in this group gets clicked. Implement the actual logic you want your button group to perform in here.
Override me! Gets called whenever a button of any group gets pressed (or something calls for a re-render). If you e.g. want to enable/disable buttons or change tooltips based on the current state, implement that logic in this method. Otherwise, an empty method will do.
Refresh state (active/inactive) of all buttons