Doing it the proper (Seerah) way it would be:
Code:
if not CommunitiesFrame or not CommunitiesFrame:IsShown() then
ToggleGuildFrame()
end
CommunitiesFrame:SetDisplayMode(COMMUNITIES_FRAME_DISPLAY_MODES.ROSTER)
Although they both end up doing the same thing, my way adds 2 additional function calls (GetScript and the OnClick call).
XML for the roster tab:
Code:
<CheckButton name="CommunitiesRosterTabTemplate" hidden="true" inherits="CommunitiesFrameTabTemplate" virtual="true">
<KeyValues>
<KeyValue key="tooltip" value="COMMUNITIES_ROSTER_TAB_TOOLTIP" type="global"/>
</KeyValues>
<Scripts>
<OnLoad>
self.Icon:SetTexture("Interface\\Icons\\achievement_guildperk_everybodysfriend");
</OnLoad>
<OnClick inherit="append">
self:GetParent():SetDisplayMode(COMMUNITIES_FRAME_DISPLAY_MODES.ROSTER);
</OnClick>
</Scripts>
</CheckButton>