Anvil
Anvil.API.NuiWindowToken Struct Reference

Represents a NUI window instance for a certain player. More...

+ Inheritance diagram for Anvil.API.NuiWindowToken:
+ Collaboration diagram for Anvil.API.NuiWindowToken:

Public Member Functions

void Close ()
 Close this window instance. More...
 
void Dispose ()
 
bool Equals (NuiWindowToken other)
 
override bool Equals (object? obj)
 
T? GetBindValue< T > (NuiBind< T > bind)
 Gets the current value of the specified bind for this window instance. More...
 
List< T >? GetBindValues< T > (NuiBind< T > bind)
 Gets the current values of the specified bind for this window instance. More...
 
override int GetHashCode ()
 
T? GetUserData< T > ()
 Get the userdata of this token. More...
 
void SetBindValue< T > (NuiBind< T > bind, T value)
 Sets the current value of the specified bind for this window instance. More...
 
void SetBindValues< T > (NuiBind< T > bind, IEnumerable< T > values)
 Sets the current values of the specified bind for this window instance. More...
 
void SetBindWatch< T > (NuiBind< T > bind, bool watch)
 Marks the specified bind as watched/unwatched for this player. More...
 
void SetGroupLayout (NuiGroup group, NuiLayout newLayout)
 Applies the specified group layout for this player. More...
 
void SetUserData< T > (T userData)
 Sets an arbitrary json value as userdata on this token.
This userdata is not read or handled by the game engine and not sent to clients.
This mechanism only exists as a convenience for the programmer to store data bound to a windows' lifecycle.
Will do nothing if the window does not exist. More...
 

Static Public Member Functions

static bool operator!= (NuiWindowToken left, NuiWindowToken right)
 
static bool operator== (NuiWindowToken left, NuiWindowToken right)
 

Static Public Attributes

static NuiWindowToken Invalid = new NuiWindowToken(null!, -1)
 

Properties

Action< ModuleEvents.OnNuiEventOnNuiEvent
 
NwPlayer Player [get]
 The player associated with this token. More...
 
int Token [get]
 The window unique token for this player. More...
 
string WindowId [get]
 The user assigned window id of this token.
Creating a new window with the same window id will replace the existing window. More...
 

Detailed Description

Represents a NUI window instance for a certain player.

Member Function Documentation

◆ Close()

void Anvil.API.NuiWindowToken.Close ( )
inline

Close this window instance.

◆ GetBindValue< T >()

T? Anvil.API.NuiWindowToken.GetBindValue< T > ( NuiBind< T >  bind)
inline

Gets the current value of the specified bind for this window instance.

Parameters
bindThe bind value to query.
Template Parameters
TThe value type of the bind.
Returns
The current assigned value of the bind, otherwise the default value of T.

◆ GetBindValues< T >()

List<T>? Anvil.API.NuiWindowToken.GetBindValues< T > ( NuiBind< T >  bind)
inline

Gets the current values of the specified bind for this window instance.

Parameters
bindThe bind value to query.
Template Parameters
TThe value type of the bind.
Returns
The current assigned value of the bind, otherwise the default value of T.

◆ GetUserData< T >()

T? Anvil.API.NuiWindowToken.GetUserData< T > ( )
inline

Get the userdata of this token.

Template Parameters
TA serializable class structure matching the data to fetch.
Returns
The fetched data, or null if the window does not exist on the given player, or has no userdata set.

◆ SetBindValue< T >()

void Anvil.API.NuiWindowToken.SetBindValue< T > ( NuiBind< T >  bind,
value 
)
inline

Sets the current value of the specified bind for this window instance.

Parameters
bindThe bind value to assign.
valueThe new value.
Template Parameters
TThe value type of the bind.

◆ SetBindValues< T >()

void Anvil.API.NuiWindowToken.SetBindValues< T > ( NuiBind< T >  bind,
IEnumerable< T >  values 
)
inline

Sets the current values of the specified bind for this window instance.

Parameters
bindThe bind value to assign.
valuesThe new values.
Template Parameters
TThe value type of the bind.

◆ SetBindWatch< T >()

void Anvil.API.NuiWindowToken.SetBindWatch< T > ( NuiBind< T >  bind,
bool  watch 
)
inline

Marks the specified bind as watched/unwatched for this player.

Parameters
bind
watch
Template Parameters
T

◆ SetGroupLayout()

void Anvil.API.NuiWindowToken.SetGroupLayout ( NuiGroup  group,
NuiLayout  newLayout 
)
inline

Applies the specified group layout for this player.

Parameters
groupThe group to apply the layout.
newLayoutThe new layout.

◆ SetUserData< T >()

void Anvil.API.NuiWindowToken.SetUserData< T > ( userData)
inline

Sets an arbitrary json value as userdata on this token.
This userdata is not read or handled by the game engine and not sent to clients.
This mechanism only exists as a convenience for the programmer to store data bound to a windows' lifecycle.
Will do nothing if the window does not exist.

Parameters
userDataThe data to store.
Template Parameters
TThe type of data to store. Must be serializable to JSON.

Property Documentation

◆ Player

NwPlayer Anvil.API.NuiWindowToken.Player
get

The player associated with this token.

◆ Token

int Anvil.API.NuiWindowToken.Token
get

The window unique token for this player.

◆ WindowId

string Anvil.API.NuiWindowToken.WindowId
get

The user assigned window id of this token.
Creating a new window with the same window id will replace the existing window.


The documentation for this struct was generated from the following files: