API:TextEditBoxGetHistory
From RoR Wiki
UI Lua API · TextEditBox functions
Version: WAR 1.4.8
Returns the input history of a TextEditBox.
history = TextEditBoxGetHistory(editBoxName)
Arguments
- editBoxName
string– Name of a TextEditBox window.
Returns
- history
wstring-table– Array of the stored history lines, indexed from 1. An empty table if there is no history.
Details
- A TextEditBox with history enabled stores each non-empty line the player confirms with Enter, and the player can step back through the stored lines.
- The table can be passed back to TextEditBoxSetHistory later, which is how the chat window keeps its history across logins.
Errors
Error in function call 'TextEditBoxGetHistory': Window %s does not existError in function call 'TextEditBoxGetHistory': Window %s is not a TextEditBox
Example
From ea_chatwindow/source/chatwindow.lua:
function EA_ChatWindow.Shutdown()
EA_ChatWindow.SaveSettings()
-- Retrieve the history (this preserves it across logging in/out)
GameData.ChatData.history = TextEditBoxGetHistory("EA_TextEntryGroupEntryBoxTextInput")
end
