Skip to main content

QALogsUIViewModel

ViewModel for the QALogsUI component.

local QALogsUIViewModel = Import("QALogsUIViewModel")

local visible = Value(false)
local viewModel = QALogsUIViewModel.new(visible)

viewModel:newLog("Client", {
	Message = "Hello World",
	Type = "MessageOutput",
})

-- to hide the UI
viewModel:close()

Functions

new

QALogsUIViewModel.new(
visibleValue--

Fusion value that controls the visibility of the UI

) → ()

close

QALogsUIViewModel:close() → ()

Closes the UI

_addNewLogEntry

QALogsUIViewModel:_addNewLogEntry(
logValueFusionValue,
infotable--

The log info

) → ()
local info = {
	Message = "Hello World",
	Type =  "MessageOutput", -- MessageType.Value
}

newLog

QALogsUIViewModel:newLog(
contextstring,--

Either "Client" or "Server"

infotable--

The log info

) → ()
local info = {
	Message = "Hello World",
	Type =  "MessageOutput", -- MessageType.Value
}

setServerAccess

QALogsUIViewModel:setServerAccess(
accessboolean--

Whether the player can access the server

) → ()

Sets the server access for the UI

This, effectively, just makes the server button in the UI visible or not.

If the player does not have access on the server side, then the button will not be visible.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "visible",
                    "desc": "Fusion value that controls the visibility of the UI",
                    "lua_type": "Value"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 37,
                "path": "src/qalogs/src/Client/QALogsUIViewModel.lua"
            }
        },
        {
            "name": "close",
            "desc": "Closes the UI",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 52,
                "path": "src/qalogs/src/Client/QALogsUIViewModel.lua"
            }
        },
        {
            "name": "_addNewLogEntry",
            "desc": "```lua\nlocal info = {\n\tMessage = \"Hello World\",\n\tType =  \"MessageOutput\", -- MessageType.Value\n}\n```",
            "params": [
                {
                    "name": "logValue",
                    "desc": "",
                    "lua_type": "FusionValue"
                },
                {
                    "name": "info",
                    "desc": "The log info",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 67,
                "path": "src/qalogs/src/Client/QALogsUIViewModel.lua"
            }
        },
        {
            "name": "newLog",
            "desc": "```lua\nlocal info = {\n\tMessage = \"Hello World\",\n\tType =  \"MessageOutput\", -- MessageType.Value\n}\n```",
            "params": [
                {
                    "name": "context",
                    "desc": "Either \"Client\" or \"Server\"",
                    "lua_type": "string"
                },
                {
                    "name": "info",
                    "desc": "The log info",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 102,
                "path": "src/qalogs/src/Client/QALogsUIViewModel.lua"
            }
        },
        {
            "name": "setServerAccess",
            "desc": "Sets the server access for the UI\n\nThis, effectively, just makes the server button in the UI visible or not.  \n\nIf the player does not have access on the server side, then the button will not be visible.",
            "params": [
                {
                    "name": "access",
                    "desc": "Whether the player can access the server",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 120,
                "path": "src/qalogs/src/Client/QALogsUIViewModel.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "QALogsUIViewModel",
    "desc": "ViewModel for the QALogsUI component.\n\n```lua\nlocal QALogsUIViewModel = Import(\"QALogsUIViewModel\")\n\nlocal visible = Value(false)\nlocal viewModel = QALogsUIViewModel.new(visible)\n\nviewModel:newLog(\"Client\", {\n\tMessage = \"Hello World\",\n\tType = \"MessageOutput\",\n})\n\n-- to hide the UI\nviewModel:close()\n```",
    "source": {
        "line": 21,
        "path": "src/qalogs/src/Client/QALogsUIViewModel.lua"
    }
}