API:BuyBackpackSlots
From RoR Wiki
UI Lua API · Item functions
Version: WAR 1.4.8
Asks the server to sell the player the next set of backpack slots.
BuyBackpackSlots()
Arguments
None.
Returns
Nothing.
Details
- The request is only sent when all of these are true:
- there is a player object;
- the player still has backpack slots left to buy;
- the cost of the next set of backpack slots is not more than the player's money as the client last received it.
- Otherwise the call does nothing. No message is shown.
- The client sends the cost it knows for the purchase with the request. The new slots appear when the server answers.
- There is no confirmation in the client. The stock backpack window checks
GameData.Player.moneyitself before calling. - Any arguments are ignored.
Errors
None.
Example
From default/ea_backpackwindow/source/backpackiconview.lua:
if( GameData.Player.money < pocketCost )
then
DialogManager.MakeOneButtonDialog( GetString( StringTables.Default.DIALOG_CANNOT_BUY_BACKPACK_SLOTS), GetString( StringTables.Default.LABEL_OKAY ) )
return
end
BuyBackpackSlots()
