Official ScriptUO EasyUO Scripts > Scripting Tutorials

New Menu Code and how to adapt old scripts

<< < (4/4)

manwinc:
But when I recreate the combo, it needs to have a different unique name than the original?

manwinc:
I mean, it wouldn't be that hard to adapt my own code to generate a unique id every time I created something on the menu and then return the unique id for that item so I could set another variable to track it. Just trying to get a feel for it.

Gaderian:
It seems that the unique id rule, while originally required by Cheffe's explanation, has changed a little. Someone may say it is an incomplete rule or overly strict, but I tested it with the original implementation and it was correct. The behavior is a little looser now in some situations.

Today, my definition is more like, "unique ids are required for anything you want to reference (think menu get for checkboxes, radio buttons, edit fields), images (all menu image and menu shape must be unique), forms, panels".

TrailMyx has proven that you can delete and recreate buttons. When the new menu code was released, I had a routine that deleted and recreated a button - which failed to work. If you have more than one button with the same name on the same form, will confuse the menu engine. So the delete/recreate can work. Personally, I would rather have unique id's for all buttons. Hide and show (menu setprop ___ visible true/false) makes more sense to my brain because then I have a known value in #MENUBUTTON for an action.

To re-iterate about the list box and combo box... you can delete and recreate these - as it is the only way to remove an entry.

In general, you can't have more than 1 of anything you could reference by name to get information from it. So anything that could udpate #MENUBUTTON or #MENURES. Also all 'menu image/shape' must be unique.

Gaderian

Navigation

[0] Message Index

[*] Previous page

Go to full version