WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Classic - AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=179)
-   -   Using ToggleGuildFrame() inside an addon (https://www.wowinterface.com/forums/showthread.php?t=57479)

kernighan 09-12-19 05:53 PM

Using ToggleGuildFrame() inside an addon
 
I have a guild related addon, and for some reason, ToggleGuildFrame() doesn't do anything when executed inside of it, but if I execute ToggleGuildFrame() via a macro, it opens up the social tab (albeit on Groups tab rather than the guild tab, not sure how to tell it which subtab to pick).

In any case, I've got print statements in the code, and can confirm it gets to the code to execute ToggleGuildFrame, but nothing happens. Any idea on how I can get this to work?

Code:

function TitanPanelGuildButton_OnClick(self, button)
        -- open the guild pane on a left click
        print("Got a click");
        if ( button == "LeftButton" and not IsControlKeyDown()) then
            print("button is left button");
                if (not FriendsFrame:IsVisible()) then
                    print("Toggling guild frame");
                    ToggleGuildFrame();
                    print("Friends Frame update");
                    --ToggleFriendsFrame(TITAN_GUILD_TAB_NUMBER);
                    FriendsFrame_Update();
                elseif (FriendsFrame:IsVisible()) then
                        ToggleGuildFrame();
                        --ToggleFriendsFrame(TITAN_GUILD_TAB_NUMBER);
                end
        elseif ( button == "LeftButton" and IsControlKeyDown()) then
                -- forcing an update, since auto-update might be off
                FriendsFrame:UnregisterEvent("GUILD_ROSTER_UPDATE");
                if (IsInGuild()) then
                        GuildRoster();
                end
                FriendsFrame:RegisterEvent("GUILD_ROSTER_UPDATE");
                TitanPanelGuildButton_ListInitMaster();
        end
       
        GUILD_THIS = self;
end

Thanks!


All times are GMT -6. The time now is 10:01 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI