field_highlight()

Purpose

Highlights a menu option

Old name

#define highlight_field field_highlight

Syntax

int field_highlight(mapnr, fieldnr)

Parameters

int mapnr

Number of map containing field

 

int fieldnr

Number of field in menu to highlight

Description

The field_highlight() function temporarily changes the colour of the selected field to that for a field selected in a menu. The next time the screen is updated, the highlighting disappears.

field_highlight() is used in the construction of menu functions like map_bar_choose() and field_choose(). Because it returns FALSE if the field does not exist, it is used to check that a valid option exists for the key pressed.

Return values

Returns FALSE if field does not exist, otherwise TRUE

See also

field_force_colour(), field_colour()

Example

askm_special() has a good example using field_highlight() to check for valid key input