mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-22 10:10:13 +01:00
cedit command for toggling autosave for bugs, typos and ideas
This commit is contained in:
parent
48578939c5
commit
bf0539a425
7 changed files with 31 additions and 3 deletions
14
src/cedit.c
14
src/cedit.c
|
|
@ -134,6 +134,7 @@ static void cedit_setup(struct descriptor_data *d)
|
|||
OLC_CONFIG(d)->operation.auto_save_olc = CONFIG_OLC_SAVE;
|
||||
OLC_CONFIG(d)->operation.nameserver_is_slow = CONFIG_NS_IS_SLOW;
|
||||
OLC_CONFIG(d)->operation.medit_advanced = CONFIG_MEDIT_ADVANCED;
|
||||
OLC_CONFIG(d)->operation.ibt_autosave = CONFIG_IBT_AUTOSAVE;
|
||||
|
||||
/* Autowiz */
|
||||
OLC_CONFIG(d)->autowiz.use_autowiz = CONFIG_USE_AUTOWIZ;
|
||||
|
|
@ -246,7 +247,7 @@ static void cedit_save_internally(struct descriptor_data *d)
|
|||
CONFIG_NS_IS_SLOW = OLC_CONFIG(d)->operation.nameserver_is_slow;
|
||||
CONFIG_OLC_SAVE = OLC_CONFIG(d)->operation.auto_save_olc;
|
||||
CONFIG_MEDIT_ADVANCED = OLC_CONFIG(d)->operation.medit_advanced;
|
||||
|
||||
CONFIG_IBT_AUTOSAVE = OLC_CONFIG(d)->operation.ibt_autosave;
|
||||
/* Autowiz */
|
||||
CONFIG_USE_AUTOWIZ = OLC_CONFIG(d)->autowiz.use_autowiz;
|
||||
CONFIG_MIN_WIZLIST_LEV = OLC_CONFIG(d)->autowiz.min_wizlist_lev;
|
||||
|
|
@ -557,6 +558,10 @@ int save_config( IDXTYPE nowhere )
|
|||
"medit_advanced_stats = %d\n\n",
|
||||
CONFIG_MEDIT_ADVANCED);
|
||||
|
||||
fprintf(fl, "* Should the idea, bug and typo commands autosave (1) or not (0).\n"
|
||||
"ibt_autosave = %d\n\n",
|
||||
CONFIG_IBT_AUTOSAVE);
|
||||
|
||||
fprintf(fl, "\n\n\n* [ Autowiz Options ]\n");
|
||||
|
||||
fprintf(fl, "* Should the game automatically create a new wizlist/immlist every time\n"
|
||||
|
|
@ -818,6 +823,7 @@ static void cedit_disp_operation_options(struct descriptor_data *d)
|
|||
"%sM%s) Welcome Message : \r\n%s%s\r\n"
|
||||
"%sN%s) Start Message : \r\n%s%s\r\n"
|
||||
"%sO%s) Medit Stats Menu : %s%s\r\n"
|
||||
"%sP%s) Autosave bugs when resolved from commandline : %s%s\r\n"
|
||||
"%sQ%s) Exit To The Main Menu\r\n"
|
||||
"Enter your choice : ",
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->operation.DFLT_PORT,
|
||||
|
|
@ -835,6 +841,7 @@ static void cedit_disp_operation_options(struct descriptor_data *d)
|
|||
grn, nrm, cyn, OLC_CONFIG(d)->operation.WELC_MESSG ? OLC_CONFIG(d)->operation.WELC_MESSG : "<None>",
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->operation.START_MESSG ? OLC_CONFIG(d)->operation.START_MESSG : "<None>",
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->operation.medit_advanced ? "Advanced" : "Standard",
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->operation.ibt_autosave ? "Yes" : "No",
|
||||
grn, nrm
|
||||
);
|
||||
|
||||
|
|
@ -1360,6 +1367,11 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||
TOGGLE_VAR(OLC_CONFIG(d)->operation.medit_advanced);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
case 'P':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->operation.ibt_autosave);
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
case 'Q':
|
||||
cedit_disp_menu(d);
|
||||
|
|
|
|||
|
|
@ -307,3 +307,6 @@ int default_minimap_size = 2;
|
|||
|
||||
/* Medit Stats menu - show 'advanced' options? */
|
||||
int medit_advanced_stats = YES;
|
||||
/** Does "bug resolve" autosave ? */
|
||||
int ibt_autosave = YES;
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ extern int default_map_size;
|
|||
extern int default_minimap_size;
|
||||
|
||||
extern int medit_advanced_stats;
|
||||
extern int ibt_autosave;
|
||||
/*
|
||||
* Variables not controlled by cedit
|
||||
*/
|
||||
|
|
|
|||
5
src/db.c
5
src/db.c
|
|
@ -3769,7 +3769,8 @@ static void load_default_config( void )
|
|||
CONFIG_WELC_MESSG = strdup(WELC_MESSG);
|
||||
CONFIG_START_MESSG = strdup(START_MESSG);
|
||||
CONFIG_MEDIT_ADVANCED = medit_advanced_stats;
|
||||
|
||||
CONFIG_IBT_AUTOSAVE = ibt_autosave;
|
||||
|
||||
/* Autowiz options. */
|
||||
CONFIG_USE_AUTOWIZ = use_autowiz;
|
||||
CONFIG_MIN_WIZLIST_LEV = min_wizlist_lev;
|
||||
|
|
@ -3881,6 +3882,8 @@ void load_config( void )
|
|||
CONFIG_NO_MORT_TO_IMMORT = num;
|
||||
else if (!str_cmp(tag, "immort_start_room"))
|
||||
CONFIG_IMMORTAL_START = num;
|
||||
else if (!str_cmp(tag, "ibt_autosave"))
|
||||
CONFIG_IBT_AUTOSAVE = num;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ ACMD(do_ibt)
|
|||
int i, num_res, num_unres;
|
||||
IBT_DATA *ibtData, *first_ibt, *last_ibt;
|
||||
int ano=0;
|
||||
|
||||
|
||||
if (IS_NPC(ch))
|
||||
return;
|
||||
|
||||
|
|
@ -674,6 +674,9 @@ ACMD(do_ibt)
|
|||
} else {
|
||||
send_to_char(ch,"%s %d resolved!\r\n", ibt_types[subcmd], ano);
|
||||
SET_BIT_AR(IBT_FLAGS(ibtData), IBT_RESOLVED);
|
||||
if (CONFIG_IBT_AUTOSAVE) {
|
||||
save_ibt_file(subcmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
@ -695,6 +698,9 @@ ACMD(do_ibt)
|
|||
} else {
|
||||
if (free_ibt(subcmd, ibtData)) {
|
||||
send_to_char(ch,"%s%s Number %d removed.%s\r\n", QCYN, ibt_types[subcmd], ano, QNRM);
|
||||
if (CONFIG_IBT_AUTOSAVE) {
|
||||
save_ibt_file(subcmd);
|
||||
}
|
||||
} else {
|
||||
send_to_char(ch,"%sUnable to remove %s %d!%s\r\n", QRED, CMD_NAME, ano, QNRM);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1384,6 +1384,7 @@ struct game_operation
|
|||
char *WELC_MESSG; /**< The welcome message. */
|
||||
char *START_MESSG; /**< The start msg for new characters. */
|
||||
int medit_advanced; /**< Does the medit OLC show the advanced stats menu ? */
|
||||
int ibt_autosave; /**< Does "bug resolve" autosave ? */
|
||||
};
|
||||
|
||||
/** The Autowizard options. */
|
||||
|
|
|
|||
|
|
@ -1067,6 +1067,8 @@ do \
|
|||
#define CONFIG_START_MESSG config_info.operation.START_MESSG
|
||||
/** Should medit show the advnaced stats menu? */
|
||||
#define CONFIG_MEDIT_ADVANCED config_info.operation.medit_advanced
|
||||
/** Does "bug resolve" autosave ? */
|
||||
#define CONFIG_IBT_AUTOSAVE config_info.operation.ibt_autosave
|
||||
|
||||
/* Autowiz */
|
||||
/** Use autowiz or not? */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue