ID:156438
 
Hi guys!
I'm currently using a library that incorperates Screen text into my game. I really enjoy it! The only thing I've added to it was when ever the box for the text to fit in is created, it creates "x" and "->" buttons for people to cancel/continue reading the text. The "x" button's code was simple enough to do.

My only question is how I would go about dialog progression. I want to be able to press the "->" (Which means the icon just looks like an arrow) which will clear the text in the dialog box and output the new text, both of which I can do. How exactly can I have the game know which dialog to output the correct text to the player in the appropriet context?

And just in case this information is required: I have a mob/proc handling the text output and button obj creating. obj/Click() for the buttons to do their thing, and another mob/proc to clear any of these things from the clients screen.
Well, you would either have to set a variable on the player (next text is type thing or current text is) or you could have a proc that waits for an action, then once received proceed.

I personally prefer the 2nd method, and there is a resource made for this:
http://www.byond.com/developer/Garthor/GetClick
In response to Pirion
Heh! Thanks again Pirion. I'll give it a shot.
In response to Pirion
Hey! First of all, I love your GetClick() library.
Anywho, my only concern at the moment is that when ever I click anywhere BUT my "->" button, it no longer registers the button if I do click it afterwards. Here:
Hey! First of all, I love your GetClick() library.
Anywho, my only concern at the moment is that when ever I click anywhere BUT my "->" button, it no longer registers the button if I do click it afterwards. Here:
<dm>
mob
proc
bleh()
screentextbackground()
screentext([text1)
var/obj/Buttons/Next/S = GetClick()
if(istype(S))
deletetext()
screentext([text2])
var/obj/Buttons/Next/A = GetClick()
if(istype(A))
//And so on and so forth...

You see if I click anywhere else, it renders the button useless. Is there a way for me to keep my GetClick() as the Next button's path during this situation? I can't use while only because the screen text flashes because it's deleting and reoutputting the screentext.




In response to Yurokei
You'd use a while() loop. In this case, something like:

while(!istype(GetClick(), /obj/Buttons/Next))
// Do nothing
// Do stuff


Or, perhaps more explicitly:

var/X = GetClick()
while(!istype(X, /obj/Buttons/Next))
X = GetClick()
// Do stuff
In response to Garthor
Ffff. Thank you...

I feel so inefficient when it comes to coding. Like, I can find my way around code, understanding how most libraries work ect ect. Just when it comes to fabricating it myself, my thoughts get too scrambled for me to piece them together logically. Like that answer.

Thanks again