Name : Help_Patch Version: PennMUSH 1.7.7p13 Credits: Pelle Haukali Files : src/help.c Syntax : patch -p0 < Help_Patch This patch can be used to modify the help.c file, in order for indexed-text files to be displayed with automatic borders. You can modify the border pattern by changing the border variable (Currently set as: ==--==-- etc). The command name and topic is displayed in the header, surrounded by borders. *** help.c.old Tue May 13 07:46:14 2003 --- help.c Wed May 14 07:01:12 2003 *************** *** 161,166 **** --- 161,167 ---- { help_indx *entry = NULL; FILE *fp; + char border[79] = "==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--=="; char *p, line[LINE_SIZE + 1]; char the_topic[LINE_SIZE + 2]; size_t n; *************** *** 238,244 **** notify_format(player, T("No entry for '%s'."), arg1); return; } ! if ((fp = fopen(help_dat->file, "rb")) == NULL) { notify(player, T("Sorry, that function is temporarily unavailable.")); do_log(LT_ERR, 0, 0, T("Can't open text file %s for reading"), --- 239,245 ---- notify_format(player, T("No entry for '%s'."), arg1); return; } ! if ((fp = fopen(help_dat->file, "rb")) == NULL) { notify(player, T("Sorry, that function is temporarily unavailable.")); do_log(LT_ERR, 0, 0, T("Can't open text file %s for reading"), *************** *** 251,263 **** return; } strcpy(the_topic, strupper(entry->topic + (*entry->topic == '&'))); ! /* ANSI topics */ ! if (ShowAnsi(player)) { ! char ansi_topic[LINE_SIZE + 10]; ! sprintf(ansi_topic, "%s%s%s", ANSI_HILITE, the_topic, ANSI_NORMAL); ! notify(player, ansi_topic); ! } else ! notify(player, the_topic); if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%cSAMP%c", TAG_START, TAG_END)); --- 252,281 ---- return; } strcpy(the_topic, strupper(entry->topic + (*entry->topic == '&'))); ! ! /* Was ANSI topics ; Now header */ ! ! notify(player,border); ! ! char cbuff[79]; ! char *cbp = cbuff; ! int clen = 78; ! char ctopic[77]; ! snprintf(ctopic, 78, "%s: %s", toupper(help_dat->command), the_topic); ! int x, slen = strlen(ctopic), spaces = (clen - slen) / 2; ! ! if(slen >= 76) ! strcpy(cbuff,"AradorMUSH"); ! else { ! while (spaces--) *cbp++ = ' '; ! for(x = 0;x < slen;x++,cbp++) ! *cbp = ctopic[x]; ! *cbp='\0'; ! } ! ! ! notify(player,cbuff); ! notify(player,border); if (SUPPORT_PUEBLO) notify_noenter(player, tprintf("%cSAMP%c", TAG_START, TAG_END)); *************** *** 275,280 **** --- 293,300 ---- notify(player, line); } } + notify(player, border); + if (SUPPORT_PUEBLO) notify_format(player, "%c/SAMP%c", TAG_START, TAG_END); fclose(fp);