-
Notifications
You must be signed in to change notification settings - Fork 1
Action
Justin Oroz edited this page Jul 8, 2018
·
2 revisions

Adding a ConfigAction object to your menu displays a Button which can be used to trigger actions in your mod.
ConfigAction myButton = new ConfigAction("mySetting", "Option Label", OptionActionType.GIFT);ConfigAction initialization requires an identifier, label, and type but can be initialized with the standard enabled. You can then add it to an OptionsTab.
The type argument decides which icon to display and requires a ButtonType enum value which currently includes:
public enum ButtonType
{
OK, SET, CLEAR, DONE, GIFT
}The corresponding icons are as follows:
![]()
The event ActionWasTriggered is triggered every time the button is pressed.
The mod can manually trigger the event with the Trigger() method.
ConfigAction(string identifier, string labelText, ButtonType type, bool enabled = true);void Trigger();ButtonType type { get; set; }event ActionHandler ActionWasTriggered;