Thread Tools Display Modes
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
05-26-24, 06:05 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,974
There is no 3.3.5a version of wow available. We can't help with unofficial versions.

Current Official Versions of wow are :

The War Within Alpha if you have access to it and they have addons available
10.2.7 - Retail - Dragonflight and Mists of Pandaria Remix
4.4.0 - Classic - Cataclysm
1.15.2 - Classica Era - Season of Discovery and Hardcore Servers

The correct api info source is : https://warcraft.wiki.gg/wiki/Warcraft_Wiki

There are a few events that trigger before combat starts and as combat starts. I use the pre combat events myself to disable buttons and hide frames that shouldn't be interacted with during combat. I will leave that to you to investigate yourself.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-26-24, 06:26 AM   #3
Avastos
A Defias Bandit
Join Date: May 2024
Posts: 2
Thank you for your reply.

In my case the addon with all its tabs, panels and scrollframe should work in and out of combat. Like recount, skada and many other addons.
  Reply With Quote
05-26-24, 09:59 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,974
In that instance I will point you to some reading material https://warcraft.wiki.gg/wiki/Secure...n_and_Tainting and suggest you look at other addons to see how they do things and learn via example and practise.

That should now cover you for both out of combat and in combat options. Whether they will work for you is another kettle of fish. And as I mentioned before we won't be able to help you make/fix addons for an unofficial version of wow.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote

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

Thread Tools
Display Modes

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