EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > UI Developer Discussion

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 03-29-2011, 11:58 AM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,095
Default 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
Reply With Quote
  #2  
Unread 03-29-2011, 12:02 PM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

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).
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #3  
Unread 03-29-2011, 01:13 PM
TalTal TalTal is offline
A Griffon
Featured
 
Join Date: Nov 2005
Server: Nagafen
Posts: 1,095
Default

Quote:
Originally Posted by gm9 View Post
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

Last edited by TalTal : 03-29-2011 at 01:27 PM.
Reply With Quote
  #4  
Unread 03-29-2011, 01:29 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

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. 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.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>

Last edited by Drumstix42 : 03-29-2011 at 01:32 PM.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:16 AM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI