Jim Aikin wrote:
The only bit of piffle that remains is that when I click a link, the result looks like this:
Quote:
>
go east
As I told you before, you must put the lines that write the new command at the prompt
before calling the glk cancel line function, that's to say:
this
Code:
glk_set_style(style_Input);
print "MY NEW COMMAND HERE!";
glk_set_style(style_Normal);
goes before this:
Code:
glk_cancel_line_event(gg_mainwin,0);
And as I mentioned, the ugly side effect is that if the player types something before clicking the result could be like this (in the example she has typed "xyzzy", then, for any reason, changed her mind and clicked on the "NORTH" link)
Quote:
Room 01
You're in Room 01. An exit leads NORTH
>xyzzy
(now player clicks on NORTH before typing ENTER)
>go northxyzzy
Room 02
You're in Room 02.
I'm going to take a look to this glk set echo calls (I didn't know they existed! nice!) to see if they can help with this.
Jim Akin wrote:
No sooner do I solve that problem than I find I have a worse problem. When the player (at the moment, player = me) resizes the game window, a GlkEvent is generated, which means that HandleGlkEvent is called. This has the effect of repeating the last command, whatever it was -- and whether or not it resulted from clicking a link. I have no smegging idea how to prevent this, because nothing in my HandleGlkEvent code seems to be responsible for it. Here's what I have:
You're doing the "return 2" from the HandleGlkEvent main routine. You should put it in the
evtype_hyperlink: case of the
switch (ev-->0) switch. If not, you're returning "2" wichever the event is, which has the effect of canceling the current command line. And I miss the glk_cancel_line_event() call in your last code, which surely is causing some more adiotional chaos ^_^'.