Code:
mob var Actionsup = 0
obj proc GatherUI() if(usr.Actionsup==0) overlays += image('BotanyUI.dmi',"Extract") usr.Actionsup = 1 usr << output ("[usr] attempts to extract [src].", "output1") else overlays -= image('BotanyUI.dmi',"Extract") usr.Actionsup = 0 usr << output ("[usr] no longer attempts to extract [src].", "output1")
obj Lilac Lilac icon = 'Lilac.dmi' icon_state = "" layer = 7 Click(location,control,params) var/p=params2list(params) if(p["right"]) GatherUI()
|
Problem description:
I'm trying to make a UI for displaying interaction options an object has. However, I can't seem to get the code to do what I want. The code I have works fine when dealing with one plant alone, but when I have two or more and I right click on one, then the other, it doesn't close the first one. Instead, both have a UI up. I need to make right clicking on one close any other UI that is up before bringing up a new one.
Now for your actual problem I would go with something like this:
Hope this helps.