EQInterface Forums

EQInterface Forums (http://www.eqinterface.com/forums/index.php)
-   General authoring help / discussion (http://www.eqinterface.com/forums/forumdisplay.php?f=12)
-   -   Hiding with containers (http://www.eqinterface.com/forums/showthread.php?t=20169)

Halelen 12-22-2008 12:20 PM

Hiding with containers
 
Ok I am cleaning up some windows by hiding elements using containers. Currently working on the group window and pet health. Now I can get the 0 to disappear and only show when I have a pet problem is now the gauge doesnt show at all. Anyone of you xml geniuses have any advice for me? Here is the code I have so far


Code:
<Gauge item = "GW_PetGauge0"> <ScreenID>PetGauge0</ScreenID> <!--<Font>3</Font>--> <RelativePosition>true</RelativePosition> <TextOffsetY>-50</TextOffsetY> <GaugeOffsetY>-2</GaugeOffsetY> <FillTint> <R>0</R> <G>0</G> <B>240</B> </FillTint> <EQType>16</EQType> <GaugeDrawTemplate> <Background>A_GaugeBackground</Background> <Fill>A_GaugeFill</Fill> </GaugeDrawTemplate> <AutoStretch>true</AutoStretch> <TopAnchorOffset>21</TopAnchorOffset> <BottomAnchorOffset>30</BottomAnchorOffset> <LeftAnchorOffset>5</LeftAnchorOffset> <RightAnchorOffset>285</RightAnchorOffset> <RightAnchorToLeft>false</RightAnchorToLeft> </Gauge> <Gauge item="GW_ManaGauge0"> <ScreenID>ManaGauge0</ScreenID> <TextOffsetY>-50</TextOffsetY> <GaugeOffsetY>-2</GaugeOffsetY> <RelativePosition>true</RelativePosition> <FillTint> <R>0</R> <G>128</G> <B>255</B> </FillTint> <EQType>2</EQType> <GaugeDrawTemplate> <Fill>A_GaugeFill</Fill> </GaugeDrawTemplate> <AutoStretch>true</AutoStretch> <TopAnchorOffset>24</TopAnchorOffset> <BottomAnchorOffset>30</BottomAnchorOffset> <RightAnchorToLeft>false</RightAnchorToLeft> <LeftAnchorOffset>5</LeftAnchorOffset> <RightAnchorOffset>285</RightAnchorOffset> </Gauge> <Gauge item="GW_STAGauge0"> <ScreenID>STAGauge0</ScreenID> <TextOffsetY>-50</TextOffsetY> <GaugeOffsetY>-2</GaugeOffsetY> <RelativePosition>true</RelativePosition> <FillTint> <R>240</R> <G>240</G> <B>0</B> </FillTint> <EQType>3</EQType> <GaugeDrawTemplate> <Fill>A_GaugeFill</Fill> </GaugeDrawTemplate> <AutoStretch>true</AutoStretch> <TopAnchorOffset>27</TopAnchorOffset> <BottomAnchorOffset>30</BottomAnchorOffset> <RightAnchorToLeft>false</RightAnchorToLeft> <LeftAnchorOffset>5</LeftAnchorOffset> <RightAnchorOffset>285</RightAnchorOffset> </Gauge> <Label item ="Gauge0_HPPercent"> <ScreenID>HPPercLabel0</ScreenID> <Font>2</Font> <RelativePosition>true</RelativePosition> <Location> <X>111</X> <Y>15</Y> </Location> <Size> <CX>40</CX> <CY>15</CY> </Size> <EQType>19</EQType> <TextColor> <R>255</R> <G>0</G> <B>0</B> </TextColor> <NoWrap>true</NoWrap> <AlignCenter>false</AlignCenter> <AlignRight>false</AlignRight> </Label> <Label item ="Gauge0_DivisionBar"> <ScreenID>Gauge0_DivisionBarLabel</ScreenID> <Font>2</Font> <RelativePosition>true</RelativePosition> <Location> <X>126</X> <Y>14</Y> </Location> <Size> <CX>40</CX> <CY>15</CY> </Size> <Text>|</Text> <TextColor> <R>100</R> <G>100</G> <B>100</B> </TextColor> <NoWrap>true</NoWrap> <AlignCenter>false</AlignCenter> <AlignRight>false</AlignRight> </Label> <Label item ="Gauge0_PetHPPercent"> <ScreenID>Gauge0_PetHPPercentLabel</ScreenID> <Font>2</Font> <RelativePosition>true</RelativePosition> <Location> <X>127</X> <Y>14</Y> </Location> <Size> <CX>40</CX> <CY>15</CY> </Size> <EQType>69</EQType> <TextColor> <R>51</R> <G>192</G> <B>51</B> </TextColor> <NoWrap>true</NoWrap> <AlignCenter>false</AlignCenter> <AlignRight>false</AlignRight> </Label> <Screen item="GW_PetGauge0_x"> <ScreenID>PetGauge0</ScreenID> <RelativePosition>true</RelativePosition> <Location> <X>4</X> <Y>1</Y> </Location> <Size> <CX>180</CX> <CY>40</CY> </Size> <Style_Transparent>true</Style_Transparent> <Pieces>Gauge0_DivisionBar</Pieces> <Pieces>Gauge0_PetHPPercent</Pieces> <Pieces>GW_PetGauge0</Pieces> </Screen>







Hal

Sylphan 12-22-2008 02:00 PM

All you have to do is remove the ScreenID from your container element.

The EQ system looks for ScreenID when it's looking for an expected item in a window, not the actual "Screen item" name. So ScreenID is actually more important than the element name.

What you've done is give your container ("Screen item") the ScreenID of PetGauge0, and it's conflicting with the ScreenID of GW_PetGauge0, which is also PetGauge0. In general, when you're putting elements into containers, you should give the container no ScreenID at all.

BTW: If you use a "Screen item" as your container, it will not fade with the rest of the window when the user right clicks on the window and chooses Alpha. But if you use a "LayoutBox item" as your container, it will.

myxiplx 12-22-2008 02:21 PM

I remember hitting a few problems when I tried this myself, but I haven't really explored the concept enough to know for sure. I think it's a great idea by the way, and one I certainly plan to steal eventually to tidy up my own UI :-D

What I think is worth a try is taking the screen ID off the pet gauge itself (just comment out the whole line). It might be getting confused with two screen ID's, or it might just be hiding the pet gauge because of it, but only re-displaying the last one it sees.

For troubleshooting you could also try giving the pet gauge a completely different name, and maybe change it's eq type to do something like point it to your mana. That will verify that the gauge itself is in the right place and will show up normally.

Halelen 12-22-2008 02:28 PM

ok sylphan if i remove screen id from container then it doesnt make the 0 disappear whioch is what i was trying to do.

so use a layout box with those 3 items in it instead of a screen item?


myx i have tried commenting out the pet gauge and it still doesnt work


Hal

Halelen 12-23-2008 10:33 AM

Any other ideas. Have tried all the above with same result, I know it can be done just not getting something right.


Hal

myxiplx 12-23-2008 03:52 PM

Just spotted something. You have a right anchor offset of 285 for your pet gauge, but the screen piece that contains it is only 180 wide.

Not quite sure how EQ will cope with that, but at best, it puts your gauge around 100 pixels to the left of your visible area...

Might be worth changing the gauge offsets to 5 or something like that. You should also remove ScreenID's from everything except your screen piece, mana gauge and stamina gauge. They are the only pieces that need a screen ID to be managed by SoE's code, the other items look like pieces you've added yourself so the screen ID doesn't actually do anything and just adds complexity to the code.

Sylphan 12-29-2008 01:32 PM

Ok, here's basically how I do it in my player window. The example uses Screen items, but it's really better to replace some of the Screen items with LayoutBox items. In my mod, I like to put the pet health right underneath the pet bar.

Most of the action is in Player_PetFixer, because it has a Layout. Try to ignore Player_PetHolder at first, it's merely the container for Player_PetFixer.

The label items Player_PetSpacer1 and Player_PetSpacer2 kinda just cancel each other out, but they do serve a purpose. I use a negative 3 in Player_PetSpacer2 to make the percentage partially-overlap the gauge. (Normally in a vertical layout the items are placed in order, each one below the last). But then I had to add Player_PetSpacer1 to make sure that the sum of the heights doesn't actually go below zero -- that would cause errors.

The pet percent is Player_PetHealthLabel. When you have a pet, it's located at 1,30 within Player_PetFixer, because the gauge has height of 30. (3+30-3) When you don't have a pet, it's located at 1,0 within Player_PetFixer because the gauge is not displayed, essentially height of 0. (3+0-3)

But Player_PetFixer itself is located at a Y coord of -17, so Player_PetHealthLabel is displayed at location 1,13 or location 1,-17 within Player_PetHolder. In the latter case the little '0' DOES still show, but since it's at a negative location you can't actually see it.


<Gauge item = "Pet_HP">
<ScreenID>PetHP</ScreenID>
<Font>3</Font>
<TextColor>
<R>240</R>
<G>240</G>
<B>240</B>
</TextColor>
<RelativePosition>true</RelativePosition>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<CX>100</CX>
<CY>30</CY>
</Size>
<TextOffsetY>-50</TextOffsetY>
<GaugeOffsetY>28</GaugeOffsetY>
<Style_VScroll>false</Style_VScroll>
<Style_HScroll>false</Style_HScroll>
<Style_Transparent>false</Style_Transparent>
<!--<TooltipReference/>-->
<FillTint>
<R>51</R>
<G>192</G>
<B>51</B>
</FillTint>
<LinesFillTint>
<R>220</R>
<G>220</G>
<B>0</B>
</LinesFillTint>
<DrawLinesFill>false</DrawLinesFill>
<EQType>16</EQType>
<GaugeDrawTemplate>
<Background>A_PW_ThinGaugeBackground</Background>
<Fill>A_PW_ThinGaugeFill</Fill>
<!--<Lines>A_PW_ThinGaugeLines</Lines>-->
<!--<LinesFill>A_PW_ThinGaugeLinesFill</LinesFill>-->
</GaugeDrawTemplate>
</Gauge>

<Label item ="Player_PetHealthLabel">
<ScreenID>PetHealthLabel</ScreenID>
<Font>2</Font>
<RelativePosition>true</RelativePosition>
<Location>
<X>3</X>
<Y>0</Y>
</Location>
<Size>
<CX>20</CX>
<CY>11</CY>
</Size>
<Text></Text>
<EQType>69</EQType>
<TextColor>
<R>255</R>
<G>255</G>
<B>255</B>
</TextColor>
<NoWrap>true</NoWrap>
<AlignCenter>true</AlignCenter>
<AlignRight>false</AlignRight>
<Style_Tooltip>false</Style_Tooltip>
</Label>

<LayoutVertical item="Player_L_Ver0">
<Padding>0</Padding>
<Resize>false</Resize>
</LayoutVertical>
<LayoutHorizontal item="Player_L_Hor0">
<Padding>0</Padding>
<Resize>false</Resize>
</LayoutHorizontal>
<Label item="Player_PetSpacer1">
<Size><CX>0</CX><CY>3</CY></Size>
<Style_Tooltip>false</Style_Tooltip>
</Label>
<Label item="Player_PetSpacer2">
<Size><CX>0</CX><CY>-3</CY></Size>
<Style_Tooltip>false</Style_Tooltip>
</Label>
<Label item="Player_PetSpacer3">
<Size><CX>1</CX><CY>0</CY></Size>
<Style_Tooltip>false</Style_Tooltip>
</Label>
<Screen item="Player_PetPctHolder">
<RelativePosition>true</RelativePosition>
<Layout>Player_L_Hor0</Layout>
<Style_Transparent>true</Style_Transparent>
<Style_Border>false</Style_Border>
<Style_Tooltip>false</Style_Tooltip>
<DrawTemplate>WDT_PW_RoundedNoTitle</DrawTemplate>
<Location>
<X>0</X>
<Y>-17</Y>
</Location>
<Size>
<CX>105</CX>
<CY>65</CY>
</Size>
<Pieces>Player_PetSpacer3</Pieces>
<Pieces>Player_PetHealthLabel</Pieces>
</Screen>
<Screen item="Player_PetFixer">
<RelativePosition>true</RelativePosition>
<Layout>Player_L_Ver0</Layout>
<Style_Transparent>true</Style_Transparent>
<Style_Border>false</Style_Border>
<DrawTemplate>WDT_PW_RoundedNoTitle</DrawTemplate>
<Location>
<X>0</X>
<Y>-17</Y>
</Location>
<Size>
<CX>105</CX>
<CY>65</CY>
</Size>
<Pieces>Player_PetSpacer1</Pieces>
<Pieces>Pet_HP</Pieces>
<Pieces>Player_PetSpacer2</Pieces>
<Pieces>Player_PetPctHolder</Pieces>
</Screen>
<Screen item="Player_PetHolder">
<RelativePosition>true</RelativePosition>
<Style_Transparent>true</Style_Transparent>
<Style_Border>false</Style_Border>
<DrawTemplate>WDT_PW_RoundedNoTitle</DrawTemplate>
<Location>
<X>2</X>
<Y>17</Y>
</Location>
<Size>
<CX>100</CX>
<CY>24</CY>
</Size>
<Pieces>Player_PetFixer</Pieces>
</Screen>

Desideratus 12-30-2008 04:48 AM

Quote:
Originally Posted by myxiplx
Just spotted something. You have a right anchor offset of 285 for your pet gauge, but the screen piece that contains it is only 180 wide.

Not quite sure how EQ will cope with that, but at best, it puts your gauge around 100 pixels to the left of your visible area...

Might be worth changing the gauge offsets to 5 or something like that. You should also remove ScreenID's from everything except your screen piece, mana gauge and stamina gauge. They are the only pieces that need a screen ID to be managed by SoE's code, the other items look like pieces you've added yourself so the screen ID doesn't actually do anything and just adds complexity to the code.


The right anchor offset of 285 is definitely the problem - with RightAnchorToLeft set false, as you have, that means the right hand side of the gauge is fixed to 285 pixels from the right of the container ... which is only 180 wide.
If you removed the RightAnchorToLeft tag but kept the offset of 285, I suspect the gauge would work but would not begin to drop below full until your pet hit about 60% (as only 180 of the 280 width of the defined bar are visible).

If you keep the RightAnchorToLeft false, the RightAnchorOffset should be 5. If you drop the RightAnchorToLeft line, the RightAnchorOffset should be 175.

And the ScreenID, should be on the container and not the gauge itself I think - IF all the parser does with that screenID is decide whether or not to display it. IF the parser actually uses the ScreenID to determine how to calculate the gauge fill, then that ScreenID needs to remain on the gauge and you might not be able to do what you want: because there isn't another game-defined ScreenID in the player window that is linked to pet existence you can use to modify the hide behaviour for the other elements.

Note, this is different to mana, where because there are three ScreenIDs in the player window linked to mana and one of them is for the "%" sign (ManaPercLabel), using that for a "mana" container instead of for the "%" sign itself has exactly the desired effect of completely removing mana info from characters that have no mana - because that ScreenID CAN'T do anything other than hide or show the % sign anyway ....

Halelen 01-03-2009 01:47 AM

Woot I got it ...all the coding was correct just cant use the offsets for the gauges....once i used loc and size it worked perfectly...And I did remove screen item from gauge and use it for the container...placed pet gauge division bar and pet hp percent in container...when pet gone division bar pet bar and percent health all disappear thanks for the thoughts guys 8)




HAl

Halelen 01-05-2009 12:32 PM

Group window is done and works Beautifully.

Ok next dilema

Now I am trying to do the same with the target window for the Target of Target gauge and subsequent hp label. Have the container gauge and hp label in container but no matter what the 0 shows when there is no target of target.

Any ideas how I can get this to hide when there is no target of target like the gauge does?


Code:
<Gauge item="TargetOfTarget_HP"> <Font>3</Font> <TextColor> <R>51</R> <G>190</G> <B>51</B> </TextColor> <RelativePosition>true</RelativePosition> <Location> <X>0</X> <Y>0</Y> </Location> <Size> <CX>108</CX> <CY>27</CY> </Size> <GaugeOffsetY>13</GaugeOffsetY> <TextOffsetX>8</TextOffsetX> <Style_VScroll>false</Style_VScroll> <Style_HScroll>false</Style_HScroll> <Style_Transparent>false</Style_Transparent> <FillTint> <R>240</R> <G>0</G> <B>0</B> </FillTint> <LinesFillTint> <R>255</R> <G>255</G> <B>255</B> </LinesFillTint> <DrawLinesFill>false</DrawLinesFill> <EQType>27</EQType> <GaugeDrawTemplate> <Background>A_GaugeBackground</Background> <Fill>A_GaugeFill</Fill> <Lines>A_GaugeLines</Lines> <LinesFill>A_GaugeLinesFill</LinesFill> <EndCapLeft>A_GaugeEndCapLeft</EndCapLeft> <EndCapRight>A_GaugeEndCapRight</EndCapRight> </GaugeDrawTemplate> </Gauge> <Label item="TargetOfTarget_HPLabel"> <Font>2</Font> <RelativePosition>true</RelativePosition> <Location> <X>110</X> <Y>12</Y> </Location> <Size> <CX>20</CX> <CY>15</CY> </Size> <EQType>120</EQType> <TextColor> <R>51</R> <G>192</G> <B>51</B> </TextColor> <NoWrap>true</NoWrap> <AlignCenter>false</AlignCenter> <AlignRight>false</AlignRight> </Label> <Screen item="TargetOfTarget_HPPercLabel"> <ScreenID>TargetOfTarget_HPPercLabel</ScreenID> <RelativePosition>true</RelativePosition> <Location> <X>2</X> <Y>0</Y> </Location> <Size> <CX>150</CX> <CY>30</CY> </Size> <Style_Transparent>true</Style_Transparent> <Pieces>TargetOfTarget_HP</Pieces> <Pieces>TargetOfTarget_HPLabel</Pieces> </Screen> <Screen item="TargetWindow"> <ScreenID/> <RelativePosition>false</RelativePosition> <Location> <X>516</X> <Y>242</Y> </Location> <Size> <CX>1171</CX> <CY>32</CY> </Size> <Style_AutoVScroll>false</Style_AutoVScroll> <Style_HScroll>false</Style_HScroll> <Style_Transparent>false</Style_Transparent> <TooltipReference>Your Current Target</TooltipReference> <DrawTemplate>WDT_RoundedNoTitle</DrawTemplate> <Style_Titlebar>false</Style_Titlebar> <Style_Closebox>false</Style_Closebox> <Style_Minimizebox>false</Style_Minimizebox> <Style_Border>false</Style_Border> <Style_Sizable>false</Style_Sizable> <Pieces>Target_HP</Pieces> <Pieces>Target_HPLabel</Pieces> <Pieces>Target_HPPercLabel</Pieces> <!--<Pieces>TargetOfTarget_HP</Pieces>--> <!--<Pieces>TargetOfTarget_HPLabel</Pieces>--> <Pieces>TargetOfTarget_HPPercLabel</Pieces> <Pieces>Target_HP_Gauge1A_X</Pieces> <Pieces>Target_HP_Gauge1B</Pieces> <Pieces>Target_HP_Gauge2A_X</Pieces> <Pieces>Target_HP_Gauge2B</Pieces> <Pieces>Target_HP_Gauge3A_X</Pieces> <Pieces>Target_HP_Gauge3B</Pieces> <Pieces>Target_HP_Gauge4A_X</Pieces> <Pieces>Target_HP_Gauge4B</Pieces> <Pieces>Target_HP_Gauge5</Pieces> <Pieces>TW_HOTT_Gauge1A_X</Pieces> <Pieces>TW_HOTT_Gauge1B</Pieces> <Pieces>TW_HOTT_Gauge2A_X</Pieces> <Pieces>TW_HOTT_Gauge2B</Pieces> <Pieces>TW_HOTT_Gauge3A_X</Pieces> <Pieces>TW_HOTT_Gauge3B</Pieces> <Pieces>TW_HOTT_Gauge4A_X</Pieces> <Pieces>TW_HOTT_Gauge4B</Pieces> <Pieces>TW_HOTT_Gauge5</Pieces> <Pieces>Target_BuffWindow</Pieces> <Pieces>A_TargetBoxStaticAnimTop</Pieces> <Pieces>A_TargetBoxStaticAnimBottom</Pieces> <Pieces>A_TargetBoxStaticAnimLeft</Pieces> <Pieces>A_TargetBoxStaticAnimRight</Pieces> <Pieces>A_TargetBoxStaticAnimFill</Pieces> </Screen>

Desideratus 01-05-2009 02:02 PM

You can't, as far as I know, because there is no ScreenID related to Target of Target that belongs in the target window - only in the HoTT window - so when the parser works on target window it has no reason to look for anything to hide or show.

What you COULD do is reserve a large blank area in the target window and overlay a borderless HoTT window over it ... not sure how persistent the HoTT window is though, as I long ago decided just to put up with the 0 in the target window.

Halelen 01-05-2009 02:06 PM

Well crap! Ok thanks for the info....guess ill just have to live with it or like ya said make a seperate window. Anyhow thanks for all the help


HAl


All times are GMT -5. The time now is 09:44 AM.

vBulletin Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.