ID:138577
 
I'm trying to allow guides to edit the attributes of turfs and such by right-clicking on the object in the panel that represents the desired turf, from which they can choose an edit command.

I seem to recall this used to work -- but now I don't get the verb menu when I do that.

It's possible I'm setting the src incorrectly...is this supposed to work?
On 5/29/00 5:54 pm Deadron wrote:
I'm trying to allow guides to edit the attributes of turfs and such by right-clicking on the object in the panel that represents the desired turf, from which they can choose an edit command.

I seem to recall this used to work -- but now I don't get the verb menu when I do that.

It's possible I'm setting the src incorrectly...is this supposed to work?

It should work. A few releases ago we modified things so that the verb lists would only appear if there were verbs in it (to avoid having lots of "area" entries and such), so that could explain the lack of panels.

Do the verbs appear accessible from the command line? For instance, if you have a verb like "kick rock" and you can indeed parse it from the command line, then you should be able to click on rock and select "kick". I'll do some tests on my end but please report inconsistencies if they show up.
In response to Tom H.
Do the verbs appear accessible from the command line? For instance, if you have a verb like "kick rock" and you can indeed parse it from the command line, then you should be able to click on rock and select "kick". I'll do some tests on my end but please report inconsistencies if they show up.


I'll do some more testing, but I probably should be more clear in my description to make sure we're talking about the same thing.

I have "command" objects which only exist in panels. (They are very simple, but maybe I'll post them in the Code & Demos sections soon). They allow me to have items in panels that you can click on to execute commands, not unlike verbs, with the added benefit that these commands can have icons associated with them.

Currently I use them to let the guides lay down turf types. In the browser, the guide selects the kind of turf they are interested in (Grass, Rocks, Walls, etc). Say they click on Grass -- the Build panel fills with objects representing the available grass turfs. They click on whichever grass object they are interested in and then they can lay down grass on the map.

I want the "command" object in the panel to have a verb menu, so the guide can right-click to choose to edit the attributes of Crab Grass turfs.

I added an Edit() verb to the "command" object, but right-clicking on the object in the panel does not bring it up.

Could be a src thing, could be a byond thing... I'll try to think of a way to test it.

Well, here's a question: what src setting should I use in that case?
In response to Deadron
On 5/30/00 4:12 pm Deadron wrote:

I added an Edit() verb to the "command" object, but right-clicking on the object in the panel does not bring it up.

Could be a src thing, could be a byond thing... I'll try to think of a way to test it.

Well, here's a question: what src setting should I use in that case?

Try this:

obj/Command
verb/Edit()
set src in world // always accessible
...

Whenever a Command object exists in the world (even at null), it will have an accessible Edit() verb for all mobs. You can filter out particular mob types within the proc itself. If you want to filter out the mobs beforehand (ie- make the verb only accessible to mob/builder types), you'll have to make it instead a mob verb:

mob/builder/verb/Edit(obj/Command/O as obj in world)
if(!istype(O)) // is it really a command?
usr << "You can't edit that!"
else
O.Edit() // where Edit() = obj/Command/proc/Edit()

Unfortunately this method allows all objects to appear editable (only to be filtered out within the proc-- that's what the istype() line is for) So it's not ideal either. Eventually we'll probably have a way to get the notation completely right.

For your case, I think you want the first example. See if that works.

In response to Tom H.
Try this:

obj/Command
verb/Edit()
set src in world // always accessible
...


Ah, set src in world works perfectly. Thanks much.