Atrinik Client  4.0
Data Structures | Macros | Typedefs | Functions | Variables
stat.c File Reference
#include <global.h>
#include <toolkit/string.h>

Go to the source code of this file.

Data Structures

struct  widget_stat
 

Macros

#define SPHERE_PADDING   2
 

Typedefs

typedef struct widget_stat widget_stat_t
 

Functions

static bool stat_get_data (widgetdata *widget, int64_t *curr, int64_t *max, double *regen)
 
static void widget_draw (widgetdata *widget)
 
static int widget_event (widgetdata *widget, SDL_Event *event)
 
static void widget_deinit (widgetdata *widget)
 
static int widget_load (widgetdata *widget, const char *keyword, const char *parameter)
 
static void widget_save (widgetdata *widget, FILE *fp, const char *padding)
 
static void menu_stat_display_change (widgetdata *widget, widgetdata *menuitem, SDL_Event *event)
 
static void menu_stat_display (widgetdata *widget, widgetdata *menuitem, SDL_Event *event)
 
static int widget_menu_handle (widgetdata *widget, SDL_Event *event)
 
void widget_stat_init (widgetdata *widget)
 

Variables

static const char *const display_modes []
 

Detailed Description

Implements stat type widgets.

Author
Alex Tokar

Definition in file stat.c.

Typedef Documentation

typedef struct widget_stat widget_stat_t

Structure used for the stat widget data.

Function Documentation

static bool stat_get_data ( widgetdata widget,
int64_t *  curr,
int64_t *  max,
double *  regen 
)
static

Get data for the stat widget.

Parameters
widgetThe widget.
[out]currWill contain the current stat value.
[out]maxWill contain the maximum stat value.
[out]regenWill contain the regen speed of the stat.
Returns
True on success, false on failure.

Definition at line 59 of file stat.c.

static void widget_deinit ( widgetdata widget)
static

Definition at line 211 of file stat.c.

static void widget_draw ( widgetdata widget)
static

Definition at line 89 of file stat.c.

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

Definition at line 180 of file stat.c.

static int widget_load ( widgetdata widget,
const char *  keyword,
const char *  parameter 
)
static

Definition at line 218 of file stat.c.

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

Definition at line 268 of file stat.c.

static void widget_save ( widgetdata widget,
FILE *  fp,
const char *  padding 
)
static

Definition at line 231 of file stat.c.

void widget_stat_init ( widgetdata widget)

Initialize one stat widget.

Parameters
widgetThe widget to initialize.

Definition at line 282 of file stat.c.

Variable Documentation

const char* const display_modes[]
static
Initial value:
= {
"Sphere", "Bar", "Text"
}

Possible display modes of the stat widget.

Definition at line 45 of file stat.c.