cityrp.settings
Client-side settings registry for the CityRP settings panel. Plugins register categories and individual settings here; the player_settings plugin renders them in a unified GUI. Existing ConVars, cookies, and chat commands are wired through rather than replaced.
- Clientcityrp.settings.CanSeeStaffSettings() → booleanSource ☍
-
Returns whether the local player can see staff-only settings.
Returns
- booleanTrue when the player is a trial mod or above.
- Clientcityrp.settings.Close()Source ☍
-
Closes the settings panel when it is open.
- Clientcityrp.settings.GetCategoryEntries(categoryId) → CityRPSettingsEntry[]Source ☍
-
Returns settings for a category that are visible to the local player.
Parameters
- categoryIdstringCategory identifier.
Returns
- CityRPSettingsEntry[]Visible settings for the category.
- Clientcityrp.settings.GetVisibleCategories() → CityRPSettingsCategory[]Source ☍
-
Returns categories visible to the local player, sorted by order then name.
Returns
- CityRPSettingsCategory[]Visible categories.
- Clientcityrp.settings.Open()Source ☍
-
Opens the settings panel, creating it when needed.
- Clientcityrp.settings.Register(entry) → booleanSource ☍
-
Registers a single setting row in the unified settings panel.
Parameters
- entryCityRPSettingsEntrySetting definition.
Returns
- booleanFalse when the id was already taken.
- Clientcityrp.settings.RegisterCategory(id, name, order, staffOnly)Source ☍
-
Registers a sidebar category for grouping settings.
Parameters
- idstringUnique category identifier.
- namestringDisplay name shown in the sidebar.
- ordernumber?Sort order (lower appears first).
- staffOnlyboolean?When true, only trial mods and above see this category.
- Clientcityrp.settings.Search(query) → CityRPSettingsSearchResult[]Source ☍
-
Returns visible settings matching a query, grouped by category in sidebar order. Matches case-insensitive plain text against the label, description, ConVar and category name; headers and labels are layout rather than settings, so they are never returned.
Parameters
- querystringText to search for.
Returns
- CityRPSettingsSearchResult[]Matches per category; empty for a blank query.
- Clientcityrp.settings.Toggle()Source ☍
-
Toggles the settings panel open or closed.
- ClientCityRPSettingsCategory.idSource ☍
-
Unique category identifier.
- ClientCityRPSettingsCategory.nameSource ☍
-
Display name shown in the sidebar.
- ClientCityRPSettingsCategory.orderSource ☍
-
Sort order (lower appears first).
- ClientCityRPSettingsCategory.staffOnlySource ☍
-
When true, only trial mods and above see this category.
- ClientCityRPSettingsEntry.actionSource ☍
-
Callback for button-type entries.
- ClientCityRPSettingsEntry.categorySource ☍
-
Category id this entry belongs to.
- ClientCityRPSettingsEntry.choicesSource ☍
-
Combo options as
{label = string, value = string}rows, or a resolver. - ClientCityRPSettingsEntry.convarSource ☍
-
Client ConVar name for checkbox, slider, combo, and text types.
- ClientCityRPSettingsEntry.decimalsSource ☍
-
Decimal places for sliders.
- ClientCityRPSettingsEntry.descriptionSource ☍
-
Secondary help text.
- ClientCityRPSettingsEntry.hintKeySource ☍
-
Hint registry key for hint-type entries.
- ClientCityRPSettingsEntry.idSource ☍
-
Unique setting identifier.
- ClientCityRPSettingsEntry.labelSource ☍
-
Primary label for the control.
- ClientCityRPSettingsEntry.maxSource ☍
-
Maximum value for sliders.
- ClientCityRPSettingsEntry.minSource ☍
-
Minimum value for sliders.
- ClientCityRPSettingsEntry.onSelectSource ☍
-
Callback for combo rows without a convar.
- ClientCityRPSettingsEntry.orderSource ☍
-
Sort order within a category (lower appears first).
- ClientCityRPSettingsEntry.staffOnlySource ☍
-
When true, only trial mods and above see this entry.
- ClientCityRPSettingsEntry.typeSource ☍
-
One of: header, label, checkbox, slider, combo, button, hint, text.
- ClientCityRPSettingsEntry.visibleSource ☍
-
Optional visibility predicate evaluated when building the panel.