/* テスト */
/* 
 * Debug Status: Now testing init_angband()
 * - Fixed __T on this page.
 */
/*
 * File: options.c
 * Purpose: Options table and definitions.
 *
 * Copyright (c) 1997 Ben Harrison
 *
 * This work is free software; you can redistribute it and/or modify it
 * under the terms of either:
 *
 * a) the GNU General Public License as published by the Free Software
 *    Foundation, version 2, or
 *
 * b) the "Angband licence":
 *    This software may be copied and distributed for educational, research,
 *    and not for profit purposes provided that this copyright and statement
 *    are included in all such copies.  Other copyrights may also apply.
 */
extern "C"
{
#include "angband.h"
#include "option.h"
}
/*
 * Option screen interface
 */
const byte option_page[OPT_PAGE_MAX][OPT_PAGE_PER] =
{
	/* Interface */
	{
		OPT_use_sound,
		OPT_rogue_like_commands,
		OPT_use_old_target,
		OPT_pickup_always,
		OPT_pickup_inven,
		OPT_pickup_detail,
		OPT_hide_squelchable,
		OPT_squelch_worthless,
		OPT_easy_alter,
		OPT_easy_open,
		OPT_show_lists,
		OPT_mouse_movement,
		OPT_mouse_buttons,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
	},
	/* Display */
	{
		OPT_hp_changes_color,
		OPT_hilite_player,
 		OPT_center_player,
		OPT_show_piles,
		OPT_show_flavors,
		OPT_show_labels,
		OPT_view_yellow_lite,
		OPT_view_bright_lite,
		OPT_view_granite_lite,
		OPT_view_special_lite,
		OPT_view_perma_grids,
		OPT_view_torch_grids,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
	},
	/* Warning */
	{
		OPT_disturb_move,
		OPT_disturb_near,
		OPT_disturb_detect,
		OPT_disturb_state,
		OPT_quick_messages,
		OPT_auto_more,
		OPT_ring_bell,
		OPT_flush_failure,
		OPT_flush_disturb,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
	},
	/* Birth/Difficulty */
	{
		OPT_birth_maximize,
		OPT_birth_randarts,
		OPT_birth_money,
		OPT_birth_ai_sound,
		OPT_birth_ai_smell,
		OPT_birth_ai_packs,
		OPT_birth_ai_learn,
		OPT_birth_ai_cheat,
		OPT_birth_ai_smart,
		OPT_birth_ironman,
		OPT_birth_no_stores,
		OPT_birth_no_artifacts,
		OPT_birth_no_stacking,
		OPT_birth_no_preserve,
		OPT_birth_no_stairs,
		OPT_birth_feelings
	},
	/* Cheat */
	{
		OPT_cheat_peek,
		OPT_cheat_hear,
		OPT_cheat_room,
		OPT_cheat_xtra,
		OPT_cheat_know,
		OPT_cheat_live,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
		OPT_NONE,
	}
};

typedef struct
{
	const _TCHAR *name;
	const _TCHAR *description;
	bool normal;
} option_entry;

static option_entry options[OPT_MAX] =
{
{ __T("rogue_like_commands"), __T("Rogue-like commands"),               FALSE }, /* 0 */
{ __T("quick_messages"),      __T("Activate quick messages"),           TRUE },  /* 1 */
{ __T("use_sound"),           __T("Use sound"),                         FALSE }, /* 2 */
{ __T("pickup_detail"),       __T("Be verbose when picking things up"), TRUE },  /* 3 */
{ __T("use_old_target"),      __T("Use old target by default"),         FALSE }, /* 4 */
{ __T("pickup_always"),       __T("Always pickup items"),               FALSE }, /* 5 */
{ __T("pickup_inven"),        __T("Always pickup items matching inventory"), TRUE },  /* 6 */
{ NULL,                  NULL,                                          FALSE }, /* 8 */
{ NULL,                  NULL,                                          FALSE }, /* 8 */
{ NULL,                  NULL,                                          FALSE }, /* 9 */
{ __T("show_labels"),         __T("Show labels in equipment listings"), TRUE },  /* 10 */
{ __T("show_lists"),          __T("Always show lists"),                 TRUE },  /* 11 */
{ NULL,                  NULL,                                          FALSE }, /* 12 */
{ NULL,                  NULL,                                          FALSE }, /* 13 */
{ __T("ring_bell"),           __T("Audible bell (on errors, etc)"),     TRUE },  /* 14 */
{ __T("show_flavors"),        __T("Show flavors in object descriptions"), TRUE },  /* 15 */
{ NULL,                  NULL,                                          FALSE }, /* 16 */
{ NULL,                  NULL,                                          FALSE }, /* 17 */
{ NULL,                  NULL,                                          FALSE }, /* 18 */
{ NULL,                  NULL,                                          FALSE }, /* 19 */
{ __T("disturb_move"),        __T("Disturb whenever any monster moves"),          FALSE }, /* 20 */
{ __T("disturb_near"),        __T("Disturb whenever viewable monster moves"),     TRUE },  /* 21 */
{ __T("disturb_detect"),      __T("Disturb whenever leaving trap detected area"), TRUE },  /* 22 */
{ __T("disturb_state"),       __T("Disturb whenever player state changes"),       TRUE },  /* 23 */
{ NULL,                  NULL,                                          FALSE }, /* 24 */
{ NULL,                  NULL,                                          FALSE }, /* 25 */
{ NULL,                  NULL,                                          FALSE }, /* 26 */
{ NULL,                  NULL,                                          FALSE }, /* 27 */
{ NULL,                  NULL,                                          FALSE }, /* 28 */
{ NULL,                  NULL,                                          FALSE }, /* 29 */
{ NULL,                  NULL,                                          FALSE }, /* 30 */
{ NULL,                  NULL,                                          FALSE }, /* 31 */
{ NULL,                  NULL,                                          FALSE }, /* 32 */
{ NULL,                  NULL,                                          FALSE }, /* 33 */
{ NULL,                  NULL,                                          FALSE }, /* 34 */
{ NULL,                  NULL,                                          FALSE }, /* 35 */
{ NULL,                  NULL,                                          FALSE }, /* 36 */
{ NULL,                  NULL,                                          FALSE }, /* 37 */
{ __T("view_perma_grids"),    __T("Map remembers all perma-lit grids"), TRUE },  /* 38 */
{ __T("view_torch_grids"),    __T("Map remembers all torch-lit grids"), TRUE },  /* 39 */
{ NULL,                  NULL,                                          TRUE }, /* 40 */
{ NULL,                  NULL,                                          TRUE }, /* 41 */
{ NULL,                  NULL,                                          FALSE }, /* 42 */
{ NULL,                  NULL,                                          FALSE }, /* 43 */
{ NULL,                  NULL,                                          FALSE }, /* 44 */
{ NULL,                  NULL,                                          FALSE }, /* 45 */
{ NULL,                  NULL,                                          FALSE }, /* 46 */
{ NULL,                  NULL,                                          FALSE }, /* 47 */
{ NULL,                  NULL,                                          FALSE }, /* 48 */
{ NULL,                  NULL,                                          FALSE }, /* 49 */
{ NULL,                  NULL,                                          FALSE }, /* 50 */
{ NULL,                  NULL,                                          FALSE }, /* 51 */
{ __T("flush_failure"),       __T("Flush input on various failures"),   TRUE },  /* 52 */
{ __T("flush_disturb"),       __T("Flush input whenever disturbed"),    FALSE }, /* 53 */
{ NULL,                  NULL,                                          FALSE }, /* 54 */
{ NULL,                  NULL,                                          FALSE }, /* 55 */
{ NULL,                  NULL,                                          FALSE }, /* 56 */
{ NULL,                  NULL,                                          FALSE }, /* 57 */
{ NULL,                  NULL,                                          FALSE }, /* 58 */
{ __T("hilite_player"),       __T("Hilite the player with the cursor"), FALSE }, /* 59 */
{ __T("view_yellow_lite"),    __T("Use special colors for torch lite"), FALSE }, /* 60 */
{ __T("view_bright_lite"),    __T("Use special colors for field of view"), TRUE },  /* 61 */
{ __T("view_granite_lite"),   __T("Use special colors for wall grids"),    FALSE }, /* 62 */
{ __T("view_special_lite"),   __T("Use special colors for floor grids"),   TRUE },  /* 63 */
{ __T("easy_open"),           __T("Open/Disarm/Close without direction"),  FALSE }, /* 64 */
{ __T("easy_alter"),          __T("Open/Disarm doors/traps on movement"),  FALSE }, /* 65 */
{ NULL,                  NULL,                                          FALSE }, /* 66 */
{ __T("show_piles"),          __T("Show stacks using special attr/char"), FALSE }, /* 67 */
{ __T("center_player"),       __T("Center map continuously"),             FALSE }, /* 68 */
{ NULL,                  NULL,                                          FALSE }, /* 69 */
{ NULL,                  NULL,                                          FALSE }, /* 70 */
{ __T("auto_more"),           __T("Automatically clear '-more-' prompts"), FALSE }, /* 71 */
{ NULL,                  NULL,                                          FALSE }, /* 72 */
{ NULL,                  NULL,                                          FALSE }, /* 73 */
{ __T("hp_changes_color"), __T("Player color indicates low hit points"), FALSE }, /* 74 */
{ __T("hide_squelchable"), __T("Hide items set as squelchable"),         FALSE }, /* 75 */
{ __T("squelch_worthless"), __T("Automatically squelch worthless items"), FALSE }, /* 76 */
{ __T("mouse_movement"),   __T("Allow mouse clicks to move the player"), FALSE }, /* 77 */
{ __T("mouse_buttons"),    __T("Show mouse status line buttons"),       FALSE }, /* 78 */
{ NULL,                  NULL,                                          FALSE }, /* 79 */
{ NULL,                  NULL,                                          FALSE }, /* 80 */
{ NULL,                  NULL,                                          FALSE }, /* 81 */
{ NULL,                  NULL,                                          FALSE }, /* 82 */
{ NULL,                  NULL,                                          FALSE }, /* 83 */
{ NULL,                  NULL,                                          FALSE }, /* 84 */
{ NULL,                  NULL,                                          FALSE }, /* 85 */
{ NULL,                  NULL,                                          FALSE }, /* 86 */
{ NULL,                  NULL,                                          FALSE }, /* 87 */
{ NULL,                  NULL,                                          FALSE }, /* 88 */
{ NULL,                  NULL,                                          FALSE }, /* 89 */
{ NULL,                  NULL,                                          FALSE }, /* 90 */
{ NULL,                  NULL,                                          FALSE }, /* 91 */
{ NULL,                  NULL,                                          FALSE }, /* 92 */
{ NULL,                  NULL,                                          FALSE }, /* 93 */
{ NULL,                  NULL,                                          FALSE }, /* 94 */
{ NULL,                  NULL,                                          FALSE }, /* 95 */
{ NULL,                  NULL,                                          FALSE }, /* 96 */
{ NULL,                  NULL,                                          FALSE }, /* 97 */
{ NULL,                  NULL,                                          FALSE }, /* 98 */
{ NULL,                  NULL,                                          FALSE }, /* 99 */
{ NULL,                  NULL,                                          FALSE }, /* 100 */
{ NULL,                  NULL,                                          FALSE }, /* 101 */
{ NULL,                  NULL,                                          FALSE }, /* 102 */
{ NULL,                  NULL,                                          FALSE }, /* 103 */
{ NULL,                  NULL,                                          FALSE }, /* 104 */
{ NULL,                  NULL,                                          FALSE }, /* 105 */
{ NULL,                  NULL,                                          FALSE }, /* 106 */
{ NULL,                  NULL,                                          FALSE }, /* 107 */
{ NULL,                  NULL,                                          FALSE }, /* 108 */
{ NULL,                  NULL,                                          FALSE }, /* 109 */
{ NULL,                  NULL,                                          FALSE }, /* 110 */
{ NULL,                  NULL,                                          FALSE }, /* 111 */
{ NULL,                  NULL,                                          FALSE }, /* 112 */
{ NULL,                  NULL,                                          FALSE }, /* 113 */
{ NULL,                  NULL,                                          FALSE }, /* 114 */
{ NULL,                  NULL,                                          FALSE }, /* 115 */
{ NULL,                  NULL,                                          FALSE }, /* 116 */
{ NULL,                  NULL,                                          FALSE }, /* 117 */
{ NULL,                  NULL,                                          FALSE }, /* 118 */
{ NULL,                  NULL,                                          FALSE }, /* 119 */
{ NULL,                  NULL,                                          FALSE }, /* 120 */
{ NULL,                  NULL,                                          FALSE }, /* 121 */
{ NULL,                  NULL,                                          FALSE }, /* 122 */
{ NULL,                  NULL,                                          FALSE }, /* 123 */
{ NULL,                  NULL,                                          FALSE }, /* 124 */
{ NULL,                  NULL,                                          FALSE }, /* 125 */
{ NULL,                  NULL,                                          FALSE }, /* 126 */
{ NULL,                  NULL,                                          FALSE }, /* 127 */
{ __T("birth_maximize"), __T("Maximise effect of race/class bonuses"),  TRUE },  /* 128 */
{ __T("birth_randarts"), __T("Randomise the artifacts (except a very few)"), FALSE }, /* 129 */
{ __T("birth_money"),    __T("Start with more money instead of equipment"), FALSE }, /* 130 */
{ __T("birth_ironman"),  __T("Restrict the use of stairs/recall"),      FALSE }, /* 131 */
{ __T("birth_no_stores"), __T("Restrict the use of stores/home"),       FALSE }, /* 132 */
{ __T("birth_no_artifacts"), __T("Restrict creation of artifacts"),     FALSE }, /* 133 */
{ __T("birth_no_stacking"), __T("Don't stack objects on the floor"),    FALSE }, /* 134 */
{ __T("birth_no_preserve"), __T("Lose artifacts when leaving level"),   FALSE }, /* 135 */
{ __T("birth_no_stairs"), __T("Don't generate connected stairs"),       FALSE }, /* 136 */
{ __T("birth_feelings"), __T("Don't show level feelings"),              FALSE }, /* 137 */
{ NULL,                  NULL,                                          FALSE }, /* 138 */
{ NULL,                  NULL,                                          FALSE }, /* 139 */
{ NULL,                  NULL,                                          FALSE }, /* 140 */
{ __T("birth_ai_sound"), __T("Monsters chase current location"),        TRUE },  /* 141 */
{ __T("birth_ai_smell"), __T("Monsters chase recent locations"),        TRUE },  /* 142 */
{ __T("birth_ai_packs"), __T("Monsters act smarter in groups"),         TRUE },  /* 143 */
{ __T("birth_ai_learn"), __T("Monsters learn from their mistakes"),     FALSE }, /* 144 */
{ __T("birth_ai_cheat"), __T("Monsters exploit player's weaknesses"),   FALSE }, /* 145 */
{ __T("birth_ai_smart"), __T("Monsters behave more intelligently (broken)"), FALSE }, /* 146 */
{ NULL,                  NULL,                                          FALSE }, /* 147 */
{ NULL,                  NULL,                                          FALSE }, /* 148 */
{ NULL,                  NULL,                                          FALSE }, /* 149 */
{ NULL,                  NULL,                                          FALSE }, /* 150 */
{ NULL,                  NULL,                                          FALSE }, /* 151 */
{ NULL,                  NULL,                                          FALSE }, /* 152 */
{ NULL,                  NULL,                                          FALSE }, /* 153 */
{ NULL,                  NULL,                                          FALSE }, /* 154 */
{ NULL,                  NULL,                                          FALSE }, /* 155 */
{ NULL,                  NULL,                                          FALSE }, /* 156 */
{ NULL,                  NULL,                                          FALSE }, /* 157 */
{ NULL,                  NULL,                                          FALSE }, /* 158 */
{ NULL,                  NULL,                                          FALSE }, /* 159 */
{ __T("cheat_peek"),     __T("Cheat: Peek into object creation"),       FALSE }, /* 160 */
{ __T("cheat_hear"),     __T("Cheat: Peek into monster creation"),      FALSE }, /* 161 */
{ __T("cheat_room"),     __T("Cheat: Peek into dungeon creation"),      FALSE }, /* 162 */
{ __T("cheat_xtra"),     __T("Cheat: Peek into something else"),        FALSE }, /* 163 */
{ __T("cheat_know"),     __T("Cheat: Know complete monster info"),      FALSE }, /* 164 */
{ __T("cheat_live"),     __T("Cheat: Allow player to avoid death"),     FALSE }, /* 165 */
{ NULL,                  NULL,                                          FALSE }, /* 166 */
{ NULL,                  NULL,                                          FALSE }, /* 167 */
{ NULL,                  NULL,                                          FALSE }, /* 168 */
{ NULL,                  NULL,                                          FALSE }, /* 169 */
{ NULL,                  NULL,                                          FALSE }, /* 170 */
{ NULL,                  NULL,                                          FALSE }, /* 171 */
{ NULL,                  NULL,                                          FALSE }, /* 172 */
{ NULL,                  NULL,                                          FALSE }, /* 173 */
{ NULL,                  NULL,                                          FALSE }, /* 174 */
{ NULL,                  NULL,                                          FALSE }, /* 175 */
{ NULL,                  NULL,                                          FALSE }, /* 176 */
{ NULL,                  NULL,                                          FALSE }, /* 177 */
{ NULL,                  NULL,                                          FALSE }, /* 178 */
{ NULL,                  NULL,                                          FALSE }, /* 179 */
{ NULL,                  NULL,                                          FALSE }, /* 180 */
{ NULL,                  NULL,                                          FALSE }, /* 181 */
{ NULL,                  NULL,                                          FALSE }, /* 182 */
{ NULL,                  NULL,                                          FALSE }, /* 183 */
{ NULL,                  NULL,                                          FALSE }, /* 184 */
{ NULL,                  NULL,                                          FALSE }, /* 185 */
{ NULL,                  NULL,                                          FALSE }, /* 186 */
{ NULL,                  NULL,                                          FALSE }, /* 187 */
{ NULL,                  NULL,                                          FALSE }, /* 188 */
{ NULL,                  NULL,                                          FALSE }, /* 189 */
{ NULL,                  NULL,                                          FALSE }, /* 190 */
{ NULL,                  NULL,                                          FALSE }, /* 191 */
{ __T("adult_maximize"), __T("Maximize effect of race/class bonuses"),  TRUE },  /* 192 */
{ __T("adult_randarts"), __T("Randomize some of the artifacts (beta)"), FALSE }, /* 193 */
{ NULL,                  NULL,                                          FALSE }, /* 194 */
{ __T("adult_ironman"),       __T("Restrict the use of stairs/recall"), FALSE }, /* 195 */
{ __T("adult_no_stores"),     __T("Restrict the use of stores/home"),   FALSE }, /* 196 */
{ __T("adult_no_artifacts"),  __T("Restrict creation of artifacts"),    FALSE }, /* 197 */
{ __T("adult_no_stacking"),   __T("Don't stack objects on the floor"),  FALSE }, /* 198 */
{ __T("adult_no_preserve"),   __T("Lose artifacts when leaving level"), FALSE }, /* 199 */
{ __T("adult_no_stairs"),     __T("Don't generate connected stairs"),   FALSE }, /* 200 */
{ NULL,                  NULL,                                          FALSE }, /* 201 */
{ NULL,                  NULL,                                          FALSE }, /* 202 */
{ NULL,                  NULL,                                          FALSE }, /* 203 */
{ NULL,                  NULL,                                          FALSE }, /* 204 */
{ __T("adult_ai_sound"), __T("Adult: Monsters chase current location"), TRUE },  /* 205 */
{ __T("adult_ai_smell"), __T("Adult: Monsters chase recent locations"), TRUE },  /* 206 */
{ __T("adult_ai_packs"), __T("Adult: Monsters act smarter in groups"),  TRUE },  /* 207 */
{ __T("adult_ai_learn"), __T("Adult: Monsters learn from their mistakes"), FALSE }, /* 208 */
{ __T("adult_ai_cheat"), __T("Adult: Monsters exploit players weaknesses"), FALSE }, /* 209 */
{ __T("adult_ai_smart"), __T("Adult: Monsters behave more intelligently (broken)"), FALSE }, /* 210 */
{ NULL,                  NULL,                                          FALSE }, /* 211 */
{ NULL,                  NULL,                                          FALSE }, /* 212 */
{ NULL,                  NULL,                                          FALSE }, /* 213 */
{ NULL,                  NULL,                                          FALSE }, /* 214 */
{ NULL,                  NULL,                                          FALSE }, /* 215 */
{ NULL,                  NULL,                                          FALSE }, /* 216 */
{ NULL,                  NULL,                                          FALSE }, /* 217 */
{ NULL,                  NULL,                                          FALSE }, /* 218 */
{ NULL,                  NULL,                                          FALSE }, /* 219 */
{ NULL,                  NULL,                                          FALSE }, /* 220 */
{ NULL,                  NULL,                                          FALSE }, /* 221 */
{ NULL,                  NULL,                                          FALSE }, /* 222 */
{ NULL,                  NULL,                                          FALSE }, /* 223 */
{ __T("score_peek"),          __T("Score: Peek into object creation"),  FALSE }, /* 224 */
{ __T("score_hear"),          __T("Score: Peek into monster creation"), FALSE }, /* 225 */
{ __T("score_room"),          __T("Score: Peek into dungeon creation"), FALSE }, /* 226 */
{ __T("score_xtra"),          __T("Score: Peek into something else"),   FALSE }, /* 227 */
{ __T("score_know"),          __T("Score: Know complete monster info"), FALSE }, /* 228 */
{ __T("score_live"),          __T("Score: Allow player to avoid death"), FALSE }, /* 229 */
{ NULL,                  NULL,                                          FALSE }, /* 230 */
{ NULL,                  NULL,                                          FALSE }, /* 231 */
{ NULL,                  NULL,                                          FALSE }, /* 232 */
{ NULL,                  NULL,                                          FALSE }, /* 233 */
{ NULL,                  NULL,                                          FALSE }, /* 234 */
{ NULL,                  NULL,                                          FALSE }, /* 235 */
{ NULL,                  NULL,                                          FALSE }, /* 236 */
{ NULL,                  NULL,                                          FALSE }, /* 237 */
{ NULL,                  NULL,                                          FALSE }, /* 238 */
{ NULL,                  NULL,                                          FALSE }, /* 239 */
{ NULL,                  NULL,                                          FALSE }, /* 240 */
{ NULL,                  NULL,                                          FALSE }, /* 241 */
{ NULL,                  NULL,                                          FALSE }, /* 242 */
{ NULL,                  NULL,                                          FALSE }, /* 243 */
{ NULL,                  NULL,                                          FALSE }, /* 244 */
{ NULL,                  NULL,                                          FALSE }, /* 245 */
{ NULL,                  NULL,                                          FALSE }, /* 246 */
{ NULL,                  NULL,                                          FALSE }, /* 247 */
{ NULL,                  NULL,                                          FALSE }, /* 248 */
{ NULL,                  NULL,                                          FALSE }, /* 249 */
{ NULL,                  NULL,                                          FALSE }, /* 250 */
{ NULL,                  NULL,                                          FALSE }, /* 251 */
{ NULL,                  NULL,                                          FALSE }, /* 252 */
{ NULL,                  NULL,                                          FALSE }, /* 253 */
{ NULL,                  NULL,                                          FALSE }, /* 254 */
{ NULL,                  NULL,                                          FALSE }, /* 255 */
};

/* Accessor functions */
const _TCHAR *option_name(int opt)
{
	if (opt >= OPT_MAX) return NULL;
	return options[opt].name;
}

const _TCHAR *option_desc(int opt)
{
	if (opt >= OPT_MAX) return NULL;
	return options[opt].description;
}

/* Setup functions */
void option_set(int opt, bool on)
{
	op_ptr->opt[opt] = on;
}

void option_set_defaults(void)
{
	size_t opt;

	for (opt = 0; opt < OPT_MAX; opt++)
		op_ptr->opt[opt] = options[opt].normal;
}
