Freeciv-3.2
|
Go to the source code of this file.
Data Structures | |
struct | act_confirmation_data |
Enumerations | |
enum | cursor_hover_state { HOVER_NONE = 0 , HOVER_GOTO , HOVER_TELEPORT , HOVER_PARADROP , HOVER_CONNECT , HOVER_PATROL , HOVER_ACT_SEL_TGT , HOVER_GOTO_SEL_TGT } |
enum | quickselect_type { SELECT_POPUP = 0 , SELECT_SEA , SELECT_LAND , SELECT_APPEND , SELECT_FOCUS } |
#define SPECENUM_COUNT SELLOC_COUNT |
#define SPECENUM_VALUE0 SELTYPE_SINGLE |
#define SPECENUM_VALUE1 SELTYPE_SAME |
#define SPECENUM_VALUE1 SELLOC_TILE /* Tile. */ |
#define SPECENUM_VALUE2 SELTYPE_ALL |
#define SPECENUM_VALUE2 SELLOC_CONT /* Continent. */ |
#define SPECENUM_VALUE3 SELLOC_LAND /* Move type: land. */ |
#define SPECENUM_VALUE5 SELLOC_BOTH /* Move type: both. */ |
#define SPECENUM_VALUE6 SELLOC_WORLD /* World. */ |
void action_confirmation | ( | struct act_confirmation_data * | data, |
bool | confirm | ||
) |
GUI (likely user) either confirmed the action, or not. Even if not, we have to free the data.
Definition at line 1766 of file control.c.
Referenced by act_conf_response(), gui_request_action_confirmation(), popup_act_confirmation_dialog(), and request_action_confirmation().
Have the server record that a decision no longer is wanted for the specified unit.
Definition at line 1080 of file control.c.
Referenced by act_sel_done_primary(), action_decision_maybe_auto(), diplomat_queue_handle_primary(), diplomat_queue_handle_primary(), handle_city_sabotage_list(), handle_unit_action_answer(), and handle_unit_actions().
Request that the player makes a decision for the specified unit.
Definition at line 1110 of file control.c.
Referenced by action_decision_handle(), and action_decision_maybe_auto().
Move on to the next unit in focus that needs an action decision.
Definition at line 1092 of file control.c.
Referenced by act_sel_done_primary(), diplomat_queue_handle_primary(), diplomat_queue_handle_primary(), handle_city_sabotage_list(), handle_unit_action_answer(), handle_unit_actions(), and handle_unit_remove().
The action selection process is no longer in progress for the specified unit. It is safe to let another unit enter action selection.
Definition at line 1051 of file control.c.
Referenced by act_sel_done_primary(), diplomat_queue_handle_primary(), diplomat_queue_handle_primary(), handle_city_sabotage_list(), handle_unit_action_answer(), handle_unit_actions(), tgt_extra_change_callback(), and tgt_unit_change_callback().
Center on the focus unit, if off-screen and auto_center_on_unit is true.
Definition at line 434 of file control.c.
Referenced by handle_new_year(), popup_action_selection(), popup_bribe_dialog(), popup_incite_dialog(), popup_sabotage_dialog(), and unit_focus_set().
Blink the active unit (if necessary). Return the time until the next blink (in seconds).
Definition at line 892 of file control.c.
Referenced by real_timer_callback().
Blink the turn done button (if necessary). Return the time until the next blink (in seconds).
Definition at line 925 of file control.c.
Referenced by real_timer_callback().
bool can_unit_do_connect | ( | struct unit * | punit, |
enum unit_activity | activity, | ||
struct extra_type * | tgt | ||
) |
Return whether the unit can connect with given activity (or with any activity if activity arg is set to ACTIVITY_IDLE)
This function is client-specific.
Definition at line 1415 of file control.c.
Referenced by can_units_do_connect(), and real_menus_update().
Do not build city after all. Cancel city building mark from all units prepared for it.
Definition at line 4110 of file control.c.
Referenced by name_new_city_popup_callback(), newcity_cancel_callback(), and popup_newcity_dialog().
int check_recursive_road_connect | ( | struct tile * | ptile, |
const struct extra_type * | pextra, | ||
const struct unit * | punit, | ||
const struct player * | pplayer, | ||
int | rec | ||
) |
Fill orders to build recursive roads. This modifies ptile, so virtual copy of the real tile should be passed.
Definition at line 1337 of file control.c.
Referenced by can_unit_do_connect(), check_recursive_road_connect(), and get_activity_time().
Clear current hover state (go to HOVER_NONE).
Definition at line 328 of file control.c.
Referenced by control_free(), control_unit_killed(), do_map_click(), do_move_unit(), do_unit_connect(), do_unit_patrol_to(), handle_game_info(), key_cancel_action(), key_unit_action_select_tgt(), paradrop_here_callback(), release_goto_button(), map_view::shortcut_pressed(), unit_focus_add(), unit_focus_advance(), unit_focus_remove(), and unit_focus_set().
Clear all orders for the given unit.
Definition at line 481 of file control.c.
Referenced by current_focus_append(), request_unit_move_done(), and send_goto_route().
Called only by client_game_free() in client/client_main.c
Definition at line 154 of file control.c.
Referenced by client_game_free(), and client_game_reset().
Called only by client_game_init() in client/client_main.c
Definition at line 137 of file control.c.
Referenced by client_game_init(), and client_game_reset().
Determines which mouse cursor should be used, according to hover_state, and the information gathered from the tile which is under the mouse cursor (ptile).
Definition at line 1215 of file control.c.
Referenced by anim_cursor_cb(), leave_mapcanvas(), main_mouse_motion_handler(), mouse_scroll_mapcanvas(), mouse_scroll_mapcanvas(), map_view::mouseMoveEvent(), move_mapcanvas(), move_mapcanvas(), request_unit_connect(), request_unit_goto(), set_server_busy(), and mr_menu::slot_delayed_goto().
Called when a unit is killed; this removes it from the control lists.
Definition at line 226 of file control.c.
Referenced by client_remove_unit().
void do_map_click | ( | struct tile * | ptile, |
enum quickselect_type | qtype | ||
) |
Handles everything when the user clicked a tile
Definition at line 2909 of file control.c.
Referenced by action_button_pressed(), butt_down_overviewcanvas(), and left_butt_down_overviewcanvas().
Called to have the client move a unit from one location to another, updating the graphics if necessary. The caller must redraw the target location after the move.
Definition at line 2802 of file control.c.
Referenced by handle_unit_packet_common().
void do_unit_connect | ( | struct tile * | ptile, |
enum unit_activity | activity, | ||
struct extra_type * | tgt | ||
) |
"Connect" to the given location.
Definition at line 3241 of file control.c.
Referenced by do_map_click().
Finish the goto mode and let the units stored in goto_map_list move to a given location.
Definition at line 3124 of file control.c.
Referenced by do_map_click(), and release_goto_button().
Paradrop to a location.
Definition at line 3185 of file control.c.
Referenced by do_map_click(), and paradrop_here_callback().
Patrol to a location.
Definition at line 3225 of file control.c.
Referenced by do_map_click(), and patrol_here_callback().
Return a pointer to a visible unit, if there is one.
Definition at line 822 of file control.c.
Referenced by clipboard_copy_production(), control_mouse_cursor(), get_drawable_unit(), inputline_make_chat_link(), chatwdg::make_link(), overview_tile_color(), popit(), popit(), popup_info_text(), and fc_client::popup_tile_info().
All units ready to build city to the tile should now proceed.
Definition at line 4091 of file control.c.
Referenced by name_new_city_popup_callback(), newcity_ok_callback(), and popup_newcity_dialog().
Return TRUE iff a unit on this tile is in focus.
Definition at line 396 of file control.c.
Referenced by city_packet_common(), client_remove_unit(), find_a_focus_unit_tile_to_center_on(), find_best_focus_candidate(), handle_city_remove(), handle_tile_info(), and handle_unit_packet_common().
Return the number of units currently in focus (0 or more).
Definition at line 185 of file control.c.
Referenced by blink_active_unit(), center_on_something(), client_remove_unit(), control_unit_killed(), do_map_click(), find_a_focus_unit_tile_to_center_on(), handle_unit_packet_common(), maybe_activate_keyboardless_goto(), mr_menu::menus_sensitive(), popup_airlift_dialog(), popup_goto_dialog(), real_menus_update(), real_timer_callback(), request_unit_move_done(), reset_unit_table(), store_previous_focus(), toggle_unit_info_window_callback(), unit_focus_advance(), unit_focus_remove(), unit_focus_set(), unit_focus_update(), unit_goto_city_callback(), unit_goto_city_callback(), and usdlg_tab_append_units().
Returns list of units currently in focus.
Definition at line 177 of file control.c.
Referenced by action_selection_next_in_focus(), goto_dialog::airlift_to(), base_callback(), base_callback(), blink_active_unit(), build_city_callback(), build_city_callback(), build_road_callback(), build_road_callback(), clean_callback(), clean_menu_callback(), client_remove_unit(), control_mouse_cursor(), control_unit_killed(), do_map_click(), do_move_unit(), do_unit_act_sel_vs(), fill_grid_sprite_array(), goto_dialog::fill_tab(), find_visible_unit(), focus_units_changed(), fortify_callback(), fortify_callback(), get_focus_unit_on_tile(), goto_dialog::go_to_city(), goto_cmd_callback(), handle_city_info(), handle_new_year(), handle_unit_packet_common(), irrigation_callback(), is_valid_goto_draw_line(), goto_dialog::item_selected(), key_cancel_action(), key_unit_action_select(), key_unit_action_select_tgt(), key_unit_airbase(), key_unit_assign_battlegroup(), key_unit_auto_explore(), key_unit_auto_settle(), key_unit_build_city(), key_unit_build_wonder(), key_unit_clean(), key_unit_convert(), key_unit_cultivate(), key_unit_extra(), key_unit_fortify(), key_unit_fortress(), key_unit_homecity(), key_unit_move(), key_unit_paradrop(), key_unit_pillage(), key_unit_plant(), key_unit_road(), key_unit_sentry(), key_unit_teleport(), key_unit_trade_route(), key_unit_transform(), key_unit_unload_all(), key_unit_wait(), key_unit_wakeup_others(), leave_mapcanvas(), leave_mapcanvas(), mr_menu::menus_sensitive(), mine_callback(), overview_update_line(), paradrop_here_callback(), patrol_here_callback(), popup_info_text(), real_menus_update(), real_resize_window_callback(), real_set_client_page(), refresh_airlift_button(), refresh_airlift_column(), release_goto_button(), request_unit_connect(), request_unit_goto(), request_unit_move_done(), request_unit_patrol(), request_units_wait(), reset_unit_table(), road_callback(), road_callback(), select_all_on_tile_callback(), select_all_on_tile_callback(), select_same_type_callback(), select_same_type_callback(), select_same_type_cont_callback(), select_same_type_cont_callback(), select_same_type_tile_callback(), select_same_type_tile_callback(), select_single_callback(), select_single_callback(), set_client_state(), set_turn_done_button_state(), mr_menu::slot_board(), mr_menu::slot_build_base(), mr_menu::slot_build_city(), mr_menu::slot_build_path(), mr_menu::slot_build_road(), mr_menu::slot_clean(), mr_menu::slot_deboard(), mr_menu::slot_delayed_goto(), mr_menu::slot_disband(), mr_menu::slot_paradrop(), mr_menu::slot_return_to_city(), mr_menu::slot_select_all_tile(), mr_menu::slot_select_one(), mr_menu::slot_select_same_continent(), mr_menu::slot_select_same_everywhere(), mr_menu::slot_select_same_tile(), mr_menu::slot_upgrade(), store_previous_focus(), tileset_changed(), toggle_unit_info_window_callback(), unit_board_callback(), unit_board_callback(), unit_deboard_callback(), unit_deboard_callback(), unit_disband_callback(), unit_disband_callback(), unit_focus_advance(), unit_focus_update(), unit_is_in_focus(), unit_order_callback(), unit_return_callback(), unit_return_callback(), unit_upgrade_callback(), unit_upgrade_callback(), go_act_menu::update(), hud_units::update_actions(), mr_menu::update_bases_menu(), update_line(), mr_menu::update_roads_menu(), and update_source_label().
Return head of focus units list.
Definition at line 410 of file control.c.
Referenced by center_on_something(), goto_dialog::fill_tab(), find_a_focus_unit_tile_to_center_on(), find_best_focus_candidate(), goto_city_callback(), goto_here_callback(), unit_hud_selector::island_filter(), main_key_down_handler(), main_key_down_handler(), popup_advanced_terrain_dialog(), quickselect(), reset_unit_table(), mr_menu::slot_autocaravan(), toggle_map_window_callback(), unit_focus_advance(), unit_focus_set(), unit_hud_selector::unit_hud_selector(), unit_order_callback(), unit_select_dialog_popup(), unit_actions::update_actions(), hud_units::update_actions(), fc_client::update_info_label(), units_select::update_units(), and usdlg_tile().
Handle user 'toggle bases display' input
Definition at line 3984 of file control.c.
Referenced by show_bases_callback(), and show_bases_callback().
The 'Escape' key.
Definition at line 3258 of file control.c.
Referenced by button_down_on_map(), key_press_map_canvas(), key_press_map_canvas(), map_view::keyPressEvent(), map_event_handler(), and map_event_handler().
Center the mapview on the player's named capital, or print a failure message.
Definition at line 3295 of file control.c.
Referenced by fc_client::create_game_page(), key_press_map_canvas(), and key_press_map_canvas().
Handle user 'toggle cities display' input
Definition at line 4016 of file control.c.
Referenced by show_cities_callback(), and show_cities_callback().
Toggles the showing of the buy cost of the current production in the city descriptions.
Definition at line 3911 of file control.c.
Referenced by show_city_buy_cost_callback(), show_city_buy_cost_callback(), and mr_menu::slot_city_buycost().
Toggle the "Draw the city bar" option.
Definition at line 3885 of file control.c.
Referenced by show_city_full_bar_callback(), show_city_full_bar_callback(), and mr_menu::slot_fullbar().
Toggles the "show city growth turns" option by passing off the request to another function...
Definition at line 3902 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_city_growth_callback(), show_city_growth_callback(), and mr_menu::slot_city_growth().
Handle user 'toggle city names display' input
Definition at line 3893 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_city_names_callback(), show_city_names_callback(), and mr_menu::slot_city_names().
Toggle drawing of city outlines.
Definition at line 3845 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_city_outlines_callback(), show_city_outlines_callback(), and mr_menu::slot_city_outlines().
Toggle drawing of city output produced by workers of the city.
Definition at line 3853 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_city_output_callback(), show_city_output_callback(), and mr_menu::slot_city_output().
Handle user 'toggle city production display' input
Definition at line 3919 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_city_productions_callback(), show_city_productions_callback(), and mr_menu::slot_city_production().
Handle client request to toggle drawing of trade route information by the city name for cities visible on the main map view.
Definition at line 3928 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_city_trade_routes_callback(), show_city_trade_routes_callback(), and mr_menu::slot_city_trade_routes().
Handle user 'toggle coastline display' input
Definition at line 3952 of file control.c.
Referenced by show_coastline_callback(), and show_coastline_callback().
Recalculate borders.
Definition at line 4072 of file control.c.
Referenced by recalc_borders_callback().
Toggle editor mode in the server.
Definition at line 4064 of file control.c.
Referenced by edit_mode_callback(), and edit_mode_callback().
Send a request to the server to toggle fog-of-war for the current player (only applies in edit mode).
Definition at line 4081 of file control.c.
Referenced by toggle_fog_callback(), and toggle_fog_callback().
Handle user 'end turn' input.
Definition at line 3312 of file control.c.
Referenced by end_turn_callback(), map_view::keyPressEvent(), main_key_down_handler(), main_key_down_handler(), side_finish_turn(), toplevel_key_press_handler(), toplevel_key_press_handler(), and unit_focus_advance().
Handle user 'toggle key units display' input
Definition at line 4048 of file control.c.
Referenced by show_focus_unit_callback(), and show_focus_unit_callback().
Handle user 'toggle fog of war display' input
Definition at line 4056 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_fog_of_war_callback(), and show_fog_of_war_callback().
Handle user 'toggle huts display' input
Definition at line 4000 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_huts_callback(), and show_huts_callback().
Handle user 'toggle irrigation display' input
Definition at line 3968 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_irrigation_callback(), and show_irrigation_callback().
Toggle map borders on the mapview on/off based on a keypress.
Definition at line 3869 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_national_borders_callback(), show_national_borders_callback(), and mr_menu::slot_borders().
Handle user 'toggle map grid' input
Definition at line 3861 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_map_grid_callback(), show_map_grid_callback(), and mr_menu::slot_map_grid().
Toggle native tiles on the mapview on/off based on a keypress.
Definition at line 3877 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_native_tiles_callback(), show_native_tiles_callback(), and mr_menu::slot_native_tiles().
Handle user 'toggle mine display' input
Definition at line 3976 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_mine_callback(), and show_mines_callback().
Handle user 'toggle paths display' input
Definition at line 3960 of file control.c.
Referenced by show_paths_callback(), and show_paths_callback().
Handle user 'toggle pollution display' input
Definition at line 4008 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_pollution_callback(), and show_pollution_callback().
Recall the previous focus unit(s). See store_previous_focus().
Definition at line 3320 of file control.c.
Referenced by key_press_map_canvas(), key_press_map_canvas(), map_view::keyPressEvent(), map_event_handler(), and map_event_handler().
Handle user 'toggle resources display' input
Definition at line 3992 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_resources_callback(), and show_resources_callback().
Handle user 'toggle terrain display' input
Definition at line 3944 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_terrain_callback(), and show_terrain_callback().
Handle user 'Do...' input
Definition at line 3384 of file control.c.
Referenced by key_unit_action_select_tgt().
Have the user select what action the unit(s) in focus should perform to the targets at the tile the user will specify by clicking on it.
Will stop asking for a target tile and have each actor unit act against its own tile if called twice.
Definition at line 3406 of file control.c.
Referenced by diplomat_action_callback(), do_action_callback(), mr_menu::slot_action(), and unit_order_callback().
Handle user 'build base of class airbase' input
Definition at line 3560 of file control.c.
Referenced by build_airbase_callback(), build_airbase_callback(), mr_menu::slot_unit_airbase(), and unit_order_callback().
Assign all focus units to this battlegroup.
Definition at line 3780 of file control.c.
Referenced by bg_append0_callback(), bg_append1_callback(), bg_append2_callback(), bg_append3_callback(), bg_append_callback(), bg_assign0_callback(), bg_assign1_callback(), bg_assign2_callback(), bg_assign3_callback(), bg_assign_callback(), mr_menu::slot_bg1append(), mr_menu::slot_bg1assign(), mr_menu::slot_bg2append(), mr_menu::slot_bg2assign(), mr_menu::slot_bg3append(), mr_menu::slot_bg3assign(), mr_menu::slot_bg4append(), and mr_menu::slot_bg4assign().
Handle user 'autoexplore' input
Definition at line 3577 of file control.c.
Referenced by mr_menu::slot_unit_explore(), unit_explore_callback(), unit_explore_callback(), and unit_order_callback().
Call to request (from the server) that the focus unit is put into autosettler mode.
Definition at line 3590 of file control.c.
Referenced by auto_settle_callback(), auto_settle_callback(), and mr_menu::slot_auto_settler().
Handle use 'build city' input.
Definition at line 3353 of file control.c.
Referenced by unit_order_callback().
Handle user 'help build wonder' input
Definition at line 3363 of file control.c.
Referenced by unit_order_callback().
Handle user 'clean' input
Definition at line 3720 of file control.c.
Referenced by clean_callback(), clean_nuisance_callback(), and unit_order_callback().
void key_unit_connect | ( | enum unit_activity | activity, |
struct extra_type * | tgt | ||
) |
Handle user pressing key for 'Connect' command
Definition at line 3375 of file control.c.
Referenced by connect_irrigation_callback(), connect_irrigation_callback(), connect_maglev_callback(), connect_maglev_callback(), connect_rail_callback(), connect_rail_callback(), connect_road_callback(), connect_road_callback(), mr_menu::slot_conn_irrigation(), mr_menu::slot_conn_maglev(), mr_menu::slot_conn_rail(), mr_menu::slot_conn_road(), and unit_order_callback().
Unit convert key pressed or respective menu entry selected.
Definition at line 3602 of file control.c.
Referenced by mr_menu::slot_convert(), unit_convert_callback(), unit_convert_callback(), and unit_order_callback().
Handle user 'cultivate' input
Definition at line 3676 of file control.c.
Referenced by cultivate_callback(), cultivate_callback(), mr_menu::slot_cultivate(), and unit_order_callback().
Handle user 'unit done' input
Definition at line 3463 of file control.c.
Referenced by mr_menu::slot_done_moving(), unit_done_callback(), unit_done_callback(), and unit_order_callback().
Handle user 'fortify' input
Definition at line 3612 of file control.c.
Referenced by mr_menu::slot_unit_fortify(), and unit_order_callback().
Handle user 'build base of class fortress' input
Definition at line 3624 of file control.c.
Referenced by build_fortress_callback(), build_fortress_callback(), mr_menu::slot_unit_fortress(), and unit_order_callback().
Handle user 'unit goto' input
Definition at line 3471 of file control.c.
Referenced by button_down_on_map(), finger_down_on_map(), mr_menu::slot_unit_goto(), unit_goto_callback(), unit_goto_callback(), and unit_order_callback().
Handle user 'change homecity' input
Definition at line 3641 of file control.c.
Referenced by mr_menu::slot_set_home(), unit_homecity_callback(), unit_homecity_callback(), and unit_order_callback().
Handle user 'irrigate' input
Definition at line 3668 of file control.c.
Referenced by build_irrigation_callback(), build_irrigation_callback(), mr_menu::slot_build_irrigation(), and unit_order_callback().
Handle user 'build mine' input
Definition at line 3688 of file control.c.
Referenced by build_mine_callback(), build_mine_callback(), mr_menu::slot_build_mine(), and unit_order_callback().
void key_unit_move | ( | enum direction8 | gui_dir | ) |
Move the focus unit in the given direction. Here directions are defined according to the GUI, so that north is "up" in the interface.
Definition at line 3341 of file control.c.
Referenced by key_press_map_canvas(), key_press_map_canvas(), map_view::keyPressEvent(), map_event_handler(), and map_event_handler().
Handle user 'paradrop' input
Definition at line 3479 of file control.c.
Referenced by do_paradrop_callback(), paradrop_callback(), mr_menu::slot_paradrop(), and unit_order_callback().
Handle user 'patrol' input
Definition at line 3487 of file control.c.
Referenced by mr_menu::slot_patrol(), unit_order_callback(), unit_patrol_callback(), and unit_patrol_callback().
Handle user 'pillage' input
Definition at line 3708 of file control.c.
Referenced by do_pillage_callback(), pillage_callback(), mr_menu::slot_pillage(), and unit_order_callback().
Handle user 'plant' input
Definition at line 3696 of file control.c.
Referenced by plant_callback(), plant_callback(), mr_menu::slot_plant(), and unit_order_callback().
Handle user 'build road or railroad' input
Definition at line 3738 of file control.c.
Referenced by unit_order_callback().
Bring this battlegroup into focus.
Definition at line 3819 of file control.c.
Referenced by bg_select0_callback(), bg_select1_callback(), bg_select2_callback(), bg_select3_callback(), bg_select_callback(), mr_menu::slot_bg1select(), mr_menu::slot_bg2select(), mr_menu::slot_bg3select(), and mr_menu::slot_bg4select().
Handle user 'sentry' input
Definition at line 3756 of file control.c.
Referenced by mr_menu::slot_unit_sentry(), unit_order_callback(), unit_sentry_callback(), and unit_sentry_callback().
Toggle the "Draw shield graphics for units" option.
Definition at line 4040 of file control.c.
Referenced by show_unit_shields_callback(), and show_unit_shields_callback().
Toggle the "Solid unit background color" option.
Definition at line 4032 of file control.c.
Referenced by show_unit_solid_bg_callback(), and show_unit_solid_bg_callback().
Handle client request to toggle drawing of unit stack size information
Definition at line 3936 of file control.c.
Referenced by show_stack_size_callback(), show_stack_size_callback(), and mr_menu::slot_stack_size().
Handle user 'teleport' input
Definition at line 3495 of file control.c.
Referenced by unit_teleport_callback().
Handle user 'establish trade route' input
Definition at line 3503 of file control.c.
Referenced by unit_order_callback().
Handle user 'transform unit' input
Definition at line 3768 of file control.c.
Referenced by mr_menu::slot_transform(), transform_terrain_callback(), transform_terrain_callback(), and unit_order_callback().
Handle user 'unload all' input
Definition at line 3517 of file control.c.
Referenced by mr_menu::slot_unload_all(), unit_order_callback(), unit_unload_transporter_callback(), and unit_unload_transporter_callback().
Handle user 'wait' input
Definition at line 3542 of file control.c.
Referenced by act_sel_wait(), act_sel_wait_callback(), act_sel_wait_callback(), fc_client::create_game_page(), mr_menu::slot_wait(), unit_info_window_callback(), unit_order_callback(), unit_wait_callback(), and unit_wait_callback().
Handle user 'wakeup others' input
Definition at line 3550 of file control.c.
Referenced by mr_menu::slot_unsentry(), unit_order_callback(), unit_unsentry_callback(), and unsentry_all_callback().
Handle user 'toggle units display' input
Definition at line 4024 of file control.c.
Referenced by map_event_handler(), map_event_handler(), show_units_callback(), and show_units_callback().
Request data for follow up questions about an action the unit can perform.
Definition at line 1798 of file control.c.
Referenced by diplomat_bribe(), diplomat_bribe_callback(), diplomat_incite(), diplomat_incite_callback(), diplomat_incite_escape(), request_action_details_callback(), spy_incite_callback(), spy_request_sabotage_esc_list(), spy_request_sabotage_list(), spy_request_strike_bld_list(), spy_sabotage_esc_request(), spy_sabotage_request(), and spy_strike_bld_request().
Center to focus unit.
Definition at line 2750 of file control.c.
Referenced by center_on_unit(), map_event_handler(), map_event_handler(), click_label::on_clicked(), side_center_unit(), mr_menu::slot_center_view(), and unit_info_window_callback().
void request_do_action | ( | action_id | action, |
int | actor_id, | ||
int | target_id, | ||
int | sub_tgt, | ||
const char * | name | ||
) |
Request an actor unit to do a specific action.
Definition at line 1730 of file control.c.
Referenced by action_decision_maybe_auto(), airlift(), attack(), base(), bombard(), bombard2(), bombard3(), bombard_lethal(), bribe_response(), capture_units(), caravan_establish_trade(), caravan_help_build(), caravan_marketplace(), clean(), conquer_city(), conquer_city2(), conquer_extras(), conquer_extras2(), convert_unit(), cultivate(), destroy_city(), diplomat_bribe_yes_callback(), diplomat_embassy(), diplomat_incite_yes_callback(), diplomat_investigate(), diplomat_sabotage(), diplomat_sabotage_esc(), diplomat_steal(), diplomat_steal_esc(), disband_unit(), disembark1(), disembark2(), do_disband_alternative(), do_unit_paradrop_to(), do_unit_teleport_to(), enter_hut(), enter_hut2(), expel_unit(), finish_city(), fortify(), frighten_hut(), frighten_hut2(), handle_city_name_suggestion_info(), heal_unit(), heal_unit2(), homeless(), incite_response(), irrigate(), join_city(), mine(), nuke(), nuke_city(), nuke_units(), paradrop(), paradrop_conquer(), paradrop_enter(), paradrop_enter_conquer(), paradrop_frighten(), paradrop_frighten_conquer(), pillage(), plant(), popup_action_selection(), popup_bribe_dialog(), popup_incite_dialog(), regular_move(), request_unit_airlift(), request_unit_build_city(), request_unit_caravan_action(), request_unit_change_homecity(), request_unit_load(), request_unit_unload(), request_unit_upgrade(), road(), sabotage_impr_callback(), simple_action_callback(), simple_action_callback(), spy_advances_response(), spy_embassy(), spy_escape(), spy_improvements_response(), spy_investigate(), spy_nuke_city(), spy_nuke_city_esc(), spy_poison(), spy_poison_esc(), spy_sabotage(), spy_sabotage_unit(), spy_sabotage_unit_esc(), spy_steal_callback(), spy_steal_gold(), spy_steal_gold_esc(), spy_steal_maps(), spy_steal_maps_esc(), spy_steal_popup_shared(), spy_steal_something(), suicide_attack(), transform_terrain(), transport_board(), transport_board2(), transport_board3(), transport_deboard(), transport_embark(), transport_embark2(), transport_embark3(), transport_embark4(), transport_load(), transport_load2(), transport_load3(), transport_unload(), unit_disband_recover(), unit_home_city(), and wipe_units().
This function is called whenever the player pressed an arrow key.
We do NOT take into account that punit might be a caravan or a diplomat trying to move into a city, or a diplomat going into a tile with a unit; the server will catch those cases and send the client a package to pop up a dialog. (the server code has to be there anyway as goto's are entirely in the server)
Definition at line 1879 of file control.c.
Referenced by key_unit_move(), and mr_menu::slot_execute_orders().
void request_new_unit_activity | ( | struct unit * | punit, |
enum unit_activity | act | ||
) |
Send request for unit activity changing to server. If activity has target, use request_new_unit_activity_targeted() instead.
Definition at line 1929 of file control.c.
Referenced by activate_all_units(), adv_unit_select_callback(), adv_unit_sentry_idle_callback(), clear_unit_orders(), focus_units_info_callback(), handle_player_diplstate(), key_unit_cultivate(), key_unit_fortify(), key_unit_plant(), key_unit_sentry(), key_unit_transform(), request_unit_convert(), request_unit_fortify(), request_unit_sentry(), unit_select_callback(), usdlg_cmd_exec_unit(), and wakeup_sentried_units().
void request_new_unit_activity_targeted | ( | struct unit * | punit, |
enum unit_activity | act, | ||
struct extra_type * | tgt | ||
) |
Send request for unit activity changing to server. This is for activities that are targeted to certain special or base type.
Definition at line 1938 of file control.c.
Referenced by base_callback(), base_callback(), build_road_callback(), build_road_callback(), clean_callback(), clean_menu_callback(), irrigation_callback(), key_unit_airbase(), key_unit_clean(), key_unit_extra(), key_unit_fortress(), key_unit_road(), mine_callback(), pillage_callback(), pillage_callback(), pillage_something(), request_new_unit_activity(), request_unit_pillage(), road_callback(), road_callback(), mr_menu::slot_build_base(), mr_menu::slot_build_path(), mr_menu::slot_build_road(), and mr_menu::slot_clean().
Toggle display of bases
Definition at line 2619 of file control.c.
Referenced by key_bases_toggle(), map_event_handler(), and map_event_handler().
Toggle display of cities
Definition at line 2671 of file control.c.
Referenced by key_cities_toggle(), map_event_handler(), and map_event_handler().
Toggle display of city buycost
Definition at line 2515 of file control.c.
Referenced by key_city_buycost_toggle().
Toggle display of city full bar.
Definition at line 2463 of file control.c.
Referenced by key_city_full_bar_toggle().
Toggle display of city growth (turns-to-grow)
Definition at line 2489 of file control.c.
Referenced by key_city_growth_toggle().
Toggle display of city names
Definition at line 2476 of file control.c.
Referenced by key_city_names_toggle().
Toggle display of city outlines on the map
Definition at line 2398 of file control.c.
Referenced by key_city_outlines_toggle().
Toggle display of worker output of cities on the map
Definition at line 2411 of file control.c.
Referenced by key_city_output_toggle().
Toggle display of city productions
Definition at line 2502 of file control.c.
Referenced by key_city_productions_toggle().
Toggle display of city trade routes
Definition at line 2528 of file control.c.
Referenced by key_city_trade_routes_toggle().
Toggle display of coastline
Definition at line 2567 of file control.c.
Referenced by key_coastline_toggle().
Toggle display of focus unit
Definition at line 2723 of file control.c.
Referenced by key_focus_unit_toggle().
Toggle display of fog of war
Definition at line 2736 of file control.c.
Referenced by key_fog_of_war_toggle().
Toggle display of irrigation
Definition at line 2593 of file control.c.
Referenced by key_irrigation_toggle().
Toggle display of national borders on the map
Definition at line 2437 of file control.c.
Referenced by key_map_borders_toggle().
Toggle display of grid lines on the map
Definition at line 2424 of file control.c.
Referenced by key_map_grid_toggle().
Toggle display of native tiles on the map
Definition at line 2450 of file control.c.
Referenced by key_map_native_toggle().
Toggle display of mines
Definition at line 2606 of file control.c.
Referenced by key_mines_toggle().
Toggle display of paths
Definition at line 2580 of file control.c.
Referenced by key_paths_toggle().
Toggle display of pollution
Definition at line 2658 of file control.c.
Referenced by key_pollution_toggle().
Toggle display of resources
Definition at line 2632 of file control.c.
Referenced by key_resources_toggle().
Toggle display of terrain
Definition at line 2554 of file control.c.
Referenced by key_terrain_toggle().
Toggle display of unit shields.
Definition at line 2710 of file control.c.
Referenced by key_unit_shields_toggle().
Toggle display of unit solid background.
Definition at line 2697 of file control.c.
Referenced by key_unit_solid_bg_toggle().
Toggle display of unit stack sizes
Definition at line 2541 of file control.c.
Referenced by key_unit_stack_size_toggle().
Toggle display of units
Definition at line 2684 of file control.c.
Referenced by key_units_toggle().
Send unit airlift request to server.
Definition at line 1543 of file control.c.
Referenced by goto_dialog::airlift_to(), goto_city_callback(), goto_cmd_callback(), and multiairlift().
Call to request (from the server) that the settler unit is put into autosettler mode.
Definition at line 2141 of file control.c.
Referenced by key_unit_auto_settle(), and unit_order_callback().
Player pressed 'b' or otherwise instructed unit to build or add to city. If the unit can build a city, we popup the appropriate dialog. Otherwise, we just send a packet to the server. If this action is not appropriate, the server will respond with an appropriate message. (This is to avoid duplicating all the server checks and messages here.)
Definition at line 1817 of file control.c.
Referenced by build_city_callback(), build_city_callback(), key_unit_build_city(), and mr_menu::slot_build_city().
Send request to do caravan action - establishing trade route or helping in wonder building - to server.
Definition at line 2223 of file control.c.
Referenced by build_city_callback(), build_city_callback(), build_road_callback(), build_road_callback(), key_unit_build_wonder(), key_unit_trade_route(), mr_menu::slot_build_city(), and mr_menu::slot_build_road().
Send request to change unit homecity to server.
Definition at line 2094 of file control.c.
Referenced by unit_item::change_homecity(), homecity_units_orders_city_dlg_callback(), key_unit_homecity(), unit_homecity_callback(), and unit_homecity_callback().
void request_unit_connect | ( | enum unit_activity | activity, |
struct extra_type * | tgt | ||
) |
Prompt player for entering destination point for unit connect (e.g. connecting with roads)
Definition at line 1482 of file control.c.
Referenced by key_unit_connect().
Sends unit convert packet.
Definition at line 2118 of file control.c.
Referenced by key_unit_convert().
Send request to disband unit to server.
Definition at line 2075 of file control.c.
Referenced by disband_all_units(), disband_box::disband_clicked(), ok_disband_unit_window_callback(), and popup_disband_dialog().
Try to fortify unit.
Definition at line 2353 of file control.c.
Referenced by fortify_callback(), fortify_callback(), unit_item::fortify_unit(), fortify_units_orders_city_dlg_callback(), unit_fortify_callback(), and unit_fortify_callback().
void request_unit_goto | ( | enum unit_orders | last_order, |
action_id | act_id, | ||
int | sub_tgt_id | ||
) |
Do a goto with an order at the end (or ORDER_LAST).
Definition at line 1130 of file control.c.
Referenced by key_unit_goto(), maybe_activate_keyboardless_goto(), go_act_menu::start_go_act(), unit_goto_and_callback(), unit_goto_and_callback(), and unit_order_callback().
Send a request to the server that the cargo be loaded into the transporter.
If ptransporter is NULL a suitable transporter will be chosen.
Definition at line 2156 of file control.c.
Referenced by qtg_request_transport(), request_transport(), hud_unit_loader::selection_changed(), transport_response_callback(), and unit_order_callback().
Set focus units to FOCUS_DONE state.
Definition at line 2776 of file control.c.
Referenced by key_unit_done().
Have the player select what tile to paradrop to. Once selected a paradrop request will be sent to server.
Definition at line 2246 of file control.c.
Referenced by key_unit_paradrop().
Either start new patrol route planning, or add waypoint to current one.
Definition at line 2319 of file control.c.
Referenced by key_unit_patrol().
Send pillage request to server.
Definition at line 2364 of file control.c.
Referenced by key_unit_pillage().
Return-and-recover for a particular unit. This sets the unit to GOTO the nearest city.
Definition at line 1552 of file control.c.
Referenced by mr_menu::slot_return_to_city(), unit_order_callback(), unit_return_callback(), and unit_return_callback().
void request_unit_select | ( | struct unit_list * | punits, |
enum unit_select_type_mode | seltype, | ||
enum unit_select_location_mode | selloc | ||
) |
Select all units based on the given list of units and the selection modes.
Definition at line 1621 of file control.c.
Referenced by select_all_on_tile_callback(), select_all_on_tile_callback(), select_same_type_callback(), select_same_type_callback(), select_same_type_cont_callback(), select_same_type_cont_callback(), select_same_type_tile_callback(), select_same_type_tile_callback(), select_single_callback(), select_single_callback(), mr_menu::slot_select_all_tile(), mr_menu::slot_select_one(), mr_menu::slot_select_same_continent(), mr_menu::slot_select_same_everywhere(), and mr_menu::slot_select_same_tile().
Try to sentry unit.
Definition at line 2342 of file control.c.
Referenced by unit_item::sentry_unit(), sentry_units_orders_city_dlg_callback(), unit_sentry_callback(), and unit_sentry_callback().
Call to request (from the server) that the unit is put under the control of the specified server side agent or - if agent is SSA_NONE - under client control.
Definition at line 2128 of file control.c.
Referenced by action_confirmation(), key_unit_auto_explore(), request_do_action(), request_move_unit_direction(), request_new_unit_activity_targeted(), request_orders_cleared(), request_unit_autosettlers(), request_unit_non_action_move(), send_connect_route(), and send_path_orders().
Send a request to the server that the cargo be unloaded from its current transporter.
Definition at line 2194 of file control.c.
Referenced by request_unit_unload_all(), mr_menu::slot_deboard(), unit_deboard_callback(), unit_deboard_callback(), unit_order_callback(), unit_unload_callback(), unit_unload_callback(), and unit_item::unload_unit().
Returns one of the unit of the transporter which can have focus next.
Definition at line 1511 of file control.c.
Referenced by key_unit_unload_all(), and unit_item::unload_all().
Send request to upgrade unit to server.
Definition at line 2106 of file control.c.
Referenced by ok_upgrade_unit_window_callback(), and popup_upgrade_dialog().
(RP:) un-sentry all my own sentried units on punit's tile
Definition at line 1600 of file control.c.
Referenced by key_unit_wakeup_others().
Set units in list to waiting focus. If they are current focus units, advance focus.
Definition at line 2763 of file control.c.
Referenced by key_unit_wait().
void set_hover_state | ( | struct unit_list * | punits, |
enum cursor_hover_state | state, | ||
enum unit_activity | activity, | ||
struct extra_type * | tgt, | ||
int | last_tgt, | ||
int | last_sub_tgt, | ||
action_id | action, | ||
enum unit_orders | order | ||
) |
Enter the given hover state.
activity => The connect activity (ACTIVITY_IRRIGATE, etc.) order => The last order (ORDER_PERFORM_ACTION, ORDER_LAST, etc.)
Definition at line 290 of file control.c.
Referenced by clear_hover_state(), key_cancel_action(), key_unit_action_select_tgt(), overview_update_line(), paradrop_here_callback(), patrol_here_callback(), request_unit_connect(), request_unit_goto(), request_unit_paradrop(), request_unit_patrol(), request_unit_teleport(), mr_menu::slot_delayed_goto(), and update_line().
Adjusts way combatants are displayed suitable for combat.
Definition at line 1032 of file control.c.
Referenced by decrease_unit_hp_smooth(), and handle_unit_combat_info().
Returns TRUE iff the client should ask the server about what actions a unit can perform.
Definition at line 339 of file control.c.
Referenced by action_selection_next_in_focus(), current_focus_append(), fill_unit_sprite_array(), handle_unit_packet_common(), and unit_focus_advance().
Change the battlegroup for this unit.
Definition at line 255 of file control.c.
Referenced by handle_unit_packet_common().
Adds this unit to the list of units in focus.
Definition at line 561 of file control.c.
Referenced by define_tiles_within_rectangle(), do_map_click(), key_recall_previous_focus_unit(), key_unit_assign_battlegroup(), key_unit_select_battlegroup(), request_unit_select(), unit_hud_selector::uhs_select(), and usdlg_cmd_exec_unit().
This function may be called from packhand.c, via unit_focus_update(), as a result of packets indicating change in activity for a unit. Also called when user press the "Wait" command.
FIXME: Add feature to focus only units of a certain category.
accept_current | The current focus can be kept if no other candidates |
Definition at line 688 of file control.c.
Referenced by client_remove_unit(), control_unit_killed(), request_unit_move_done(), request_units_wait(), unit_focus_remove(), and unit_focus_update().
Removes this unit from the list of units in focus.
Definition at line 591 of file control.c.
Referenced by usdlg_cmd_exec_unit().
Sets the focus unit directly. The unit given will be given the focus; if NULL the focus will be cleared.
This function is called for several reasons. Sometimes a fast-focus happens immediately as a result of a client action. Other times it happens because of a server-sent packet that wakes up a unit.
Definition at line 506 of file control.c.
Referenced by activate_all_units(), unit_item::activate_and_close_dialog(), activate_and_exit_units_orders_city_dlg_callback(), unit_item::activate_unit(), activate_units_orders_city_dlg_callback(), adv_unit_select_callback(), define_tiles_within_rectangle(), focus_units_info_callback(), handle_city_sabotage_list(), handle_unit_action_answer(), key_recall_previous_focus_unit(), key_unit_select_battlegroup(), key_unit_unload_all(), middle_present_unit_release(), middle_supported_unit_release(), unit_item::mousePressEvent(), units_select::mousePressEvent(), present_unit_activate_close_callback(), present_unit_activate_close_callback(), present_unit_middle_callback(), request_unit_select(), right_unit_release(), select_unit_image_callback(), select_unit_pic_callback(), set_client_state(), supported_unit_activate_close_callback(), supported_unit_activate_close_callback(), supported_unit_middle_callback(), unit_activate_callback(), unit_activate_callback(), unit_focus_advance(), unit_focus_set_and_select(), unit_select_callback(), units_orders_city_dlg_callback(), and usdlg_cmd_focus_real().
The only difference is that here we draw the "cross".
Definition at line 636 of file control.c.
Referenced by do_map_click(), units_report_command_callback(), and unittype_item::wheelEvent().
If there is no unit currently in focus, or if the current unit in focus should not be in focus, then get a new focus unit. We let GOTO-ing units stay in focus, so that if they have moves left at the end of the goto, then they are still in focus.
Definition at line 789 of file control.c.
Referenced by handle_game_info(), handle_new_year(), handle_unit_packet_common(), real_set_client_page(), set_client_state(), and usdlg_cmd_exec().
Store a priority focus unit.
Definition at line 207 of file control.c.
Referenced by action_decision_request(), and handle_unit_packet_common().
Return TRUE iff this unit is in focus.
Definition at line 388 of file control.c.
Referenced by action_decision_request(), control_unit_killed(), do_move_unit(), fill_sprite_array(), find_best_focus_candidate(), get_drawable_unit(), goto_map_unit(), handle_unit_packet_common(), key_unit_assign_battlegroup(), quickselect(), select_unit_image_callback(), select_unit_pic_callback(), set_units_in_combat(), unit_drawn_with_city_outline(), unit_focus_add(), unit_focus_remove(), usdlg_cmd_cursor_changed(), usdlg_cmd_exec_unit(), and usdlg_tab_append_units().
Call this on new units to enter them in the battlegroup lists.
Definition at line 275 of file control.c.
Referenced by handle_unit_packet_common().
Update unit icons (and arrow) in the information display, for specified punit as the active unit and other units on the same square. In practice punit is almost always (or maybe strictly always?) the focus unit.
Static vars store some info on current (ie previous) state, to avoid unnecessary redraws; initialise to "flag" values to always redraw first time. In principle we might need more info (eg ai.control, connecting), but in practice this is enough?
Used to store unit_ids for below units, to use for callbacks (now done inside gui-dep set_unit_icon()), but even with ids here they would not be enough information to know whether to redraw – instead redraw every time. (Could store enough info to know, but is it worth it?)
Definition at line 985 of file control.c.
Referenced by client_remove_unit(), reset_unit_table(), and update_unit_info_label().
Wakes all owned sentried units on tile.
Definition at line 1583 of file control.c.
Referenced by request_unit_wakeup(), and wakeup_button_pressed().
|
extern |
Definition at line 90 of file control.c.
Referenced by do_map_click(), get_activity_time(), get_connect_road(), goto_fill_parameter_full(), key_cancel_action(), key_unit_action_select_tgt(), overview_update_line(), request_unit_connect(), set_hover_state(), and update_line().
|
extern |
Definition at line 91 of file control.c.
Referenced by do_map_click(), get_activity_time(), get_connect_road(), key_cancel_action(), key_unit_action_select_tgt(), overview_update_line(), request_unit_connect(), set_hover_state(), and update_line().
|
extern |
Definition at line 93 of file control.c.
Referenced by control_mouse_cursor(), do_map_click(), goto_fill_parameter_full(), key_cancel_action(), key_unit_action_select_tgt(), overview_update_line(), send_goto_route(), set_hover_state(), and update_line().
|
extern |
Definition at line 96 of file control.c.
Referenced by key_cancel_action(), key_unit_action_select_tgt(), overview_update_line(), send_goto_route(), set_hover_state(), and update_line().
|
extern |
Definition at line 95 of file control.c.
Referenced by key_cancel_action(), key_unit_action_select_tgt(), overview_update_line(), send_goto_route(), set_hover_state(), and update_line().
|
extern |
Definition at line 94 of file control.c.
Referenced by key_cancel_action(), key_unit_action_select_tgt(), send_goto_route(), and set_hover_state().
|
extern |
Definition at line 89 of file control.c.
Referenced by base_set_mapview_origin(), butt_down_mapcanvas(), butt_release_mapcanvas(), control_mouse_cursor(), do_map_click(), do_move_unit(), do_unit_goto(), get_activity_time(), get_unit_info_label_text2(), goto_fill_parameter_full(), goto_get_turns(), goto_map_free(), goto_tile_state(), key_cancel_action(), key_unit_action_select_tgt(), mouse_scroll_mapcanvas(), mouse_scroll_mapcanvas(), map_view::mouseMoveEvent(), move_mapcanvas(), move_mapcanvas(), overview_update_line(), release_goto_button(), request_unit_connect(), request_unit_goto(), request_unit_patrol(), right_butt_down_mapcanvas(), right_butt_up_mapcanvas(), set_hover_state(), mr_menu::slot_delayed_goto(), unit_focus_add(), unit_focus_remove(), update_last_part(), and update_line().
|
extern |
Definition at line 125 of file control.c.
Referenced by handle_start_phase(), and unit_focus_advance().
|
extern |
Definition at line 76 of file control.c.
Referenced by free_unit_table(), populate_unit_image_table(), populate_unit_pic_table(), set_unit_icon(), and update_unit_pix_label().