Crossfire Client, Branch
R11627
|
Handles spell related functionality. More...
#include <gtk/gtk.h>
#include <glade/glade.h>
#include "client.h"
#include "image.h"
#include "gtk2proto.h"
#include "metaserver.h"
#include "main.h"
Go to the source code of this file.
Enumerations | |
enum | { LIST_IMAGE, LIST_NAME, LIST_LEVEL, LIST_TIME, LIST_COST, LIST_DAMAGE, LIST_SKILL, LIST_PATH, LIST_DESCRIPTION, LIST_BACKGROUND, LIST_MAX_SP, LIST_TAG, LIST_FOREGROUND, LIST_FONT } |
enum | Styles { Style_Magical = 0, Style_Cursed, Style_Unpaid, Style_Locked, Style_Applied, Style_Last, Style_Attuned, Style_Repelled, Style_Denied, Style_Normal, Style_Last } |
Functions | |
void | on_spell_cast_clicked (GtkButton *button, gpointer user_data) |
void | on_spell_close_clicked (GtkButton *button, gpointer user_data) |
void | on_spell_invoke_clicked (GtkButton *button, gpointer user_data) |
void | on_spell_treeview_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) |
void | on_spells_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | spell_get_styles (void) |
Gets the style information for the inventory windows. | |
static gboolean | spell_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata) |
Used if a user just single clicks on an entry - at which point, we enable the cast & invoke buttons. | |
void | update_spell_information (void) |
Variables | |
static int | has_init = 0 |
const char *const | rcsid_gtk2_spells_c = "$Id: spells.c 9201 2008-06-01 17:32:45Z anmaster $" |
static GtkWidget * | spell_cast |
static GtkWidget * | spell_eventbox [Style_Last] |
static GtkWidget * | spell_invoke |
static GtkWidget * | spell_label [Style_Last] |
static GtkWidget * | spell_options |
static GtkTreeSelection * | spell_selection |
static GtkListStore * | spell_store |
static GtkStyle * | spell_styles [Style_Last] |
Actual styles as loaded. | |
static GtkWidget * | spell_treeview |
static GtkWidget * | spell_window |
static const char * | Style_Names [Style_Last] |
The name of these styles in the rc * file. |
Handles spell related functionality.
Definition in file spells.c.
anonymous enum |
enum Styles |
void on_spell_cast_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 397 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, send_command(), spell_options, and spell_selection.
Referenced by on_spells_activate().
void on_spell_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 456 of file spells.c.
References spell_window.
Referenced by on_spells_activate().
void on_spell_invoke_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 427 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, send_command(), spell_options, and spell_selection.
Referenced by on_spells_activate().
void on_spell_treeview_row_activated | ( | GtkTreeView * | treeview, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) |
treeview | |
path | |
column | |
user_data |
Definition at line 367 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, and send_command().
Referenced by on_spells_activate().
void on_spells_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
menuitem | |
user_data |
Definition at line 198 of file spells.c.
References dialog_xml, FALSE, has_init, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, LIST_LEVEL, LIST_MAX_SP, LIST_NAME, LIST_SKILL, on_spell_cast_clicked(), on_spell_close_clicked(), on_spell_invoke_clicked(), on_spell_treeview_row_activated(), spell_cast, spell_eventbox, spell_get_styles(), spell_invoke, spell_label, spell_options, spell_selection, spell_selection_func(), spell_store, spell_treeview, spell_window, Style_Attuned, Style_Denied, Style_Normal, Style_Repelled, TRUE, and update_spell_information().
Referenced by enable_menu_items().
void spell_get_styles | ( | void | ) |
Gets the style information for the inventory windows.
This is a separate function because if the user changes styles, it can be nice to re-load the configuration. The style for the inventory/look is a bit special. That is because with gtk, styles are widget wide - all rows in the widget would use the same style. We want to adjust the styles based on other attributes.
Definition at line 72 of file spells.c.
References LOG(), LOG_INFO, spell_styles, Style_Last, and Style_Names.
Referenced by load_theme(), and on_spells_activate().
static gboolean spell_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.
selection | |
model | |
path | |
path_currently_selected | |
userdata |
Definition at line 104 of file spells.c.
References spell_cast, spell_invoke, and TRUE.
Referenced by on_spells_activate().
void update_spell_information | ( | void | ) |
Definition at line 119 of file spells.c.
References Stat_struct::attuned, background, cpl, Spell_struct::dam, Stat_struct::denied, font, foreground, Spell_struct::grace, has_init, Spell_struct::level, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, LIST_LEVEL, LIST_MAX_SP, LIST_NAME, LIST_SKILL, LIST_TAG, MAX_BUF, Spell_struct::message, Spell_struct::name, Spell_struct::next, Spell_struct::path, Stat_struct::repelled, Spell_struct::skill, Spell_struct::sp, spell_eventbox, spell_label, spell_store, spell_styles, Player_Struct::spelldata, Player_Struct::spells_updated, Player_Struct::stats, Style_Attuned, Style_Denied, Style_Last, Style_Normal, Style_Repelled, Spell_struct::tag, and text.
Referenced by do_timeout(), load_theme(), and on_spells_activate().
int has_init = 0 [static] |
Definition at line 63 of file spells.c.
Referenced by config_init(), get_metaserver(), info_get_styles(), inventory_get_styles(), on_spells_activate(), pickup_init(), stats_get_styles(), and update_spell_information().
const char* const rcsid_gtk2_spells_c = "$Id: spells.c 9201 2008-06-01 17:32:45Z anmaster $" |
GtkWidget * spell_cast [static] |
Definition at line 48 of file spells.c.
Referenced by on_spells_activate(), and spell_selection_func().
GtkWidget * spell_eventbox[Style_Last] [static] |
Definition at line 48 of file spells.c.
Referenced by on_spells_activate(), and update_spell_information().
GtkWidget * spell_invoke [static] |
Definition at line 48 of file spells.c.
Referenced by on_spells_activate(), and spell_selection_func().
GtkWidget * spell_label[Style_Last] [static] |
Definition at line 48 of file spells.c.
Referenced by on_spells_activate(), and update_spell_information().
GtkWidget * spell_options [static] |
Definition at line 48 of file spells.c.
Referenced by on_spell_cast_clicked(), on_spell_invoke_clicked(), and on_spells_activate().
GtkTreeSelection* spell_selection [static] |
Definition at line 51 of file spells.c.
Referenced by on_spell_cast_clicked(), on_spell_invoke_clicked(), and on_spells_activate().
GtkListStore* spell_store [static] |
Definition at line 50 of file spells.c.
Referenced by on_spells_activate(), and update_spell_information().
GtkStyle* spell_styles[Style_Last] [static] |
Actual styles as loaded.
May be null if no style found.
Definition at line 61 of file spells.c.
Referenced by spell_get_styles(), and update_spell_information().
GtkWidget * spell_treeview [static] |
Definition at line 48 of file spells.c.
Referenced by on_spells_activate().
GtkWidget* spell_window [static] |
Definition at line 48 of file spells.c.
Referenced by on_spell_close_clicked(), and on_spells_activate().
const char* Style_Names[Style_Last] [static] |
{ "spell_attuned", "spell_repelled", "spell_denied", "spell_normal" }
The name of these styles in the rc * file.
Definition at line 57 of file spells.c.
Referenced by spell_get_styles().