EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   UI Developer Discussion (https://www.eq2interface.com/forums/forumdisplay.php?f=3)
-   -   Capturing a DynamicData Change? (https://www.eq2interface.com/forums/showthread.php?t=6374)

Retsek 06-27-2006 06:49 PM

Capturing a DynamicData Change?
 
One of the things troubling me most about our friendly UI interface is the Dynamic data issue. For example

the /Gamedata.self.experiencecurrent is updated whenever your XP changes however NONE of the onshow, onactivate, onenable etc... flags recognize that it changes.

Anyone have any ideas on how to know when a dynamic changes? I thought perhaps using the Actiontype="Experience" on a button or page would allow me to track it but no luck so far.

The usage I'm after is to get the XP value convert it properly to a number combine with the bubbleXP and make the correct number display. Otherwise if you just crop and past numbers you are always wrong when the number changes over a decade mark.

gm9 06-28-2006 04:59 AM

Sliderbars, for example, have OnChange events.

But I'm curious how you manage to crop numbers?

Retsek 06-28-2006 09:11 AM

Cropping a number?
 
Cropping numbers ... like a picture doesn't change it at all you just adjust the "frame" in this case a page around it. A typical 3 digit number in Arial 14 would be 20,15 in size you right or left justify it depending on the end you want to cut off. Place it in a page of smaller size

<page name"example" size="15,15">
<text name="sample"
textalignment="right"
textverticalalignment="top">123</text>
</page>

This would in most cases cut off the trailing digit. Purely cosmetic but with overlapping you can create the illusion of the XP decilmal point XXX.X

gm9 06-28-2006 10:31 AM

Ok, that's the technique we are all using, that's just a visual crop (I had hoped you had found a way to crop the number itself). In that case you don't need events to copy the XP data to your text field, just make it use the dynamic data directly. ;)

Retsek 06-28-2006 10:36 PM

Nope, still want to find an event or way to know of change =)
 
Different example. Your target changes simple your UI will show it NP since you are using dynamicdata. However let us assume that if you could KNOW when it changed IE through an onXXX event or filter of some kind then you could implement say a target lock.

target <> oldtarget then dammit better change it back hehe. Not code but it is the idea.

Or in the XP bar version if you KNEW when it changed you could run the text value through a comparison and actually substitue the correct text. Since the last digit of currentexperience should actually be the tens digit of the experiencebubble you either want to change the 103% XP 25% bubble into 10 and then change the bubble text to 2.5% etc... or change the 103% to '102.' and simply crop the tens place off the bubble xp.

Lots of handy uses in different places where dynamic data occurs if only there is a way to detect the change. For progress bars the text value won't convert to a number for math, nor can you assign it to a textbox - slider etc... and use their onchange events.

Any ideas?

Sorry I was unclear before. There is a bastardized form of regular expressions that works occasionally on normal data but won't touch dynamics for some reason so I'm stumped unless I can detect the change and trigger a button.

Magus 06-28-2006 11:17 PM

I don't think it's possible to run anything onchange of a dynamicdata.

gm9 06-29-2006 04:40 AM

Magus, other events work for objects updated by DynamicData (I know that I'm using at least OnSet, OnUnset on checkboxes). I'm not sure for OnChange, I don't think I ever tried.

Retsek, I think that your target lock would be easier to implement by making a "lock" checkbox that sets or removes the dynamic data field.

I now understand what you want to do with the XP, that's something I had been considering as well to work around the current XP rounding mess, but so far I'm hoping that SOE will fix it.

You are right that you can't apply the DD to a sliderbar, I forgot that it contains the "%". However, I would have thought that applying it to a progress bar you could read the progress value which should be a number only. Unfortunately you say that it doesn't work. Even if it was a number, you couldn't apply it to sliderbars because I think those accept only integer values, whereas progress bars use decimals (you could work around that particular problem with the solution below).

So if you can't do math at all you can still create a pre-populated datasource that contains all possible XP values and what you want to convert them to. Apply the datasource to a dropdown and then compare every item of the dropdown to your value until you find the correct one. Sounds like very ugly code, but all I can think of right now if you have to work with text only...

Magus 06-29-2006 07:58 PM

Quote:

Originally Posted by gm9
Magus, other events work for objects updated by DynamicData (I know that I'm using at least OnSet, OnUnset on checkboxes). I'm not sure for OnChange, I don't think I ever tried.

The reason I say I don't think it's possible is that people have wanted to do things like showing how much XP you got for the last kill, and the only way to do it has been to make a button that you'd have to click both before and after the kill, and it could show how much something changed.

If you could trigger something on a change event, they wouldn't have to require the button click before/after - the simple act of the XP bar changing would trigger it and make such a mod possible.

Retsek 06-29-2006 08:32 PM

Manual capture all I can do apparently ....
 
Yeah aside from the checkbox type items there is no way to get the change other than a manual button push that I can find. I'm willing to admit defeat at this point since you can't trigger progress bar values.

I may have another way to work the target lock and if it works I"ll share it ... an idea hit me this morning haven't had a chance to code it yet.

gm9 06-29-2006 08:59 PM

I agree, I had a quick look at the events for each object in UIbuilder and there really appears to be no way to get an event on a string change...

Talyns 06-29-2006 09:58 PM

You can track target changes with a 0,0 page.

Give the page dynamicdata "/GameData.Target.Window" it will now show whenever the target window is susposed to be shown.. If you hide it everytime it is shown then it will open every time the target window is opened (i.e. every time the target is changed)..

I dunno about the lock

Might be able to do something like this in the page.
OnActivate="activated=false target_previous"
OnShow="visible=false OnActivated=Parent.LockCheckbox.Checked"

Hope that helps a little

edit:
Capturing experience gain is harder but can be done with a few side-effects:
http://www.eq2interface.com/forums/s...ead.php?t=3929

But maybe the code I used there can be added to a experience window in another sub-page of the HUD and keep it functionality (e.g. inventory.experience). I never tried that.


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

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