Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-qt/mapctrl.cpp Source File

Freeciv-3.2

Loading...
Searching...
No Matches
mapctrl.cpp
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18// Qt
19#include <QApplication>
20#include <QKeyEvent>
21#include <QMouseEvent>
22#include <QPushButton>
23
24// common
25#include "control.h"
26#include "goto.h"
27
28// client
29#include "client_main.h"
30#include "climap.h"
31#include "control.h"
32#include "mapctrl.h"
33#include "themes_common.h"
34#include "tile.h"
35#include "unit.h"
36#include "zoom.h"
37
38// gui-qt
39#include "citydlg.h"
40#include "fc_client.h"
41#include "qtg_cxxside.h"
42#include "shortcuts.h"
43
44extern void side_disable_endturn(bool do_restore);
45extern void update_turn_done_tooltip(void);
46extern void qload_lua_script();
47extern void qreload_lua_script();
48extern "C" int city_buy_production(struct city *pcity);
49
50/**********************************************************************/
54 void popup_newcity_dialog(struct unit *punit, const char *suggestname)
55{
56 hud_input_box *ask = new hud_input_box(gui()->central_wdg);
57 int index = tile_index(unit_tile(punit));
58
59 ask->set_text_title_definput(_("What should we call our new city?"),
60 _("Build New City"), suggestname);
61 ask->setAttribute(Qt::WA_DeleteOnClose);
62 QObject::connect(ask, &hud_input_box::finished, [=](int result) {
63 if (result == QDialog::Accepted) {
64 QByteArray ask_bytes;
65
66 ask_bytes = ask->input_edit.text().toUtf8();
67 finish_city(index_to_tile(&(wld.map), index),
68 ask_bytes.data());
69 } else {
70 cancel_city(index_to_tile(&(wld.map), index));
71 }
72 });
73 ask->show();
74
75 return;
76}
77
78/**********************************************************************/
82 void set_turn_done_button_state(bool state)
83{
84 side_disable_endturn(state);
85
86 update_turn_done_tooltip();
87}
88
89/**********************************************************************/
92 void create_line_at_mouse_pos(void)
93{
94 QPoint global_pos, local_pos;
95 int x, y;
96
97 global_pos = QCursor::pos();
98 local_pos = gui()->mapview_wdg->mapFromGlobal(global_pos);
99 x = local_pos.x();
100 y = local_pos.y();
101
102 if (x >= 0 && y >= 0 && x < mapview.width && y < mapview.width) {
103 update_line(x, y);
104 }
105}
106
107/**********************************************************************/
111 void update_rect_at_mouse_pos(void)
112{
113 // PLS DONT PORT IT
114}
115
116/**********************************************************************/
119 void map_view::keyPressEvent(QKeyEvent * event)
120{
121 Qt::KeyboardModifiers key_mod = QApplication::keyboardModifiers();
122 bool is_shift = key_mod.testFlag(Qt::ShiftModifier);
123
124 if (C_S_RUNNING == client_state()) {
125 if (is_shift) {
126 switch (event->key()) {
127 case Qt::Key_Return:
128 case Qt::Key_Enter:
129 key_end_turn();
130 return;
131 default:
132 break;
133 }
134 }
135
136 switch (event->key()) {
137 case Qt::Key_Up:
138 case Qt::Key_8:
139 if (is_shift) {
140 recenter_button_pressed(gui()->mapview_wdg->width() / 2, 0);
141 } else {
142 key_unit_move(DIR8_NORTH);
143 }
144 return;
145 case Qt::Key_Left:
146 case Qt::Key_4:
147 if (is_shift) {
148 recenter_button_pressed(0, gui()->mapview_wdg->height() / 2);
149 } else {
150 key_unit_move(DIR8_WEST);
151 }
152 return;
153 case Qt::Key_Right:
154 case Qt::Key_6:
155 if (is_shift) {
156 recenter_button_pressed(gui()->mapview_wdg->width(),
157 gui()->mapview_wdg->height() / 2);
158 } else {
159 key_unit_move(DIR8_EAST);
160 }
161 return;
162 case Qt::Key_Down:
163 case Qt::Key_2:
164 if (is_shift) {
165 recenter_button_pressed(gui()->mapview_wdg->width() / 2,
166 gui()->mapview_wdg->height());
167 } else {
168 key_unit_move(DIR8_SOUTH);
169 }
170 return;
171 case Qt::Key_PageUp:
172 case Qt::Key_9:
173 key_unit_move(DIR8_NORTHEAST);
174 return;
175 case Qt::Key_PageDown:
176 case Qt::Key_3:
177 key_unit_move(DIR8_SOUTHEAST);
178 return;
179 case Qt::Key_Home:
180 case Qt::Key_7:
181 key_unit_move(DIR8_NORTHWEST);
182 return;
183 case Qt::Key_End:
184 case Qt::Key_1:
185 key_unit_move(DIR8_SOUTHWEST);
186 return;
187 case Qt::Key_5:
188 case Qt::Key_Clear:
189 key_recall_previous_focus_unit();
190 return;
191 case Qt::Key_Escape:
192 key_cancel_action();
193 if (gui()->infotab->chat_maximized) {
194 gui()->infotab->restore_chat();
195 }
196 return;
197 case Qt::Key_Enter:
198 case Qt::Key_Return:
199 if (!gui()->infotab->chat_maximized) {
200 gui()->infotab->maximize_chat();
201 gui()->infotab->chtwdg->chat_line->setFocus();
202 }
203 return;
204 default:
205 break;
206 }
207 shortcut_pressed(event->key());
208 }
209}
210
211/**********************************************************************/
214 void map_view::shortcut_pressed(int key)
215{
216 Qt::MouseButtons bt;
217 QPoint pos;
218 fc_shortcut *sc;
219 fc_shortcut *sc_sec;
220 Qt::KeyboardModifiers md;
221 production_widget *pw;
222 struct tile *ctile = nullptr;
223 struct city *pcity = nullptr;
224
225 md = QApplication::keyboardModifiers();
226 bt = QApplication::mouseButtons();
227 pos = mapFromGlobal(QCursor::pos());
228
229 ctile = canvas_pos_to_tile(pos.x(), pos.y(), map_zoom);
230 pcity = ctile ? tile_city(ctile) : nullptr;
231
232 if (pcity && pcity->owner != client_player()) {
233 pcity = nullptr;
234 }
235
236 // Trade Generator - skip
237 sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
238 if (bt == sc->mouse && md == sc->mod
239 && gui()->trade_gen.hover_city) {
240 ctile = canvas_pos_to_tile(pos.x(), pos.y(), map_zoom);
241 gui()->trade_gen.add_tile(ctile);
242 gui()->mapview_wdg->repaint();
243
244 return;
245 }
246
247 // Rally point - select city - skip
248 if (bt == sc->mouse && md == sc->mod
249 && gui()->rallies.hover_city) {
250 char text[1024];
251 struct city *rcity;
252
253 ctile = canvas_pos_to_tile(pos.x(), pos.y(), map_zoom);
254 rcity = tile_city(ctile);
255 if (rcity) {
256 gui()->rallies.hover_tile = true;
257 gui()->rallies.rally_city = rcity;
258
259 fc_snprintf(text, sizeof(text),
260 _("Selected city %s. Now choose rally point."),
261 city_link(rcity));
262 output_window_append(ftc_client, text);
263 } else {
264 output_window_append(ftc_client, _("No city selected. Aborted"));
265 }
266
267 return;
268 }
269
270 // Rally point - select tile - skip
271 if (bt == Qt::LeftButton && gui()->rallies.hover_tile && ctile != NULL) {
272 char text[1024];
273 struct city *rcity = gui()->rallies.rally_city;
274
275 fc_assert_ret(rcity != NULL);
276
277 if (send_rally_tile(rcity, ctile, FALSE)) {
278 fc_snprintf(text, sizeof(text),
279 _("Tile %s set as rally point from city %s."),
280 tile_link(ctile), city_link(rcity));
281 output_window_append(ftc_client, text);
282 } else {
283 fc_snprintf(text, sizeof(text),
284 _("Could not set rally point for city %s."),
285 city_link(rcity));
286 output_window_append(ftc_client, text);
287 }
288
289 gui()->rallies.rally_city = NULL;
290 gui()->rallies.hover_tile = false;
291
292 return;
293 }
294
295 if (bt == Qt::LeftButton && gui()->menu_bar->delayed_order) {
296 ctile = canvas_pos_to_tile(pos.x(), pos.y(), map_zoom);
297 gui()->menu_bar->set_tile_for_order(ctile);
298 clear_hover_state();
299 exit_goto_state();
300 gui()->menu_bar->delayed_order = false;
301
302 return;
303 }
304
305 if (bt == Qt::LeftButton && gui()->infotab->chat_maximized) {
306 gui()->infotab->restore_chat();
307 }
308 if (bt == Qt::LeftButton && gui()->menu_bar->quick_airlifting) {
309 struct city *acity;
310
311 ctile = canvas_pos_to_tile(pos.x(), pos.y(), map_zoom);
312 acity = tile_city(ctile);
313 if (acity) {
314 multiairlift(acity, gui()->menu_bar->airlift_type_id);
315 } else {
316 output_window_append(ftc_client, "No city selected for airlift");
317 }
318 gui()->menu_bar->quick_airlifting = false;
319
320 return;
321 }
322
323 // Check configured shortcuts
324 if (!gui()->menu_bar->delayed_order) {
325 sc = fc_shortcuts::sc()->get_shortcut(SC_QUICK_SELECT);
326 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
327 && pcity != nullptr) {
328 pw = new production_widget(this, pcity, false, 0, 0, true);
329 pw->show();
330
331 return;
332 }
333
334 sc = fc_shortcuts::sc()->get_shortcut(SC_SHOW_UNITS);
335 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
336 && ctile != nullptr && unit_list_size(ctile->units) > 0) {
337 gui()->toggle_unit_sel_widget(ctile);
338
339 return;
340 }
341
342 sc = fc_shortcuts::sc()->get_shortcut(SC_COPY_PROD);
343 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
344 && ctile != nullptr) {
345 clipboard_copy_production(ctile);
346
347 return;
348 }
349
350 sc = fc_shortcuts::sc()->get_shortcut(SC_POPUP_COMB_INF);
351 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
352 && gui()->battlelog_wdg != nullptr) {
353 gui()->battlelog_wdg->show();
354
355 return;
356 }
357
358 sc = fc_shortcuts::sc()->get_shortcut(SC_PASTE_PROD);
359 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
360 && pcity != nullptr) {
361 clipboard_paste_production(pcity);
362
363 return;
364 }
365
366 sc = fc_shortcuts::sc()->get_shortcut(SC_RELOAD_THEME);
367 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
368 load_theme(gui_options.gui_qt_default_theme_name);
369
370 return;
371 }
372
373 sc = fc_shortcuts::sc()->get_shortcut(SC_RELOAD_TILESET);
374 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
375 QPixmapCache::clear();
376 tilespec_reread(tileset_basename(tileset), true, gui()->map_scale);
377
378 return;
379 }
380
381 sc = fc_shortcuts::sc()->get_shortcut(SC_LOAD_LUA);
382 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
383 qload_lua_script();
384
385 return;
386 }
387
388 sc = fc_shortcuts::sc()->get_shortcut(SC_RELOAD_LUA);
389 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
390 qreload_lua_script();
391
392 return;
393 }
394
395 sc = fc_shortcuts::sc()->get_shortcut(SC_HIDE_WORKERS);
396 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
397 key_city_overlay(pos.x(), pos.y());
398
399 return;
400 }
401
402 sc = fc_shortcuts::sc()->get_shortcut(SC_MAKE_LINK);
403 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
404 && ctile != nullptr) {
405 gui()->infotab->chtwdg->make_link(ctile);
406
407 return;
408 }
409
410 sc = fc_shortcuts::sc()->get_shortcut(SC_BUY_MAP);
411 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
412 && pcity != nullptr) {
413 city_buy_production(pcity);
414
415 return;
416 }
417
418 sc = fc_shortcuts::sc()->get_shortcut(SC_QUICK_BUY);
419 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod
420 && pcity != nullptr) {
421 pw = new production_widget(this, pcity, false, 0, 0, true, true);
422 pw->show();
423
424 return;
425 }
426
427 sc = fc_shortcuts::sc()->get_shortcut(SC_APPEND_FOCUS);
428 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
429 action_button_pressed(pos.x(), pos.y(), SELECT_APPEND);
430
431 return;
432 }
433
434 sc = fc_shortcuts::sc()->get_shortcut(SC_ADJUST_WORKERS);
435 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
436 adjust_workers_button_pressed(pos.x(), pos.y());
437
438 return;
439 }
440 }
441
442 sc = fc_shortcuts::sc()->get_shortcut(SC_SCROLL_MAP);
443 sc_sec = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
444 if ((((key && key == sc->key) || (bt == sc->mouse
445 // Check if keyboardless goto active and its shortcut if pressed
446 || (goto_is_active() && (bt == (sc->mouse | sc_sec->mouse)))))
447 && md == sc->mod)) {
448 recenter_button_pressed(pos.x(), pos.y());
449
450 return;
451 }
452
453 sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
454 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
455 if (!goto_is_active()) {
456 stored_autocenter = gui_options.auto_center_on_unit;
457 gui_options.auto_center_on_unit = false;
458 action_button_pressed(pos.x(), pos.y(), SELECT_FOCUS);
459 }
460
461 return;
462 }
463
464 sc = fc_shortcuts::sc()->get_shortcut(SC_POPUP_INFO);
465 if (((key && key == sc->key) || bt == sc->mouse)
466 && md == sc->mod && ctile != nullptr) {
467 gui()->popup_tile_info(ctile);
468
469 return;
470 }
471
472 sc = fc_shortcuts::sc()->get_shortcut(SC_WAKEUP_SENTRIES);
473 if (((key && key == sc->key) || bt == sc->mouse) && md == sc->mod) {
474 wakeup_button_pressed(pos.x(), pos.y());
475
476 return;
477 }
478}
479
480/**********************************************************************/
483 void map_view::shortcut_released(Qt::MouseButton bt)
484{
485 QPoint pos;
486 fc_shortcut *sc;
487 Qt::KeyboardModifiers md;
488 md = QApplication::keyboardModifiers();
489 pos = mapFromGlobal(QCursor::pos());
490
491 sc = fc_shortcuts::sc()->get_shortcut(SC_POPUP_INFO);
492 if (bt == sc->mouse && md == sc->mod) {
493 gui()->popdown_tile_info();
494 return;
495 }
496
497 sc = fc_shortcuts::sc()->get_shortcut(SC_SELECT_BUTTON);
498 if (bt == sc->mouse && md == sc->mod) {
499 if (gui()->trade_gen.hover_city
500 || gui()->rallies.hover_city) {
501 gui()->trade_gen.hover_city = false;
502 gui()->rallies.hover_city = false;
503 return;
504 }
505 if (menu_click) {
506 menu_click = false;
507 return;
508 }
509 if (!keyboardless_goto_active || goto_is_active()) {
510 action_button_pressed(pos.x(), pos.y(), SELECT_POPUP);
511 gui_options.auto_center_on_unit = stored_autocenter;
512 }
513 release_goto_button(pos.x(), pos.y());
514 return;
515 }
516}
517
518/**********************************************************************/
521 void map_view::mousePressEvent(QMouseEvent *event)
522{
523 shortcut_pressed(0);
524}
525
526/**********************************************************************/
529 void map_view::mouseReleaseEvent(QMouseEvent *event)
530{
531 shortcut_released(event->button());
532}
533
534/**********************************************************************/
537 void map_view::mouseMoveEvent(QMouseEvent *event)
538{
539 update_line(event->pos().x(), event->pos().y());
540
541 if (keyboardless_goto_button_down && hover_state == HOVER_NONE) {
542 maybe_activate_keyboardless_goto(event->pos().x(), event->pos().y());
543 }
544 control_mouse_cursor(canvas_pos_to_tile(event->pos().x(),
545 event->pos().y(),
546 map_zoom));
547}
548
549/**********************************************************************/
552 void fc_client::popup_tile_info(struct tile *ptile)
553{
554 struct unit *punit = NULL;
555
556 if (info_tile_wdg != nullptr) {
557 popdown_tile_info();
558 }
559
560 if (TILE_UNKNOWN != client_tile_get_known(ptile)) {
561 mapdeco_set_crosshair(ptile, true);
562 punit = find_visible_unit(ptile);
563 if (punit) {
564 mapdeco_set_gotoroute(punit);
565 if (punit->goto_tile && unit_has_orders(punit)) {
566 mapdeco_set_crosshair(punit->goto_tile, true);
567 }
568 }
569 info_tile_wdg = new info_tile(ptile, mapview_wdg);
570 info_tile_wdg->show();
571 }
572}
573
574/**********************************************************************/
577 void fc_client::popdown_tile_info()
578{
579 mapdeco_clear_crosshairs();
580 mapdeco_clear_gotoroutes();
581 if (info_tile_wdg != nullptr) {
582 info_tile_wdg->close();
583 delete info_tile_wdg;
584 info_tile_wdg = nullptr;
585 }
586}
output_window_append
void output_window_append(const struct ft_color color, const char *featured_text)
Definition chatline_common.c:104
city_buy_production
int city_buy_production(struct city *pcity)
Definition citydlg_common.c:1549
fc_client::info_tile_wdg
info_tile * info_tile_wdg
Definition fc_client.h:218
fc_client::popdown_tile_info
void popdown_tile_info()
Definition mapctrl.cpp:577
fc_client::mapview_wdg
map_view * mapview_wdg
Definition fc_client.h:230
fc_client::popup_tile_info
void popup_tile_info(struct tile *ptile)
Definition mapctrl.cpp:552
fc_shortcuts::sc
static fc_shortcuts * sc()
Definition shortcuts.cpp:278
fc_shortcuts::get_shortcut
fc_shortcut * get_shortcut(shortcut_id id)
Definition shortcuts.cpp:236
hud_input_box
Definition hudwidget.h:111
info_tile
Definition mapview.h:117
map_view::menu_click
bool menu_click
Definition mapview.h:92
map_view::stored_autocenter
bool stored_autocenter
Definition mapview.h:107
map_view::keyPressEvent
void keyPressEvent(QKeyEvent *event)
Definition mapctrl.cpp:119
map_view::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event)
Definition mapctrl.cpp:537
map_view::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition mapctrl.cpp:521
map_view::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event)
Definition mapctrl.cpp:529
map_view::shortcut_released
void shortcut_released(Qt::MouseButton mb)
Definition mapctrl.cpp:483
map_view::shortcut_pressed
void shortcut_pressed(int key)
Definition mapctrl.cpp:214
production_widget
Definition citydlg.h:384
client_state
enum client_states client_state(void)
Definition client_main.c:1026
client_main.h
client_player
#define client_player()
Definition client_main.h:106
C_S_RUNNING
@ C_S_RUNNING
Definition client_main.h:47
client_tile_get_known
enum known_type client_tile_get_known(const struct tile *ptile)
Definition climap.c:36
climap.h
incite_cost
char * incite_cost
Definition comments.c:74
key_recall_previous_focus_unit
void key_recall_previous_focus_unit(void)
Definition control.c:3291
key_cancel_action
void key_cancel_action(void)
Definition control.c:3229
clear_hover_state
void clear_hover_state(void)
Definition control.c:323
key_end_turn
void key_end_turn(void)
Definition control.c:3283
key_unit_move
void key_unit_move(enum direction8 gui_dir)
Definition control.c:3312
hover_state
enum cursor_hover_state hover_state
Definition control.c:89
finish_city
void finish_city(struct tile *ptile, const char *name)
Definition control.c:4062
find_visible_unit
struct unit * find_visible_unit(struct tile *ptile)
Definition control.c:804
control_mouse_cursor
void control_mouse_cursor(struct tile *ptile)
Definition control.c:1189
cancel_city
void cancel_city(struct tile *ptile)
Definition control.c:4081
control.h
SELECT_APPEND
@ SELECT_APPEND
Definition control.h:38
SELECT_POPUP
@ SELECT_POPUP
Definition control.h:38
SELECT_FOCUS
@ SELECT_FOCUS
Definition control.h:38
HOVER_NONE
@ HOVER_NONE
Definition control.h:26
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
event
enum event_type event
Definition events.c:81
fc_client.h
_
#define _(String)
Definition fcintl.h:67
tile_link
const char * tile_link(const struct tile *ptile)
Definition featured_text.c:1106
ftc_client
const struct ft_color ftc_client
Definition featured_text.c:78
city_link
const char * city_link(const struct city *pcity)
Definition featured_text.c:1072
wld
struct world wld
Definition game.c:63
exit_goto_state
void exit_goto_state(void)
Definition goto.c:1022
goto_is_active
bool goto_is_active(void)
Definition goto.c:1059
send_rally_tile
bool send_rally_tile(struct city *pcity, struct tile *ptile, bool persistent)
Definition goto.c:1575
goto.h
pos
static struct tile * pos
Definition finddlg.c:53
load_theme
static bool load_theme
Definition theme_dlg.c:30
citydlg.h
mapctrl.h
fc_assert_ret
#define fc_assert_ret(condition)
Definition log.h:191
qload_lua_script
void qload_lua_script()
Definition luaconsole.cpp:73
qreload_lua_script
void qreload_lua_script()
Definition luaconsole.cpp:89
index_to_tile
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
Definition map.c:456
popup_newcity_dialog
void popup_newcity_dialog(struct unit *punit, const char *suggestname)
Definition mapctrl.cpp:54
city_buy_production
int city_buy_production(struct city *pcity)
Definition citydlg_common.c:1549
qload_lua_script
void qload_lua_script()
Definition luaconsole.cpp:73
create_line_at_mouse_pos
void create_line_at_mouse_pos(void)
Definition mapctrl.cpp:92
set_turn_done_button_state
void set_turn_done_button_state(bool state)
Definition mapctrl.cpp:82
side_disable_endturn
void side_disable_endturn(bool do_restore)
Definition sidebar.cpp:676
update_rect_at_mouse_pos
void update_rect_at_mouse_pos(void)
Definition mapctrl.cpp:111
update_turn_done_tooltip
void update_turn_done_tooltip(void)
Definition gui_main.c:1130
qreload_lua_script
void qreload_lua_script()
Definition luaconsole.cpp:89
update_line
void update_line(int canvas_x, int canvas_y)
Definition mapctrl_common.c:666
maybe_activate_keyboardless_goto
void maybe_activate_keyboardless_goto(int canvas_x, int canvas_y)
Definition mapctrl_common.c:508
adjust_workers_button_pressed
void adjust_workers_button_pressed(int canvas_x, int canvas_y)
Definition mapctrl_common.c:598
release_goto_button
void release_goto_button(int canvas_x, int canvas_y)
Definition mapctrl_common.c:488
recenter_button_pressed
void recenter_button_pressed(int canvas_x, int canvas_y)
Definition mapctrl_common.c:634
action_button_pressed
void action_button_pressed(int canvas_x, int canvas_y, enum quickselect_type qtype)
Definition mapctrl_common.c:571
wakeup_button_pressed
void wakeup_button_pressed(int canvas_x, int canvas_y)
Definition mapctrl_common.c:586
keyboardless_goto_button_down
bool keyboardless_goto_button_down
Definition mapctrl_common.c:69
key_city_overlay
void key_city_overlay(int canvas_x, int canvas_y)
Definition mapctrl_common.c:360
keyboardless_goto_active
bool keyboardless_goto_active
Definition mapctrl_common.c:70
clipboard_paste_production
void clipboard_paste_production(struct city *pcity)
Definition mapctrl_common.c:425
clipboard_copy_production
bool clipboard_copy_production(struct tile *ptile)
Definition mapctrl_common.c:380
mapdeco_set_crosshair
void mapdeco_set_crosshair(const struct tile *ptile, bool crosshair)
Definition mapview_common.c:3406
mapview
struct view mapview
Definition mapview_common.c:75
canvas_pos_to_tile
struct tile * canvas_pos_to_tile(float canvas_x, float canvas_y, float zoom)
Definition mapview_common.c:763
mapdeco_set_gotoroute
void mapdeco_set_gotoroute(const struct unit *punit)
Definition mapview_common.c:3529
mapdeco_clear_gotoroutes
void mapdeco_clear_gotoroutes(void)
Definition mapview_common.c:3585
mapdeco_clear_crosshairs
void mapdeco_clear_crosshairs(void)
Definition mapview_common.c:3441
multiairlift
void multiairlift(struct city *acity, Unit_type_id ut)
Definition menu.cpp:3911
gui
static mpgui * gui
Definition mpgui_qt.cpp:52
gui_options
struct client_options gui_options
Definition options.c:71
qtg_cxxside.h
shortcuts.h
SC_POPUP_COMB_INF
@ SC_POPUP_COMB_INF
Definition shortcuts.h:83
SC_HIDE_WORKERS
@ SC_HIDE_WORKERS
Definition shortcuts.h:52
SC_POPUP_INFO
@ SC_POPUP_INFO
Definition shortcuts.h:47
SC_RELOAD_LUA
@ SC_RELOAD_LUA
Definition shortcuts.h:90
SC_SHOW_UNITS
@ SC_SHOW_UNITS
Definition shortcuts.h:53
SC_PASTE_PROD
@ SC_PASTE_PROD
Definition shortcuts.h:50
SC_WAKEUP_SENTRIES
@ SC_WAKEUP_SENTRIES
Definition shortcuts.h:48
SC_MAKE_LINK
@ SC_MAKE_LINK
Definition shortcuts.h:49
SC_APPEND_FOCUS
@ SC_APPEND_FOCUS
Definition shortcuts.h:46
SC_QUICK_BUY
@ SC_QUICK_BUY
Definition shortcuts.h:42
SC_RELOAD_THEME
@ SC_RELOAD_THEME
Definition shortcuts.h:84
SC_RELOAD_TILESET
@ SC_RELOAD_TILESET
Definition shortcuts.h:85
SC_BUY_MAP
@ SC_BUY_MAP
Definition shortcuts.h:79
SC_SCROLL_MAP
@ SC_SCROLL_MAP
Definition shortcuts.h:35
SC_QUICK_SELECT
@ SC_QUICK_SELECT
Definition shortcuts.h:43
SC_ADJUST_WORKERS
@ SC_ADJUST_WORKERS
Definition shortcuts.h:45
SC_SELECT_BUTTON
@ SC_SELECT_BUTTON
Definition shortcuts.h:44
SC_COPY_PROD
@ SC_COPY_PROD
Definition shortcuts.h:51
SC_LOAD_LUA
@ SC_LOAD_LUA
Definition shortcuts.h:89
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
city
Definition city.h:320
city::owner
struct player * owner
Definition city.h:323
client_options::gui_qt_default_theme_name
char gui_qt_default_theme_name[512]
Definition options.h:410
client_options::auto_center_on_unit
bool auto_center_on_unit
Definition options.h:155
fc_shortcut
Definition shortcuts.h:105
fc_shortcut::key
int key
Definition shortcuts.h:107
fc_shortcut::mod
Qt::KeyboardModifiers mod
Definition shortcuts.h:109
fc_shortcut::mouse
Qt::MouseButton mouse
Definition shortcuts.h:108
tile
Definition tile.h:50
tileset
Definition tilespec.c:481
unit
Definition unit.h:138
unit::goto_tile
struct tile * goto_tile
Definition unit.h:155
view::width
int width
Definition mapview_common.h:38
world::map
struct civ_map map
Definition world_object.h:38
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
FALSE
#define FALSE
Definition support.h:47
themes_common.h
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile.h
tile_index
#define tile_index(_pt_)
Definition tile.h:88
TILE_UNKNOWN
@ TILE_UNKNOWN
Definition tile.h:36
tileset_basename
const char * tileset_basename(const struct tileset *t)
Definition tilespec.c:704
tilespec_reread
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1355
unit_has_orders
bool unit_has_orders(const struct unit *punit)
Definition unit.c:205
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:390
map_zoom
float map_zoom
Definition zoom.c:25
zoom.h