Jump to content

Item Commands - Order


SecretSquirrel-BJC

Recommended Posts

This is probably a question with an obvious answer but I would appreciate some help

 

When I create 3 commands (say A, B, C) for an item, I cannot guarantee that the commands will be shown in the order of A, B, C

 

It doesn't seem to matter about the name or text of the command or the order in which they are defined.

 

Thanks

Link to comment

I tried moving some commands around in the Lua file and even changing the GUIDs (hex strings). At one point a change which I made did have an effect, but I was unable to reproduce it. So I presume it's considered unimportant. Matters are complicated by the fact that the command verbs are listed twice.

 

Earwigo displays commands sorted by the command verb, and puts them in that order into the Lua file. I don't know if the compiled cartridge respects the Lua file order. If it does, then a (weak) workaround when using the Groundspeak builder would be to arrange the verbs by hand just before compiling.

Link to comment

Hi Folks

 

using techniques discussed in http://wherigobuilder.wikispaces.com/Reverse+Engineering

I discovered that I could use something called CommandsArray to order the item commands how I want

 

itmGB.CommandsArray[4] = itmGB.Commands.zcmdAboutGame -- first on menu

itmGB.CommandsArray[3] = itmGB.Commands.zcmdAboutAuthor

itmGB.CommandsArray[2] = itmGB.Commands.zcmdAboutBuild

itmGB.CommandsArray[1] = itmGB.Commands.zcmdAboutYou -- last on menu

Link to comment

i might be wrong, but ... it seems to me that the sorting from CommandsArray is only a coincidence or some kind of a side-effect. in lua, when iterating over a table the obvious way, you are never guaranteed that you will get the elements in any particular order.

 

that said, you can easily test if you're on ppc/oregon and sort the array accordingly

Link to comment

We have had this theme in our german board and made some tests. We determined that different devices may have different orders. Particularly with switching commands visible/invisible its impossible to make a solid order. I these case the order changes from case to case in the same cartridge ! An idea was to give the commands a "priority" attribute.

Red (Prio 1)

Green (Prio 2)

Blue (Prio 3)

I would always have the order Red-Green-Blue

 

@yourself : in the next version ? :anibad:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...