[RESOLVED] Restoring TypeHereLabel

OurJud
11 Jan 2016, 21:11I hope this isn't too naughty. I know it may seem like one of my recently unanswered questions in disguise, but that problem has come on enough now to hopefully warrant this.
I want to create the old DOS style > symbol, which will serve as a command marker, due to the fact that I hide my command box. Because of this, if a player inadvertently mouse clicks the screen, the flashing cursor will disappear, making if tricky to locate the command box again to get back the flashing cursor.
Now, in the libraries there's a function/command/whatever called TypeHereLabel, where you can simply change the text to whatever you desire.
But there a number of issues with this.
1. Simply changing the Type here... to >, results in | > instead of the desired > |
2. My Type here... is hidden, along with the background and border of the command box.
So, two questions:
What would I need to change to get back the Type here... label?
Is there any way to get the > to come before the flashing cursor, instead of after?
Below is what I've done with my game to hide the command box:
Hiding command bar
1. Go to game code and add the following after <firstpublished>2016</firstpublished>
2. Scroll right to bottom of code and immediately before </asl> add:
NB: The last two HideCommandBar functions here, are in case you want to hide the flashing parser/cursor while the intro plays. If you do, just call a Function script at the start of your intro and call it HideCommandBar (Just don't forget to unhide it at the end, when the game starts, by calling a Function again and calling it ShowCommandBar).
3. Back in the UI, go Game >> Script >> click the code view in Start Script and add:
Finally I suggest you download and install the retrostyle.aslx library file if all the above fails. I'm not altogether sure what the retrostyle library does, but it wasn't until I added it (along with all the above) that I got my game to look how I wanted: viewtopic.php?f=10&t=4760&start=60#p31475 (further investigation would suggest it includes the ClearScreen CSS hack, so you may or may not need to omit it from the last but one block of code in this post)
I think that's everything, but let me know if not.
I want to create the old DOS style > symbol, which will serve as a command marker, due to the fact that I hide my command box. Because of this, if a player inadvertently mouse clicks the screen, the flashing cursor will disappear, making if tricky to locate the command box again to get back the flashing cursor.
Now, in the libraries there's a function/command/whatever called TypeHereLabel, where you can simply change the text to whatever you desire.
But there a number of issues with this.
1. Simply changing the Type here... to >, results in | > instead of the desired > |
2. My Type here... is hidden, along with the background and border of the command box.
So, two questions:
What would I need to change to get back the Type here... label?
Is there any way to get the > to come before the flashing cursor, instead of after?
Below is what I've done with my game to hide the command box:
Hiding command bar
1. Go to game code and add the following after <firstpublished>2016</firstpublished>
<css><![CDATA[
<style type="text/css">
div#txtCommandDiv {
border: none;
background: no-repeat;
}
input#txtCommand {
outline:none;
border: none;
margin:0;
padding:0;
max-width: 1000px;
}
#status { display: none !important; visibility: hidden !important; }
</style>
]]></css>
2. Scroll right to bottom of code and immediately before </asl> add:
<function name="ClearScreen">
request (ClearScreen, "")
OutputTextNoBr (game.css)
</function>
<function name="InitUserInterface"><![CDATA[
JS.setCommandBarStyle (GetCurrentTextFormat("") + ";border:" + game.defaultbackground)
JS.eval ("$('#status').hide();")
JS.SetBackgroundCol ("black")
JS.eval ("$('#txtCommandDiv').prepend('> ')")
JS.OutputTextNoBr (game.css)
OutputTextNoBr (game.css)
request (SetInterfaceString, "TypeHereLabel=")
if (GetBoolean(game, "inprogress")) {
}
else {
game.inprogress = true
}
]]></function>
<function name="HideCommandBar">
request (Hide, "Command")
</function>
<function name="ShowCommandBar">
request (Show, "Command")
</function>
NB: The last two HideCommandBar functions here, are in case you want to hide the flashing parser/cursor while the intro plays. If you do, just call a Function script at the start of your intro and call it HideCommandBar (Just don't forget to unhide it at the end, when the game starts, by calling a Function again and calling it ShowCommandBar).
3. Back in the UI, go Game >> Script >> click the code view in Start Script and add:
JS.eval ("getCSSRule('a.cmdlink').style.color='#000000'")
JS.setCommandBarStyle (GetCurrentTextFormat("") + ";border:" + game.defaultbackground)
Finally I suggest you download and install the retrostyle.aslx library file if all the above fails. I'm not altogether sure what the retrostyle library does, but it wasn't until I added it (along with all the above) that I got my game to look how I wanted: viewtopic.php?f=10&t=4760&start=60#p31475 (further investigation would suggest it includes the ClearScreen CSS hack, so you may or may not need to omit it from the last but one block of code in this post)
I think that's everything, but let me know if not.

jaynabonne
12 Jan 2016, 20:42Not sure if this is the solution you'd want, but if you add this line to your InitUserInterface:
then it will set the focus back to the text command bar when they click on the page.
JS.eval("$('#gameBorder').click(function() { if ($('#txtCommand').css('display') != 'none') { $('#txtCommand').focus(); }});")
then it will set the focus back to the text command bar when they click on the page.

OurJud
12 Jan 2016, 21:21At first I thought you meant if they lose the flashing cursor, clicking anywhere on the screen will put them back in the command bar, but it does it instantly and automatically and gives the impression that anywhere outside the command bar is out of bounds.
In short, what I thought would be a temp workaround, is actually a solution I'm more than happy with.
Thanks very much!
In short, what I thought would be a temp workaround, is actually a solution I'm more than happy with.
Thanks very much!