Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs16:/tmp/cvs-serv15958/src

Modified Files:
	main.c mswindow.c 
Log Message:
Bug fix to messages not scrolling properly in richtext windows if message takes
more than 1 line due to window resizing/whatever.
Added option for autogenerated filenames for game recordings.

Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- mswindow.c	11 Apr 2007 23:06:34 -0000	1.68
+++ mswindow.c	12 Apr 2007 09:06:10 -0000	1.69
@@ -6017,6 +6017,7 @@
     struct stringList *p = win->strings;
     struct stringList *end, *p2;
     int NumStrings = win->NumItems;
+    int diff;
     char str1[256];
     CHARFORMAT2 cf;
     POINT point;
@@ -6106,13 +6107,10 @@
     SendMessage (win->hwnd, EM_SETSEL, -1, -1);
     SendMessage (win->hwnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
     SendMessage (win->hwnd, EM_REPLACESEL, FALSE, (LPARAM) str1);
-    if (numLines - point.y / W_Textheight > visibleLines + 1)
-    {
-        SendMessage (win->hwnd, EM_SETSCROLLPOS, 0, (LPARAM) &point);
-    }
-    else if (numLines - point.y / W_Textheight == visibleLines + 1)
+    diff = numLines - point.y / W_Textheight - visibleLines;
+    if (diff >= 1)
     {
-        point.y += W_Textheight;
+        point.y += W_Textheight * diff;
         SendMessage (win->hwnd, EM_SETSCROLLPOS, 0, (LPARAM) &point);
     }
     //SendMessage (win->hwnd, EM_HIDESELECTION, FALSE, 0);

Index: main.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- main.c	27 Nov 2006 07:08:41 -0000	1.11
+++ main.c	12 Apr 2007 09:06:10 -0000	1.12
@@ -43,7 +43,7 @@
     LineToConsole (" [-U udp_port]       specify client UDP port (useful for some firewalls)\n");
 #ifdef RECORDGAME
     LineToConsole (" [-F filename]       view recorded game from 'filename'\n");
-    LineToConsole (" [-f filename]       record game into 'filename'\n");
+    LineToConsole (" [-f filename]       record game into 'filename' (filename is autogenerated if none is provided)\n");
 #endif
     LineToConsole (" [-l filename]       record messages into 'filename'\n");
     LineToConsole (" [-L]                record messages into autogenerated log file with filename YYYYMMDD.log\n");
@@ -175,7 +175,11 @@
                     i++;
                 }
                 else
-                    usage++;
+                {
+                    tm = time(NULL);
+                    strftime(s, 20, "%Y%m%d.pkt", localtime(&tm));
+                    recordFileName = s;
+                }
                 break;
 #endif
             case 'l':           /* log to file */