API:EnableAlert
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Turns one type of on-screen alert message on or off and sets its cooldown.
EnableAlert(alertType, enabled, cooldown)
Arguments
- alertType
number– The alert type, aSystemData.AlertContainervalue. Fractions are dropped.- enabled
boolean–trueto show alerts of this type,falseto hide them.- cooldown
number– Cooldown for this alert type. The stock UI passes milliseconds. Fractions are dropped.
Returns
Nothing.
Details
- With
enabled = truethe type's enabled flag is set andcooldownbecomes its cooldown. The previous cooldown value is kept in a second slot. - With
enabled = falseonly the enabled flag is cleared;cooldownis ignored and the stored cooldown is left alone. alertTypeis not range-checked. Use only theSystemData.AlertContainervalues.enabledmust be a real boolean. Passingnilor a number raises an Invalid Parameters error.- The function needs at least three arguments and only reads the last three.
Errors
None besides the Invalid Parameters argument check.
Example
From ea_settingswindow/source/settingswindowtabinterface.lua:
local cooldownInMs, cooldownSlider = ProcessSliderCooldown( MessageBodyWindowName.."CombatSlider" ) SettingsWindowTabInterface.SavedMessageSettings.combatSlider = cooldownSlider EnableAlert( SystemData.AlertContainer.COMBAT, SettingsWindowTabInterface.SavedMessageSettings.combat, cooldownInMs )
