Thread: Changing Name
View Single Post
  #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