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 |
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).
|
Quote:
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 |
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 Have another page where you have a numbered list Code:
|- OrderPage 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