home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / SYSOP / MODS1.ZIP / AQUA25A.MOD < prev    next >
Text File  |  1994-05-03  |  13KB  |  459 lines

  1. ┌──────────────────────────────────────────────────────────────────────────┐
  2. │      Mod Name: AQUA25A.MOD             Author: AquaMaestro 1@7704 IceNET │
  3. │    Difficulty: ████▒▒▒▒▒▒                Date: 12/25/93    1@7724 WW4net │
  4. │      Modified: COM.C, BBSUTL.C, MSGBASE.C,                               │
  5. │                VARDEC.H, VARS.H, BBS.C                                   │
  6. │ WWIV Version : 4.23                                                      │
  7. │ Short Desc.  : Gives WWIV the capability for 94 configurable colors,     │
  8. │                with the same ^P-character capability.  Does not change   │
  9. │                the operation of the stock ^P0-9 color commands.          │
  10. └──────────────────────────────────────────────────────────────────────────┘
  11. *** FIXED BY Pâpâ ßêâr (1@5079.wwivnet / 1@5050.sexnet) by popular demand ***
  12.                *** I'm responsible for STEPs 9a, 9b, and 9c ***
  13.  
  14.   Long Desc.   : Back when we were all running 4.21a, Gate Keeper came out
  15.          with a mod adding ^P 8 and 9, plus ^P A-Z.  It worked fine,
  16.          and changing the colors around wasn't too difficult, since
  17.          the colors' ANSI definitions were contained in STATUS.DAT.
  18.          When 4.23 came around, GATECLR2 no longer would work without
  19.          more modification than I was up to.  Also, the new 4.23
  20.          INIT didn't like the 50 or so bytes that were added to
  21.          STATUS.DAT, and I ended up recoding 4.23 before I could
  22.          install it.  Anyway, this mod allows for 94 colors,
  23.          including the 0-9 that 4.23 includes, which can be
  24.          reconfigured at will.  The color definitions are stored in
  25.          COLOR.DAT, rather than STATUS.DAT, where they won't get in
  26.          the way.
  27.  
  28.     Purely as an aside, we're dealing with three banks of ASCII chars:
  29.  
  30.         032-047 : ' ' to '/'
  31.         048-057 : '0' to '9'
  32.         058-126 : ':' to '~'
  33.  
  34. Key:
  35.  /*==*/ Existing Code
  36.  /*++*/ Add this Code
  37.  /*--*/ Subtract this Code
  38.  /*%%*/ Change this Code
  39.  
  40. Step 1:
  41.  
  42. Back up your source.  If we added up all the costs of sending these step 1's
  43. in all the mods every posted on the mod subs, how much have we spent?
  44.  
  45.  
  46. Step 2:
  47.  
  48. Load VARDEC.H.  Add this code after the structure defintion for .status:
  49.  
  50. /*==*/            last_bbslist;           /* date last bbslist.net */
  51. /*==*/    float           net_req_free;           /* net free factor def 3 */
  52. /*==*/    char            res[31];                /* RESERVED */
  53. /*==*/} statusrec;
  54. /*==*/
  55. /*++*/typedef struct {
  56. /*++*/                    unsigned char   resx[240]; /* Includes padding */
  57. /*++*/} colorrec;
  58. /*==*/
  59. /*==*/
  60. /*==*//* MESSAGE BASE INFORMATION */
  61. /*==*/typedef struct {
  62. /*==*/    char        name[41],        /* board name */
  63.  
  64. Declaring a type for the color information here is frankly redundant,
  65. but it's simpler to allow it to be changed, and allows for updates or changes
  66. to the mod.
  67.  
  68.  
  69. Step 2:
  70.  
  71. Load UTILITY.C, and add this line:
  72.  
  73. /*==*/static int statusfile=-1;
  74. /*++*/static int colorfile=-1;
  75.  
  76. And, somewhere below that, add these four voids:
  77.  
  78. void get_colordata(void)
  79. {
  80.   char s[81];
  81.  
  82.   if (colorfile<0) {
  83.     sprintf(s,"%sCOLOR.DAT",syscfg.datadir);
  84.     colorfile=sh_open1(s,O_RDWR | O_BINARY | O_CREAT);
  85.     read(colorfile,(void *)(&rescolor), sizeof(colorrec));
  86.     colorfile=sh_close(colorfile);
  87.   }
  88. }
  89.  
  90. void save_colordata(void)
  91. {
  92.   char s[81];
  93.  
  94.   sprintf(s,"%sCOLOR.DAT",syscfg.datadir);
  95.   colorfile=sh_open1(s,O_RDWR | O_BINARY | O_CREAT);
  96.   sh_write(colorfile, (void *)(&rescolor), sizeof(colorrec));
  97.   colorfile=sh_close(colorfile);
  98. }
  99.  
  100. void list_ext_colors(void)
  101. {
  102.   goxy(40,7);
  103.   prt(7,"┌─────────────────────────┐");
  104.   goxy(40,8);
  105.   prt(7,"│        2COLOR LIST7       │");
  106.   goxy(40,9);
  107.   prt(7,"├─────────────────────────┤");
  108.   goxy(40,10);
  109.   prt(7,"│   0 !!0 \"\"0 ##0 $$0 %%0 &&0"
  110.      " ''0 ((0 ))0 **0 ++7 │");
  111.   goxy(40,11);
  112.   prt(7,"│ ,,0 --0 ..0 //0 000 110 220"
  113.      " 330 440 550 660 777 │");
  114.   goxy(40,12);
  115.   prt(7,"│ 880 990 ::0 ;;0 <<0 ==0 >>0"
  116.      " ??0 @@0 AA0 BB0 CC7 │");
  117.   goxy(40,13);
  118.   prt(7,"│ DD0 EE0 FF0 GG0 HH0 II0 JJ0"
  119.      " KK0 LL0 MM0 NN0 OO7 │");
  120.   goxy(40,14);
  121.   prt(7,"│ PP0 QQ0 RR0 SS0 TT0 UU0 VV0"
  122.      " WW0 XX0 YY0 ZZ0 [[7 │");
  123.   goxy(40,15);
  124.   prt(7,"│ \\\\0 ]]0 ^^0 __0 ``0 aa0 bb0"
  125.      " cc0 dd0 ee0 ff0 gg7 │");
  126.   goxy(40,16);
  127.   prt(7,"│ hh0 ii0 jj0 kk0 ll0 mm0 nn0"
  128.      " oo0 pp0 qq0 rr0 ss7 │");
  129.   goxy(40,17);
  130.   prt(7,"│ tt0 uu0 vv0 ww0 xx0 yy0 zz0"
  131.      " {{0 ||0 }}0 ~~0 [[7 │");
  132.   goxy(40,18);
  133.   prt(7,"├─────────────────────────┤");
  134.   goxy(40,19);
  135.   prt(7,"│                         │");
  136.   goxy(40,20);
  137.   prt(7,"└─────────────────────────┘");
  138. }
  139.  
  140. void color_config(void)
  141. {
  142.   char s[81],ch,ch1;
  143.   unsigned c;
  144.   int i,done=0,n;
  145.  
  146.   strcpy(s,"      SAMPLE COLOR      ");
  147.   get_colordata();
  148.   do {
  149.     outchr(12);
  150.     pl("Extended Color Configuration - Enter Choice, ^Z to Quit, ^R to Relist");
  151.     outstr(": ");
  152.     list_ext_colors();
  153.     goxy(2,2);
  154.     ch=getkey();
  155.     if (ch==26)
  156.       done=1;
  157.     if (ch==18) {
  158.       list_ext_colors();
  159.       goxy(2,2);
  160.     }
  161.     if (ch>=32) {
  162.       outchr(ch);
  163.       n=ch-48;
  164.       nln(2);
  165.       color_list();
  166.       ansic(0);
  167.       nl();
  168.       prt(2,get_string(430));
  169.       ch1=onek("01234567");
  170.       c=ch1-'0';
  171.       goxy(41,19);
  172.       setc(c);
  173.       outstr(s);
  174.       ansic(0);
  175.       goxy(1,16);
  176.       prt(2,get_string(431));
  177.       ch1=onek("01234567");
  178.       c=c | ((ch1-'0') << 4);
  179.       goxy(41,19);
  180.       setc(c);
  181.       outstr(s);
  182.       ansic(0);
  183.       goxy(1,17);
  184.       nl();
  185.       prt(5,get_string(434));
  186.       if (yn())
  187.     c |= 0x08;
  188.       goxy(41,19);
  189.       setc(c);
  190.       outstr(s);
  191.       ansic(0);
  192.       goxy(1,18);
  193.       nl();
  194.       prt(5,get_string(437));
  195.       if (yn())
  196.     c |= 0x80;
  197.       nl();
  198.       goxy(41,19);
  199.       setc(c);
  200.       outstr(s);
  201.       ansic(0);
  202.       goxy(1,21);
  203.       setc(c);
  204.       outstr(describe(c));
  205.       ansic(0);
  206.       nln(2);
  207.       prt(5,get_string(438));
  208.       if (yn()) {
  209.     nl();
  210.     pl(get_string(439));
  211.     nl();
  212.     if ((n<=-1) && (n>=-16))
  213.       rescolor.resx[207+abs(n)]=c;
  214.     else if ((n>=0) && (n<=9))
  215.       thisuser.colors[n]=c;
  216.     else
  217.       rescolor.resx[n-10]=c;
  218.       } else {
  219.     nl();
  220.     pl(get_string(440));
  221.     nl();
  222.       }
  223.     }
  224.   } while ((!done) && (!hangup));
  225.   nln(2);
  226.   prt(5,"Save changes? ");
  227.   if (yn())
  228.     save_colordata();
  229.   else
  230.     get_colordata();
  231.   outchr(12);
  232.   nln(3);
  233. }
  234.  
  235. void buildcolorfile(void)
  236. {
  237.   int i,i1,colorfile;
  238.   char s[81],s1[81];
  239.  
  240.   sprintf(s1,"%sCOLOR.DAT",syscfg.datadir);
  241.   colorfile=sh_open1(s1,O_RDWR | O_BINARY | O_CREAT);
  242.   nl();
  243.   for (i=0; i<240; i++)
  244.     rescolor.resx[i]=i+1;
  245.   sh_write(colorfile, (void *)(&rescolor), sizeof(colorrec));
  246.   colorfile=sh_close(colorfile);
  247. }
  248.  
  249.  
  250. Step 3:
  251.  
  252. Load COM.C, and make this change in void outchr():
  253.  
  254.  
  255. /*==*/  int i, i1;
  256. /*==*/
  257. /*==*/  if (change_color) {
  258. /*==*/    change_color = 0;
  259. /*--*/    if ((c >= '0') && (c <= '9'))
  260. /*--*/      ansic(c - '0');
  261. /*++*/    if ((c>=32) && (c<=126))
  262. /*++*/      ansic(c-48);
  263. /*==*/    return;
  264. /*==*/  }
  265. /*==*/  if (c == 3) {
  266. /*==*/    change_color = 1;
  267. /*==*/    return;
  268.  
  269.  
  270. Then, replace void ansic() with this one:
  271.  
  272. void ansic(int n)
  273. {
  274.   char c;
  275.   if ((n<=-1) && (n>=-16))
  276.     c=((thisuser.sysstatus & sysstatus_color) ?
  277.      rescolor.resx[207+abs(n)] : thisuser.bwcolors[0]);
  278.   if ((n>=0) && (n<=9))
  279.     c=((thisuser.sysstatus & sysstatus_color) ?
  280.      thisuser.colors[n] : thisuser.bwcolors[n]);
  281.   if ((n>=10) && (n<=207))
  282.     c=((thisuser.sysstatus & sysstatus_color) ?
  283.      rescolor.resx[n-10] : thisuser.bwcolors[0]);
  284.   if (c==curatr)
  285.     return;
  286.   setc(c);
  287.   makeansi((thisuser.sysstatus & sysstatus_color) ?
  288.        thisuser.colors[0] : thisuser.bwcolors[0],endofline,0);
  289. }
  290.  
  291.  
  292.  
  293. Step 4:
  294.  
  295.  
  296. Load BBSUTL.C, and replace the Ctrl-P switch within int inli() with this:
  297.  
  298. /*==*/          s[cp++]=8;
  299. /*==*/        }
  300. /*==*/        break;
  301. /*++*/      case 16: /* Ctrl-P */
  302. /*++*/        if (cp<maxlen-1) {
  303. /*++*/          ch=getkey();
  304. /*++*/          if ((ch>=32) && (ch<=126)) {
  305. /*++*/        s[cp++]=3;
  306. /*++*/        s[cp++]=ch;
  307. /*++*/        ansic(ch-48);
  308. /*++*/          }
  309. /*++*/        }
  310. /*++*/        topscreen();
  311. /*++*/      break;
  312. /*==*/      case 9:  /* Tab */
  313. /*==*/        i=5-(cp % 5);
  314. /*==*/        if (((cp+i)<maxlen) && ((wherex()+i)<thisuser.screenchars)) {
  315.  
  316.  
  317.  
  318. Step 5:
  319.  
  320. Load BBSOVL2.C, and replace the Ctrl-P switch in void two_way_chat() with
  321. this one:
  322.  
  323. /*==*/        outchr(8);
  324. /*==*/        side1[wherey()-13][cp1++]=8;
  325. /*==*/          }
  326. /*==*/        break;
  327. /*++*/      case 16: /* Ctrl-P */
  328. /*++*/        if (side==0) {
  329. /*++*/          if (cp0<maxlen-1) {
  330. /*++*/        ch=getkey();
  331. /*++*/        if ((ch>=32) && (ch<=126)) {
  332. /*++*/          side0[wherey()][cp0++]=3;
  333. /*++*/          side0[wherey()][cp0++]=ch;
  334. /*++*/          ansic(ch-48);
  335. /*++*/        }
  336. /*++*/          }
  337. /*++*/        } else {
  338. /*++*/          if (cp1<maxlen-1) {
  339. /*++*/        ch=getkey();
  340. /*++*/        if ((ch>=32) && (ch<=126)) {
  341. /*++*/          side1[wherey()-13][cp1++]=3;
  342. /*++*/          side1[wherey()-13][cp1++]=ch;
  343. /*++*/          ansic(ch-48);
  344. /*++*/        }
  345. /*++*/          }
  346. /*++*/        }
  347. /*++*/        break;
  348. /*==*/      case 9:  /* Tab */
  349. /*==*/        if (side==0) {
  350. /*==*/          i=5-(cp0 % 5);
  351.  
  352.  
  353. Step 6:
  354.  
  355. Load MSGBASE.C, and make these changes in void inmsg():
  356.  
  357.  
  358. /*==*/  if (!fsed) {
  359. /*==*/    outstr(get_string(627));
  360. /*==*/    pln(maxli);
  361. /*%%*/    outstr(get_string(628));
  362. /*++*/    pl("Colors: ^P-0112233445566778899AABBCC"
  363. /*++*/         "DDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSS"
  364. /*++*/         "TTUUVVWWXXYYZZ0");
  365. /*==*/    strcpy(s,get_string(629));
  366. /*==*/    s[thisuser.screenchars]=0;
  367.  
  368. Step 7:
  369.  
  370. Load BBS.C, and add the following two // command entries:
  371.  
  372. /*==*/      topscreen();
  373. /*==*/    }
  374. /*++*/    if ((strcmp(s,"COLOREDIT")==0) || (strcmp(s,"CLE")==0))
  375. /*++*/      color_config();
  376. /*++*/    if ((strcmp(s,"COLORINIT")==0) || (strcmp(s,"CI")==0))
  377. /*++*/      buildcolorfile();
  378. /*==*/    if ((strcmp(s,"CHUSER")==0) || (strcmp(s,"CU")==0)) {
  379.  
  380.  
  381. Step 8:
  382.  
  383. Load FCNS.H, and add the following entries to the utility.c entry, or
  384. just use MAKE FCNS, if you prefer.
  385.  
  386. /*==*/void win_pause(void);
  387. /*++*/void get_colordata(void);
  388. /*++*/void save_colordata(void);
  389. /*++*/void list_ext_colors(void);
  390. /*++*/void color_config(void);
  391. /*==*/void get_status(int mode, int lock);
  392.  
  393.  
  394. Step 9:
  395.  
  396. Recompile.
  397. -----------------------------------------------------------------------------
  398. STEP 9a:  ADD this line to VARS.H:
  399.  
  400. == __EXTRN__ configoverrec syscfgovr;
  401. == __EXTRN__ statusrec status;
  402. ++ __EXTRN__ colorrec rescolor;                           // AQUA25 94 COLORS
  403. == __EXTRN__ smalrec huge *smallist;
  404. == __EXTRN__ subboardrec *subboards;
  405. -----------------------------------------------------------------------------
  406. STEP 9b: ADD this line to XINIT.C, right above the final }
  407.  
  408. ==   if (!restoring_shrink)
  409. ==     catsl();
  410. ==
  411. ==   write_inst(INST_LOC_WFC,0,INST_FLAGS_NONE);
  412. ==
  413. ==   get_colordata();                                    // AQUA25 94 COLORS
  414. == }
  415. -----------------------------------------------------------------------------
  416. STEP 9c: ADD this line to NEWUSER.C, in function void newuser(void) :
  417.  
  418. == void newuser(void)
  419. == {
  420. ==   int i,ok;
  421. ==   char s[255],s1[81],ch;
  422. ==   userrec u;
  423. ==   long l1;
  424. ==
  425. ++   get_colordata();                                    // AQUA25 94 COLORS
  426. ==
  427. ==   memset(&thisuser, 0, sizeof(userrec));
  428. ==  memset(qsc, 0, syscfg.qscn_len);
  429. -----------------------------------------------------------------------------
  430.  
  431.  
  432. Step 10:
  433.  
  434. This is my COLOR.DAT file, containing my recommended color scheme.  It
  435. includes Shift 1-0 as ANSI 01-10 (dark blue to intense green), '_', '+', '|'
  436. as ANSI 11, 12 and 13, and '-' and '=' as ANSI 14 and 15, much like entering
  437. colors in TheDraw, which most people are familiar with.  ^P-M and N, O and P,
  438. and so forth are first an intense color on its corresponding background,
  439. followed by intense white on the same background.  If you'd like to use this
  440. configuration, either in its current form or as a basis from which to modify,
  441. UUDECODE this and put it in your DATA directory.
  442.  
  443.  
  444. section 1 of uuencode 5.22 of file color.dat    by R.E.M.
  445.  
  446. begin 644 color.dat
  447. M`0(##P4&`@@*#0P/@82(B8J-A1D?*B\[/TQ/75]N;W]X(B,D!@LG"`H-#`^!
  448. MA(B)BHV%&1\J+SL_3$]=7VYO?WA"#6I%1D=(24I+3$U.3U!14E-4!E976%E:
  449. M6UQ=7E]@86)C9&5F9VAI:FML;6YO<'%R<W1U=G=X>7I[?'U^?X"!@H.$A8:'
  450. MB(F*BXR-CH^0D9*3E)66EYB9FIN<G9Z?H*&BHZ2EIJ>HJ:JKK*VNK["QLK.T
  451. MM;:WN+FZN[R]OK_`P<+#Q,7&Q\C)RLO,S<[/T-'2#M0,"@H)B@<%!`/>`>#A
  452. /XN/DY>;GZ.GJZ^SM[N_P
  453. `
  454. end
  455. sum -r/size 62576/358 section (from "begin" to "end")
  456. sum -r/size 14788/240 entire input file
  457.  
  458.  
  459.