[solved]Is it possible to edit the 'wait' function?

I mean this 'wait for keypress' thing. The only thing I wanna change is the color of the printed ''Continue...'' hyperlink so that it matches the other hyperlinks. But most important for a better contrast from the dark background.


Virtually everything display-related in Quest is done using Javascript. In this case it's fairly simple, as you just want to change the style information of an element.

The command you want will be something like:

JS.eval("$('#endWaitLink').css({color: 'green'});")

That will change the colour of the "Continue…" link to green; and it should stay green whether it's shown or hidden. But it will go back to its default colour when a saved game is reloaded, so I would recommend sending the JS command in your "UI Initialisation Script" (which is on the 'Advanced Scripts' tab of the game object, but you might have to enable it by ticking a box on the 'features' tab first). This is just what UI Initialisation is meant for: that script is run before the start script on a new game, and when a saved game is reloaded, so it ensures you will always have the colour you want.


Thanks a lot again.

[•••]whether it's shown or hidden.

Now, this seems interesting. How would I hide the hyperlink?
That means I could show anything else instead, even an image file.
However, I do realize there might be settings to change the font and size of the default ''Continue...'' link, and maybe even the string itself?


I believe there's a function to change the string of the continue message, but I can't remember what it is.

You can change just about anything about it using simple javascript:

JS.eval("$('#endWaitLink').css({color: 'green', fontSize: '16px', fontFamily: 'FoglihtenNo07, Comic Sans, cursive'});")

And to change the text:

JS.eval("$('#endWaitLink').text('Get on with it!');")

or combine style and text:

JS.eval("$('#endWaitLink').text('What are we waiting for?').css({color: 'pink'});")

or with HTML:

JS.eval("$('#endWaitLink').html('<img src=\"" + GetFileURL("continue_link.jpg") + "\" alt=\"Continue…\" />');")

The link is automatically shown when you call wait, and hidden again when the wait ends. So hiding it yourself won't actually do anything.
If you want it to not appear (which may make your game unplayable for mobile users, because they can't press a key if they don't have a keyboard) the easiest way would be to set the text to nothing:

JS.eval("$('#endWaitLink').text('');")

or to remove the link entirely:

JS.eval("$('#endWaitLink').remove();")

If you know the ID, the same commands can change the style of just about every part of the Quest interface.


So hiding it yourself won't actually do anything.
If you want it to not appear (which may make your game unplayable for mobile users, because they can't press a key if they don't have a keyboard)

Thanks, this is important info.
I was just curious... changing the color is really enough for now.

[•••]using simple javascript[•••]

Easy said... having zero Java knowledge ... *smile*


The link is automatically shown when you call wait and hidden again when the wait ends. So hiding it yourself won't actually do anything.
If you want it to not appear (which may make your game unplayable for mobile users, because they can't press a key if they don't have a keyboard) the easiest way would be to set the text to nothing:

Actually, this is what I was looking for to create the credits at the end.


I might suggest:

JS.eval("if (platform != 'mobile') {$('#endWaitLink').text('');}")

That way, the 'Continue…' link will disappear, but still be there for people playing on a mobile (where the onscreen keyboard won't appear unless the command bar is there, so they need a link to advance).

(I think that tapping anywhere should continue; but last time I tried it this didn't work on mobile. I'll take a look at fixing that at some point, so you don't need to preserve the continue link for mobile players)


Thanks but better not overthinking things now. I solved this bugging color thing and many other things need to be done.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums