Changeset 171

Show
Ignore:
Timestamp:
06/09/07 08:51:19 (1 year ago)
Author:
takkaria
Message:
  • Dump squelch and autoinscribe settings as part of the options dump.
  • Make version numbers more centralised
  • Nuke MAINTAINER define, update bugs address
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/configure.ac

    r167 r171  
    11dnl Process this file with autoconf to produce a configure script. 
    2 AC_INIT([angband], [3.0.8], [http://angband.rogueforge.net/trac]) 
     2AC_INIT([angband], [3.0.8], [bugs@rephial.org]) 
    33AC_PREREQ([2.50]) 
    44 
  • trunk/src/Makefile.osx

    r89 r171  
    2424EXE =angband 
    2525COPYRIGHT =1995-2006 Contributors 
    26 # version number - displayed 
    27 VERSION =3.0.7 
    2826 
    2927# Some Developer CD tools we need - the standard installation location 
  • trunk/src/Makefile.src

    r164 r171  
    55# across a range of different makefiles, to cut down on maintenance. 
    66# 
     7 
     8VERSION = 3.0.8 
    79 
    810HDRS = h-basic.h 
     
    5759        xtra1.o \ 
    5860        xtra2.o 
    59  
    60  
  • trunk/src/Makefile.std

    r141 r171  
    6565# Version info 
    6666EXE = angband 
    67 VERSION = 3.0.8 
    6867 
    6968 
  • trunk/src/cmd4.c

    r169 r171  
    26122612 
    26132613/* 
     2614 * Save autoinscription data to a pref file. 
     2615 */ 
     2616static void autoinsc_dump(FILE *fff) 
     2617{ 
     2618        int i; 
     2619 
     2620        if (!inscriptions) 
     2621                return; 
     2622 
     2623        /* Start dumping */ 
     2624        fprintf(fff, "# Autoinscription settings"); 
     2625        fprintf(fff, "# B:item kind:inscription\n\n"); 
     2626 
     2627        for (i = 0; i < inscriptions_count; i++) 
     2628        { 
     2629                object_kind *k_ptr = &k_info[inscriptions[i].kind_idx]; 
     2630 
     2631                /* Describe and write */ 
     2632                fprintf(fff, "# Autoinscription for %s\n", k_name + k_ptr->name); 
     2633                fprintf(fff, "B:%d:%s\n\n", inscriptions[i].kind_idx, 
     2634                        quark_str(inscriptions[i].inscription_idx)); 
     2635        } 
     2636 
     2637        /* All done */ 
     2638        fprintf(fff, "\n"); 
     2639} 
     2640 
     2641/* 
     2642 * Save squelch data to a pref file. 
     2643 */ 
     2644static void squelch_dump(FILE *fff) 
     2645{ 
     2646        int i; 
     2647        int tval, sval; 
     2648        bool squelch; 
     2649 
     2650        /* Start dumping */ 
     2651        fprintf(fff, "\n\n"); 
     2652        fprintf(fff, "# Squelch bits\n\n"); 
     2653 
     2654        /* Dump squelch bits */ 
     2655        for (i = 1; i < z_info->k_max; i++) 
     2656        { 
     2657                tval = k_info[i].tval; 
     2658                sval = k_info[i].sval; 
     2659                squelch = k_info[i].squelch; 
     2660 
     2661                /* Dump the squelch info */ 
     2662                if (tval || sval) 
     2663                        fprintf(fff, "Q:%d:%d:%d:%d\n", i, tval, sval, squelch); 
     2664        } 
     2665 
     2666        /* All done */ 
     2667        fprintf(fff, "\n"); 
     2668} 
     2669 
     2670/* 
    26142671 * Write all current options to a user preference file. 
    26152672 */ 
     
    26712728                } 
    26722729        } 
    2673 
     2730 
     2731        autoinsc_dump(fff); 
     2732        squelch_dump(fff); 
     2733
     2734 
     2735 
     2736 
    26742737 
    26752738/* Hack -- Base Delay Factor */ 
     
    36173680 
    36183681        menu_layout(&color_menu, &SCREEN_REGION); 
     3682 
    36193683        /* Interact until done */ 
    36203684        while (1) 
     
    40664130        { 
    40674131                int c = inkey(); 
    4068                 switch(c) { 
    4069                 case ESCAPE: 
    4070                         return; 
    4071                 case 't': do_cmd_save_screen_text(); 
    4072                         return; 
    4073                 case 'h': do_cmd_save_screen_html(0); 
    4074                         return; 
    4075                 case 'f': do_cmd_save_screen_html(1); 
    4076                         return; 
     4132                switch(c) 
     4133                { 
     4134                        case ESCAPE: 
     4135                                return; 
     4136 
     4137                        case 't': 
     4138                                do_cmd_save_screen_text(); 
     4139                                return; 
     4140 
     4141                        case 'h': 
     4142                                do_cmd_save_screen_html(0); 
     4143                                return; 
     4144 
     4145                        case 'f': 
     4146                                do_cmd_save_screen_html(1); 
     4147                                return; 
    40774148                } 
    40784149        } 
  • trunk/src/config.h

    r128 r171  
    340340#define CAPITALIZE_USER_NAME 
    341341 
    342  
    343  
    344 /* 
    345  * OPTION: Person to bother if something goes wrong. 
    346  */ 
    347 #define MAINTAINER      "angbandmaint@gmail.com" 
    348342 
    349343 
  • trunk/src/defines.h

    r163 r171  
    3434 
    3535/* 
    36  * Name of the version/variant 
    37  */ 
    38 #define VERSION_NAME "Angband" 
    39  
    40  
    41 /* 
    42  * Current version string 
    43  */ 
    44 #define VERSION_STRING  "3.0.8" 
    45  
    46  
    47 /* 
    48  * Current version numbers 
     36 * Name of the version/variant and its version string 
     37 */ 
     38#define VERSION_NAME   "Angband" 
     39#define VERSION_STRING "3.0.8" 
     40 
     41 
     42/* 
     43 * Current savefile version 
    4944 */ 
    5045#define VERSION_MAJOR   3 
     
    5247#define VERSION_PATCH   9 
    5348#define VERSION_EXTRA   0 
    54  
    5549 
    5650/* 
  • trunk/src/init2.c

    r156 r171  
    12661266 
    12671267        /* Hack -- Just call the "format()" function */ 
    1268         (void)format("%s", MAINTAINER); 
     1268        (void)format("I wish you could swim, like dolphins can swim..."); 
    12691269 
    12701270 
  • trunk/src/squelch.c

    r156 r171  
    531531 
    532532 
    533 /*** File stuff ***/ 
    534  
    535 /* 
    536  * Save squelch data to a pref file. 
    537  */ 
    538 static void dump_squelch_info(void) 
    539 { 
    540         int i, tval, sval, squelch; 
    541         FILE *fff; 
    542         char buf[1024]; 
    543         char fname[80]; 
    544  
    545         screen_save(); 
    546  
    547         /* Prompt */ 
    548         prt("Command: Dump Squelch Info", 17, 30); 
    549         prt("File: ", 18, 30); 
    550  
    551         /* Default filename */ 
    552         strnfmt(fname, sizeof(fname), "%s.squ", op_ptr->base_name); 
    553  
    554         /* Get a filename */ 
    555         if (askfor_aux(fname, sizeof fname, NULL)) 
    556         { 
    557                 /* Build the filename */ 
    558                 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname); 
    559  
    560                 /* Append to the file */ 
    561                 safe_setuid_drop(); 
    562                 fff = my_fopen(buf, "a"); 
    563                 safe_setuid_grab(); 
    564  
    565         /* Test for success */ 
    566                 if (!fff) return; 
    567  
    568                 /* Start dumping */ 
    569                 fprintf(fff, "\n\n"); 
    570                 fprintf(fff, "# Squelch bits\n\n"); 
    571  
    572                 /* Dump squelch bits */ 
    573                 for (i = 1; i < z_info->k_max; i++) 
    574                 { 
    575                         tval = k_info[i].tval; 
    576                         sval = k_info[i].sval; 
    577                         squelch = k_info[i].squelch; 
    578  
    579                         /* Dump the squelch info */ 
    580                         if (tval || sval) 
    581                                 fprintf(fff, "Q:%d:%d:%d:%d\n", i, tval, sval, squelch); 
    582                 } 
    583  
    584                 fprintf(fff, "\n\n# squelch_level array\n\n"); 
    585  
    586                 for (i = 0; i < SQUELCH_BYTES; i++) 
    587                         fprintf(fff, "Q:%d:%d\n", i, squelch_level[i]); 
    588  
    589                 /* All done */ 
    590                 fprintf(fff, "\n\n\n\n"); 
    591  
    592                 /* Close */ 
    593                 my_fclose(fff); 
    594  
    595                 /* Ending message */ 
    596                 prt("Squelch file saved successfully.  Hit any key to continue.", 17, 30); 
    597                 inkey(); 
    598         } 
    599  
    600         screen_load(); 
    601         return; 
    602 } 
    603  
    604  
    605 /* 
    606  * Save autoinscription data to a pref file. 
    607  */ 
    608 static int dump_autoins_info(void) 
    609 { 
    610         int i; 
    611         FILE *fff; 
    612         char buf[1024]; 
    613         char fname[80]; 
    614  
    615         screen_save(); 
    616  
    617         /* Forget it now if there are no inscriptions. */ 
    618         if (!inscriptions) 
    619         { 
    620                 prt("No inscriptions to save.  Press any key to continue.", 16, 30); 
    621                 inkey(); 
    622                 screen_load(); 
    623                 return 0; 
    624         } 
    625  
    626         /* Prompt */ 
    627         prt("Command: Dump Autoinscribe Info", 16, 30); 
    628         prt("File: ", 17, 30); 
    629  
    630         /* Default filename */ 
    631         my_strcpy(fname, op_ptr->base_name, sizeof(fname)); 
    632  
    633         /* Get a filename */ 
    634         if (askfor_aux(fname, sizeof fname, NULL)) 
    635         { 
    636                 /* Build the filename */ 
    637                 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname); 
    638  
    639                 /* Overwrite the file */ 
    640                 safe_setuid_drop(); 
    641                 fff = my_fopen(buf, "w"); 
    642                 safe_setuid_grab(); 
    643  
    644                 /* Test for success */ 
    645                 if (!fff) return 0; 
    646  
    647                 /* Start dumping */ 
    648                 fprintf(fff, "# Format: B:[Item Kind]:[Inscription]\n\n"); 
    649  
    650                 for (i = 0; i < inscriptions_count; i++) 
    651                 { 
    652                         object_kind *k_ptr = &k_info[inscriptions[i].kind_idx]; 
    653  
    654                         /* Write a comment for the autoinscription*/ 
    655                         fprintf(fff, "# Autoinscription for %s\n", k_name + k_ptr->name); 
    656  
    657                         /* Dump the autoinscribe info */ 
    658                         fprintf(fff, "B:%d:%s\n\n", inscriptions[i].kind_idx, 
    659                                 quark_str(inscriptions[i].inscription_idx)); 
    660                 } 
    661  
    662                 /* Close */ 
    663                 my_fclose(fff); 
    664  
    665                 /* Ending message */ 
    666                 prt("Autoinscribe file saved successfully.  (Hit a key.)", 16, 30); 
    667                 inkey(); 
    668         } 
    669  
    670         screen_load(); 
    671         return 1; 
    672 } 
    673  
    674  
    675 /* 
    676  * Load squelch info from a pref file. 
    677  */ 
    678 static void load_squelch_info(void) 
    679 { 
    680         char fname[80]; 
    681  
    682         screen_save(); 
    683  
    684         /* Prompt */ 
    685         prt("Command: Load squelch info from file", 16, 30); 
    686         prt("File: ", 17, 30); 
    687  
    688         /* Default filename */ 
    689         strnfmt(fname, sizeof(fname), "%s.squ", op_ptr->base_name); 
    690  
    691         /* Ask for a file (or cancel) */ 
    692         if (askfor_aux(fname, sizeof fname, NULL)) 
    693         { 
    694                 /* Process the given filename, note success or failure */ 
    695                 if (process_pref_file(fname)) 
    696                         prt("Failed to load squelch data!  (Hit a key.)", 17, 30); 
    697                 else 
    698                         prt("Squelch squelch squelch!  (Hit a key.)", 17, 30); 
    699  
    700                 inkey(); 
    701         } 
    702  
    703         screen_load(); 
    704  
    705         return; 
    706 } 
    707  
    708  
    709533 
    710534/*** UI stuff ***/ 
     
    1016840                prt(format("%c) %s", I2A(i), sval_dependent[i].desc), i + 3, 1); 
    1017841 
    1018  
    1019         prt("Commands:", 3, 30); 
    1020         prt(" a-t) Go to squelching settings for this type", 5, 30); 
    1021         prt("   Q) Quality squelching options", 6, 30); 
    1022         prt(" ESC) Back to options menu.", 12, 30); 
    1023         prt("   S) Save squelch values to pref file", 8, 30); 
    1024         prt("   B) Save autoinscriptions to pref file", 9, 30); 
     842        prt("Q) Quality squelching options", i + 4, 1); 
     843        prt("ESC) Back to options menu.", i + 6, 1); 
    1025844 
    1026845        while (!done) 
     
    1042861 
    1043862                /* Choose! */ 
    1044                 if (ch == 'S') dump_squelch_info();         /* Dump squelch info */ 
    1045                 else if (ch == 'B') dump_autoins_info();    /* Dump autoinscribe info */ 
    1046                 else if (ch == 'L') load_squelch_info();    /* Load squelch info */ 
    1047                 else if (ch == 'Q') quality_menu();         /* Switch to secondary squelching menu */ 
     863                if (ch == 'Q') quality_menu();         /* Switch to secondary squelching menu */ 
    1048864                else if (ch == ESCAPE) done = TRUE;         /* Finished */ 
    1049865