API:GetNumTacticsSlots
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Returns how many tactic slots of each type the player has.
slots = GetNumTacticsSlots()
Arguments
None.
Returns
- slots
table– Table with the keys0,1and2, one per tactic type. Each value is the number of slots (number) of that type.
Details
- The keys start at 0, not 1. The stock UI indexes the table with a tactic type and loops from
GameData.TacticType.FIRSTtoGameData.TacticType.NUM_TYPES. - If there is no player object, the table is empty.
- If the Lua state is not available, the function returns nothing.
Errors
None.
Example
Creating one button per slot, from ea_tacticswindow/source/tacticswindow.lua:
self.tacticsSlots = GetNumTacticsSlots ();
...
for slotType = GameData.TacticType.FIRST, GameData.TacticType.NUM_TYPES do
for i = 1, self.tacticsSlots[slotType] do
local button = self:CreateButton (slotType);
From easystem_actionbarclustermanager/source/newabilityhandler.lua:
local tacticsSlots = GetNumTacticsSlots () local availableSlots = tacticsSlots[newAbility.tacticType] -- Begins at the maximum!
