ID:271026
 
Is there a way i can make text preform an action, but in a html popup such as inside the browser?
In other words, instead of a button being the one clicked, it would be text. and how could i do it?

-EDIT-
I dont mean like a url, like when you clcik the text, it'd start a proc. that kinda thing.
If I understand you correctly, you would use topic.

client/Topic(href)
if(href=="here")//if the href in the <a href=?here>, found below in browse(), is here it executes this action.
src.Procedure()//the action executed is the test procedure.



mob/verb/Test()
src<<browse("Hello go <a href=?here>here</a>.")//this part contains <a href=?here> which makes all text after it a link, when this link is clicked, whatever is after the ? in <a href=?here> is checked.If its in Topic somewhere the code under the if statement for it in Topic is executed.

mob/proc/Procedure()//the test procedure, since you wanted a procedure executed when the "link" was clicked.
usr<<"!"
In response to Dragon_fire6653
and how about if i wanted multiple lines in the same popup?. like:

Line 1: Here1
Line 2: Here2
In response to Chibi-Gohan0
So, your asking what to do if you want something like :

Click here : [topic() link here]

Click here to : [topic() link here]

?
In response to Dragon_fire6653
yeah, two in one popup?
In response to Chibi-Gohan0
ok.You keep saying pop-up, do you want it in the browser, or in an actual "pop-up"?

Anyways,using the same way as before, you can just add another if statement to Topic() and make another link.
client/Topic(href)
if(href=="here")//if the href in the <a href=?here>, found below in browse(), is here it executes this action.
src.Procedure()//the action executed is the test procedure.
if(href=="here2")//see how I made a new if statement?
src.Procedure2()



mob/verb/Test()
src<<browse("Hello go <a href=?here>here</a>.<BR><BR>Go <a href=?here2>here too.")//notice the new <a href=?here2> also dont mind the <BR> , its just HTML that I thought would make it look nicer =p

mob/proc/Procedure()//the test procedure, since you wanted a procedure executed when the "link" was clicked.
usr<<"!"

mob/proc/Procedure2()//procedure 2
usr<<"?"
In response to Dragon_fire6653
thanks
In response to Dragon_fire6653
That would be usr.procedure, because you are the topics usr not src, and you should put usr in a proc, it is bad practice.
In response to Xx Dark Wizard xX
Incorrect, since it's a client/Topic, he should be using mob. not usr. or src. to call a mob/proc :|

- GhostAnime
In response to Xx Dark Wizard xX
You probably want something like this
client
Topic(href, href_list[])
..()
switch(href_list["action"])
if("test")
var/html={"This is a test, <a href=byond://?action=test2>test 1</a>"}
mob<<browse(html)
if("test2")
var/html2={"this is another test, <a href=byond://?action=test>test 2</a>"}
mob<<browse(html2)
mob
verb
TopicTest()
var/link="<a href=byond://?action=test>Click Here</a>"
usr<<link
In response to Xx Dark Wizard xX
Thanks for all the help. i understand the basics of it anyway.
In response to Chibi-Gohan0
Another question, if i made it with html so yo ucant close out, how could i use one of those to close the popup?
like a Cancel text butten for example?
In response to Chibi-Gohan0
mob<<browse(null,null)
In response to Xx Dark Wizard xX
Okay, thanks.
In response to Chibi-Gohan0
If you wanted to close multiple windows, you would need to store them in a list, and then loop through them and call a close topic on them.
In response to Xx Dark Wizard xX
easy. makes sence too.
In response to Xx Dark Wizard xX
Xx Dark Wizard xX wrote:
mob<<browse(null,null)

This dident work. When i hit the cancel button, it did nothing.
In response to Chibi-Gohan0
What do you mean a "cancel" button? You probably want to do some html input and when clicked calls topic.
In response to Xx Dark Wizard xX
As in, if i set the popup's can_close=0 can_resize=0 can_minimize=0

So you cant close it normally. I want a button that can close it somehow.. i know its been done.
In response to Chibi-Gohan0
How can i do this?
Page: 1 2