Thread Tools Display Modes
04/24/14, 12:41 PM   #1
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
Did you notice this SetHidden behaviour ?

Hello

I notice on my frame I want to show interactively something with SetHidden(false) but it does not show up, until I close and show again the main frame, technically the component is here but invisible and the IsHidden() is reporting false, so it is just invisible

Developped few mods in WoW and warhammer and I did not notice a single time this issue, so what the heck under this ???
  Reply With Quote
04/24/14, 12:50 PM   #2
archpoet
Cunning Linguist
 
archpoet's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 19
Without seeing any code, based entirely on your description it sounds like you're checking IsHidden() on the Parent instead of the hidden child.

Something else that's been pointed out to me, however, is that when the main frame IsHidden(true) it is no longer able to continue any background processes. It's almost like a "freeze," because they resume again OnShow()

Good Luck.
  Reply With Quote
04/24/14, 12:52 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
In ESO, as in WoW, children inherit the show-state of their parent. If you have the parent set to hide, then the child will hide as well.
  Reply With Quote
04/24/14, 01:21 PM   #4
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
//edit: Found the workaround anyway it is to change the parent to another control but it is not really explaining why the API returns hidden while the control was visible on screen

In wow if you test this the header is hidden and IsHidden would return true

In Eso, the frame is NOT hidden and IsHidden returns true (well to say true: it is hidden but still visible on your screen)

To use, run /buggy to show the global frame + header and /buggy2 supposed to hide the header

Code:
local frameGlobal     = CreateControl(nil, GuiRoot,        CT_TOPLEVELCONTROL)
local frameHeader     = CreateControl(nil, frameGlobal,    CT_TOPLEVELCONTROL)
local backdropHeader  = CreateControl(nil, frameHeader,    CT_BACKDROP)

frameGlobal:SetHeight(500)
frameGlobal:SetWidth(1024)
frameGlobal:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, 512 , 250)

frameHeader:SetHeight(50)
frameHeader:SetAnchor(TOPLEFT, frameGlobal, TOPLEFT, 0 , 0)
frameHeader:SetAnchor(TOPRIGHT, frameGlobal, TOPRIGHT, 0 , 0)

backdropHeader:SetAnchorFill(frameHeader)
backdropHeader:SetEdgeColor(1, 1, 1, 1)
backdropHeader:SetEdgeTexture("", 128, 1, 1, 0)
backdropHeader:SetCenterColor(128/255, 128/255, 128/255, 1)
backdropHeader:SetCenterTexture("", 16, 0)
backdropHeader:SetInsets(5, 5, -5, -5)

frameGlobal:SetHidden(true)

SLASH_COMMANDS["/buggy"] = function() frameGlobal:SetHidden(false) end
SLASH_COMMANDS["/buggy2"] = function() frameHeader:SetHidden(true) d("frameHeader:IsHidden(): "..tostring(frameHeader:IsHidden())) end

Last edited by Fathis Ules : 04/24/14 at 01:51 PM.
  Reply With Quote
04/24/14, 02:45 PM   #5
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
Originally Posted by Fathis Ules View Post
Hello

I notice on my frame I want to show interactively something with SetHidden(false) but it does not show up, until I close and show again the main frame, technically the component is here but invisible and the IsHidden() is reporting false, so it is just invisible

Developped few mods in WoW and warhammer and I did not notice a single time this issue, so what the heck under this ???
SetHidden is not the only way to hide something. Try SetAlpha(1)
  Reply With Quote
04/24/14, 02:54 PM   #6
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
yeah thanks , seems to do the trick with SetAlpha, still can't believe a so simple API than SetHidden() is so buggy ;(

Last edited by Fathis Ules : 04/24/14 at 02:58 PM.
  Reply With Quote
04/25/14, 04:43 PM   #7
ckaotik
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 12
Originally Posted by BadVolt View Post
SetHidden is not the only way to hide something. Try SetAlpha(1)
This. This absolutely is very very annoying. What I noticed as the reason for alpha=0 in my case was that the default UI runs animations on things and those don't reset cleanly.

Code:
ComparativeTooltip1.showAnimation:PlayFromStart() -- fade in animation, sets alpha to 1
ComparativeTooltip1.showAnimation:PlayFromEnd() -- fade out animation, sets alpha to 0 but doesn't touch :IsHidden()
  Reply With Quote
04/26/14, 11:17 AM   #8
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
It don't looks like a bug, more like a feature.
Since SetHidden is bool, and SetAlpha is float and can get variables between 0-1. Moreover, you will surely want to hide some element with alpha 0.5. If SetHidden will change alpha value, you will have to return it manually after each hide.
  Reply With Quote
04/26/14, 12:22 PM   #9
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
Go check properties for the controls and look at the ones for inheriting ?

Edit: actually, it's because you defined your header frame as a top level control, which doesn't inherit hidden. Change it to a different control that is supposed to inherit properties.

Last edited by Stormknight : 04/26/14 at 12:26 PM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Did you notice this SetHidden behaviour ?

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