API:GetScenarioQueueData
From RoR Wiki
UI Lua API · Scenario functions
Version: WAR 1.4.8
Returns the scenario queues the player is currently in, or nothing if the player is not queued.
queueData = GetScenarioQueueData()
Arguments
None.
Returns
- queueData
table– Queue table (see below), or nothing when the player is in no queue.
| Key | Type | Meaning |
|---|---|---|
totalQueuedScenarios |
number |
Number of queue entries. |
[1] … [n] |
table |
One table per queue entry, see below. |
Each queue entry:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Id of the queued scenario. |
grouped |
boolean |
– |
type |
number |
Queue type. The stock UI passes it together with id to EA_Window_OverheadMap.GetQueueName to build the entry's name.
|
Details
- The stock UI uses the
nilresult as the "not queued" test (for example to stop the glow animation on the overhead map's queue button). - A new table is built on every call.
Errors
None.
Example
From default/ea_overheadmapwindow/source/overheadmapwindow.lua:
local queueData = GetScenarioQueueData()
if( queueData ~= nil) then
EA_Window_ContextMenu.CreateContextMenu( SystemData.ActiveWindow.name )
local queueCount = queueData.totalQueuedScenarios
for index = 1, queueCount do
local queueName = EA_Window_OverheadMap.GetQueueName( queueData[index].type, queueData[index].id )
...
end
