![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <QSet>#include <QTimer>#include <algorithm>#include "bitvector.h"#include "fcintl.h"#include "log.h"#include "combat.h"#include "game.h"#include "map.h"#include "movement.h"#include "path_finder.h"#include "unitlist.h"#include "citydlg_g.h"#include "dialogs_g.h"#include "mapctrl_g.h"#include "mapview_g.h"#include "menu_g.h"#include "audio/audio.h"#include "chatline.h"#include "client_main.h"#include "climap.h"#include "climisc.h"#include "control.h"#include "editor.h"#include "goto.h"#include "governor.h"#include "options.h"#include "overview_common.h"#include "page_game.h"#include "qtg_cxxside.h"#include "tileset/tilespec.h"#include "update_queue.h"#include "views/view_map.h"
Include dependency graph for control.cpp:Go to the source code of this file.
Classes | |
| struct | client_disband_unit_data |
Functions | |
| static void | key_unit_clean (enum unit_activity act, enum extra_rmcause rmcause) |
| Handle user extra cleaning input of given type. More... | |
| static struct unit * | quickselect (struct tile *ptile, enum quickselect_type qtype) |
| Quickselecting a unit is normally done with [control] left, right click, for the current tile. More... | |
| void | control_init () |
| Called only by client_game_init() in client/client_main.c. More... | |
| void | control_free () |
| Called only by client_game_free() in client/client_main.c. More... | |
| std::vector< unit * > & | get_units_in_focus () |
| Returns list of units currently in focus. More... | |
| int | get_num_units_in_focus () |
| Return the number of units currently in focus (0 or more). More... | |
| static void | store_previous_focus () |
| Store the focus unit(s). More... | |
| void | unit_focus_urgent (struct unit *punit) |
| Store a priority focus unit. More... | |
| static void | focus_units_changed () |
| Do various updates required when the set of units in focus changes. More... | |
| void | control_unit_killed (struct unit *punit) |
| Called when a unit is killed; this removes it from the control lists. More... | |
| void | unit_change_battlegroup (struct unit *punit, int battlegroup) |
| Change the battlegroup for this unit. More... | |
| void | unit_register_battlegroup (struct unit *punit) |
| Call this on new units to enter them in the battlegroup lists. More... | |
| void | set_hover_state (const std::vector< unit * > &units, 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. More... | |
| void | clear_hover_state () |
| Clear current hover state (go to HOVER_NONE). More... | |
| bool | should_ask_server_for_actions (const struct unit *punit) |
| Returns TRUE iff the client should ask the server about what actions a unit can perform. More... | |
| static bool | can_ask_server_for_actions () |
| Returns TRUE iff it is OK to ask the server about what actions a unit can perform. More... | |
| static void | ask_server_for_actions (struct unit *punit) |
| Ask the server about what actions punit may be able to perform against it's stored target tile. More... | |
| bool | unit_is_in_focus (const struct unit *punit) |
| Return TRUE iff this unit is in focus. More... | |
| struct unit * | get_focus_unit_on_tile (const struct tile *ptile) |
| Return TRUE iff a unit on this tile is in focus. More... | |
| struct unit * | head_of_units_in_focus () |
| Return head of focus units list. More... | |
| static struct tile * | find_a_focus_unit_tile_to_center_on () |
| Finds a single focus unit that we can center on. More... | |
| void | set_auto_center_enabled (bool enabled) |
| Allows disabling automatic map recentering. More... | |
| void | auto_center_on_focus_unit () |
| Center on the focus unit, if off-screen and auto_center_on_unit is true. More... | |
| static void | current_focus_append (struct unit *punit) |
| Add unit to list of units currently in focus. More... | |
| void | clear_unit_orders (struct unit *punit) |
| Clear all orders for the given unit. More... | |
| void | unit_focus_set (struct unit *punit) |
| Sets the focus unit directly. More... | |
| void | unit_focus_add (struct unit *punit) |
| Adds this unit to the list of units in focus. More... | |
| void | unit_focus_set_and_select (struct unit *punit) |
| The only difference is that here we draw the "cross". More... | |
| static struct unit * | find_best_focus_candidate (bool accept_current) |
| Find the nearest available unit for focus, excluding any current unit in focus unless "accept_current" is TRUE. More... | |
| void | unit_focus_advance () |
| This function may be called from packhand.c, via unit_focus_update(), as a result of packets indicating change in activity for a unit. More... | |
| void | unit_focus_update () |
| 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. More... | |
| unit * | find_visible_unit (const ::tile *ptile) |
| Return a pointer to a visible unit, if there is one. More... | |
| int | blink_active_unit () |
| Blink the active unit (if necessary). More... | |
| int | blink_turn_done_button () |
| Blink the turn done button (if necessary). More... | |
| void | set_units_in_combat (struct unit *pattacker, struct unit *pdefender) |
| Adjusts way combatants are displayed suitable for combat. More... | |
| void | action_selection_no_longer_in_progress (const int old_actor_id) |
| The action selection process is no longer in progres for the specified unit. More... | |
| void | action_decision_clear_want (const int old_actor_id) |
| Have the server record that a decision no longer is wanted for the specified unit. More... | |
| void | action_selection_next_in_focus (const int old_actor_id) |
| Move on to the next unit in focus that needs an action decision. More... | |
| void | action_decision_request (struct unit *actor_unit) |
| Request that the player makes a decision for the specified unit. More... | |
| 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). More... | |
| static bool | can_units_attack_at (const std::vector< unit * > &units, const struct tile *ptile) |
| Return TRUE if at least one of the units can do an attack at the tile. More... | |
| void | control_mouse_cursor (struct tile *ptile) |
| 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). More... | |
| static bool | is_activity_on_tile (struct tile *ptile, enum unit_activity activity) |
| Return TRUE if there are any units doing the activity on the tile. More... | |
| 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. More... | |
| static bool | can_be_irrigated (const struct tile *ptile, const struct unit *punit) |
| Can tile be irrigated by given unit? Unit can be nullptr to check if any settler type unit of any player can irrigate. More... | |
| 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) More... | |
| void | request_unit_connect (enum unit_activity activity, struct extra_type *tgt) |
| Prompt player for entering destination point for unit connect (e.g. More... | |
| struct unit * | request_unit_unload_all (struct unit *punit) |
| Returns one of the unit of the transporter which can have focus next. More... | |
| void | request_unit_airlift (struct unit *punit, struct city *pcity) |
| Send unit airlift request to server. More... | |
| void | request_units_return () |
| Return-and-recover for a particular unit. More... | |
| void | wakeup_sentried_units (struct tile *ptile) |
| Wakes all owned sentried units on tile. More... | |
| void | request_unit_wakeup (struct unit *punit) |
| (RP:) un-sentry all my own sentried units on punit's tile More... | |
| void | request_unit_select (const std::vector< unit * > &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. More... | |
| 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. More... | |
| void | request_action_details (action_id action, int actor_id, int target_id) |
| Request data for follow up questions about an action the unit can perform. More... | |
| void | request_unit_build_city (struct unit *punit) |
| Player pressed 'b' or otherwise instructed unit to build or add to city. More... | |
| void | request_unit_non_action_move (struct unit *punit, struct tile *dest_tile) |
| Order a unit to move to a neighboring tile without performing an action. More... | |
| void | request_move_unit_direction (struct unit *punit, int dir) |
| This function is called whenever the player pressed an arrow key. More... | |
| void | request_new_unit_activity (struct unit *punit, enum unit_activity act) |
| Send request for unit activity changing to server. More... | |
| 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. More... | |
| static void | client_disband_unit_data_destroy (void *p) |
| Destroy the client disband unit data. More... | |
| static void | do_disband_alternative (void *p) |
| Try to disband a unit using actions ordered by preference. More... | |
| void | request_unit_disband (struct unit *punit) |
| Send request to disband unit to server. More... | |
| void | request_unit_change_homecity (struct unit *punit) |
| Send request to change unit homecity to server. More... | |
| void | request_unit_upgrade (struct unit *punit) |
| Send request to upgrade unit to server. More... | |
| void | request_unit_convert (struct unit *punit) |
| Sends unit convert packet. More... | |
| void | request_unit_ssa_set (const struct unit *punit, enum server_side_agent agent) |
| 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. More... | |
| void | request_unit_autosettlers (const struct unit *punit) |
| Call to request (from the server) that the settler unit is put into autosettler mode. More... | |
| void | request_unit_load (struct unit *pcargo, struct unit *ptrans, struct tile *ptile) |
| Send a request to the server that the cargo be loaded into the transporter. More... | |
| void | request_unit_unload (struct unit *pcargo) |
| Send a request to the server that the cargo be unloaded from its current transporter. More... | |
| void | request_unit_caravan_action (struct unit *punit, action_id action) |
| Send request to do caravan action - establishing traderoute or helping in wonder building - to server. More... | |
| void | request_unit_paradrop (const std::vector< unit * > &units) |
| Have the player select what tile to paradrop to. More... | |
| void | request_unit_patrol () |
| Either start new patrol route planning, or add waypoint to current one. More... | |
| void | request_unit_sentry (struct unit *punit) |
| Try to sentry unit. More... | |
| void | request_unit_fortify (struct unit *punit) |
| Try to fortify unit. More... | |
| void | request_unit_pillage (struct unit *punit) |
| Send pillage request to server. More... | |
| void | request_toggle_city_outlines () |
| Toggle display of city outlines on the map. More... | |
| void | request_toggle_city_output () |
| Toggle display of worker output of cities on the map. More... | |
| void | request_toggle_map_grid () |
| Toggle display of grid lines on the map. More... | |
| void | request_toggle_map_borders () |
| Toggle display of national borders on the map. More... | |
| void | request_toggle_map_native () |
| Toggle display of native tiles on the map. More... | |
| void | request_toggle_city_names () |
| Toggle display of city names. More... | |
| void | request_toggle_city_growth () |
| Toggle display of city growth (turns-to-grow) More... | |
| void | request_toggle_city_productions () |
| Toggle display of city productions. More... | |
| void | request_toggle_city_buycost () |
| Toggle display of city buycost. More... | |
| void | request_toggle_city_trade_routes () |
| Toggle display of city trade routes. More... | |
| void | request_center_focus_unit () |
| Center to focus unit. More... | |
| void | request_units_wait (const std::vector< unit * > &units) |
| Set units in list to waiting focus and advance focus. More... | |
| void | request_unit_move_done () |
| Set focus units to FOCUS_DONE state. More... | |
| void | do_move_unit (struct unit *punit, struct unit *target_unit) |
| Called to have the client move a unit from one location to another, updating the graphics if necessary. More... | |
| static void | do_unit_act_sel_vs (struct tile *ptile) |
| An action selection dialog for the selected units against the specified tile is wanted. More... | |
| void | do_map_click (struct tile *ptile, enum quickselect_type qtype) |
| Handles everything when the user clicked a tile. More... | |
| void | do_unit_goto (struct tile *ptile) |
| Finish the goto mode and let the units stored in goto_map_list move to a given location. More... | |
| void | do_unit_paradrop_to (struct unit *punit, struct tile *ptile) |
| Paradrop to a location. More... | |
| void | do_unit_patrol_to (struct tile *ptile) |
| Patrol to a location. More... | |
| void | do_unit_connect (struct tile *ptile, enum unit_activity activity, struct extra_type *tgt) |
| "Connect" to the given location. More... | |
| void | key_cancel_action () |
| The 'Escape' key. More... | |
| void | key_center_capital () |
| Center the mapview on the player's named capital, or print a failure message. More... | |
| void | key_end_turn () |
| Handle user 'end turn' input. More... | |
| void | key_recall_previous_focus_unit () |
| Recall the previous focus unit(s). More... | |
| void | key_unit_move (enum direction8 gui_dir) |
| Move the focus unit in the given direction. More... | |
| void | key_unit_connect (enum unit_activity activity, struct extra_type *tgt) |
| Handle user pressing key for 'Connect' command. More... | |
| void | key_unit_action_select () |
| Handle user 'Do...' input. More... | |
| void | 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. More... | |
| void | key_unit_done () |
| Handle user 'unit done' input. More... | |
| void | key_unit_goto () |
| Handle user 'unit goto' input. More... | |
| void | key_unit_paradrop () |
| Handle user 'paradrop' input. More... | |
| void | key_unit_patrol () |
| Handle user 'patrol' input. More... | |
| void | key_unit_unload_all () |
| Handle user 'unload all' input. More... | |
| void | key_unit_wait () |
| Handle user 'wait' input. More... | |
| void | key_unit_wakeup_others () |
| Handle user 'wakeup others' input. More... | |
| void | key_unit_airbase () |
| Handle user 'build base of class airbase' input. More... | |
| void | key_unit_auto_explore () |
| Handle user 'autoexplore' input. More... | |
| void | key_unit_auto_settle () |
| Call to request (from the server) that the focus unit is put into autosettler mode. More... | |
| void | key_unit_convert () |
| Unit convert key pressed or respective menu entry selected. More... | |
| void | key_unit_fallout () |
| Handle user 'clean fallout' input. More... | |
| void | key_unit_fortify () |
| Handle user 'fortify' input. More... | |
| void | key_unit_fortress () |
| Handle user 'build base of class fortress' input. More... | |
| void | key_unit_homecity () |
| Handle user 'change homecity' input. More... | |
| static void | key_unit_extra (enum unit_activity act, enum extra_cause cause) |
| Handle user extra building input of given type. More... | |
| void | key_unit_irrigate () |
| Handle user 'irrigate' input. More... | |
| void | key_unit_cultivate () |
| Handle user 'cultivate' input. More... | |
| void | key_unit_mine () |
| Handle user 'build mine' input. More... | |
| void | key_unit_plant () |
| Handle user 'plant' input. More... | |
| void | key_unit_pillage () |
| Handle user 'pillage' input. More... | |
| void | key_unit_sentry () |
| Handle user 'sentry' input. More... | |
| void | key_unit_transform () |
| Handle user 'transform unit' input. More... | |
| void | key_city_outlines_toggle () |
| Toggle drawing of city outlines. More... | |
| void | key_city_output_toggle () |
| Toggle drawing of city output produced by workers of the city. More... | |
| void | key_map_grid_toggle () |
| Handle user 'toggle map grid' input. More... | |
| void | key_map_borders_toggle () |
| Toggle map borders on the mapview on/off based on a keypress. More... | |
| void | key_map_native_toggle () |
| Toggle native tiles on the mapview on/off based on a keypress. More... | |
| void | key_city_names_toggle () |
| Handle user 'toggle city names display' input. More... | |
| void | key_city_growth_toggle () |
| Toggles the "show city growth turns" option by passing off the request to another function... More... | |
| void | key_city_buycost_toggle () |
| Toggles the showing of the buy cost of the current production in the city descriptions. More... | |
| void | key_city_productions_toggle () |
| Handle user 'toggle city production display' input. More... | |
| void | key_city_trade_routes_toggle () |
| Handle client request to toggle drawing of trade route information by the city name for cities visible on the main map view. More... | |
| void | finish_city (struct tile *ptile, const char *name) |
| All units ready to build city to the tile should now proceed. More... | |
| void | cancel_city (struct tile *ptile) |
| Do not build city after all. More... | |
Variables | |
| static int | disband_unit_alternatives [3] |
| static auto | current_focus = std::vector<unit *>() |
| static struct unit_list * | previous_focus = nullptr |
| static struct unit_list * | urgent_focus_queue = nullptr |
| enum cursor_hover_state | hover_state = HOVER_NONE |
| enum unit_activity | connect_activity |
| struct extra_type * | connect_tgt |
| action_id | goto_last_action |
| int | goto_last_tgt |
| int | goto_last_sub_tgt |
| enum unit_orders | goto_last_order |
| static struct tile * | hover_tile = nullptr |
| static struct unit_list * | battlegroups [MAX_NUM_BATTLEGROUPS] |
| static struct unit * | punit_moving = nullptr |
| static struct unit * | punit_attacking = nullptr |
| static struct unit * | punit_defending = nullptr |
| static int | action_selection_in_progress_for = IDENTITY_NUMBER_ZERO |
| bool | non_ai_unit_focus |
| void action_decision_clear_want | ( | const int | old_actor_id | ) |
Have the server record that a decision no longer is wanted for the specified unit.
Definition at line 944 of file control.cpp.
Referenced by diplomat_queue_handle_primary(), handle_city_sabotage_list(), handle_unit_action_answer(), and handle_unit_actions().
| void action_decision_request | ( | struct unit * | actor_unit | ) |
Request that the player makes a decision for the specified unit.
Definition at line 976 of file control.cpp.
Referenced by handle_unit_packet_common().
| void action_selection_next_in_focus | ( | const int | old_actor_id | ) |
Move on to the next unit in focus that needs an action decision.
Definition at line 958 of file control.cpp.
Referenced by diplomat_queue_handle_primary(), handle_city_sabotage_list(), handle_unit_action_answer(), handle_unit_actions(), and handle_unit_remove().
| void action_selection_no_longer_in_progress | ( | const int | old_actor_id | ) |
The action selection process is no longer in progres for the specified unit.
It is safe to let another unit enter it.
Definition at line 924 of file control.cpp.
Referenced by diplomat_queue_handle_primary(), handle_city_sabotage_list(), handle_unit_action_answer(), and handle_unit_actions().
|
static |
Ask the server about what actions punit may be able to perform against it's stored target tile.
The server's reply will pop up the action selection dialog unless no alternatives exists.
Definition at line 345 of file control.cpp.
Referenced by action_decision_request(), action_selection_next_in_focus(), and current_focus_append().
| void auto_center_on_focus_unit | ( | ) |
Center on the focus unit, if off-screen and auto_center_on_unit is true.
Definition at line 422 of file control.cpp.
Referenced by handle_new_year(), and unit_focus_set().
| int blink_active_unit | ( | ) |
Blink the active unit (if necessary).
Return the time until the next blink (in seconds).
Definition at line 827 of file control.cpp.
Referenced by real_timer_callback().
| int blink_turn_done_button | ( | ) |
Blink the turn done button (if necessary).
Return the time until the next blink (in seconds).
Definition at line 857 of file control.cpp.
Referenced by real_timer_callback().
|
static |
Returns TRUE iff it is OK to ask the server about what actions a unit can perform.
Definition at line 331 of file control.cpp.
Referenced by action_decision_request(), current_focus_append(), key_unit_action_select(), and unit_focus_update().
Can tile be irrigated by given unit? Unit can be nullptr to check if any settler type unit of any player can irrigate.
Definition at line 1244 of file control.cpp.
Referenced by can_unit_do_connect().
| 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 1270 of file control.cpp.
|
static |
Return TRUE if at least one of the units can do an attack at the tile.
Definition at line 1054 of file control.cpp.
Referenced by control_mouse_cursor().
| void cancel_city | ( | struct tile * | ptile | ) |
Do not build city after all.
Cancel city building mark from all units prepared for it.
Definition at line 3228 of file control.cpp.
Referenced by 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 1188 of file control.cpp.
Referenced by can_unit_do_connect().
| void clear_hover_state | ( | ) |
Clear current hover state (go to HOVER_NONE).
Definition at line 308 of file control.cpp.
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(), release_goto_button(), send_goto_route(), map_view::shortcut_pressed(), map_view::show_debugger(), unit_focus_add(), unit_focus_advance(), and unit_focus_set().
| void clear_unit_orders | ( | struct unit * | punit | ) |
Clear all orders for the given unit.
Definition at line 454 of file control.cpp.
Referenced by current_focus_append(), and request_unit_move_done().
|
static |
Destroy the client disband unit data.
Definition at line 1744 of file control.cpp.
Referenced by do_disband_alternative(), and request_unit_disband().
| void control_free | ( | ) |
Called only by client_game_free() in client/client_main.c.
Definition at line 147 of file control.cpp.
Referenced by client_game_free(), and client_game_reset().
| void control_init | ( | ) |
Called only by client_game_init() in client/client_main.c.
Definition at line 131 of file control.cpp.
Referenced by client_game_init(), and client_game_reset().
| void control_mouse_cursor | ( | struct tile * | ptile | ) |
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 1067 of file control.cpp.
Referenced by map_view::mouseMoveEvent(), request_unit_connect(), request_unit_goto(), set_server_busy(), and mr_menu::slot_delayed_goto().
| void control_unit_killed | ( | struct unit * | punit | ) |
Called when a unit is killed; this removes it from the control lists.
Definition at line 212 of file control.cpp.
Referenced by client_remove_unit().
|
static |
Add unit to list of units currently in focus.
Definition at line 435 of file control.cpp.
Referenced by unit_focus_add(), and unit_focus_set().
|
static |
Try to disband a unit using actions ordered by preference.
Definition at line 1755 of file control.cpp.
Referenced by request_unit_disband().
| void do_map_click | ( | struct tile * | ptile, |
| enum quickselect_type | qtype | ||
| ) |
Handles everything when the user clicked a tile.
Definition at line 2410 of file control.cpp.
Referenced by action_button_pressed().
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 2303 of file control.cpp.
Referenced by handle_unit_packet_common().
|
static |
An action selection dialog for the selected units against the specified tile is wanted.
Definition at line 2395 of file control.cpp.
Referenced by do_map_click().
| void do_unit_connect | ( | struct tile * | ptile, |
| enum unit_activity | activity, | ||
| struct extra_type * | tgt | ||
| ) |
"Connect" to the given location.
Definition at line 2693 of file control.cpp.
Referenced by do_map_click().
| void do_unit_goto | ( | struct tile * | ptile | ) |
Finish the goto mode and let the units stored in goto_map_list move to a given location.
Definition at line 2647 of file control.cpp.
Referenced by do_map_click(), and release_goto_button().
| void do_unit_patrol_to | ( | struct tile * | ptile | ) |
|
static |
Finds a single focus unit that we can center on.
May return nullptr.
Definition at line 396 of file control.cpp.
Referenced by auto_center_on_focus_unit(), and request_center_focus_unit().
|
static |
Find the nearest available unit for focus, excluding any current unit in focus unless "accept_current" is TRUE.
If the current focus unit is the only possible unit, or if there is no possible unit, returns nullptr.
Definition at line 577 of file control.cpp.
Referenced by unit_focus_advance().
Return a pointer to a visible unit, if there is one.
Definition at line 749 of file control.cpp.
Referenced by clipboard_copy_production(), control_mouse_cursor(), get_drawable_unit(), chat_widget::make_link(), overview_tile_color(), popup_info_text(), and popup_tile_info().
| void finish_city | ( | struct tile * | ptile, |
| const char * | name | ||
| ) |
All units ready to build city to the tile should now proceed.
Definition at line 3208 of file control.cpp.
Referenced by popup_newcity_dialog().
|
static |
Do various updates required when the set of units in focus changes.
Definition at line 201 of file control.cpp.
Referenced by control_unit_killed(), unit_focus_add(), and unit_focus_set().
Return TRUE iff a unit on this tile is in focus.
Definition at line 373 of file control.cpp.
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().
| int get_num_units_in_focus | ( | ) |
Return the number of units currently in focus (0 or more).
Definition at line 174 of file control.cpp.
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_goto_dialog(), real_timer_callback(), request_unit_move_done(), mr_menu::slot_rename(), store_previous_focus(), unit_focus_advance(), unit_focus_set(), and unit_focus_update().
| std::vector<unit *>& get_units_in_focus | ( | ) |
Returns list of units currently in focus.
Definition at line 169 of file control.cpp.
Referenced by action_selection_next_in_focus(), goto_dialog::airlift_to(), blink_active_unit(), client_remove_unit(), client_state(), control_mouse_cursor(), control_unit_killed(), current_focus_append(), do_map_click(), do_move_unit(), do_unit_act_sel_vs(), freeciv::layer_grid::fill_sprite_array(), goto_dialog::fill_tab(), find_visible_unit(), focus_units_changed(), get_focus_unit_on_tile(), goto_dialog::go_to_city(), handle_city_info(), handle_new_year(), handle_unit_packet_common(), head_of_units_in_focus(), 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_auto_explore(), key_unit_auto_settle(), 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_sentry(), key_unit_transform(), key_unit_unload_all(), key_unit_wait(), key_unit_wakeup_others(), mr_menu::menus_sensitive(), popup_info_text(), release_goto_button(), request_unit_connect(), request_unit_goto(), request_unit_move_done(), request_unit_patrol(), request_units_return(), mr_menu::slot_build_base(), mr_menu::slot_build_city(), mr_menu::slot_build_path(), mr_menu::slot_build_road(), mr_menu::slot_clean_pollution(), mr_menu::slot_delayed_goto(), mr_menu::slot_disband(), mr_menu::slot_load(), mr_menu::slot_rename(), 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_unload(), mr_menu::slot_upgrade(), store_previous_focus(), tileset_changed(), unit_focus_advance(), unit_focus_set(), unit_focus_update(), unit_is_in_focus(), go_act_menu::update(), hud_units::update_actions(), mr_menu::update_bases_menu(), update_line(), and mr_menu::update_roads_menu().
| struct unit* head_of_units_in_focus | ( | ) |
Return head of focus units list.
Definition at line 387 of file control.cpp.
Referenced by center_on_something(), find_a_focus_unit_tile_to_center_on(), find_best_focus_candidate(), unit_hud_selector::island_filter(), quickselect(), mr_menu::slot_autocaravan(), unit_focus_advance(), unit_focus_set(), unit_hud_selector::unit_hud_selector(), unit_actions::update_actions(), hud_units::update_actions(), units_select::update_units(), and pageGame::updateInfoLabelTimeout().
|
static |
Return TRUE if there are any units doing the activity on the tile.
Definition at line 1170 of file control.cpp.
Referenced by can_unit_do_connect().
| void key_cancel_action | ( | ) |
The 'Escape' key.
Definition at line 2709 of file control.cpp.
Referenced by map_view::keyPressEvent().
| void key_center_capital | ( | ) |
Center the mapview on the player's named capital, or print a failure message.
Definition at line 2745 of file control.cpp.
Referenced by pageGame::pageGame().
| void key_city_buycost_toggle | ( | ) |
Toggles the showing of the buy cost of the current production in the city descriptions.
Definition at line 3192 of file control.cpp.
Referenced by mr_menu::slot_city_buycost().
| void key_city_growth_toggle | ( | ) |
Toggles the "show city growth turns" option by passing off the request to another function...
Definition at line 3186 of file control.cpp.
Referenced by mr_menu::slot_city_growth().
| void key_city_names_toggle | ( | ) |
Handle user 'toggle city names display' input.
Definition at line 3180 of file control.cpp.
Referenced by mr_menu::slot_city_names().
| void key_city_outlines_toggle | ( | ) |
Toggle drawing of city outlines.
Definition at line 3155 of file control.cpp.
Referenced by mr_menu::slot_city_outlines().
| void key_city_output_toggle | ( | ) |
Toggle drawing of city output produced by workers of the city.
Definition at line 3160 of file control.cpp.
Referenced by mr_menu::slot_city_output().
| void key_city_productions_toggle | ( | ) |
Handle user 'toggle city production display' input.
Definition at line 3197 of file control.cpp.
Referenced by mr_menu::slot_city_production().
| void key_city_trade_routes_toggle | ( | ) |
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 3203 of file control.cpp.
Referenced by mr_menu::slot_city_traderoutes().
| void key_end_turn | ( | ) |
Handle user 'end turn' input.
Definition at line 2762 of file control.cpp.
Referenced by map_view::keyPressEvent(), top_bar_finish_turn(), and unit_focus_advance().
| void key_map_borders_toggle | ( | ) |
Toggle map borders on the mapview on/off based on a keypress.
Definition at line 3170 of file control.cpp.
Referenced by mr_menu::slot_borders().
| void key_map_grid_toggle | ( | ) |
Handle user 'toggle map grid' input.
Definition at line 3165 of file control.cpp.
Referenced by mr_menu::slot_map_grid().
| void key_map_native_toggle | ( | ) |
Toggle native tiles on the mapview on/off based on a keypress.
Definition at line 3175 of file control.cpp.
Referenced by mr_menu::slot_native_tiles().
| void key_recall_previous_focus_unit | ( | ) |
Recall the previous focus unit(s).
Definition at line 2767 of file control.cpp.
Referenced by map_view::keyPressEvent().
| void key_unit_action_select | ( | ) |
Handle user 'Do...' input.
Definition at line 2810 of file control.cpp.
Referenced by key_unit_action_select_tgt().
| void 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 2837 of file control.cpp.
Referenced by mr_menu::slot_action().
| void key_unit_airbase | ( | ) |
Handle user 'build base of class airbase' input.
Definition at line 2952 of file control.cpp.
Referenced by mr_menu::slot_unit_airbase().
| void key_unit_auto_explore | ( | ) |
Handle user 'autoexplore' input.
Definition at line 2969 of file control.cpp.
Referenced by mr_menu::slot_unit_explore().
| void key_unit_auto_settle | ( | ) |
Call to request (from the server) that the focus unit is put into autosettler mode.
Definition at line 2982 of file control.cpp.
Referenced by mr_menu::slot_auto_settler().
|
static |
Handle user extra cleaning input of given type.
Definition at line 3066 of file control.cpp.
Referenced by key_unit_fallout().
| void key_unit_connect | ( | enum unit_activity | activity, |
| struct extra_type * | tgt | ||
| ) |
Handle user pressing key for 'Connect' command.
Definition at line 2802 of file control.cpp.
Referenced by mr_menu::slot_conn_irrigation(), mr_menu::slot_conn_rail(), and mr_menu::slot_conn_road().
| void key_unit_convert | ( | ) |
Unit convert key pressed or respective menu entry selected.
Definition at line 2994 of file control.cpp.
Referenced by mr_menu::slot_convert().
| void key_unit_cultivate | ( | ) |
Handle user 'cultivate' input.
Definition at line 3090 of file control.cpp.
Referenced by mr_menu::slot_cultivate().
| void key_unit_done | ( | ) |
Handle user 'unit done' input.
Definition at line 2891 of file control.cpp.
Referenced by mr_menu::slot_done_moving().
|
static |
Handle user extra building input of given type.
Definition at line 3051 of file control.cpp.
Referenced by key_unit_irrigate(), and key_unit_mine().
| void key_unit_fallout | ( | ) |
Handle user 'clean fallout' input.
Definition at line 3004 of file control.cpp.
Referenced by mr_menu::slot_clean_fallout().
| void key_unit_fortify | ( | ) |
Handle user 'fortify' input.
Definition at line 3012 of file control.cpp.
Referenced by mr_menu::slot_unit_fortify().
| void key_unit_fortress | ( | ) |
Handle user 'build base of class fortress' input.
Definition at line 3024 of file control.cpp.
Referenced by mr_menu::slot_unit_fortress().
| void key_unit_goto | ( | ) |
Handle user 'unit goto' input.
Definition at line 2896 of file control.cpp.
Referenced by mr_menu::slot_unit_goto().
| void key_unit_homecity | ( | ) |
Handle user 'change homecity' input.
Definition at line 3041 of file control.cpp.
Referenced by mr_menu::slot_set_home().
| void key_unit_irrigate | ( | ) |
Handle user 'irrigate' input.
Definition at line 3082 of file control.cpp.
Referenced by mr_menu::slot_build_irrigation().
| void key_unit_mine | ( | ) |
Handle user 'build mine' input.
Definition at line 3102 of file control.cpp.
Referenced by mr_menu::slot_build_mine().
| 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 2790 of file control.cpp.
Referenced by map_view::keyPressEvent().
| void key_unit_paradrop | ( | ) |
Handle user 'paradrop' input.
Definition at line 2901 of file control.cpp.
Referenced by mr_menu::slot_clean_pollution().
| void key_unit_patrol | ( | ) |
Handle user 'patrol' input.
Definition at line 2906 of file control.cpp.
Referenced by mr_menu::slot_patrol().
| void key_unit_pillage | ( | ) |
Handle user 'pillage' input.
Definition at line 3119 of file control.cpp.
Referenced by mr_menu::slot_pillage().
| void key_unit_plant | ( | ) |
Handle user 'plant' input.
Definition at line 3107 of file control.cpp.
Referenced by mr_menu::slot_plant().
| void key_unit_sentry | ( | ) |
Handle user 'sentry' input.
Definition at line 3131 of file control.cpp.
Referenced by mr_menu::slot_unit_sentry().
| void key_unit_transform | ( | ) |
Handle user 'transform unit' input.
Definition at line 3143 of file control.cpp.
Referenced by mr_menu::slot_transform().
| void key_unit_unload_all | ( | ) |
Handle user 'unload all' input.
Definition at line 2911 of file control.cpp.
Referenced by mr_menu::slot_unload_all().
| void key_unit_wait | ( | ) |
Handle user 'wait' input.
Definition at line 2937 of file control.cpp.
Referenced by act_sel_wait(), pageGame::pageGame(), and mr_menu::slot_wait().
| void key_unit_wakeup_others | ( | ) |
Handle user 'wakeup others' input.
Definition at line 2942 of file control.cpp.
Referenced by mr_menu::slot_unsentry().
|
static |
Quickselecting a unit is normally done with [control] left, right click, for the current tile.
Bypassing the stack popup is quite convenient, and can be tactically important in furious multiplayer games.
Definition at line 2525 of file control.cpp.
Referenced by do_map_click().
| void request_action_details | ( | action_id | action, |
| int | actor_id, | ||
| int | target_id | ||
| ) |
Request data for follow up questions about an action the unit can perform.
Definition at line 1582 of file control.cpp.
Referenced by diplomat_bribe(), diplomat_incite(), diplomat_incite_escape(), spy_request_sabotage_esc_list(), spy_request_sabotage_list(), and spy_request_strike_bld_list().
| void request_center_focus_unit | ( | ) |
Center to focus unit.
Definition at line 2254 of file control.cpp.
Referenced by click_label::mouse_clicked(), mr_menu::slot_center_view(), and top_bar_center_unit().
| 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 1563 of file control.cpp.
Referenced by airlift(), attack(), base(), bombard(), bombard2(), bombard3(), capture_units(), caravan_establish_trade(), caravan_help_build(), caravan_marketplace(), clean_fallout(), clean_pollution(), conquer_city(), conquer_city2(), convert_unit(), destroy_city(), diplomat_embassy(), diplomat_investigate(), diplomat_sabotage(), diplomat_sabotage_esc(), diplomat_steal(), diplomat_steal_esc(), disband_unit(), do_disband_alternative(), do_that_action(), do_unit_paradrop_to(), expel_unit(), finish_city(), fortify(), handle_city_name_suggestion_info(), handle_unit_actions(), heal_unit(), irrigate(), join_city(), mine(), nuke(), nuke_city(), nuke_units(), pillage(), popup_action_selection(), popup_bribe_dialog(), popup_incite_dialog(), 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(), spy_embassy(), 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_gold(), spy_steal_gold_esc(), spy_steal_maps(), spy_steal_maps_esc(), spy_steal_something(), suicide_attack(), transport_alight(), transport_board(), transport_embark(), transport_unload(), unit_home_city(), unit_recycle(), user_action_unit_vs_city(), user_action_unit_vs_self(), user_action_unit_vs_tile(), and user_action_unit_vs_unit().
| void request_move_unit_direction | ( | struct unit * | punit, |
| int | dir | ||
| ) |
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 1660 of file control.cpp.
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 1712 of file control.cpp.
Referenced by clear_unit_orders(), 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(), request_unit_unload_all(), 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 1721 of file control.cpp.
Referenced by key_unit_airbase(), key_unit_clean(), key_unit_extra(), key_unit_fortress(), pillage_something(), request_new_unit_activity(), request_unit_load(), request_unit_pillage(), request_unit_unload(), mr_menu::slot_build_base(), mr_menu::slot_build_path(), mr_menu::slot_build_road(), and mr_menu::slot_clean_pollution().
| void request_toggle_city_buycost | ( | ) |
Toggle display of city buycost.
Definition at line 2228 of file control.cpp.
Referenced by key_city_buycost_toggle().
| void request_toggle_city_growth | ( | ) |
Toggle display of city growth (turns-to-grow)
Definition at line 2202 of file control.cpp.
Referenced by key_city_growth_toggle().
| void request_toggle_city_names | ( | ) |
Toggle display of city names.
Definition at line 2189 of file control.cpp.
Referenced by key_city_names_toggle().
| void request_toggle_city_outlines | ( | ) |
Toggle display of city outlines on the map.
Definition at line 2124 of file control.cpp.
Referenced by key_city_outlines_toggle().
| void request_toggle_city_output | ( | ) |
Toggle display of worker output of cities on the map.
Definition at line 2137 of file control.cpp.
Referenced by key_city_output_toggle().
| void request_toggle_city_productions | ( | ) |
Toggle display of city productions.
Definition at line 2215 of file control.cpp.
Referenced by key_city_productions_toggle().
| void request_toggle_city_trade_routes | ( | ) |
Toggle display of city trade routes.
Definition at line 2241 of file control.cpp.
Referenced by key_city_trade_routes_toggle().
| void request_toggle_map_borders | ( | ) |
Toggle display of national borders on the map.
Definition at line 2163 of file control.cpp.
Referenced by key_map_borders_toggle().
| void request_toggle_map_grid | ( | ) |
Toggle display of grid lines on the map.
Definition at line 2150 of file control.cpp.
Referenced by key_map_grid_toggle().
| void request_toggle_map_native | ( | ) |
Toggle display of native tiles on the map.
Definition at line 2176 of file control.cpp.
Referenced by key_map_native_toggle().
Send unit airlift request to server.
Definition at line 1397 of file control.cpp.
Referenced by goto_dialog::airlift_to(), and multiairlift().
| void request_unit_autosettlers | ( | const struct unit * | punit | ) |
Call to request (from the server) that the settler unit is put into autosettler mode.
Definition at line 1918 of file control.cpp.
Referenced by key_unit_auto_settle().
| void request_unit_build_city | ( | struct unit * | punit | ) |
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 1599 of file control.cpp.
Referenced by mr_menu::slot_build_city().
Send request to do caravan action - establishing traderoute or helping in wonder building - to server.
Definition at line 1988 of file control.cpp.
Referenced by mr_menu::slot_build_city(), and mr_menu::slot_build_road().
| void request_unit_change_homecity | ( | struct unit * | punit | ) |
Send request to change unit homecity to server.
Definition at line 1872 of file control.cpp.
Referenced by freeciv::add_quick_unit_actions(), and key_unit_homecity().
| 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 1336 of file control.cpp.
Referenced by key_unit_connect().
| void request_unit_convert | ( | struct unit * | punit | ) |
Sends unit convert packet.
Definition at line 1896 of file control.cpp.
Referenced by key_unit_convert().
| void request_unit_disband | ( | struct unit * | punit | ) |
Send request to disband unit to server.
Definition at line 1853 of file control.cpp.
Referenced by disband_all_units(), and disband_box::disband_clicked().
| void request_unit_fortify | ( | struct unit * | punit | ) |
Try to fortify unit.
Definition at line 2077 of file control.cpp.
Referenced by freeciv::add_quick_unit_actions().
| 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 995 of file control.cpp.
Referenced by key_unit_goto(), maybe_activate_keyboardless_goto(), and go_act_menu::start_go_act().
Send a request to the server that the cargo be loaded into the transporter.
If ptransporter is nullptr a suitable transporter will be chosen.
Definition at line 1934 of file control.cpp.
Referenced by request_transport(), and hud_unit_loader::selection_changed().
| void request_unit_move_done | ( | ) |
Set focus units to FOCUS_DONE state.
Definition at line 2277 of file control.cpp.
Referenced by key_unit_done().
Order a unit to move to a neighboring tile without performing an action.
Does nothing it the destination tile isn't next to the tile where the unit currently is located.
Definition at line 1618 of file control.cpp.
Referenced by act_sel_keep_moving().
| void request_unit_paradrop | ( | const std::vector< unit * > & | units | ) |
Have the player select what tile to paradrop to.
Once selected a paradrop request will be sent to server.
Definition at line 2009 of file control.cpp.
Referenced by key_unit_paradrop().
| void request_unit_patrol | ( | ) |
Either start new patrol route planning, or add waypoint to current one.
Definition at line 2043 of file control.cpp.
Referenced by key_unit_patrol().
| void request_unit_pillage | ( | struct unit * | punit | ) |
Send pillage request to server.
Definition at line 2088 of file control.cpp.
Referenced by key_unit_pillage().
| void request_unit_select | ( | const std::vector< unit * > & | 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 1484 of file control.cpp.
Referenced by 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().
| void request_unit_sentry | ( | struct unit * | punit | ) |
Try to sentry unit.
Definition at line 2066 of file control.cpp.
Referenced by freeciv::add_quick_unit_actions().
| void request_unit_ssa_set | ( | const struct unit * | punit, |
| enum server_side_agent | agent | ||
| ) |
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 1906 of file control.cpp.
Referenced by 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(), request_units_return(), send_goto_route(), and send_path_orders().
| void request_unit_unload | ( | struct unit * | pcargo | ) |
Send a request to the server that the cargo be unloaded from its current transporter.
Definition at line 1962 of file control.cpp.
Referenced by freeciv::add_quick_unit_actions(), request_unit_unload_all(), and mr_menu::slot_unload().
Returns one of the unit of the transporter which can have focus next.
Definition at line 1364 of file control.cpp.
Referenced by freeciv::add_quick_unit_actions(), and key_unit_unload_all().
| void request_unit_upgrade | ( | struct unit * | punit | ) |
Send request to upgrade unit to server.
Definition at line 1884 of file control.cpp.
Referenced by popup_upgrade_dialog().
| void request_unit_wakeup | ( | struct unit * | punit | ) |
(RP:) un-sentry all my own sentried units on punit's tile
Definition at line 1476 of file control.cpp.
Referenced by key_unit_wakeup_others().
| void request_units_return | ( | ) |
Return-and-recover for a particular unit.
This sets the unit to GOTO the nearest city.
Definition at line 1406 of file control.cpp.
Referenced by mr_menu::setup_menus().
| void request_units_wait | ( | const std::vector< unit * > & | units | ) |
Set units in list to waiting focus and advance focus.
Definition at line 2266 of file control.cpp.
Referenced by key_unit_wait().
| void set_auto_center_enabled | ( | bool | enabled | ) |
Allows disabling automatic map recentering.
Definition at line 417 of file control.cpp.
Referenced by map_view::shortcut_pressed(), and map_view::shortcut_released().
| void set_hover_state | ( | const std::vector< unit * > & | units, |
| 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 272 of file control.cpp.
Referenced by clear_hover_state(), key_cancel_action(), key_unit_action_select_tgt(), request_unit_connect(), request_unit_goto(), request_unit_paradrop(), request_unit_patrol(), map_view::show_debugger(), mr_menu::slot_delayed_goto(), and update_line().
Adjusts way combatants are displayed suitable for combat.
Definition at line 905 of file control.cpp.
Referenced by decrease_unit_hp_smooth(), handle_unit_bombard_info(), and handle_unit_combat_info().
| bool should_ask_server_for_actions | ( | const struct unit * | punit | ) |
Returns TRUE iff the client should ask the server about what actions a unit can perform.
Definition at line 318 of file control.cpp.
Referenced by action_selection_next_in_focus(), current_focus_append(), freeciv::layer_units::fill_sprite_array(), handle_unit_packet_common(), and unit_focus_advance().
|
static |
Store the focus unit(s).
This is used so that we can return to the previously focused unit with an appropriate keypress.
Definition at line 180 of file control.cpp.
Referenced by unit_focus_set().
| void unit_change_battlegroup | ( | struct unit * | punit, |
| int | battlegroup | ||
| ) |
Change the battlegroup for this unit.
Definition at line 237 of file control.cpp.
Referenced by handle_unit_packet_common().
| void unit_focus_add | ( | struct unit * | punit | ) |
Adds this unit to the list of units in focus.
Definition at line 534 of file control.cpp.
Referenced by unit_list_widget::activate(), do_map_click(), freeciv::upkeep_widget::item_double_clicked(), key_recall_previous_focus_unit(), request_unit_select(), and unit_hud_selector::uhs_select().
| void unit_focus_advance | ( | ) |
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.
Definition at line 617 of file control.cpp.
Referenced by client_remove_unit(), request_unit_move_done(), request_units_wait(), and unit_focus_update().
| void unit_focus_set | ( | struct unit * | punit | ) |
Sets the focus unit directly.
The unit given will be given the focus; if nullptr 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 479 of file control.cpp.
Referenced by unit_list_widget::activate(), client_state(), handle_city_sabotage_list(), handle_unit_action_answer(), freeciv::upkeep_widget::item_double_clicked(), key_recall_previous_focus_unit(), key_unit_unload_all(), units_select::mousePressEvent(), request_unit_select(), city_dialog::showEvent(), unit_focus_advance(), and unit_focus_set_and_select().
| void unit_focus_set_and_select | ( | struct unit * | punit | ) |
The only difference is that here we draw the "cross".
Definition at line 563 of file control.cpp.
Referenced by do_map_click(), and units_view::find_nearest().
| void unit_focus_update | ( | ) |
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 718 of file control.cpp.
Referenced by client_state(), handle_game_info(), handle_new_year(), handle_unit_packet_common(), and city_dialog::hideEvent().
| void unit_focus_urgent | ( | struct unit * | punit | ) |
Store a priority focus unit.
Definition at line 193 of file control.cpp.
Referenced by action_decision_request(), and handle_unit_packet_common().
| bool unit_is_in_focus | ( | const struct unit * | punit | ) |
Return TRUE iff this unit is in focus.
Definition at line 364 of file control.cpp.
Referenced by action_decision_request(), freeciv::layer::do_draw_unit(), do_move_unit(), freeciv::layer_background::fill_sprite_array(), freeciv::layer_units::fill_sprite_array(), find_best_focus_candidate(), get_drawable_unit(), handle_unit_packet_common(), quickselect(), set_units_in_combat(), unit_drawn_with_city_outline(), and unit_focus_add().
| void unit_register_battlegroup | ( | struct unit * | punit | ) |
Call this on new units to enter them in the battlegroup lists.
Definition at line 257 of file control.cpp.
Referenced by handle_unit_packet_common().
| void wakeup_sentried_units | ( | struct tile * | ptile | ) |
Wakes all owned sentried units on tile.
Definition at line 1458 of file control.cpp.
Referenced by request_unit_wakeup(), and wakeup_button_pressed().
|
static |
Definition at line 112 of file control.cpp.
Referenced by action_selection_no_longer_in_progress(), ask_server_for_actions(), and can_ask_server_for_actions().
|
static |
Definition at line 92 of file control.cpp.
Referenced by control_free(), control_init(), control_unit_killed(), unit_change_battlegroup(), and unit_register_battlegroup().
| enum unit_activity connect_activity |
Definition at line 79 of file control.cpp.
Referenced by do_map_click(), key_cancel_action(), key_unit_action_select_tgt(), request_unit_connect(), set_hover_state(), and update_line().
| struct extra_type* connect_tgt |
Definition at line 84 of file control.cpp.
Referenced by do_map_click(), key_cancel_action(), key_unit_action_select_tgt(), request_unit_connect(), set_hover_state(), and update_line().
|
static |
Definition at line 72 of file control.cpp.
Referenced by control_free(), get_num_units_in_focus(), and get_units_in_focus().
|
static |
Definition at line 65 of file control.cpp.
Referenced by do_disband_alternative().
| action_id goto_last_action |
Definition at line 86 of file control.cpp.
Referenced by control_mouse_cursor(), do_map_click(), key_cancel_action(), key_unit_action_select_tgt(), set_hover_state(), and update_line().
| enum unit_orders goto_last_order |
Definition at line 88 of file control.cpp.
Referenced by key_cancel_action(), key_unit_action_select_tgt(), send_goto_route(), set_hover_state(), and update_line().
| int goto_last_sub_tgt |
Definition at line 88 of file control.cpp.
Referenced by key_cancel_action(), key_unit_action_select_tgt(), set_hover_state(), and update_line().
| int goto_last_tgt |
Definition at line 87 of file control.cpp.
Referenced by key_cancel_action(), key_unit_action_select_tgt(), and set_hover_state().
| enum cursor_hover_state hover_state = HOVER_NONE |
Definition at line 79 of file control.cpp.
Referenced by base_set_mapview_origin(), control_mouse_cursor(), do_map_click(), do_move_unit(), do_unit_goto(), goto_add_waypoint(), goto_pop_waypoint(), goto_tile_state(), is_valid_goto_draw_line(), key_cancel_action(), key_unit_action_select_tgt(), map_view::mouseMoveEvent(), release_goto_button(), request_unit_connect(), request_unit_goto(), request_unit_patrol(), send_goto_route(), set_hover_state(), map_view::show_debugger(), mr_menu::slot_delayed_goto(), unit_focus_add(), and update_line().
|
static |
Definition at line 91 of file control.cpp.
Referenced by control_init(), and control_mouse_cursor().
| bool non_ai_unit_focus |
Definition at line 118 of file control.cpp.
Referenced by handle_start_phase(), and unit_focus_advance().
|
static |
Definition at line 76 of file control.cpp.
Referenced by control_free(), control_init(), control_unit_killed(), key_recall_previous_focus_unit(), and store_previous_focus().
|
static |
Definition at line 98 of file control.cpp.
Referenced by find_visible_unit(), and set_units_in_combat().
|
static |
Definition at line 99 of file control.cpp.
Referenced by find_visible_unit(), and set_units_in_combat().
|
static |
Definition at line 95 of file control.cpp.
Referenced by do_move_unit(), and find_visible_unit().
|
static |
Definition at line 79 of file control.cpp.
Referenced by control_free(), control_init(), control_unit_killed(), unit_focus_advance(), and unit_focus_urgent().