Skip to content

GetPlayerInterface

Who draws a component of a player’s screen - what was asked for and what draws it.

Two words: what the mode asked for and what actually draws the component. With the "native" and "hidden" drawers they are always the same word. What the mode asked for is the player’s own setting, else the one made for everyone, else "native"; for the party it is the party frames’ switch (ShowPartyFrames, [party] frames). nil and the reason - "not connected" or "unknown component 'x'" - for a player who is not connected or a component that does not exist.

With a web drawer ("default" or a frame’s name, for the components that have one) the second word is what the player’s game says draws it now: the same word while the web layer draws it, "native" while it cannot (the web layer is off or failed, the page is not ready yet) - and "native" until the game has said anything. Before the interface’s own [components.<name>] drawer, what was asked for is the mode’s setting for the player, else for everyone.

GetPlayerInterface(pid, component)
Parameter Type
pid number the player
component string the component’s name, as in SetPlayerInterface

string | nil, string - the two words requested, effective ("native" or "hidden"); nil and the reason when the player or the component does not exist

-- /plates: a player switches the name plates over heads off and on for themselves
function OnPlayerCommandText(pid, cmd, args)
if cmd == "plates" then
local _, effective = GetPlayerInterface(pid, "nameplates")
SetPlayerInterface(pid, "nameplates", effective == "hidden" and "native" or "hidden")
return true
end
return false
end

SetPlayerInterface · SetInterfaceForAll · ShowPartyFrames · the Interface group of the index