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

Modified Files:
	beeplite.c data.c defaults.c 
Log Message:
Tidied up the save_options function, fixing some spacing errors, and puttting the
keymap/buttonmap on the top of the list due to its importance.  Also added the
sounddir option.  The eventual goal is to make save_options generate a file that contains
everything from your netrekrc file, so the options menus act as an in-game netrekrc editor.
Once everything is in place, save_options could write over your current netrekrc (the default
will be to write to a separate file, but there will be a menu option to save over your netrekrc). 
Currently it writes to a separate file (netrek.sav) because it still doesn't save everything that is needed.
Default windows placements need to be saved, uselite options need to be saved, review window mapping
needs to be saved, option server/servernick/servertype needs to be saved, and lastly, the save
keymap routine is broken.

Fixed mainResizeable loading from rc/saving.  Also made default setting = on.

Index: beeplite.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- beeplite.c	19 Apr 2006 13:02:33 -0000	1.2
+++ beeplite.c	19 Apr 2006 15:18:27 -0000	1.3
@@ -1,6 +1,20 @@
 /* beeplite.c
  *
  * $Log$
+ * Revision 1.3  2006/04/19 15:18:27  modemhero
+ * Tidied up the save_options function, fixing some spacing errors, and puttting the
+ * keymap/buttonmap on the top of the list due to its importance.  Also added the
+ * sounddir option.  The eventual goal is to make save_options generate a file that contains
+ * everything from your netrekrc file, so the options menus act as an in-game netrekrc editor.
+ * Once everything is in place, save_options could write over your current netrekrc (the default
+ * will be to write to a separate file, but there will be a menu option to save over your netrekrc).
+ * Currently it writes to a separate file (netrek.sav) because it still doesn't save everything that is needed.
+ * Default windows placements need to be saved, uselite options need to be saved, review window mapping
+ * needs to be saved, option server/servernick/servertype needs to be saved, and lastly, the save
+ * keymap routine is broken.
+ *
+ * Fixed mainResizeable loading from rc/saving.  Also made default setting = on.
+ *
  * Revision 1.2  2006/04/19 13:02:33  modemhero
  * Rewrote TTS centering/refresh code so that text is properly centered and clears properly when the message expires.
  * The old code used an average text width that was not so good, resulting in poor centering for long messages.  The new code measures the length of the message directly.
@@ -13,7 +27,6 @@
  *
  * Revision 1.1.1.1  1998/11/01 17:24:08  siegl
  * COW 3.0 initial revision
- * Added back to NetrekXP 2006/04/17   balcerski
  *
  */
 

Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- defaults.c	19 Apr 2006 13:02:33 -0000	1.5
+++ defaults.c	19 Apr 2006 15:18:27 -0000	1.6
@@ -183,7 +183,7 @@
             NULL
         }
     },
-    {"mainResizeable", &logging, RC_BOOL,
+    {"mainResizeable", &mainResizeable, RC_BOOL,
         {
             "Make main window resizeable",
             NULL
@@ -1745,39 +1745,7 @@
 
     sprintf (str, "Saving options to: %s", save_file);
     warning (str);
-
-    so = save_options;
-    while (so->name != NULL)
-    {
-        switch (so->type)
-        {
-        case RC_INT:
-            sprintf (str, "%s: %d\n", so->name, *so->int_value);
-            break;
-        case RC_BOOL:
-            if (*so->int_value)
-                sprintf (str, "%s: on\n", so->name);
-            else
-                sprintf (str, "%s: off\n", so->name);
-            break;
-        }
-        if (saveBig)
-        {
-            i = 0;
-            while (so->desc[i] != NULL)
-            {
-                sprintf (str1, "# %s\n", so->desc[i]);
-                fputs (str1, fp);
-                i++;
-            }
-        }
-        fputs (str, fp);
-        if (saveBig)
-            fputs ("\n", fp);
-        so++;
-    }
-
-
+    
     // Let's print buttonmap
     str[0] = '\0';
     str1[0] = '\0';
@@ -1810,15 +1778,7 @@
     }
     if (saveBig && strlen (str1) != 0)
         fputs ("\n", fp);
-
-    // cloak chars
-    if (saveBig)
-        fputs ("# Two characters to show cloaked player on map window\n", fp);
-    sprintf (str, "cloakChars: %c%c\n", cloakChars[0], cloakChars[1]);
-    fputs (str, fp);
-    if (saveBig)
-        fputs ("\n", fp);
-
+        
     // keymap part
     // we're going to print only keymap that differs from standard one
     // we have to start from second key, because first one is space
@@ -1869,6 +1829,57 @@
             fputs ("\n", fp);
     }
 
+    // Large list of save options
+    so = save_options;
+    while (so->name != NULL)
+    {
+        switch (so->type)
+        {
+        case RC_INT:
+            sprintf (str, "%s: %d\n", so->name, *so->int_value);
+            break;
+        case RC_BOOL:
+            if (*so->int_value)
+                sprintf (str, "%s: on\n", so->name);
+            else
+                sprintf (str, "%s: off\n", so->name);
+            break;
+        }
+        if (saveBig)
+        {
+            i = 0;
+            while (so->desc[i] != NULL)
+            {
+                sprintf (str1, "# %s\n", so->desc[i]);
+                fputs (str1, fp);
+                i++;
+            }
+        }
+        fputs (str, fp);
+        if (saveBig)
+            fputs ("\n", fp);
+        so++;
+    }
+
+    // cloak chars
+    if (saveBig)
+        fputs ("# Two characters to show cloaked player on map window\n", fp);
+    sprintf (str, "cloakChars: %c%c\n", cloakChars[0], cloakChars[1]);
+    fputs (str, fp);
+    if (saveBig)
+        fputs ("\n", fp);
+        
+    // sound directory
+    if (sounddir != NULL)
+    {
+	    if (saveBig)
+	        fputs ("# Sound directory\n", fp);
+	    sprintf (str, "sounddir: %s\n", sounddir);
+	    fputs (str, fp);
+	    if (saveBig)
+	        fputs ("\n", fp);
+    }
+
     // player list
     if (strlen (plistLayout) != 0)
     {
@@ -2085,12 +2096,12 @@
                 if (macro[i].key != 0)
                 {
                     if (macro[i].key > 127)
-                        sprintf (str, "macro.^%c.%c:%s\n",
+                        sprintf (str, "macro.^%c.%c: %s\n",
                                 getkeyfromctrl (macro[i].key),
                                 macro[i].who,
                                 macro[i].string);
                     else
-                        sprintf (str, "macro.%c.%c:%s\n",
+                        sprintf (str, "macro.%c.%c: %s\n",
                                 getkeyfromctrl (macro[i].key),
                                 macro[i].who,
                                 macro[i].string);
@@ -2105,11 +2116,11 @@
                 if (macro[i].key != 0)
                 {
                     if (macro[i].key > 127)
-                        sprintf (str, "mac.^%c:%s\n", 
+                        sprintf (str, "mac.^%c: %s\n", 
                                 getkeyfromctrl (macro[i].key),
                                 macro[i].string);
                     else
-                        sprintf (str, "mac.%c:%s\n", 
+                        sprintf (str, "mac.%c: %s\n", 
                                 getkeyfromctrl (macro[i].key),
                                 macro[i].string);
 
@@ -2123,12 +2134,12 @@
                 if (macro[i].key != 0)
                 {
                     if (macro[i].key > 127)
-                        sprintf (str, "mac.^%c.%c:%s\n", 
+                        sprintf (str, "mac.^%c.%c: %s\n", 
                                 getkeyfromctrl (macro[i].key),
                                 macro[i].who,
                                 macro[i].string);
                     else
-                        sprintf (str, "mac.%c.%c:%s\n", 
+                        sprintf (str, "mac.%c.%c: %s\n", 
                                 getkeyfromctrl (macro[i].key),
                                 macro[i].who,
                                 macro[i].string);
@@ -2150,27 +2161,26 @@
                     switch (macro[i].who)
                     {
                     case MACRO_PLAYER:
-                        strcat (str, "%p:");
+                        strcat (str, "%p: ");
                         break;
                     case MACRO_TEAM:
-                        strcat (str, "%t:");
+                        strcat (str, "%t: ");
                         break;
                     case MACRO_FRIEND:
-                        strcat (str, "%g:");
+                        strcat (str, "%g: ");
                         break;
                     case MACRO_ENEMY:
-                        strcat (str, "%h:");
+                        strcat (str, "%h: ");
                         break;
                     case MACRO_ME:
-                        strcat (str, "%i:");
+                        strcat (str, "%i: ");
                         break;
                     }
                     strcat (str, macro[i].string);
                     strcat (str, "\n");
+                    fputs (str, fp);
                     if (macro[i+1].type != NEWMMOUSE)
                         fputs ("\n", fp);
-
-                    fputs (str, fp);
                 }
                 break;
 #ifdef NBT
@@ -2220,7 +2230,7 @@
                 strcpy (str, "dist.");
 
             strcat (str, dm->name);
-            strcat (str, ":");
+            strcat (str, ": ");
             strcat (str, dm->macro);
             strcat (str, "\n");
 
@@ -2242,14 +2252,9 @@
 
         for (dm = &rcm_msg[1]; dm->name; dm++)
         {
-            sprintf (str, "msg.%s:%s\n", dm->name, dm->macro);
+            sprintf (str, "msg.%s: %s\n", dm->name, dm->macro);
             fputs (str, fp);
         }
-
-        fputs ("\n", fp);
-
-        if (saveBig)
-            fputs ("\n", fp);
     }
 #endif
 

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- data.c	19 Apr 2006 13:02:33 -0000	1.5
+++ data.c	19 Apr 2006 15:18:27 -0000	1.6
@@ -677,7 +677,7 @@
 int agriColor = 2;
 
 int windowMove = 0;
-int mainResizeable = 0;
+int mainResizeable = 1;
 int observerMode = 0;
 int showHockeyScore = 1;