From 7a122e7c2d529546b2334406ded417415e33e626 Mon Sep 17 00:00:00 2001 From: mogami Date: Wed, 22 Oct 2003 14:19:49 +0000 Subject: [PATCH] =?utf8?q?=E8=87=AA=E5=8B=95=E7=A0=B4=E5=A3=8A=E3=81=AE?= =?utf8?q?=E8=87=AA=E5=8B=95=E7=99=BB=E9=8C=B2=E3=81=8C=E3=80=81=E3=82=A2?= =?utf8?q?=E3=83=AB=E3=83=95=E3=82=A1=E3=83=99=E3=83=83=E3=83=88=E3=82=92?= =?utf8?q?=E5=B0=8F=E6=96=87=E5=AD=97=E3=81=AB=E7=B5=B1=E4=B8=80=E3=81=97?= =?utf8?q?=E5=BF=98=E3=82=8C=E3=81=A6=E3=81=84=E3=81=A6=E8=8B=B1=E8=AA=9E?= =?utf8?q?=E7=89=88=E3=81=A7=E6=AD=A3=E3=81=97=E3=81=8F=E5=8B=95=E4=BD=9C?= =?utf8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= =?utf8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/autopick.c | 72 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/autopick.c b/src/autopick.c index d08f9fbfb..1c34b10b5 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -482,6 +482,26 @@ static bool is_favorite(object_type *o_ptr) /* + * Convert string to lower case + */ +static void str_tolower(char *str) +{ + /* Force to be lower case string */ + for (; *str; str++) + { +#ifdef JP + if (iskanji(*str)) + { + str++; + continue; + } +#endif + *str = tolower(*str); + } +} + + +/* * Get auto-picker entry from o_ptr. */ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr) @@ -489,7 +509,11 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr) /* Assume that object name is to be added */ bool name = TRUE; - entry->name = NULL; + char name_str[MAX_NLEN]; + + /* Initialize name string */ + name_str[0] = '\0'; + entry->insc = string_make(quark_str(o_ptr->inscription)); entry->action = DO_AUTOPICK | DO_DISPLAY; entry->flag[0] = entry->flag[1] = 0L; @@ -548,16 +572,18 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr) if (o_ptr->name2) { - ego_item_type *e_ptr = &e_info[o_ptr->name2]; - entry->name = string_make(e_name + e_ptr->name); - if (TV_WEAPON_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END) { /* * Base name of ego weapons and armors - * are almost meaningless. Ignore it. + * are almost meaningless. + * Register the ego type only. */ + ego_item_type *e_ptr = &e_info[o_ptr->name2]; + strcpy(name_str, e_name + e_ptr->name); + + /* Don't use the object description */ name = FALSE; } @@ -673,19 +699,15 @@ static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr) else if (o_ptr->tval == TV_BOOTS) ADD_FLG(FLG_BOOTS); - + /* Prepare the object description */ if (name) { - char o_name[MAX_NLEN]; - object_desc(o_name, o_ptr, FALSE, 0); - - entry->name = string_make(o_name); + object_desc(name_str, o_ptr, FALSE, 0); } - else if (!entry->name) - { - entry->name = string_make(""); - } + /* Register the name in lowercase */ + str_tolower(name_str); + entry->name = string_make(name_str); return; } @@ -1273,26 +1295,6 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam /* - * Convert string to lower case - */ -static void str_tolower(char *str) -{ - /* Force to be lower case string */ - for (; *str; str++) - { -#ifdef JP - if (iskanji(*str)) - { - str++; - continue; - } -#endif - *str = tolower(*str); - } -} - - -/* * A function for Auto-picker/destroyer * Examine whether the object matches to the list of keywords or not. */ @@ -5799,7 +5801,7 @@ void do_cmd_edit_autopick(void) #ifdef JP prt("(^Q:½ªÎ» ^W:¥»¡¼¥Ö¤·¤Æ½ªÎ», ESC:¥á¥Ë¥å¡¼, ¤½¤Î¾:ÆþÎÏ)", 0, 0); #else - prt("(^Q:quit, ^W:save&quit, ESC:menu, Other:input text)", 0, 0); + prt("(^Q:Quit, ^W:Save&Quit, ESC:Menu, Other:Input text)", 0, 0); #endif if (!tb->mark) { -- 2.11.0