Hey guys,
I'm new to wow-addon-development.
Currently I'm learning to create addons for WoW 3.3.5a.
As a base I used this tutorial
https://wowwiki-archive.fandom.com/w...tabbed_windows .
Right now the addon has 4 Tabs, in Tab 2-4 are scrollframes (FauxScrollFrameTemplate).
Everything is working fine if the player is not in combat.
If the player enters combat the current tab and its content is "stuck".
For example:
I'm currently reading the content from tab 4 and get attacked (-> enter combat), if i click on another tab, the content from tab 4 will overlay the content from the other tab.
And the content won't update until the combat ist over.
The tab template:
Code:
<Button name="MyTab_Tab" inherits="CharacterFrameTabButtonTemplate" virtual="true">
<Scripts>
<OnClick>PlaySound("igMainMenuOpen");
PanelTemplates_Tab_OnClick(self, My_Mainframe);
MyAddon_ShowPanel(self, My_Mainframe.selectedTab);</OnClick>
</Scripts>
</Button>
The Tabs:
Code:
<Button name="$parentTab1" inherits="MyTab_Tab" id="1" text="Tab 1">
<Anchors>
<Anchor point="CENTER" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="50" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="$parentTab2" inherits="MyTab_Tab" id="2" text="Tab 2">
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTab1" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-14" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
....
Onload-function
Lua Code:
function MyOnload(self)
-- register stuff ...
self.selectedTab = 1;
PanelTemplates_SetNumTabs(self, 4);
PanelTemplates_UpdateTabs(self);
end
ShowPanel-function
Lua Code:
function MyAddon_ShowPanel(self, tabNo)
PanelTemplates_UpdateTabs(self);
for i = 1,4 do
g=_G["My_Panel"..i];
g:Hide();
end
g=_G["My_Panel"..tabNo];
g:Show();
UpdateScrollFrame(Panel2_Scrollframe);
UpdateScrollFramePanel3(Panel3_Scrollframe);
UpdateScrollFramePanel4(Panel4_Scrollframe);
end
What I noticed:
The active panel while entering combat will never be hidden.
So every time i checked something like:
Lua Code:
if _G["My_Panel"..1]:IsShown() then
print("Panel is shown")
end
The frozen panel is always visible.
To make it clear: everything works fine out of combat.
Did I miss something?