API:CurrentEventsGetTimers
From RoR Wiki
UI Lua API · LiveEvent functions
Version: WAR 1.4.8
Returns the two jump-cooldown timers of the Current Events window.
playerCooldown, cooldownLength = CurrentEventsGetTimers()
Arguments
None.
Returns
- playerCooldown
number– The stock UI treats this as the player's remaining jump cooldown in seconds;0means the player can jump.- cooldownLength
number– The stock UI treats this as the length of the jump cooldown in seconds, and shows it in minutes.
Details
- Both values are stored as single-precision floats and returned as numbers.
- If the current-events data is not available, the function returns nothing.
- The stock UI uses the same function,
EA_Window_CurrentEvents.OnJumpTimerUpdated, to handle this function's result and theSystemData.Events.CURRENT_EVENTS_JUMP_TIMER_UPDATEDevent.
Errors
None.
Example
From default/ea_currenteventswindow/source/currenteventswindow.lua:
EA_Window_CurrentEvents.OnJumpTimerUpdated( CurrentEventsGetTimers() )
...
function EA_Window_CurrentEvents.OnJumpTimerUpdated( playerCurrentTimerSeconds, jumpCooldownTimerSeconds )
m_playerCurJumpCooldownTimerSeconds = playerCurrentTimerSeconds
m_jumpCooldownTimerHours = jumpCooldownTimerSeconds / TimeUtils.SECONDS_PER_HOUR
m_jumpCooldownTimerMinutes = jumpCooldownTimerSeconds / TimeUtils.SECONDS_PER_MINUTE
local jumpDisabled = m_playerCurJumpCooldownTimerSeconds ~= 0
...
