EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   UI Developer Discussion (https://www.eq2interface.com/forums/forumdisplay.php?f=3)
-   -   Changing Name (https://www.eq2interface.com/forums/showthread.php?t=15539)

TalTal 03-29-2011 11:58 AM

Changing Name
 
Quick Question.
If I were to change the name of an element dynamically and then refer to it from that point forward as the new name, assuming that there was no other element with the new name, would that work?

ie.
<Button Name="SampleA" Location="1,1" Size="1,1" OnPress="
Name='SampleB'
"/>
SampleA.Press=true
COND = SampleB.Left

Would COND == 1 ?

If so, is there a reason not to do this?


Silat

gm9 03-29-2011 12:02 PM

It will work although it's not immediately apparent to me why you would want to do this (the only times I ever used this was to create duplicates of hardcoded elements in game - nothing I ever released though).

TalTal 03-29-2011 01:13 PM

Quote:

Originally Posted by gm9 (Post 96490)
It will work although it's not immediately apparent to me why you would want to do this (the only times I ever used this was to create duplicates of hardcoded elements in game - nothing I ever released though).

Basically my idea for sorting the elements on the bottom bar is to let the user set the position via a number dropdown. This would be stored in the width element of the state storage page for each element. The easy way out would be to make all elements exactly the same width but this would leave lots of wasted space on the bottom bar since the smallest element would have to reserve enough space for the biggest.

Since I need each element to be a different width I have to calculate them in order of appearance on the bar to determine the next elements start location. I can parse all storage elements for their width(order) each time through or I could parse each storage element once and then set its name to be its width(order) and then just parse them straight down the line for display purposes.

What I really need is an array. But I have seen no documentation on arrays for the ui.

edit: To include a better example.

<Page eq2usescomwndcontrols="true" UserResizable="true" Activated="true" Name="Item01" Descrip="Platinum Coin" Size="2,1" Location="1,1" VisSize="50,20" LSize="18" ILabel="PP:" IData="/GameData.Coins.Coin_3" OnShow="Location='99999,99999'"/>
<Page eq2usescomwndcontrols="true" UserResizable="true" Activated="true" Name="Item02" Descrip="Gold Coin" Size="1,1" Location="1,1" VisSize="34,20" LSize="18" ILabel="GP:" IData="/GameData.Coins.Coin_2" OnShow="Location='99999,99999'"/>
<Page eq2usescomwndcontrols="true" UserResizable="true" Activated="true" Name="Item03" Descrip="Silver Coin" Size="4,1" Location="1,1" VisSize="34,20" LSize="18" ILabel="SP:" IData="/GameData.Coins.Coin_1" OnShow="Location='99999,99999'"/>
<Page eq2usescomwndcontrols="true" UserResizable="true" Activated="true" Name="Item04" Descrip="Copper Coin" Size="3,1" Location="1,1" VisSize="34,20" LSize="18" ILabel="CP:" IData="/GameData.Coins.Coin_0" OnShow="Location='99999,99999'"/>

The way these are set Item02 , item01, item04, and item03 would be the display order. But to figure that out I would have to parse all elements (which including dividers is 100 elements) to find the first, then parse all again to find the second, and so on.

I was thinking if I renamed them...ie item02 renamed to item01, item01 to item02, and so on then i would only have to parse the list once.

Silat

Drumstix42 03-29-2011 01:29 PM

You could set up a data page with the names of each stat and just have a Width property assigned to each stat, ie:

Code:

|- WidthPage
  |- Health (Width = 150)
  |- Power (Width = 150)
  |- CritChance (Width = 40)

Then setup window elements to be saved and assign their height (or something) to be the number of the location of the element (the order). You do this by locking that window and then setting a property, and then unlocking it.

Have another page where you have a numbered list

Code:

|- OrderPage
  |- Stat1
  |- Stat2
  |- Stat3
  ...

When you initiate the code, you would load the pages and OnShow for each window that got saved it would read the Height value, and fill into the appropriate OrderPage element. Then you would load each element (going in order 1, 2, 3, etc, and use the values from datapage with the Widths to fill in the actual stat bar.

I thought about doing this for a while, but decided it's just too much code for a little bit of customization that doesn't truly affect how you play the game ;) I wanted to wait for LUA to make it more realistic and uncluttered code. :mad: Plus each time you would want to reorder one stat, it would have to recall all the code, and it seems like such a clusterf*ck to do.


All times are GMT -5. The time now is 12:34 AM.

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