 |
Crossfire Client, Trunk
|
Go to the documentation of this file.
19 extern 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);
53 extern void addsmooth(guint16 face, guint16 smooth_face);
67 extern void draw_ext_info(
int orig_color,
int type,
int subtype,
const char *message);
102 extern void focusoutfunc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window);
103 extern void keyrelfunc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window);
104 extern void keyfunc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window);
118 extern gboolean
keybinding_selection_func(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata);
124 extern void error_dialog(
char *description,
char *information);
125 extern void my_log_handler(
const gchar *log_domain, GLogLevelFlags log_level,
const gchar *message, gpointer user_data);
126 extern int main(
int argc,
char *argv[]);
127 extern void get_window_coord(GtkWidget *win,
int *x,
int *y,
int *wx,
int *wy,
int *w,
int *h);
200 extern 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);
213 extern void play_sound_effect(gint8 x, gint8 y, guint8 dir, guint8 vol, guint8 type,
const char *sound,
const char *source);
214 extern void Sound2Cmd(
unsigned char *data,
int len);
215 extern void MusicCmd(
const char *data,
int len);
228 extern void update_stat(
int stat_no, gint64 max_stat, gint64 current_stat, gint64 statbar_max, gint64 statbar_stat,
int can_alert);
void update_msgctrl_configuration(void)
Update the state of the message control dialog so the configuration matches the currently selected se...
void on_menu_gloves_activate(GtkMenuItem *menuitem, gpointer user_data)
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,...
void init_glx_opengl(GtkWidget *drawingarea)
static gboolean redraw(gpointer data)
Redraw the map.
void addsmooth(guint16 face, guint16 smooth_face)
Referenced from common/commands.c.
void update_keybinding_list(void)
Update the keybinding dialog to reflect the current state of the keys file.
void draw_look_list(void)
Draws the objects beneath the player.
void init_menu_items()
Initialize menu bar items and connect their signals to their handlers.
void client_pickup(guint32 pickup)
We get pickup information from server, update our status.
void load_window_positions(GtkWidget *window_root)
Resize the client window and its panels using saved window positions.
void create_character_window_show()
This function is here so that other files, in particular account.c:on_button_create_character_clicked...
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)...
void update_login_info(int type)
This is called from ReplyInfoCmd when it gets a response from news/motd/rules.
void on_menu_containers_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_entry_commands_activate(GtkEntry *entry, gpointer user_data)
Used to process keyboard input whenever the player types commands into the command entry box.
void keyfunc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window)
GTK Callback function used to handle client key press events.
guint8 * png_to_data(guint8 *data, int len, guint32 *width, guint32 *height)
void on_keybindings_activate(GtkMenuItem *menuitem, gpointer user_data)
Menubar item to activate keybindings window.
void draw_stats(int redraw)
Draws the stats window.
void on_spell_treeview_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
void keybindings_init(const char *character_name)
Reads in the keybindings, and initializes special values.
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...
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.
void on_entry_account_password_activate(GtkEntry *entry, gpointer user_data)
void on_menu_drinks_activate(GtkMenuItem *menuitem, gpointer user_data)
Used mostly in the cache.c file, however, it can be returned to the graphic side of things so that th...
void on_window_destroy_event(GtkWidget *object, gpointer user_data)
Handles client shutdown.
void on_menu_ratio_15_activate(GtkMenuItem *menuitem, gpointer user_data)
void load_msgctrl_configuration(void)
Setup the state of the message control dialog so the configuration matches a previously saved configu...
void display_map_doneupdate(int redraw, int notice)
This is called after the map has been all digested.
void on_keybinding_button_bind_clicked(GtkButton *button, gpointer user_data)
Sets up a new binding when the "Add" button is clicked.
void info_buffer_init(void)
Output count/sync message buffer initialization to set all buffers empty.
void get_map_image_size(int face, guint8 *w, guint8 *h)
void do_new_image(guint8 *data, PixmapInfo *pi)
Wrapper for accessing outside this file.
void on_menu_missile_weapons_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_button_new_cancel_clicked(GtkButton *button, gpointer user_data)
void map_init(GtkWidget *window_root)
This initializes the stuff we need for the map.
void on_spell_invoke_clicked(GtkButton *button, gpointer user_data)
void on_button_return_character_select_clicked(GtkButton *button, gpointer user_data)
User has hit the return to character selection button.
void on_menu_normal_book_scrolls_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_entry_new_character_name(GtkEntry *entry, gpointer user_data)
User hit return in the new character name box.
void on_skill_close_clicked(GtkButton *button, gpointer user_data)
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.
void on_kb_scope_togglebutton_global_toggled(GtkToggleButton *toggle_button, gpointer user_data)
Called when "All characters" is clicked.
void msgctrl_init(GtkWidget *window_root)
Initialize the message control panel by populating it with descriptions of each message type along wi...
void read_msgctrl_configuration(void)
Reads the state of the message control dialog and applies the settings to the msgctrl_widgets[] state...
void account_show_login(void)
int associate_cache_entry(Cache_Entry *ce, int pixnum)
This functions associates image_data in the cache entry with the specific pixmap number.
void on_button_play_character_clicked(GtkButton *button, gpointer user_data)
User has hit the play character button.
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 appl...
void trigger_skill(GtkTreeIter iter, GtkTreeModel *model, int use_skill)
This is where we actually do something with the skill.
void on_button_do_add_character_clicked(GtkButton *button, gpointer user_data)
User has hit the add character button.
void on_menu_stop_before_pickup_activate(GtkMenuItem *menuitem, gpointer user_data)
void start_login(int method)
Starts the login process.
void on_button_go_metaserver_clicked(GtkButton *button, gpointer user_data)
User hit the go to metaserver button.
void map_check_resize(void)
Calculate and set desired map size based on map window size.
void on_menu_ratio_pickup_off_activate(GtkMenuItem *menuitem, gpointer user_data)
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.
void on_menu_flesh_activate(GtkMenuItem *menuitem, gpointer user_data)
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 clien...
void on_menu_arrows_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_spells_activate(GtkMenuItem *menuitem, gpointer user_data)
gboolean on_keybinding_entry_key_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
Respond to a key press in the "Key" input box.
void default_msgctrl_configuration(void)
Setup the state of the message control dialog so the configuration matches the default settings built...
void on_skills_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_configure_activate(GtkWidget *menuitem, gpointer user_data)
void open_container(item *op)
void init_create_character_window()
Initializes the create character window.
gboolean on_window_delete_event(GtkWidget *window, gpointer *user_data)
Prevent delete_event closure and/or hiding of account windows.
void save_defaults(void)
This function saves user settings chosen using the configuration popup dialog.
void sdl_gen_map(int redraw)
void save_winpos(void)
Save client window positions to a file unique to each layout.
void on_menu_all_weapons_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_50_activate(GtkMenuItem *menuitem, gpointer user_data)
void menu_clear(void)
Clears all the message panels.
void pickup_init(GtkWidget *window_root)
Maps the menuitem lists into pickup values.
void draw_message_window(int redraw)
Updates the stats pane - hp, sp, etc labels.
void info_init(GtkWidget *window_root)
Initialize the information panels in the client.
void reset_image_data(void)
Connecting to different servers, try to clear out any old images.
void create_character_window_hide()
Basically opposite as above - hide the create character windows - this is called from hide_all_login_...
void on_keybinding_button_update_clicked(GtkButton *button, gpointer user_data)
Implements the "Update Binding" button to update the currently selected keybinding to match the curre...
void on_menu_jewels_activate(GtkMenuItem *menuitem, gpointer user_data)
void focusoutfunc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window)
When the main window looses its focus, act as if all keys have been released.
void on_spell_cast_clicked(GtkButton *button, gpointer user_data)
void on_menu_ratio_35_activate(GtkMenuItem *menuitem, gpointer user_data)
int display_mapscroll(int dx, int dy)
void on_menu_food_activate(GtkMenuItem *menuitem, gpointer user_data)
void account_login_failure(char *message)
Handles a failure from the server - pretty basic - just throw up the message and let the user try aga...
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.
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.
void init_opengl(GtkWidget *drawingarea)
void clear_stat_mapping(void)
void on_menu_spellbooks_activate(GtkMenuItem *menuitem, gpointer user_data)
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 aga...
void gtk_complete_command(void)
Executes when the TAB key is pressed while the command input box has focus to give hints on what comm...
void spell_get_styles(void)
Gets the style information for the inventory windows.
void on_keybinding_button_clear_clicked(GtkButton *button, gpointer user_data)
Implements the "Clear Fields" button function on the keybinding dialog.
void Sound2Cmd(unsigned char *data, int len)
Parse the data contained by a sound2 command coming from the server and handle playing the specified ...
void on_entry_character(GtkEntry *entry, gpointer user_data)
User has hit return in either name or password box.
void init_image_cache_data(void)
Initializes the data for image caching Create question mark to display in each supported rendering mo...
void on_menu_boots_activate(GtkMenuItem *menuitem, gpointer user_data)
int sdl_mapscroll(int dx, int dy)
void on_menu_magical_items_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_spell_close_clicked(GtkButton *button, gpointer user_data)
void draw_lists(void)
Redraws inventory and look windows when necessary.
void on_menu_bows_activate(GtkMenuItem *menuitem, gpointer user_data)
void create_new_character_failure(char *message)
Pop up a dialog window with the error from the server.
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 redra...
void item_event_container_clearing(item *container)
void inventory_init(GtkWidget *window_root)
Set up the inventory viewer.
void on_button_new_create_account_clicked(GtkButton *button, gpointer user_data)
User clicked on the create account button.
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...
void on_button_create_account_clicked(GtkButton *button, gpointer user_data)
User hit the create account button.
void on_button_create_new_char_clicked(GtkButton *button, gpointer user_data)
User hit the create character button.
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.
void config_init(GtkWidget *window_root)
void metaserver_show_prompt(void)
Constructs the metaserver dialog and handles metaserver selection.
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 cfsndse...
void on_treeview_choose_character_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
void on_menu_ratio_20_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_skill_treeview_row_activated(GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
void info_buffer_flush(const int id)
Handles message buffer flushes, and, as needed, displays the text.
void on_keybinding_button_close_clicked(GtkButton *button, gpointer user_data)
Deactivates the keybinding dialog when the "Close Window" button is clicked.
void metaserver_ui_init()
Initialize the metaserver user interface.
void choose_char_window_show()
Basic little function - this is used because we make the choose_char_window widget private to this fi...
void add_tags_to_textbuffer(Info_Pane *pane, GtkTextBuffer *textbuf)
Adds the various tags to the next buffer.
void on_menu_ratio_25_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_metaserver_select_clicked(GtkButton *button, gpointer user_data)
Establish a connection with the server when pressing the connect button.
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 item_event_item_changed(item *it)
void show_main_client(void)
Show main client window.
void magic_map_flash_pos(void)
Flash the player's position on the magic map.
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 ...
void keys_init(GtkWidget *window_root)
One-time initialization of windows and signals for the keybindings dialog.
void on_menu_helmets_activate(GtkMenuItem *menuitem, gpointer user_data)
void opengl_gen_map(int redraw)
void on_menu_ratio_40_activate(GtkMenuItem *menuitem, gpointer user_data)
void draw_prompt(const char *str)
Draws a prompt.
void on_menu_potions_activate(GtkMenuItem *menuitem, gpointer user_data)
void create_opengl_question_mark(void)
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.
void keyrelfunc(GtkWidget *widget, GdkEventKey *event, GtkWidget *window)
GTK callback function used to handle client key release events.
void on_menu_ratio_5_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_10_activate(GtkMenuItem *menuitem, gpointer user_data)
void reset_keybinding_status(void)
Reset the state of the keybinding dialog.
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.
gboolean on_drawingarea_magic_map_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
int main(int argc, char *argv[])
Main client entry point.
void choose_character_init(void)
Called when we get the accountplayers command from the server (indirectly via AccountPlayersCmd).
void update_spell_information(void)
When spell information updates, the treeview is cleared and re-populated.
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.
void set_text_tag_from_style(GtkTextTag *tag, GtkStyle *style, const GtkStyle *const base_style)
Sets attributes in the text tag from a style.
void on_menu_shields_activate(GtkMenuItem *menuitem, gpointer user_data)
void opengl_free_pixmap(PixmapInfo *pi)
void item_event_item_deleting(item *it)
void inventory_tick(void)
This is called periodically from main.c - basically a timeout, used to animate the inventory.
void config_load(void)
Load settings from the user's configuration file into want_config.
void on_menu_ratio_45_activate(GtkMenuItem *menuitem, gpointer user_data)
cairo_surface_t * rgba_to_cairo_surface(guint8 *data, int width, int height)
Create a Cairo surface for the given RGBA data.
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,...
void update_skill_information(void)
Called whenever the skill window is opened or a stats packet is received.
void unbind_key(const char *params)
void inventory_get_styles(void)
Gets the style information for the inventory windows.
void on_menu_skillscrolls_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_button_login_clicked(GtkButton *button, gpointer user_data)
User hit the login button - just call do_account_login()
void info_get_styles(void)
Loads up values from the style file.
void on_menu_wands_rods_horns_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_entry_account_name_activate(GtkEntry *entry, gpointer user_data)
User hit return in the name entry box.
void on_button_exit_client_clicked(GtkButton *button, gpointer user_data)
User hit the exit client button.
void play_sound_effect(gint8 x, gint8 y, guint8 dir, guint8 vol, guint8 type, const char *sound, const char *source)
void on_menu_body_armor_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_msgctrl_activate(GtkMenuItem *menuitem, gpointer user_data)
Shows the message control dialog when the menu item is activated.
void on_button_create_character_clicked(GtkButton *button, gpointer user_data)
void create_opengl_map_image(guint8 *data, PixmapInfo *pi)
void close_container(item *op)
Open and close_container are now no-ops - since these are now drawn inline as treestores,...
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().
void stats_get_styles(void)
Gets the style information for the stat bars (only portion of the window right now that has custom st...
GdkPixbuf * rgba_to_gdkpixbuf(guint8 *data, int width, int height)
Create a GdkPixbuf for the given RGBA data.
void hide_all_login_windows(void)
Hides all the login related windows.
void gtk_command_history(int direction)
Deals with command history.
void info_buffer_tick(void)
Output count/sync buffer maintainer adds buffer time and output messages.
void on_menu_keys_activate(GtkMenuItem *menuitem, gpointer user_data)
void error_dialog(char *description, char *information)
Display an error message dialog.
void on_entry_new_account(GtkEntry *entry, gpointer user_data)
This handles cases where the user hits return in one of the entry boxes.
void draw_magic_map(void)
void on_menu_cloaks_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_valuables_activate(GtkMenuItem *menuitem, gpointer user_data)
GtkWidget * window_root
In main.c.
void account_creation_failure(char *message)
Handles a failure from the server - pretty basic - just throw up the message and let the user try aga...
void on_kb_scope_togglebutton_character_toggled(GtkToggleButton *toggle_button, gpointer user_data)
Called when "This character" is clicked.
guint8 * rescale_rgba_data(guint8 *data, int *width, int *height, int scale)
Takes png data and scales it accordingly.
void on_button_metaserver_quit_pressed(GtkButton *button, gpointer user_data)
Quits the client application if the quit button is pressed.
gboolean keybinding_selection_func(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
Called when the user clicks one of the entries in the list of keybindings and places information abou...
void on_keybinding_button_remove_clicked(GtkButton *button, gpointer user_data)
Implements the "Remove Binding" button function that unbinds the currently selected keybinding.
void command_show(const char *params)
void on_menu_dont_pickup_activate(GtkMenuItem *menuitem, gpointer user_data)
void draw_map(void)
Draw the map window using the appropriate backend.
void use_skill(int skill_id)
Maintain the last_used_skills LRU list for displaying the recently used skills first.
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.
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.
void on_menu_not_cursed_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_30_activate(GtkMenuItem *menuitem, gpointer user_data)
void on_keybinding_checkbutton_any_clicked(GtkCheckButton *cb, gpointer user_data)
Deactivate the modifier checkboxes if "Any" is selected.
void load_theme(int reload)
void client_tick(guint32 tick)
Called whenever the server sends a tick command.
void stats_init(GtkWidget *window_root)
Associate the XML-defined widgets with pointers by name reference.
void on_skill_use_clicked(GtkButton *button, gpointer user_data)
void save_msgctrl_configuration(void)
Applies the current state of the checkboxes to the msgctrl_widgets state variables and saves the sett...
void config_check()
Check that want_config is valid, copy the new configuration to use_config, and apply the new configur...
void on_skill_ready_clicked(GtkButton *button, gpointer user_data)
void bind_key(char *params)
Implements the "bind" command when entered as a text command.