ph.alertDialog
ph.alertDialog(options)
Parametri & Opzioni
| Parametro | Tipo | Stato | Descrizione |
|---|---|---|---|
options.header |
string | Obbligatorio | Uppercase header text (Cinzel font). |
options.content |
string | Obbligatorio | Body content text. Supports newlines (\n). |
options.centered |
boolean | Opzionale (default: true) |
Centers text content if true. |
options.cancel |
boolean | Opzionale (default: true) |
Shows cancel button and allows ESC key if true. |
options.labels |
table | Opzionale | Custom button labels: { confirm = 'Text', cancel = 'Text' }. |
Valore di Ritorno
string — Returns 'confirm' on confirm, 'cancel' on cancel/ESC.
Esempio d'Uso
ph.async(function()
local action = ph.alertDialog({
header = "CONFIRM ACTION",
content = "Are you sure you want to learn this ancient spell?\nCost: 50 Mana.",
centered = true,
cancel = true
})
if action == "confirm" then
ph.notify({ title = "Spell Learned", type = "success" })
end
end)