TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Bug in prompt rows [patch]

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Miesco



Joined: 08 Sep 2005
Posts: 16

PostPosted: Wed Aug 11, 2010 6:40 am    Post subject: Bug in prompt rows [patch] Reply with quote

--- prompt.c 2010-08-11 10:42:57.000000000 +0000
+++ prompt.cd 2010-08-11 10:51:27.000000000 +0000
@@ -115,7 +115,7 @@
row = ses->rows - row;
}

- if (row <= ses->top_row && row >= ses->bot_row)
+ if (row <= ses->top_row || row >= ses->bot_row+1)
{
show_message(ses, LIST_PROMPT, "#ERROR: INVALID PROMPT ROW: {%s} {%d}.", prompt, row);



I think thats a bug assuming you dont want the prompt to be on the input line or the top line. How it currently is doesn't make sense. Tell me if I fixed anything.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Wed Aug 11, 2010 7:39 am    Post subject: Reply with quote

It was indeed a bug, but your approach didn't fix it. I changed it to the following:

Code:

        if (row < 1 || row > ses->rows)
        {
                show_message(ses, LIST_PROMPT, "#ERROR: PROMPT ROW IS OUTSIDE THE SCREEN: {%s} {%d}.", prompt, row);

                return;     
        }
         
        if (row > ses->top_row && row < ses->bot_row)
        {
                show_message(ses, LIST_PROMPT, "#ERROR: PROMPT ROW IS INSIDE THE SCROLLING REGION: {%s} {%d}.", prompt, row);

                return;
        }
Back to top
View user's profile Send private message Send e-mail
Miesco



Joined: 08 Sep 2005
Posts: 16

PostPosted: Thu Aug 12, 2010 7:27 am    Post subject: Reply with quote

In vt102.c:

Code:
void restore_cursor(struct session *ses)
{
   printf("\033[%d;%dH", ses->cols, gtd->input_pos+1);
}


Why is the vertical axis corresponding to the horizontal ses->cols?

I am trying to figure out when the vt102 escape codes are put into the buffer to put the cursor back into the input line. Is this where it is?

-Shawn
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Aug 12, 2010 6:06 pm    Post subject: Reply with quote

That's another little bug, never caught that one because that function is not used.

Tintin calls save_pos() to save the cursor position, then it moves the cursor from the input line to the bottom of the scrolling region, typically with goto_rowcol(), prints some text, then it returns the cursor to the saved position with restore_pos()
Back to top
View user's profile Send private message Send e-mail
Miesco



Joined: 08 Sep 2005
Posts: 16

PostPosted: Thu Aug 12, 2010 8:47 pm    Post subject: Reply with quote

Okay.

Also, why do this:

Code:
   for (bot = 1 ; ses->rows - bot > ses->bot_row ; bot++)
   {
      do_one_prompt(ses, "", +bot);
   }

   for (top = 1 ; top < ses->top_row ; top++)
   {
      do_one_prompt(ses, "", -top);
   }


Why not just do this instead:
Code:
   do_one_prompt(ses, "", 1);


Why do you put the default '---...' prompt twice on each row in the session? Especially cause your not even suppose to have prompts in the session at all.

Thanks
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Aug 12, 2010 10:03 pm    Post subject: Reply with quote

It's so the the full split section is initialized when you do something like:

#split 5 5
Back to top
View user's profile Send private message Send e-mail
Miesco



Joined: 08 Sep 2005
Posts: 16

PostPosted: Thu Aug 12, 2010 10:21 pm    Post subject: Reply with quote

Okay. Also, what did you have before you had in tintin_puts2 a \n in the printf?
Also why did you add it so there's a blank line? I think I might of read in a post that it was to fix a #split issue? Are you working on fixing this at all?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Fri Aug 13, 2010 7:06 am    Post subject: Reply with quote

Not sure what you're asking here.

The blank line above the split line has always been there, not sure if people actually want that changed as it'll push the text against the split line, and adding two different display modes would be pretty messy code wise.
Back to top
View user's profile Send private message Send e-mail
Pasta



Joined: 15 Feb 2010
Posts: 32

PostPosted: Fri Aug 13, 2010 7:14 am    Post subject: Reply with quote

Scandum wrote:
The blank line above the split line has always been there, not sure if people actually want that changed as it'll push the text against the split line...
Just thinking off the top of my head, if you were to change the actual split line from dashes to underscores, you might be able to get rid of the blank line above the split line.

-Pasta
Back to top
View user's profile Send private message
Miesco



Joined: 08 Sep 2005
Posts: 16

PostPosted: Sat Aug 14, 2010 1:20 am    Post subject: Reply with quote

Scandum:
Okay. A lot of my last post did not make sense. Moving on...

I do not get some of these escape codes:

scdD\033[1P\033[1D\033[1Pm#NO SESSION ACTIVE. USE: #session {name} {host} {port} TO START
ONE.\033[0m\n


I can not find the '\033[1P' vt102 escape code. I am confused. Also, just curious why the decision was to implement your own terminal control instead of using a library such as curses... portability?

Also what do you mean by 'push the text against the split line'? Like having the scroll area above the split line? A lot of clients do it, irc clients, etc. I have never seen a blank line like that. I might not quite get what your saying. Why wouldn't you just put the scroll area 1 line above the split line?

Thanks
Back to top
View user's profile Send private message
Miesco



Joined: 08 Sep 2005
Posts: 16

PostPosted: Sat Aug 14, 2010 6:47 am    Post subject: Reply with quote

I am suggesting another way to display the prompt.

What does not work with this extremly messy code [I have had no sleep and can no longer think]:

Text from client

Is there a way to see if text is from the client?


In readline():

/* if (prompt)*/
if (!HAS_BIT(ses->flags, SES_FLAG_READMUD) && IS_SPLIT(ses))
{
printf("%s", wrapped_str);
}
else if (!HAS_BIT(ses->flags, SES_FLAG_READMUD))
{
printf("%s", wrapped_str);
}
/* Text from non-user */
else if (IS_SPLIT(ses))
{
printf("\n%s", wrapped_str);
}
else if (prompt)
{
printf("%s", wrapped_str);
} else {
printf("%s\n", wrapped_str);
}
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sat Aug 14, 2010 10:06 am    Post subject: Reply with quote

It's an option, not sure how many people would care for it.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group