Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-26-24, 05:56 AM   #1
Avastos
A Defias Bandit
Join Date: May 2024
Posts: 2
Tab-Content won't hide in combat

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:
  1. function MyOnload(self)
  2. -- register stuff ...
  3.     self.selectedTab = 1;
  4.     PanelTemplates_SetNumTabs(self, 4);
  5.     PanelTemplates_UpdateTabs(self);
  6. end

ShowPanel-function
Lua Code:
  1. function MyAddon_ShowPanel(self, tabNo)
  2.     PanelTemplates_UpdateTabs(self);
  3.     for i = 1,4 do
  4.         g=_G["My_Panel"..i];
  5.         g:Hide();
  6.     end
  7.  
  8.     g=_G["My_Panel"..tabNo];
  9.     g:Show();
  10.     UpdateScrollFrame(Panel2_Scrollframe);
  11.     UpdateScrollFramePanel3(Panel3_Scrollframe);
  12.     UpdateScrollFramePanel4(Panel4_Scrollframe);
  13. end

What I noticed:
The active panel while entering combat will never be hidden.
So every time i checked something like:
Lua Code:
  1. if _G["My_Panel"..1]:IsShown() then
  2.         print("Panel is shown")
  3.     end

The frozen panel is always visible.

To make it clear: everything works fine out of combat.

Did I miss something?
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Tab-Content won't hide in combat


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off