Crossfire Client, Trunk
|
Go to the source code of this file.
Functions | |
void | account_add_character_failure (char *message) |
void | account_creation_failure (char *message) |
void | account_login_failure (char *message) |
void | account_show_login (void) |
void | add_marked_text_to_pane (Info_Pane *pane, const char *message, int type, int subtype, int orig_color) |
void | add_style_to_textbuffer (Info_Pane *pane, GtkStyle *base_style) |
void | add_tags_to_textbuffer (Info_Pane *pane, GtkTextBuffer *textbuf) |
void | addsmooth (guint16 face, guint16 smooth_face) |
int | associate_cache_entry (Cache_Entry *ce, int pixnum) |
void | bind_key (char *params) |
void | choose_char_window_show () |
void | choose_character_init (void) |
void | clear_stat_mapping (void) |
void | client_pickup (guint32 pickup) |
void | client_tick (guint32 tick) |
void | close_container (item *op) |
void | command_show (const char *params) |
void | config_check () |
void | config_init (GtkWidget *window_root) |
void | config_load (void) |
int | create_and_rescale_image_from_data (Cache_Entry *ce, int pixmap_num, guint8 *rgba_data, int width, int height) |
void | create_character_window_hide () |
void | create_character_window_show () |
void | create_new_character_failure (char *message) |
void | create_opengl_map_image (guint8 *data, PixmapInfo *pi) |
void | create_opengl_question_mark (void) |
void | default_msgctrl_configuration (void) |
void | display_map_doneupdate (int redraw, int notice) |
int | display_mapscroll (int dx, int dy) |
void | do_new_image (guint8 *data, PixmapInfo *pi) |
void | draw_ext_info (int orig_color, int type, int subtype, const char *message) |
void | draw_lists (void) |
void | draw_look_list (void) |
void | draw_magic_map (void) |
void | draw_map (void) |
void | draw_message_window (int redraw) |
void | draw_prompt (const char *str) |
void | draw_stats (int redraw) |
void | drawquarterlightmap_sdl (int tl, int tr, int bl, int br, int width, int height, int startx, int starty, int endx, int endy, int destx, int desty) |
void | error_dialog (char *description, char *information) |
void | focusoutfunc (GtkWidget *widget, GdkEventKey *event, GtkWidget *window) |
void | get_map_image_size (int face, guint8 *w, guint8 *h) |
void | get_window_coord (GtkWidget *win, int *x, int *y, int *wx, int *wy, int *w, int *h) |
void | gtk_command_history (int direction) |
void | gtk_complete_command (void) |
void | hide_all_login_windows (void) |
void | image_update_download_status (int start, int end, int total) |
void | info_buffer_flush (const int id) |
void | info_buffer_init (void) |
void | info_buffer_tick (void) |
void | info_get_styles (void) |
void | info_init (GtkWidget *window_root) |
void | init_create_character_window () |
void | init_glx_opengl (GtkWidget *drawingarea) |
void | init_image_cache_data (void) |
void | init_menu_items () |
void | init_opengl (GtkWidget *drawingarea) |
int | init_sounds (void) |
void | init_theme () |
void | inventory_get_styles (void) |
void | inventory_init (GtkWidget *window_root) |
void | inventory_tick (void) |
void | item_event_container_clearing (item *container) |
void | item_event_item_changed (item *it) |
void | item_event_item_deleting (item *it) |
gboolean | keybinding_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata) |
void | keybindings_init (const char *character_name) |
void | keyfunc (GtkWidget *widget, GdkEventKey *event, GtkWidget *window) |
void | keyrelfunc (GtkWidget *widget, GdkEventKey *event, GtkWidget *window) |
void | keys_init (GtkWidget *window_root) |
void | load_msgctrl_configuration (void) |
void | load_theme (int reload) |
void | load_window_positions (GtkWidget *window_root) |
void | magic_map_flash_pos (void) |
int | main (int argc, char *argv[]) |
void | map_check_resize (void) |
void | map_init (GtkWidget *window_root) |
void | menu_clear (void) |
void | metaserver_show_prompt (void) |
void | metaserver_ui_init () |
void | msgctrl_init (GtkWidget *window_root) |
void | MusicCmd (const char *data, int len) |
void | my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
void | on_button_add_character_clicked (GtkButton *button, gpointer user_data) |
void | on_button_create_account_clicked (GtkButton *button, gpointer user_data) |
void | on_button_create_character_clicked (GtkButton *button, gpointer user_data) |
void | on_button_create_new_char_clicked (GtkButton *button, gpointer user_data) |
void | on_button_do_add_character_clicked (GtkButton *button, gpointer user_data) |
void | on_button_exit_client_clicked (GtkButton *button, gpointer user_data) |
void | on_button_go_metaserver_clicked (GtkButton *button, gpointer user_data) |
void | on_button_login_clicked (GtkButton *button, gpointer user_data) |
void | on_button_metaserver_quit_pressed (GtkButton *button, gpointer user_data) |
void | on_button_new_cancel_clicked (GtkButton *button, gpointer user_data) |
void | on_button_new_char_cancel_clicked (GtkButton *button, gpointer user_data) |
void | on_button_new_create_account_clicked (GtkButton *button, gpointer user_data) |
void | on_button_play_character_clicked (GtkButton *button, gpointer user_data) |
void | on_button_return_character_select_clicked (GtkButton *button, gpointer user_data) |
void | on_button_return_login_clicked (GtkButton *button, gpointer user_data) |
void | on_configure_activate (GtkWidget *menuitem, gpointer user_data) |
gboolean | on_drawingarea_magic_map_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) |
void | on_entry_account_name_activate (GtkEntry *entry, gpointer user_data) |
void | on_entry_account_password_activate (GtkEntry *entry, gpointer user_data) |
void | on_entry_character (GtkEntry *entry, gpointer user_data) |
void | on_entry_commands_activate (GtkEntry *entry, gpointer user_data) |
void | on_entry_new_account (GtkEntry *entry, gpointer user_data) |
void | on_entry_new_character_name (GtkEntry *entry, gpointer user_data) |
void | on_kb_scope_togglebutton_character_toggled (GtkToggleButton *toggle_button, gpointer user_data) |
void | on_kb_scope_togglebutton_global_toggled (GtkToggleButton *toggle_button, gpointer user_data) |
void | on_keybinding_button_bind_clicked (GtkButton *button, gpointer user_data) |
void | on_keybinding_button_clear_clicked (GtkButton *button, gpointer user_data) |
void | on_keybinding_button_close_clicked (GtkButton *button, gpointer user_data) |
void | on_keybinding_button_remove_clicked (GtkButton *button, gpointer user_data) |
void | on_keybinding_button_update_clicked (GtkButton *button, gpointer user_data) |
void | on_keybinding_checkbutton_any_clicked (GtkCheckButton *cb, gpointer user_data) |
gboolean | on_keybinding_entry_key_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data) |
void | on_keybindings_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_all_weapons_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_arrows_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_body_armor_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_boots_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_bows_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_cloaks_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_containers_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_dont_pickup_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_drinks_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_flesh_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_food_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_gloves_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_helmets_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_jewels_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_keys_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_magical_items_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_missile_weapons_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_normal_book_scrolls_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_not_cursed_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_potions_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_10_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_15_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_20_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_25_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_30_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_35_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_40_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_45_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_50_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_5_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_ratio_pickup_off_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_shields_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_skillscrolls_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_spellbooks_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_stop_before_pickup_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_valuables_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_menu_wands_rods_horns_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_metaserver_select_clicked (GtkButton *button, gpointer user_data) |
void | on_msgctrl_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_msgctrl_button_apply_clicked (GtkButton *button, gpointer user_data) |
void | on_msgctrl_button_close_clicked (GtkButton *button, gpointer user_data) |
void | on_msgctrl_button_defaults_clicked (GtkButton *button, gpointer user_data) |
void | on_msgctrl_button_load_clicked (GtkButton *button, gpointer user_data) |
void | on_msgctrl_button_save_clicked (GtkButton *button, gpointer user_data) |
void | on_save_window_position_activate (GtkMenuItem *menuitem, gpointer user_data) |
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) |
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_spell_window_size_allocate (GtkWidget *widget, gpointer user_data) |
void | on_spells_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | on_treeview_choose_character_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) |
gboolean | on_window_delete_event (GtkWidget *window, gpointer *user_data) |
void | on_window_destroy_event (GtkWidget *object, gpointer user_data) |
void | open_container (item *op) |
void | opengl_free_pixmap (PixmapInfo *pi) |
void | opengl_gen_map (int redraw) |
void | pickup_init (GtkWidget *window_root) |
void | play_sound_effect (gint8 x, gint8 y, guint8 dir, guint8 vol, guint8 type, const char *sound, const char *source) |
guint8 * | png_to_data (guint8 *data, int len, guint32 *width, guint32 *height) |
void | read_msgctrl_configuration (void) |
guint8 * | rescale_rgba_data (guint8 *data, int *width, int *height, int scale) |
void | reset_image_data (void) |
void | reset_keybinding_status (void) |
void | resize_map_window (int x, int y) |
cairo_surface_t * | rgba_to_cairo_surface (guint8 *data, int width, int height) |
GdkPixbuf * | rgba_to_gdkpixbuf (guint8 *data, int width, int height) |
void | save_defaults (void) |
void | save_msgctrl_configuration (void) |
void | save_winpos (void) |
void | sdl_gen_map (int redraw) |
int | sdl_mapscroll (int dx, int dy) |
void | set_text_tag_from_style (GtkTextTag *tag, GtkStyle *style, const GtkStyle *const base_style) |
void | set_weight_limit (guint32 wlim) |
void | show_main_client (void) |
void | Sound2Cmd (unsigned char *data, int len) |
void | spell_get_styles (void) |
void | start_login (int method) |
void | stats_get_styles (void) |
void | stats_init (GtkWidget *window_root) |
void | trigger_skill (GtkTreeIter iter, GtkTreeModel *model, int use_skill) |
void | unbind_key (const char *params) |
void | update_character_choose (const char *name, const char *class, const char *race, const char *face, const char *party, const char *map, int level, int faceno) |
void | update_keybinding_list (void) |
void | update_login_info (int type) |
void | update_msgctrl_configuration (void) |
void | update_skill_information (void) |
void | update_spell_information (void) |
void | update_stat (int stat_no, gint64 max_stat, gint64 current_stat, gint64 statbar_max, gint64 statbar_stat, int can_alert) |
void | x_set_echo (void) |
void account_add_character_failure | ( | char * | message | ) |
Handles a failure from the server - pretty basic - just throw up the message and let the user try again. This is a response to the 'failure accountaddplayer' command. Calling this account_add_character_failure may be a little bit of a misnomer, but all the other routines in this area refer to character, not player.
message | Message to display. Unlike other messages, the first word of this message should be an integer, which denotes if using the 'force' option would allow the user to override this. |
Definition at line 282 of file account.c.
References add_character_to_account(), entry_character_name, entry_character_password, and label_add_status.
void account_creation_failure | ( | char * | message | ) |
Handles a failure from the server - pretty basic - just throw up the message and let the user try again.
message |
Definition at line 692 of file account.c.
References label_create_account_status.
void account_login_failure | ( | char * | message | ) |
Handles a failure from the server - pretty basic - just throw up the message and let the user try again.
message |
Definition at line 868 of file account.c.
References label_account_login_status.
void account_show_login | ( | void | ) |
Definition at line 1302 of file account.c.
References button_login, entry_account_name, and main_notebook.
Referenced by main().
void add_marked_text_to_pane | ( | Info_Pane * | pane, |
const char * | message, | ||
int | type, | ||
int | subtype, | ||
int | orig_color | ||
) |
This just does the work of taking text (which may have markup) and putting it into the target pane. This is a lower level than the draw_ext_info() below, as it does not do message routing. This is called from draw_ext_info() below, as well as account.c to update news/motd/rules.
pane | Pointer to the pane info to draw info. |
message | Message that is parsed and displayed. |
type | Type of the message - for default coloring information. |
subtype | Subtype of message - used for default coloring information. |
orig_color | Legacy color hint not based on type that is used when a theme does not define a style for the message. |
< Only if we get a [color] tag should we care, otherwise, the type/subtype should dictate color (unless no style set!)
Definition at line 802 of file info.c.
References add_to_textbuf(), FONT_ARCANE, FONT_FIXED, FONT_HAND, FONT_NORMAL, FONT_STRANGE, has_style, LOG(), LOG_ERROR, LOG_INFO, Info_Pane::msg_type_tags, NUM_COLORS, and usercolorname.
Referenced by draw_ext_info(), on_combobox_starting_map_changed(), and update_login_info().
void add_style_to_textbuffer | ( | Info_Pane * | pane, |
GtkStyle * | base_style | ||
) |
This is like add_tags_to_textbuffer above, but styles can be changed during the run of the client. So this has to be separate to note it it might be a reload.
pane | Message panel number to update. |
base_style | Base style if retrieved - may be null. |
Definition at line 409 of file info.c.
References Info_Pane::color_tags, font_style_names, Info_Pane::font_tags, MAX_BUF, NUM_COLORS, NUM_FONTS, set_text_tag_from_style(), Info_Pane::textbuffer, and usercolorname.
Referenced by info_get_styles(), init_choose_char_window(), init_create_account_window(), init_create_character_window(), and init_login_window().
void add_tags_to_textbuffer | ( | Info_Pane * | pane, |
GtkTextBuffer * | textbuf | ||
) |
Adds the various tags to the next buffer. If textbuf is non-null, then it also sets the text buffer for that pane to textbuf. This is called right now by info_get_styles() below and from within the account code.
pane | Message panel number to add buffer to. |
textbuf | Text buffer to apply tags to. It is allowed to be null if info_pane[pane].textbuffer has already been set. |
Definition at line 355 of file info.c.
References Info_Pane::bold_tag, Info_Pane::color_tags, Info_Pane::default_tag, Info_Pane::font_tags, Info_Pane::italic_tag, max_subtype, MSG_TYPE_LAST, Info_Pane::msg_type_tags, NUM_COLORS, NUM_FONTS, Info_Pane::textbuffer, and Info_Pane::underline_tag.
Referenced by info_get_styles(), init_choose_char_window(), init_create_account_window(), init_create_character_window(), and init_login_window().
void addsmooth | ( | guint16 | face, |
guint16 | smooth_face | ||
) |
Referenced from common/commands.c
face | |
smooth_face |
Definition at line 251 of file image.c.
References pixmaps, and PixmapInfo::smooth_face.
int associate_cache_entry | ( | Cache_Entry * | ce, |
int | pixnum | ||
) |
This functions associates image_data in the cache entry with the specific pixmap number. Currently, there is no failure condition, but there is the potential that in the future, we want to more closely look at the data and if it isn't valid, return the failure code.
Definition at line 264 of file image.c.
References Cache_Entry::image_data, and pixmaps.
Referenced by finish_face_cmd().
void choose_char_window_show | ( | ) |
Basic little function - this is used because we make the choose_char_window widget private to this file, but the create_char.c file will need to show this if the user decides to abandon creation of a new character.
Definition at line 436 of file account.c.
References main_notebook.
Referenced by choose_character_init(), on_button_cc_cancel(), and on_button_new_char_cancel_clicked().
void choose_character_init | ( | ) |
Called when we get the accountplayers command from the server (indirectly via AccountPlayersCmd). This tells us to wipe any data from the treeview, but also hide any other windows and make the choose_character_window visible.
Definition at line 421 of file account.c.
References character_store, choose_char_window_show(), and hide_main_client().
void clear_stat_mapping | ( | void | ) |
Definition at line 771 of file stats.c.
References need_mapping_update.
Referenced by show_main_client().
void client_pickup | ( | guint32 | pickup | ) |
We get pickup information from server, update our status.
Definition at line 630 of file pickup.c.
References no_recurse, num_pickups, pickup_mapping, pmode, and PU_RATIO.
void client_tick | ( | guint32 | tick | ) |
Called whenever the server sends a tick command.
Definition at line 186 of file main.c.
References auto_afk(), CONFIG_AUTO_AFK, cpl, info_buffer_tick(), inventory_tick(), is_afk, last_command_sent, magic_map_flash_pos(), MAGIC_MAP_PAGE, map_notebook, mapdata_animation(), redraw(), Player_Struct::showmagic, Player_Struct::spells_updated, update_spell_information(), and use_config.
void close_container | ( | item * | op | ) |
Open and close_container are now no-ops - since these are now drawn inline as treestores, we don't need to update what we are drawing were. and since the activation of a container will cause the list to be redrawn, don't need to worry about making an explicit call here.
op |
Definition at line 647 of file inventory.c.
void command_show | ( | const char * | params | ) |
params |
Definition at line 661 of file inventory.c.
References draw_ext_info(), inv_notebook, inv_notebooks, MAX_BUF, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_ERROR, NDI_RED, NUM_INV_LISTS, and num_inv_notebook_pages.
void config_init | ( | GtkWidget * | window_root | ) |
Definition at line 539 of file config.c.
References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, config_button_cache, config_button_download, config_button_echo, config_button_fasttcp, config_button_fog, config_button_foodbeep, config_button_grad_color, config_button_smoothing, config_button_sound, config_button_timestamp, config_combobox_displaymode, config_combobox_faceset, config_combobox_lighting, config_dialog, dialog_xml, on_config_close(), theme_filechooser, and ui_filechooser.
Referenced by init_ui().
void config_load | ( | ) |
Load settings from the user's configuration file into want_config.
Definition at line 442 of file config.c.
References config, config_dir, config_load_legacy(), config_names, CONFIG_NUMS, config_path, face_info, last_server, LOG(), LOG_DEBUG, predict_alpha, theme, THEME_DEFAULT, use_config, want_config, Face_Information_struct::want_faceset, and window_xml_file.
Referenced by main().
int create_and_rescale_image_from_data | ( | Cache_Entry * | ce, |
int | pixmap_num, | ||
guint8 * | rgba_data, | ||
int | width, | ||
int | height | ||
) |
Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data). Scales and stores the relevant data into the pixmap structure.
ce | can be NULL |
pixmap_num | |
rgba_data | |
width | |
height |
Definition at line 142 of file image.c.
References CFG_DM_OPENGL, CONFIG_CACHE, CONFIG_DISPLAYMODE, CONFIG_ICONSCALE, create_full_icon_image(), create_icon_image(), create_map_image(), DEFAULT_IMAGE_SIZE, free_pixmap(), PixmapInfo::full_icon_height, PixmapInfo::full_icon_width, have_new_image, height, PixmapInfo::icon_height, PixmapInfo::icon_image, icon_rescale_factor, PixmapInfo::icon_width, Cache_Entry::image_data, PixmapInfo::map_image, MAX_ICON_SPACES, MAXPIXMAPNUM, pixmaps, rescale_rgba_data(), use_config, and width.
Referenced by display_newpng(), and finish_face_cmd().
void create_character_window_hide | ( | ) |
Basically opposite as above - hide the create character windows - this is called from hide_all_login_windows(), which is called when the client gets an addme success command.
Definition at line 195 of file create_char.c.
References show_window(), and WINDOW_NONE.
Referenced by hide_all_login_windows().
void create_character_window_show | ( | ) |
This function is here so that other files, in particular account.c:on_button_create_character_clicked() can pop up this window. This function also requests necessary data from server if we don't already have it.
Definition at line 152 of file create_char.c.
References classes, create_character_set_sensitive(), create_character_window, cs_print_string(), csocket, ClientSocket::fd, label_cc_status_update, races, and stat_points.
Referenced by on_button_create_character_clicked().
void create_new_character_failure | ( | char * | message | ) |
Pop up a dialog window with the error from the server. Since both v1 and v2 character creation are supported, either the new_character_window or the create_character_window may be up, so we can not easily display an in window message - a pop up is probably better, but it will also work no matter what window is up.
message | message - this comes from the server. |
Definition at line 142 of file account.c.
References hide_main_client().
void create_opengl_map_image | ( | guint8 * | data, |
PixmapInfo * | pi | ||
) |
void create_opengl_question_mark | ( | void | ) |
void default_msgctrl_configuration | ( | void | ) |
Setup the state of the message control dialog so the configuration matches the default settings built in to the client.
Iterate through each message type. For each, copy the built-in client default to the Message Control dialog state variables. All supported defaults are copied, not just the ones supported by the layout.
Definition at line 1771 of file info.c.
References message_control_t::buffer, msgctrl_data_t::buffer, buffer_control, buffer_control_t::count, buffer_parameter_t::default_state, MSG_TYPE_LAST, msgctrl_defaults, msgctrl_widgets, NUM_TEXT_VIEWS, message_control_t::pane, msgctrl_data_t::pane, buffer_parameter_t::state, boolean_widget_t::state, buffer_control_t::timer, and update_msgctrl_configuration().
Referenced by msgctrl_init(), and on_msgctrl_button_defaults_clicked().
void display_map_doneupdate | ( | int | redraw, |
int | notice | ||
) |
This is called after the map has been all digested. this should perhaps be removed, and left to being done from from the main event loop.
redraw | If set, force redraw of all tiles. |
notice | If set, another call will follow soon. |
Definition at line 622 of file map.c.
References map_updated, and redraw().
void do_new_image | ( | guint8 * | data, |
PixmapInfo * | pi | ||
) |
Wrapper for accessing outside this file.
Definition at line 105 of file image.c.
References create_full_icon_image(), create_icon_image(), and create_map_image().
Referenced by map_init().
void draw_ext_info | ( | int | orig_color, |
int | type, | ||
int | subtype, | ||
const char * | message | ||
) |
A message processor that accepts messages along with meta information color and type. The message type and subtype are analyzed to select font and other text attributes. All gtk-v2 client messages pass through this processor before being output. Before addition of the output buffering feature, this was the message callback function. It is a separate function so that it can be called both by the callback, and but buffer maintenance functions.
Client-sourced messages generally should be passed directly to this handler instead of to the callback. This will save some overhead as the callback implements a system that coalesces duplicate messages - a feature that is not really applicable to most messages that do not come from the server.
orig_color | Suggested text color that type/subtype can over-ride. |
type | Message type. See MSG_TYPE definitions in newclient.h. |
subtype | Message subtype. See MSG_TYPE_*_* values in newclient.h. |
message | The message text to display. |
< When 0, the type is valid and may be used to pick the panel routing, otherwise the message can only go to the main message pane.
Definition at line 915 of file info.c.
References add_marked_text_to_pane(), CONFIG_TIMESTAMP, info_pane, LOG(), LOG_ERROR, MSG_TYPE_LAST, msgctrl_widgets, NUM_TEXT_VIEWS, and want_config.
Referenced by info_buffer_flush(), load_msgctrl_configuration(), message_callback(), and save_msgctrl_configuration().
void draw_lists | ( | ) |
Redraws inventory and look windows when necessary
Definition at line 1165 of file inventory.c.
References Player_Struct::below, Player_Struct::container, cpl, draw_inv(), draw_look_list(), item_struct::env, inv_notebook, item_struct::inv_updated, and Player_Struct::ob.
Referenced by load_theme(), and redraw().
void draw_look_list | ( | ) |
Draws the objects beneath the player.
Definition at line 835 of file inventory.c.
References add_object_to_store(), Player_Struct::below, Player_Struct::container, cpl, item_struct::inv, item_struct::next, item_struct::open, store_look, and treeview_look.
Referenced by draw_lists().
void draw_magic_map | ( | void | ) |
Definition at line 24 of file magicmap.c.
References cpl, FACE_COLOR_MASK, LOG(), LOG_WARNING, magic_map, MAGIC_MAP_PAGE, Player_Struct::magicmap, map_notebook, Player_Struct::mapxres, Player_Struct::mapyres, Player_Struct::mmapx, Player_Struct::mmapy, root_color, and Player_Struct::showmagic.
Referenced by on_drawingarea_magic_map_expose_event().
void draw_map | ( | ) |
Draw the map window using the appropriate backend.
Definition at line 477 of file map.c.
References CONFIG_MAPSCALE, gtk_map_redraw(), LOG(), LOG_DEBUG, map_check_resize(), time_map_redraw, update_global_offset(), and use_config.
Referenced by map_expose_event(), and redraw().
void draw_message_window | ( | int | redraw | ) |
Updates the stats pane - hp, sp, etc labels
redraw |
Definition at line 459 of file stats.c.
References CONFIG_FOODBEEP, cpl, Stat_struct::exp, exp_table, exp_table_max, Stat_struct::food, Stat_struct::grace, Stat_struct::hp, Stat_struct::level, Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, Stat_struct::sp, STAT_BAR_EXP, STAT_BAR_FOOD, STAT_BAR_GRACE, STAT_BAR_HP, STAT_BAR_SP, Player_Struct::stats, update_stat(), and use_config.
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 554 of file stats.c.
References StatWindow::ac, Stat_struct::ac, StatWindow::armor, StatWindow::Cha, Stat_struct::Cha, StatWindow::Con, Stat_struct::Con, cpl, csocket, StatWindow::dam, Stat_struct::dam, StatWindow::Dex, Stat_struct::Dex, StatWindow::exp, Stat_struct::exp, FLOAT_MULTF, StatWindow::Int, Stat_struct::Int, StatWindow::level, Stat_struct::level, MAX_BUF, MAX_SKILL, NameMapping::name, need_mapping_update, NUM_RESISTS, StatWindow::playername, StatWindow::Pow, Stat_struct::Pow, PROTECTION_BOXES_X, PROTECTION_BOXES_Y, StatWindow::range, Player_Struct::range, redraw(), Stat_struct::resist_change, resist_mapping, StatWindow::resists, Stat_struct::resists, ClientSocket::sc_version, StatWindow::skill_exp, Stat_struct::skill_exp, Stat_struct::skill_level, skill_mapping, skill_names, StatWindow::speed, Stat_struct::speed, Player_Struct::stats, statwindow, StatWindow::Str, Stat_struct::Str, StatWindow::table_skills_exp, Player_Struct::title, update_skill_information(), update_stat_mapping(), NameMapping::value, StatWindow::wc, Stat_struct::wc, Stat_struct::weapon_sp, StatWindow::weapon_speed, StatWindow::Wis, and Stat_struct::Wis.
void drawquarterlightmap_sdl | ( | int | tl, |
int | tr, | ||
int | bl, | ||
int | br, | ||
int | width, | ||
int | height, | ||
int | startx, | ||
int | starty, | ||
int | endx, | ||
int | endy, | ||
int | destx, | ||
int | desty | ||
) |
void error_dialog | ( | char * | error, |
char * | message | ||
) |
Display an error message dialog. The dialog contains a multi-line, bolded heading that includes the client version information, an error description, and information relevant to the error condition.
Definition at line 314 of file main.c.
Referenced by event_loop(), and init_ui().
void get_map_image_size | ( | int | face, |
guint8 * | w, | ||
guint8 * | h | ||
) |
face | |
w | |
h |
Definition at line 341 of file image.c.
References CFG_DM_PIXMAP, CONFIG_DISPLAYMODE, CONFIG_MAPSCALE, PixmapInfo::full_icon_height, PixmapInfo::full_icon_width, map_image_size, MAXPIXMAPNUM, pixmaps, and use_config.
void get_window_coord | ( | GtkWidget * | win, |
int * | x, | ||
int * | y, | ||
int * | wx, | ||
int * | wy, | ||
int * | w, | ||
int * | h | ||
) |
Gets the coordinates of a specified window.
win | Pass in a GtkWidget pointer to get its coordinates. |
x | Parent-relative window x coordinate |
y | Parent-relative window y coordinate |
wx | ? |
wy | ? |
w | Window width |
h | Window height |
Definition at line 579 of file main.c.
Referenced by image_update_download_status(), and save_winpos().
void hide_all_login_windows | ( | ) |
Hides all the login related windows. This is needed in case the client loses the connection to the server (either through player going to client/disconnect or network failure). get_metaserver() calls this, as well as AddMeSuccess
Definition at line 96 of file account.c.
References connect_window, create_character_window_hide(), has_init, new_character_window, and treeview_look.
void image_update_download_status | ( | int | start, |
int | end, | ||
int | total | ||
) |
Draws a status bar showing where we our in terms of downloading all the image data. A few hacks: If start is 1, this is the first batch, so it means we need to create the appropriate status window. If start = end = total, it means were finished, so destroy the gui element.
start | The start value just sent to the server. |
end | |
total | The total number of images. |
Definition at line 309 of file image.c.
References get_window_coord(), pbar, pbar_window, and window_root.
void info_get_styles | ( | void | ) |
Loads up values from the style file. Note that the actual name of the style file is set elsewhere.
This function is designed so that it should be possible to call it multiple times - it will release old style data and load up new values. In this way, a user should be able to change styles on the fly and have things work.
Definition at line 499 of file info.c.
References add_style_to_textbuffer(), add_tags_to_textbuffer(), has_init, has_style, info_pane, LOG(), LOG_INFO, MAX_BUF, max_subtype, Info_Pane::msg_type_tags, NUM_TEXT_VIEWS, and set_text_tag_from_style().
Referenced by load_theme().
void info_init | ( | GtkWidget * | window_root | ) |
Initialize the information panels in the client. These panels are the client areas where text is drawn.
window_root | Pointer to the parent (root) application window. |
Definition at line 632 of file info.c.
References Info_Pane::adjustment, info_buffer_init(), info_pane, MAX_BUF, message_callback(), MSG_TYPE_LAST, NUM_TEXT_VIEWS, Info_Pane::scrolled_window, setTextManager(), Info_Pane::textbuffer, Info_Pane::textmark, Info_Pane::textview, and window_xml.
Referenced by init_ui().
void init_create_character_window | ( | ) |
Initializes the create character window.
Definition at line 791 of file create_char.c.
References add_style_to_textbuffer(), add_tags_to_textbuffer(), button_cc_cancel, button_choose_starting_map, button_csm_cancel, button_csm_done, choose_starting_map_window, combobox_cs, combobox_rs, combobox_starting_map, connect_window, create_char_pane, create_character_window, dialog_xml, entry_new_character_name, has_init, label_cc_desc, label_cc_status_update, label_cc_unspent, label_cs, label_rs, label_tot, NUM_NEW_CHAR_STATS, NUM_OPT_FIELDS, on_button_cc_cancel(), on_button_cc_done(), on_button_choose_starting_map(), on_button_csm_cancel(), on_spinbutton_cc(), opt_combobox, opt_label, spinbutton_cc, STARTING_MAP_PANE, stat_mapping, text_mark_cs, text_mark_rs, textbuf_starting_map, Info_Pane::textmark, Info_Pane::textview, textview_cs_desc, textview_rs_desc, and window_root.
Referenced by init_ui().
void init_glx_opengl | ( | GtkWidget * | drawingarea | ) |
void init_image_cache_data | ( | void | ) |
Initializes the data for image caching Create question mark to display in each supported rendering mode when an image is not cached. When image caching is enabled, if a needed image is not yet in the cache, a question mark image is displayed instead. The image displayed is unique to the display mode. This function creates the image to use when OpenGL mode is in effect.
Definition at line 380 of file image.c.
References PixmapInfo::full_icon_height, PixmapInfo::full_icon_image, PixmapInfo::full_icon_width, PixmapInfo::icon_height, PixmapInfo::icon_image, PixmapInfo::icon_width, init_common_cache_data(), PixmapInfo::map_image, map_image_size, MAXPIXMAPNUM, pixmaps, and PixmapInfo::smooth_face.
Referenced by main().
void init_menu_items | ( | ) |
Initialize menu bar items and connect their signals to their handlers.
Definition at line 89 of file menubar.c.
References menu_about(), menu_quit_character(), menu_quit_program(), on_configure_activate(), on_disconnect_activate(), on_keybindings_activate(), on_menu_all_weapons_activate(), on_menu_arrows_activate(), on_menu_body_armor_activate(), on_menu_boots_activate(), on_menu_bows_activate(), on_menu_cloaks_activate(), on_menu_containers_activate(), on_menu_dont_pickup_activate(), on_menu_drinks_activate(), on_menu_flesh_activate(), on_menu_food_activate(), on_menu_gloves_activate(), on_menu_helmets_activate(), on_menu_jewels_activate(), on_menu_keys_activate(), on_menu_magical_items_activate(), on_menu_missile_weapons_activate(), on_menu_normal_book_scrolls_activate(), on_menu_not_cursed_activate(), on_menu_potions_activate(), on_menu_ratio_10_activate(), on_menu_ratio_15_activate(), on_menu_ratio_20_activate(), on_menu_ratio_25_activate(), on_menu_ratio_35_activate(), on_menu_ratio_40_activate(), on_menu_ratio_45_activate(), on_menu_ratio_50_activate(), on_menu_ratio_5_activate(), on_menu_ratio_pickup_off_activate(), on_menu_shields_activate(), on_menu_skillscrolls_activate(), on_menu_spellbooks_activate(), on_menu_stop_before_pickup_activate(), on_menu_valuables_activate(), on_menu_wands_rods_horns_activate(), on_msgctrl_activate(), on_save_window_position_activate(), on_skills_activate(), on_spells_activate(), and window_xml.
Referenced by init_ui().
void init_opengl | ( | GtkWidget * | drawingarea | ) |
int init_sounds | ( | void | ) |
Definition at line 26 of file sound.c.
References cf_snd_init().
Referenced by config_check(), and main().
void init_theme | ( | ) |
Definition at line 92 of file config.c.
References config_dir, default_files, MAX_BUF, and ui_name().
Referenced by init_ui().
void inventory_get_styles | ( | ) |
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 501 of file inventory.c.
References has_init, inv_styles, LOG(), LOG_INFO, Style_Last, and Style_Names.
Referenced by load_theme().
void inventory_init | ( | GtkWidget * | window_root | ) |
Set up the inventory viewer.
window_root | The client main window. |
Definition at line 528 of file inventory.c.
References encumbrance_current, encumbrance_max, inv_notebook, inv_notebooks, inv_table, inv_table_children, INV_TREE, LIST_NUM_COLUMNS, list_row_collapse(), LOG(), LOG_ERROR, MAX_INV, NUM_INV_LISTS, num_inv_notebook_pages, on_switch_page(), setup_list_columns(), store_look, treestore, Notebook_Info::treeview, treeview_look, and window_xml.
Referenced by init_ui().
void inventory_tick | ( | ) |
This is called periodically from main.c - basically a timeout, used to animate the inventory.
Definition at line 1304 of file inventory.c.
References animate_inventory(), and animate_look().
Referenced by client_tick().
void item_event_container_clearing | ( | item * | container | ) |
Definition at line 773 of file inventory.c.
void item_event_item_changed | ( | item * | it | ) |
Definition at line 776 of file inventory.c.
void item_event_item_deleting | ( | item * | it | ) |
Definition at line 760 of file inventory.c.
References Player_Struct::below, cpl, get_item_env(), item_struct::inv_updated, ITEM_GROUND, ITEM_INVENTORY, Player_Struct::ob, remove_object_from_store(), store_look, and treestore.
void load_msgctrl_configuration | ( | void | ) |
Setup the state of the message control dialog so the configuration matches a previously saved configuration.
Definition at line 1590 of file info.c.
References message_control_t::buffer, buffer_control, config_dir, buffer_control_t::count, draw_ext_info(), LOG(), LOG_DEBUG, LOG_ERROR, MAX_BUF, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_ERROR, MSG_TYPE_LAST, msgctrl_widgets, NDI_RED, NUM_TEXT_VIEWS, message_control_t::pane, buffer_parameter_t::state, boolean_widget_t::state, buffer_control_t::timer, and update_msgctrl_configuration().
Referenced by msgctrl_init(), and on_msgctrl_button_load_clicked().
void load_theme | ( | int | reload | ) |
Definition at line 154 of file config.c.
References Player_Struct::below, cpl, default_files, draw_lists(), draw_message_window(), draw_stats(), info_get_styles(), item_struct::inv_updated, inventory_get_styles(), LOG(), LOG_ERROR, Player_Struct::ob, spell_get_styles(), stats_get_styles(), theme, THEME_DEFAULT, and update_spell_information().
Referenced by init_ui(), and read_config_dialog().
void load_window_positions | ( | GtkWidget * | window_root | ) |
Resize the client window and its panels using saved window positions.
window_root | The client's main window. |
Definition at line 848 of file config.c.
References config, ui_name(), window_root, and window_xml.
Referenced by init_ui().
void magic_map_flash_pos | ( | ) |
Flash the player's position on the magic map.
Definition at line 77 of file magicmap.c.
References cpl, magic_map, Player_Struct::mapxres, Player_Struct::mapyres, Player_Struct::pmapx, Player_Struct::pmapy, root_color, and Player_Struct::showmagic.
Referenced by client_tick().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main client entry point.
Definition at line 493 of file main.c.
References account_show_login(), client_connect(), client_init(), client_negotiate(), client_reset(), config_check(), config_load(), CONFIG_SOUND, connect_server, connect_window, cpl, csocket, event_loop(), ClientSocket::fd, FULL_VERSION, global_time, hide_main_client(), init_image_cache_data(), init_sockets(), init_sounds(), init_ui(), Player_Struct::input_state, LOG(), LOG_DEBUG, LOG_ERROR, MAX_BUF, metaserver_show_prompt(), parse_args(), Playing, reset_image_data(), serverloginmethod, show_main_client(), use_config, VERSION_INFO, want_config, and window_xml_file.
void map_init | ( | GtkWidget * | window_root | ) |
This initializes the stuff we need for the map.
window_root | The client's main playing window. |
Definition at line 86 of file map.c.
References CONFIG_MAPSCALE, DEFAULT_IMAGE_SIZE, do_new_image(), face_info, Face_Information_struct::faceset, Face_Information_struct::facesets, PixmapInfo::full_icon_height, PixmapInfo::full_icon_width, PixmapInfo::icon_height, PixmapInfo::icon_width, image_size, LOG(), LOG_ERROR, map_button_event(), map_check_resize(), map_drawing_area, map_expose_event(), map_image_size, map_notebook, pixmaps, rescale_rgba_data(), FaceSets_struct::size, use_config, and window_xml.
Referenced by show_main_client().
void menu_clear | ( | void | ) |
Clears all the message panels. It is not clear why someone would use it, but is called from the common area, and so is supported here.
Definition at line 1326 of file info.c.
References info_pane, and NUM_TEXT_VIEWS.
void metaserver_show_prompt | ( | ) |
Constructs the metaserver dialog and handles metaserver selection. If the player has a servers.cache file in their .crossfire folder, the cached server list is added to the contents of the metaserver dialog.
Definition at line 215 of file metaserver.c.
References cpl, Player_Struct::input_state, last_server, main_notebook, metaserver_button, metaserver_entry, metaserver_refresh(), Metaserver_Select, and on_server_entry_changed().
Referenced by main().
void metaserver_ui_init | ( | ) |
Initialize the metaserver user interface.
Definition at line 75 of file metaserver.c.
References dialog_xml, LIST_COMMENT, LIST_HOSTNAME, LIST_PLAYERS, LIST_VERSION, metaserver_button, metaserver_entry, metaserver_selection, metaserver_status, on_button_metaserver_quit_pressed(), on_button_refresh(), on_configure_activate(), on_metaserver_select_clicked(), on_selection_changed(), on_server_entry_changed(), store_metaserver, and treeview_metaserver.
Referenced by init_ui().
void msgctrl_init | ( | GtkWidget * | window_root | ) |
Initialize the message control panel by populating it with descriptions of each message type along with checkboxes that are used to configure the routing and duplicate suppression system. If previously saved settings are found on disk, they are loaded and applied, otherwise the built in client defaults are loaded and applied. This initialization must occur after the info_init() function runs.
window_root | The client main window |
Definition at line 1345 of file info.c.
References message_control_t::buffer, buffer_control, buffer_control_t::count, default_msgctrl_configuration(), dialog_xml, load_msgctrl_configuration(), MSG_TYPE_LAST, msgctrl_defaults, msgctrl_table, msgctrl_widgets, msgctrl_window, NUM_TEXT_VIEWS, on_msgctrl_button_apply_clicked(), on_msgctrl_button_close_clicked(), on_msgctrl_button_defaults_clicked(), on_msgctrl_button_load_clicked(), on_msgctrl_button_save_clicked(), message_control_t::pane, buffer_parameter_t::ptr, boolean_widget_t::ptr, and buffer_control_t::timer.
Referenced by init_ui().
void MusicCmd | ( | const char * | data, |
int | len | ||
) |
Parse the data contained by a music command coming from the server and pass the name along to cfsndserv as a quoted string.
data | Data provided following the music command from the server that hints what kind of music should play. NONE is an indication that music should stop playing. |
len | Length of the string describing the music to play. |
Format of the music command received in data:
music {string}
Definition at line 113 of file sound.c.
References cf_play_music(), CONFIG_SOUND, LOG(), LOG_ERROR, and use_config.
void my_log_handler | ( | const gchar * | log_domain, |
GLogLevelFlags | log_level, | ||
const gchar * | message, | ||
gpointer | user_data | ||
) |
This goes with the g_log_set_handler below in main(). I leave it here since it may be useful - basically, it can prove handy to try and track down error messages like:
file gtklabel.c: line 1845: assertion ‘GTK_IS_LABEL (label)’ failed
In the debugger, you can set a breakpoint in this function, and then see the stacktrace on what is trying to access a widget that isn't set or otherwise having issues.
void on_button_add_character_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User has hit the add character button, so hide this window, show the add character window.
button | |
user_data |
Definition at line 500 of file account.c.
References entry_character_name, entry_character_password, and main_notebook.
Referenced by init_choose_char_window().
void on_button_create_account_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User hit the create account button. So we need to hide the login window and bring up the create login window.
button | |
user_data |
Definition at line 879 of file account.c.
References entry_new_account_name, entry_new_account_password, entry_new_confirm_password, label_create_account_status, and main_notebook.
Referenced by init_login_window().
void on_button_create_character_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 484 of file account.c.
References create_character_window_show(), entry_new_character_name, new_character_window, and serverloginmethod.
Referenced by init_choose_char_window().
void on_button_create_new_char_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User hit the create character button. Get data, send to server.
button | |
user_data |
Definition at line 184 of file account.c.
References create_new_character().
Referenced by init_new_character_window().
void on_button_do_add_character_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User has hit the add character button. Let add_character_to_account() do all the work.
button | |
user_data |
Definition at line 334 of file account.c.
References add_character_to_account(), entry_character_name, and entry_character_password.
Referenced by init_add_character_window().
void on_button_exit_client_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User hit the exit client button. Pretty simple in this case.
button | |
user_data |
Definition at line 904 of file account.c.
References script_killall().
void on_button_go_metaserver_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User hit the go to metaserver button. Need to disconnect from The server, and by clearing the csocket_fd, the main loop routine will bring up the metaserver window.
button | |
user_data |
Definition at line 895 of file account.c.
References client_disconnect().
Referenced by init_login_window().
void on_button_login_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User hit the login button - just call do_account_login()
button | |
user_data |
Definition at line 944 of file account.c.
References do_account_login(), entry_account_name, and entry_account_password.
Referenced by init_login_window().
void on_button_metaserver_quit_pressed | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Quits the client application if the quit button is pressed. This is also used to quit the client if the button's accelerator is pressed.
button | |
user_data |
Definition at line 281 of file metaserver.c.
References on_window_destroy_event().
Referenced by metaserver_ui_init().
void on_button_new_cancel_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 759 of file account.c.
References main_notebook.
Referenced by init_create_account_window().
void on_button_new_char_cancel_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User his hit the cancel button in the new character window, so hide the new character window, show the choose character window.
button | |
user_data |
Definition at line 205 of file account.c.
References choose_char_window_show(), and new_character_window.
Referenced by init_new_character_window().
void on_button_new_create_account_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User clicked on the create account button. In this case, we just process the data and call do_account_create();
button | |
user_data |
Definition at line 738 of file account.c.
References do_account_create(), entry_new_account_name, entry_new_account_password, entry_new_confirm_password, and label_create_account_status.
Referenced by init_create_account_window().
void on_button_play_character_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User has hit the play character button. Grab the selected entry, if there is one.
button | |
user_data |
Definition at line 462 of file account.c.
References CHAR_NAME, play_character(), show_main_client(), and treeview_choose_character.
Referenced by init_choose_char_window().
void on_button_return_character_select_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User has hit the return to character selection button. Pretty simple - just hide this window, activate the other window.
button | |
user_data |
Definition at line 348 of file account.c.
References main_notebook.
Referenced by init_add_character_window().
void on_button_return_login_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
User has hit the return to login window, so hide this window, show the account login window.
button | |
user_data |
Definition at line 514 of file account.c.
References main_notebook.
Referenced by init_choose_char_window().
void on_configure_activate | ( | GtkWidget * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 778 of file config.c.
References config_dialog, and setup_config_dialog().
Referenced by init_menu_items(), and metaserver_ui_init().
gboolean on_drawingarea_magic_map_expose_event | ( | GtkWidget * | widget, |
GdkEventExpose * | event, | ||
gpointer | user_data | ||
) |
void on_entry_account_name_activate | ( | GtkEntry * | entry, |
gpointer | user_data | ||
) |
User hit return in the name entry box.
entry | |
user_data |
Definition at line 954 of file account.c.
References entry_account_password.
Referenced by init_login_window().
void on_entry_account_password_activate | ( | GtkEntry * | entry, |
gpointer | user_data | ||
) |
void on_entry_character | ( | GtkEntry * | entry, |
gpointer | user_data | ||
) |
User has hit return in either name or password box. If both boxes have non empty data, process request. Otherwise, either stay in same box if this box is empty, or move to the other box.
entry | Entry widget which generated this callback. |
user_data |
Definition at line 361 of file account.c.
References add_character_to_account(), entry_character_name, and entry_character_password.
Referenced by init_add_character_window().
void on_entry_new_account | ( | GtkEntry * | entry, |
gpointer | user_data | ||
) |
This handles cases where the user hits return in one of the entry boxes. We use the same callback for all 3 entry boxes, since the processing is basically the same - if there is valid data in all of them, we try to create an account - otherwise, we move to the next box.
entry | Entry box used to figure out what the next box is. |
user_data | Not used. |
Definition at line 773 of file account.c.
References do_account_create(), entry_new_account_name, entry_new_account_password, and entry_new_confirm_password.
Referenced by init_create_account_window().
void on_entry_new_character_name | ( | GtkEntry * | entry, |
gpointer | user_data | ||
) |
User hit return in the new character name box. Like above, get data and send to server.
entry | |
user_data |
Definition at line 194 of file account.c.
References create_new_character().
Referenced by init_new_character_window().
void on_menu_all_weapons_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 287 of file pickup.c.
References new_menu_pickup(), and PU_ALLWEAPON.
Referenced by init_menu_items().
void on_menu_arrows_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 308 of file pickup.c.
References new_menu_pickup(), and PU_ARROW.
Referenced by init_menu_items().
void on_menu_body_armor_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 135 of file pickup.c.
References new_menu_pickup(), and PU_ARMOUR.
Referenced by init_menu_items().
void on_menu_boots_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 142 of file pickup.c.
References new_menu_pickup(), and PU_BOOTS.
Referenced by init_menu_items().
void on_menu_bows_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 301 of file pickup.c.
References new_menu_pickup(), and PU_BOW.
Referenced by init_menu_items().
void on_menu_cloaks_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 149 of file pickup.c.
References new_menu_pickup(), and PU_CLOAK.
Referenced by init_menu_items().
void on_menu_containers_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 269 of file pickup.c.
References new_menu_pickup(), and PU_CONTAINERS.
Referenced by init_menu_items().
void on_menu_dont_pickup_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 117 of file pickup.c.
References new_menu_pickup(), and PU_INHIBIT.
Referenced by init_menu_items().
void on_menu_drinks_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 206 of file pickup.c.
References new_menu_pickup(), and PU_DRINK.
Referenced by init_menu_items().
void on_menu_flesh_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 276 of file pickup.c.
References new_menu_pickup(), and PU_FLESH.
Referenced by init_menu_items().
void on_menu_food_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 213 of file pickup.c.
References new_menu_pickup(), and PU_FOOD.
Referenced by init_menu_items().
void on_menu_gloves_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 156 of file pickup.c.
References new_menu_pickup(), and PU_GLOVES.
Referenced by init_menu_items().
void on_menu_helmets_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 163 of file pickup.c.
References new_menu_pickup(), and PU_HELMET.
Referenced by init_menu_items().
void on_menu_jewels_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 262 of file pickup.c.
References new_menu_pickup(), and PU_JEWELS.
Referenced by init_menu_items().
void on_menu_keys_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 220 of file pickup.c.
References new_menu_pickup(), and PU_KEY.
Referenced by init_menu_items().
void on_menu_magical_items_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 227 of file pickup.c.
References new_menu_pickup(), and PU_MAGICAL.
Referenced by init_menu_items().
void on_menu_missile_weapons_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 294 of file pickup.c.
References new_menu_pickup(), and PU_MISSILEWEAPON.
Referenced by init_menu_items().
void on_menu_normal_book_scrolls_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 189 of file pickup.c.
References new_menu_pickup(), and PU_READABLES.
Referenced by init_menu_items().
void on_menu_not_cursed_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 255 of file pickup.c.
References new_menu_pickup(), and PU_NOT_CURSED.
Referenced by init_menu_items().
void on_menu_potions_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 234 of file pickup.c.
References new_menu_pickup(), and PU_POTION.
Referenced by init_menu_items().
void on_menu_ratio_10_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 333 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_15_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 340 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_20_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 347 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_25_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 354 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_30_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 361 of file pickup.c.
References new_menu_pickup().
void on_menu_ratio_35_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 368 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_40_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 375 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_45_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 382 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_50_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 389 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_5_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 326 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_ratio_pickup_off_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 319 of file pickup.c.
References new_menu_pickup().
Referenced by init_menu_items().
void on_menu_shields_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 170 of file pickup.c.
References new_menu_pickup(), and PU_SHIELD.
Referenced by init_menu_items().
void on_menu_skillscrolls_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 181 of file pickup.c.
References new_menu_pickup(), and PU_SKILLSCROLL.
Referenced by init_menu_items().
void on_menu_spellbooks_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 197 of file pickup.c.
References new_menu_pickup(), and PU_SPELLBOOK.
Referenced by init_menu_items().
void on_menu_stop_before_pickup_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 124 of file pickup.c.
References new_menu_pickup(), and PU_STOP.
Referenced by init_menu_items().
void on_menu_valuables_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 241 of file pickup.c.
References new_menu_pickup(), and PU_VALUABLES.
Referenced by init_menu_items().
void on_menu_wands_rods_horns_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 248 of file pickup.c.
References new_menu_pickup(), and PU_MAGIC_DEVICE.
Referenced by init_menu_items().
void on_metaserver_select_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Establish a connection with the server when pressing the connect button.
button | |
user_data |
Definition at line 267 of file metaserver.c.
References metaserver_connect_to(), and metaserver_entry.
Referenced by metaserver_ui_init().
void on_msgctrl_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Shows the message control dialog when the menu item is activated. The settings shown on the dialog when it is activated are the settings currently in use.
menuitem | |
user_data |
Definition at line 1907 of file info.c.
References msgctrl_window.
Referenced by init_menu_items().
void on_msgctrl_button_apply_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
When the message control dialog apply button is pressed, the currently displayed settings are applied. The dialog is not dismissed, but remains open for further adjustments to be made.
button | |
user_data |
Definition at line 1877 of file info.c.
References read_msgctrl_configuration().
Referenced by msgctrl_init().
void on_msgctrl_button_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
When the message control dialog close button is pressed, the currently displayed settings are applied and the dialog is dismissed.
button | |
user_data |
Definition at line 1891 of file info.c.
References msgctrl_window, and read_msgctrl_configuration().
Referenced by msgctrl_init().
void on_msgctrl_button_defaults_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
When the message control dialog defaults button is pressed, the default settings built into the client are restored and applied.
button | |
user_data |
Definition at line 1862 of file info.c.
References default_msgctrl_configuration().
Referenced by msgctrl_init().
void on_msgctrl_button_load_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
When the message control dialog load button is pressed, the settings last saved are restored and applied. It may be used to "undo" both applied and unapplied setting changes.
button | |
user_data |
Definition at line 1848 of file info.c.
References load_msgctrl_configuration().
Referenced by msgctrl_init().
void on_msgctrl_button_save_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
When the message control dialog save button is pressed, the currently shown settings are applied for immediate use and they are saved to disk so the settings persist across client sessions. Saved settings automatically load and apply when the client is started.
button | |
user_data |
Definition at line 1832 of file info.c.
References read_msgctrl_configuration(), and save_msgctrl_configuration().
Referenced by msgctrl_init().
void on_save_window_position_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Handles saving of the window positions when the Client | Save Window Position menu item is activated.
menuitem | |
user_data |
Definition at line 834 of file config.c.
References save_winpos().
Referenced by init_menu_items().
void on_skill_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 267 of file skills.c.
References skill_window.
Referenced by on_skills_activate().
void on_skill_ready_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 238 of file skills.c.
References skill_selection, skill_window, and trigger_skill().
Referenced by on_skills_activate().
void on_skill_treeview_row_activated | ( | GtkTreeView * | treeview, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) |
treeview | |
path | |
column | |
user_data |
Definition at line 221 of file skills.c.
References skill_window, and trigger_skill().
Referenced by on_skills_activate().
void on_skill_use_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 253 of file skills.c.
References skill_selection, and trigger_skill().
Referenced by on_skills_activate().
void on_skills_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
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().
void on_spell_cast_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 515 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, options, send_command(), spell_options, and spell_selection.
Referenced by on_spell_treeview_row_activated(), and on_spells_activate().
void on_spell_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 571 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 543 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, options, 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 502 of file spells.c.
References on_spell_cast_clicked().
Referenced by on_spells_activate().
void on_spell_window_size_allocate | ( | GtkWidget * | widget, |
gpointer | user_data | ||
) |
Adjust the line wrap width used by the spells dialog Description column text renderer and force redraw of the rows to cause row height adjustment. To compute the new wrap width, the widths of all other columns are subtracted from the width of the spells window to determine the available width for the description column. The remaining space is then configured as the new wrap width. Once the new wrap is computed, mark all the rows changed so that the renderer adjusts the row height to expand or contract to fit the reformatted description.
widget | |
user_data |
Definition at line 124 of file spells.c.
References description_renderer, has_init, spell_store, spell_treeview, and width.
Referenced by on_spells_activate().
void on_spells_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
menuitem | |
user_data |
Definition at line 283 of file spells.c.
References description_renderer, dialog_xml, has_init, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, LIST_IMAGE, 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(), on_spell_window_size_allocate(), 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, and update_spell_information().
Referenced by init_menu_items().
void on_treeview_choose_character_activated | ( | GtkTreeView * | treeview, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) |
gboolean on_window_delete_event | ( | GtkWidget * | window, |
gpointer * | user_data | ||
) |
Prevent delete_event closure and/or hiding of account windows. All account system windows ignore delete events and remain visible unless the user clicks an appropriate button.
window | Pointer to an account window that received a delete_event. |
user_data | Unused. |
Definition at line 123 of file account.c.
Referenced by init_new_character_window().
void on_window_destroy_event | ( | GtkWidget * | object, |
gpointer | user_data | ||
) |
Handles client shutdown.
Definition at line 213 of file main.c.
References LOG(), LOG_DEBUG, and script_killall().
Referenced by init_ui(), and on_button_metaserver_quit_pressed().
void open_container | ( | item * | op | ) |
op |
Definition at line 654 of file inventory.c.
void opengl_free_pixmap | ( | PixmapInfo * | pi | ) |
void opengl_gen_map | ( | int | redraw | ) |
void pickup_init | ( | GtkWidget * | window_root | ) |
Maps the menuitem lists into pickup values. In this way, client_pickup knows what values to change.
window_root |
Definition at line 401 of file pickup.c.
References has_init, LOG(), LOG_ERROR, MAX_PICKUPS, PickupMapping::menuitem, num_pickups, pickup_mapping, PickupMapping::pickup_mode, PU_ALLWEAPON, PU_ARMOUR, PU_ARROW, PU_BOOTS, PU_BOW, PU_CLOAK, PU_CONTAINERS, PU_DRINK, PU_FLESH, PU_FOOD, PU_GLOVES, PU_HELMET, PU_INHIBIT, PU_JEWELS, PU_KEY, PU_MAGIC_DEVICE, PU_MAGICAL, PU_MISSILEWEAPON, PU_NOT_CURSED, PU_POTION, PU_RATIO, PU_READABLES, PU_SHIELD, PU_SKILLSCROLL, PU_SPELLBOOK, PU_STOP, PU_VALUABLES, and window_xml.
Referenced by init_ui().
void play_sound_effect | ( | gint8 | x, |
gint8 | y, | ||
guint8 | dir, | ||
guint8 | vol, | ||
guint8 | type, | ||
const char * | sound, | ||
const char * | source | ||
) |
guint8* png_to_data | ( | guint8 * | data, |
int | len, | ||
guint32 * | width, | ||
guint32 * | height | ||
) |
Definition at line 49 of file png.c.
References data_cp, data_len, data_start, height, LOG(), LOG_CRITICAL, LOG_ERROR, user_read_data(), and width.
void read_msgctrl_configuration | ( | void | ) |
Reads the state of the message control dialog and applies the settings to the msgctrl_widgets[] state variables that control the message routing and duplicate suppression system.
Definition at line 1793 of file info.c.
References message_control_t::buffer, buffer_control, buffer_control_t::count, MSG_TYPE_LAST, msgctrl_widgets, NUM_TEXT_VIEWS, message_control_t::pane, buffer_parameter_t::ptr, buffer_parameter_t::state, boolean_widget_t::state, and buffer_control_t::timer.
Referenced by on_msgctrl_button_apply_clicked(), on_msgctrl_button_close_clicked(), on_msgctrl_button_save_clicked(), and save_msgctrl_configuration().
guint8* rescale_rgba_data | ( | guint8 * | data, |
int * | width, | ||
int * | height, | ||
int | scale | ||
) |
Takes png data and scales it accordingly. This function is based on pnmscale, but has been modified to support alpha channel - instead of blending the alpha channel, it takes the most opaque value - blending it is not likely to give sane results IMO - for any image that has transparent information, if we blended the alpha, the result would be the edges of that region being partially transparent. This function has also been re-written to use more static data - in the case of the client, it will be called thousands of times, so it doesn't make sense to free the data and then re-allocate it.
For pixels that are fully transparent, the end result after scaling is they will be tranparent black. This is a needed effect for blending to work properly.
This function returns a new pointer to the scaled image data. This is g_malloc'd data, so should be freed at some point to prevent leaks. This function does not modify the data passed to it - the caller is responsible for freeing it if it is no longer needed.
function arguments:
*data | PNG data - this is any 4 byte per pixel data, in RGBA format. |
*width | Source width modified to contain the new image size. |
*height | Source height modified to contain the new image size. |
scale | Percentage size that new image should be. 100 is a same size image - values larger than 100 will result in zoom, values less than 100 will result in a shrinkage. |
Definition at line 235 of file png.c.
References BPP, height, LOG(), LOG_CRITICAL, MAX_IMAGE_HEIGHT, MAX_IMAGE_WIDTH, RATIO, and width.
Referenced by create_and_rescale_image_from_data(), and map_init().
void reset_image_data | ( | void | ) |
Connecting to different servers, try to clear out any old images. Try to free the data to prevent memory leaks. This could be more clever, ie, if we're caching images and go to a new server and get a name, we should try to re-arrange our cache or the like.
Definition at line 276 of file image.c.
References CONFIG_CACHE, free_pixmap(), MAXPIXMAPNUM, pixmaps, reset_image_cache_data(), and want_config.
Referenced by main().
void resize_map_window | ( | int | x, |
int | y | ||
) |
Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now. Note - this is note a window resize request, but rather process the size (in spaces) of the map - is received from server.
cairo_surface_t* rgba_to_cairo_surface | ( | guint8 * | data, |
int | width, | ||
int | height | ||
) |
Create a Cairo surface for the given RGBA data.
Definition at line 440 of file png.c.
Referenced by create_map_image().
GdkPixbuf* rgba_to_gdkpixbuf | ( | guint8 * | data, |
int | width, | ||
int | height | ||
) |
Create a GdkPixbuf for the given RGBA data.
Definition at line 414 of file png.c.
Referenced by create_full_icon_image(), and create_icon_image().
void save_defaults | ( | ) |
This function saves user settings chosen using the configuration popup dialog.
Definition at line 513 of file config.c.
References config, config_names, CONFIG_NUMS, config_path, draw_ext_info(), face_info, last_server, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_CONFIG, NDI_RED, predict_alpha, theme, want_config, Face_Information_struct::want_faceset, and window_xml_file.
Referenced by on_config_close(), and save_winpos().
void save_msgctrl_configuration | ( | void | ) |
Applies the current state of the checkboxes to the msgctrl_widgets state variables and saves the settings to disk so the configuration persists across client sessions.
Definition at line 1522 of file info.c.
References buffer_control, config_dir, buffer_control_t::count, draw_ext_info(), LOG(), LOG_DEBUG, LOG_WARNING, make_path_to_file(), MAX_BUF, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_CONFIG, MSG_TYPE_CLIENT_ERROR, MSG_TYPE_LAST, msgctrl_widgets, NDI_BLUE, NDI_RED, NUM_TEXT_VIEWS, read_msgctrl_configuration(), buffer_parameter_t::state, and buffer_control_t::timer.
Referenced by on_msgctrl_button_save_clicked().
void save_winpos | ( | ) |
Save client window positions to a file unique to each layout.
Definition at line 793 of file config.c.
References config, draw_ext_info(), get_window_coord(), MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_CONFIG, NDI_BLUE, save_defaults(), ui_name(), window_root, and window_xml.
Referenced by on_save_window_position_activate().
void sdl_gen_map | ( | int | redraw | ) |
int sdl_mapscroll | ( | int | dx, |
int | dy | ||
) |
void set_text_tag_from_style | ( | GtkTextTag * | tag, |
GtkStyle * | style, | ||
const GtkStyle *const | base_style | ||
) |
Sets attributes in the text tag from a style. Best I can gather, there is no way to take all of the attributes from a style and apply them directly to a text tag, hence this function to do the work. GtkTextTags also know what attributes are set and which are not set - thus, you can apply multiple tags to the same text, and get all of the effects. For styles, that isn't the case - a style contains all of the information. So this function also compares the loaded style from the base style, and only sets the attributes that are different.
tag | Text tag to set values on. |
style | Style name to get values from. |
base_style | Base style for the widget to compare against. |
Definition at line 317 of file info.c.
Referenced by add_style_to_textbuffer(), and info_get_styles().
void set_weight_limit | ( | guint32 | wlim | ) |
No reason to divide by 1000 everytime we do the display, so do it once and store it here.
wlim |
Definition at line 693 of file inventory.c.
References weight_limit.
void show_main_client | ( | ) |
Show main client window. Called after connect if server does not support new loginmethod, or after character is selected.
Definition at line 466 of file main.c.
References clear_stat_mapping(), hide_all_login_windows(), map_init(), and window_root.
Referenced by main().
void Sound2Cmd | ( | unsigned char * | data, |
int | len | ||
) |
Parse the data contained by a sound2 command coming from the server and handle playing the specified sound. See server doc/Developers/sound for details.
data | Data provided following the sound2 command from the server. |
len | Length of the sound2 command data. |
Format of the sound2 command recieved in data:
sound2 {x}{y}{dir}{volume}{type}{len_sound}{sound}{len_source}{source} b b b b b b str b str
Definition at line 38 of file sound.c.
References cf_play_sound(), CONFIG_SOUND, LOG(), LOG_WARNING, and use_config.
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 66 of file spells.c.
References LOG(), LOG_INFO, spell_styles, Style_Last, and Style_Names.
Referenced by load_theme(), and on_spells_activate().
void start_login | ( | int | method | ) |
Starts the login process. If not already done, gets widgets, sets up callboacks, etc. This is at the end of the file so all the callbacks are defined before this function - in that way, we do not need forward declarations. This is called from SetupCmd in common/commands.c
method | Login method that the server suppots. |
Definition at line 1263 of file account.c.
References entry_account_name, entry_account_password, has_init, INFO_MOTD, INFO_NEWS, INFO_RULES, init_account_password_window(), init_add_character_window(), init_choose_char_window(), init_create_account_window(), init_login_window(), init_new_character_window(), serverloginmethod, and update_login_info().
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 109 of file stats.c.
References bar_colors, has_init, LOG(), LOG_INFO, MAX_BUF, MAX_STAT_BARS, NUM_STYLES, stat_bar, stat_bar_names, and stat_style_names.
Referenced by load_theme().
void stats_init | ( | GtkWidget * | window_root | ) |
Associate the XML-defined widgets with pointers by name reference.
*window_root |
Definition at line 147 of file stats.c.
References StatWindow::ac, StatWindow::armor, StatWindow::Cha, StatWindow::Con, StatWindow::dam, StatWindow::Dex, StatWindow::exp, StatWindow::Int, lastmax, lastval, StatWindow::level, MAX_BUF, MAX_STAT_BARS, StatWindow::playername, StatWindow::Pow, PROTECTION_BOXES_X, PROTECTION_BOXES_Y, StatWindow::range, StatWindow::resists, SKILL_BOXES_X, SKILL_BOXES_Y, StatWindow::skill_exp, StatWindow::speed, stat_bar, stat_bar_names, statwindow, StatWindow::Str, StatWindow::table_protections, StatWindow::table_skills_exp, StatWindow::wc, StatWindow::weapon_speed, window_xml, and StatWindow::Wis.
Referenced by init_ui().
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.
iter | |
model | |
use_skill |
Definition at line 197 of file skills.c.
References LIST_NAME, LOG(), LOG_ERROR, MAX_BUF, send_command(), and use_skill().
Referenced by on_skill_ready_clicked(), on_skill_treeview_row_activated(), and on_skill_use_clicked().
void update_character_choose | ( | const char * | name, |
const char * | class, | ||
const char * | race, | ||
const char * | face, | ||
const char * | party, | ||
const char * | map, | ||
int | level, | ||
int | faceno | ||
) |
This gets data and adds it to the list store. This is called from AccountPlayersCmd and data is from the accountplayers protocol command. The parameters are data to add to the list store.
name | |
class | |
race | |
face | |
party | |
map | |
level | |
faceno |
Definition at line 547 of file account.c.
References CHAR_CLASS, CHAR_ICON, CHAR_IMAGE, CHAR_LEVEL, CHAR_MAP, CHAR_NAME, CHAR_PARTY, CHAR_RACE, character_store, map, and pixmaps.
void update_login_info | ( | int | type | ) |
This is called from ReplyInfoCmd when it gets a response from news/motd/rules. It is very possible that the window will get displayed before we got a reply response, so this tells the client to update it.
type | What data just got updated - text string of motd/news/rules |
Definition at line 1174 of file account.c.
References add_marked_text_to_pane(), BIG_BUF, has_init, INFO_MOTD, INFO_NEWS, INFO_RULES, login_pane, motd, news, rules, textbuf_motd, textbuf_news, textbuf_rules_account, textbuf_rules_char, TEXTVIEW_MOTD, TEXTVIEW_NEWS, TEXTVIEW_RULES_ACCOUNT, and TEXTVIEW_RULES_CHAR.
Referenced by start_login().
void update_msgctrl_configuration | ( | void | ) |
Update the state of the message control dialog so the configuration matches the currently selected settings. Do not call this before msgctrl_widgets[] is initialized. It also really only makes sense to call it if changes have been made to msgctrl_widgets[].
Definition at line 1492 of file info.c.
References message_control_t::buffer, buffer_control, buffer_control_t::count, MSG_TYPE_LAST, msgctrl_widgets, NUM_TEXT_VIEWS, buffer_parameter_t::ptr, buffer_parameter_t::state, boolean_widget_t::state, and buffer_control_t::timer.
Referenced by default_msgctrl_configuration(), and load_msgctrl_configuration().
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, 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().
void update_spell_information | ( | void | ) |
When spell information updates, the treeview is cleared and re-populated. The clear/re-populate is easier than "editing" the contents.
Definition at line 190 of file spells.c.
References Stat_struct::attuned, cpl, Spell_struct::dam, Stat_struct::denied, Spell_struct::face, PixmapInfo::full_icon_image, Spell_struct::grace, has_init, Spell_struct::level, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, LIST_IMAGE, 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, pixmaps, 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, and Spell_struct::tag.
Referenced by client_tick(), load_theme(), and on_spells_activate().
void update_stat | ( | int | stat_no, |
gint64 | max_stat, | ||
gint64 | current_stat, | ||
gint64 | statbar_max, | ||
gint64 | statbar_stat, | ||
int | can_alert | ||
) |
Updates the stat bar and text display as it pertains to a specific stat.
stat_no | The stat number to update. |
max_stat | The normal maximum value this stat can have. Note that within game terms, the actual value can go above this via supercharging stats. |
current_stat | current value of the stat. |
statbar_max | |
statbar_stat | this 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_alert | Whether 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 291 of file stats.c.
References bar_colors, CONFIG_GRAD_COLOR, format_si_number(), lastmax, lastval, stat_bar, STAT_BAR_EXP, STYLE_GRAD_LOW, STYLE_GRAD_NORMAL, STYLE_GRAD_SUPER, STYLE_LOW, STYLE_NORMAL, STYLE_SUPER, and use_config.
Referenced by draw_message_window().