Skip to content

Return of Reckoning

Wiki

RoR Wiki

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, a SystemData.AlertContainer value. Fractions are dropped.
enabled
boolean – true to show alerts of this type, false to hide them.
cooldown
number – Cooldown for this alert type. The stock UI passes milliseconds. Fractions are dropped.

Returns

Nothing.

Details

  • With enabled = true the type's enabled flag is set and cooldown becomes its cooldown. The previous cooldown value is kept in a second slot.
  • With enabled = false only the enabled flag is cleared; cooldown is ignored and the stored cooldown is left alone.
  • alertType is not range-checked. Use only the SystemData.AlertContainer values.
  • enabled must be a real boolean. Passing nil or 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 )

See also