ID:158302
 
I wanted to know if there was a way to make an object (Kinda like a Case) that when you clicked on it a window appeared showing the content of it... XD Kinda like Resident Evil 4 inventory case
Goukaryuu wrote:
I wanted to know if there was a way to make an object (Kinda like a Case) that when you clicked on it a window appeared showing the content of it... XD Kinda like Resident Evil 4

obj
var
notes = null
Case
name = "Clickable Case"
Click()
usr<<browse(notes,"window=Case,size=300x300")
verb
Edit_Case_Message()
var/message = input("What would you like to change the message to?","Case Message")as message|null
if(!message) return
notes = message
usr<<"Changed message to:"
usr<<"[message]"

I'm sure Vic or someone will provide a better explanation, but this should be about right, it worked when I tested it just now.
In response to Cyberlord34
obj
case
var/notes="Default message."
name="Click me!"
Click() //when it's clicked once
usr<<output(notes, "output1") //output the notes to whatever output you use
verb/EditMessage()
src.notes=input("What do you want to write here?") as message|null
if(!src.notes) return //they didn't type in a message at all, or hit cancel
else //it's not null, let things happen
usr<<"The notes in this case were changed to [notes]!"

Using a browse() for this seems redundant to me, but eh.
In response to Vic Rattlehead
Both were helpful for something else I was planning to do XD but that's not what I meant... Sorry maybe I didn't explained myself what I want to do is see the obj in the pop-up window or browser... not the name but the obj itself (The image)... I hope I explained myself this time... sorry xD... If this is impossible sorry to have bothered xD