EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   UI Developer Discussion (https://www.eq2interface.com/forums/forumdisplay.php?f=3)
-   -   Hey is there any way to do this? (https://www.eq2interface.com/forums/showthread.php?t=12312)

Landiin 02-06-2009 02:43 PM

Quote:

Originally Posted by SOE-Rothgar (Post 80693)
We could always modify the client to use Lua as its scripting language, but then you'd have to re-write every line of your UI code. :)

I'm down for that! I'd resurrect eXtremeUI if you guys added a real scripting language.

Not saying you guys haven't done a super fantastic job making the UI even easier to mod. I just hate having to do 10 steps to get 1 thing done.

Come to think of it, you could do it in a way people wouldn't have to recode every line of their UI. Just add new evens LUAOnShow, LUAOnHide... etc..

Landiin 02-06-2009 02:45 PM

Quote:

Originally Posted by gm9 (Post 80695)
It's probably a bit late in the game for LUA

Hush you, nothing is to late.. I vote make this your #1 Rothgar :)

SOE-Rothgar 02-06-2009 04:30 PM

Yeah, I considered that we could have separate functions for lua commands, and then I decided that it would be much easier to add a new property to UIWidget "UseLuaScript" and if that property is set to true then all functions would be processed using the lua interpreter.

I talked to a coworker who is a big lua fan and has been doing lots of server-side lua work and he was pretty excited about this idea too. He's the type of guy that likes working on little side-projects too, so I'm thinking maybe I'll keep pestering him to do it. :)

With a lua script engine we'd have true function calls and we could expose a whole lot more of our UI to scripting. It would be much easier to create functions for reading/writing your own data to the new xml file. You'd also get all the built-in functions for lua. It would be nice being able to create local variables that don't turn into widget properties. The lua environment would be implemented on a window basis, so while each event would have its own stack space, you could declare global variables on a window level and they'd persist between function calls. So you wouldnt have to store data in widgets.

Implementing the "UseLuaScript" property would let existing UI's continue using UIScript even down to a widget level.

gm9 02-06-2009 04:38 PM

Actually if you properly implement it LUA should be unicode or even binary compatible. Don't mess it up! :p :D

Drumstix42 02-06-2009 06:48 PM

Haha.

INI's saved as editble XML...
A possible in-game replacement of EQ2.ini setting files...
New UI script functions and events...
Talk of LUA function scripting...

Holy cow, EQ2 UI is really coming together this year. Can I get a hoorah for 2009?

gm9 02-06-2009 06:51 PM

Hoorah. :)

Landiin 02-06-2009 07:09 PM

Quote:

Originally Posted by SOE-Rothgar (Post 80702)
Yeah, I considered that we could have separate functions for lua commands, and then I decided that it would be much easier to add a new property to UIWidget "UseLuaScript" and if that property is set to true then all functions would be processed using the lua interpreter.

Yea that's even a better idea.

Quote:

Originally Posted by SOE-Rothgar (Post 80702)
The lua environment would be implemented on a window basis, so while each event would have its own stack space, you could declare global variables on a window level and they'd persist between function calls. So you wouldnt have to store data in widgets.

I would think you would implement it at root level. While lua isn't a OO language out of the box there are packages out that adds OO to the lua language. Ether way I'm looking forwards to it.

SOE-Rothgar 02-06-2009 07:35 PM

Quote:

Originally Posted by Landiin (Post 80707)
I would think you would implement it at root level. While lua isn't a OO language out of the box there are packages out that adds OO to the lua language. Ether way I'm looking forwards to it.

You're right, it would be done this way. I was just trying to give an example of using data out of scope of the local event.

dragowulf 02-06-2009 11:36 PM

Darn it. I'm just getting the hang of EQ2's XML..does this mean that I'm going to need to learn LUA (which means more questions for me to ask, which is bad for you guys because you have to answer) to maintain awesome status?

I'm still down for it however or if you guys decide to do it.

Is LUA more hard than EQ2 XML?

Drumstix42 02-07-2009 04:56 AM

Lol. I haven't scripted with it myself before, but I've looked it over.

It's a normal scripting language (not tags like XHML) allows functions/methods, classes, code comments, etc...

http://lua-users.org/wiki/ClassesAndMethodsExample

I think it's more unfortunate than "too late in the game" for lua to just be implemented now. As in, it would have been awesome to see this sooner. No complaints though. Looking forward to any more info on this going into development status.

dragowulf 02-07-2009 07:02 AM

So what are some benefits of the LUA scripting language? I do know that you don't have to keep doing all these useless strings, but that's about it.

Landiin 02-07-2009 10:53 PM

Quote:

Originally Posted by dragowulf (Post 80716)
So what are some benefits of the LUA scripting language? I do know that you don't have to keep doing all these useless strings, but that's about it.

http://www.lua.org/docs.html

Search Google for tip & tricks and examples.

dragowulf 04-06-2009 05:15 PM

COND1=a && b

For some odd reason this screws up the whole interface when put in a On property. Any other way to write it so it doesn't do that?

Drumstix42 04-06-2009 05:17 PM

Strange.

The threat window has an || conditional in the OnSize property.

dragowulf 04-06-2009 05:20 PM

OnTextChanged="COND1=a && b"

When I restart EQ2 for some reason it makes everything Default. Is it the way I'm writing the code?

Drumstix42 04-06-2009 06:12 PM

Post your code.
If you're only changing the variable COND in OnTextChanged, I don't think anything is gonna be updated.

dragowulf 04-06-2009 06:23 PM

Quote:

Originally Posted by Drumstix42 (Post 82257)
Post your code.
If you're only changing the variable COND in OnTextChanged, I don't think anything is gonna be updated.

IDK. When I go to load UIBuilder with OnTextChanged="COND1=a && b" in my file UIBuilder screws up a hell of a lot, but when I delete the && part it is fine.

I'll try something really quick, if it doesn't work than I will post the code.

dragowulf 04-06-2009 06:29 PM

Ok I found it I think. It seems that I have to write it as OnTextChanged="COND1=a && b" in a Text Editor rather than OnTextChanged="COND1=a && b"

Drumstix42 04-06-2009 06:38 PM

Ah, okay. Yup :D

dragowulf 04-06-2009 07:57 PM

Lol I'm just full of unreleased mods.

Here's a screenshot of my most recent unreleased mod that uses some of the coding methods that was discussed in this thread. Pretty much a more in depth look-a-like of Dolby's proposed Hotkeys, with some added features.


Drumstix42 04-06-2009 09:16 PM

Good work. I hadn't thought about putting the bars above the hotbars until now. Looking forward to more expansive modifications.

We can only go up from here :cool:

dragowulf 04-06-2009 11:44 PM

I actually had to do a little more work than how it looks. If you want I can post the code, or I will probably release it when I've got the few known bugs fixed.

Some things to notice:
  • I made the ProgressBar/Text change colors depending on it's progress.
  • The frame on the first Hotbar is shown, but on the second and third Hotbars it is not, same with the added frame border around the ProgressBar. They will change depending on whether you want the IconBorder enabled or disabled (via the Hotbar Settings).
  • It wasn't as easy to code as one would think...at least for me..:p

Drumstix42 04-07-2009 02:26 AM

I think best of all it looks clean.
For me it's a bit different as the bars I've been messing with go right to red after you've used it (and obviously stay red as I haven't messed with them lately).

I like your border/no border idea. I think the borders work well if you're gonna have a bar showing all the time (like green is ready, red is refilling). But for the ones without borders, I like your color scheme better. Though with your color scheme I would think you would fill the bar left to right (go from red to green), LOL. I'm babbling.

Feel free to post your code. If anything I just like to see if to spawn new ideas for other windows, and the such. There seems like so much potential for new mods, but it just requires some ideas first :)
Did you figure out how to make it works for hotbars that are not horizontal only (I can kinda care less if it's not possible, but I'm curious) ?

gm9 04-07-2009 03:55 AM

Quote:

Originally Posted by dragowulf (Post 82266)
Here's a screenshot of my most recent unreleased mod that uses some of the coding methods that was discussed in this thread. Pretty much a more in depth look-a-like of Dolby's proposed Hotkeys, with some added features.


Nice shading, I like the looks of this. I assume it won't work when the hotbar is not in a straight line or did you find some way around that?

dragowulf 04-07-2009 07:10 AM

Right now it only works 100% with it horizontal, I found it too tedious to try to make it work otherwise. I can make it work otherwise, but it wouldn't look the same...any suggestions?

Quote:

Originally Posted by Drumstix42 (Post 82276)
I like your border/no border idea. I think the borders work well if you're gonna have a bar showing all the time (like green is ready, red is refilling). But for the ones without borders, I like your color scheme better. Though with your color scheme I would think you would fill the bar left to right (go from red to green), LOL. I'm babbling.

You mean that I have it flipped? Instead it should start as Red -> Orange -> Yellow -> Green rather than green first? That does sound logical.

left2right rather than right2left? That would look insanely weird for me.

Zonx 04-07-2009 01:36 PM

Depending on how the icons are set to scale, it may be possible to use the new OnSize event to pad the cell height enough to make room for the prog bars.

I'll test this soon as I get a chance since I've been dorking with this stuff myself of late. Possible probs I see with this...

A) if the icon scaling is not proportional, icons will stretch the icon vertically to fill the extra space.

B) Icon image and label vertical alignment may be an issue if everything isn't either top or bottom relative.

gm9 04-07-2009 03:03 PM

I thought the problem was that you couldn't pad just the height, but haven't looked at this in ages.

Zonx 04-07-2009 03:29 PM

Not sure if its possible with an IconBank and not able to test it atm. There's a couple ways this might be possible if IconBank supports any of the attributes. Could revert back to the less efficient Volume page approach originally used for Hotkeys if needed.

Personally, if its gonna require a performance hit, I'd just lay the bars over the icons.

dragowulf 04-07-2009 05:37 PM

For me it doesn't really change much performance the way I made it. The only thing that would decrease a little to no performance would be the changing of the colors, but I can make it so that all of the ReuseSec texts refer to one code for OnTextChanged, which is easy.

Zonx 04-07-2009 06:11 PM

Aye, but the issue comes up if we want a cell format that isn't square but still wraps properly when the bar isn't completely horizontal. Requires forcing the IconBank to use a cell height different than IconSize (not sure this is possible) or replace the IconBank with a less efficient Volume page approach.

Hotkeys where originally implemented as Volume pages. The IconBank was introduced specifically to improve performance, so I hesitate to revert back to Volume for everything just to get non-square cells that wrap properly.

gm9 04-07-2009 06:15 PM

I don't think you can go back to the volume actually, I remember the old volume coded hotbars stopped working when the IconBank was introduced.

edit: a non-square IconStyle might do the trick but I've never tested that

dragowulf 04-07-2009 11:48 PM

I don't think that you can do that anymore. I remember when they did the update that changed it to an IconBank, it broke the Hotbar windows...I could be wrong though

Drumstix42 04-08-2009 04:58 AM

Yeah fairly sure you can't do volume at all anymore.

Here was my origal implementation of dolby's original mock-up (with overlay numbers shown as well for original testing purposes):




The overlapping isn't horrible. Given my frames + bar = 6 pixels above the hotkeys:



The only problem is charge numbers getting covered up. Bump it down about 2 pixels, and it's even less of an inconvenience. :P

Zonx 04-08-2009 11:47 PM

After dorking with this some more, I decided the bars added too much extra clutter and didn't update smoothly enough for my tastes, so I ditched them.

In any case, I tried various padding and margin settings to force space above or below the icons with no positive results. One option I didn't try... create a new iconStyle that reserves the extra space. Even this may not work as intended if IconBank insists on square icons. Could clip or squish the icons.

Goldentale 04-10-2009 08:49 AM

Quote:

Originally Posted by SOE-Rothgar (Post 80693)
We could always modify the client to use Lua as its scripting language, but then you'd have to re-write every line of your UI code. :)

Actually...

We could do something like look for a string at the beginning of a script command like "<Lua>" and if it exists, parse the script with a lua interpreter, otherwise pass the script to the existing interpreter.

*wheels start churning*

Rothgar, not to hold you to this, but is there an estimate for when we may see this implemented? 1-3 months, 3-6 months, next expansion, the expansion after that?

To hear EQ2 may finally adopt LUA is mouth watering.

lordebon 04-10-2009 10:05 PM

Quote:

Originally Posted by Goldentale (Post 82417)
Rothgar, not to hold you to this, but is there an estimate for when we may see this implemented? 1-3 months, 3-6 months, next expansion, the expansion after that?

To hear EQ2 may finally adopt LUA is mouth watering.

My guess is that this kind of project would be the 3-6 months at the earliest. Rothgar has a lot on his plate I'm sure, and I think reworking the UI to use LUA is a pretty mighty task. But yeah, having a full-fledged script engine in the UI... mmm, possibilities.

dragowulf 04-11-2009 12:42 AM

I tried the hotkeys starting at Red -> Orange -> Yellow -> Green. In my honest opinion it kind of confuses me because of the color situation we are all use to. I had to revert it back because I was tripping hardcore. lol

dragowulf 04-11-2009 01:43 PM

Here's a screenshot of my newest version of my SpellTimer window. I'm pretty much done with testing, but it looks and works pretty cool. I might remove the color changing stuff because it drops FPS quite noticeably.

Drumstix42 04-11-2009 02:41 PM

Starting at green makes sense for me for buffs (cause green is "good" zone, long duration remaining). But for things like hotbars, I always thought it the other way around.

Anyhow. I've also come to the conclusion that bar timers on hotbars are kinda pointless. The numbers show you exactly how many seconds left, and the bar will always leave you guessing. My current setup just uses all numbers, and I left bars on 1 or 2 just remind me later if I get any good ideas.

The only thing I wanted to do what overlap the already existing refresh animation with a more apparently red bar that went from bottom to top, but give it some transparency. Currently can't do it.

On a side note, I really like the style of your spell window/timers.

Goldentale 04-15-2009 02:15 PM

Quote:

Originally Posted by dragowulf (Post 82458)
Here's a screenshot of my newest version of my SpellTimer window. I'm pretty much done with testing, but it looks and works pretty cool. I might remove the color changing stuff because it drops FPS quite noticeably.

This is a great looking addon Dragowulf, I hope you release it soon :)!


All times are GMT -5. The time now is 06:43 AM.

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