![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "fcintl.h"#include "log.h"#include "support.h"#include "combat.h"#include "game.h"#include "unitlist.h"#include "chatline_common.h"#include "client_main.h"#include "climisc.h"#include "control.h"#include "goto.h"#include "governor.h"#include "mapctrl_common.h"#include "mapview_g.h"#include "minimap_panel.h"#include "options.h"#include "page_game.h"#include "views/view_map.h"#include "views/view_map_common.h"
Include dependency graph for mapctrl_common.cpp:Go to the source code of this file.
Functions | |
| static void | clipboard_send_production_packet (struct city *pcity) |
| Send request to build production in clipboard to server. More... | |
| void | cancel_selection_rectangle () |
| Redraws the selection rectangle after a map flush. More... | |
| void | key_city_overlay (int canvas_x, int canvas_y) |
| The user pressed the overlay-city button (t) while the mouse was at the given canvas position. More... | |
| bool | clipboard_copy_production (struct tile *ptile) |
| Shift-Left-Click on owned city or any visible unit to copy. More... | |
| void | clipboard_paste_production (struct city *pcity) |
| If City tiles are hilited, paste into all those cities. More... | |
| void | upgrade_canvas_clipboard () |
| A newer technology may be available for units. More... | |
| void | release_goto_button (int canvas_x, int canvas_y) |
| Goto button has been released. More... | |
| void | maybe_activate_keyboardless_goto (int canvas_x, int canvas_y) |
| The goto hover state is only activated when the mouse pointer moves beyond the tile where the button was depressed, to avoid mouse typos. More... | |
| bool | get_turn_done_button_state () |
| Return TRUE iff the turn done button should be enabled. More... | |
| bool | can_end_turn () |
| Return TRUE iff client can end turn. More... | |
| void | action_button_pressed (int canvas_x, int canvas_y, enum quickselect_type qtype) |
| Do some appropriate action when the "main" mouse button (usually left-click) is pressed. More... | |
| void | wakeup_button_pressed (int canvas_x, int canvas_y) |
| Wakeup sentried units on the tile of the specified location. More... | |
| void | adjust_workers_button_pressed (int canvas_x, int canvas_y) |
| Adjust the position of city workers from the mapview. More... | |
| void | recenter_button_pressed (int canvas_x, int canvas_y) |
| Recenter the map on the canvas location, on user request. More... | |
| void | update_turn_done_button_state () |
| Update the turn done button state. More... | |
| void | update_line (int canvas_x, int canvas_y) |
| Update the goto/patrol line to the given map canvas location. More... | |
Variables | |
| static int | rec_corner_x |
| static int | rec_corner_y |
| static int | rec_w |
| static int | rec_h |
| bool | rectangle_active = false |
| bool | tiles_hilited_cities = false |
| struct universal | clipboard |
| bool | keyboardless_goto_button_down = false |
| bool | keyboardless_goto_active = false |
| struct tile * | keyboardless_goto_start_tile |
| struct city * | city_workers_display = nullptr |
| void action_button_pressed | ( | int | canvas_x, |
| int | canvas_y, | ||
| enum quickselect_type | qtype | ||
| ) |
Do some appropriate action when the "main" mouse button (usually left-click) is pressed.
For more sophisticated user control use (or write) a different xxx_button_pressed function.
Definition at line 259 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_pressed(), and map_view::shortcut_released().
| void adjust_workers_button_pressed | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
Adjust the position of city workers from the mapview.
Definition at line 286 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_pressed().
| bool can_end_turn | ( | ) |
Return TRUE iff client can end turn.
Definition at line 239 of file mapctrl_common.cpp.
Referenced by get_turn_done_button_state(), manual_turn_done_callback(), send_turn_done(), and update_turn_done_button_state().
| void cancel_selection_rectangle | ( | ) |
Redraws the selection rectangle after a map flush.
Definition at line 64 of file mapctrl_common.cpp.
Referenced by enter_goto_state().
| bool clipboard_copy_production | ( | struct tile * | ptile | ) |
Shift-Left-Click on owned city or any visible unit to copy.
Returns whether it found anything to try to copy.
Definition at line 98 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_pressed().
| void clipboard_paste_production | ( | struct city * | pcity | ) |
If City tiles are hilited, paste into all those cities.
Otherwise paste into the one city under the mouse pointer.
Definition at line 140 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_pressed().
|
static |
Send request to build production in clipboard to server.
Definition at line 161 of file mapctrl_common.cpp.
Referenced by clipboard_paste_production().
| bool get_turn_done_button_state | ( | ) |
Return TRUE iff the turn done button should be enabled.
Definition at line 229 of file mapctrl_common.cpp.
Referenced by fc_game_tab_widget::event(), update_turn_done_button(), and update_turn_done_button_state().
| void key_city_overlay | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
The user pressed the overlay-city button (t) while the mouse was at the given canvas position.
Definition at line 78 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_pressed().
| void maybe_activate_keyboardless_goto | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
The goto hover state is only activated when the mouse pointer moves beyond the tile where the button was depressed, to avoid mouse typos.
Definition at line 214 of file mapctrl_common.cpp.
Referenced by map_view::mouseMoveEvent().
| void recenter_button_pressed | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
Recenter the map on the canvas location, on user request.
Usually this is done with a right-click.
Definition at line 319 of file mapctrl_common.cpp.
Referenced by editor_end_selection_rectangle(), map_view::keyPressEvent(), and map_view::shortcut_pressed().
| void release_goto_button | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
Goto button has been released.
Finish goto.
Definition at line 194 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_released().
| void update_line | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
Update the goto/patrol line to the given map canvas location.
Definition at line 349 of file mapctrl_common.cpp.
Referenced by create_line_at_mouse_pos(), and map_view::mouseMoveEvent().
| void update_turn_done_button_state | ( | ) |
Update the turn done button state.
Definition at line 332 of file mapctrl_common.cpp.
Referenced by client_state(), handle_player_info(), handle_start_phase(), handle_thaw_client(), manual_turn_done_callback(), governor::run(), and send_turn_done().
| void upgrade_canvas_clipboard | ( | ) |
A newer technology may be available for units.
Also called from packhand.c.
Definition at line 176 of file mapctrl_common.cpp.
Referenced by clipboard_copy_production(), and handle_player_info().
| void wakeup_button_pressed | ( | int | canvas_x, |
| int | canvas_y | ||
| ) |
Wakeup sentried units on the tile of the specified location.
Definition at line 274 of file mapctrl_common.cpp.
Referenced by map_view::shortcut_pressed().
| struct city* city_workers_display = nullptr |
Definition at line 55 of file mapctrl_common.cpp.
Referenced by adjust_workers_button_pressed(), city_packet_common(), and do_map_click().
| struct universal clipboard |
Definition at line 43 of file mapctrl_common.cpp.
Referenced by clipboard_copy_production(), clipboard_paste_production(), clipboard_send_production_packet(), and upgrade_canvas_clipboard().
| bool keyboardless_goto_active = false |
Definition at line 51 of file mapctrl_common.cpp.
Referenced by do_map_click(), key_cancel_action(), maybe_activate_keyboardless_goto(), release_goto_button(), and map_view::shortcut_released().
| bool keyboardless_goto_button_down = false |
Definition at line 50 of file mapctrl_common.cpp.
Referenced by do_map_click(), key_cancel_action(), map_view::mouseMoveEvent(), and release_goto_button().
| struct tile* keyboardless_goto_start_tile |
Definition at line 52 of file mapctrl_common.cpp.
Referenced by do_map_click(), key_cancel_action(), maybe_activate_keyboardless_goto(), and release_goto_button().
|
static |
Definition at line 36 of file mapctrl_common.cpp.
Referenced by cancel_selection_rectangle().
|
static |
Definition at line 36 of file mapctrl_common.cpp.
Referenced by cancel_selection_rectangle().
|
static |
Definition at line 37 of file mapctrl_common.cpp.
Referenced by cancel_selection_rectangle().
|
static |
Definition at line 37 of file mapctrl_common.cpp.
Referenced by cancel_selection_rectangle().
| bool rectangle_active = false |
Definition at line 39 of file mapctrl_common.cpp.
Referenced by base_set_mapview_origin(), and cancel_selection_rectangle().
| bool tiles_hilited_cities = false |
Definition at line 43 of file mapctrl_common.cpp.
Referenced by clipboard_paste_production().