Răsfoiți Sursa

* Made some DEFINES in color.h for colors. See color.h for syntax.

svn: 561
Bryan Drewery 22 ani în urmă
părinte
comite
380bb29442
5 a modificat fișierele cu 54 adăugiri și 30 ștergeri
  1. 48 0
      src/color.h
  2. 2 2
      src/dcc.c
  3. 3 3
      src/dccutil.c
  4. 0 25
      src/eggdrop.h
  5. 1 0
      src/main.h

+ 48 - 0
src/color.h

@@ -0,0 +1,48 @@
+#define C_BLACK                 1
+#define C_BLUE                  2
+#define C_GREEN                 3
+#define C_CYAN                  4
+#define C_RED                   5
+#define C_PURPLE                6
+#define C_BROWN                 7
+#define C_LIGHTGREY             8
+#define C_DARKGREY              9
+#define C_LIGHTBLUE             10
+#define C_LIGHTGREEN            11
+#define C_LIGHTCYAN             12
+#define C_LIGHTRED              13
+#define C_LIGHTPURPLE           14
+#define C_YELLOW                15
+#define C_WHITE                 16
+#define BOLD_OPEN               1
+#define BOLD_CLOSE              2
+#define UNDERLINE_OPEN          3
+#define UNDERLINE_CLOSE         4
+#define COLOR_OPEN              5
+#define COLOR_CLOSE             6
+#define FLASH_OPEN              7
+#define FLASH_CLOSE             8
+#define BLACK(idx) 		color(idx, COLOR_OPEN, C_BLACK)
+#define BLUE(idx) 		color(idx, COLOR_OPEN, C_BLUE)
+#define GREEN(idx) 		color(idx, COLOR_OPEN, C_GREEN)
+#define CYAN(idx) 		color(idx, COLOR_OPEN, C_CYAN)
+#define RED(idx) 		color(idx, COLOR_OPEN, C_RED)
+#define PURPLE(idx) 		color(idx, COLOR_OPEN, C_PURPLE)
+#define BROWN(idx) 		color(idx, COLOR_OPEN, C_BROWN)
+#define LIGHTGREY(idx) 		color(idx, COLOR_OPEN, C_LIGHTGREY)
+#define DARKGREY(idx) 		color(idx, COLOR_OPEN, C_DARKGREY)
+#define LIGHTBLUE(idx) 		color(idx, COLOR_OPEN, C_LIGHTBLUE)
+#define LIGHTGREEN(idx)		color(idx, COLOR_OPEN, C_LIGHTGREEN)
+#define LIGHTCYAN(idx) 		color(idx, COLOR_OPEN, C_LIGHTCYAN)
+#define LIGHTRED(idx) 		color(idx, COLOR_OPEN, C_LIGHTRED)
+#define LIGHTPURPLE(idx) 	color(idx, COLOR_OPEN, C_LIGHTPURPLE)
+#define YELLOW(idx) 		color(idx, COLOR_OPEN, C_YELLOW)
+#define WHITE(idx) 		color(idx, COLOR_OPEN, C_WHITE)
+#define COLOR_END(idx) 		color(idx, COLOR_CLOSE, 0)
+#define BOLD(idx) 		color(idx, BOLD_OPEN, 0)
+#define BOLD_END(idx) 		color(idx, BOLD_CLOSE, 0)
+#define UNDERLINE(idx) 		color(idx, UNDERLINE_OPEN, 0)
+#define UNDERLINE_END(idx) 	color(idx, UNDERLINE_CLOSE, 0)
+#define FLASH(idx) 		color(idx, FLASH_OPEN, 0)
+#define FLASH_END(idx) 		color(idx, FLASH_CLOSE, 0)
+

+ 2 - 2
src/dcc.c

@@ -620,7 +620,7 @@ static void dcc_chat_secpass(int idx, char *buf, int atr)
 
 
         dprintf(idx, "******************************************************************** \
         dprintf(idx, "******************************************************************** \
                       \n \n \n%sWARNING: YOU DO NOT HAVE A SECPASS SET, NOW SETTING A RANDOM ONE....%s\n",
                       \n \n \n%sWARNING: YOU DO NOT HAVE A SECPASS SET, NOW SETTING A RANDOM ONE....%s\n",
-                     color(idx, FLASH_OPEN, 0), color(idx, FLASH_CLOSE, 0));
+                     FLASH(idx), FLASH_END(idx));
         make_rand_str(pass, 16);
         make_rand_str(pass, 16);
         pass[16] = 0;
         pass[16] = 0;
         set_user(&USERENTRY_SECPASS, dcc[idx].user, pass);
         set_user(&USERENTRY_SECPASS, dcc[idx].user, pass);
@@ -629,7 +629,7 @@ static void dcc_chat_secpass(int idx, char *buf, int atr)
 #endif /* HUB */
 #endif /* HUB */
         dprintf(idx, "Your secpass is now: %s%s%s\nMake sure you do not lose this, as it is \
         dprintf(idx, "Your secpass is now: %s%s%s\nMake sure you do not lose this, as it is \
                      needed to login for now on.\n \n*******************************************************\n", 
                      needed to login for now on.\n \n*******************************************************\n", 
-                    color(idx, BOLD_OPEN, 0), pass, color(idx, BOLD_CLOSE, 0));
+                    BOLD(idx), BOLD_END(idx));
       }
       }
       dcc_chatter(idx);
       dcc_chatter(idx);
 #ifdef S_AUTH
 #ifdef S_AUTH

+ 3 - 3
src/dccutil.c

@@ -175,12 +175,12 @@ void dprintf EGG_VARARGS_DEF(int, arg1)
         buf2[0] = 0;
         buf2[0] = 0;
 
 
         if (c == ':') {
         if (c == ':') {
-          sprintf(buf2, "%s%c%s", color(idx, COLOR_OPEN, C_LIGHTGREY), c, color(idx, COLOR_CLOSE, 0));
+          sprintf(buf2, "%s%c%s", LIGHTGREY(idx), c, COLOR_END(idx));
         } else if (c == '@') {
         } else if (c == '@') {
-          sprintf(buf2, "%s%c%s", color(idx, BOLD_OPEN, 0), c, color(idx, BOLD_CLOSE, 0));
+          sprintf(buf2, "%s%c%s", BOLD(idx), c, BOLD_END(idx));
 //        } else if (c == ']' || c == '>' || c == ')' || c == '[' || c == '<' || c == '(') {
 //        } else if (c == ']' || c == '>' || c == ')' || c == '[' || c == '<' || c == '(') {
         } else if (c == '>' || c == ')' || c == '<' || c == '(') {
         } else if (c == '>' || c == ')' || c == '<' || c == '(') {
-          sprintf(buf2, "%s%c%s", color(idx, COLOR_OPEN, C_GREEN), c, color(idx, COLOR_CLOSE, 0));
+          sprintf(buf2, "%s%c%s", GREEN(idx), c, COLOR_END(idx));
         } else {
         } else {
           sprintf(buf2, "%c", c);
           sprintf(buf2, "%c", c);
         }
         }

+ 0 - 25
src/eggdrop.h

@@ -104,31 +104,6 @@
 #define ERR_BADCONF 14
 #define ERR_BADCONF 14
 #define ERR_MAX 15
 #define ERR_MAX 15
 
 
-#define C_BLACK                 1
-#define C_BLUE                  2
-#define C_GREEN                 3
-#define C_CYAN                  4
-#define C_RED                   5
-#define C_PURPLE                6
-#define C_BROWN                 7
-#define C_LIGHTGREY             8
-#define C_DARKGREY              9
-#define C_LIGHTBLUE             10
-#define C_LIGHTGREEN            11
-#define C_LIGHTCYAN             12
-#define C_LIGHTRED              13
-#define C_LIGHTPURPLE           14
-#define C_YELLOW                15
-#define C_WHITE                 16
-#define BOLD_OPEN               1
-#define BOLD_CLOSE              2
-#define UNDERLINE_OPEN          3
-#define UNDERLINE_CLOSE         4
-#define COLOR_OPEN              5
-#define COLOR_CLOSE             6
-#define FLASH_OPEN              7
-#define FLASH_CLOSE             8
-
 #define EMAIL_OWNERS    0x1
 #define EMAIL_OWNERS    0x1
 #define EMAIL_TEAM      0x2
 #define EMAIL_TEAM      0x2
 
 

+ 1 - 0
src/main.h

@@ -14,6 +14,7 @@
 
 
 #include "conf.h"
 #include "conf.h"
 #include "salt.h"
 #include "salt.h"
+#include "color.h"
 
 
 #include "lush.h" /* We seem to need this everywhere... */
 #include "lush.h" /* We seem to need this everywhere... */