Angband
Data Structures | Macros | Functions | Variables
option.c File Reference

Options table and definitions. More...

#include "angband.h"
#include "init.h"
#include "option.h"
#include "list-options.h"

Data Structures

struct  option_entry
 

Macros

#define OP(a, b, c, d)   { #a, b, OP_##c, d },
 

Functions

const char * option_name (int opt)
 Given an option index, return its name. More...
 
const char * option_desc (int opt)
 Given an option index, return its description. More...
 
int option_type (int opt)
 Determine the type of option (score, birth etc) More...
 
static bool option_is_cheat (int opt)
 
bool option_set (const char *name, int val)
 Set an option, return true if successful. More...
 
void options_init_cheat (void)
 Set score options from cheat options. More...
 
void options_init_defaults (struct player_options *opts)
 Set player default options. More...
 
void init_options (void)
 Initialise options package. More...
 

Variables

int option_page [OPT_PAGE_MAX][OPT_PAGE_PER] = { {0} }
 Option screen interface. More...
 
static struct option_entry options [OPT_MAX]
 
struct init_module options_module
 

Detailed Description

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.

Macro Definition Documentation

◆ OP

#define OP (   a,
  b,
  c,
 
)    { #a, b, OP_##c, d },

Function Documentation

◆ init_options()

void init_options ( void  )

Initialise options package.

References OPT_PAGE_MAX, OPT_PAGE_PER, option_page, options, and option_entry::type.

◆ option_desc()

const char* option_desc ( int  opt)

Given an option index, return its description.

References option_entry::description, NULL, and options.

Referenced by option_toggle_display(), and write_character_dump().

◆ option_is_cheat()

static bool option_is_cheat ( int  opt)
static

References OP_CHEAT, and option_type().

Referenced by option_set(), and options_init_cheat().

◆ option_name()

const char* option_name ( int  opt)

Given an option index, return its name.

References option_entry::name, NULL, and options.

Referenced by option_toggle_display(), option_toggle_handle(), wr_options(), and write_character_dump().

◆ option_set()

bool option_set ( const char *  name,
int  val 
)

Set an option, return true if successful.

References player_options::opt, option_is_cheat(), options, player::opts, streq, and true.

Referenced by option_toggle_handle(), and rd_options().

◆ option_type()

int option_type ( int  opt)

Determine the type of option (score, birth etc)

References options, and option_entry::type.

Referenced by enter_score(), option_is_cheat(), option_toggle_handle(), and write_character_dump().

◆ options_init_cheat()

void options_init_cheat ( void  )

Set score options from cheat options.

Functions.

References i, player_options::opt, option_is_cheat(), and player::opts.

Referenced by do_cmd_accept_character().

◆ options_init_defaults()

void options_init_defaults ( struct player_options opts)

Set player default options.

References option_entry::normal, and options.

Referenced by init_player(), and test_effects().

Variable Documentation

◆ option_page

int option_page[OPT_PAGE_MAX][OPT_PAGE_PER] = { {0} }

Option screen interface.

Referenced by init_options(), and option_toggle_menu().

◆ options

struct option_entry options[OPT_MAX]
static

◆ options_module

struct init_module options_module
Initial value:
= {
.name = "options",
.init = init_options,
.cleanup = NULL
}
void init_options(void)
Initialise options package.
Definition: option.c:127
NULL
Definition: list-summon-types.h:18