API:GameData.GetScenarioGroupReservations
From RoR Wiki
UI Lua API · Scenario functions
Version: WAR 1.4.8
Returns the reserved slots of the scenario groups in the current scenario (or city siege instance).
reservations = GameData.GetScenarioGroupReservations()
Arguments
None.
Returns
- reservations
table– Array of slot tables, indexed from 1, or nothing if the client has no scenario data.
Each slot table has these fields:
| Key | Type | Meaning |
|---|---|---|
sgroupindex |
number |
Scenario group of the reserved slot. |
sgroupslotnum |
number |
Slot number within that group. |
Details
- When
GameData.Player.isInSiegeis true the client reads the city instance's data; otherwise it reads the scenario's data. If that data does not exist, the function returns nothing. - The list is passed on as the client stored it; it is not checked against GameData.GetScenarioPlayerGroups.
Errors
None.
Example
From default/ea_scenariogroupwindow/source/scenariogroupwindow.lua:
ScenarioGroupWindow.slotReservationData = GameData.GetScenarioGroupReservations()
if( ScenarioGroupWindow.slotReservationData ~= nil ) then
for index, slot in ipairs( ScenarioGroupWindow.slotReservationData ) do
local groupIndex = slot.sgroupindex
local groupSlotNum = slot.sgroupslotnum
