home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / patch2b < prev    next >
Encoding:
Internet Message Format  |  1993-06-15  |  61.4 KB

  1. Path: uunet!news.tek.com!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i077:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch2b/33
  5. Date: 11 Jun 1993 00:05:10 GMT
  6. Organization: Tektronix, Inc, Redmond, OR, USA
  7. Lines: 2477
  8. Approved: billr@saab.CNA.TEK.COM
  9. Message-ID: <1v8i7m$iou@ying.cna.tek.com>
  10. NNTP-Posting-Host: saab.cna.tek.com
  11. Xref: uunet comp.sources.games:1756
  12.  
  13. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  14. Posting-number: Volume 17, Issue 77
  15. Archive-name: nethack31/Patch2b
  16. Patch-To: nethack31: Volume 16, Issue 1-116
  17. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  18.  
  19.  
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then unpack
  23. # it by saving it into a file and typing "sh file".  To overwrite existing
  24. # files, type "sh file -c".  You can also feed this as standard input via
  25. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  26. # will see the following message at the end:
  27. #        "End of archive 2 (of 33)."
  28. # Contents:  patches02m
  29. # Wrapped by billr@saab on Thu Jun 10 16:54:59 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'patches02m' -a "${1}" != "-c" ; then 
  32.   echo shar: Renaming existing file \"'patches02m'\" to \"'patches02m.orig'\"
  33.   mv -f 'patches02m' 'patches02m.orig'
  34. fi
  35. echo shar: Extracting \"'patches02m'\" \(58318 characters\)
  36. sed "s/^X//" >'patches02m' <<'END_OF_FILE'
  37. X*** /tmp/da11960    Tue Jun  1 17:01:06 1993
  38. X--- sys/amiga/wb.c    Tue Jun  1 12:12:58 1993
  39. X***************
  40. X*** 10,15 ****
  41. X--- 10,17 ----
  42. X  # define __chip
  43. X  #endif
  44. X  
  45. X+ #include "incl:patchlevel.h"
  46. X+ 
  47. X  #include "Amiga:wbdefs.h"        /* Miscellany information */
  48. X  #ifdef  INTUI_NEW_LOOK
  49. X  #define NewWindow   ExtNewWindow
  50. X***************
  51. X*** 84,97 ****
  52. X      struct IntuiMessage mimsg;
  53. X      int i;
  54. X  
  55. X!     ZapOptions( curopts );
  56. X      InitWB( argc, argv );
  57. X!     SetupWB( ); /* open window, build menus */
  58. X!     errmsg( NO_FLASH, "Welcome to NetHack Version 3.1.1!" );
  59. X      CopyRight( );
  60. X  
  61. X      ReadConfig( );
  62. X-     LoadDefaults( defgname );
  63. X  
  64. X      /* Initially, no game selected so disable menu items */
  65. X  
  66. X--- 86,103 ----
  67. X      struct IntuiMessage mimsg;
  68. X      int i;
  69. X  
  70. X!     /* Initialize and load libraries. */
  71. X      InitWB( argc, argv );
  72. X! 
  73. X!     /* open window, build menus */
  74. X!     SetupWB( );
  75. X! 
  76. X!     errmsg( NO_FLASH, "Welcome to NetHack Version %d.%d.%d!",
  77. X!       VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL );
  78. X! 
  79. X      CopyRight( );
  80. X  
  81. X      ReadConfig( );
  82. X  
  83. X      /* Initially, no game selected so disable menu items */
  84. X  
  85. X***************
  86. X*** 111,124 ****
  87. X  
  88. X      rmask = Wait( mask );
  89. X  
  90. X-     /* If displayed an error message before, clear it */
  91. X- 
  92. X-     if( errup )
  93. X-     {
  94. X-         errmsg( NO_FLASH, "" );
  95. X-         errup = 0;
  96. X-     }
  97. X- 
  98. X      /* Process the messages on the port unless the workbench is
  99. X       * shutdown by a request to play a game.
  100. X       */
  101. X--- 117,122 ----
  102. X***************
  103. X*** 150,156 ****
  104. X          break;
  105. X  
  106. X          case MENUPICK:
  107. X!         do_menu( mimsg.Code );
  108. X          flushIDCMP( win->UserPort );
  109. X          break;
  110. X  
  111. X--- 148,159 ----
  112. X          break;
  113. X  
  114. X          case MENUPICK:
  115. X!         if( errup > 0 )
  116. X!         {
  117. X!             errmsg( NO_FLASH, "" );
  118. X!             errup = -1;
  119. X!         }
  120. X!         do_menu( &MenuList1, mimsg.Code );
  121. X          flushIDCMP( win->UserPort );
  122. X          break;
  123. X  
  124. X***************
  125. X*** 157,162 ****
  126. X--- 160,171 ----
  127. X          case RAWKEY:
  128. X          if( mimsg.Code == 0x5f )
  129. X          {
  130. X+             if( errup > 0 )
  131. X+             {
  132. X+             errmsg( NO_FLASH, "" );
  133. X+             errup = -1;
  134. X+             }
  135. X+ 
  136. X              /* Pick the correct help message */
  137. X  
  138. X              if( lastgaddown == NULL )
  139. X***************
  140. X*** 179,184 ****
  141. X--- 188,198 ----
  142. X          break;
  143. X  
  144. X          case GADGETDOWN:
  145. X+         if( errup > 0 )
  146. X+         {
  147. X+             errmsg( NO_FLASH, "" );
  148. X+             errup = -1;
  149. X+         }
  150. X          do_gadgetdown( &mimsg );
  151. X          break;
  152. X  
  153. X***************
  154. X*** 187,201 ****
  155. X--- 201,227 ----
  156. X          break;
  157. X  
  158. X          case DISKINSERTED:
  159. X+         if( errup > 0 )
  160. X+         {
  161. X+             errmsg( NO_FLASH, "" );
  162. X+             errup = -1;
  163. X+         }
  164. X          MapGadgets( R_DISK, 1 );
  165. X          break;
  166. X  
  167. X          case MOUSEBUTTONS:
  168. X+         if( errup > 0 )
  169. X+         {
  170. X+             errmsg( NO_FLASH, "" );
  171. X+             errup = -1;
  172. X+         }
  173. X          do_buttons( &mimsg );
  174. X          flushIDCMP( win->UserPort );
  175. X          break;
  176. X          }
  177. X      }
  178. X+     if( errup == -1 )
  179. X+         errup = 0;
  180. X  
  181. X      if( rmask & ( 1L << dosport->mp_SigBit ) )
  182. X      {
  183. X***************
  184. X*** 258,265 ****
  185. X--- 284,294 ----
  186. X      struct MsgPort *port;
  187. X  {
  188. X      struct Message *msg;
  189. X+ 
  190. X      while( msg = GetMsg( port ) )
  191. X          ReplyMsg( msg );
  192. X+ 
  193. X+     SetSignal( 0L, ( 1L << port->mp_SigBit ) );
  194. X  }
  195. X  
  196. X  void CopyRight( )
  197. X***************
  198. X*** 323,328 ****
  199. X--- 352,358 ----
  200. X      argv = (char **)wbs;
  201. X      for( i = 1; i < argc; ++i )
  202. X      {
  203. X+         if( argv[i][0] == '?' )goto usage;
  204. X          if( argv[i][0] != '-' )
  205. X          break;
  206. X          for( j = 1; c = argv[i][j]; ++j )
  207. X***************
  208. X*** 378,387 ****
  209. X                  cleanup( 1 );
  210. X              }
  211. X              break;
  212. X- 
  213. X          default:
  214. X              fprintf( stderr, "%s: invalid option %c\n",
  215. X              argv[0], c );
  216. X              fprintf( stderr,
  217. X  "usage: %s [-m] [-f .def filename] [-c config filename] [ -N screen]\n",
  218. X              argv[ 0 ] );
  219. X--- 408,417 ----
  220. X                  cleanup( 1 );
  221. X              }
  222. X              break;
  223. X          default:
  224. X              fprintf( stderr, "%s: invalid option %c\n",
  225. X              argv[0], c );
  226. X+ usage:
  227. X              fprintf( stderr,
  228. X  "usage: %s [-m] [-f .def filename] [-c config filename] [ -N screen]\n",
  229. X              argv[ 0 ] );
  230. X***************
  231. X*** 557,563 ****
  232. X      NewScreenStructure.Width = GfxBase->NormalDisplayColumns;
  233. X      NewScreenStructure.Height = GfxBase->NormalDisplayRows;
  234. X  
  235. X!     NewScreenStructure.DefaultTitle = "WorkBench for V3.1.1 of NetHack";
  236. X  
  237. X  #ifdef  INTUI_NEW_LOOK
  238. X      if( IntuitionBase->LibNode.lib_Version < 37 )
  239. X--- 587,598 ----
  240. X      NewScreenStructure.Width = GfxBase->NormalDisplayColumns;
  241. X      NewScreenStructure.Height = GfxBase->NormalDisplayRows;
  242. X  
  243. X!     {
  244. X!     static char dt[40];
  245. X!     sprintf(dt,"WorkBench for V%d.%d.%d of NetHack",
  246. X!       VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL );
  247. X!     NewScreenStructure.DefaultTitle = dt;
  248. X!     }
  249. X  
  250. X  #ifdef  INTUI_NEW_LOOK
  251. X      if( IntuitionBase->LibNode.lib_Version < 37 )
  252. X***************
  253. X*** 583,596 ****
  254. X      {
  255. X          if( ( scrn = LockPubScreen( pubscreen ) ) == 0 )
  256. X          {
  257. X          scrntags[1].ti_Tag = SA_PubName;
  258. X          scrntags[1].ti_Data = (ULONG) pubscreen;
  259. X          scrntags[2].ti_Tag = TAG_DONE;
  260. X          if( ( scrn = OpenScreen( (void *)
  261. X              &NewScreenStructure ) ) == NULL )
  262. X          {
  263. X!             error( "Can't create screen" );
  264. X!             cleanup( 1 );
  265. X          }
  266. X          pubopen = 1;
  267. X          scrlocked = 0;
  268. X--- 618,653 ----
  269. X      {
  270. X          if( ( scrn = LockPubScreen( pubscreen ) ) == 0 )
  271. X          {
  272. X+         /* Now add our pub screen name */
  273. X          scrntags[1].ti_Tag = SA_PubName;
  274. X          scrntags[1].ti_Data = (ULONG) pubscreen;
  275. X          scrntags[2].ti_Tag = TAG_DONE;
  276. X+ 
  277. X+         /* Get the default pub screen's size */
  278. X+         scrn = LockPubScreen( NULL );
  279. X+         NewScreenStructure.Height = scrn->Height;
  280. X+         NewScreenStructure.Width = scrn->Width;
  281. X+         UnlockPubScreen( NULL, scrn );
  282. X+ 
  283. X+         /* Request LACE if it looks laced.  For 2.1/3.0, we will get
  284. X+          * promoted to the users choice of modes (if promotion is alloed)
  285. X+          * which is best to avoid extra coding involving copying of the
  286. X+          * viewport modes etc.
  287. X+          */
  288. X+         if( NewScreenStructure.Height > 300 )
  289. X+             NewScreenStructure.ViewModes |= LACE;
  290. X+ 
  291. X          if( ( scrn = OpenScreen( (void *)
  292. X              &NewScreenStructure ) ) == NULL )
  293. X          {
  294. X!             NewScreenStructure.Height = GfxBase->NormalDisplayRows;
  295. X!             NewScreenStructure.Width = GfxBase->NormalDisplayColumns;
  296. X!             if( ( scrn = OpenScreen( (void *)
  297. X!             &NewScreenStructure ) ) == NULL )
  298. X!             {
  299. X!             error( "Can't create screen" );
  300. X!             cleanup( 1 );
  301. X!             }
  302. X          }
  303. X          pubopen = 1;
  304. X          scrlocked = 0;
  305. X***************
  306. X*** 644,650 ****
  307. X  
  308. X  #ifdef  INTUI_NEW_LOOK
  309. X      if( scrlocked )
  310. X!     strcpy( mytitle, "NetHack WB 3.1.1 - Select a GAME or press HELP" );
  311. X      else
  312. X      strcpy( mytitle, "Select a GAME or press HELP" );
  313. X  
  314. X--- 701,709 ----
  315. X  
  316. X  #ifdef  INTUI_NEW_LOOK
  317. X      if( scrlocked )
  318. X!     sprintf( mytitle, "NetHack WB %d.%d.%d - Select a GAME or press HELP",
  319. X!       VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL );
  320. X! 
  321. X      else
  322. X      strcpy( mytitle, "Select a GAME or press HELP" );
  323. X  
  324. X***************
  325. X*** 682,687 ****
  326. X--- 741,750 ----
  327. X  #ifdef  INTUI_NEW_LOOK
  328. X      if( IntuitionBase->LibNode.lib_Version >= 37 )
  329. X      {
  330. X+     /* If we did not create this screen, unlock it.
  331. X+      * otherwise, advertise it for other applications
  332. X+      * to use.
  333. X+      */
  334. X      if( scrlocked )
  335. X          UnlockPubScreen( NULL, scrn );
  336. X      else if( pubopen )
  337. X***************
  338. X*** 1070,1076 ****
  339. X      Help3_NewWindowStructure10.Height += txtdiff;
  340. X      }
  341. X  
  342. X!     Help3_NewWindowStructure10.Title = "Help for NetHack WorkBench V3.1.1";
  343. X      Help3_NewWindowStructure10.Screen = scrn;
  344. X      if( ( win = MyOpenWindow( &Help3_NewWindowStructure10 ) ) == NULL )
  345. X      {
  346. X--- 1133,1145 ----
  347. X      Help3_NewWindowStructure10.Height += txtdiff;
  348. X      }
  349. X  
  350. X!     {
  351. X!     static char title[40];
  352. X!     sprintf(title,"Help for NetHack WorkBench V%d.%d.%d",
  353. X!       VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL );
  354. X!     Help3_NewWindowStructure10.Title = title;
  355. X!     }
  356. X! 
  357. X      Help3_NewWindowStructure10.Screen = scrn;
  358. X      if( ( win = MyOpenWindow( &Help3_NewWindowStructure10 ) ) == NULL )
  359. X      {
  360. X***************
  361. X*** 1204,1277 ****
  362. X  /* Act on the menu item number passed */
  363. X  
  364. X  void
  365. X! do_menu(mcode)
  366. X      register int mcode;
  367. X  {
  368. X!     switch(MENUNUM(mcode))
  369. X      {
  370. X!     case MENU_PROJECT:
  371. X!         switch(ITEMNUM(mcode))
  372. X!         {
  373. X!         case ITEM_HELP:
  374. X!             help_requester( "NetHack:HackWB.hlp" );
  375. X!             break;
  376. X  
  377. X!         case ITEM_ABOUT:
  378. X!             text_requester( &About_NewWindowStructure9,
  379. X!                 &About_IntuiTextList9 );
  380. X!             break;
  381. X  
  382. X!         case ITEM_SCORES:
  383. X!             menu_scores( );
  384. X!             break;
  385. X  
  386. X!         case ITEM_RECOVER:
  387. X!             menu_recover( );
  388. X!             break;
  389. X  
  390. X!         case ITEM_EDDEF:
  391. X!             menu_editdef( GAME_FROM_DEFAULT );
  392. X!             break;
  393. X  
  394. X!         case ITEM_CONFIG:
  395. X!             menu_config( );
  396. X!             break;
  397. X  
  398. X!         case ITEM_QUIT:
  399. X!             quit = Ask( "Ready to Quit?" );
  400. X!             break;
  401. X  
  402. X!         }
  403. X!         break;
  404. X  
  405. X!     case MENU_GAME:
  406. X!         switch( ITEMNUM( mcode ) )
  407. X!         {
  408. X  
  409. X!         case ITEM_INFO:
  410. X!             menu_info( );
  411. X!             break;
  412. X  
  413. X!         case ITEM_SETCOMMENT:
  414. X!             menu_comment( );
  415. X!             break;
  416. X  
  417. X!         case ITEM_SETOPT:
  418. X!             menu_setopt( );
  419. X!             break;
  420. X! 
  421. X!         case ITEM_COPYOPT:
  422. X!             menu_copyopt( );
  423. X!             break;
  424. X! 
  425. X!         case ITEM_DISCARD:
  426. X!             menu_discard( );
  427. X!             break;
  428. X! 
  429. X!         case ITEM_RENAME:
  430. X!             menu_rename( );
  431. X!             break;
  432. X!         }
  433. X      }
  434. X  }
  435. X  
  436. X--- 1273,1339 ----
  437. X  /* Act on the menu item number passed */
  438. X  
  439. X  void
  440. X! do_menu( mptr, mcode)
  441. X!     struct Menu *mptr;
  442. X      register int mcode;
  443. X  {
  444. X!     while( mcode != MENUNULL )
  445. X      {
  446. X!     switch(MENUNUM(mcode))
  447. X!     {
  448. X!         case MENU_PROJECT:
  449. X!         switch(ITEMNUM(mcode))
  450. X!         {
  451. X!             case ITEM_HELP:
  452. X!             help_requester( "NetHack:HackWB.hlp" );
  453. X!             break;
  454. X  
  455. X!             case ITEM_ABOUT:
  456. X!             text_requester( &About_NewWindowStructure9,
  457. X!                 &About_IntuiTextList9 );
  458. X!             break;
  459. X  
  460. X!             case ITEM_SCORES:
  461. X!             menu_scores( );
  462. X!             break;
  463. X  
  464. X!             case ITEM_RECOVER:
  465. X!             menu_recover( );
  466. X!             break;
  467. X  
  468. X!             case ITEM_CONFIG:
  469. X!             menu_config( );
  470. X!             break;
  471. X  
  472. X!             case ITEM_QUIT:
  473. X!             quit = Ask( "Ready to Quit?" );
  474. X!             break;
  475. X  
  476. X!         }
  477. X!         break;
  478. X  
  479. X!         case MENU_GAME:
  480. X!         switch( ITEMNUM( mcode ) )
  481. X!         {
  482. X  
  483. X!             case ITEM_INFO:
  484. X!             menu_info( );
  485. X!             break;
  486. X  
  487. X!             case ITEM_COPYOPT:
  488. X!             menu_copyopt( );
  489. X!             break;
  490. X  
  491. X!             case ITEM_DISCARD:
  492. X!             menu_discard( );
  493. X!             break;
  494. X  
  495. X!             case ITEM_RENAME:
  496. X!             menu_rename( );
  497. X!             break;
  498. X!         }
  499. X!     }
  500. X!         mcode = ((struct MenuItem *)ItemAddress( mptr, (long)mcode ))->NextSelect;
  501. X      }
  502. X  }
  503. X  
  504. X***************
  505. X*** 1300,1308 ****
  506. X  run_game( gptr )
  507. X      register GPTR gptr;
  508. X  {
  509. X      struct Task *ctask;
  510. X      register struct MsgPort *proc = NULL;
  511. X!     char buf[ 100 ], *t;
  512. X      char namebuf[ 100 ];
  513. X      int once, tidx;
  514. X  
  515. X--- 1362,1371 ----
  516. X  run_game( gptr )
  517. X      register GPTR gptr;
  518. X  {
  519. X+     extern UWORD __chip waitPointer[];
  520. X      struct Task *ctask;
  521. X      register struct MsgPort *proc = NULL;
  522. X!     char buf[ 100 ];
  523. X      char namebuf[ 100 ];
  524. X      int once, tidx;
  525. X  
  526. X***************
  527. X*** 1318,1340 ****
  528. X  
  529. X      if( gptr->dobj->do_Gadget.GadgetID == GADNEWGAME )
  530. X      {
  531. X-         /*
  532. X-         if currrent name in use, get new name
  533. X-         */
  534. X- 
  535. X-     if( !defgame.plname )
  536. X-         defgame.plname = strdup( defgname );
  537. X- 
  538. X-     /* Put options from gadgets into options[ OPTIONS_IDX ] */
  539. X- 
  540. X-     PutOptions( curopts );
  541. X- 
  542. X      once = 0;
  543. X!     sprintf( buf, "%s/%s.sav", options[ SAVE_IDX ], defgame.plname );
  544. X      while( access( buf, 0 ) == 0 )
  545. X      {
  546. X          if( StrRequest( "Game Already Exists, Enter a New Name",
  547. X!         namebuf, once ? namebuf : defgame.plname ) == 0 )
  548. X          {
  549. X          return;
  550. X          }
  551. X--- 1381,1392 ----
  552. X  
  553. X      if( gptr->dobj->do_Gadget.GadgetID == GADNEWGAME )
  554. X      {
  555. X      once = 0;
  556. X!     sprintf( buf, "%s/%s.sav", options[ SAVE_IDX ], gptr->name );
  557. X      while( access( buf, 0 ) == 0 )
  558. X      {
  559. X          if( StrRequest( "Game Already Exists, Enter a New Name",
  560. X!         namebuf, once ? namebuf : gptr->gname ) == 0 )
  561. X          {
  562. X          return;
  563. X          }
  564. X***************
  565. X*** 1341,1386 ****
  566. X          once = 1;
  567. X          sprintf( buf, "%s/%s.sav", options[ SAVE_IDX ], namebuf );
  568. X      }
  569. X- 
  570. X-     /* Set new name to use, if done one at all */
  571. X-     if( once )
  572. X-     {
  573. X-         if( defgame.plname ) free( defgame.plname );
  574. X-         defgame.plname = strdup( namebuf );
  575. X-     }
  576. X- 
  577. X-         /* set defaults for this game from previous defaults. */
  578. X-     if( defgame.plname && stricmp( defgame.plname, "wbdefaults" ) )
  579. X-         SetToolLine( gptr, "NAME", defgame.plname );
  580. X-     if( defgame.pltype )
  581. X-         SetToolLine( gptr, "CHARACTER", players[ defgame.pltype ] );
  582. X- 
  583. X-     gptr->gname = xmalloc( 20 + strlen( defgame.plname ) );
  584. X      }
  585. X!     else
  586. X!     {
  587. X!     gptr->gname = xmalloc( 20 + strlen( gptr->name ) );
  588. X!     }
  589. X  
  590. X!     SetToolLine( gptr, "PATH", options[ PATH_IDX ] );
  591. X!     if( defgame.options )
  592. X!     SetToolLine( gptr, "OPTIONS", defgame.options );
  593. X!     else
  594. X!     SetToolLine( gptr, "OPTIONS", options[ OPTIONS_IDX ] );
  595. X  
  596. X-     /* Prefer a setting in the users data over the global one */
  597. X-     if( ( ( t = ToolsEntry( gptr, "PENS" ) ) == NULL || *t == 0 ) &&
  598. X-       ( ( t = ToolsEntry( gptr, "PEN" ) ) == NULL || *t == 0 ) )
  599. X-     {
  600. X-     t = options[ PENS_IDX ];
  601. X-     }
  602. X-     SetToolLine( gptr, "PENS", t );
  603. X-     SetToolLine( gptr, "HACKDIR", options[ HACKDIR_IDX ] );
  604. X-     SetToolLine( gptr, "LEVELS", options[ LEVELS_IDX ] );
  605. X-     SetToolLine( gptr, "SAVE", options[ SAVE_IDX ] );
  606. X- 
  607. X      gptr->wbs = AllocMem( sizeof( struct WBStartup ) +
  608. X!     ( sizeof( struct WBArg ) * 2 ), MEMF_PUBLIC | MEMF_CLEAR );
  609. X  
  610. X      /* Check if we got everything */
  611. X  
  612. X--- 1393,1408 ----
  613. X          once = 1;
  614. X          sprintf( buf, "%s/%s.sav", options[ SAVE_IDX ], namebuf );
  615. X      }
  616. X      }
  617. X!     gptr->gname = xmalloc( 20 + strlen( gptr->name ) );
  618. X  
  619. X!     /*
  620. X!      * options[] are no longer put into the tooltypes because they are in the options
  621. X!      * string now.
  622. X!      */
  623. X  
  624. X      gptr->wbs = AllocMem( sizeof( struct WBStartup ) +
  625. X!         ( sizeof( struct WBArg ) * 2 ), MEMF_PUBLIC | MEMF_CLEAR );
  626. X  
  627. X      /* Check if we got everything */
  628. X  
  629. X***************
  630. X*** 1400,1422 ****
  631. X      if( shutdown )
  632. X      CloseDownWB( );
  633. X  
  634. X      /* Load the game into memory */
  635. X  #ifdef SPLIT
  636. X      /* Which version do we run? */
  637. X      {
  638. X!     char gi[80];
  639. X  
  640. X!     sprintf( gi, "%s.dir", GAMEIMAGE );
  641. X!     if( access( gi, 0 ) == 0 ){
  642. X!     gptr->seglist = (BPTR)s_LoadSeg( gi );
  643. X!     if( gptr->seglist ) running_split=1;
  644. X!     }else{
  645. X!     gptr->seglist = (BPTR)LoadSeg( GAMEIMAGE );
  646. X      }
  647. X-     }
  648. X  #else
  649. X      gptr->seglist = (BPTR)LoadSeg( GAMEIMAGE );
  650. X  #endif
  651. X  
  652. X      if( gptr->seglist == NULL)
  653. X      {
  654. X--- 1422,1448 ----
  655. X      if( shutdown )
  656. X      CloseDownWB( );
  657. X  
  658. X+     SetPointer( win, waitPointer, 16, 16, -6, 0 );
  659. X+ 
  660. X      /* Load the game into memory */
  661. X+ 
  662. X  #ifdef SPLIT
  663. X      /* Which version do we run? */
  664. X      {
  665. X!     char gi[80];
  666. X  
  667. X!     sprintf( gi, "%s.dir", GAMEIMAGE );
  668. X!     if( access( gi, 0 ) == 0 ){
  669. X!         gptr->seglist = (BPTR)s_LoadSeg( gi );
  670. X!         if( gptr->seglist ) running_split=1;
  671. X!     }else{
  672. X!         gptr->seglist = (BPTR)LoadSeg( GAMEIMAGE );
  673. X!     }
  674. X      }
  675. X  #else
  676. X      gptr->seglist = (BPTR)LoadSeg( GAMEIMAGE );
  677. X  #endif
  678. X+     ClearPointer( win );
  679. X  
  680. X      if( gptr->seglist == NULL)
  681. X      {
  682. X***************
  683. X*** 1429,1435 ****
  684. X  
  685. X      /* Set the game name for the status command */
  686. X  
  687. X!     sprintf( gptr->gname, "NetHack 3.1.1 %s", gptr->name );
  688. X  
  689. X      /* Create a process for the game to execute in */
  690. X  
  691. X--- 1455,1462 ----
  692. X  
  693. X      /* Set the game name for the status command */
  694. X  
  695. X!     sprintf( gptr->gname, "NetHack %d.%d.%d %s",
  696. X!       VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, gptr->name );
  697. X  
  698. X      /* Create a process for the game to execute in */
  699. X  
  700. X***************
  701. X*** 1471,1477 ****
  702. X      gptr->wbs->sm_Process = proc;
  703. X      gptr->wbs->sm_Segment = gptr->seglist;
  704. X      gptr->wbs->sm_NumArgs = 2;
  705. X!     gptr->wbs->sm_ToolWindow = "con:0/0/350/50/Amiga NetHack 3.1.1";
  706. X      gptr->wbs->sm_ArgList = gptr->wba;
  707. X  
  708. X      /* Fill in the args */
  709. X--- 1498,1509 ----
  710. X      gptr->wbs->sm_Process = proc;
  711. X      gptr->wbs->sm_Segment = gptr->seglist;
  712. X      gptr->wbs->sm_NumArgs = 2;
  713. X!     {
  714. X!     static char tw[40];
  715. X!     sprintf(tw,"con:0/0/350/50/Amiga NetHack %d.%d.%d",
  716. X!       VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL );
  717. X!     gptr->wbs->sm_ToolWindow = tw;
  718. X!     }
  719. X      gptr->wbs->sm_ArgList = gptr->wba;
  720. X  
  721. X      /* Fill in the args */
  722. X***************
  723. X*** 1649,1656 ****
  724. X  
  725. X      /* Check if we can access the new save directory */
  726. X  
  727. X!     if( ( savedir = Lock( options[ SAVE_IDX ], ACCESS_READ ) ) == NULL )
  728. X      {
  729. X      errmsg( FLASH,
  730. X          "Can't access save directory: %s", options[ SAVE_IDX ] );
  731. X      return;
  732. X--- 1681,1701 ----
  733. X  
  734. X      /* Check if we can access the new save directory */
  735. X  
  736. X!     if( t = strchr( options[ SAVE_IDX ], ';' ) )
  737. X      {
  738. X+     strncpy( buf, options[ SAVE_IDX ], sizeof( buf ) - 1 );
  739. X+     buf[ sizeof( buf ) - 1 ] = 0;
  740. X+     if( ( t = strchr( buf, ';' ) ) && strcmp( t, ";n" ) == 0 )
  741. X+         *t = 0;
  742. X+     if( ( savedir = Lock( buf, ACCESS_READ ) ) == NULL )
  743. X+     {
  744. X+         errmsg( FLASH,
  745. X+             "Can't access save directory: %s", buf );
  746. X+         return;
  747. X+     }
  748. X+     }
  749. X+     else if( ( savedir = Lock( options[ SAVE_IDX ], ACCESS_READ ) ) == NULL )
  750. X+     {
  751. X      errmsg( FLASH,
  752. X          "Can't access save directory: %s", options[ SAVE_IDX ] );
  753. X      return;
  754. X***************
  755. X*** 1664,1671 ****
  756. X      return;
  757. X      }
  758. X  
  759. X!     if( newgame = gamehead )
  760. X      gamehead = gamehead->next;
  761. X  
  762. X      if( !Examine( savedir, finfo ) )
  763. X      {
  764. X--- 1709,1718 ----
  765. X      return;
  766. X      }
  767. X  
  768. X!     if( ( newgame = gamehead ) && newgame->dobj->do_Gadget.GadgetID == GADNEWGAME )
  769. X      gamehead = gamehead->next;
  770. X+     else
  771. X+     newgame = NULL;
  772. X  
  773. X      if( !Examine( savedir, finfo ) )
  774. X      {
  775. X***************
  776. X*** 1752,1758 ****
  777. X  
  778. X      if( !once )
  779. X      {
  780. X!     for( gd = Rst_NewWindowStructure12.FirstGadget;
  781. X              gd; gd = gd->NextGadget )
  782. X      {
  783. X          switch( gd->GadgetID )
  784. X--- 1799,1805 ----
  785. X  
  786. X      if( !once )
  787. X      {
  788. X!     for( gd = Rst_NewWindowStructure11.FirstGadget;
  789. X              gd; gd = gd->NextGadget )
  790. X      {
  791. X          switch( gd->GadgetID )
  792. X***************
  793. X*** 1786,1793 ****
  794. X              break;
  795. X          }
  796. X      }
  797. X!     Rst_NewWindowStructure12.Height += txtdiff*5;
  798. X!     for( ip = &Rst_IntuiTextList12; ip; ip = ip->NextText )
  799. X      {
  800. X          if( *ip->IText == 'O' )
  801. X          ip->TopEdge += txtdiff;
  802. X--- 1833,1840 ----
  803. X              break;
  804. X          }
  805. X      }
  806. X!     Rst_NewWindowStructure11.Height += txtdiff*5;
  807. X!     for( ip = &Rst_IntuiTextList11; ip; ip = ip->NextText )
  808. X      {
  809. X          if( *ip->IText == 'O' )
  810. X          ip->TopEdge += txtdiff;
  811. X***************
  812. X*** 1797,1809 ****
  813. X      once = 1;
  814. X      }
  815. X  
  816. X!     Rst_NewWindowStructure12.Screen = scrn;
  817. X!     if( ( w = MyOpenWindow( &Rst_NewWindowStructure12 ) ) == NULL )
  818. X      {
  819. X      errmsg( FLASH, "Can't create requester window" );
  820. X      return;
  821. X      }
  822. X!     PrintIText( w->RPort, &Rst_IntuiTextList12, 0, txtdiff );
  823. X      lastact = FindGadget( w, NULL, GADRESTDIR );
  824. X  
  825. X      while( !done )
  826. X--- 1844,1856 ----
  827. X      once = 1;
  828. X      }
  829. X  
  830. X!     Rst_NewWindowStructure11.Screen = scrn;
  831. X!     if( ( w = MyOpenWindow( &Rst_NewWindowStructure11 ) ) == NULL )
  832. X      {
  833. X      errmsg( FLASH, "Can't create requester window" );
  834. X      return;
  835. X      }
  836. X!     PrintIText( w->RPort, &Rst_IntuiTextList11, 0, txtdiff );
  837. X      lastact = FindGadget( w, NULL, GADRESTDIR );
  838. X  
  839. X      while( !done )
  840. X***************
  841. X*** 1878,1883 ****
  842. X--- 1925,1931 ----
  843. X      register struct Gadget *gd;
  844. X      static int once = 0;
  845. X      int txtdiff = scrn->RastPort.TxHeight - 8;
  846. X+     char *env;
  847. X  
  848. X      strcpy( StrPath, options[ PATH_IDX ] );
  849. X      strcpy( StrHackdir, options[ HACKDIR_IDX ] );
  850. X***************
  851. X*** 2050,2055 ****
  852. X--- 2098,2108 ----
  853. X  
  854. X              case GADCONFLOAD:
  855. X                  ReadConfig( );
  856. X+                             env = malloc( strlen( StrConf ) + 3 +
  857. X+                         strlen( "NETHACKOPTIONS" ) );
  858. X+                 sprintf( env, "NETHACKOPTIONS=@%s", StrConf );
  859. X+                 putenv( env );
  860. X+                 free( env );
  861. X                  strcpy( StrPath, options[ PATH_IDX ] );
  862. X                  strcpy( StrHackdir, options[ HACKDIR_IDX ] );
  863. X                  strcpy( StrPens, options[ PENS_IDX ] );
  864. X***************
  865. X*** 2064,2070 ****
  866. X                          char buf[ 300 ], *t, nname[ 100 ], oname[100], *b;
  867. X  
  868. X                                  setoneopt( PATH_IDX, StrPath );
  869. X-                                 PutOptions( curopts );
  870. X                                  setoneopt( HACKDIR_IDX, StrHackdir );
  871. X                                  setoneopt( PENS_IDX, StrPens );
  872. X                                  setoneopt( LEVELS_IDX, StrLevels );
  873. X--- 2117,2122 ----
  874. X***************
  875. X*** 2142,2148 ****
  876. X      }
  877. X  
  878. X      setoneopt( PATH_IDX, StrPath );
  879. X-     PutOptions( curopts );
  880. X      setoneopt( HACKDIR_IDX, StrHackdir );
  881. X      setoneopt( PENS_IDX, StrPens );
  882. X      setoneopt( LEVELS_IDX, StrLevels );
  883. X--- 2194,2199 ----
  884. X***************
  885. X*** 2242,2468 ****
  886. X      rename( "new_nethack.cnf", "nethack.cnf" );
  887. X  }
  888. X  
  889. X- void menu_editdef( gametype )
  890. X-     int gametype;
  891. X- {
  892. X-     register struct Window *cwin;
  893. X-     int done = 0, err;
  894. X-     USHORT mcode;
  895. X-     long class, qual, code;
  896. X-     register struct IntuiMessage *imsg;
  897. X-     register struct Gadget *gd;
  898. X-     char buf[ 100 ];
  899. X-     struct IntuiText *ip;
  900. X-     static int once = 0;
  901. X-     int txtdiff = scrn->RastPort.TxHeight - 8;
  902. X-     register GPTR gptr;
  903. X- 
  904. X-     /* If gametype indicates an INFO request... */
  905. X-     if( gametype == GAME_FROM_INFO )
  906. X-     {
  907. X-     register char *t;
  908. X- 
  909. X-     if( ( gptr = NeedGame() ) == NULL )
  910. X-     {
  911. X-         errmsg( FLASH, "No Game selected to edit options for" );
  912. X-         return;
  913. X-     }
  914. X- 
  915. X-     strcpy( DefOutFile, gptr->name );
  916. X-     if( ( t = strrchr( DefOutFile, '.' ) ) &&
  917. X-         stricmp( t, ".sav" ) == 0 )
  918. X-     {
  919. X-         *t = 0;
  920. X-     }
  921. X-     LoadDefaults( DefOutFile );
  922. X-     }
  923. X-     else /* if( gametype == GAME_FROM_DEFAULT ) */
  924. X-     {
  925. X-     /* Find the newgame gadget... */
  926. X- 
  927. X-     for( gptr = windowgads; gptr; gptr = gptr->nextwgad )
  928. X-     {
  929. X-         if( gptr->dobj->do_Gadget.GadgetID == GADNEWGAME )
  930. X-         break;
  931. X-     }
  932. X- 
  933. X-     if( !gptr )
  934. X-     {
  935. X-         errmsg( FLASH, "Can't find NewGame information" );
  936. X-         return;
  937. X-     }
  938. X- 
  939. X-     strcpy( DefOutFile, defgname );
  940. X-     LoadDefaults( DefOutFile );
  941. X-     }
  942. X- 
  943. X-     /* Copy the defgame.* date into the Defs_ window gadgets */
  944. X-     CopyDefs2Gad();
  945. X- 
  946. X-     /* Do one time window setup and initialization */
  947. X- 
  948. X-     if( !once )
  949. X-     {
  950. X-     /* Rearrange the gadgets based on fonts text height */
  951. X- 
  952. X-     for( gd = Defs_NewWindowStructure11.FirstGadget;
  953. X-         gd; gd = gd->NextGadget )
  954. X-     {
  955. X-         if( gd->GadgetID != 0 )
  956. X-         {
  957. X-         gd->TopEdge += txtdiff;
  958. X-         gd->Height += txtdiff;
  959. X-         switch( gd->GadgetID )
  960. X-         {
  961. X-             case GADOUTFILE:
  962. X-             gd->TopEdge += txtdiff;
  963. X-             break;
  964. X-             case GADDEFLOAD:
  965. X-             case GADDEFSAVE:
  966. X-             case GADEDOPTIONS:
  967. X-             gd->TopEdge += txtdiff * 3;
  968. X-             break;
  969. X-             default:
  970. X-             if( ( gd->Flags & GADGHIGHBITS ) == GADGHNONE )
  971. X-                 gd->TopEdge += txtdiff * 2;
  972. X-             break;
  973. X-         }
  974. X-         SetBorder( gd, -1 );
  975. X-         }
  976. X-     }
  977. X- 
  978. X-     /* Move the text down as appropriate */
  979. X- 
  980. X-     for( ip = &Defs_IntuiTextList11; ip; ip = ip->NextText )
  981. X-     {
  982. X-         if( *ip->IText == 'C' )
  983. X-         ip->TopEdge += txtdiff * 2;
  984. X-         else if( *ip->IText == 'O' )
  985. X-         ip->TopEdge += txtdiff;
  986. X-     }
  987. X- 
  988. X-     /* Adjust the height of the window */
  989. X-     Defs_NewWindowStructure11.Height += txtdiff * 5;
  990. X-     ++once;
  991. X-     }
  992. X- 
  993. X-     Defs_NewWindowStructure11.Screen = scrn;
  994. X- 
  995. X-     /* Set Correct title */
  996. X-     if( gametype == GAME_FROM_DEFAULT )
  997. X-     Defs_NewWindowStructure11.Title = "Edit Default Game Definition";
  998. X-     else if( gametype == GAME_FROM_INFO )
  999. X-     Defs_NewWindowStructure11.Title = "Edit Game Definition";
  1000. X-     else
  1001. X-     {
  1002. X-     errmsg( FLASH, "Can't edit game of type %d", gametype );
  1003. X-     return;
  1004. X-     }
  1005. X- 
  1006. X-     if( ( cwin = MyOpenWindow( &Defs_NewWindowStructure11 ) ) == NULL )
  1007. X-     {
  1008. X-     errmsg( FLASH, "Can't create requester window" );
  1009. X-     return;
  1010. X-     }
  1011. X- 
  1012. X-     PrintIText( cwin->RPort, &Defs_IntuiTextList11, 0, txtdiff );
  1013. X-     UpdateTypes( cwin );
  1014. X- 
  1015. X-     /* Do Menu Layouts Based on FontHeight */
  1016. X-     SetUpMenus( &Defs_MenuList11, scrn );
  1017. X-     SetMenuStrip( cwin, &Defs_MenuList11 );
  1018. X- 
  1019. X-     /* Process messages */
  1020. X-     while( !done )
  1021. X-     {
  1022. X-     WaitPort( cwin->UserPort );
  1023. X-     while( ( imsg = (void *) GetMsg( cwin->UserPort ) ) != NULL )
  1024. X-     {
  1025. X-         mcode = imsg->Code;
  1026. X-         gd = (struct Gadget *)imsg->IAddress;
  1027. X-         qual = imsg->Qualifier;
  1028. X-         class = imsg->Class;
  1029. X-         code = imsg->Code;
  1030. X- 
  1031. X-         ReplyMsg( (struct Message *)imsg );
  1032. X- 
  1033. X-         switch( class )
  1034. X-         {
  1035. X-         case VANILLAKEY:
  1036. X-             /* Escape or LEFT_AMIGA-b aborts the requester... */
  1037. X-             if( code == '\33' || (code == 'b' && (qual&AMIGALEFT)))
  1038. X-             {
  1039. X-             done = 1;
  1040. X-             }
  1041. X-             break;
  1042. X- 
  1043. X-         case ACTIVEWINDOW:
  1044. X-             if( gd = FindGadget( cwin, NULL, GADCHARNAME ) )
  1045. X-             ActivateGadget( gd, cwin, NULL );
  1046. X-             break;
  1047. X- 
  1048. X-         case MENUPICK:
  1049. X-             while( mcode != MENUNULL )
  1050. X-             {
  1051. X-             switch(MENUNUM(mcode))
  1052. X-             {
  1053. X-                 case PLAYERMENU:
  1054. X-                 defgame.pltype = ITEMNUM( mcode );
  1055. X-                 UpdateTypes( cwin );
  1056. X-                 break;
  1057. X-             }
  1058. X-             mcode = ((struct MenuItem *)
  1059. X-                 ItemAddress( &Defs_MenuList11,
  1060. X-                 mcode))->NextSelect;
  1061. X-             }
  1062. X-             break;
  1063. X- 
  1064. X-         case CLOSEWINDOW:
  1065. X-             CopyGad2Defs( );
  1066. X-             done = 1;
  1067. X-             break;
  1068. X- 
  1069. X-         case GADGETUP:
  1070. X-             switch( gd->GadgetID )
  1071. X-             {
  1072. X-             case GADEDOPTIONS:
  1073. X-                 CopyOptions( curopts, gptr );
  1074. X-                 if( EditOptions( curopts ) )
  1075. X-                 SetOptions( curopts, gptr );
  1076. X-                 break;
  1077. X- 
  1078. X-             case GADDEFSAVE:
  1079. X-                 CopyGad2Defs( );
  1080. X-                 sprintf( buf,
  1081. X-                 "Game definition saved in: %s", DefOutFile );
  1082. X-                 errmsg( NO_FLASH, buf );
  1083. X-                 SaveDefaults( DefOutFile );
  1084. X-                 break;
  1085. X- 
  1086. X-             case GADDEFLOAD:
  1087. X-                 err = !LoadDefaults( DefPlayerName );
  1088. X-                 if( !err )
  1089. X-                 {
  1090. X-                 strcpy( DefOutFile, DefPlayerName );
  1091. X-                 CopyDefs2Gad();
  1092. X-                 UpdateTypes( cwin );
  1093. X-                 sprintf( buf, "Game definition loaded from: %s",
  1094. X-                     DefPlayerName );
  1095. X-                 errmsg( NO_FLASH, buf );
  1096. X-                 }
  1097. X-                 break;
  1098. X- 
  1099. X-             default:
  1100. X-                 break;
  1101. X-             }
  1102. X-             break;
  1103. X-         }
  1104. X-     }
  1105. X-     }
  1106. X- 
  1107. X-     SafeCloseWindow( cwin );
  1108. X- }
  1109. X- 
  1110. X  void do_gadgetup( imsg )
  1111. X      register struct IntuiMessage *imsg;
  1112. X  {
  1113. X--- 2293,2298 ----
  1114. X***************
  1115. X*** 2563,2583 ****
  1116. X      gptr->mics = imsg->Micros;
  1117. X  }
  1118. X  
  1119. X! void menu_setopt()
  1120. X! {
  1121. X      register GPTR gptr;
  1122. X! 
  1123. X!     if( ( gptr = NeedGame() ) == NULL )
  1124. X!     return;
  1125. X      CopyOptions( curopts, gptr );
  1126. X!     if( EditOptions( curopts ) )
  1127. X      SetOptions( curopts, gptr );
  1128. X  }
  1129. X  
  1130. X  void menu_info()
  1131. X  {
  1132. X      register struct IntuiMessage *imsg;
  1133. X-     struct IntuiText *ip;
  1134. X      char *t;
  1135. X      register GPTR gptr;
  1136. X      register struct Gadget *gd;
  1137. X--- 2393,2410 ----
  1138. X      gptr->mics = imsg->Micros;
  1139. X  }
  1140. X  
  1141. X! void setopt( gptr )
  1142. X      register GPTR gptr;
  1143. X! {
  1144. X      CopyOptions( curopts, gptr );
  1145. X!     if( EditOptions( curopts, gptr ) )
  1146. X      SetOptions( curopts, gptr );
  1147. X  }
  1148. X  
  1149. X  void menu_info()
  1150. X  {
  1151. X+     int itemno;
  1152. X      register struct IntuiMessage *imsg;
  1153. X      char *t;
  1154. X      register GPTR gptr;
  1155. X      register struct Gadget *gd;
  1156. X***************
  1157. X*** 2584,2596 ****
  1158. X      register struct FileInfoBlock *finfo;
  1159. X      register struct Window *cwin;
  1160. X      register int i;
  1161. X!     int done = 0, quit;
  1162. X      char **sp;
  1163. X      static int once = 0;
  1164. X-     register BPTR lock;
  1165. X      long code, class, qual;
  1166. X!     static struct IntuiText itext[ 4 ];
  1167. X!     char commentstr[ 100 ], namestr[ 50 ];
  1168. X      int txtdiff = scrn->RastPort.TxHeight - 8;
  1169. X  
  1170. X      if( ( gptr = NeedGame() ) == NULL )
  1171. X--- 2411,2423 ----
  1172. X      register struct FileInfoBlock *finfo;
  1173. X      register struct Window *cwin;
  1174. X      register int i;
  1175. X!     int done = 0;
  1176. X!     long lock, olock;
  1177. X      char **sp;
  1178. X      static int once = 0;
  1179. X      long code, class, qual;
  1180. X!     static struct IntuiText itext[ 2 ];
  1181. X!     char commentstr[ 100 ], *s;
  1182. X      int txtdiff = scrn->RastPort.TxHeight - 8;
  1183. X  
  1184. X      if( ( gptr = NeedGame() ) == NULL )
  1185. X***************
  1186. X*** 2613,2619 ****
  1187. X      commentstr[ sizeof( finfo->fib_Comment ) ] = 0;
  1188. X      free( finfo );
  1189. X  
  1190. X!     for( i = 0; i < 4; ++i )
  1191. X      {
  1192. X      itext[ i ].FrontPen = C_BLACK;
  1193. X      itext[ i ].BackPen = C_GREY;
  1194. X--- 2440,2446 ----
  1195. X      commentstr[ sizeof( finfo->fib_Comment ) ] = 0;
  1196. X      free( finfo );
  1197. X  
  1198. X!     for( i = 0; i < 2; ++i )
  1199. X      {
  1200. X      itext[ i ].FrontPen = C_BLACK;
  1201. X      itext[ i ].BackPen = C_GREY;
  1202. X***************
  1203. X*** 2622,2634 ****
  1204. X      itext[ i ].LeftEdge = 4;
  1205. X      }
  1206. X      ReallocTools( gptr, 0 );
  1207. X-     sp = gptr->dobj->do_ToolTypes;
  1208. X  
  1209. X      if( !once )
  1210. X      {
  1211. X!     Info_Comment.TopEdge += txtdiff*2;
  1212. X!     Info_Class.TopEdge += txtdiff;
  1213. X!     Info_NewWindowStructure6.Height += txtdiff * 6;
  1214. X      for( gd = Info_NewWindowStructure6.FirstGadget;
  1215. X          gd; gd = gd->NextGadget )
  1216. X      {
  1217. X--- 2449,2459 ----
  1218. X      itext[ i ].LeftEdge = 4;
  1219. X      }
  1220. X      ReallocTools( gptr, 0 );
  1221. X  
  1222. X      if( !once )
  1223. X      {
  1224. X!         Info_Comment.TopEdge += txtdiff*2;
  1225. X!     Info_NewWindowStructure6.Height += txtdiff * 7;
  1226. X      for( gd = Info_NewWindowStructure6.FirstGadget;
  1227. X          gd; gd = gd->NextGadget )
  1228. X      {
  1229. X***************
  1230. X*** 2640,2647 ****
  1231. X--- 2465,2479 ----
  1232. X          case 0:
  1233. X              break;
  1234. X  
  1235. X+         case GADEDITOPTS:
  1236. X+             gd->TopEdge += txtdiff*3;
  1237. X+             SetBorder( gd, -1 );
  1238. X+             break;
  1239. X+ 
  1240. X          case GADTOOLTYPES:
  1241. X              gd->TopEdge += txtdiff*4;
  1242. X+             if( scrn->Height > 300 )
  1243. X+             gd->TopEdge += 2;
  1244. X              SetBorder( gd, -1 );
  1245. X              break;
  1246. X  
  1247. X***************
  1248. X*** 2655,2666 ****
  1249. X              SetBorder( gd, -1 );
  1250. X              break;
  1251. X  
  1252. X          case GADTOOLUP:
  1253. X              gd->TopEdge += txtdiff*4;
  1254. X              gd->Flags &= ~GADGHIGHBITS;
  1255. X              gd->Flags |= GADGIMAGE|GADGHIMAGE;
  1256. X!             gd->GadgetRender = (APTR)&up_selectimage;
  1257. X!             gd->SelectRender = (APTR)&up_renderimage;
  1258. X              break;
  1259. X  
  1260. X          case GADTOOLDOWN:
  1261. X--- 2487,2524 ----
  1262. X              SetBorder( gd, -1 );
  1263. X              break;
  1264. X  
  1265. X+         case GADSAVEINFO:
  1266. X+             gd->TopEdge += txtdiff*5;
  1267. X+             SetBorder( gd, -1 );
  1268. X+             break;
  1269. X+ 
  1270. X+         case GADQUITINFO:
  1271. X+             gd->TopEdge += txtdiff*5;
  1272. X+             SetBorder( gd, -1 );
  1273. X+             break;
  1274. X+ 
  1275. X+         case GADUSEINFO:
  1276. X+             gd->TopEdge += txtdiff*5;
  1277. X+             SetBorder( gd, -1 );
  1278. X+             break;
  1279. X+ 
  1280. X          case GADTOOLUP:
  1281. X              gd->TopEdge += txtdiff*4;
  1282. X              gd->Flags &= ~GADGHIGHBITS;
  1283. X              gd->Flags |= GADGIMAGE|GADGHIMAGE;
  1284. X!             if( scrn->Height > 300 )
  1285. X!             {
  1286. X!             gd->GadgetRender = (APTR)&tall_up_selectimage;
  1287. X!             gd->SelectRender = (APTR)&tall_up_renderimage;
  1288. X!             gd->Height *= 2;
  1289. X!             if( txtdiff == 0 )
  1290. X!                 gd->TopEdge -= 2;
  1291. X!             }
  1292. X!             else
  1293. X!             {
  1294. X!             gd->GadgetRender = (APTR)&up_selectimage;
  1295. X!             gd->SelectRender = (APTR)&up_renderimage;
  1296. X!             }
  1297. X              break;
  1298. X  
  1299. X          case GADTOOLDOWN:
  1300. X***************
  1301. X*** 2667,2674 ****
  1302. X              gd->TopEdge += txtdiff*5;
  1303. X              gd->Flags &= ~GADGHIGHBITS;
  1304. X              gd->Flags |= GADGIMAGE|GADGHIMAGE;
  1305. X!             gd->GadgetRender = (APTR)&down_selectimage;
  1306. X!             gd->SelectRender = (APTR)&down_renderimage;
  1307. X              break;
  1308. X  
  1309. X          default:
  1310. X--- 2525,2543 ----
  1311. X              gd->TopEdge += txtdiff*5;
  1312. X              gd->Flags &= ~GADGHIGHBITS;
  1313. X              gd->Flags |= GADGIMAGE|GADGHIMAGE;
  1314. X!             if( scrn->Height > 300 )
  1315. X!             {
  1316. X!             gd->GadgetRender = (APTR)&tall_down_selectimage;
  1317. X!             gd->SelectRender = (APTR)&tall_down_renderimage;
  1318. X!             gd->Height *= 2;
  1319. X!             if( txtdiff == 0 )
  1320. X!                 gd->TopEdge += 4;
  1321. X!             }
  1322. X!             else
  1323. X!             {
  1324. X!             gd->GadgetRender = (APTR)&down_selectimage;
  1325. X!             gd->SelectRender = (APTR)&down_renderimage;
  1326. X!             }
  1327. X              break;
  1328. X  
  1329. X          default:
  1330. X***************
  1331. X*** 2675,2727 ****
  1332. X              SetBorder( gd, -1 );
  1333. X          }
  1334. X      }
  1335. X!     for( ip = &Info_IntuiTextList6; ip; ip = ip->NextText )
  1336. X!     {
  1337. X!         if( *ip->IText == 'C' )
  1338. X!         {
  1339. X!         if( ip->IText[1] == 'o' )
  1340. X!             ip->TopEdge += 2*txtdiff;
  1341. X!         else
  1342. X!             ip->TopEdge += txtdiff;
  1343. X!         }
  1344. X!         else if( *ip->IText == 'T' )
  1345. X!         ip->TopEdge += 4*txtdiff;
  1346. X!     }
  1347. X      ++once;
  1348. X      }
  1349. X  
  1350. X!     gd = &Info_EditDef;
  1351. X!     if( access( GameName( gptr, gptr->name ), 1 ) == 0 )
  1352. X!     gd->Flags |= GADGDISABLED;
  1353. X!     else
  1354. X!     gd->Flags &= ~GADGDISABLED;
  1355. X  
  1356. X-     /* Put in the comment */
  1357. X- 
  1358. X-     Info_Comment.GadgetText = &itext[ 0 ];
  1359. X-     itext[ 0 ].IText = commentstr;
  1360. X- 
  1361. X      /* The players name */
  1362. X  
  1363. X!     Info_Player.GadgetText = &itext[ 1 ];
  1364. X!     strncpy( namestr, ToolsEntry( gptr, "NAME" ), sizeof( namestr ) );
  1365. X!     namestr[ sizeof( namestr ) - 1 ] = 0;
  1366. X!     if( *namestr == 0 )
  1367. X      {
  1368. X!     strncpy( namestr, gptr->name, sizeof( namestr ) );
  1369. X!     namestr[ sizeof( namestr ) - 1 ] = 0;
  1370. X      }
  1371. X!     if( ( t = strrchr( namestr, '.' ) ) && stricmp( t, ".sav" ) == 0 )
  1372. X      *t = 0;
  1373. X!     itext[ 1 ].IText = namestr;
  1374. X  
  1375. X      /* The character class of the player */
  1376. X  
  1377. X!     Info_Class.GadgetText = &itext[ 2 ];
  1378. X!     itext[ 2 ].IText = ToolsEntry( gptr, "CHARACTER" );
  1379. X  
  1380. X      /* If there are ToolTypes entries, put the first one into the gadget */
  1381. X  
  1382. X      if( sp && *sp )
  1383. X      strcpy( StrTools, *sp );
  1384. X  
  1385. X--- 2544,2581 ----
  1386. X              SetBorder( gd, -1 );
  1387. X          }
  1388. X      }
  1389. X! 
  1390. X      ++once;
  1391. X      }
  1392. X  
  1393. X!     strncpy( Sbuff( &Info_Comment ), commentstr, 100 );
  1394. X  
  1395. X      /* The players name */
  1396. X  
  1397. X!     strncpy( StrPlayer, ToolsEntry( gptr, "NAME" ), 100 );
  1398. X!     if( *StrPlayer == 0 )
  1399. X      {
  1400. X!     strncpy( StrPlayer, gptr->name, 99 );
  1401. X      }
  1402. X! 
  1403. X!     if( ( t = strrchr( StrPlayer, '.' ) ) && stricmp( t, ".sav" ) == 0 )
  1404. X!     {
  1405. X      *t = 0;
  1406. X!     }
  1407. X  
  1408. X      /* The character class of the player */
  1409. X  
  1410. X!     Info_Class.GadgetText = &itext[ 0 ];
  1411. X!     itext[ 0 ].IText = ToolsEntry( gptr, "CHARACTER" );
  1412. X!     if( *itext[ 0 ].IText == 0 )
  1413. X!     {
  1414. X!     itext[ 0 ].IText = players[ 0 ];
  1415. X!     SetToolLine( gptr, "CHARACTER", players[ 0 ] );
  1416. X!     }
  1417. X  
  1418. X      /* If there are ToolTypes entries, put the first one into the gadget */
  1419. X  
  1420. X+     sp = gptr->dobj->do_ToolTypes;
  1421. X      if( sp && *sp )
  1422. X      strcpy( StrTools, *sp );
  1423. X  
  1424. X***************
  1425. X*** 2736,2743 ****
  1426. X      errmsg( FLASH, "Can't create info window" );
  1427. X      return;
  1428. X      }
  1429. X-     PrintIText( cwin->RPort, &Info_IntuiTextList6, 0, txtdiff );
  1430. X  
  1431. X      while( !done )
  1432. X      {
  1433. X      WaitPort( cwin->UserPort );
  1434. X--- 2590,2613 ----
  1435. X      errmsg( FLASH, "Can't create info window" );
  1436. X      return;
  1437. X      }
  1438. X  
  1439. X+     itemno = 0;
  1440. X+     if( s = FindToolType( (char **) gptr->dobj->do_ToolTypes, "CHARACTER" ) )
  1441. X+     {
  1442. X+     s += 10;
  1443. X+     for( itemno = 0; players[ itemno ]; ++itemno )
  1444. X+     {
  1445. X+         if( strnicmp( s, players[ itemno ], strlen( s ) ) == 0 )
  1446. X+         break;
  1447. X+     }
  1448. X+     }
  1449. X+     if( !players[ itemno ] )
  1450. X+     itemno = 0;
  1451. X+ 
  1452. X+     CheckOnly( &Info_MenuList6, 0, itemno );
  1453. X+     SetUpMenus( &Info_MenuList6, scrn );
  1454. X+     SetMenuStrip( cwin, &Info_MenuList6 );
  1455. X+ 
  1456. X      while( !done )
  1457. X      {
  1458. X      WaitPort( cwin->UserPort );
  1459. X***************
  1460. X*** 2756,2762 ****
  1461. X              if( code == '\33' || (code == 'b' && (qual&AMIGALEFT)) )
  1462. X              {
  1463. X              done = 1;
  1464. X-             quit = 0;
  1465. X              }
  1466. X              break;
  1467. X  
  1468. X--- 2626,2631 ----
  1469. X***************
  1470. X*** 2768,2893 ****
  1471. X              *sp = strdup( StrTools );
  1472. X              }
  1473. X              done = 1;
  1474. X-             quit = 0;
  1475. X              break;
  1476. X  
  1477. X          case GADGETUP:
  1478. X              switch( gd->GadgetID )
  1479. X              {
  1480. X!             case GADEDDEF:
  1481. X!                 /* Put the game values into the defaults */
  1482. X  
  1483. X!                 Game2Defs( gptr );
  1484. X  
  1485. X!                 /* Put the options into the options array */
  1486. X  
  1487. X!                 CopyOptions( curopts, gptr );
  1488. X  
  1489. X!                 /* Edit the defaults */
  1490. X  
  1491. X!                 menu_editdef( GAME_FROM_INFO );
  1492. X  
  1493. X!                 /* Put the options back in */
  1494. X  
  1495. X!                 SetOptions( curopts, gptr );
  1496. X  
  1497. X!                 /* Move defaults to game */
  1498. X! 
  1499. X!                 SetToolLine( gptr, "NAME", defgame.plname );
  1500. X!                 SetToolLine( gptr, "CHARACTER",
  1501. X!                 defgame.pltype ?
  1502. X!                 players[ defgame.pltype ] : "" );
  1503. X!                 itext[ 2 ].IText =
  1504. X!                 ToolsEntry( gptr, "CHARACTER" );
  1505. X!                 strncpy( namestr, ToolsEntry( gptr, "NAME" ),
  1506. X!                 sizeof( namestr ) );
  1507. X!                 namestr[ sizeof( namestr ) - 1 ] = 0;
  1508. X!                 if( *namestr == 0 )
  1509. X!                 {
  1510. X!                 strncpy( namestr, gptr->name, sizeof(namestr) );
  1511. X!                 namestr[ sizeof( namestr ) - 1 ] = 0;
  1512. X!                 }
  1513. X!                 if( ( t = strrchr( namestr, '.' ) ) &&
  1514. X!                 stricmp( t, ".sav" ) == 0 )
  1515. X!                 {
  1516. X!                 *t = 0;
  1517. X!                 }
  1518. X!                 itext[ 1 ].IText = namestr;
  1519. X! 
  1520. X!                 /* Make sure that the correct ToolTypes line
  1521. X!                  * is displayed in the gadget.
  1522. X!                  */
  1523. X! 
  1524. X!                 sp = gptr->dobj->do_ToolTypes;
  1525. X                  strcpy( StrTools, *sp );
  1526. X!                 UpdateInfoWin( cwin );
  1527. X!                 break;
  1528. X! 
  1529. X!             case GADADDTOOL:
  1530. X!                 ReallocTools( gptr, 1 );
  1531. X!                 sp = gptr->dobj->do_ToolTypes;
  1532. X!                 for( i = 0; sp[ i ]; ++i )
  1533. X!                 ;
  1534. X!                 sp[i] = strdup( "" );
  1535. X!                 sp[i+1] = NULL;
  1536. X!                 itext[ 2 ].IText =
  1537. X!                 ToolsEntry( gptr, "CHARACTER" );
  1538. X!                 *StrTools = 0;
  1539. X!                 UpdateInfoWin( cwin );
  1540. X!                 sp += i;
  1541. X!                 break;
  1542. X! 
  1543. X!             case GADDELTOOL:
  1544. X!                 while( *sp = sp[1] )
  1545. X!                 ++sp;
  1546. X!                 sp = gptr->dobj->do_ToolTypes;
  1547. X!                 strcpy( StrTools, *sp ? *sp : "" );
  1548. X!                 UpdateInfoWin( cwin );
  1549. X!                 break;
  1550. X! 
  1551. X!             case GADTOOLTYPES:
  1552. X!                 if( sp && *sp && CheckAndCopy( StrTools, *sp ) )
  1553. X!                 {
  1554. X!                 if( *sp )
  1555. X!                     free( *sp );
  1556. X!                 *sp = strdup( StrTools );
  1557. X!                 }
  1558. X!                 break;
  1559. X! 
  1560. X!             case GADTOOLDOWN:
  1561. X!                 if( sp && *sp && CheckAndCopy( StrTools, *sp ) )
  1562. X!                 {
  1563. X!                 if( *sp )
  1564. X!                     free( *sp );
  1565. X!                 *sp = strdup( StrTools );
  1566. X!                 }
  1567. X!                 if( sp != NULL && sp[1] != NULL )
  1568. X!                 {
  1569. X!                 ++sp;
  1570. X!                 strcpy( StrTools, *sp );
  1571. X!                 if( IsEditEntry( StrTools, gptr ) )
  1572. X!                     Info_ToolTypes.Flags &= ~GADGDISABLED;
  1573. X!                 else
  1574. X!                     Info_ToolTypes.Flags |= GADGDISABLED;
  1575. X!                 }
  1576. X                  else
  1577. X!                 {
  1578. X!                 if( sp && *sp )
  1579. X!                     strcpy( StrTools, *sp );
  1580. X!                 DisplayBeep( NULL );
  1581. X!                 }
  1582. X!                 break;
  1583. X  
  1584. X!             case GADTOOLUP:
  1585. X!                 if( sp && *sp && CheckAndCopy( StrTools, *sp ) )
  1586. X                  {
  1587. X-                 if( *sp )
  1588. X-                     free( *sp );
  1589. X-                 *sp = strdup( StrTools );
  1590. X-                 }
  1591. X-                 if( sp && sp > gptr->dobj->do_ToolTypes )
  1592. X-                 {
  1593. X-                 --sp;
  1594. X                  strcpy( StrTools, *sp );
  1595. X                  if( IsEditEntry( StrTools, gptr ) )
  1596. X                      Info_ToolTypes.Flags &= ~GADGDISABLED;
  1597. X--- 2637,2760 ----
  1598. X              *sp = strdup( StrTools );
  1599. X              }
  1600. X              done = 1;
  1601. X              break;
  1602. X  
  1603. X          case GADGETUP:
  1604. X              switch( gd->GadgetID )
  1605. X              {
  1606. X!             case GADSAVEINFO:
  1607. X!             /* Write icon and quit. */
  1608. X!             SetToolLine( gptr, "NAME", StrPlayer );
  1609. X!             UpdateGameIcon( gptr );
  1610. X!             lock = Lock( gptr->dname, ACCESS_READ );
  1611. X!             if( lock )
  1612. X!             {
  1613. X!                 olock = CurrentDir( lock );
  1614. X!                 SetComment( gptr->fname, Sbuff( &Info_Comment ) );
  1615. X!                 CurrentDir( olock );
  1616. X!                 done = 1;
  1617. X!             }
  1618. X!             else
  1619. X!             {
  1620. X!                 errmsg( FLASH, "Can't access icon's directory" );
  1621. X!                 sp = gptr->dobj->do_ToolTypes;
  1622. X!                 strcpy( StrTools, *sp ? *sp : "" );
  1623. X!                 UpdateInfoWin( cwin );
  1624. X!             }
  1625. X!             break;
  1626. X  
  1627. X!             case GADUSEINFO:
  1628. X!             /* Quit this loop. */
  1629. X!             done = 1;
  1630. X!             break;
  1631. X  
  1632. X!             case GADQUITINFO:
  1633. X!             /* Reload icon and quit this loop. */
  1634. X!             RemoveGadget( win, &gptr->dobj->do_Gadget );
  1635. X!             RemoveGITEM( gptr );
  1636. X!             lastgaddown = NULL; /* very important... */
  1637. X!             MapGadgets( R_DISK, 1 );
  1638. X!             done = 1;
  1639. X!             break;
  1640. X  
  1641. X!             case GADEDITOPTS:
  1642. X!             setopt( gptr );
  1643. X!             sp = gptr->dobj->do_ToolTypes;
  1644. X!             strcpy( StrTools, *sp ? *sp : "" );
  1645. X!             UpdateInfoWin( cwin );
  1646. X!             break;
  1647. X  
  1648. X!             case GADADDTOOL:
  1649. X!             FreeTools( gptr );
  1650. X!             ReallocTools( gptr, 2 );
  1651. X!             sp = gptr->dobj->do_ToolTypes;
  1652. X!             for( i = 0; sp[ i ]; ++i )
  1653. X!                 ;
  1654. X!             sp[i] = strdup( "" );
  1655. X!             sp[i+1] = NULL;
  1656. X!             itext[ 0 ].IText =
  1657. X!                 ToolsEntry( gptr, "CHARACTER" );
  1658. X!             *StrTools = 0;
  1659. X!             Info_ToolTypes.Flags &= ~GADGDISABLED;
  1660. X!             UpdateInfoWin( cwin );
  1661. X!             sp += i;
  1662. X!             break;
  1663. X  
  1664. X!             case GADDELTOOL:
  1665. X!             while( *sp = sp[1] )
  1666. X!                 ++sp;
  1667. X!             sp = gptr->dobj->do_ToolTypes;
  1668. X!             strcpy( StrTools, *sp ? *sp : "" );
  1669. X!             Info_ToolTypes.Flags &= ~GADGDISABLED;
  1670. X!             UpdateInfoWin( cwin );
  1671. X!             break;
  1672. X  
  1673. X!             case GADTOOLTYPES:
  1674. X!             if( sp && *sp && CheckAndCopy( StrTools, *sp ) )
  1675. X!             {
  1676. X!                 if( *sp )
  1677. X!                 free( *sp );
  1678. X!                 *sp = strdup( StrTools );
  1679. X!             }
  1680. X!             break;
  1681. X  
  1682. X!             case GADTOOLDOWN:
  1683. X!             if( sp && *sp && CheckAndCopy( StrTools, *sp ) )
  1684. X!             {
  1685. X!                 if( *sp )
  1686. X!                 free( *sp );
  1687. X!                 *sp = strdup( StrTools );
  1688. X!             }
  1689. X  
  1690. X!             if( sp && sp[0] && sp[1] )
  1691. X!             {
  1692. X!                 ++sp;
  1693. X                  strcpy( StrTools, *sp );
  1694. X!                 if( IsEditEntry( StrTools, gptr ) )
  1695. X!                 Info_ToolTypes.Flags &= ~GADGDISABLED;
  1696. X                  else
  1697. X!                 Info_ToolTypes.Flags |= GADGDISABLED;
  1698. X!             }
  1699. X!             else
  1700. X!             {
  1701. X!                 if( sp && *sp )
  1702. X!                 strcpy( StrTools, *sp );
  1703. X!                 DisplayBeep( NULL );
  1704. X!             }
  1705. X!             break;
  1706. X  
  1707. X!             case GADTOOLUP:
  1708. X!             if( sp && *sp && CheckAndCopy( StrTools, *sp ) )
  1709. X!             {
  1710. X!                 if( *sp )
  1711. X!                 free( *sp );
  1712. X!                 *sp = strdup( StrTools );
  1713. X!             }
  1714. X!             if( sp && sp > gptr->dobj->do_ToolTypes )
  1715. X!             {
  1716. X!                 --sp;
  1717. X!                 if( *sp )
  1718. X                  {
  1719. X                  strcpy( StrTools, *sp );
  1720. X                  if( IsEditEntry( StrTools, gptr ) )
  1721. X                      Info_ToolTypes.Flags &= ~GADGDISABLED;
  1722. X***************
  1723. X*** 2894,2907 ****
  1724. X                  else
  1725. X                      Info_ToolTypes.Flags |= GADGDISABLED;
  1726. X                  }
  1727. X!                 else
  1728. X!                 {
  1729. X!                 DisplayBeep( NULL );
  1730. X!                 }
  1731. X!                 break;
  1732. X              }
  1733. X              RefreshGList( &Info_ToolTypes, cwin, NULL, 1 );
  1734. X              break;
  1735. X          }
  1736. X      }
  1737. X      }
  1738. X--- 2761,2797 ----
  1739. X                  else
  1740. X                      Info_ToolTypes.Flags |= GADGDISABLED;
  1741. X                  }
  1742. X!             }
  1743. X!             else
  1744. X!             {
  1745. X!                 DisplayBeep( NULL );
  1746. X!             }
  1747. X!             break;
  1748. X! 
  1749. X!             case GADPLNAME:
  1750. X!             SetToolLine( gptr, "NAME", StrPlayer );
  1751. X!             sp = gptr->dobj->do_ToolTypes;
  1752. X!             strcpy( StrTools, *sp ? *sp : "" );
  1753. X!             UpdateInfoWin( cwin );
  1754. X!             break;
  1755. X              }
  1756. X              RefreshGList( &Info_ToolTypes, cwin, NULL, 1 );
  1757. X              break;
  1758. X+ 
  1759. X+             case MENUPICK:
  1760. X+                 while( code != MENUNULL )
  1761. X+                 {
  1762. X+             SetToolLine( gptr, "CHARACTER",
  1763. X+                     players[ ITEMNUM( code ) ] );
  1764. X+             itext[ 0 ].IText =
  1765. X+                     ToolsEntry( gptr, "CHARACTER" );
  1766. X+             sp = gptr->dobj->do_ToolTypes;
  1767. X+             strcpy( StrTools, *sp ? *sp : "" );
  1768. X+             UpdateInfoWin( cwin );
  1769. X+             code = ((struct MenuItem *)ItemAddress(
  1770. X+                 &Info_MenuList6, (long)code ))->NextSelect;
  1771. X+             }
  1772. X+             break;
  1773. X          }
  1774. X      }
  1775. X      }
  1776. X***************
  1777. X*** 2921,2931 ****
  1778. X      Info_Class.TopEdge,
  1779. X      Info_Class.LeftEdge + Info_Class.Width-1,
  1780. X      Info_Class.TopEdge + Info_Class.Height-1 );
  1781. X-     RectFill( cwin->RPort,
  1782. X-     Info_Player.LeftEdge,
  1783. X-     Info_Player.TopEdge,
  1784. X-     Info_Player.LeftEdge + Info_Player.Width-1,
  1785. X-     Info_Player.TopEdge + Info_Player.Height-1 );
  1786. X      RefreshGList( cwin->FirstGadget, cwin, NULL, -1 );
  1787. X  }
  1788. X  
  1789. X--- 2811,2816 ----
  1790. X***************
  1791. X*** 3131,3297 ****
  1792. X  }
  1793. X  
  1794. X  /*
  1795. X-  * Load a defaults file into global structures
  1796. X-  */
  1797. X- 
  1798. X- LoadDefaults( player )
  1799. X-     char *player;
  1800. X- {
  1801. X-     FILE *fp;
  1802. X-     int i;
  1803. X-     char fname[ 100 ];
  1804. X-     char buf[ 200 ];
  1805. X-     char *t;
  1806. X- 
  1807. X-     sprintf( fname, "%s.def", player );
  1808. X- 
  1809. X-     if( ( fp = fopen( fname, "r" ) ) == NULL )
  1810. X-     {
  1811. X-     errmsg( FLASH,
  1812. X-         "Can't open defaults, %s, in current directory", fname );
  1813. X-     return 0;
  1814. X-     }
  1815. X- 
  1816. X-     while( fgets( buf, sizeof( buf ), fp ) != NULL )
  1817. X-     {
  1818. X-     if( *buf == '#' )
  1819. X-         continue;
  1820. X- 
  1821. X-     if( ( t = strchr( buf, '\n' ) ) != NULL )
  1822. X-         *t = 0;
  1823. X-     if( strnicmp( "PLAYER=", buf, 7 ) == 0 )
  1824. X-     {
  1825. X-         if( defgame.plname )
  1826. X-         free( defgame.plname );
  1827. X-         defgame.plname = strdup( buf + 7 );
  1828. X-     }
  1829. X-     else if( strnicmp( "PLAYERTYPE=", buf, 11 ) == 0 )
  1830. X-     {
  1831. X-         for( i = 0; players[ i ]; ++i )
  1832. X-         {
  1833. X-         if( strnicmp( &buf[11], players[ i ], 1 ) == 0 )
  1834. X-             break;
  1835. X-         }
  1836. X- 
  1837. X-         if( players[ i ] )
  1838. X-         defgame.pltype = i;
  1839. X-         else
  1840. X-         defgame.pltype = 0;
  1841. X-     }
  1842. X-     else if( strnicmp( "OPTIONS=", buf, 8 ) == 0 )
  1843. X-     {
  1844. X-         errmsg( FLASH, "OPTIONS set by game configuration" );
  1845. X-         setoneopt( OPTIONS_IDX, buf+8 );
  1846. X-         defgame.options = strdup( buf + 8 );
  1847. X-     }
  1848. X-     else
  1849. X-     {
  1850. X-         errmsg( FLASH, "Invalid line in defaults file" );
  1851. X-         fclose( fp );
  1852. X-         return( 0 );
  1853. X-     }
  1854. X-     }
  1855. X-     fclose( fp );
  1856. X-     return( 1 );
  1857. X- }
  1858. X- 
  1859. X- /*
  1860. X-  * Create a defaults file my the name given with all of the global
  1861. X-  * information currently set.
  1862. X-  */
  1863. X- 
  1864. X- void SaveDefaults( player )
  1865. X-     char *player;
  1866. X- {
  1867. X-     FILE *fp;
  1868. X-     char fname[ 100 ];
  1869. X-     int err;
  1870. X- 
  1871. X-     sprintf( fname, "%s.def", player );
  1872. X- 
  1873. X-     if( ( fp = fopen( fname, "w" ) ) == NULL )
  1874. X-     {
  1875. X-     errmsg( FLASH, "Can't open defaults file: %s", fname );
  1876. X-     return;
  1877. X-     }
  1878. X- 
  1879. X-     err = fprintf( fp, "PLAYER=%s\n", defgame.plname );
  1880. X-     if( defgame.pltype )
  1881. X-     err |= fprintf( fp, "PLAYERTYPE=%s\n", players[ defgame.pltype ] );
  1882. X-     else
  1883. X-     err |= fprintf( fp, "PLAYERTYPE=<RANDOM>\n" );
  1884. X- 
  1885. X-     /* Get the options. */
  1886. X-     PutOptions( curopts );
  1887. X- 
  1888. X-     /* Put them in too */
  1889. X-     err |= fprintf( fp, "OPTIONS=%s\n", options[ OPTIONS_IDX ] );
  1890. X-     err |= fclose( fp );
  1891. X- 
  1892. X-     if( err == EOF )
  1893. X-     errmsg( FLASH, "Error writing out defaults for: %s", fname );
  1894. X- }
  1895. X- 
  1896. X- /*
  1897. X-  * Copy the defgame structure values into the Defs windows gadgets
  1898. X-  */
  1899. X- 
  1900. X- void CopyDefs2Gad()
  1901. X- {
  1902. X-     if( defgame.plname )
  1903. X-     strcpy( DefPlayerName, defgame.plname );
  1904. X-     else
  1905. X-     *DefPlayerName = 0;
  1906. X- 
  1907. X-     CheckOnly( &Defs_MenuList11, 0, defgame.pltype );
  1908. X- 
  1909. X-     /* If there are default options fill them in, else reset
  1910. X-      * to the real defaults.
  1911. X-      */
  1912. X-     if( defgame.options )
  1913. X-     CopyOptionStr( curopts, defgame.options );
  1914. X-     else
  1915. X-     ZapOptions( curopts );
  1916. X- }
  1917. X- 
  1918. X- /*
  1919. X-  * Copy the Defs window gadgets into the defgame structure
  1920. X-  */
  1921. X- 
  1922. X- void CopyGad2Defs( )
  1923. X- {
  1924. X-     if( defgame.plname )
  1925. X-     free( defgame.plname );
  1926. X-     defgame.plname = strdup( DefPlayerName );
  1927. X- 
  1928. X-     defgame.pltype = FindChecked( &Defs_MenuList11, 0 );
  1929. X- }
  1930. X- 
  1931. X- /*
  1932. X-  * Make sure that the correct character type is checked
  1933. X-  */
  1934. X- 
  1935. X- void UpdateTypes( cwin )
  1936. X-     register struct Window *cwin;
  1937. X- {
  1938. X-     register struct RastPort *rp = cwin->RPort;
  1939. X- 
  1940. X-     SetAPen( rp, 0 );
  1941. X-     SetBPen( rp, 0 );
  1942. X-     SetDrMd( rp, JAM2 );
  1943. X-     RectFill( cwin->RPort,
  1944. X-     Defs_PlayerType.LeftEdge+1,
  1945. X-     Defs_PlayerType.TopEdge+1,
  1946. X-     Defs_PlayerType.LeftEdge+Defs_PlayerType.Width-1,
  1947. X-     Defs_PlayerType.TopEdge+Defs_PlayerType.Height-1 );
  1948. X- 
  1949. X-     Defs_PlayerType.GadgetText->IText = players[ defgame.pltype ];
  1950. X-     RefreshGList( &Defs_PlayerType, cwin, NULL, 1 );
  1951. X-     RefreshGList( &Defs_PlayerName, cwin, NULL, 1 );
  1952. X-     RefreshGList( &Defs_DefaultName, cwin, NULL, 1 );
  1953. X- }
  1954. X- 
  1955. X- /*
  1956. X   * Ask the user if they really want to do something.
  1957. X   */
  1958. X  
  1959. X--- 3016,3021 ----
  1960. X***************
  1961. X*** 3485,3492 ****
  1962. X      switch( i )
  1963. X      {
  1964. X          case ITEM_INFO:
  1965. X-         case ITEM_SETCOMMENT:
  1966. X-         case ITEM_SETOPT:
  1967. X          case ITEM_COPYOPT:
  1968. X          case ITEM_DISCARD:
  1969. X          case ITEM_RENAME:
  1970. X--- 3209,3214 ----
  1971. X***************
  1972. X*** 3524,3530 ****
  1973. X      {
  1974. X      switch( i )
  1975. X      {
  1976. X-         case ITEM_SETOPT:
  1977. X          case ITEM_RENAME:
  1978. X          case ITEM_DISCARD:
  1979. X          ino = MENUITEMNO( 1,i,NOSUB );
  1980. X--- 3246,3251 ----
  1981. X***************
  1982. X*** 3533,3539 ****
  1983. X  
  1984. X          case ITEM_COPYOPT:
  1985. X          case ITEM_INFO:
  1986. X-         case ITEM_SETCOMMENT:
  1987. X          ino = MENUITEMNO( 1,i,NOSUB );
  1988. X          if( enable )
  1989. X              OnMenu( win, ino );
  1990. X--- 3254,3259 ----
  1991. X***************
  1992. X*** 3549,3556 ****
  1993. X   * of the members changed based on the users input
  1994. X   */
  1995. X  
  1996. X! int EditOptions( optr )
  1997. X      OPTR optr;
  1998. X  {
  1999. X      int done = 0, quit = 0;
  2000. X      register struct Window *cwin;
  2001. X--- 3269,3277 ----
  2002. X   * of the members changed based on the users input
  2003. X   */
  2004. X  
  2005. X! int EditOptions( optr, gptr )
  2006. X      OPTR optr;
  2007. X+     GPTR gptr;
  2008. X  {
  2009. X      int done = 0, quit = 0;
  2010. X      register struct Window *cwin;
  2011. X***************
  2012. X*** 3564,3570 ****
  2013. X  
  2014. X      if( !once )
  2015. X      {
  2016. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOCOLOR ))
  2017. X      {
  2018. X          struct Gadget *g;
  2019. X          for( g = Options_NewWindowStructure3.FirstGadget;
  2020. X--- 3285,3291 ----
  2021. X  
  2022. X      if( !once )
  2023. X      {
  2024. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOLITCORRIDOR ))
  2025. X      {
  2026. X          struct Gadget *g;
  2027. X          for( g = Options_NewWindowStructure3.FirstGadget;
  2028. X***************
  2029. X*** 3637,3674 ****
  2030. X          gd->TopEdge += txtdiff*4;
  2031. X          gd->Height += txtdiff;
  2032. X      }
  2033. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOCATNAME ))
  2034. X      {
  2035. X          gd->TopEdge += txtdiff*5;
  2036. X          gd->Height += txtdiff;
  2037. X      }
  2038. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADODOGNAME ))
  2039. X      {
  2040. X          gd->TopEdge += txtdiff*6;
  2041. X          gd->Height += txtdiff;
  2042. X      }
  2043. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOFRUIT ))
  2044. X      {
  2045. X          gd->TopEdge += txtdiff*7;
  2046. X          gd->Height += txtdiff;
  2047. X      }
  2048. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOOBJECTS ))
  2049. X      {
  2050. X          gd->TopEdge += txtdiff*8;
  2051. X          gd->Height += txtdiff;
  2052. X      }
  2053. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOOKAY ))
  2054. X      {
  2055. X          gd->TopEdge += txtdiff*9;
  2056. X          gd->Height += txtdiff;
  2057. X      }
  2058. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOCANCEL ))
  2059. X      {
  2060. X          gd->TopEdge += txtdiff*9;
  2061. X          gd->Height += txtdiff;
  2062. X      }
  2063. X!     Options_NewWindowStructure3.Height += txtdiff*11;
  2064. X!     Options_NewWindowStructure3.TopEdge -= txtdiff*6;
  2065. X      if( Options_NewWindowStructure3.Height +
  2066. X          Options_NewWindowStructure3.TopEdge >= scrn->Height )
  2067. X      {
  2068. X--- 3358,3430 ----
  2069. X          gd->TopEdge += txtdiff*4;
  2070. X          gd->Height += txtdiff;
  2071. X      }
  2072. X+     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOPICKUPTYPES ))
  2073. X+     {
  2074. X+         gd->TopEdge += txtdiff*4;
  2075. X+         gd->Height += txtdiff;
  2076. X+     }
  2077. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOCATNAME ))
  2078. X      {
  2079. X          gd->TopEdge += txtdiff*5;
  2080. X          gd->Height += txtdiff;
  2081. X      }
  2082. X+     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOWINDOWTYPE ))
  2083. X+     {
  2084. X+         gd->TopEdge += txtdiff*5;
  2085. X+         gd->Height += txtdiff;
  2086. X+     }
  2087. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADODOGNAME ))
  2088. X      {
  2089. X          gd->TopEdge += txtdiff*6;
  2090. X          gd->Height += txtdiff;
  2091. X      }
  2092. X+     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOMSGHISTORY ))
  2093. X+     {
  2094. X+         gd->TopEdge += txtdiff*6;
  2095. X+         gd->Height += txtdiff;
  2096. X+     }
  2097. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOFRUIT ))
  2098. X      {
  2099. X          gd->TopEdge += txtdiff*7;
  2100. X          gd->Height += txtdiff;
  2101. X      }
  2102. X+     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOPALETTE ))
  2103. X+     {
  2104. X+         gd->TopEdge += txtdiff*7;
  2105. X+         gd->Height += txtdiff;
  2106. X+     }
  2107. X      if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOOBJECTS ))
  2108. X      {
  2109. X          gd->TopEdge += txtdiff*8;
  2110. X          gd->Height += txtdiff;
  2111. X      }
  2112. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOSCORE ))
  2113. X      {
  2114. X+         gd->TopEdge += txtdiff*8;
  2115. X+         gd->Height += txtdiff;
  2116. X+     }
  2117. X+     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADONAME ))
  2118. X+     {
  2119. X          gd->TopEdge += txtdiff*9;
  2120. X          gd->Height += txtdiff;
  2121. X      }
  2122. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOPETTYPE ))
  2123. X      {
  2124. X          gd->TopEdge += txtdiff*9;
  2125. X          gd->Height += txtdiff;
  2126. X      }
  2127. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOOKAY ))
  2128. X!     {
  2129. X!         gd->TopEdge += txtdiff*10;
  2130. X!         gd->Height += txtdiff;
  2131. X!     }
  2132. X!     if( gd = FindGadget( NULL, &Options_NewWindowStructure3, GADOCANCEL ))
  2133. X!     {
  2134. X!         gd->TopEdge += txtdiff*10;
  2135. X!         gd->Height += txtdiff;
  2136. X!     }
  2137. X!     Options_NewWindowStructure3.Height += txtdiff*12;
  2138. X!     Options_NewWindowStructure3.TopEdge -= txtdiff*12;
  2139. X      if( Options_NewWindowStructure3.Height +
  2140. X          Options_NewWindowStructure3.TopEdge >= scrn->Height )
  2141. X      {
  2142. X***************
  2143. X*** 3677,3686 ****
  2144. X      }
  2145. X      if( Options_NewWindowStructure3.TopEdge < 0 )
  2146. X          Options_NewWindowStructure3.TopEdge = 0;
  2147. X!     {
  2148. X!         if( Options_NewWindowStructure3.Height > scrn->Height )
  2149. X!         Options_NewWindowStructure3.Height = scrn->Height;
  2150. X!     }
  2151. X  
  2152. X      /* Now that heights are correct, render borders */
  2153. X      for( gd = Options_NewWindowStructure3.FirstGadget;
  2154. X--- 3433,3440 ----
  2155. X      }
  2156. X      if( Options_NewWindowStructure3.TopEdge < 0 )
  2157. X          Options_NewWindowStructure3.TopEdge = 0;
  2158. X!     if( Options_NewWindowStructure3.Height > scrn->Height )
  2159. X!         Options_NewWindowStructure3.Height = scrn->Height;
  2160. X  
  2161. X      /* Now that heights are correct, render borders */
  2162. X      for( gd = Options_NewWindowStructure3.FirstGadget;
  2163. X***************
  2164. X*** 3692,3709 ****
  2165. X          SetBorder( gd, -1 );
  2166. X          }
  2167. X      }
  2168. X      for( ip = &Options_IntuiTextList3; ip; ip = ip->NextText )
  2169. X      {
  2170. X!         if( *ip->IText == 'P' )
  2171. X          ip->TopEdge += txtdiff * 5;
  2172. X!         else if( *ip->IText == 'C' )
  2173. X          ip->TopEdge += txtdiff * 6;
  2174. X!         else if( *ip->IText == 'D' )
  2175. X          ip->TopEdge += txtdiff * 7;
  2176. X!         else if( *ip->IText == 'F' )
  2177. X          ip->TopEdge += txtdiff * 8;
  2178. X!         else if( *ip->IText == 'O' )
  2179. X          ip->TopEdge += txtdiff * 9;
  2180. X      }
  2181. X      once = 1;
  2182. X      }
  2183. X--- 3446,3489 ----
  2184. X          SetBorder( gd, -1 );
  2185. X          }
  2186. X      }
  2187. X+ 
  2188. X      for( ip = &Options_IntuiTextList3; ip; ip = ip->NextText )
  2189. X      {
  2190. X!         /* Pack Order:  and  Pickup: */
  2191. X!         if( ( *ip->IText == 'P' && ip->IText[2] == 'c' ) )
  2192. X!         {
  2193. X!         ip->TopEdge += txtdiff * 4;
  2194. X!         }
  2195. X!         /* Cat Name:  and  Window Type: */
  2196. X!         else if( ( *ip->IText == 'C' ) ||
  2197. X!             ( *ip->IText == 'W' ) )
  2198. X!         {
  2199. X          ip->TopEdge += txtdiff * 5;
  2200. X!         }
  2201. X!         /* Dog Name:  and  Msg History: */
  2202. X!         else if( ( *ip->IText == 'D' ) ||
  2203. X!             ( *ip->IText == 'M' ) )
  2204. X!         {
  2205. X          ip->TopEdge += txtdiff * 6;
  2206. X!         }
  2207. X!         /* Fruit:  and  Pallete: */
  2208. X!         else if( ( *ip->IText == 'F' ) ||
  2209. X!             ( *ip->IText == 'P' && ip->IText[2] == 'l' ) )
  2210. X!         {
  2211. X          ip->TopEdge += txtdiff * 7;
  2212. X!         }
  2213. X!         /* Objects:  and  Score: */
  2214. X!         else if( ( *ip->IText == 'O' ) ||
  2215. X!                 ( *ip->IText == 'S' ) )
  2216. X!         {
  2217. X          ip->TopEdge += txtdiff * 8;
  2218. X!         }
  2219. X!         /* Name:  and  Pet Type: */
  2220. X!         else if(( *ip->IText == 'N' ) ||
  2221. X!             ( *ip->IText == 'P' && ip->IText[1] == 'e' ) )
  2222. X!         {
  2223. X          ip->TopEdge += txtdiff * 9;
  2224. X+         }
  2225. X      }
  2226. X      once = 1;
  2227. X      }
  2228. X***************
  2229. X*** 3717,3723 ****
  2230. X          /* If string valued option, set string */
  2231. X          if( optr[ i ].optstr )
  2232. X          {
  2233. X!         strcpy( Sbuff( gd ), optr[i].optstr );
  2234. X          }
  2235. X          else
  2236. X          {
  2237. X--- 3497,3520 ----
  2238. X          /* If string valued option, set string */
  2239. X          if( optr[ i ].optstr )
  2240. X          {
  2241. X!             char *t;
  2242. X! 
  2243. X!         if( optr[ i ].id == GADOPALETTE &&
  2244. X!                     ( optr[i].optstr == NULL || *optr[i].optstr == 0 ) )
  2245. X!         {
  2246. X!             if( gptr && ( t = ToolsEntry( gptr, "PENS" ) ) )
  2247. X!             {
  2248. X!             strcpy( Sbuff( gd ), t );
  2249. X!             }
  2250. X!             else
  2251. X!             {
  2252. X!             strcpy( Sbuff( gd ), options[ PENS_IDX ] );
  2253. X!             }
  2254. X!             for( t = strchr( Sbuff( gd ), ',' ); t; t = strchr( t, ',' ) )
  2255. X!                 *t = '/';
  2256. X!         }
  2257. X!         else
  2258. X!             strcpy( Sbuff( gd ), optr[i].optstr );
  2259. X          }
  2260. X          else
  2261. X          {
  2262. X***************
  2263. X*** 3773,3814 ****
  2264. X              done = 1;
  2265. X              quit = 1;
  2266. X              }
  2267. X-             else
  2268. X-             {
  2269. X-             switch( code )
  2270. X-             {
  2271. X-                 case 'p':
  2272. X-                 case 'P':
  2273. X-                 ActivateGadget(
  2274. X-                     FindGadget( cwin, 0, GADOPACKORDER ),
  2275. X-                     cwin, 0 );
  2276. X-                 break;
  2277. X-                 case 'c':
  2278. X-                 case 'C':
  2279. X-                 ActivateGadget(
  2280. X-                     FindGadget( cwin, 0, GADOCATNAME ),
  2281. X-                     cwin, 0 );
  2282. X-                 break;
  2283. X-                 case 'd':
  2284. X-                 case 'D':
  2285. X-                 ActivateGadget(
  2286. X-                     FindGadget( cwin, 0, GADODOGNAME ),
  2287. X-                     cwin, 0 );
  2288. X-                 break;
  2289. X-                 case 'f':
  2290. X-                 case 'F':
  2291. X-                 ActivateGadget(
  2292. X-                     FindGadget( cwin, 0, GADOFRUIT ),
  2293. X-                     cwin, 0 );
  2294. X-                 break;
  2295. X-                 case 'o':
  2296. X-                 case 'O':
  2297. X-                 ActivateGadget(
  2298. X-                     FindGadget( cwin, 0, GADOOBJECTS ),
  2299. X-                     cwin, 0 );
  2300. X-                 break;
  2301. X-             }
  2302. X-             }
  2303. X              break;
  2304. X  
  2305. X          case CLOSEWINDOW:
  2306. X--- 3570,3575 ----
  2307. X***************
  2308. X*** 3820,3850 ****
  2309. X              {
  2310. X              case GADOPACKORDER:
  2311. X                  ActivateGadget(
  2312. X!                 FindGadget( cwin, 0, GADOCATNAME ),
  2313. X                  cwin, 0 );
  2314. X                  break;
  2315. X  
  2316. X              case GADOCATNAME:
  2317. X                  ActivateGadget(
  2318. X!                 FindGadget( cwin, 0, GADODOGNAME ),
  2319. X                  cwin, 0 );
  2320. X                  break;
  2321. X  
  2322. X              case GADODOGNAME:
  2323. X                  ActivateGadget(
  2324. X!                 FindGadget( cwin, 0, GADOFRUIT ),
  2325. X                  cwin, 0 );
  2326. X                  break;
  2327. X  
  2328. X              case GADOFRUIT:
  2329. X                  ActivateGadget(
  2330. X!                 FindGadget( cwin, 0, GADOOBJECTS ),
  2331. X                  cwin, 0 );
  2332. X                  break;
  2333. X  
  2334. X              case GADOOBJECTS:
  2335. X                  break;
  2336. X  
  2337. X              case GADOOKAY:
  2338. X                  done = 1;
  2339. X                  break;
  2340. X--- 3581,3653 ----
  2341. X              {
  2342. X              case GADOPACKORDER:
  2343. X                  ActivateGadget(
  2344. X!                 FindGadget( cwin, 0, GADOPICKUPTYPES ),
  2345. X                  cwin, 0 );
  2346. X                  break;
  2347. X  
  2348. X              case GADOCATNAME:
  2349. X                  ActivateGadget(
  2350. X!                 FindGadget( cwin, 0, GADOWINDOWTYPE ),
  2351. X                  cwin, 0 );
  2352. X                  break;
  2353. X  
  2354. X              case GADODOGNAME:
  2355. X                  ActivateGadget(
  2356. X!                 FindGadget( cwin, 0, GADOMSGHISTORY ),
  2357. X                  cwin, 0 );
  2358. X                  break;
  2359. X  
  2360. X              case GADOFRUIT:
  2361. X                  ActivateGadget(
  2362. X!                 FindGadget( cwin, 0, GADOPALETTE ),
  2363. X                  cwin, 0 );
  2364. X                  break;
  2365. X  
  2366. X              case GADOOBJECTS:
  2367. X+                 ActivateGadget(
  2368. X+                 FindGadget( cwin, 0, GADOSCORE ),
  2369. X+                 cwin, 0 );
  2370. X                  break;
  2371. X  
  2372. X+             case GADONAME:
  2373. X+                 ActivateGadget(
  2374. X+                 FindGadget( cwin, 0, GADOPETTYPE ),
  2375. X+                 cwin, 0 );
  2376. X+                 break;
  2377. X+ 
  2378. X+             case GADOPICKUPTYPES:
  2379. X+                 ActivateGadget(
  2380. X+                 FindGadget( cwin, 0, GADOCATNAME ),
  2381. X+                 cwin, 0 );
  2382. X+                 break;
  2383. X+ 
  2384. X+             case GADOWINDOWTYPE:
  2385. X+                 ActivateGadget(
  2386. X+                 FindGadget( cwin, 0, GADODOGNAME ),
  2387. X+                 cwin, 0 );
  2388. X+                 break;
  2389. X+ 
  2390. X+             case GADOMSGHISTORY:
  2391. X+                 ActivateGadget(
  2392. X+                 FindGadget( cwin, 0, GADOFRUIT ),
  2393. X+                 cwin, 0 );
  2394. X+                 break;
  2395. X+ 
  2396. X+             case GADOPALETTE:
  2397. X+                 ActivateGadget(
  2398. X+                 FindGadget( cwin, 0, GADOOBJECTS ),
  2399. X+                 cwin, 0 );
  2400. X+                 break;
  2401. X+ 
  2402. X+             case GADOSCORE:
  2403. X+                 ActivateGadget(
  2404. X+                 FindGadget( cwin, 0, GADONAME ),
  2405. X+                 cwin, 0 );
  2406. X+                 break;
  2407. X+ 
  2408. X+             case GADOPETTYPE:
  2409. X+                 break;
  2410. X+ 
  2411. X              case GADOOKAY:
  2412. X                  done = 1;
  2413. X                  break;
  2414. X***************
  2415. X*** 3865,3871 ****
  2416. X                  {
  2417. X                  if( optr[ i ].optstr != NULL )
  2418. X                  {
  2419. X!                     if( optr[i].optstr && *optr[i].optstr )
  2420. X                      free( optr[i].optstr );
  2421. X  
  2422. X                      if( *Sbuff(gd) == 0 )
  2423. X--- 3668,3674 ----
  2424. X                  {
  2425. X                  if( optr[ i ].optstr != NULL )
  2426. X                  {
  2427. X!                     if( *optr[i].optstr )
  2428. X                      free( optr[i].optstr );
  2429. X  
  2430. X                      if( *Sbuff(gd) == 0 )
  2431. X***************
  2432. X*** 3987,4019 ****
  2433. X  
  2434. X      setoneopt( OPTIONS_IDX, optbuf );
  2435. X      free( optbuf );
  2436. X- }
  2437. X- 
  2438. X- void Game2Defs( gptr )
  2439. X-     register GPTR gptr;
  2440. X- {
  2441. X-     register char *s;
  2442. X-     register int i;
  2443. X- 
  2444. X-     if( defgame.plname )
  2445. X-     free( defgame.plname );
  2446. X-     defgame.plname = strdup( ToolsEntry( gptr, "NAME" ) );
  2447. X- 
  2448. X-     s = ToolsEntry( gptr, "CHARACTER" );
  2449. X-     for( i = 0; players[ i ]; ++i )
  2450. X-     {
  2451. X-     if( strnicmp( s, players[ i ], strlen(s) ) == 0 )
  2452. X-         break;
  2453. X-     }
  2454. X- 
  2455. X-     if( players[ i ] )
  2456. X-     defgame.pltype = i;
  2457. X-     else
  2458. X-     defgame.pltype = 0;
  2459. X- 
  2460. X-     if( defgame.options )
  2461. X-     free( defgame.options );
  2462. X-     defgame.options = strdup( ToolsEntry( gptr, "OPTIONS" ) );
  2463. X  }
  2464. X  
  2465. X  char *basename( str )
  2466. X--- 3790,3795 ----
  2467. END_OF_FILE
  2468. if test 58318 -ne `wc -c <'patches02m'`; then
  2469.     echo shar: \"'patches02m'\" unpacked with wrong size!
  2470. fi
  2471. # end of 'patches02m'
  2472. echo shar: End of archive 2 \(of 33\).
  2473. cp /dev/null ark2isdone
  2474. MISSING=""
  2475. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
  2476.     if test ! -f ark${I}isdone ; then
  2477.     MISSING="${MISSING} ${I}"
  2478.     fi
  2479. done
  2480. if test "${MISSING}" = "" ; then
  2481.     echo You have unpacked all 33 archives.
  2482.     echo "Now execute ./patchit.sh"
  2483.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2484. else
  2485.     echo You still need to unpack the following archives:
  2486.     echo "        " ${MISSING}
  2487. fi
  2488. ##  End of shell archive.
  2489. exit 0
  2490.