Skip to main content

PlayerSettingsUtils

Utility helpers to work with settings.

Functions​

create​

PlayerSettingsUtils.create() → Folder

Creates a new player settings

getAttributeName​

PlayerSettingsUtils.getAttributeName(settingName: string) → string

Gets the attribute name for a setting

getSettingName​

PlayerSettingsUtils.getSettingName(attributeName: string) → string

Gets the settings name from an attribute. May return a string that cannot be loaded into datastore.

isSettingAttribute​

PlayerSettingsUtils.isSettingAttribute(attributeName: string) → string

Returns true if the attribute name is a settings attribute

encodeForNetwork​

PlayerSettingsUtils.encodeForNetwork(settingValue: any) → any

Encodes a given value for network transfer

decodeForNetwork​

PlayerSettingsUtils.decodeForNetwork(settingValue: any) → any

Decodes a given value from network transfer

decodeForAttribute​

PlayerSettingsUtils.decodeForAttribute(settingValue: any) → any

Decodes a given value for attribute storage

encodeForAttribute​

PlayerSettingsUtils.encodeForAttribute(settingValue: any) → any

Encodes a given value for attribute storage

Show raw api
{
    "functions": [
        {
            "name": "create",
            "desc": "Creates a new player settings",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Folder"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 22,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "getAttributeName",
            "desc": "Gets the attribute name for a setting",
            "params": [
                {
                    "name": "settingName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 36,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "getSettingName",
            "desc": "Gets the settings name from an attribute. May return a string\nthat cannot be loaded into datastore.",
            "params": [
                {
                    "name": "attributeName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 50,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "isSettingAttribute",
            "desc": "Returns true if the attribute name is a settings attribute",
            "params": [
                {
                    "name": "attributeName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 62,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "encodeForNetwork",
            "desc": "Encodes a given value for network transfer",
            "params": [
                {
                    "name": "settingValue",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 74,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "decodeForNetwork",
            "desc": "Decodes a given value from network transfer",
            "params": [
                {
                    "name": "settingValue",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 92,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "decodeForAttribute",
            "desc": "Decodes a given value for attribute storage",
            "params": [
                {
                    "name": "settingValue",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 108,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        },
        {
            "name": "encodeForAttribute",
            "desc": "Encodes a given value for attribute storage",
            "params": [
                {
                    "name": "settingValue",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 122,
                "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerSettingsUtils",
    "desc": "Utility helpers to work with settings.",
    "source": {
        "line": 7,
        "path": "src/settings/src/Shared/Player/PlayerSettingsUtils.lua"
    }
}