ID:138285
 
Okay, here's the deal. I'm trying to get one of those "Press Enter To Continue" deals going by using
prompt("Press Enter To Continue") To sleep the proc until the user presses enter. When I try it I get this:

usage: Press-Enter-To-Continue "text"

...which I assume means that prompt() can't be used in this fashion. My question is... How could I do it without using prompt()?

On 11/26/00 12:49 pm Manifacae wrote:
My question is... How could I do it without using prompt()?

For situations like this, I would create an object named "Click here to continue" and place it in a panel that is brought forward.

mob/proc
Start()
usr << "Click in the Alert panel to continue."
var/obj/alert/continue = new(usr)
Continue()
usr << "You have continued!"

mob/var
alerts[0]

client
Stat()
if(alerts.len)
statpanel("Alert",alerts)

obj
alert
continue
name = "Click here to continue"
Click()
Continue()
usr.alerts -= src
del(src)

Z
On 11/26/00 12:49 pm Manifacae wrote:
Okay, here's the deal. I'm trying to get one of those "Press Enter To Continue" deals going by using
prompt("Press Enter To Continue") To sleep the proc until the user presses enter. When I try it I get this:

usage: Press-Enter-To-Continue "text"

...which I assume means that prompt() can't be used in this fashion. My question is... How could I do it without using prompt()?

You bring up a good concern. Right now interrupts (like alerts, message boxes, and "continue buttons") are not so easily accessible in BYOND. We'll be introducing such elements in the future. In the meantime, you can use Zilal stat-panel idea, which works pretty well. Or you can use prompt() with slightly different wording, eg:

usr << prompt("continue?","yes") in list("yes","no")

which will popup a list with two choices ("yes" selected by default); I guess you'll have to handle the case where they don't want to continue though!

Typically this sort of "enter to continue" command is used to ensure that the user has read some text or something before moving on. Since you probably don't want to introduce a popup (the default prompt behavior) at this point, the wisest interface might be to use topic links. That is, you could put the user in some sort of "waiting state" (defined by a world-defined flag var) and then output a "Click to continue" link. When they click the link (calling a Topic() proc) you could take them out of this waiting state and continue the action for them. If that sounds useful I or someone else on the board could assist you in the details.