#define MAX_LINELEN 1024
-/*
- * Macros for Keywords
- */
+ /*
+ * Macros for Keywords
+ */
#define FLG_ALL 0
#define FLG_UNAWARE 1
#define FLG_UNIDENTIFIED 2
static GAME_TEXT KEY_RARE[] = "レアな";
static GAME_TEXT KEY_COMMON[] = "ありふれた";
static GAME_TEXT KEY_BOOSTED[] = "ダイス目の違う";
-static GAME_TEXT KEY_MORE_THAN[] = "ダイス目";
-static GAME_TEXT KEY_DICE[] = "以上の";
-static GAME_TEXT KEY_MORE_BONUS[] = "修正値";
-static GAME_TEXT KEY_MORE_BONUS2[] = "以上の";
+static GAME_TEXT KEY_MORE_THAN[] = "ダイス目";
+static GAME_TEXT KEY_DICE[] = "以上の";
+static GAME_TEXT KEY_MORE_BONUS[] = "修正値";
+static GAME_TEXT KEY_MORE_BONUS2[] = "以上の";
static GAME_TEXT KEY_WANTED[] = "賞金首の";
static GAME_TEXT KEY_UNIQUE[] = "ユニーク・モンスターの";
static GAME_TEXT KEY_HUMAN[] = "人間の";
static GAME_TEXT KEY_RARE[] = "rare";
static GAME_TEXT KEY_COMMON[] = "common";
static GAME_TEXT KEY_BOOSTED[] = "dice boosted";
-static GAME_TEXT KEY_MORE_THAN[] = "more than";
-static GAME_TEXT KEY_DICE[] = " dice";
-static GAME_TEXT KEY_MORE_BONUS[] = "more bonus than";
-static GAME_TEXT KEY_MORE_BONUS2[] = "";
+static GAME_TEXT KEY_MORE_THAN[] = "more than";
+static GAME_TEXT KEY_DICE[] = " dice";
+static GAME_TEXT KEY_MORE_BONUS[] = "more bonus than";
+static GAME_TEXT KEY_MORE_BONUS2[] = "";
static GAME_TEXT KEY_WANTED[] = "wanted";
static GAME_TEXT KEY_UNIQUE[] = "unique monster's";
static GAME_TEXT KEY_HUMAN[] = "human";
#define IS_FLG(FLG) (entry->flag[FLG / 32] & (1L << (FLG % 32)))
#ifdef JP
- static char kanji_colon[] = ":";
+static char kanji_colon[] = ":";
#endif
/*
str++;
continue;
}
-
+
if ((act & DO_AUTOPICK) && *str == '~')
{
act &= ~DO_AUTOPICK;
str++;
continue;
}
-
+
if ((act & DO_AUTOPICK) && *str == ';')
{
act &= ~DO_AUTOPICK;
str++;
continue;
}
-
+
if ((act & DO_DISPLAY) && *str == '(')
{
act &= ~DO_DISPLAY;
str++;
continue;
}
-
+
break;
}
/* There was no noun */
if (prev_flg == -1)
- /* Add extra word "items" */
- ADD_FLG_NOUN(FLG_ITEMS);
+ /* Add extra word "items" */
+ ADD_FLG_NOUN(FLG_ITEMS);
}
else
{
if (prev_flg != -1)
{
/* A noun type keyword didn't end correctly */
- entry->flag[prev_flg/32] &= ~(1L<< (prev_flg%32));
+ entry->flag[prev_flg / 32] &= ~(1L << (prev_flg % 32));
ptr = prev_ptr;
}
}
}
if ((o_ptr->tval == TV_CORPSE || o_ptr->tval == TV_STATUE)
- && (r_info[o_ptr->pval].flags1 & RF1_UNIQUE))
+ && (r_info[o_ptr->pval].flags1 & RF1_UNIQUE))
{
ADD_FLG(FLG_UNIQUE);
}
}
if (o_ptr->tval >= TV_LIFE_BOOK &&
- !check_book_realm(o_ptr->tval, o_ptr->sval))
+ !check_book_realm(o_ptr->tval, o_ptr->sval))
{
ADD_FLG(FLG_UNREADABLE);
if (o_ptr->tval != TV_ARCANE_BOOK) name = FALSE;
}
if (REALM1_BOOK == o_ptr->tval &&
- player_ptr->pclass != CLASS_SORCERER &&
- player_ptr->pclass != CLASS_RED_MAGE)
+ player_ptr->pclass != CLASS_SORCERER &&
+ player_ptr->pclass != CLASS_RED_MAGE)
{
ADD_FLG(FLG_REALM1);
name = FALSE;
}
if (REALM2_BOOK == o_ptr->tval &&
- player_ptr->pclass != CLASS_SORCERER &&
- player_ptr->pclass != CLASS_RED_MAGE)
+ player_ptr->pclass != CLASS_SORCERER &&
+ player_ptr->pclass != CLASS_RED_MAGE)
{
ADD_FLG(FLG_REALM2);
name = FALSE;
if (object_is_ammo(o_ptr))
ADD_FLG(FLG_MISSILES);
else if (o_ptr->tval == TV_SCROLL || o_ptr->tval == TV_STAFF
- || o_ptr->tval == TV_WAND || o_ptr->tval == TV_ROD)
+ || o_ptr->tval == TV_WAND || o_ptr->tval == TV_ROD)
ADD_FLG(FLG_DEVICES);
else if (o_ptr->tval == TV_LITE)
ADD_FLG(FLG_LIGHTS);
else if (o_ptr->tval == TV_SKELETON || o_ptr->tval == TV_BOTTLE
- || o_ptr->tval == TV_JUNK || o_ptr->tval == TV_STATUE)
+ || o_ptr->tval == TV_JUNK || o_ptr->tval == TV_STATUE)
ADD_FLG(FLG_JUNKS);
else if (o_ptr->tval == TV_CORPSE)
ADD_FLG(FLG_CORPSES);
else if (o_ptr->tval >= TV_LIFE_BOOK)
ADD_FLG(FLG_SPELLBOOKS);
else if (o_ptr->tval == TV_POLEARM || o_ptr->tval == TV_SWORD
- || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)
+ || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)
ADD_FLG(FLG_WEAPONS);
else if (o_ptr->tval == TV_SHIELD)
ADD_FLG(FLG_SHIELDS);
else if (o_ptr->tval == TV_AMULET)
ADD_FLG(FLG_AMULETS);
else if (o_ptr->tval == TV_DRAG_ARMOR || o_ptr->tval == TV_HARD_ARMOR ||
- o_ptr->tval == TV_SOFT_ARMOR)
+ o_ptr->tval == TV_SOFT_ARMOR)
ADD_FLG(FLG_SUITS);
else if (o_ptr->tval == TV_CLOAK)
ADD_FLG(FLG_CLOAKS);
}
/* Clear old entries */
- for( i = 0; i < max_autopick; i++)
+ for (i = 0; i < max_autopick; i++)
autopick_free_entry(&autopick_list[i]);
max_autopick = 0;
int i;
/* Nuke illegal char */
- for(i = 0; buf[i]; i++)
+ for (i = 0; buf[i]; i++)
{
#ifdef JP
if (iskanji(buf[i]))
}
buf[i] = 0;
-
+
if (!autopick_new_entry(entry, buf, FALSE)) return 0;
- /* Already has the same entry? */
- for(i = 0; i < max_autopick; i++)
+ /* Already has the same entry? */
+ for (i = 0; i < max_autopick; i++)
{
if (!strcmp(entry->name, autopick_list[i].name)
&& entry->flag[0] == autopick_list[i].flag[0]
/*** Unidentified ***/
if (IS_FLG(FLG_UNIDENTIFIED)
- && (object_is_known(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
+ && (object_is_known(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
return FALSE;
/*** Identified ***/
/*** *Identified* ***/
if (IS_FLG(FLG_STAR_IDENTIFIED) &&
- (!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL)))
+ (!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL)))
return FALSE;
/*** Dice boosted (weapon of slaying) ***/
/* Require boosted dice */
if ((o_ptr->dd == k_ptr->dd) && (o_ptr->ds == k_ptr->ds))
return FALSE;
-
+
/* In Vault Quest, Dice must be hide.*/
- if(!object_is_known(o_ptr) && object_is_quest_target(o_ptr))
+ if (!object_is_known(o_ptr) && object_is_quest_target(o_ptr))
{
return FALSE;
}
if (o_ptr->dd * o_ptr->ds < entry->dice)
return FALSE;
}
-
+
/*** Weapons whic dd*ds is more than nn ***/
if (IS_FLG(FLG_MORE_BONUS))
{
else
{
if (o_ptr->to_h < entry->bonus &&
- o_ptr->to_d < entry->bonus &&
- o_ptr->to_a < entry->bonus &&
- o_ptr->pval < entry->bonus)
+ o_ptr->to_d < entry->bonus &&
+ o_ptr->to_a < entry->bonus &&
+ o_ptr->pval < entry->bonus)
return FALSE;
}
}
-
+
/*** Worthless items ***/
if (IS_FLG(FLG_WORTHLESS) && object_value(o_ptr) > 0)
return FALSE;
/* Need to be known to be an ego */
if (!object_is_known(o_ptr) &&
- !((o_ptr->ident & IDENT_SENSE) && o_ptr->feeling == FEEL_EXCELLENT))
+ !((o_ptr->ident & IDENT_SENSE) && o_ptr->feeling == FEEL_EXCELLENT))
return FALSE;
}
/*** Unique monster's corpse/skeletons/statues ***/
if (IS_FLG(FLG_UNIQUE) &&
- ((o_ptr->tval != TV_CORPSE && o_ptr->tval != TV_STATUE) ||
- !(r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
+ ((o_ptr->tval != TV_CORPSE && o_ptr->tval != TV_STATUE) ||
+ !(r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
return FALSE;
/*** Human corpse/skeletons (for Daemon magic) ***/
if (IS_FLG(FLG_HUMAN) &&
- (o_ptr->tval != TV_CORPSE ||
- !my_strchr("pht", r_info[o_ptr->pval].d_char)))
+ (o_ptr->tval != TV_CORPSE ||
+ !my_strchr("pht", r_info[o_ptr->pval].d_char)))
return FALSE;
/*** Unreadable spellbooks ***/
if (IS_FLG(FLG_UNREADABLE) &&
- (o_ptr->tval < TV_LIFE_BOOK ||
- check_book_realm(o_ptr->tval, o_ptr->sval)))
+ (o_ptr->tval < TV_LIFE_BOOK ||
+ check_book_realm(o_ptr->tval, o_ptr->sval)))
return FALSE;
/*** First realm spellbooks ***/
- if (IS_FLG(FLG_REALM1) &&
- (REALM1_BOOK != o_ptr->tval ||
- player_ptr->pclass == CLASS_SORCERER ||
- player_ptr->pclass == CLASS_RED_MAGE))
+ if (IS_FLG(FLG_REALM1) &&
+ (REALM1_BOOK != o_ptr->tval ||
+ player_ptr->pclass == CLASS_SORCERER ||
+ player_ptr->pclass == CLASS_RED_MAGE))
return FALSE;
/*** Second realm spellbooks ***/
if (IS_FLG(FLG_REALM2) &&
- (REALM2_BOOK != o_ptr->tval ||
- player_ptr->pclass == CLASS_SORCERER ||
- player_ptr->pclass == CLASS_RED_MAGE))
+ (REALM2_BOOK != o_ptr->tval ||
+ player_ptr->pclass == CLASS_SORCERER ||
+ player_ptr->pclass == CLASS_RED_MAGE))
return FALSE;
/*** First rank spellbooks ***/
if (IS_FLG(FLG_FIRST) &&
- (o_ptr->tval < TV_LIFE_BOOK || 0 != o_ptr->sval))
+ (o_ptr->tval < TV_LIFE_BOOK || 0 != o_ptr->sval))
return FALSE;
/*** Second rank spellbooks ***/
if (IS_FLG(FLG_SECOND) &&
- (o_ptr->tval < TV_LIFE_BOOK || 1 != o_ptr->sval))
+ (o_ptr->tval < TV_LIFE_BOOK || 1 != o_ptr->sval))
return FALSE;
/*** Third rank spellbooks ***/
- if (IS_FLG(FLG_THIRD) &&
- (o_ptr->tval < TV_LIFE_BOOK || 2 != o_ptr->sval))
+ if (IS_FLG(FLG_THIRD) &&
+ (o_ptr->tval < TV_LIFE_BOOK || 2 != o_ptr->sval))
return FALSE;
/*** Fourth rank spellbooks ***/
if (IS_FLG(FLG_FOURTH) &&
- (o_ptr->tval < TV_LIFE_BOOK || 3 != o_ptr->sval))
+ (o_ptr->tval < TV_LIFE_BOOK || 3 != o_ptr->sval))
return FALSE;
/*** Items ***/
}
else if (IS_FLG(FLG_DEVICES))
{
- switch(o_ptr->tval)
+ switch (o_ptr->tval)
{
case TV_SCROLL: case TV_STAFF: case TV_WAND: case TV_ROD:
break;
}
else if (IS_FLG(FLG_JUNKS))
{
- switch(o_ptr->tval)
+ switch (o_ptr->tval)
{
case TV_SKELETON: case TV_BOTTLE:
case TV_JUNK: case TV_STATUE:
else if (IS_FLG(FLG_SUITS))
{
if (!(o_ptr->tval == TV_DRAG_ARMOR ||
- o_ptr->tval == TV_HARD_ARMOR ||
- o_ptr->tval == TV_SOFT_ARMOR))
+ o_ptr->tval == TV_HARD_ARMOR ||
+ o_ptr->tval == TV_SOFT_ARMOR))
return FALSE;
}
else if (IS_FLG(FLG_CLOAKS))
for (int j = 0; j < INVEN_PACK; j++)
{
/*
- * 'Collecting' means the item must be absorbed
+ * 'Collecting' means the item must be absorbed
* into an inventory slot.
* But an item can not be absorbed into itself!
*/
if ((&player_ptr->inventory_list[j] != o_ptr) &&
- object_similar(&player_ptr->inventory_list[j], o_ptr))
+ object_similar(&player_ptr->inventory_list[j], o_ptr))
return TRUE;
}
/* Convert the string to lower case */
str_tolower(o_name);
- /* Look for a matching entry in the list */
+ /* Look for a matching entry in the list */
for (int i = 0; i < max_autopick; i++)
{
autopick_type *entry = &autopick_list[i];
if (player_ptr->prace == RACE_DEMON)
{
if (o_ptr->tval == TV_CORPSE &&
- o_ptr->sval == SV_CORPSE &&
- my_strchr("pht", r_info[o_ptr->pval].d_char))
+ o_ptr->sval == SV_CORPSE &&
+ my_strchr("pht", r_info[o_ptr->pval].d_char))
return FALSE;
}
if (player_ptr->pclass == CLASS_ARCHER)
{
if (o_ptr->tval == TV_SKELETON ||
- (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
+ (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
return FALSE;
}
else if (player_ptr->pclass == CLASS_NINJA)
{
if (o_ptr->tval == TV_LITE &&
- o_ptr->name2 == EGO_LITE_DARKNESS && object_is_known(o_ptr))
+ o_ptr->name2 == EGO_LITE_DARKNESS && object_is_known(o_ptr))
return FALSE;
}
else if (player_ptr->pclass == CLASS_BEASTMASTER ||
- player_ptr->pclass == CLASS_CAVALRY)
+ player_ptr->pclass == CLASS_CAVALRY)
{
if (o_ptr->tval == TV_WAND &&
- o_ptr->sval == SV_WAND_HEAL_MONSTER && object_is_aware(o_ptr))
+ o_ptr->sval == SV_WAND_HEAL_MONSTER && object_is_aware(o_ptr))
return FALSE;
}
}
/* Protected by auto-picker (2nd priotity) */
if (autopick_idx >= 0 &&
- !(autopick_list[autopick_idx].action & DO_AUTODESTROY))
+ !(autopick_list[autopick_idx].action & DO_AUTODESTROY))
destroy = FALSE;
/* Auto-destroyer works only when !always_pickup */
{
/* Auto-picker/destroyer (1st priority) */
if (autopick_idx >= 0 &&
- (autopick_list[autopick_idx].action & DO_AUTODESTROY))
+ (autopick_list[autopick_idx].action & DO_AUTODESTROY))
destroy = TRUE;
}
{
INVENTORY_IDX item;
- /*
+ /*
* Scan inventry in reverse order to prevent
* skipping after inven_item_optimize()
*/
- for (item = INVEN_TOTAL - 1; item >= 0 ; item--)
+ for (item = INVEN_TOTAL - 1; item >= 0; item--)
autopick_delayed_alter_aux(owner_ptr, item);
/* Scan the pile of objects */
void autopick_pickup_items(player_type* player_ptr, grid_type *g_ptr)
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
-
+
/* Scan the pile of objects */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
int idx;
- object_type *o_ptr = &player_ptr->current_floor_ptr->o_list[this_o_idx];
- next_o_idx = o_ptr->next_o_idx;
+ object_type *o_ptr = &player_ptr->current_floor_ptr->o_list[this_o_idx];
+ next_o_idx = o_ptr->next_o_idx;
idx = is_autopick(player_ptr, o_ptr);
auto_destroy_item(player_ptr, o_ptr, idx);
continue;
}
-
+
disturb(player_ptr, FALSE, FALSE);
if (!inven_carry_okay(o_ptr))
o_ptr->marked |= OM_NOMSG;
continue;
}
-
+
if (!(autopick_list[idx].action & DO_QUERY_AUTOPICK))
{
py_pickup_aux(player_ptr, this_o_idx);
if (num)
{
msg_format(_("以前のキャラクター用の自動設定(%d行)が残っています。",
- "Auto registered lines (%d lines) for previous character are remaining."), num);
+ "Auto registered lines (%d lines) for previous character are remaining."), num);
strcpy(buf, _("古い設定行は削除します。よろしいですか?", "These lines will be deleted. Are you sure? "));
/* You can cancel it */
autoregister = FALSE;
msg_print(_("エディタのカット&ペースト等を使って必要な行を避難してください。",
- "Use cut & paste of auto picker editor (_) to keep old prefs."));
+ "Use cut & paste of auto picker editor (_) to keep old prefs."));
}
}
/* Known to be an artifact? */
if ((object_is_known(o_ptr) && object_is_artifact(o_ptr)) ||
- ((o_ptr->ident & IDENT_SENSE) &&
- (o_ptr->feeling == FEEL_TERRIBLE || o_ptr->feeling == FEEL_SPECIAL)))
+ ((o_ptr->ident & IDENT_SENSE) &&
+ (o_ptr->feeling == FEEL_TERRIBLE || o_ptr->feeling == FEEL_SPECIAL)))
{
GAME_TEXT o_name[MAX_NLEN];
fprintf(pref_fff, "%s\n", autoregister_header);
fprintf(pref_fff, "%s\n", _("# *警告!!* 以降の行は自動登録されたものです。",
- "# *Waring!* The lines below will be deleated later."));
- fprintf(pref_fff, "%s\n", _("# 後で自動的に削除されますので、必要な行は上の方へ移動しておいてください。",
- "# Keep it by cut & paste if you need these lines for future characters."));
+ "# *Waring!* The lines below will be deleated later."));
+ fprintf(pref_fff, "%s\n", _("# 後で自動的に削除されますので、必要な行は上の方へ移動しておいてください。",
+ "# Keep it by cut & paste if you need these lines for future characters."));
/* Now auto register is in-use */
player_ptr->autopick_autoregister = TRUE;
/*** Which can be absorbed into a slot as a bundle ***/
if (IS_FLG(FLG_COLLECTING))
before_str[before_n++] = "収集中で既に持っているスロットにまとめられる";
-
+
/*** Unaware items ***/
if (IS_FLG(FLG_UNAWARE))
before_str[before_n++] = "未鑑定でその効果も判明していない";
static char more_than_desc_str[] = "___";
before_str[before_n++] = "ダメージダイスの最大値が";
body_str = "武器";
-
- sprintf(more_than_desc_str,"%d", entry->dice);
+
+ sprintf(more_than_desc_str, "%d", entry->dice);
before_str[before_n++] = more_than_desc_str;
before_str[before_n++] = "以上の";
}
{
static char more_bonus_desc_str[] = "___";
before_str[before_n++] = "修正値が(+";
-
- sprintf(more_bonus_desc_str,"%d", entry->bonus);
+
+ sprintf(more_bonus_desc_str, "%d", entry->bonus);
before_str[before_n++] = more_bonus_desc_str;
before_str[before_n++] = ")以上の";
}
body_str = "ブーツ";
*buff = '\0';
- if (!before_n)
+ if (!before_n)
strcat(buff, "全ての");
else for (i = 0; i < before_n && before_str[i]; i++)
strcat(buff, before_str[i]);
/*** Which can be absorbed into a slot as a bundle ***/
if (IS_FLG(FLG_COLLECTING))
which_str[which_n++] = "can be absorbed into an existing inventory list slot";
-
+
/*** Unaware items ***/
if (IS_FLG(FLG_UNAWARE))
{
static char more_than_desc_str[] =
"maximum damage from dice is bigger than __";
body_str = "weapons";
-
+
sprintf(more_than_desc_str + sizeof(more_than_desc_str) - 3,
"%d", entry->dice);
whose_str[whose_n++] = more_than_desc_str;
{
static char more_bonus_desc_str[] =
"magical bonus is bigger than (+__)";
-
+
sprintf(more_bonus_desc_str + sizeof(more_bonus_desc_str) - 4,
"%d)", entry->bonus);
whose_str[whose_n++] = more_bonus_desc_str;
}
/* Adjective */
- if (!before_n)
+ if (!before_n)
strcat(buff, "all ");
else for (i = 0; i < before_n && before_str[i]; i++)
{
FILE *fff;
fff = my_fopen(buf, "w");
if (!fff) return FALSE;
-
+
for (int lines = 0; lines_list[lines]; lines++)
{
my_fputs(fff, lines_list[lines], 1024);
for (i = FLG_NOUN_BEGIN; i <= FLG_NOUN_END; i++)
REM_FLG(i);
}
-
+
/* You can use only one identify state flag */
else if (FLG_UNAWARE <= flg && flg <= FLG_STAR_IDENTIFIED)
{
for (i = FLG_UNAWARE; i <= FLG_STAR_IDENTIFIED; i++)
REM_FLG(i);
}
-
+
/* You can use only one flag in artifact/ego/nameless */
else if (FLG_ARTIFACT <= flg && flg <= FLG_AVERAGE)
{
for (i = FLG_ARTIFACT; i <= FLG_AVERAGE; i++)
REM_FLG(i);
}
-
+
/* You can use only one flag in rare/common */
else if (FLG_RARE <= flg && flg <= FLG_COMMON)
{
for (i = FLG_RARE; i <= FLG_COMMON; i++)
REM_FLG(i);
}
-
+
if (add) ADD_FLG(flg);
else REM_FLG(flg);
-
+
tb->lines_list[y] = autopick_line_from_entry_kill(entry);
-
+
/* Now dirty */
tb->dirty_flags |= DIRTY_ALL;
if (wid > 0) tb->cx++;
if (wid < 0 && tb->cx > 0) tb->cx--;
}
-
+
tb->lines_list[y] = autopick_line_from_entry_kill(entry);
-
+
/* Now dirty */
tb->dirty_flags |= DIRTY_ALL;
autopick_free_entry(entry);
continue;
}
-
+
string_free(tb->lines_list[y]);
-
+
/* Remove all noun flag */
if (FLG_NOUN_BEGIN <= flg && flg <= FLG_NOUN_END)
{
for (i = FLG_NOUN_BEGIN; i <= FLG_NOUN_END; i++)
REM_FLG(i);
}
-
+
ADD_FLG(flg);
-
+
tb->lines_list[y] = autopick_line_from_entry_kill(entry);
/* Now dirty */
concptr s = tb->lines_list[y];
if ((s[0] == '?' && s[1] == ':') ||
- (tb->states[y] & LSTAT_BYPASS))
+ (tb->states[y] & LSTAT_BYPASS))
{
/* Expressions need re-evaluation */
tb->dirty_flags |= DIRTY_EXPRESSION;
int k;
for (k = 0; tb->lines_list[k]; k++)
- /* count number of lines */ ;
+ /* count number of lines */;
/* Too many lines! */
if (k >= MAX_LINES - 2) return FALSE;
/* The last line is already empty */
- if (!tb->lines_list[k-1][0]) return FALSE;
+ if (!tb->lines_list[k - 1][0]) return FALSE;
/* Create new empty line */
tb->lines_list[k] = string_make("");
int i, j, k;
for (k = 0; tb->lines_list[k]; k++)
- /* count number of lines */ ;
+ /* count number of lines */;
if (k >= MAX_LINES - 2) return FALSE;
k--;
/* Move down lines */
for (; tb->cy < k; k--)
{
- tb->lines_list[k+1] = tb->lines_list[k];
- tb->states[k+1] = tb->states[k];
+ tb->lines_list[k + 1] = tb->lines_list[k];
+ tb->states[k + 1] = tb->states[k];
}
/* Split current line */
}
buf[j] = '\0';
- tb->lines_list[tb->cy+1] = string_make(&tb->lines_list[tb->cy][i]);
+ tb->lines_list[tb->cy + 1] = string_make(&tb->lines_list[tb->cy][i]);
string_free(tb->lines_list[tb->cy]);
tb->lines_list[tb->cy] = string_make(buf);
* TERM_WHITE : Insert mode
*/
byte color = TERM_YELLOW;
- char buf[MAX_NLEN+20];
+ char buf[MAX_NLEN + 20];
const int len = 80;
char prompt[] = _("検索(^I:持ち物 ^L:破壊された物): ", "Search key(^I:inven ^L:destroyed): ");
if (iskanji(buf[i])) next_pos++;
#endif
- /* Is there the cursor at next position? */
+ /* Is there the cursor at next position? */
if (next_pos >= pos) break;
/* Move to next */
if (iskanji(buf[i])) next_pos++;
#endif
- /* Is there the cursor at next position? */
+ /* Is there the cursor at next position? */
if (next_pos >= pos) break;
/* Move to next */
/* Found a line but it's inactive */
if ((tb->states[i] & LSTAT_BYPASS) &&
- !(tb->states[i] & LSTAT_EXPRESSION))
+ !(tb->states[i] & LSTAT_EXPRESSION))
{
/* If it is first found, remember it */
if (bypassed_cy == -1)
/*
- * Display the menu, and get a command
+ * Display the menu, and get a command
*/
static int do_command_menu(int level, int start)
{
int max_len = 0;
int max_menu_wid;
- int col0 = 5 + level*7;
- int row0 = 1 + level*3;
+ int col0 = 5 + level * 7;
+ int row0 = 1 + level * 3;
byte menu_key = 0;
int menu_id_list[26];
bool redraw = TRUE;
/* Scroll if necessary */
if (tb->cy < tb->upper || tb->upper + tb->hgt <= tb->cy)
- tb->upper = tb->cy - (tb->hgt)/2;
+ tb->upper = tb->cy - (tb->hgt) / 2;
if (tb->upper < 0)
tb->upper = 0;
if ((tb->cx < tb->left + 10 && tb->left > 0) || tb->left + tb->wid - 5 <= tb->cx)
- tb->left = tb->cx - (tb->wid)*2/3;
+ tb->left = tb->cx - (tb->wid) * 2 / 3;
if (tb->left < 0)
tb->left = 0;
int leftcol = 0;
concptr msg;
byte color;
- int y = tb->upper+i;
+ int y = tb->upper + i;
/* clean or dirty? */
if (!(tb->dirty_flags & DIRTY_ALL) && (tb->dirty_line != y))
{
/* Kill whole line? */
concptr s = tb->lines_list[y];
- if (whole && x0 == 0 && s[x1] == '\0' && tb->lines_list[y+1])
+ if (whole && x0 == 0 && s[x1] == '\0' && tb->lines_list[y + 1])
{
string_free(tb->lines_list[y]);
/* Shift lines up */
int i;
- for (i = y; tb->lines_list[i+1]; i++)
- tb->lines_list[i] = tb->lines_list[i+1];
+ for (i = y; tb->lines_list[i + 1]; i++)
+ tb->lines_list[i] = tb->lines_list[i + 1];
tb->lines_list[i] = NULL;
/* Expressions need re-evaluation */
ascii_to_text(tmp, buf);
/* Null */
- if(!tmp[0]) return FALSE;
+ if (!tmp[0]) return FALSE;
tb->cx = 0;
ascii_to_text(tmp, buf);
/* Null */
- if(!tmp[0]) return FALSE;
+ if (!tmp[0]) return FALSE;
tb->cx = 0;
*/
static bool do_editor_command(player_type *player_ptr, text_body_type *tb, int com_id)
{
- switch(com_id)
+ switch (com_id)
{
case EC_QUIT:
if (tb->changed)
{
if (!get_check(_("全ての変更を破棄してから終了します。よろしいですか? ",
- "Discard all changes and quit. Are you sure? "))) break;
+ "Discard all changes and quit. Are you sure? "))) break;
}
return QUIT_WITHOUT_SAVE;
case EC_REVERT:
/* Revert to original */
if (!get_check(_("全ての変更を破棄して元の状態に戻します。よろしいですか? ",
- "Discard all changes and revert to original file. Are you sure? "))) break;
+ "Discard all changes and revert to original file. Are you sure? "))) break;
free_text_lines(tb->lines_list);
tb->lines_list = read_pickpref_text_lines(player_ptr, &tb->filename_mode);
break;
case EC_CUT:
- {
+ {
/* Copy the text first */
copy_text_to_yank(tb);
for (y = by2; y >= by1; y--)
{
int len = strlen(tb->lines_list[y]);
-
+
kill_line_segment(tb, y, 0, len, TRUE);
}
char rest[MAX_LINELEN], *rest_ptr = rest;
/* Save preceding string */
- for(i = 0; i < tb->cx; i++)
+ for (i = 0; i < tb->cx; i++)
buf[i] = tb->lines_list[tb->cy][i];
strcpy(rest, &(tb->lines_list[tb->cy][i]));
/* Paste yank buffer */
- while (*yank_str && i < MAX_LINELEN-1)
+ while (*yank_str && i < MAX_LINELEN - 1)
{
buf[i++] = *yank_str++;
}
tb->cx = strlen(buf);
/* Rest of original line */
- while (*rest_ptr && i < MAX_LINELEN-1)
+ while (*rest_ptr && i < MAX_LINELEN - 1)
{
buf[i++] = *rest_ptr++;
}
{
/* delete a return code and union two lines */
if (tb->cy == 0) break;
- tb->cx = strlen(tb->lines_list[tb->cy-1]);
- strcpy(buf, tb->lines_list[tb->cy-1]);
+ tb->cx = strlen(tb->lines_list[tb->cy - 1]);
+ strcpy(buf, tb->lines_list[tb->cy - 1]);
strcat(buf, tb->lines_list[tb->cy]);
- string_free(tb->lines_list[tb->cy-1]);
+ string_free(tb->lines_list[tb->cy - 1]);
string_free(tb->lines_list[tb->cy]);
- tb->lines_list[tb->cy-1] = string_make(buf);
+ tb->lines_list[tb->cy - 1] = string_make(buf);
- for (i = tb->cy; tb->lines_list[i+1]; i++)
- tb->lines_list[i] = tb->lines_list[i+1];
+ for (i = tb->cy; tb->lines_list[i + 1]; i++)
+ tb->lines_list[i] = tb->lines_list[i + 1];
tb->lines_list[i] = NULL;
tb->cy--;
search_for_object(player_ptr, tb, tb->search_o_ptr, TRUE);
break;
}
-
+
if (tb->search_str && tb->search_str[0])
{
search_for_string(tb, tb->search_str, TRUE);
break;
}
-
+
tb->dirty_flags |= DIRTY_NO_SEARCH;
break;
search_for_object(player_ptr, tb, tb->search_o_ptr, FALSE);
break;
}
-
+
if (tb->search_str && tb->search_str[0])
{
search_for_string(tb, tb->search_str, FALSE);
char expression[80];
/* Conditional Expression for Class and Race */
- sprintf(expression, "?:[AND [EQU $RACE %s] [EQU $CLASS %s] [GEQ $LEVEL %02d]]",
+ sprintf(expression, "?:[AND [EQU $RACE %s] [EQU $CLASS %s] [GEQ $LEVEL %02d]]",
#ifdef JP
rp_ptr->E_title, cp_ptr->E_title,
#else
Term_erase(0, tb->cy - tb->upper + 1, tb->wid);
/* Prompt */
- Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW,
- format(_("C:%d:<コマンドキー>: ", "C:%d:<Keypress>: "), (rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG)));
+ Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW,
+ format(_("C:%d:<コマンドキー>: ", "C:%d:<Keypress>: "), (rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG)));
if (!insert_keymap_line(tb)) break;
inkey_base = TRUE;
next = inkey();
- if (j+2 < MAX_LINELEN)
+ if (j + 2 < MAX_LINELEN)
{
buf[j++] = (char)key;
buf[j++] = (char)next;
else
#endif
{
- if (j+1 < MAX_LINELEN)
+ if (j + 1 < MAX_LINELEN)
buf[j++] = (char)key;
tb->cx++;
}
if (!(skey & SKEY_MASK)) return 0;
/* Convert from a special key code to an editor command */
- switch(skey & ~SKEY_MOD_MASK)
+ switch (skey & ~SKEY_MOD_MASK)
{
case SKEY_DOWN: com_id = EC_DOWN; break;
case SKEY_LEFT: com_id = EC_LEFT; break;
draw_text_editor(tb);
/* Display header line */
- prt(_("(^Q:終了 ^W:セーブして終了, ESC:メニュー, その他:入力)",
- "(^Q:Quit, ^W:Save&Quit, ESC:Menu, Other:Input text)"), 0, 0);
+ prt(_("(^Q:終了 ^W:セーブして終了, ESC:メニュー, その他:入力)",
+ "(^Q:Quit, ^W:Save&Quit, ESC:Menu, Other:Input text)"), 0, 0);
if (!tb->mark)
{
/* Display current position */
- prt (format("(%d,%d)", tb->cx, tb->cy), 0, 60);
+ prt(format("(%d,%d)", tb->cx, tb->cy), 0, 60);
}
else
{
/* Display current position and mark position */
- prt (format("(%d,%d)-(%d,%d)", tb->mx, tb->my, tb->cx, tb->cy), 0, 60);
+ prt(format("(%d,%d)-(%d,%d)", tb->mx, tb->my, tb->cx, tb->cy), 0, 60);
}
/* Place cursor */