Hey guys,
So I admit I didn't search too deeply for info on this, but i'm grateful for any insight that might be provided from this fine community.
I'd like to add a feature to the command line / input bar, where it could remember the previously entered command. The player can simply hit enter repeatedly and carry on using the last command that was entered.
I do already have it functioning that players can press the up arrow and recall previous commands, but it would be more helpful if they could simply press enter repeatedly. It would also be a huge benefit if the command could re-appear highlighted, so that when they wish to enter a new command, they need only type and not have to delete said previous entry.
I'd love to get some help on this if it's possible, and any idea's are appreciated.
Thanks in advance!
ID:1910746
Aug 4 2015, 4:34 pm
|
|
1st. The player writes a command in the input bar
2nd. The command that the player wrote is memorized
3rd. The player presses enter and the command appears highlighted in the input bar.
I am assuming that the input bar that you are talking about is the default one (you didn't create a new interface file).
So this is an option:
In order to higlight the text you need to simulate a combo key press SHIFT+HOME. That can be achieved with javascript:
I don't know why but my javascript code isn't working... I've posted a topic about this in stackoverflow (feel free to follow it)
http://stackoverflow.com/questions/31843205/ javascript-key-simulation-isnt-working
After a lot of research I found this topic http://www.byond.com/ forum/?post=1755334&hl=fireMacro#comment13453362 and Lumox talked about a byond.fn.fireMacro() procedure. I'm
not sure how it works though (or even if it can do what we want it to do). But don't worry, I'm sure that he will check this post and he'll help us with it.
Sorry for only help you solving half of the problem... I really don't know how to highlight the text on the input bar...