• R/O
  • SSH
  • HTTPS

junnethack: Commit


Commit MetaInfo

Revisión401 (tree)
Tiempo2011-03-14 15:51:33
Autorso-miya

Log Message

UnNetHack SVN版rev.764を適用した。
New config option for changing order of spells in spell menu: SPELLORDER
Example: SPELLORDER=ZzqwertuiopasdfghjklyxcvbnmQWERTUIOPASDFGHJKLYXCVBNM

呪文メニューの表示順を変更する新設定オプション:SPELLORDER
例:SPELLORDER=ZzqwertuiopasdfghjklyxcvbnmQWERTUIOPASDFGHJKLYXCVBNM

Cambiar Resumen

Diferencia

--- junnethack/trunk/include/extern.h (revision 400)
+++ junnethack/trunk/include/extern.h (revision 401)
@@ -2034,6 +2034,7 @@
20342034 E int NDECL(dovspell);
20352035 E void FDECL(initialspell, (struct obj *));
20362036 E void NDECL(dump_spells);
2037+E boolean FDECL(parse_spellorder, (char *));
20372038
20382039 /* ### steal.c ### */
20392040
--- junnethack/trunk/src/files.c (revision 400)
+++ junnethack/trunk/src/files.c (revision 401)
@@ -2032,6 +2032,8 @@
20322032 return parse_monster_color(bufp);
20332033 } else if (match_varname(buf, "SYMBOL", 6)) {
20342034 return parse_symbol(bufp);
2035+ } else if (match_varname(buf, "SPELLORDER", 10)) {
2036+ return parse_spellorder(bufp);
20352037 } else if (match_varname(buf, "GRAPHICS", 4)) {
20362038 len = get_uchars(fp, buf, bufp, translate, FALSE,
20372039 MAXPCHARS, "GRAPHICS");
--- junnethack/trunk/src/spell.c (revision 400)
+++ junnethack/trunk/src/spell.c (revision 401)
@@ -25,8 +25,6 @@
2525
2626 #define spellev(spell) spl_book[spell].sp_lev
2727 #define spellname(spell) OBJ_NAME(objects[spellid(spell)])
28-#define spellet(spell) \
29- ((char)((spell < 26) ? ('a' + spell) : ('A' + spell - 26)))
3028
3129 STATIC_DCL int FDECL(spell_let_to_idx, (CHAR_P));
3230 STATIC_DCL boolean FDECL(cursed_book, (struct obj *bp));
@@ -1298,6 +1296,36 @@
12981296 }
12991297 }
13001298
1299+/** Standard spell order in the spell menu. */
1300+static char spellorder[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
1301+
1302+/** Return the shortcut character for the spell menu spell number. */
1303+static int
1304+spellet(spell)
1305+int spell;
1306+{
1307+ if (spell < strlen(spellorder)) {
1308+ return spellorder[spell];
1309+ } else {
1310+ return -1;
1311+ }
1312+}
1313+
1314+/** Overwrite standard spell order with user supplied string. */
1315+boolean
1316+parse_spellorder(str)
1317+char *str;
1318+{
1319+ int i;
1320+ for (i=0; i < strlen(str) && i < strlen(spellorder); i++) {
1321+ spellorder[i] = str[i];
1322+ }
1323+ return TRUE;
1324+}
1325+
1326+
1327+
1328+
13011329 /* the '+' command -- view known spells */
13021330 int
13031331 dovspell()
Show on old repository browser