Sinespace Client 2025.3.19431
Client-side scripting for Sinespace
SineSpace.Scripting.Player.SInventory Class Reference
Inheritance diagram for SineSpace.Scripting.Player.SInventory:
ScriptClass

Public Member Functions

override void Initialise (SScript runtime, object wrapper)
 
void Authorize (Closure onAuthorized=null, Closure onRejected=null)
 Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.
 
void Authorize (Action onAuthorized=null, Action onRejected=null)
 Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.
 
int CountCopiesOfItem (int itemID)
 Checks if the user owns a specified item.
 
void AddToHotbar (int index, int itemID)
 Adds the first found instance of itemID to the players first free hotbar entry.
 
void RemoveFromHotbar (int index)
 Adds the first found instance of itemID to the players first free hotbar entry.
 
void RequestRefresh ()
 Requests a refresh of the users inventory (can occur max once per 120 seconds). Requires authorization.
 
- Public Member Functions inherited from ScriptClass
void ReportError (string error, bool fatal, UnityEngine.Object target=null)
 
void Initialise (SScript runtime, object wrapper)
 

Properties

bool Authorized [get]
 
SInventoryItem[] Items [get]
 Returns the users current loaded inventory.
 
- Properties inherited from ScriptClass
virtual bool Alive [get]
 
DynValue CachedData [get, set]
 

Additional Inherited Members

- Protected Member Functions inherited from ScriptClass
void Initialise (SScript runtime)
 

Member Function Documentation

◆ AddToHotbar()

void SineSpace.Scripting.Player.SInventory.AddToHotbar ( int index,
int itemID )

Adds the first found instance of itemID to the players first free hotbar entry.

◆ Authorize() [1/2]

void SineSpace.Scripting.Player.SInventory.Authorize ( Action onAuthorized = null,
Action onRejected = null )

Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.

Parameters
onAuthorizedThe onAuthorized c# action.
onRejectedThe onRejected c# action.

◆ Authorize() [2/2]

void SineSpace.Scripting.Player.SInventory.Authorize ( Closure onAuthorized = null,
Closure onRejected = null )

Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.

Parameters
onAuthorizedThe onAuthorized lua callback.
onRejectedThe onRejected lua callback.

◆ CountCopiesOfItem()

int SineSpace.Scripting.Player.SInventory.CountCopiesOfItem ( int itemID)

Checks if the user owns a specified item.

Parameters
itemID
Returns
-1 if still loading inventory, number of items otherwise

◆ Initialise()

override void SineSpace.Scripting.Player.SInventory.Initialise ( SScript runtime,
object wrapper )

◆ RemoveFromHotbar()

void SineSpace.Scripting.Player.SInventory.RemoveFromHotbar ( int index)

Adds the first found instance of itemID to the players first free hotbar entry.

◆ RequestRefresh()

void SineSpace.Scripting.Player.SInventory.RequestRefresh ( )

Requests a refresh of the users inventory (can occur max once per 120 seconds). Requires authorization.

Property Documentation

◆ Authorized

bool SineSpace.Scripting.Player.SInventory.Authorized
get

◆ Items

SInventoryItem [] SineSpace.Scripting.Player.SInventory.Items
get

Returns the users current loaded inventory.