Freeciv-3.1
|
#include <gtk/gtk.h>
#include "astring.h"
#include "support.h"
#include "actions.h"
#include "game.h"
#include "traderoutes.h"
#include "movement.h"
#include "research.h"
#include "unit.h"
#include "unitlist.h"
#include "dialogs_g.h"
#include "chatline.h"
#include "choice_dialog.h"
#include "client_main.h"
#include "climisc.h"
#include "connectdlg_common.h"
#include "control.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapview.h"
#include "packhand.h"
#include "text.h"
#include "citydlg.h"
#include "dialogs.h"
#include "unitselextradlg.h"
#include "unitselunitdlg.h"
#include "wldlg.h"
Go to the source code of this file.
Data Structures | |
struct | action_data |
Macros | |
#define | BUTTON_NEW_UNIT_TGT (ACTION_COUNT + 1) |
#define | BUTTON_NEW_EXTRA_TGT (BUTTON_NEW_UNIT_TGT + 1) |
#define | BUTTON_LOCATION (BUTTON_NEW_EXTRA_TGT + 1) |
#define | BUTTON_WAIT (BUTTON_LOCATION + 1) |
#define | BUTTON_CANCEL (BUTTON_WAIT + 1) |
#define | BUTTON_COUNT (BUTTON_CANCEL + 1) |
#define | BUTTON_NOT_THERE -1 |
Functions | |
static struct action_data * | act_data (action_id act_id, int actor_id, int target_city_id, int target_unit_id, int target_tile_id, int target_building_id, int target_tech_id, int tgt_extra_id) |
static void | diplomat_queue_handle_primary (void) |
static void | diplomat_queue_handle_secondary (void) |
void | action_selection_no_longer_in_progress_gui_specific (int actor_id) |
static action_id | get_non_targeted_action_id (action_id tgt_action_id) |
static action_id | get_production_targeted_action_id (action_id tgt_action_id) |
static void | simple_action_callback (GtkWidget *w, gpointer data) |
static void | request_action_details_callback (GtkWidget *w, gpointer data) |
static void | found_city_callback (GtkWidget *w, gpointer data) |
static void | upgrade_callback (GtkWidget *w, gpointer data) |
static void | bribe_response (GtkWidget *w, gint response, gpointer data) |
void | popup_bribe_dialog (struct unit *actor, struct unit *punit, int cost, const struct action *paction) |
static void | spy_advances_response (GtkWidget *w, gint response, gpointer data) |
static void | spy_advances_callback (GtkTreeSelection *select, gpointer data) |
static void | create_advances_list (struct player *pplayer, struct player *pvictim, struct action_data *args) |
static void | spy_improvements_response (GtkWidget *w, gint response, gpointer data) |
static void | spy_improvements_callback (GtkTreeSelection *select, gpointer data) |
static void | create_improvements_list (struct player *pplayer, struct city *pcity, struct action_data *args) |
static void | spy_steal_popup_shared (GtkWidget *w, gpointer data) |
static void | spy_steal_popup (GtkWidget *w, gpointer data) |
static void | spy_steal_esc_popup (GtkWidget *w, gpointer data) |
void | popup_sabotage_dialog (struct unit *actor, struct city *pcity, const struct action *paction) |
static void | incite_response (GtkWidget *w, gint response, gpointer data) |
void | popup_incite_dialog (struct unit *actor, struct city *pcity, int cost, const struct action *paction) |
static void | tgt_unit_change_callback (GtkWidget *dlg, gint arg) |
static void | act_sel_new_unit_tgt_callback (GtkWidget *w, gpointer data) |
static void | tgt_extra_change_callback (GtkWidget *dlg, gint arg) |
static void | act_sel_new_extra_tgt_callback (GtkWidget *w, gpointer data) |
static void | act_sel_location_callback (GtkWidget *w, gpointer data) |
static void | act_sel_wait_callback (GtkWidget *w, gpointer data) |
static void | act_sel_destroy_callback (GtkWidget *w, gpointer data) |
static void | act_sel_cancel_callback (GtkWidget *w, gpointer data) |
static void | act_sel_close_callback (GtkWidget *w, gint response_id, gpointer data) |
static void | action_entry (GtkWidget *shl, action_id act_id, const struct act_prob *act_probs, const char *custom, action_id act_num) |
static void | action_entry_update (GtkWidget *shl, action_id act_id, const struct act_prob *act_probs, const char *custom, action_id act_num) |
void | popup_action_selection (struct unit *actor_unit, struct city *target_city, struct unit *target_unit, struct tile *target_tile, struct extra_type *target_extra, const struct act_prob *act_probs) |
int | action_selection_actor_unit (void) |
int | action_selection_target_city (void) |
int | action_selection_target_unit (void) |
int | action_selection_target_tile (void) |
int | action_selection_target_extra (void) |
void | action_selection_refresh (struct unit *actor_unit, struct city *target_city, struct unit *target_unit, struct tile *target_tile, struct extra_type *target_extra, const struct act_prob *act_probs) |
void | action_selection_close (void) |
Variables | |
static GtkWidget * | act_sel_dialog |
static int | action_button_map [BUTTON_COUNT] |
static int | actor_unit_id |
static int | target_ids [ATK_COUNT] |
static int | target_extra_id |
static bool | is_more_user_input_needed = FALSE |
static bool | did_not_decide = FALSE |
static bool | action_selection_restart = FALSE |
static GtkWidget * | spy_tech_shell |
static GtkWidget * | spy_sabotage_shell |
static struct action_data * | act_sel_dialog_data |
static const GCallback | af_map [ACTION_COUNT] |
#define BUTTON_CANCEL (BUTTON_WAIT + 1) |
Definition at line 59 of file action_dialog.c.
#define BUTTON_COUNT (BUTTON_CANCEL + 1) |
Definition at line 60 of file action_dialog.c.
#define BUTTON_LOCATION (BUTTON_NEW_EXTRA_TGT + 1) |
Definition at line 57 of file action_dialog.c.
#define BUTTON_NEW_EXTRA_TGT (BUTTON_NEW_UNIT_TGT + 1) |
Definition at line 56 of file action_dialog.c.
#define BUTTON_NEW_UNIT_TGT (ACTION_COUNT + 1) |
Definition at line 55 of file action_dialog.c.
#define BUTTON_NOT_THERE -1 |
Definition at line 62 of file action_dialog.c.
#define BUTTON_WAIT (BUTTON_LOCATION + 1) |
Definition at line 58 of file action_dialog.c.
|
static |
Create a new action data structure that can be stored in the dialogs.
Definition at line 99 of file action_dialog.c.
Referenced by popup_action_selection(), popup_bribe_dialog(), popup_incite_dialog(), and popup_sabotage_dialog().
|
static |
Action selection dialog has been canceled
Definition at line 1229 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Action selection dialog has been closed
Definition at line 1238 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Action selection dialog has been destroyed
Definition at line 1220 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Callback from action selection dialog for "Show Location".
Definition at line 1191 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Callback from action selection dialog for "Change extra target".
Definition at line 1136 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Callback from action selection dialog for "Change unit target".
Definition at line 1064 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Delay selection of what action to take.
Definition at line 1205 of file action_dialog.c.
Referenced by popup_action_selection().
|
static |
Show the user the action if it is enabled.
Definition at line 1278 of file action_dialog.c.
Referenced by action_selection_refresh(), and popup_action_selection().
|
static |
Update an existing button.
Definition at line 1316 of file action_dialog.c.
Referenced by action_selection_refresh().
int action_selection_actor_unit | ( | void | ) |
Returns the id of the actor unit currently handled in action selection dialog when the action selection dialog is open. Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open.
Definition at line 1592 of file action_dialog.c.
Referenced by action_selection_refresh(), can_ask_server_for_actions(), current_focus_remove(), handle_city_info(), handle_player_diplstate(), handle_unit_actions(), handle_unit_packet_common(), handle_unit_remove(), and unit_focus_set().
void action_selection_close | ( | void | ) |
Closes the action selection dialog
Definition at line 1741 of file action_dialog.c.
Referenced by action_selection_refresh(), current_focus_remove(), handle_unit_remove(), and unit_focus_set().
void action_selection_no_longer_in_progress_gui_specific | ( | int | actor_id | ) |
Let the non shared client code know that the action selection process no longer is in progress for the specified unit.
This allows the client to clean up any client specific assumptions.
Definition at line 186 of file action_dialog.c.
void action_selection_refresh | ( | struct unit * | actor_unit, |
struct city * | target_city, | ||
struct unit * | target_unit, | ||
struct tile * | target_tile, | ||
struct extra_type * | target_extra, | ||
const struct act_prob * | act_probs | ||
) |
Updates the action selection dialog with new information.
Definition at line 1662 of file action_dialog.c.
Referenced by handle_unit_actions(), and choice_dialog::update_dialog().
int action_selection_target_city | ( | void | ) |
Returns id of the target city of the actions currently handled in action selection dialog when the action selection dialog is open and it has a city target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open or no city target is present in the action selection dialog.
Definition at line 1606 of file action_dialog.c.
Referenced by handle_city_info(), and handle_player_diplstate().
int action_selection_target_extra | ( | void | ) |
Returns id of the target extra of the actions currently handled in action selection dialog when the action selection dialog is open and it has an extra target. Returns EXTRA_NONE if no action selection dialog is open or no extra target is present in the action selection dialog.
Definition at line 1650 of file action_dialog.c.
Referenced by handle_city_info(), handle_player_diplstate(), handle_unit_packet_common(), choice_dialog::switch_target(), tgt_extra_change_callback(), and tgt_unit_change_callback().
int action_selection_target_tile | ( | void | ) |
Returns id of the target tile of the actions currently handled in action selection dialog when the action selection dialog is open and it has a tile target. Returns TILE_INDEX_NONE if no action selection dialog is open.
Definition at line 1635 of file action_dialog.c.
Referenced by handle_player_diplstate().
int action_selection_target_unit | ( | void | ) |
Returns id of the target unit of the actions currently handled in action selection dialog when the action selection dialog is open and it has a unit target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open or no unit target is present in the action selection dialog.
Definition at line 1620 of file action_dialog.c.
Referenced by handle_city_info(), handle_player_diplstate(), handle_unit_packet_common(), and tgt_extra_change_callback().
|
static |
User responded to bribe dialog
Definition at line 459 of file action_dialog.c.
Referenced by popup_bribe_dialog().
|
static |
Create spy's tech stealing dialog
Definition at line 574 of file action_dialog.c.
Referenced by spy_steal_popup_shared().
|
static |
Creates spy's building sabotaging dialog
Definition at line 764 of file action_dialog.c.
Referenced by popup_sabotage_dialog().
|
static |
Move the queue of units that need user input forward unless the current unit is going to need more input.
Definition at line 126 of file action_dialog.c.
Referenced by act_sel_destroy_callback(), diplomat_queue_handle_secondary(), diplomat_queue_handle_secondary(), and popup_action_selection().
|
static |
Move the queue of units that need user input forward since the current unit doesn't require the extra input any more.
Definition at line 173 of file action_dialog.c.
Referenced by bribe_response(), incite_response(), popup_bribe_dialog(), popup_incite_dialog(), popup_sabotage_dialog(), spy_advances_response(), spy_improvements_response(), and spy_steal_shared().
|
static |
User selected build city from the choice dialog
Definition at line 421 of file action_dialog.c.
Get the non targeted version of an action so it, if enabled, can appear in the target selection dialog.
Definition at line 196 of file action_dialog.c.
Referenced by create_advances_list(), create_improvements_list(), popup_sabotage_dialog(), sabotage_impr_callback(), spy_advances_response(), spy_improvements_response(), spy_steal_callback(), and spy_steal_popup_shared().
Get the production targeted version of an action so it, if enabled, can appear in the target selection dialog.
Definition at line 219 of file action_dialog.c.
Referenced by create_improvements_list(), popup_sabotage_dialog(), sabotage_impr_callback(), and spy_improvements_response().
|
static |
User has responded to incite dialog
Definition at line 954 of file action_dialog.c.
Referenced by popup_incite_dialog().
void popup_action_selection | ( | struct unit * | actor_unit, |
struct city * | target_city, | ||
struct unit * | target_unit, | ||
struct tile * | target_tile, | ||
struct extra_type * | target_extra, | ||
const struct act_prob * | act_probs | ||
) |
Popup a dialog that allows the player to select what action a unit should take.
Definition at line 1350 of file action_dialog.c.
void popup_bribe_dialog | ( | struct unit * | actor, |
struct unit * | punit, | ||
int | cost, | ||
const struct action * | paction | ||
) |
Popup unit bribe dialog
Definition at line 478 of file action_dialog.c.
void popup_incite_dialog | ( | struct unit * | actor, |
struct city * | pcity, | ||
int | cost, | ||
const struct action * | paction | ||
) |
Popup the yes/no dialog for inciting, since we know the cost now
Definition at line 973 of file action_dialog.c.
Referenced by handle_unit_action_answer().
void popup_sabotage_dialog | ( | struct unit * | actor, |
struct city * | pcity, | ||
const struct action * | paction | ||
) |
Pops-up the Spy sabotage dialog, upon return of list of available improvements requested by the above function.
Definition at line 938 of file action_dialog.c.
Referenced by handle_city_sabotage_list().
|
static |
User selected an action from the choice dialog that needs details from the server.
Definition at line 347 of file action_dialog.c.
|
static |
User selected an action from the choice dialog and the action has no special needs.
Definition at line 240 of file action_dialog.c.
Referenced by action_entry(), and action_entry().
|
static |
User selected entry in steal advances dialog
Definition at line 550 of file action_dialog.c.
Referenced by create_advances_list().
|
static |
User responded to steal advances dialog
Definition at line 517 of file action_dialog.c.
Referenced by create_advances_list().
|
static |
User has selected new building from spy's sabotage dialog
Definition at line 741 of file action_dialog.c.
Referenced by create_improvements_list().
|
static |
User has responded to spy's sabotage building dialog
Definition at line 701 of file action_dialog.c.
Referenced by create_improvements_list().
|
static |
Popup tech stealing dialog with list of possible techs for "Targeted Steal Tech Escape Expected"
Definition at line 928 of file action_dialog.c.
|
static |
Popup tech stealing dialog with list of possible techs for "Targeted Steal Tech"
Definition at line 918 of file action_dialog.c.
|
static |
Popup tech stealing dialog with list of possible techs
Definition at line 882 of file action_dialog.c.
Referenced by spy_steal_esc_popup(), spy_steal_esc_popup(), spy_steal_popup(), and spy_steal_popup().
|
static |
Callback from the extra target selection dialog.
Definition at line 1092 of file action_dialog.c.
Referenced by act_sel_new_extra_tgt_callback().
|
static |
Callback from the unit target selection dialog.
Definition at line 1020 of file action_dialog.c.
Referenced by act_sel_new_unit_tgt_callback().
|
static |
User selected "Upgrade Unit" from choice dialog.
Definition at line 436 of file action_dialog.c.
|
static |
Definition at line 65 of file action_dialog.c.
Referenced by act_sel_cancel_callback(), act_sel_close_callback(), act_sel_close_callback(), act_sel_destroy_callback(), act_sel_new_extra_tgt_callback(), act_sel_new_unit_tgt_callback(), action_entry_update(), action_selection_actor_unit(), action_selection_close(), action_selection_refresh(), action_selection_target_city(), action_selection_target_extra(), action_selection_target_tile(), action_selection_target_unit(), found_city_callback(), popup_action_selection(), request_action_details_callback(), simple_action_callback(), spy_steal_popup_shared(), and upgrade_callback().
|
static |
Definition at line 93 of file action_dialog.c.
Referenced by act_sel_cancel_callback(), act_sel_close_callback(), act_sel_close_callback(), act_sel_location_callback(), act_sel_new_extra_tgt_callback(), act_sel_new_unit_tgt_callback(), act_sel_wait_callback(), action_selection_refresh(), found_city_callback(), popup_action_selection(), request_action_details_callback(), simple_action_callback(), spy_steal_esc_popup(), spy_steal_popup(), and upgrade_callback().
|
static |
Definition at line 66 of file action_dialog.c.
Referenced by action_entry(), action_entry_update(), action_selection_refresh(), and popup_action_selection().
Definition at line 73 of file action_dialog.c.
Referenced by act_sel_new_extra_tgt_callback(), act_sel_new_unit_tgt_callback(), and diplomat_queue_handle_primary().
|
static |
Definition at line 68 of file action_dialog.c.
Referenced by act_sel_done_primary(), act_sel_done_secondary(), action_selection_actor_unit(), caravan_establish_trade(), caravan_marketplace(), diplomat_queue_handle_primary(), diplomat_queue_handle_primary(), handle_unit_actions(), handle_unit_get_actions(), and popup_action_selection().
|
static |
Definition at line 1248 of file action_dialog.c.
Referenced by action_entry(), and action_entry().
Definition at line 72 of file action_dialog.c.
Referenced by act_sel_done_primary(), act_sel_new_extra_tgt_callback(), act_sel_new_unit_tgt_callback(), action_selection_close(), and diplomat_queue_handle_primary().
Definition at line 71 of file action_dialog.c.
Referenced by act_sel_done_primary(), act_sel_done_secondary(), action_selection_no_longer_in_progress_gui_specific(), diplomat_bribe_callback(), diplomat_incite_callback(), diplomat_queue_handle_primary(), diplomat_queue_handle_secondary(), exit_spy_tgt_dlg_callback(), popup_action_selection(), popup_bribe_dialog(), popup_incite_dialog(), popup_sabotage_dialog(), request_action_details_callback(), sabotage_impr_callback(), spy_incite_callback(), spy_sabotage_esc_request(), spy_sabotage_request(), spy_steal_callback(), spy_steal_popup_shared(), spy_steal_popup_shared(), and spy_strike_bld_request().
|
static |
Definition at line 77 of file action_dialog.c.
Referenced by create_improvements_list(), popup_sabotage_dialog(), spy_improvements_callback(), and spy_improvements_response().
|
static |
Definition at line 75 of file action_dialog.c.
Referenced by create_advances_list(), spy_advances_callback(), spy_advances_response(), and spy_steal_popup_shared().
|
static |
Definition at line 70 of file action_dialog.c.
Referenced by action_selection_target_extra(), dsend_packet_unit_actions(), dsend_packet_unit_get_actions(), handle_unit_get_actions(), popup_action_selection(), receive_packet_unit_actions_100(), receive_packet_unit_actions_101(), receive_packet_unit_get_actions_100(), and receive_packet_unit_get_actions_101().
|
static |
Definition at line 69 of file action_dialog.c.
Referenced by action_selection_target_city(), action_selection_target_tile(), action_selection_target_unit(), and popup_action_selection().