Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LogDisplayIsScrolledToBottom

From RoR Wiki

UI Lua API · LogDisplay functions
Version: WAR 1.4.8

Returns whether a LogDisplay window is scrolled all the way down.

atBottom = LogDisplayIsScrolledToBottom(displayName)

Arguments

displayName
string – Name of a LogDisplay window.

Returns

atBottom
boolean – true if the scroll position is at the end of the content.

Details

  • A display without a scroll bar always returns false.

Errors

  • Error in function call 'TextLogDisplayIsScrolledToBottom': Window %s does not exist
  • Error in function call 'TextLogDisplayIsScrolledToBottom': Window %s is not a TextLogDisplay

Example

Blinking a "new text" alert while the player has scrolled up, from ea_chatwindow/source/chatwindow.lua:

local scrolledDown = LogDisplayIsScrolledToBottom( activeTabName.."TextLog" )
local alertWindowName = activeTabName.."TextLogToBottomButtonAlert"
if( scrolledDown == false ) then
    WindowSetShowing( alertWindowName, true )
    ...
end

See also