Author Topic: New Menu Code and how to adapt old scripts  (Read 6242 times)

0 Members and 1 Guest are viewing this topic.

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: New Menu Code and how to adapt old scripts
« Reply #15 on: January 15, 2021, 06:10:10 PM »
0
But when I recreate the combo, it needs to have a different unique name than the original?
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: New Menu Code and how to adapt old scripts
« Reply #16 on: January 15, 2021, 06:12:45 PM »
0
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.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 350
  • Activity:
    0.4%
  • Reputation Power: 8
  • Gaderian has no influence.
  • Respect: +42
  • Referrals: 1
    • View Profile
Re: New Menu Code and how to adapt old scripts
« Reply #17 on: January 15, 2021, 06:54:15 PM »
0
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
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Tags: