cityrp.favorites
Client-side item favourites, shared by every item browser (inventory, market). Favourites are stored per-client in PData, keyed by item uniqueID, so a star set in one panel shows up in the other.
- Clientcityrp.favorites.Get() → table<string, boolean>Source ☍
-
Get the favourites set, loading it from PData on first use. The table is the live one -- read from it, but go through Set/Toggle to change it.
Returns
- table<string, boolean>Keyed by item uniqueID.
- Clientcityrp.favorites.IsFavorite(uniqueID) → booleanSource ☍
-
Check whether an item is favourited.
Parameters
- uniqueIDstring?The item uniqueID to check.
Returns
- boolean
- Clientcityrp.favorites.Set(uniqueID, state) → booleanSource ☍
-
Set an item's favourite state and persist it. Fires the
cityrp_FavoritesChangedhook when the state actually changed, so open panels can refresh a favourites-filtered list they are already showing.Parameters
- uniqueIDstringThe item uniqueID.
- statebooleanWhether the item should be favourited.
Returns
- booleanIf the stored state changed.
- Clientcityrp.favorites.Toggle(uniqueID) → booleanSource ☍
-
Flip an item's favourite state.
Parameters
- uniqueIDstringThe item uniqueID.
Returns
- booleanThe state the item is now in.
- Clientcityrp.favoritesSource ☍