Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31529/src

Modified Files:
	cowmain.c data.c local.c newwin.c ranklist.c smessage.c 
Log Message:
Moved message HUD display into local DrawMisc() function rather than updating
local independently, as it was causing problems with double buffering.
Added HUDbuf and showHUD variables to let local.c interact with smessage.c for
displaying messages on tactical.
Made HUDoffset a global variable.
Removed unused mdisplayed variable.
Readded some BlankChar calls that had been removed (no idea why), these missing calls
were causing message cursor to not be erased properly on delete/backspace/ctrl-u.
Fixed wrong info in hints about SB phaser cycling.
Message window will now say "Click here to send a message to ALL" until any message
is sent, then it will be blank as usual.
Left clicking on message window will either a) start a new message to ALL board or
b) continue current pending message.
Added explanation of what DI is in the rank window.

Index: smessage.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/smessage.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- smessage.c	22 Mar 2007 06:40:21 -0000	1.6
+++ smessage.c	2 Apr 2007 21:12:42 -0000	1.7
@@ -21,7 +21,6 @@
 #include "proto.h"
 
 static int lcount;
-static int HUDoffset;
 static char buf[MAX_MLENGTH];
 static char cursor = '_';
 static char mbuf[80];
@@ -32,7 +31,7 @@
 DisplayMessage ()
 {
     int length;
-    char tmp[1024];
+    char tmp[90];
 
     length = strlen (outmessage);
 
@@ -53,10 +52,7 @@
 
 #ifdef XTRA_MESSAGE_UI
     if (HUDoffset)
-    {
-        //W_WriteText (w, 5 + W_Textwidth * length, HUDoffset, textColor, " ", 1, W_RegularFont);
-        W_WriteText (w, 5, HUDoffset, textColor, tmp, length, W_RegularFont);
-    }
+        strcpy (HUDbuf, tmp);
 #endif
     W_WriteText (messagew, 5, 5, textColor, tmp, length, W_RegularFont);
 }
@@ -127,6 +123,7 @@
 
     if (messpend == 0)
     {
+        showHUD = 1;
         messpend = 1;
 #ifdef XTRA_MESSAGE_UI
         /* Figure out where to put the message on the local */
@@ -199,6 +196,7 @@
             lcount = ADDRLEN;
             break;
         }
+        BlankChar(lcount + 1, 1);
         outmessage[lcount + 1] = '\0';
         outmessage[lcount] = cursor;
         DisplayMessage ();
@@ -206,7 +204,7 @@
 
     case '\033':               /* abort message */
         BlankChar (0, lcount + 1);
-        mdisplayed = 0;
+        showHUD = 0;
         messpend = 0;
         message_off ();
         for (i = 0; i < MAX_MLENGTH; i++)
@@ -252,6 +250,7 @@
     case 23:
         while (--lcount >= ADDRLEN)
         {
+            BlankChar(lcount + 1, 1);
             outmessage[lcount + 1] = '\0';
             outmessage[lcount] = cursor;
         }
@@ -349,7 +348,7 @@
             warning ("Not legal recipient");
         }
         BlankChar (0, lcount + 1);
-        mdisplayed = 0;
+        showHUD = 0;
         lcount = 0;
         break;
 

Index: newwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- newwin.c	2 Apr 2007 10:12:38 -0000	1.57
+++ newwin.c	2 Apr 2007 21:12:42 -0000	1.58
@@ -791,6 +791,22 @@
 static void
 handleMessageWindowButton (W_Event * event)
 {
+    switch (event->key)
+    {
+    case W_LBUTTON:
+        if (messageon == 0)
+        {
+#ifdef SOUND
+            Play_Sound(MESSAGE_WAV, SF_MESSAGE);
+#endif
+            message_on ();
+            if (messpend == 0)
+                smessage ('A');
+        }
+        return;
+    default:
+        return;
+    }
 }
 
 /******************************************************************************/

Index: cowmain.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- cowmain.c	1 Apr 2007 10:11:36 -0000	1.30
+++ cowmain.c	2 Apr 2007 21:12:41 -0000	1.31
@@ -1065,6 +1065,10 @@
         /* Set up autowar settings */
         do_autosetwar(team);
 
+        /* Click me sign on message window (for newbies) */
+        sprintf(buf, "Click here to send a message to ALL");
+        W_WriteText (messagew, 5, 5, textColor, buf, strlen(buf), W_RegularFont);
+
         isFirstEntry = 0;
     }
 

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- local.c	1 Apr 2007 10:11:37 -0000	1.82
+++ local.c	2 Apr 2007 21:12:42 -0000	1.83
@@ -2587,6 +2587,20 @@
             clearcount++;
         }
     }
+
+#ifdef XTRA_MESSAGE_UI
+    /* Display message HUD */
+    if (HUDoffset && showHUD)
+    {
+        W_WriteText (w, 5, HUDoffset, textColor, HUDbuf, strlen(HUDbuf), W_RegularFont);
+        clearzone[0][clearcount] = 5;
+        clearzone[1][clearcount] = HUDoffset;
+        clearzone[2][clearcount] = W_Textwidth * strlen(HUDbuf);
+        clearzone[3][clearcount] = W_Textheight;
+        clearcount++;
+    }
+#endif
+
 }
 
 

Index: ranklist.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ranklist.c	2 Apr 2007 10:12:38 -0000	1.2
+++ ranklist.c	2 Apr 2007 21:12:42 -0000	1.3
@@ -114,7 +114,7 @@
     strcpy (buf, "To achieve a rank, you need the corresponding DI");
     W_WriteText (rankw, 1, i + 3, textColor, buf, strlen (buf),
                  W_RegularFont);
-    strcpy (buf, "in less than the hours allowed.");
+    strcpy (buf, "in less than the hours allowed (DI = ratings x hours).");
     W_WriteText (rankw, 1, i + 4, textColor, buf, strlen (buf),
                  W_RegularFont);
     strcpy (buf, "OR, get offense+boming+planets above corresponding Ratings");

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- data.c	1 Apr 2007 10:11:37 -0000	1.73
+++ data.c	2 Apr 2007 21:12:41 -0000	1.74
@@ -70,11 +70,13 @@
 int messpend = 0;
 #ifdef XTRA_MESSAGE_UI
 int messageHUD = 0;             /* Show message being typed on the local display           */
+char HUDbuf[90] = "";           /* Buffer to hold current message for display              */
+int showHUD = 0;                /* Internal variable to control when to display message    */
+int HUDoffset;                  /* Internal variable that determines message offset        */
 int messageHoldThresh = 0;      /* Threshold value for putting a message on hold (squared) */
 int messMouseDelta = 0;         /* To keep track of mouse movement delta                   */
 #endif
 int lastcount = 0;
-int mdisplayed = 0;
 int udcounter = 0;
 int showTractorPressor = 1;
 int showAllTractorPressor = 1;  /* Enable SHOW_ALL_TRACTORS feature */