Skip to main content

SettingsDataService

Shared between client and server, letting us centralize definitions in one place.

Functions

Init

SettingsDataService:Init(serviceBagServiceBag) → ()

Initializes the shared registry service. Should be done via ServiceBag.

RegisterSettingDefinition

SettingsDataService:RegisterSettingDefinition(definitionSettingDefinition) → callback--

Cleanup callback

Registers settings definitions

ObserveRegisteredDefinitionsBrio

SettingsDataService:ObserveRegisteredDefinitionsBrio() → Observable<Brio<SettingDefinition>>

Observes the registered definitions

ObservePlayerSettings

SettingsDataService:ObservePlayerSettings(playerPlayer) → Observable<PlayerSettingsBase>

Observes the player's settings

ObservePlayerSettingsBrio

SettingsDataService:ObservePlayerSettingsBrio(playerPlayer) → Observable<Brio<PlayerSettingsClient>>

Observes the player settings in a brio

PromisePlayerSettings

SettingsDataService:PromisePlayerSettings(
playerPlayer,
cancelTokenCancelToken
) → Promise<PlayerSettingsBase>

Promises the player's settings

GetPlayerSettings

SettingsDataService:GetPlayerSettings(playerPlayer) → Promise<PlayerSettingsBase>

Gets the player's settings

Destroy

SettingsDataService:Destroy() → ()

Cleans up the shared registry service

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initializes the shared registry service. Should be done via [ServiceBag].",
            "params": [
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 26,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "RegisterSettingDefinition",
            "desc": "Registers settings definitions",
            "params": [
                {
                    "name": "definition",
                    "desc": "",
                    "lua_type": "SettingDefinition"
                }
            ],
            "returns": [
                {
                    "desc": "Cleanup callback",
                    "lua_type": "callback"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 100,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "ObserveRegisteredDefinitionsBrio",
            "desc": "Observes the registered definitions",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<SettingDefinition>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 111,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "ObservePlayerSettings",
            "desc": "Observes the player's settings",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<PlayerSettingsBase>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 122,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "ObservePlayerSettingsBrio",
            "desc": "Observes the player settings in a brio",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<PlayerSettingsClient>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 134,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "PromisePlayerSettings",
            "desc": "Promises the player's settings",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "cancelToken",
                    "desc": "",
                    "lua_type": "CancelToken"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<PlayerSettingsBase>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 145,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "GetPlayerSettings",
            "desc": "Gets the player's settings",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<PlayerSettingsBase>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 161,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the shared registry service",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 170,
                "path": "src/settings/src/Shared/SettingsDataService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SettingsDataService",
    "desc": "Shared between client and server, letting us centralize definitions in one place.",
    "source": {
        "line": 6,
        "path": "src/settings/src/Shared/SettingsDataService.lua"
    }
}