Atrinik Client  4.0
Enumerations | Functions | Variables
skills.c File Reference
#include <global.h>
#include <toolkit/string.h>

Go to the source code of this file.

Enumerations

enum  { BUTTON_CLOSE, BUTTON_HELP, BUTTON_NUM }
 

Functions

void skills_init (void)
 
void skills_deinit (void)
 
static void list_post_column (list_struct *list, uint32_t row, uint32_t col)
 
static void list_row_color (list_struct *list, int row, SDL_Rect box)
 
static void skill_list_reload (void)
 
int skill_find (const char *name, size_t *id)
 
int skill_find_object (object *op, size_t *id)
 
skill_entry_structskill_get (size_t id)
 
void skills_update (object *op, uint8_t level, int64_t xp, const char *msg)
 
void skills_remove (object *op)
 
static void widget_draw (widgetdata *widget)
 
static void widget_background (widgetdata *widget, int draw)
 
static int widget_event (widgetdata *widget, SDL_Event *event)
 
static void widget_deinit (widgetdata *widget)
 
void widget_skills_init (widgetdata *widget)
 

Variables

static button_struct buttons [BUTTON_NUM]
 
static skill_entry_struct ** skill_list
 
static size_t skill_list_num
 
static list_structlist_skills = NULL
 
static size_t selected_skill
 

Detailed Description

Implements skills type widgets.

Author
Alex Tokar

Definition in file skills.c.

Function Documentation

static void list_post_column ( list_struct list,
uint32_t  row,
uint32_t  col 
)
static

Callback function to call after drawing one column in a list.

Parameters
listThe list.
rowThe row of the column that was drawn.
colThe column.

Definition at line 90 of file skills.c.

static void list_row_color ( list_struct list,
int  row,
SDL_Rect  box 
)
static

Function that will color the specified row.

Parameters
listList.
rowRow number, 0-[max visible rows].
boxContains base x/y/width/height information to use.

Definition at line 173 of file skills.c.

int skill_find ( const char *  name,
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]idWill contain the skill's ID.
Returns
1 if the skill was found, 0 otherwise.

Definition at line 217 of file skills.c.

skill_entry_struct* skill_get ( size_t  id)

Get skill from the skill_list structure.

Parameters
idSkill ID.
Returns
The skill.

Definition at line 246 of file skills.c.

static void skill_list_reload ( void  )
static

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

Definition at line 181 of file skills.c.

void skills_deinit ( void  )

Deinitialize skills system.

Definition at line 76 of file skills.c.

void skills_init ( void  )

Initialize skills system.

Definition at line 66 of file skills.c.

static void widget_background ( widgetdata widget,
int  draw 
)
static

Definition at line 353 of file skills.c.

static void widget_deinit ( widgetdata widget)
static

Definition at line 429 of file skills.c.

static void widget_draw ( widgetdata widget)
static

Definition at line 300 of file skills.c.

static int widget_event ( widgetdata widget,
SDL_Event *  event 
)
static

Definition at line 372 of file skills.c.

void widget_skills_init ( widgetdata widget)

Initialize one skills widget.

Definition at line 444 of file skills.c.

Variable Documentation

button_struct buttons[BUTTON_NUM]
static

Button buffer.

Definition at line 45 of file skills.c.

list_struct* list_skills = NULL
static

The skills list.

Definition at line 57 of file skills.c.

size_t selected_skill
static

Currently selected skill in the skills list.

Definition at line 61 of file skills.c.

skill_entry_struct** skill_list
static

The skills list.

Definition at line 49 of file skills.c.

size_t skill_list_num
static

Number of skills contained in skill_list.

Definition at line 53 of file skills.c.