EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   Dev Shack (https://www.eq2interface.com/forums/forumdisplay.php?f=11)
-   -   UI Builder Changes (https://www.eq2interface.com/forums/showthread.php?t=12029)

SOE-Rothgar 12-05-2008 01:59 PM

UI Builder Changes
 
I just realized that I made a change back in August so that the Left, Top, Width and Height functions would take a float value but apparently I forgot to push the version out to the patcher.

I'm going to do that today, but first I'm going to try to add an Int() function that will convert a value into and integer.

If you'd be interested in testing this version out before I patch it, I can send you a copy today. Just PM me your email address. I'd like to make sure the changes don't break anything.

SOE-Rothgar 12-05-2008 02:17 PM

While I'm working on this Evaluation hook, are there any other simple functions that would save you some work? I was thinking about adding int, abs, floor and ceil functions.

gm9 12-05-2008 02:41 PM

The int() function would be great, that would simplify many things. However we are currently using left, top, width, height not only to convert float to int, but also to shave off other characters at the end of a numeric string, such as a percentage sign. Therefore it would be great if the int() function would do that as well.

Your change will require a lot of mods to be changed (at least I assume that this does not only affect UIbuilder but also the ingame scripting engine) but this is a welcome change. :)

You can send me a copy of UIbuilder for testing although I'm more anxious to test in game on Test.

Landiin 12-05-2008 02:48 PM

haven't used the live one in a while, been using the last one you sent me. Just figured you wasn't as forgetful as me o_O Ya send me the new build and I'll run it. I'll email you also.

As for more function
A function like Windows StringCchCopyW API would be killer :)

edit
Changed Copy to StringCchCopyW, I've use my own wrapper for to long now..

SOE-Rothgar 12-05-2008 03:35 PM

Quote:

Originally Posted by gm9 (Post 78493)
The int() function would be great, that would simplify many things. However we are currently using left, top, width, height not only to convert float to int, but also to shave off other characters at the end of a numeric string, such as a percentage sign. Therefore it would be great if the int() function would do that as well.

Your change will require a lot of mods to be changed (at least I assume that this does not only affect UIbuilder but also the ingame scripting engine) but this is a welcome change. :)

You can send me a copy of UIbuilder for testing although I'm more anxious to test in game on Test.


Hmm, can you give me an example? With the old version of our UI library, Left,Top,Width and Height were parsing the text as a Long value. If it encountered a non-numeric digit it should have failed and not set the value of the property. So I'm not sure how you are using it to strip non-numeric characters.

Drumstix42 12-05-2008 03:51 PM

I think gm9 meant to say we're using Top, Left, Width and Height to get Integers after we put values into the comma delimited values like Location and Size.

Not sure about percentages. Been outta the loop with stuff the past few weeks.


Code:

iMathEvaluation=4+4
Parent.Location=(iMathEvaluation ## ', 0')
Random.Value.That.Needs.To.Be.Int=Parent.Left

Simple function requests? Hmm... I coulda sworn I had some ideas. You've put me on the spot now!

dragowulf 12-05-2008 03:52 PM

I'm not sure if this is UIBuilder related or not, but LocationEffector does not work vertically. I tried this in UIBuilder and it did not work.

gm9 12-05-2008 04:29 PM

Quote:

Originally Posted by Drumstix42 (Post 78497)
I think gm9 meant to say we're using Top, Left, Width and Height to get Integers after we put values into the comma delimited values like Location and Size.

Not sure about percentages. Been outta the loop with stuff the past few weeks.


Code:

iMathEvaluation=4+4
Parent.Location=(iMathEvaluation ## ', 0')
Random.Value.That.Needs.To.Be.Int=Parent.Left


True for comma delimited values.

Percentages is actually something I thought you discovered Drumstix, lol. :p To shave off percentages I think you can use the Top, Left, Width, Height directly:

Code:

Left=Parent.Spell_Cast_Percent.Text
Or my code has a bug, which is a possibility.

Edit: Yup, you discovered it: http://www.eq2interface.com/forums/s...9&postcount=13

SOE-Rothgar 12-05-2008 05:03 PM

That makes sense that you're using Top,Left etc to read out an integer. All that I changed is when you set the Top,Left values, it will now properly parse a float and treat it like an int. So even though you'll have an int() function now, you won't need to use it to do something like.

Control.Left = 5 + 10

I just finished writing the int() function and made sure it works with any non-digit character. It'll strip spaces off the front too, so basically it'll look for a dash and then numbers. When it hits a non-number it'll terminate and return what it found.

These changes will not go live in the game until the next GU. I'm not sure when we are going to push them to test, but if you want to test script sooner, I can send you a copy of the new UI builder.

gm9 12-05-2008 05:16 PM

That's great. So how is it implemented, classic way like this?

Code:

intValue=int(floatValue)

Drumstix42 12-05-2008 05:19 PM

Quote:

Originally Posted by gm9 (Post 78501)

lol, I've been sick past few days, so I'm a bit out of it ;)

gm9 12-05-2008 05:20 PM

While you were asking about other simple functions: We do not have any string manipulation possibilities, maybe some standard string manipulation functions could be introduced? E.g. one thing we currently cannot do is remove a color code from a string. In other instances I might want to explode() a string or at least get the substr() until the occurance of a specific character in the string.

And to squeeze my constant request in: Non-ASCII support in UI scripting would be very very very helpful. :p

Drumstix42 12-05-2008 05:22 PM

Quote:

Originally Posted by Drumstix42 (Post 78497)
Simple function requests? Hmm... I coulda sworn I had some ideas. You've put me on the spot now!

Ohh I remember now... we were trying to convert certain dynamic data values that had %'s and decimals I think? and there was no way to do that.

12.9% for example, and the reasoning originally was because we wanted to subtract and add percentages. Direct reasoning because there was no dynamic data available outside a tooltip for avoidance percent.

dragowulf 12-05-2008 05:29 PM

Quote:

Originally Posted by gm9 (Post 78507)
And to squeeze my constant request in: Non-ASCII support in UI scripting would be very very very helpful. :p

lol.......This is for other languages, correct?

and what is explode() & substr()

Drumstix42 12-05-2008 05:35 PM

exploding a string returns a portion of a string up to a certain point.
substr is to get a sub portion of a string, similar to above, in a different method.

gm9 12-05-2008 05:38 PM

Non-ASCII is mostly an issue on localized servers, yes, but theoretically you can run into the same issues on English servers. It also breaks some default UI functions on localized servers.

With explode(delimiter, input) I meant a function to split a string into an array based on the occurance of the delimiter string. E.g. explode(",", "123,456") you'd end up with a "123" string and a "456" string.

With substr(input, start, length) I was referring to a substring function that returns part of a string.

EDIT: Drumstix ninja'd me. :p

SOE-Rothgar 12-05-2008 06:04 PM

I was just implementing the abs() function and had an idea.

I am making this function work for floating point numbers, so I take the value passed into abs() and parse it as a float. After calculating the absolute value I have to turn the float back into a string. This has the unfortunate side effect of doing what all the other math functions would do.

so... abs(-4) would output 4.000

I decided to modify our floating point parser which currently takes a precision value (defaults to 3) and make it so I can pass a precision of -1 to indicate that it should not use trailing spaces. So now abs(-4) equals "4" while abs(-4.5) would still equal "4.5".

Now to the interesting part. I got to thinking that there's no reason why the output of the math functions should always return a precision of 3. If anything it should use this new change I made and only return the precision necessary. So 4 + 5 = "9" and not "9.000". 2 / 4 would = "0.5" and not "0.500".

So my question is, would this mess any of your mods up? Are there situations where you are relaying on a precision of 3 by default?

Oh, one other thing. I found a bug that was fixed. Wanted to give you a heads up in case this would affect you.
Currently if you try to use a negative floating point number in script, it will stop parsing the number when it hits the period. I've fixed this so now you write -4.5 and it'll work instead of returning -4.

gm9 12-05-2008 06:17 PM

That is great, this facilitates a whole lot of things.

There will however be an impact on mods since currently due to the know precision of 3 we right align numbers and "hide" the decimals. Now if decimals are not shown anymore by default that will mess up the placement and thus the display of numbers in a couple of mods.

But since the placement was only done that way to get rid of the decimals in the first place personally I'd say go ahead with your change.

Landiin 12-05-2008 06:37 PM

Quote:

Originally Posted by SOE-Rothgar (Post 78512)
So my question is, would this mess any of your mods up? Are there situations where you are relaying on a precision of 3 by default?

Who cares, this is a big improvement, people can recode easy enough for this.

StringCchCopy and StrPos is all we really need for stings and its low lever so it would be easy to make a UI wrapper for. But yea if u wanna go all out and make explode, left, right, substr I will not complain :P

Really if your gonna go that far might as well put in a language interpreter for Lua or some other common OO scripting language.

SOE-Rothgar 12-05-2008 06:51 PM

Sounds good. I know that going back and tweaking things will probably be a pain and several hours of work for many of you but hopefully in the long run this will be much better going forward.

If no one has taken the time to say it recently, we really appreciate all the trouble you guys go through to help make the game more fun for everyone. I'm just doing the job I get paid to do, but you guys are really putting in a lot of effort and it means a lot not only us at SOE but certainly to all of the players.

I've pretty much got all the changes wrapped up for today so if you think you want to test out the new UI Builder this weekend, shoot me a PM on here with your email address, or just email me at [email protected] and I'll send you the latest version.

Here are a summary of the changes for those that don't want to read back through the entire thread.

* Top, Left, Width, Height properties now accept floating point numbers
* The results of math operations no longer return 3 decimal places.
* Fixed a bug with negative floating point numbers not parsing correctly
* UIScript now supports the following functions:
int() - return the integer portion of a value
abs() - absolute value
floor() - return largest integral number less than x
ceil() - return smallest integral number greater than x

dragowulf 12-05-2008 07:18 PM

Quote:

Originally Posted by SOE-Rothgar (Post 78517)
Sounds good. I know that going back and tweaking things will probably be a pain and several hours of work for many of you but hopefully in the long run this will be much better going forward.

If no one has taken the time to say it recently, we really appreciate all the trouble you guys go through to help make the game more fun for everyone. I'm just doing the job I get paid to do, but you guys are really putting in a lot of effort and it means a lot not only us at SOE but certainly to all of the players.

I've pretty much got all the changes wrapped up for today so if you think you want to test out the new UI Builder this weekend, shoot me a PM on here with your email address, or just email me at [email protected] and I'll send you the latest version.

Here are a summary of the changes for those that don't want to read back through the entire thread.

* Top, Left, Width, Height properties now accept floating point numbers
* The results of math operations no longer return 3 decimal places.
* Fixed a bug with negative floating point numbers not parsing correctly
* UIScript now supports the following functions:
int() - return the integer portion of a value
abs() - absolute value
floor() - return largest integral number less than x
ceil() - return smallest integral number greater than x

This might mess up a few mods, but it's an easy fix. These are all great additions that will help clean up much of our code and clear a path for an easier and broader way of scripting.

With that said..any chance of adding any more event trigger functions? :D

gm9 12-05-2008 07:25 PM

Quote:

Originally Posted by SOE-Rothgar (Post 78517)
If no one has taken the time to say it recently, we really appreciate all the trouble you guys go through to help make the game more fun for everyone. I'm just doing the job I get paid to do, but you guys are really putting in a lot of effort and it means a lot not only us at SOE but certainly to all of the players.

I don't think anyone from SOE has ever taken the time to say this. I tip my hat to you. :)

SOE-Rothgar 12-05-2008 07:30 PM

Quote:

Originally Posted by dragowulf (Post 78519)
With that said..any chance of adding any more event trigger functions? :D

Event triggers can be pretty easy to add. What did you have in mind?

gm9 12-05-2008 07:39 PM

Quote:

Originally Posted by SOE-Rothgar (Post 78521)
Event triggers can be pretty easy to add. What did you have in mind?

If they are easy:
  • OnChange
  • OnMouseDown
  • OnMouseUp
  • OnFocus
  • OnBlur
  • OnResize
  • OnLoad (= either for a <Page> or a specific dynamic data element, indicating when the element has been populated with data - this is an issue because dynamic data OnShow fires before the actual data is displayed)
  • ... I'll probably think of more

PS: As you discussed with drago: OnAutoAttack ;)

Landiin 12-05-2008 07:58 PM

Quote:

Originally Posted by gm9 (Post 78522)
PS: As you discussed with drago: OnAutoAttack ;)

I wouldn't want just a generic one.. If we are making them..

OnPrimaryAA
OnSecondaryAA
OnRangedAA

but this could be DD element and not an event off a object IMO but either works.

dragowulf 12-05-2008 08:03 PM

Quote:

Originally Posted by gm9 (Post 78522)
If they are easy:
  • OnChange
  • OnMouseDown
  • OnMouseUp
  • OnFocus
  • OnBlur
  • OnResize
  • OnLoad (= either for a <Page> or a specific dynamic data element, indicating when the element has been populated with data - this is an issue because dynamic data OnShow fires before the actual data is displayed)
  • ... I'll probably think of more

PS: As you discussed with drago: OnAutoAttack ;)

We already have an OnChange, but it's mainly for sliders. What we need is one that is like an OnTextChange, OnSizeChange (OnResize), OnLocationChange, OnProgressChange, etc etc. But instead of the OnChange working manually like the sliders, it should be manual and automatic(whenever the values are changed)

EDIT: And/Or...like what you said gm9: OnLoad, whenever the element is populated with data and whenever the data is repopulated (OnReload?).

SOE-Rothgar 12-05-2008 08:12 PM

Quote:

Originally Posted by gm9 (Post 78522)
[*]OnLoad (= either for a <Page> or a specific dynamic data element, indicating when the element has been populated with data - this is an issue because dynamic data OnShow fires before the actual data is displayed)

Can you give an example of this one? I looked over the code and it looks like we're setting the Text value of a UIText control before we toggle the visibility when DynamicData changes. There could be specific instances where maybe we change the visibility and then change the text later on, but from what I can tell, if we update the text and visibility at the same time, the text should be available when OnShow fires.

SOE-Rothgar 12-05-2008 09:02 PM

I've added 3 new events because they were fairly easy.

OnTextChanged for UIText controls

and OnMove / OnSize for every control that supports Location and Size properties.

gm9 12-05-2008 09:02 PM

Quote:

Originally Posted by SOE-Rothgar (Post 78528)
Can you give an example of this one? I looked over the code and it looks like we're setting the Text value of a UIText control before we toggle the visibility when DynamicData changes. There could be specific instances where maybe we change the visibility and then change the text later on, but from what I can tell, if we update the text and visibility at the same time, the text should be available when OnShow fires.

A specific example that is causing much trouble is subclass detection. This uses /GameData.Self.SubClass, which as far as I know does not contain a visibility component, and using OnShow of the window that contains it does not work, because OnShow fires before /GameData.Self.SubClass contains a value.

Of course this specific case could be solved if we had a /GameData.Self.SubClassEnglish. :)

Quote:

Originally Posted by SOE-Rothgar (Post 78529)
I've added 3 new events because they were fairly easy.

OnTextChanged for UIText controls

and OnMove / OnSize for every control that supports Location and Size properties.

This in addition to your other changes today is christmas come early for us! :nana:

PS: Did you ever discuss the ProgressBar empty event issue in ::render() with Zoltaroth? He said we wanted to talk to you about how to fix it but didn't get back to me yet.

dragowulf 12-05-2008 09:26 PM

Quote:

Originally Posted by SOE-Rothgar (Post 78529)
I've added 3 new events because they were fairly easy.

OnTextChanged for UIText controls

and OnMove / OnSize for every control that supports Location and Size properties.

Hardcore! This is going to be great!!!!

:nana::nana::nana::nana::nana:

Drumstix42 12-06-2008 01:11 AM

Quote:

Originally Posted by SOE-Rothgar (Post 78529)
I've added 3 new events because they were fairly easy.

OnTextChanged for UIText controls

and OnMove / OnSize for every control that supports Location and Size properties.

Wow! This is great news. Now I can do averages even easier lol. For some reason Average Resists always pop into my mind first when code changes can make it easier.

I find excessive mouse-over/out events to be annoying.
And now I can do my dynamic bottom-aligned Voice Chat window mod without mouse overs if I'm thinking about this correctly.

Really looking forward to the changes!

And for event triggers, some kinda of initial load of a file would be great to have an event for. Some of our custom window modifications require the common player to have knowledge in opening the window OR we have to modify other windows. See this topic: http://www.eq2interface.com/forums/s...ad.php?t=10547

RickF7666 12-06-2008 09:31 AM

I can give you at least two examples of the gamedata not being populated until after the ui piece is draw.

First in my Player window I want to show the last name only when there is a last name. Well OnShow doesn't work for this because by default the Player window is already showing when you zone in and no gamedata has been populated yet. So I added an OnHide to the hud_zoning window to populate the data before you see the interface.

Second I, like many others, want to display an archtype icon in the group window. The problem is that when someone joins the group the graphic elements are shown first then the group member data is populated. So no icon is shown. Most get around the problem by doing a OnHover. I on the other hand hide the group window and the show it again to get the icon to show up automatically. Both options have their problems.

So an OnLoad would solve both of those problems.

And I know this may not be the place for it but can I request the addition of Home City and Riposte to the gamedata?

dragowulf 12-07-2008 02:47 AM

To quote Landiin from a previous thread for event triggers

Quote:

Originally Posted by Landiin (Post 59156)
I'd love to See SOE add some more events and properties to the base object class.

Here are some events I'd like to see added.
  • OnLeftMouseClick (I know OnPress works for this but this event isn't in the base class and only available for a limited number of objects)
  • OnRightMouseClick
  • OnDblClick (Again I know this event is here but again it isn't in the base class and only available for a limited number of object)
  • OnKeyPress
  • OnCreate
  • OnDestroy

Here are some properties I'd like to see added.
  • NodeIndex( if read it would return the it's position in the children list, if set it would change its position in the children list)
  • ChildrenCount(the number of children the node has *Read Only*)

This are the things I was wishing I had available tonight when I was testing out some ideas. I don't think they would make the UI to powerful if they where in the base object. I know it would make life a lot less stressful on us modders.


SOE-Rothgar 12-08-2008 01:18 PM

Quote:

Originally Posted by gm9 (Post 78530)
A specific example that is causing much trouble is subclass detection. This uses /GameData.Self.SubClass, which as far as I know does not contain a visibility component, and using OnShow of the window that contains it does not work, because OnShow fires before /GameData.Self.SubClass contains a value.

Of course this specific case could be solved if we had a /GameData.Self.SubClassEnglish. :)


This in addition to your other changes today is christmas come early for us! :nana:

PS: Did you ever discuss the ProgressBar empty event issue in ::render() with Zoltaroth? He said we wanted to talk to you about how to fix it but didn't get back to me yet.

As you know, we normally don't toggle the visibility component of UI data unless there's a specific reason that we'd want to hide a control. Hopefully now you'll be able to use the OnTextChanged event of a Text control to update something when the SubClass value gets populated.

I do have an email about the ProgressBar issue, I just haven't looked into it yet.

SOE-Rothgar 12-08-2008 01:25 PM

Quote:

Originally Posted by RickF7666 (Post 78537)
I can give you at least two examples of the gamedata not being populated until after the ui piece is draw.

I think I must have misunderstood the original statement. I was under the impression you guys were saying that the dynamic data's visibility value was changing before text value was changing.

I understand now that you're talking about a window's OnShow event firing before dynamic data is populated. Keep in mind that the window events really have nothing to do with the dynamic data values. They all update separately from each other so we can't really guarantee an order.

gm9 12-08-2008 02:38 PM

Yeah I think that's probably my fault, but anyway I agree that your new OnTextChanged event should solve most if not all of the timing issues.

Drumstix42 12-08-2008 03:23 PM

Agreed, looking forward to OnTextChanged big time

dragowulf 12-08-2008 07:01 PM

We need some kind of Property that allows custom windows to be visible upon login, without a macro and /show_window command.

SOE-Rothgar 12-10-2008 08:01 PM

I used OnSize() in a cool way today. We have a new UI element coming out soon that we wanted to be resizable but it contains a UIText element on it that we don't want cut off. Its now scripted to use a smaller font size if the width of the element gets too small.

-- Edited --

Ok, I tore out the FixedRatio stuff I already mentioned. It had some strange side-effects that didn't look polished and I found another way to achieve the same result without putting a ton more time into making FixedRatio work right.

Drumstix42 12-10-2008 11:42 PM

Nice. This could be a good way to keep textbox elements in the right scroll area when resizing a parent element maybe?

I just know, for example, in the info center, if you resize the window it will make the internal text areas scroll back to the top. Maybe wishful thinking ;)


All times are GMT -5. The time now is 04:14 AM.

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