EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Dynamic Font Color Change on Stats? (https://www.eq2interface.com/forums/showthread.php?t=13987)

Pyroman 03-17-2010 09:18 AM

Dynamic Font Color Change on Stats?
 
Not sure if this is possible.

I was wondering if there is a way to make it so the font color of a stat would change at a certain point. One example being, the Double Attack stat being green at 100 or lower, then turning red when it goes over 100.

Drumstix42 03-17-2010 09:42 AM

You'd first have to filter out the dynamic data for color that automatically gets sent down from the server:

Code:

DynamicDataFilter="FBFF"
(I believe that's correct)

Then you could probably setup a check for every time the text changes to do a number evaluation.

Code:

OnTextChanged="iPct=int(LocalText)
COND=(iPct > 99)
Color=(COND ? '#FF0000' : '#00FF00')"

Line 1: changes percentage into integer and removes decimal point
Line 2: check to see if integer is greater than 99
Line 3: if it is... set color to red, else set to green

Fairly sure this would work just fine. The color values are open for tweaking, they're just straight red/green.

Pyroman 03-17-2010 11:16 AM

Well maybe you can help me with implementing it (not very good hehe). Here's the code I'm currently using to show the crit chance stat.

Code:

<Text DynamicData="/GameData.Stats.Crit_Chance" Font="/TextStyles.Normal.NormalStyle" Location="44,52" Name="Value_CritChance" PackLocation="FFF" ScrollExtent="27,16" Size="27,16" TextColor="#C7CFC7">:42aee842884382ba_21:200.0</Text>

Drumstix42 03-17-2010 11:31 AM

First thing to note: Crit chance checks the level of your target to calculate crit chance. For targets higher level than you, 100% crit isn't really 100% ;)

Here's your code with my code implemented:
Code:

<Text DynamicData="/GameData.Stats.Crit_Chance" DynamicDataFilter="FBFF" Font="/TextStyles.Normal.NormalStyle" Location="44,52" Name="Value_CritChance" OnTextChanged="iPct=int(LocalText)&#xD;&#xA;COND=(iPct > 99)&#xD;&#xA;Color=(COND ? '#FF0000' : '#00FF00')" PackLocation="FFF" ScrollExtent="27,16" Size="27,16" TextColor="#C7CFC7">:42aee842884382ba_21:200.0</Text>
It's not tested. But it "should" change the text red if it's over 99%

Pyroman 03-17-2010 11:42 AM

Actually there are numerous threads stating after TSF was released (and crits merged) the amount of 'extra crit' needed to hit a higher level opponent was severely lessened, if not removed outright. My own parses getting 100% crit rate with 102 crit chance on level 98 enemies seem to support this in some small way. not the place to debate this though hehe.

http://forums.station.sony.com/eq2/p...opic_id=471667

This will help me further test this though.


All times are GMT -5. The time now is 08:10 PM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI