Module: alert
This module helps you creating popups.
alert = require("alert") local done = alert:create("Done!")
alertInstance
An alertInstance can be used to personalize its buttons.
Functions
Creates, sets the text and callback of a negative button in the alertInstance.
Using nil for the callback will remove the button
Buttons are displayed in that order: NEUTRAL, NEGATIVE, POSITIVE.
local instance = alert:create("Are you sure?") instance:setNegativeCallback("No", function() -- add your code here end) instance:setNegativeCallback("No", nil) -- removes the button
Creates, sets the text and callback of a neutral button in the alertInstance.
Using nil for the callback will remove the button
Buttons are displayed in that order: NEUTRAL, NEGATIVE, POSITIVE.
local instance = alert:create("Are you sure?") instance:setNeutralCallback("Cancel", function() -- add your code here end)
Sets the text and the callback for positive button. Using nil for the callback removes the button.
local instance = alert:create("Are you sure?") instance:setPositiveCallback("Yes!", function() -- add your code here end)
📃 Source