Reference › Function reference › Platform

Platform.role.GetTalentGroupRoleObservation

public

Call as

addon.Platform:GetTalentGroupRoleObservation(group)

Available directly through addon; no dependency is needed.

What it does

Observe the first role result of the exact legacy GetTalentGroupRole(group) dot call on probe- and restricted-policy clients. Forward the readable selected group unchanged, including nil as one argument; do not infer group bounds, substitute another API or query a player unit. The complete legacy primary declaration is not established. Missing, failed, restricted, empty or malformed role data is unavailable; readable nonempty future strings remain exact.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).
groupanyLive selected talent-group argument, forwarded unchanged as one argument after readability checking.

Returns

1string | nilKnown nonempty role string, or nil when unavailable.
2string | nilPolicy, capability or required-observation availability reason.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
GetTalentGroupRoleClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

Example

local group = GetActiveTalentGroup and GetActiveTalentGroup()
local role = addon.Platform:GetTalentGroupRoleObservation(group)
if role == nil then return nil end
return role == "TANK"

Dependencies

Source

Platform/role.lua, line 96. Read only in game; Duplicate makes an editable copy.

Platform.role.GetTalentGroupRoleObservation(self, group)
    local policy=self:GetCombatDataPolicy()
    if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
    if not self:CanReadValue(group) then return nil,'restricted-value' end
    local query,reason=readField(self,_G,'GetTalentGroupRole')
    if reason then return nil,reason end
    if type(query)~='function' then return nil,'missing-api' end
    local ok,role=pcall(query,group)
    if not ok then return nil,'api-error' end
    return roleValue(self,role)

Back to Function reference