Crossfire Client, Trunk  R20789
skills.c File Reference
#include "client.h"
#include <gtk/gtk.h>
#include "image.h"
#include "metaserver.h"
#include "main.h"
#include "gtk2proto.h"
+ Include dependency graph for skills.c:

Go to the source code of this file.

Enumerations

enum  { LIST_NAME, LIST_LEVEL, LIST_EXP, LIST_NEXTLEVEL }
 

Functions

void on_skill_close_clicked (GtkButton *button, gpointer user_data)
 
void on_skill_ready_clicked (GtkButton *button, gpointer user_data)
 
void on_skill_treeview_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
 
void on_skill_use_clicked (GtkButton *button, gpointer user_data)
 
void on_skills_activate (GtkMenuItem *menuitem, gpointer user_data)
 
static gboolean skill_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 
void trigger_skill (GtkTreeIter iter, GtkTreeModel *model, int use_skill)
 
void update_skill_information (void)
 

Variables

static int has_init = 0
 
static GtkWidget * skill_ready
 
static GtkTreeSelection * skill_selection
 
static GtkListStore * skill_store
 
static GtkWidget * skill_treeview
 
static GtkWidget * skill_use
 
static GtkWidget * skill_window
 

Detailed Description

Handles The callbacks for the skill window.

Definition in file skills.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LIST_NAME 
LIST_LEVEL 
LIST_EXP 
LIST_NEXTLEVEL 

Definition at line 32 of file skills.c.

Function Documentation

◆ on_skill_close_clicked()

void on_skill_close_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters
button
user_data

Definition at line 267 of file skills.c.

References skill_window.

Referenced by on_skills_activate().

+ Here is the caller graph for this function:

◆ on_skill_ready_clicked()

void on_skill_ready_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters
button
user_data

Definition at line 238 of file skills.c.

References skill_selection, skill_window, and trigger_skill().

Referenced by on_skills_activate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_skill_treeview_row_activated()

void on_skill_treeview_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
)
Parameters
treeview
path
column
user_data

Definition at line 221 of file skills.c.

References skill_window, and trigger_skill().

Referenced by on_skills_activate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_skill_use_clicked()

void on_skill_use_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters
button
user_data

Definition at line 253 of file skills.c.

References skill_selection, and trigger_skill().

Referenced by on_skills_activate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_skills_activate()

void on_skills_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)
Parameters
menuitem
user_data

Definition at line 106 of file skills.c.

References dialog_xml, has_init, LIST_EXP, LIST_LEVEL, LIST_NAME, LIST_NEXTLEVEL, on_skill_close_clicked(), on_skill_ready_clicked(), on_skill_treeview_row_activated(), on_skill_use_clicked(), skill_ready, skill_selection, skill_selection_func(), skill_store, skill_treeview, skill_use, skill_window, and update_skill_information().

Referenced by init_menu_items().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_selection_func()

static gboolean skill_selection_func ( GtkTreeSelection *  selection,
GtkTreeModel *  model,
GtkTreePath *  path,
gboolean  path_currently_selected,
gpointer  userdata 
)
static

Used if a user just single clicks on an entry - at which point, we enable the cast & invoke buttons.

Parameters
selection
model
path
path_currently_selected
userdata

Definition at line 46 of file skills.c.

References skill_ready, and skill_use.

Referenced by on_skills_activate().

+ Here is the caller graph for this function:

◆ trigger_skill()

void trigger_skill ( GtkTreeIter  iter,
GtkTreeModel *  model,
int  use_skill 
)

This is where we actually do something with the skill. model and iter tell us which skill we want to trigger, use_skill is 1 to use the skill, 0 to ready it.

Parameters
iter
model
use_skill

Definition at line 197 of file skills.c.

References LIST_NAME, LOG(), LOG_ERROR, MAX_BUF, and send_command().

Referenced by on_skill_ready_clicked(), on_skill_treeview_row_activated(), and on_skill_use_clicked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_skill_information()

void update_skill_information ( void  )

Called whenever the skill window is opened or a stats packet is received. If the skills window has been created and is currently visible, it rebuilds the list store otherwise nothing happens, because it will be called again next time the window is opened anyway.

Definition at line 62 of file skills.c.

References cpl, dialog_xml, exp_table, exp_table_max, has_init, LIST_EXP, LIST_LEVEL, LIST_NAME, LIST_NEXTLEVEL, MAX_BUF, MAX_SKILL, name, Stat_struct::skill_exp, Stat_struct::skill_level, skill_mapping, skill_store, Player_Struct::stats, and NameMapping::value.

Referenced by draw_stats(), and on_skills_activate().

+ Here is the caller graph for this function:

Variable Documentation

◆ has_init

int has_init = 0
static

Definition at line 34 of file skills.c.

Referenced by on_skills_activate(), and update_skill_information().

◆ skill_ready

GtkWidget * skill_ready
static

Definition at line 28 of file skills.c.

Referenced by on_skills_activate(), and skill_selection_func().

◆ skill_selection

GtkTreeSelection* skill_selection
static

Definition at line 30 of file skills.c.

Referenced by on_skill_ready_clicked(), on_skill_use_clicked(), and on_skills_activate().

◆ skill_store

GtkListStore* skill_store
static

Definition at line 29 of file skills.c.

Referenced by on_skills_activate(), and update_skill_information().

◆ skill_treeview

GtkWidget * skill_treeview
static

Definition at line 28 of file skills.c.

Referenced by on_skills_activate().

◆ skill_use

GtkWidget * skill_use
static

Definition at line 28 of file skills.c.

Referenced by on_skills_activate(), and skill_selection_func().

◆ skill_window

GtkWidget* skill_window
static