Atrinik Client 2.5
Functions | Variables
gui/skills.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static void list_handle_enter (list_struct *list)
static const char * list_text_color_hook (list_struct *list, const char *default_color, uint32 row, uint32 col)
static void skill_list_reload ()
static void button_repeat_func (button_struct *button)
void widget_skills_render (widgetdata *widget)
void widget_skills_mevent (widgetdata *widget, SDL_Event *event)
int skill_find (const char *name, size_t *type, size_t *id)
int skill_find_type_selected (const char *name, size_t *id)
skill_entry_structskill_get (size_t type, size_t id)
void skills_init ()
void skills_reload ()
void SkilllistCmd (char *data)

Variables

static skill_entry_struct ** skill_list [SKILL_LIST_TYPES]
static size_t skill_list_num [SKILL_LIST_TYPES]
static size_t skill_list_type = 0
static uint8 skill_list_filter_known
static button_struct button_type_left
static button_struct button_type_right
static button_struct button_close
static button_struct button_filter_known
static button_struct button_help

Detailed Description

Implements the skills widget.

Definition in file skills.c.


Function Documentation

static void button_repeat_func ( button_struct button) [static]

Handle button repeating (and actual pressing).

Parameters:
buttonThe button.

Definition at line 118 of file skills.c.

static void list_handle_enter ( list_struct list) [static]

Handle double click inside the skills list.

Parameters:
listThe skills list.

Definition at line 47 of file skills.c.

static const char* list_text_color_hook ( list_struct list,
const char *  default_color,
uint32  row,
uint32  col 
) [static]

Handle list::text_color_hook in the skills list.

Definition at line 61 of file skills.c.

int skill_find ( const char *  name,
size_t *  type,
size_t *  id 
)

Find a skill in the skill_list based on its name.

Partial skill names will be matched.

Parameters:
nameSkill name to find.
[out]typeWill contain the skill's type.
[out]idWill contain the skill's ID.
Returns:
1 if the skill was found, 0 otherwise.

Definition at line 327 of file skills.c.

int skill_find_type_selected ( const char *  name,
size_t *  id 
)

Find a skill in the skill_list based on its name, but only look inside the currently selected skill type list.

Partial skill names will be matched.

Parameters:
nameSkill name to find.
[out]idWill contain the skill's ID.
Returns:
1 if the skill was found, 0 otherwise.

Definition at line 351 of file skills.c.

skill_entry_struct* skill_get ( size_t  type,
size_t  id 
)

Get skill from the skill_list structure.

Parameters:
typeSkill type.
idSkill ID.
Returns:
The skill.

Definition at line 369 of file skills.c.

static void skill_list_reload ( ) [static]

Reload the skills list, due to a change of the skill type, for example.

Definition at line 76 of file skills.c.

void SkilllistCmd ( char *  data)

Skill list command. Used to update player's skill list.

Parameters:
dataThe incoming data

Definition at line 503 of file skills.c.

void skills_init ( )

Read skills from file.

Definition at line 376 of file skills.c.

void skills_reload ( )

Reload the icon IDs, as they may have changed due to an update.

Definition at line 487 of file skills.c.

void widget_skills_mevent ( widgetdata widget,
SDL_Event *  event 
)

Handle mouse events inside the skills widget.

Parameters:
widgetThe skills widget.
eventThe event to handle.

Definition at line 284 of file skills.c.

void widget_skills_render ( widgetdata widget)

Render the skill list widget.

Parameters:
widgetThe widget to render.

Definition at line 147 of file skills.c.


Variable Documentation

Button buffer.

Definition at line 42 of file skills.c.

skill_entry_struct** skill_list[SKILL_LIST_TYPES] [static]

The skill list.

Definition at line 33 of file skills.c.

If 1, only show known skills in the list of skills.

Definition at line 40 of file skills.c.

size_t skill_list_num[SKILL_LIST_TYPES] [static]

Number of skills contained in each skill type array in skill_list.

Definition at line 35 of file skills.c.

size_t skill_list_type = 0 [static]

Currently selected skill type.

Definition at line 38 of file skills.c.