Crossfire Client, Trunk  R18666
Data Structures | Defines | Functions | Variables
/home/leaf/crossfire/client/trunk/gtk-v2/src/stats.c File Reference
#include <assert.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
#include "client.h"
#include "main.h"
#include "image.h"
#include "gtk2proto.h"
Include dependency graph for stats.c:

Go to the source code of this file.

Data Structures

struct  StatWindow

Defines

#define STAT_BAR_HP   0
#define STAT_BAR_SP   1
#define STAT_BAR_GRACE   2
#define STAT_BAR_FOOD   3
#define STAT_BAR_EXP   4
#define MAX_STAT_BARS   5
#define STYLE_NORMAL   0
#define STYLE_LOW   1
#define STYLE_SUPER   2
#define STYLE_GRAD_NORMAL   3
#define STYLE_GRAD_LOW   4
#define STYLE_GRAD_SUPER   5
#define NUM_STYLES   6
#define SKILL_BOXES_X   6
#define SKILL_BOXES_Y   17
#define PROTECTION_BOXES_X   6
#define PROTECTION_BOXES_Y   6

Functions

void stats_get_styles (void)
void stats_init (GtkWidget *window_root)
void update_stat (int stat_no, sint64 max_stat, sint64 current_stat, sint64 statbar_max, sint64 statbar_stat, int can_alert)
void draw_message_window (int redraw)
void draw_stats (int redraw)
void clear_stat_mapping (void)

Variables

const char *const rcsid_gtk2_stats_c = "$Id: stats.c 14240 2011-01-12 06:31:21Z mwedel $"
GdkColor * bar_colors [MAX_STAT_BARS][NUM_STYLES]
int need_mapping_update = 1

Detailed Description

Support for character statistics.

Definition in file stats.c.


Define Documentation

#define MAX_STAT_BARS   5

Definition at line 48 of file stats.c.

#define NUM_STYLES   6

Definition at line 64 of file stats.c.

#define PROTECTION_BOXES_X   6

Definition at line 88 of file stats.c.

#define PROTECTION_BOXES_Y   6

Definition at line 89 of file stats.c.

#define SKILL_BOXES_X   6

Definition at line 85 of file stats.c.

#define SKILL_BOXES_Y   17

Definition at line 86 of file stats.c.

#define STAT_BAR_EXP   4

Definition at line 47 of file stats.c.

#define STAT_BAR_FOOD   3

Definition at line 46 of file stats.c.

#define STAT_BAR_GRACE   2

Definition at line 45 of file stats.c.

#define STAT_BAR_HP   0

Definition at line 43 of file stats.c.

#define STAT_BAR_SP   1

Definition at line 44 of file stats.c.

#define STYLE_GRAD_LOW   4

Definition at line 62 of file stats.c.

#define STYLE_GRAD_NORMAL   3

Definition at line 61 of file stats.c.

#define STYLE_GRAD_SUPER   5

Definition at line 63 of file stats.c.

#define STYLE_LOW   1

Definition at line 59 of file stats.c.

#define STYLE_NORMAL   0

Definition at line 58 of file stats.c.

#define STYLE_SUPER   2

Definition at line 60 of file stats.c.


Function Documentation

void clear_stat_mapping ( void  )

Definition at line 721 of file stats.c.

Here is the caller graph for this function:

void draw_message_window ( int  redraw)

Updates the stats pane - hp, sp, etc labels

Parameters:
redraw

Definition at line 423 of file stats.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_stats ( int  redraw)

Draws the stats window. If redraw is true, it means we need to redraw the entire thing, and not just do an updated

Definition at line 507 of file stats.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void stats_get_styles ( void  )

Gets the style information for the stat bars (only portion of the window right now that has custom style support.

Definition at line 126 of file stats.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void stats_init ( GtkWidget *  window_root)

Associate the XML-defined widgets with pointers by name reference.

Parameters:
*window_root

Definition at line 163 of file stats.c.

Here is the caller graph for this function:

void update_stat ( int  stat_no,
sint64  max_stat,
sint64  current_stat,
sint64  statbar_max,
sint64  statbar_stat,
int  can_alert 
)

Updates the stat bar and text display as it pertains to a specific stat.

Parameters:
stat_noThe stat number to update.
max_statThe normal maximum value this stat can have. Note that within game terms, the actual value can go above this via supercharging stats.
current_statcurrent value of the stat.
statbar_max
statbar_statthis is the stat value to use for drawing the statbar. For most stats, this is same as current stat, but for the exp bar, we basically want it to be a graph relative to amount for next level.
can_alertWhether this stat can go on alert when it gets low. It doesn't make sense for this to happen on exp (not really an alert if you gain a level). Note: This is no longer used with the new style code - if a stat shouldn't ever change color when it is low, the style should dictate that.

Definition at line 284 of file stats.c.

Here is the caller graph for this function:


Variable Documentation

Definition at line 78 of file stats.c.

Definition at line 118 of file stats.c.

const char* const rcsid_gtk2_stats_c = "$Id: stats.c 14240 2011-01-12 06:31:21Z mwedel $"

Definition at line 1 of file stats.c.