Angband
Typedefs | Functions
ui-entry.h File Reference

Declarations to link object/player properties to 2nd character screen. More...

#include "h-basic.h"

Go to the source code of this file.

Typedefs

typedef bool(* ui_entry_predicate) (const struct ui_entry *entry, void *closure)
 

Functions

int bind_object_property_to_ui_entry_by_name (const char *name, int type, int index, int value, bool have_value, bool isaux)
 Binds an object property, given by type and index, to a user interface entry configured in ui_entry.txt. More...
 
int bind_player_ability_to_ui_entry_by_name (const char *name, struct player_ability *ability, int value, bool have_value, bool isaux)
 Binds a player ability to to a user interface entry configured in ui_entry. More...
 
struct ui_entry_iteratorinitialize_ui_entry_iterator (ui_entry_predicate predicate, void *closure, const char *sortcategory)
 Constructs an iterator to enumerate all the user interface elements for which the given predicate returns true. More...
 
void release_ui_entry_iterator (struct ui_entry_iterator *i)
 Releases the resources allocated by a prior call to initialize_ui_entry_iterator. More...
 
void reset_ui_entry_iterator (struct ui_entry_iterator *i)
 Resets the given iterator to the position it ahd when returned by initialize_ui_entry_iterator. More...
 
int count_ui_entry_iterator (struct ui_entry_iterator *i)
 Returns the number of elements remaining to be iterated for the given iterator. More...
 
struct ui_entryadvance_ui_entry_iterator (struct ui_entry_iterator *i)
 Returns the user interface entry currently pointed to by the iterator and advances the iterator. More...
 
bool ui_entry_has_category (const struct ui_entry *entry, const char *name)
 Returns true if the given user interface entry was configured in ui_entry.txt to be part of the category with the given name. More...
 
void get_ui_entry_label (const struct ui_entry *entry, int length, bool pad_left, wchar_t *label)
 Fills label with length characters, including a terminating null, of a label for a user interface entry configured in ui_entry.txt. More...
 
int get_ui_entry_combiner_index (const struct ui_entry *entry)
 Returns the combiner index, suitable as the first argument to ui_entry_combiner_get_funcs(), for the given user interface element. More...
 
int get_ui_entry_renderer_index (const struct ui_entry *entry)
 Returns the renderer index, suitable as the first argument to ui_entry_renderer_apply(), for the given user interface element. More...
 
bool is_ui_entry_for_known_rune (const struct ui_entry *entry, const struct player *p)
 Returns true if the properties/abilities bound to a user interface entry correspond to a known rune. More...
 
void compute_ui_entry_values_for_object (const struct ui_entry *entry, const struct object *obj, const struct player *p, struct cached_object_data **cache, int *val, int *auxval)
 
void compute_ui_entry_values_for_player (const struct ui_entry *entry, struct player *p, struct cached_player_data **cache, int *val, int *auxval)
 
void release_cached_object_data (struct cached_object_data *cache)
 
void release_cached_player_data (struct cached_player_data *cache)
 

Detailed Description

Declarations to link object/player properties to 2nd character screen.

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.

Typedef Documentation

◆ ui_entry_predicate

typedef bool(* ui_entry_predicate) (const struct ui_entry *entry, void *closure)

Function Documentation

◆ advance_ui_entry_iterator()

struct ui_entry* advance_ui_entry_iterator ( struct ui_entry_iterator i)

Returns the user interface entry currently pointed to by the iterator and advances the iterator.

References ui_entry_iterator::entries, and ui_entry_iterator::i.

Referenced by configure_char_sheet(), and initialize_summary().

◆ bind_object_property_to_ui_entry_by_name()

int bind_object_property_to_ui_entry_by_name ( const char *  name,
int  type,
int  index,
int  value,
bool  have_value,
bool  isaux 
)

Binds an object property, given by type and index, to a user interface entry configured in ui_entry.txt.

If name isn't configured in that file returns a nonzero value. Otherwise returns zero after binding the property. Currently, this is only used for some parts of the second character screen.

References bound_object_property::have_value, bound_object_property::index, index, bound_object_property::isaux, mem_alloc(), mem_free(), ui_entry::n_obj_prop, ui_entry::nalloc_obj_prop, ui_entry::obj_props, bound_object_property::type, type, ui_entry_search(), bound_object_property::value, value, and void().

Referenced by parse_object_property_bindui().

◆ bind_player_ability_to_ui_entry_by_name()

int bind_player_ability_to_ui_entry_by_name ( const char *  name,
struct player_ability ability,
int  value,
bool  have_value,
bool  isaux 
)

Binds a player ability to to a user interface entry configured in ui_entry.

If name isn't configured in that file returns a nonzero value. Otherwise returns zero after binding the ability. Currently, this is only used for some parts of the second character screen.

References bound_player_ability::ability, bound_player_ability::have_value, bound_player_ability::isaux, mem_alloc(), mem_free(), ui_entry::n_p_ability, ui_entry::nalloc_p_ability, ui_entry::p_abilities, ui_entry_search(), bound_player_ability::value, value, and void().

Referenced by finish_parse_player_prop().

◆ compute_ui_entry_values_for_object()

void compute_ui_entry_values_for_object ( const struct ui_entry entry,
const struct object obj,
const struct player p,
struct cached_object_data **  cache,
int val,
int auxval 
)

◆ compute_ui_entry_values_for_player()

void compute_ui_entry_values_for_player ( const struct ui_entry entry,
struct player p,
struct cached_player_data **  cache,
int val,
int auxval 
)

◆ count_ui_entry_iterator()

int count_ui_entry_iterator ( struct ui_entry_iterator i)

Returns the number of elements remaining to be iterated for the given iterator.

References ui_entry_iterator::i, and ui_entry_iterator::n.

Referenced by configure_char_sheet(), and initialize_summary().

◆ get_ui_entry_combiner_index()

int get_ui_entry_combiner_index ( const struct ui_entry entry)

Returns the combiner index, suitable as the first argument to ui_entry_combiner_get_funcs(), for the given user interface element.

References ui_entry::combiner_index.

◆ get_ui_entry_label()

void get_ui_entry_label ( const struct ui_entry entry,
int  length,
bool  pad_left,
wchar_t *  label 
)

Fills label with length characters, including a terminating null, of a label for a user interface entry configured in ui_entry.txt.

If the label is naturally shorter than the specified length, the label will be padded with spaces, either on the left if pad_left is true, or on the right if pad_left is false.

References ui_entry_iterator::i, ui_entry::label, MAX_SHORTENED, ui_entry_iterator::n, ui_entry::nlabel, ui_entry::nshortened, ui_entry::shortened_labels, text_mbstowcs(), and void().

Referenced by configure_char_sheet(), initialize_summary(), and prompt_for_easy_filter().

◆ get_ui_entry_renderer_index()

int get_ui_entry_renderer_index ( const struct ui_entry entry)

Returns the renderer index, suitable as the first argument to ui_entry_renderer_apply(), for the given user interface element.

References ui_entry::renderer_index.

Referenced by compute_player_and_equipment_values(), display_page(), display_player_sust_info(), and display_resistance_panel().

◆ initialize_ui_entry_iterator()

struct ui_entry_iterator* initialize_ui_entry_iterator ( ui_entry_predicate  predicate,
void closure,
const char *  sortcategory 
)

Constructs an iterator to enumerate all the user interface elements for which the given predicate returns true.

The iterator will present those elements in descending order of priority where the priority is that configured for the element in the category named sortcategory.

References category_for_cmp_desc_prio, cmp_desc_prio(), ui_entry_iterator::entries, ENTRY_FLAG_TEMPLATE_ONLY, flags, ui_entry_iterator::i, mem_alloc(), ui_entry_iterator::n, n_entry, and sort().

Referenced by configure_char_sheet(), and initialize_summary().

◆ is_ui_entry_for_known_rune()

bool is_ui_entry_for_known_rune ( const struct ui_entry entry,
const struct player p 
)

◆ release_cached_object_data()

void release_cached_object_data ( struct cached_object_data cache)

◆ release_cached_player_data()

void release_cached_player_data ( struct cached_player_data cache)

◆ release_ui_entry_iterator()

void release_ui_entry_iterator ( struct ui_entry_iterator i)

Releases the resources allocated by a prior call to initialize_ui_entry_iterator.

References ui_entry_iterator::entries, and mem_free().

Referenced by configure_char_sheet(), and initialize_summary().

◆ reset_ui_entry_iterator()

void reset_ui_entry_iterator ( struct ui_entry_iterator i)

Resets the given iterator to the position it ahd when returned by initialize_ui_entry_iterator.

References ui_entry_iterator::i.

◆ ui_entry_has_category()

bool ui_entry_has_category ( const struct ui_entry entry,
const char *  name 
)

Returns true if the given user interface entry was configured in ui_entry.txt to be part of the category with the given name.

Otherwise, returns false.

References ui_entry_search_categories().

Referenced by check_for_two_categories().