Anvil
Anvil.API.NuiBind< T > Class Template Reference

A NUI property binding that can be updated after being sent to the client. More...

+ Inheritance diagram for Anvil.API.NuiBind< T >:
+ Collaboration diagram for Anvil.API.NuiBind< T >:

Public Member Functions

 NuiBind (string key)
 
T? GetBindValue (NwPlayer player, int uiToken)
 Queries the specified player for the value of this binding. More...
 
List< T >? GetBindValues (NwPlayer player, int uiToken)
 Queries the specified player for the array of values assigned to this binding. More...
 
void SetBindValue (NwPlayer player, int uiToken, T value)
 Assigns a value to the binding for the specified player. More...
 
void SetBindValues (NwPlayer player, int uiToken, IEnumerable< T > values)
 Assigns an array of values to the binding for the specified player. More...
 
void SetBindWatch (NwPlayer player, int uiToken, bool watch)
 Marks this property as watched/un-watched.
A watched bind will invoke the NUI script event every time its value changes. More...
 

Properties

string Key [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Anvil.API.NuiProperty< T >
static NuiBind< T > CreateBind (string key)
 Creates a Nui variable binding that can be changed at runtime. More...
 
static NuiValue< T > CreateValue (T value)
 Creates a readonly Nui variable that cannot be changed at runtime. More...
 
static implicit operator NuiProperty< T > (T value)
 

Detailed Description

A NUI property binding that can be updated after being sent to the client.

Template Parameters
TThe type of value being bound.

Member Function Documentation

◆ GetBindValue()

T? Anvil.API.NuiBind< T >.GetBindValue ( NwPlayer  player,
int  uiToken 
)
inline

Queries the specified player for the value of this binding.

Parameters
playerThe player to query.
uiTokenThe associated UI token.
Returns
The current value of the binding.

◆ GetBindValues()

List<T>? Anvil.API.NuiBind< T >.GetBindValues ( NwPlayer  player,
int  uiToken 
)
inline

Queries the specified player for the array of values assigned to this binding.

Parameters
playerThe player to query.
uiTokenThe associated UI token.
Returns
The current values of the binding.

◆ SetBindValue()

void Anvil.API.NuiBind< T >.SetBindValue ( NwPlayer  player,
int  uiToken,
value 
)
inline

Assigns a value to the binding for the specified player.

Parameters
playerThe player whose binding will be updated.
uiTokenThe unique UI token to be updated.
valueThe new value to assign.

◆ SetBindValues()

void Anvil.API.NuiBind< T >.SetBindValues ( NwPlayer  player,
int  uiToken,
IEnumerable< T >  values 
)
inline

Assigns an array of values to the binding for the specified player.

Parameters
playerThe player whose binding will be updated.
uiTokenThe unique UI token to be updated.
valuesThe new value to assign.

◆ SetBindWatch()

void Anvil.API.NuiBind< T >.SetBindWatch ( NwPlayer  player,
int  uiToken,
bool  watch 
)
inline

Marks this property as watched/un-watched.
A watched bind will invoke the NUI script event every time its value changes.

Parameters
playerThe player whose binding will be updated.
uiTokenThe unique UI token to be updated.
watchTrue if the value should be watched, false if it should not be watched.

The documentation for this class was generated from the following file: