Freeciv-3.2
Loading...
Searching...
No Matches
menu.c
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#include <stdlib.h>
19
20#include <gtk/gtk.h>
21
22/* utility */
23#include "fcintl.h"
24#include "log.h"
25#include "shared.h"
26#include "support.h"
27
28/* common */
29#include "game.h"
30#include "government.h"
31#include "road.h"
32#include "unit.h"
33
34/* client */
35#include "client_main.h"
36#include "clinet.h"
37#include "connectdlg_common.h"
38#include "control.h"
39#include "mapview_common.h"
40#include "options.h"
41#include "tilespec.h"
42
43/* client/gui-gtk-4.0 */
44#include "chatline.h"
45#include "cityrep.h"
46#include "dialogs.h"
47#include "editgui.h"
48#include "editprop.h"
49#include "finddlg.h"
50#include "gamedlgs.h"
51#include "gotodlg.h"
52#include "gui_main.h"
53#include "gui_stuff.h"
54#include "helpdlg.h"
55#include "infradlg.h"
56#include "luaconsole.h"
57#include "mapctrl.h" /* center_on_unit(). */
58#include "messagedlg.h"
59#include "messagewin.h"
60#include "optiondlg.h"
61#include "pages.h"
62#include "plrdlg.h"
63#include "rallypointdlg.h"
64#include "ratesdlg.h"
65#include "repodlgs.h"
66#include "sprite.h"
67#include "spaceshipdlg.h"
68#include "unitselect.h"
69#include "wldlg.h"
70
71#include "menu.h"
72
74static bool menus_built = FALSE;
75
77
79
82
90
91struct menu_entry_info {
92 const char *key;
93 const char *name;
94 const char *action;
95 const char *accl;
97 void (*toggle)(GSimpleAction *act, GVariant *value, gpointer data);
98 bool state; /* Only for toggle actions */
99};
100
103static GMenuItem *create_toggle_menu_item_for_key(const char *key);
104
105/* Menu entry callbacks */
107 GVariant *parameter,
108 gpointer data);
110 GVariant *parameter,
111 gpointer data);
113 GVariant *parameter,
114 gpointer data);
116 GVariant *parameter,
117 gpointer data);
119 GVariant *parameter,
120 gpointer data);
122 GVariant *parameter,
123 gpointer data);
125 GVariant *parameter,
126 gpointer data);
128 GVariant *parameter,
129 gpointer data);
131 GVariant *parameter,
132 gpointer data);
133
134#ifdef FREECIV_DEBUG
136 GVariant *parameter,
137 gpointer data);
138#endif /* FREECIV_DEBUG */
139
141 GVariant *parameter,
142 gpointer data);
144 GVariant *parameter,
145 gpointer data);
147 GVariant *parameter,
148 gpointer data);
150 GVariant *parameter,
151 gpointer data);
153 GVariant *parameter,
154 gpointer data);
156 GVariant *parameter,
157 gpointer data);
159 GVariant *parameter,
160 gpointer data);
162 GVariant *parameter,
163 gpointer data);
165 GVariant *parameter,
166 gpointer data);
168 GVariant *parameter,
169 gpointer data);
171 GVariant *parameter,
172 gpointer data);
174 GVariant *parameter,
175 gpointer data);
177 GVariant *parameter,
178 gpointer data);
180 GVariant *parameter,
181 gpointer data);
183 GVariant *parameter,
184 gpointer data);
186 GVariant *parameter,
187 gpointer data);
189 GVariant *parameter,
190 gpointer data);
192 GVariant *parameter,
193 gpointer data);
195 GVariant *parameter,
196 gpointer data);
198 GVariant *parameter,
199 gpointer data);
201 GVariant *parameter,
202 gpointer data);
204 GVariant *parameter,
205 gpointer data);
207 GVariant *parameter,
208 gpointer data);
210 GVariant *parameter,
211 gpointer data);
213 GVariant *parameter,
214 gpointer data);
216 GVariant *parameter,
217 gpointer data);
219 GVariant *parameter,
220 gpointer data);
222 GVariant *parameter,
223 gpointer data);
225 GVariant *parameter,
226 gpointer data);
228 GVariant *parameter,
229 gpointer data);
231 GVariant *parameter,
232 gpointer data);
234 GVariant *parameter,
235 gpointer data);
237 GVariant *parameter,
238 gpointer data);
240 GVariant *parameter,
241 gpointer data);
243 GVariant *parameter,
244 gpointer data);
246 GVariant *parameter,
247 gpointer data);
249 GVariant *parameter,
250 gpointer data);
252 GVariant *parameter,
253 gpointer data);
255 GVariant *parameter,
256 gpointer data);
258 GVariant *parameter,
259 gpointer data);
261 GVariant *parameter,
262 gpointer data);
264 GVariant *parameter,
265 gpointer data);
267 GVariant *parameter,
268 gpointer data);
270 GVariant *parameter,
271 gpointer data);
273 GVariant *parameter,
274 gpointer data);
276 GVariant *parameter,
277 gpointer data);
279 GVariant *parameter,
280 gpointer data);
282 GVariant *parameter,
283 gpointer data);
285 GVariant *parameter,
286 gpointer data);
288 GVariant *parameter,
289 gpointer data);
291 GVariant *parameter,
292 gpointer data);
294 GVariant *parameter,
295 gpointer data);
297 GVariant *parameter,
298 gpointer data);
300 GVariant *parameter,
301 gpointer data);
303 GVariant *parameter,
304 gpointer data);
306 GVariant *parameter,
307 gpointer data);
309 GVariant *parameter,
310 gpointer data);
312 GVariant *parameter,
313 gpointer data);
315 GVariant *parameter,
316 gpointer data);
318 GVariant *parameter,
319 gpointer data);
321 GVariant *parameter,
322 gpointer data);
324 GVariant *parameter,
325 gpointer data);
327 GVariant *parameter,
328 gpointer data);
330 GVariant *parameter,
331 gpointer data);
333 GVariant *parameter,
334 gpointer data);
336 GVariant *parameter,
337 gpointer data);
339 GVariant *parameter,
340 gpointer data);
342 GVariant *parameter,
343 gpointer data);
345 GVariant *parameter,
346 gpointer data);
348 GVariant *parameter,
349 gpointer data);
351 GVariant *parameter,
352 gpointer data);
354 GVariant *parameter,
355 gpointer data);
357 GVariant *parameter,
358 gpointer data);
360 GVariant *parameter,
361 gpointer data);
363 GVariant *parameter,
364 gpointer data);
366 GVariant *parameter,
367 gpointer data);
369 GVariant *parameter,
370 gpointer data);
372 GVariant *parameter,
373 gpointer data);
375 GVariant *parameter,
376 gpointer data);
378 GVariant *parameter,
379 gpointer data);
380
382 GVariant *parameter,
383 gpointer data);
385 GVariant *parameter,
386 gpointer data);
388 GVariant *parameter,
389 gpointer data);
391 GVariant *parameter,
392 gpointer data);
394 GVariant *parameter,
395 gpointer data);
397 GVariant *parameter,
398 gpointer data);
400 GVariant *parameter,
401 gpointer data);
403 GVariant *parameter,
404 gpointer data);
406 GVariant *parameter,
407 gpointer data);
409 GVariant *parameter,
410 gpointer data);
412 GVariant *parameter,
413 gpointer data);
415 GVariant *parameter,
416 gpointer data);
418 GVariant *parameter,
419 gpointer data);
421 GVariant *parameter,
422 gpointer data);
424 GVariant *parameter,
425 gpointer data);
427 GVariant *parameter,
428 gpointer data);
430 GVariant *parameter,
431 gpointer data);
433 GVariant *parameter,
434 gpointer data);
436 GVariant *parameter,
437 gpointer data);
439 GVariant *parameter,
440 gpointer data);
442 GVariant *parameter,
443 gpointer data);
445 GVariant *parameter,
446 gpointer data);
448 GVariant *parameter,
449 gpointer data);
451 GVariant *parameter,
452 gpointer data);
454 GVariant *parameter,
455 gpointer data);
457 GVariant *parameter,
458 gpointer data);
460 GVariant *parameter,
461 gpointer data);
463 GVariant *parameter,
464 gpointer data);
466 GVariant *parameter,
467 gpointer data);
469 GVariant *parameter,
470 gpointer data);
472 GVariant *parameter,
473 gpointer data);
475 GVariant *parameter,
476 gpointer data);
478 GVariant *parameter,
479 gpointer data);
480
482 GVariant *parameter,
483 gpointer data);
485 GVariant *parameter,
486 gpointer data);
488 GVariant *parameter,
489 gpointer data);
491 GVariant *parameter,
492 gpointer data);
494 GVariant *parameter,
495 gpointer data);
497 GVariant *parameter,
498 gpointer data);
500 GVariant *parameter,
501 gpointer data);
503 GVariant *parameter,
504 gpointer data);
506 GVariant *parameter,
507 gpointer data);
509 GVariant *parameter,
510 gpointer data);
512 GVariant *parameter,
513 gpointer data);
515 GVariant *parameter,
516 gpointer data);
518 GVariant *parameter,
519 gpointer data);
521 GVariant *parameter,
522 gpointer data);
523
525 GVariant *parameter,
526 gpointer data);
528 GVariant *parameter,
529 gpointer data);
531 GVariant *parameter,
532 gpointer data);
533
535{
536 /* Game menu */
537 { "CLEAR_CHAT_LOGS", N_("_Clear Chat Log"),
538 "clear_chat", NULL, MGROUP_SAFE,
539 NULL, FALSE },
540 { "SAVE_CHAT_LOGS", N_("Save Chat _Log"),
541 "save_chat", NULL, MGROUP_SAFE,
542 NULL, FALSE },
543
544 { "LOCAL_OPTIONS", N_("_Local Client"),
545 "local_options", NULL, MGROUP_SAFE,
546 NULL, FALSE },
547 { "MESSAGE_OPTIONS", N_("_Message"),
548 "message_options", NULL, MGROUP_SAFE,
549 NULL, FALSE },
550 { "SERVER_OPTIONS", N_("_Remote Server"),
551 "server_options", NULL, MGROUP_SAFE,
552 NULL, FALSE },
553 { "SAVE_OPTIONS", N_("Save Options _Now"),
554 "save_options", NULL, MGROUP_SAFE,
555 NULL, FALSE },
556 { "SAVE_OPTIONS_ON_EXIT", N_("Save Options on _Exit"),
557 "save_options_on_exit", NULL, MGROUP_SAFE,
559
560#ifdef FREECIV_DEBUG
561 { "RELOAD_TILESET", N_("_Reload Tileset"),
562 "reload_tileset", "<ctrl><alt>r", MGROUP_SAFE,
563 NULL, FALSE },
564#endif /* FREECIV_DEBUG */
565
566 { "GAME_SAVE", N_("_Save Game"),
567 "game_save", "<ctrl>s", MGROUP_SAFE,
568 NULL, FALSE },
569 { "GAME_SAVE_AS", N_("Save Game _As..."),
570 "game_save_as", NULL, MGROUP_SAFE,
571 NULL, FALSE },
572 { "MAPIMG_SAVE", N_("Save Map _Image"),
573 "save_mapimg", NULL, MGROUP_SAFE,
574 NULL, FALSE },
575 { "MAPIMG_SAVE_AS", N_("Save _Map Image As..."),
576 "save_mapimg_as", NULL, MGROUP_SAFE,
577 NULL, FALSE },
578 { "LEAVE", N_("_Leave"),
579 "leave", NULL, MGROUP_SAFE,
580 NULL, FALSE },
581 { "QUIT", N_("_Quit"),
582 "quit", "<ctrl>q", MGROUP_SAFE,
583 NULL, FALSE },
584
585 /* Edit menu */
586 { "FIND_CITY", N_("_Find City"),
587 "find_city", "<ctrl>f", MGROUP_SAFE,
588 NULL, FALSE },
589 { "WORKLISTS", N_("Work_lists"),
590 "worklists", "<ctrl><shift>l", MGROUP_SAFE,
591 NULL, FALSE },
592 { "RALLY_DLG", N_("Rally point dialog"),
593 "rally_dlg", "<ctrl><shift>r", MGROUP_SAFE,
594 NULL, FALSE },
595 { "INFRA_DLG", N_("Infra dialog"),
596 "infra_dlg", "<ctrl><shift>f", MGROUP_SAFE,
597 NULL, FALSE },
598 { "EDIT_MODE", N_("_Editing Mode"),
599 "edit_mode", "<ctrl>e", MGROUP_SAFE,
601 { "TOGGLE_FOG", N_("Toggle Fog of _War"),
602 "toggle_fog", "<ctrl><shift>w", MGROUP_EDIT,
604 { "SCENARIO_PROPERTIES", N_("Game/Scenario Properties"),
605 "scenario_props", NULL, MGROUP_EDIT,
606 NULL, FALSE },
607 { "SCENARIO_SAVE", N_("Save Scenario"),
608 "scenario_save", NULL, MGROUP_EDIT,
609 NULL, FALSE },
610 { "CLIENT_LUA_SCRIPT", N_("Client _Lua Script"),
611 "lua_script", NULL, MGROUP_SAFE,
612 NULL, FALSE },
613
614 /* View menu */
615 { "SHOW_CITY_OUTLINES", N_("Cit_y Outlines"),
616 "show_city_outlines", "<ctrl>y", MGROUP_SAFE,
618 { "SHOW_CITY_OUTPUT", N_("City Output"),
619 "show_city_output", "<ctrl>v", MGROUP_SAFE,
621 { "SHOW_MAP_GRID", N_("Map _Grid"),
622 "show_map_grid", "<ctrl>g", MGROUP_SAFE,
624 { "SHOW_NAT_BORDERS", N_("National _Borders"),
625 "show_nat_borders", "<ctrl>b", MGROUP_SAFE,
627 { "SHOW_NATIVE_TILES", N_("Native Tiles"),
628 "show_native_tiles", "<ctrl><shift>n", MGROUP_SAFE,
630 { "SHOW_CITY_FULL_BAR", N_("City Full Bar"),
631 "show_city_full_bar", NULL, MGROUP_SAFE,
633 { "SHOW_CITY_NAMES", N_("City _Names"),
634 "show_city_names", "<ctrl>n", MGROUP_SAFE,
636 { "SHOW_CITY_GROWTH", N_("City G_rowth"),
637 "show_city_growth", "<ctrl>o", MGROUP_SAFE,
639 { "SHOW_CITY_PRODUCTIONS", N_("City _Production"),
640 "show_city_productions", "<ctrl>p", MGROUP_SAFE,
642 { "SHOW_CITY_BUY_COST", N_("City Buy Cost"),
643 "show_city_buy_cost", NULL, MGROUP_SAFE,
645 { "SHOW_CITY_TRADE_ROUTES", N_("City Tra_deroutes"),
646 "show_trade_routes", "<ctrl>d", MGROUP_SAFE,
648 { "SHOW_TERRAIN", N_("_Terrain"),
649 "show_terrain", NULL, MGROUP_SAFE,
651 { "SHOW_COASTLINE", N_("C_oastline"),
652 "show_coastline", NULL, MGROUP_SAFE,
654 { "SHOW_PATHS", N_("_Paths"),
655 "show_paths", NULL, MGROUP_SAFE,
657 { "SHOW_IRRIGATION", N_("_Irrigation"),
658 "show_irrigation", NULL, MGROUP_SAFE,
660 { "SHOW_MINES", N_("_Mines"),
661 "show_mines", NULL, MGROUP_SAFE,
663 { "SHOW_BASES", N_("_Bases"),
664 "show_bases", NULL, MGROUP_SAFE,
666 { "SHOW_RESOURCES", N_("_Resources"),
667 "show_resources", NULL, MGROUP_SAFE,
669 { "SHOW_HUTS", N_("_Huts"),
670 "show_huts", NULL, MGROUP_SAFE,
672 { "SHOW_POLLUTION", N_("Po_llution & Fallout"),
673 "show_pollution", NULL, MGROUP_SAFE,
675 { "SHOW_CITIES", N_("Citi_es"),
676 "show_cities", NULL, MGROUP_SAFE,
678 { "SHOW_UNITS", N_("_Units"),
679 "show_units", NULL, MGROUP_SAFE,
681 { "SHOW_UNIT_SOLID_BG", N_("Unit Solid Background"),
682 "show_unit_solid_bg", NULL, MGROUP_SAFE,
684 { "SHOW_UNIT_SHIELDS", N_("Unit shields"),
685 "show_unit_shields", NULL, MGROUP_SAFE,
687 { "SHOW_STACK_SIZE", N_("Unit Stack Size"),
688 "show_stack_size", "<ctrl>plus", MGROUP_SAFE,
690 { "SHOW_FOCUS_UNIT", N_("Focu_s Unit"),
691 "show_focus_unit", NULL, MGROUP_SAFE,
693 { "SHOW_FOG_OF_WAR", N_("Fog of _War"),
694 "show_fow", NULL, MGROUP_SAFE,
696
697 { "FULL_SCREEN", N_("_Fullscreen"),
698 "full_screen", "<ctrl>F11", MGROUP_SAFE,
700 { "CENTER_VIEW", N_("_Center View"),
701 "center_view", "c", MGROUP_PLAYER,
702 NULL, FALSE },
703
704 /* Select menu */
705 { "SELECT_SINGLE", N_("_Single Unit (Unselect Others)"),
706 "select_single", "z", MGROUP_UNIT,
707 NULL, FALSE },
708 { "SELECT_ALL_ON_TILE", N_("_All On Tile"),
709 "select_all_tile", "v", MGROUP_UNIT,
710 NULL, FALSE },
711 { "SELECT_SAME_TYPE_TILE", N_("Same Type on _Tile"),
712 "select_same_type_tile", "<shift>v", MGROUP_UNIT,
713 NULL, FALSE },
714 { "SELECT_SAME_TYPE_CONT", N_("Same Type on _Continent"),
715 "select_same_type_cont", "<shift>c", MGROUP_UNIT,
716 NULL, FALSE },
717 { "SELECT_SAME_TYPE", N_("Same Type _Everywhere"),
718 "select_same_type", "<shift>x", MGROUP_UNIT,
719 NULL, FALSE },
720 { "SELECT_DLG", N_("Unit Selection Dialog"),
721 "select_dlg", NULL, MGROUP_UNIT,
722 NULL, FALSE },
723
724 /* Unit menu */
725 { "UNIT_GOTO", N_("_Go to"),
726 "goto", "g", MGROUP_UNIT,
727 NULL, FALSE },
728 { "UNIT_GOTO_CITY", N_("Go _to/Airlift to City..."),
729 "goto_city", "t", MGROUP_UNIT,
730 NULL, FALSE },
731 { "UNIT_RETURN", N_("_Return to Nearest City"),
732 "return", "<shift>g", MGROUP_UNIT,
733 NULL, FALSE },
734 { "UNIT_EXPLORE", N_("Auto E_xplore"),
735 "explore", "x", MGROUP_UNIT,
736 NULL, FALSE },
737 { "UNIT_PATROL", N_("_Patrol"),
738 "patrol", "q", MGROUP_UNIT,
739 NULL, FALSE },
740 { "UNIT_TELEPORT", N_("_Teleport"),
741 "teleport", NULL, MGROUP_UNIT,
742 NULL, FALSE },
743 { "UNIT_SENTRY", N_("_Sentry"),
744 "sentry", "s", MGROUP_UNIT,
745 NULL, FALSE },
746 { "UNSENTRY_ALL", N_("Uns_entry All On Tile"),
747 "unsentry_all", "<shift>s", MGROUP_UNIT,
748 NULL, FALSE },
749 { "UNIT_BOARD", N_("_Load"),
750 "board", "l", MGROUP_UNIT,
751 NULL, FALSE },
752 { "UNIT_DEBOARD", N_("_Unload"),
753 "deboard", "u", MGROUP_UNIT,
754 NULL, FALSE },
755 { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"),
756 "unload_transporter", "<shift>t", MGROUP_UNIT,
757 NULL, FALSE },
758 { "UNIT_HOMECITY", N_("Set _Home City"),
759 "homecity", "h", MGROUP_UNIT,
760 NULL, FALSE },
761 { "UNIT_UPGRADE", N_("Upgr_ade"),
762 "upgrade", "<shift>u", MGROUP_UNIT,
763 NULL, FALSE },
764 { "UNIT_CONVERT", N_("C_onvert"),
765 "convert", "<shift>o", MGROUP_UNIT,
766 NULL, FALSE },
767 { "UNIT_DISBAND", N_("_Disband"),
768 "disband", "<shift>d", MGROUP_UNIT,
769 NULL, FALSE },
770 { "DO_ACTION", N_("_Do..."),
771 "do_action", "d", MGROUP_UNIT,
772 NULL, FALSE },
773 { "UNIT_WAIT", N_("_Wait"),
774 "wait", "w", MGROUP_UNIT,
775 NULL, FALSE },
776 { "UNIT_DONE", N_("_Done"),
777 "done", "space", MGROUP_UNIT,
778 NULL, FALSE },
779
780 /* Work menu */
781 { "BUILD_CITY", N_("_Build City"),
782 "build_city", "b", MGROUP_UNIT,
783 NULL, FALSE },
784 { "AUTO_SETTLER", N_("_Auto Settler"),
785 "auto_settle", "a", MGROUP_UNIT,
786 NULL, FALSE },
787 { "BUILD_ROAD", N_("Build _Road"),
788 "build_road", "r", MGROUP_UNIT,
789 NULL, FALSE },
790 { "BUILD_IRRIGATION", N_("Build _Irrigation"),
791 "build_irrigation", "i", MGROUP_UNIT,
792 NULL, FALSE },
793 { "BUILD_MINE", N_("Build _Mine"),
794 "build_mine", "m", MGROUP_UNIT,
795 NULL, FALSE },
796 { "CULTIVATE", N_("Cultivate"),
797 "cultivate", "<shift>i", MGROUP_UNIT,
798 NULL, FALSE },
799 { "PLANT", N_("Plant"),
800 "plant", "<shift>m", MGROUP_UNIT,
801 NULL, FALSE },
802 { "TRANSFORM_TERRAIN", N_("Transf_orm Terrain"),
803 "transform_terrain", "o", MGROUP_UNIT,
804 NULL, FALSE },
805 { "CONNECT_ROAD", N_("Connect With Roa_d"),
806 "connect_road", "<ctrl>r", MGROUP_UNIT,
807 NULL, FALSE },
808 { "CONNECT_RAIL", N_("Connect With Rai_l"),
809 "connect_rail", "<ctrl>l", MGROUP_UNIT,
810 NULL, FALSE },
811 { "CONNECT_MAGLEV", N_("Connect With _Maglev"),
812 "connect_maglev", "<ctrl>m", MGROUP_UNIT,
813 NULL, FALSE },
814 { "CONNECT_IRRIGATION", N_("Connect With Irri_gation"),
815 "connect_irrigation", "<ctrl>i", MGROUP_UNIT,
816 NULL, FALSE },
817 { "CLEAN", N_("_Clean"),
818 "clean", "p", MGROUP_UNIT,
819 NULL, FALSE },
820
821 /* Combat menu */
822 { "FORTIFY", N_("Fortify"),
823 "fortify", "f", MGROUP_UNIT,
824 NULL, FALSE },
825 { "BUILD_FORTRESS", N_("Build Fortress"),
826 "build_base_fortress", "<shift>f", MGROUP_UNIT,
827 NULL, FALSE },
828 { "BUILD_AIRBASE", N_("Build Airbase"),
829 "build_base_airbase", "<shift>e", MGROUP_UNIT,
830 NULL, FALSE },
831 { "PARADROP", N_("P_aradrop"),
832 "paradrop", "j", MGROUP_UNIT,
833 NULL, FALSE },
834 { "PILLAGE", N_("_Pillage"),
835 "pillage", "<shift>p", MGROUP_UNIT,
836 NULL, FALSE },
837
838 /* Civilization */
839 { "MAP_VIEW", N_("?noun:_View"),
840 "map_view", "F1", MGROUP_SAFE,
841 NULL, FALSE },
842 { "REPORT_UNITS", N_("_Units"),
843 "report_units", "F2", MGROUP_SAFE,
844 NULL, FALSE },
845 { "REPORT_NATIONS", N_("_Nations"),
846 "report_nations", "F3", MGROUP_SAFE,
847 NULL, FALSE },
848 { "REPORT_CITIES", N_("_Cities"),
849 "report_cities", "F4", MGROUP_SAFE,
850 NULL, FALSE },
851 { "REPORT_ECONOMY", N_("_Economy"),
852 "report_economy", "F5", MGROUP_PLAYER,
853 NULL, FALSE },
854 { "REPORT_RESEARCH", N_("_Research"),
855 "report_research", "F6", MGROUP_PLAYER,
856 NULL, FALSE },
857
858 { "TAX_RATES", N_("_Tax Rates..."),
859 "tax_rates", "<ctrl>t", MGROUP_PLAYING,
860 NULL, FALSE },
861 { "POLICIES", N_("_Policies..."),
862 "policies", "<shift><ctrl>p", MGROUP_PLAYER,
863 NULL, FALSE },
864 { "START_REVOLUTION", N_("_Revolution..."),
865 "revolution", "<shift><ctrl>g", MGROUP_PLAYING,
866 NULL, FALSE },
867
868 { "REPORT_WOW", N_("_Wonders of the World"),
869 "report_wow", "F7", MGROUP_SAFE,
870 NULL, FALSE },
871 { "REPORT_TOP_CITIES", N_("Top Cities"),
872 "report_top_cities", "F8", MGROUP_SAFE,
873 NULL, FALSE },
874 { "REPORT_MESSAGES", N_("_Messages"),
875 "report_messages", "F9", MGROUP_SAFE,
876 NULL, FALSE },
877 { "REPORT_DEMOGRAPHIC", N_("_Demographics"),
878 "report_demographics", "F11", MGROUP_SAFE,
879 NULL, FALSE },
880 { "REPORT_SPACESHIP", N_("_Spaceship"),
881 "report_spaceship", "F12", MGROUP_SAFE,
882 NULL, FALSE },
883 { "REPORT_ACHIEVEMENTS", N_("_Achievements"),
884 "report_achievements", "asterisk", MGROUP_SAFE,
885 NULL, FALSE },
886
887 /* Battle Groups menu */
888 /* Note that user view: 1 - 4, internal: 0 - 3 */
889 { "BG_SELECT_1", N_("Select Battle Group 1"),
890 "bg_select_0", "<shift>F1", MGROUP_PLAYING,
891 NULL, FALSE },
892 { "BG_ASSIGN_1", N_("Assign Battle Group 1"),
893 "bg_assign_0", "<ctrl>F1", MGROUP_PLAYING,
894 NULL, FALSE },
895 { "BG_APPEND_1", N_("Append to Battle Group 1"),
896 "bg_append_0", "<shift><ctrl>F1", MGROUP_PLAYING,
897 NULL, FALSE },
898 { "BG_SELECT_2", N_("Select Battle Group 2"),
899 "bg_select_1", "<shift>F2", MGROUP_PLAYING,
900 NULL, FALSE },
901 { "BG_ASSIGN_2", N_("Assign Battle Group 2"),
902 "bg_assign_1", "<ctrl>F2", MGROUP_PLAYING,
903 NULL, FALSE },
904 { "BG_APPEND_2", N_("Append to Battle Group 2"),
905 "bg_append_1", "<shift><ctrl>F2", MGROUP_PLAYING,
906 NULL, FALSE },
907 { "BG_SELECT_3", N_("Select Battle Group 3"),
908 "bg_select_2", "<shift>F3", MGROUP_PLAYING,
909 NULL, FALSE },
910 { "BG_ASSIGN_3", N_("Assign Battle Group 3"),
911 "bg_assign_2", "<ctrl>F3", MGROUP_PLAYING,
912 NULL, FALSE },
913 { "BG_APPEND_3", N_("Append to Battle Group 3"),
914 "bg_append_2", "<shift><ctrl>F3", MGROUP_PLAYING,
915 NULL, FALSE },
916 { "BG_SELECT_4", N_("Select Battle Group 4"),
917 "bg_select_3", "<shift>F4", MGROUP_PLAYING,
918 NULL, FALSE },
919 { "BG_ASSIGN_4", N_("Assign Battle Group 4"),
920 "bg_assign_3", "<ctrl>F4", MGROUP_PLAYING,
921 NULL, FALSE },
922 { "BG_APPEND_4", N_("Append to Battle Group 4"),
923 "bg_append_3", "<shift><ctrl>F4", MGROUP_PLAYING,
924 NULL, FALSE },
925
926 /* Help menu */
927 { "HELP_OVERVIEW", N_("?help:Overview"),
928 "help_overview", NULL, MGROUP_SAFE,
929 NULL, FALSE },
930 { "HELP_PLAYING", N_("Strategy and Tactics"),
931 "help_playing", NULL, MGROUP_SAFE,
932 NULL, FALSE },
933 { "HELP_POLICIES", N_("Policies"),
934 "help_policies", NULL, MGROUP_SAFE,
935 NULL, FALSE },
936 { "HELP_TERRAIN", N_("Terrain"),
937 "help_terrains", NULL, MGROUP_SAFE,
938 NULL, FALSE },
939 { "HELP_ECONOMY", N_("Economy"),
940 "help_economy", NULL, MGROUP_SAFE,
941 NULL, FALSE },
942 { "HELP_CITIES", N_("Cities"),
943 "help_cities", NULL, MGROUP_SAFE,
944 NULL, FALSE },
945 { "HELP_IMPROVEMENTS", N_("City Improvements"),
946 "help_improvements", NULL, MGROUP_SAFE,
947 NULL, FALSE },
948 { "HELP_WONDERS", N_("Wonders of the World"),
949 "help_wonders", NULL, MGROUP_SAFE,
950 NULL, FALSE },
951 { "HELP_UNITS", N_("Units"),
952 "help_units", NULL, MGROUP_SAFE,
953 NULL, FALSE },
954 { "HELP_COMBAT", N_("Combat"),
955 "help_combat", NULL, MGROUP_SAFE,
956 NULL, FALSE },
957 { "HELP_ZOC", N_("Zones of Control"),
958 "help_zoc", NULL, MGROUP_SAFE,
959 NULL, FALSE },
960 { "HELP_GOVERNMENT", N_("Government"),
961 "help_government", NULL, MGROUP_SAFE,
962 NULL, FALSE },
963 { "HELP_DIPLOMACY", N_("Diplomacy"),
964 "help_diplomacy", NULL, MGROUP_SAFE,
965 NULL, FALSE },
966 { "HELP_TECH", N_("Technology"),
967 "help_tech", NULL, MGROUP_SAFE,
968 NULL, FALSE },
969 { "HELP_SPACE_RACE", N_("Space Race"),
970 "help_space_race", NULL, MGROUP_SAFE,
971 NULL, FALSE },
972 { "HELP_RULESET", N_("About Current Ruleset"),
973 "help_ruleset", NULL, MGROUP_SAFE,
974 NULL, FALSE },
975 { "HELP_TILESET", N_("About Current Tileset"),
976 "help_tileset", NULL, MGROUP_SAFE,
977 NULL, FALSE },
978 { "HELP_MUSICSET", N_("About Current Musicset"),
979 "help_musicset", NULL, MGROUP_SAFE,
980 NULL, FALSE },
981 { "HELP_NATIONS", N_("About Nations"),
982 "help_nations", NULL, MGROUP_SAFE,
983 NULL, FALSE },
984 { "HELP_CONNECTING", N_("Connecting"),
985 "help_connecting", NULL, MGROUP_SAFE,
986 NULL, FALSE },
987 { "HELP_CONTROLS", N_("Controls"),
988 "help_controls", NULL, MGROUP_SAFE,
989 NULL, FALSE },
990 { "HELP_GOVERNOR", N_("Citizen Governor"),
991 "help_governor", NULL, MGROUP_SAFE,
992 NULL, FALSE },
993 { "HELP_CHATLINE", N_("Chatline"),
994 "help_chatline", NULL, MGROUP_SAFE,
995 NULL, FALSE },
996 { "HELP_WORKLIST_EDITOR", N_("Worklist Editor"),
997 "help_worklist_editor", NULL, MGROUP_SAFE,
998 NULL, FALSE },
999 { "HELP_LANGUAGES", N_("Languages"),
1000 "help_languages", NULL, MGROUP_SAFE,
1001 NULL, FALSE },
1002 { "HELP_COPYING", N_("Copying"),
1003 "help_copying", NULL, MGROUP_SAFE,
1004 NULL, FALSE },
1005 { "HELP_ABOUT", N_("About Freeciv"),
1006 "help_about", NULL, MGROUP_SAFE,
1007 NULL, FALSE },
1008 { NULL }
1009};
1010
1011enum {
1041
1043 { "clear_chat", clear_chat_logs_callback },
1044 { "save_chat", save_chat_logs_callback },
1045 { "local_options", local_options_callback },
1046 { "message_options", message_options_callback },
1047 { "server_options", server_options_callback },
1048 { "save_options", save_options_callback },
1049
1050#ifdef FREECIV_DEBUG
1051 { "reload_tileset", reload_tileset_callback },
1052#endif /* FREECIV_DEBUG */
1053
1054 { "game_save", save_game_callback },
1055 { "game_save_as", save_game_as_callback },
1056 { "save_mapimg", save_mapimg_callback },
1057 { "save_mapimg_as", save_mapimg_as_callback },
1058 { "leave", leave_callback },
1059 { "quit", quit_callback },
1060
1061 { "find_city", find_city_callback },
1062 { "worklists", worklists_callback },
1063 { "rally_dlg", rally_dialog_callback },
1064 { "infra_dlg", infra_dialog_callback },
1065 { "scenario_props", scenario_properties_callback },
1066 { "scenario_save", save_scenario_callback },
1067 { "lua_script", client_lua_script_callback },
1068
1069 { "center_view", center_view_callback },
1070
1071 { "select_single", select_single_callback },
1072 { "select_all_tile", select_all_on_tile_callback },
1073 { "select_same_type_tile", select_same_type_tile_callback },
1074 { "select_same_type_cont", select_same_type_cont_callback },
1075 { "select_same_type", select_same_type_callback },
1076 { "select_dlg", select_dialog_callback },
1077
1078 { "goto", unit_goto_callback },
1079 { "goto_city", unit_goto_city_callback },
1080 { "return", unit_return_callback },
1081 { "explore", unit_explore_callback },
1082 { "patrol", unit_patrol_callback },
1083 { "teleport", unit_teleport_callback },
1084 { "sentry", unit_sentry_callback },
1085 { "unsentry_all", unsentry_all_callback },
1086 { "board", unit_board_callback },
1087 { "deboard", unit_deboard_callback },
1088 { "unload_transporter", unit_unload_transporter_callback },
1089 { "homecity", unit_homecity_callback },
1090 { "upgrade", unit_upgrade_callback },
1091 { "convert", unit_convert_callback },
1092 { "disband", unit_disband_callback },
1093 { "do_action", do_action_callback },
1094 { "wait", unit_wait_callback },
1095 { "done", unit_done_callback },
1096
1097 { "build_city", build_city_callback },
1098 { "auto_settle", auto_settle_callback },
1099 { "build_road", build_road_callback },
1100 { "build_irrigation", build_irrigation_callback },
1101 { "build_mine", build_mine_callback },
1102 { "cultivate", cultivate_callback },
1103 { "plant", plant_callback },
1104 { "transform_terrain", transform_terrain_callback },
1105 { "connect_road", connect_road_callback },
1106 { "connect_rail", connect_rail_callback },
1107 { "connect_maglev", connect_maglev_callback },
1108 { "connect_irrigation", connect_irrigation_callback },
1109 { "clean", clean_callback },
1110
1111 { "fortify", fortify_callback },
1112 { "build_base_fortress", build_fortress_callback },
1113 { "build_base_airbase", build_airbase_callback },
1114 { "paradrop", paradrop_callback },
1115 { "pillage", pillage_callback },
1116
1117 { "revolution", revolution_callback },
1118
1119 { "map_view", map_view_callback },
1120 { "report_units", report_units_callback },
1121 { "report_nations", report_nations_callback },
1122 { "report_cities", report_cities_callback },
1123 { "report_economy", report_economy_callback },
1124 { "report_research", report_research_callback },
1125 { "tax_rates", tax_rate_callback },
1126 { "policies", multiplier_callback },
1127 { "report_wow", report_wow_callback },
1128 { "report_top_cities", report_top_cities_callback },
1129 { "report_messages", report_messages_callback },
1130 { "report_demographics", report_demographic_callback },
1131 { "report_spaceship", report_spaceship_callback },
1132 { "report_achievements", report_achievements_callback },
1133
1134 { "help_overview", help_overview_callback },
1135 { "help_playing", help_playing_callback },
1136 { "help_policies", help_policies_callback },
1137 { "help_terrains", help_terrain_callback },
1138 { "help_economy", help_economy_callback },
1139 { "help_cities", help_cities_callback },
1140 { "help_improvements", help_improvements_callback },
1141 { "help_wonders", help_wonders_callback },
1142 { "help_units", help_units_callback },
1143 { "help_combat", help_combat_callback },
1144 { "help_zoc", help_zoc_callback },
1145 { "help_government", help_government_callback },
1146 { "help_diplomacy", help_diplomacy_callback },
1147 { "help_tech", help_tech_callback },
1148 { "help_space_race", help_space_race_callback },
1149 { "help_ruleset", help_ruleset_callback },
1150 { "help_tileset", help_tileset_callback },
1151 { "help_musicset", help_musicset_callback },
1152 { "help_nations", help_nations_callback },
1153 { "help_connecting", help_connecting_callback },
1154 { "help_controls", help_controls_callback },
1155 { "help_governor", help_governor_callback },
1156 { "help_chatline", help_chatline_callback },
1157 { "help_worklist_editor", help_worklist_editor_callback },
1158 { "help_languages", help_language_callback },
1159 { "help_copying", help_copying_callback },
1160 { "help_about", help_about_callback }
1161};
1162
1163static struct menu_entry_info *menu_entry_info_find(const char *key);
1164
1165/************************************************************************/
1169 GVariant *parameter,
1170 gpointer data)
1171{
1173}
1174
1175/************************************************************************/
1179 GVariant *parameter,
1180 gpointer data)
1181{
1183}
1184
1185/************************************************************************/
1189 GVariant *parameter,
1190 gpointer data)
1191{
1192 option_dialog_popup(_("Set local options"), client_optset);
1193}
1194
1195/************************************************************************/
1199 GVariant *parameter,
1200 gpointer data)
1201{
1203}
1204
1205/************************************************************************/
1209 GVariant *parameter,
1210 gpointer data)
1211{
1212 option_dialog_popup(_("Game Settings"), server_optset);
1213}
1214
1215/************************************************************************/
1219 GVariant *parameter,
1220 gpointer data)
1221{
1223}
1224
1225/************************************************************************/
1229 GVariant *parameter,
1230 gpointer data)
1231{
1232 struct menu_entry_info *info = (struct menu_entry_info *)data;
1233
1234 info->state ^= 1;
1236
1238
1241}
1242
1243#ifdef FREECIV_DEBUG
1244/************************************************************************/
1248 GVariant *parameter,
1249 gpointer data)
1250{
1251 tilespec_reread(NULL, TRUE, 1.0);
1252}
1253#endif /* FREECIV_DEBUG */
1254
1255/************************************************************************/
1259 gpointer data)
1260{
1262}
1263
1264/************************************************************************/
1268 gpointer data)
1269{
1271}
1272
1273/************************************************************************/
1277 gpointer data)
1278{
1280}
1281
1282/************************************************************************/
1286 gpointer data)
1287{
1289}
1290
1291/************************************************************************/
1295static void leave_local_game_response(GtkWidget *dialog, gint response)
1296{
1298 if (response == GTK_RESPONSE_OK) {
1299 /* It might be killed already */
1300 if (client.conn.used) {
1301 /* It will also kill the server */
1303 }
1304 }
1305}
1306
1307/************************************************************************/
1311 GVariant *parameter,
1312 gpointer data)
1313{
1314 if (is_server_running()) {
1315 GtkWidget *dialog
1318 _("Leaving a local game will end it!"));
1319 setup_dialog(dialog, toplevel);
1320 g_signal_connect(dialog, "response",
1323 } else {
1325 }
1326}
1327
1328/************************************************************************/
1332 GVariant *parameter,
1333 gpointer data)
1334{
1336}
1337
1338/************************************************************************/
1342 GVariant *parameter,
1343 gpointer data)
1344{
1346}
1347
1348/************************************************************************/
1352 GVariant *parameter,
1353 gpointer data)
1354{
1356}
1357
1358/************************************************************************/
1362 GVariant *parameter, gpointer data)
1363{
1365}
1366
1367/************************************************************************/
1371 GVariant *parameter,
1372 gpointer data)
1373{
1375}
1376
1377/************************************************************************/
1390
1391/************************************************************************/
1395 GVariant *parameter,
1396 gpointer data)
1397{
1399}
1400
1401/************************************************************************/
1405 GVariant *parameter,
1406 gpointer data)
1407{
1409}
1410
1411/************************************************************************/
1415 GVariant *parameter,
1416 gpointer data)
1417{
1419}
1420
1421/************************************************************************/
1430
1431/************************************************************************/
1440
1441/************************************************************************/
1450
1451/************************************************************************/
1455 GVariant *parameter,
1456 gpointer data)
1457{
1459}
1460
1461/************************************************************************/
1470
1471/************************************************************************/
1475 GVariant *parameter,
1476 gpointer data)
1477{
1479}
1480
1481/************************************************************************/
1485 GVariant *parameter,
1486 gpointer data)
1487{
1489}
1490
1491/************************************************************************/
1495 GVariant *parameter,
1496 gpointer data)
1497{
1499}
1500
1501/************************************************************************/
1510
1511/************************************************************************/
1515 GVariant *parameter,
1516 gpointer data)
1517{
1519}
1520
1521/************************************************************************/
1525 GVariant *parameter,
1526 gpointer data)
1527{
1529}
1530
1531/************************************************************************/
1535 GVariant *parameter,
1536 gpointer data)
1537{
1539}
1540
1541/************************************************************************/
1545 GVariant *parameter,
1546 gpointer data)
1547{
1549}
1550
1551/************************************************************************/
1560
1561/************************************************************************/
1570
1571/************************************************************************/
1575 GVariant *parameter,
1576 gpointer data)
1577{
1579}
1580
1581/************************************************************************/
1590
1591/************************************************************************/
1595 GVariant *parameter,
1596 gpointer data)
1597{
1599}
1600
1601/************************************************************************/
1605 GVariant *parameter,
1606 gpointer data)
1607{
1609}
1610
1611/************************************************************************/
1620
1621/************************************************************************/
1625 GVariant *parameter,
1626 gpointer data)
1627{
1629}
1630
1631/************************************************************************/
1640
1641/************************************************************************/
1650
1651/************************************************************************/
1655 GVariant *parameter,
1656 gpointer data)
1657{
1659}
1660
1661/************************************************************************/
1670
1671/************************************************************************/
1680
1681/************************************************************************/
1690
1691/************************************************************************/
1695 GVariant *parameter,
1696 gpointer data)
1697{
1699}
1700
1701/************************************************************************/
1705 GVariant *parameter,
1706 gpointer data)
1707{
1709}
1710
1711/************************************************************************/
1715 GVariant *parameter,
1716 gpointer data)
1717{
1719
1720 /* Unreachable techs in reqtree on/off */
1722}
1723
1725 const char *menu_entry;
1726 bool *option;
1728};
1729
1731 { "SAVE_OPTIONS_ON_EXIT", &gui_options.save_options_on_exit, -1 },
1732 { "FULL_SCREEN", &(GUI_GTK_OPTION(fullscreen)), -1 },
1733 { "EDIT_MODE", &game.info.is_edit_mode, -1 },
1734 { "TOGGLE_FOG", &game.client.fog_of_war, -1 },
1735 { "SHOW_CITY_OUTLINES", &gui_options.draw_city_outlines, VMENU_CITY_OUTLINES },
1736 { "SHOW_CITY_OUTPUT", &gui_options.draw_city_output, VMENU_CITY_OUTPUT },
1737 { "SHOW_MAP_GRID", &gui_options.draw_map_grid, VMENU_MAP_GRID },
1738 { "SHOW_NAT_BORDERS", &gui_options.draw_borders, VMENU_NAT_BORDERS },
1739 { "SHOW_NATIVE_TILES", &gui_options.draw_native, VMENU_NATIVE_TILES },
1740 { "SHOW_CITY_FULL_BAR", &gui_options.draw_full_citybar, VMENU_CITY_FULL_BAR },
1741 { "SHOW_CITY_NAMES", &gui_options.draw_city_names, VMENU_CITY_NAMES },
1742 { "SHOW_CITY_GROWTH", &gui_options.draw_city_growth, VMENU_CITY_GROWTH },
1743 { "SHOW_CITY_PRODUCTIONS", &gui_options.draw_city_productions,
1745 { "SHOW_CITY_BUY_COST", &gui_options.draw_city_buycost, VMENU_CITY_BUY_COST },
1746 { "SHOW_CITY_TRADE_ROUTES", &gui_options.draw_city_trade_routes,
1748 { "SHOW_TERRAIN", &gui_options.draw_terrain, VMENU_TERRAIN },
1749 { "SHOW_COASTLINE", &gui_options.draw_coastline, VMENU_COASTLINE },
1750 { "SHOW_PATHS", &gui_options.draw_paths, VMENU_PATHS },
1751 { "SHOW_IRRIGATION", &gui_options.draw_irrigation, VMENU_IRRIGATION },
1752 { "SHOW_MINES", &gui_options.draw_mines, VMENU_MINES },
1753 { "SHOW_BASES", &gui_options.draw_fortress_airbase, VMENU_BASES },
1754 { "SHOW_RESOURCES", &gui_options.draw_specials, VMENU_RESOURCES },
1755 { "SHOW_HUTS", &gui_options.draw_huts, VMENU_HUTS },
1756 { "SHOW_POLLUTION", &gui_options.draw_pollution, VMENU_POLLUTION },
1757 { "SHOW_CITIES", &gui_options.draw_cities, VMENU_CITIES },
1758 { "SHOW_UNITS", &gui_options.draw_units, VMENU_UNITS },
1759 { "SHOW_UNIT_SOLID_BG", &gui_options.solid_color_behind_units, VMENU_UNIT_SOLID_BG },
1760 { "SHOW_UNIT_SHIELDS", &gui_options.draw_unit_shields , VMENU_UNIT_SHIELDS },
1761 { "SHOW_STACK_SIZE", &gui_options.draw_unit_stack_size, VMENU_STACK_SIZE },
1762 { "SHOW_FOCUS_UNIT", &gui_options.draw_focus_unit, VMENU_FOCUS_UNIT },
1763 { "SHOW_FOG_OF_WAR", &gui_options.draw_fog_of_war, VMENU_FOW },
1764
1765 { NULL, NULL, -1 }
1766};
1767
1768/************************************************************************/
1771static void view_menu_item_toggle(void (*cb)(void),
1772 bool updt_sensitivity,
1773 gpointer data)
1774{
1775 int i;
1776 struct menu_entry_info *info = (struct menu_entry_info *)data;
1777
1778 info->state ^= 1;
1779
1780 cb();
1781
1782 if (updt_sensitivity) {
1784 }
1785
1786 /* TODO: Make the information available directly from menu_entry_info,
1787 * se we don't need to do this search for it */
1788 for (i = 0; meoms[i].menu_entry != NULL; i++) {
1789 if (!strcmp(meoms[i].menu_entry, info->key)) {
1790 g_menu_remove(view_menu, meoms[i].menu_pos);
1793 return;
1794 }
1795 }
1796}
1797
1798/************************************************************************/
1807
1808/************************************************************************/
1812 GVariant *parameter,
1813 gpointer data)
1814{
1816}
1817
1818/************************************************************************/
1826
1827/************************************************************************/
1836
1837/************************************************************************/
1841 GVariant *parameter,
1842 gpointer data)
1843{
1845}
1846
1847/************************************************************************/
1856
1857/************************************************************************/
1861 GVariant *parameter,
1862 gpointer data)
1863{
1865}
1866
1867/************************************************************************/
1871 GVariant *parameter,
1872 gpointer data)
1873{
1875}
1876
1877/************************************************************************/
1886
1887/************************************************************************/
1896
1897/************************************************************************/
1906
1907/************************************************************************/
1911 GVariant *parameter,
1912 gpointer data)
1913{
1915}
1916
1917/************************************************************************/
1921 GVariant *parameter,
1922 gpointer data)
1923{
1925}
1926
1927/************************************************************************/
1931 GVariant *parameter,
1932 gpointer data)
1933{
1935}
1936
1937/************************************************************************/
1941 GVariant *parameter,
1942 gpointer data)
1943{
1945}
1946
1947/************************************************************************/
1951 GVariant *parameter,
1952 gpointer data)
1953{
1955}
1956
1957/************************************************************************/
1961 gpointer data)
1962{
1964}
1965
1966/************************************************************************/
1970 GVariant *parameter,
1971 gpointer data)
1972{
1974}
1975
1976/************************************************************************/
1980 gpointer data)
1981{
1983}
1984
1985/************************************************************************/
1993
1994/************************************************************************/
1998 gpointer data)
1999{
2001}
2002
2003/************************************************************************/
2007 gpointer data)
2008{
2010}
2011
2012/************************************************************************/
2021
2022/************************************************************************/
2031
2032/************************************************************************/
2041
2042/************************************************************************/
2046 GVariant *parameter,
2047 gpointer data)
2048{
2050}
2051
2052/************************************************************************/
2060
2061/************************************************************************/
2065 gpointer data)
2066{
2067 struct menu_entry_info *info = (struct menu_entry_info *)data;
2068
2069 info->state ^= 1;
2071
2073
2075
2078}
2079
2080/************************************************************************/
2084 GVariant *parameter,
2085 gpointer data)
2086{
2087 struct menu_entry_info *info = (struct menu_entry_info *)data;
2088
2089 info->state ^= 1;
2090
2092
2094
2097}
2098
2099/************************************************************************/
2112
2113/************************************************************************/
2117 gpointer data)
2118{
2120}
2121
2122/************************************************************************/
2130
2131/************************************************************************/
2140
2141/************************************************************************/
2150
2151/************************************************************************/
2160
2161/************************************************************************/
2170
2171/************************************************************************/
2175 GVariant *parameter,
2176 gpointer data)
2177{
2179}
2180
2181/************************************************************************/
2185 GVariant *parameter,
2186 gpointer data)
2187{
2189}
2190
2191/************************************************************************/
2195 GVariant *parameter,
2196 gpointer data)
2197{
2199}
2200
2201/************************************************************************/
2205 GVariant *parameter,
2206 gpointer data)
2207{
2208 key_unit_wait();
2209}
2210
2211/************************************************************************/
2215 GVariant *parameter,
2216 gpointer data)
2217{
2218 key_unit_done();
2219}
2220
2221/************************************************************************/
2225 gpointer data)
2226{
2227 key_unit_goto();
2228}
2229
2230/************************************************************************/
2234 GVariant *parameter,
2235 gpointer data)
2236{
2237 int sub_target = NO_TARGET;
2238 struct action *paction = (struct action *)data;
2239
2241
2243 case ASTK_BUILDING:
2244 {
2246 "end_building");
2248 sub_target = improvement_number(pbuilding);
2249 }
2250 break;
2251 case ASTK_TECH:
2252 {
2254 "end_tech");
2256 sub_target = advance_number(ptech);
2257 }
2258 break;
2259 case ASTK_EXTRA:
2261 {
2262 struct extra_type *pextra = g_object_get_data(G_OBJECT(action),
2263 "end_extra");
2264 fc_assert_ret(pextra != NULL);
2265 sub_target = extra_number(pextra);
2266 }
2267 break;
2268 case ASTK_NONE:
2269 sub_target = NO_TARGET;
2270 break;
2271 case ASTK_COUNT:
2272 /* Should not exits */
2274 break;
2275 }
2276
2278}
2279
2280/************************************************************************/
2284 GVariant *parameter,
2285 gpointer data)
2286{
2287 if (get_num_units_in_focus() > 0) {
2289 }
2290}
2291
2292/************************************************************************/
2303
2304/************************************************************************/
2308 GVariant *parameter,
2309 gpointer data)
2310{
2312}
2313
2314/************************************************************************/
2318 gpointer data)
2319{
2321}
2322
2323/************************************************************************/
2327 gpointer data)
2328{
2330}
2331
2332/************************************************************************/
2336 GVariant *parameter,
2337 gpointer data)
2338{
2340}
2341
2342/************************************************************************/
2346 GVariant *parameter,
2347 gpointer data)
2348{
2350}
2351
2352/************************************************************************/
2363
2364/************************************************************************/
2374
2375/************************************************************************/
2385
2386/************************************************************************/
2390 GVariant *parameter,
2391 gpointer data)
2392{
2394}
2395
2396/************************************************************************/
2400 GVariant *parameter,
2401 gpointer data)
2402{
2404}
2405
2406/************************************************************************/
2415
2416/************************************************************************/
2420 GVariant *parameter,
2421 gpointer data)
2422{
2424}
2425
2426/************************************************************************/
2435
2436/************************************************************************/
2440 GVariant *parameter,
2441 gpointer data)
2442{
2444 /* FIXME: this can provide different items for different units...
2445 * not good! */
2446 /* Enable the button for adding to a city in all cases, so we
2447 get an eventual error message from the server if we try. */
2453 }
2455}
2456
2457/************************************************************************/
2461 GVariant *parameter,
2462 gpointer data)
2463{
2465}
2466
2467/************************************************************************/
2471 GVariant *parameter,
2472 gpointer data)
2473{
2475 /* FIXME: this can provide different actions for different units...
2476 * not good! */
2478 EC_ROAD,
2480 punit);
2481 bool building_road = FALSE;
2482
2483 if (tgt != NULL
2487 }
2488
2491 }
2493}
2494
2495/************************************************************************/
2499 GVariant *parameter,
2500 gpointer data)
2501{
2503}
2504
2505/************************************************************************/
2509 GVariant *parameter,
2510 gpointer data)
2511{
2513}
2514
2515/************************************************************************/
2519 GVariant *parameter,
2520 gpointer data)
2521{
2523}
2524
2525/************************************************************************/
2529 GVariant *parameter,
2530 gpointer data)
2531{
2532 key_unit_mine();
2533}
2534
2535/************************************************************************/
2539 GVariant *parameter,
2540 gpointer data)
2541{
2543
2544 if (proad != NULL) {
2545 struct extra_type *tgt;
2546
2547 tgt = road_extra_get(proad);
2548
2550 }
2551}
2552
2553/************************************************************************/
2557 GVariant *parameter,
2558 gpointer data)
2559{
2561
2562 if (prail != NULL) {
2563 struct extra_type *tgt;
2564
2565 tgt = road_extra_get(prail);
2566
2568 }
2569}
2570
2571/************************************************************************/
2575 GVariant *parameter,
2576 gpointer data)
2577{
2579
2580 if (pmaglev != NULL) {
2581 struct extra_type *tgt;
2582
2583 tgt = road_extra_get(pmaglev);
2584
2586 }
2587}
2588
2589/************************************************************************/
2593 GVariant *parameter,
2594 gpointer data)
2595{
2597
2598 if (extra_type_list_size(extras) > 0) {
2599 struct extra_type *pextra;
2600
2602
2604 }
2605}
2606
2607/************************************************************************/
2611 GVariant *parameter,
2612 gpointer data)
2613{
2615}
2616
2617/************************************************************************/
2621 gpointer data)
2622{
2624}
2625
2626/************************************************************************/
2630 gpointer data)
2631{
2633}
2634
2635/************************************************************************/
2639 gpointer data)
2640{
2642}
2643
2644/************************************************************************/
2648 GVariant *parameter,
2649 gpointer data)
2650{
2652}
2653
2654/************************************************************************/
2658 GVariant *parameter,
2659 gpointer data)
2660{
2662}
2663
2664/************************************************************************/
2668 GVariant *parameter,
2669 gpointer data)
2670{
2672}
2673
2674/************************************************************************/
2678 gpointer data)
2679{
2681}
2682
2683/************************************************************************/
2687 gpointer data)
2688{
2690}
2691
2692/************************************************************************/
2696 GVariant *parameter,
2697 gpointer data)
2698{
2700}
2701
2702/************************************************************************/
2706 GVariant *parameter,
2707 gpointer data)
2708{
2710}
2711
2712/************************************************************************/
2716 GVariant *parameter,
2717 gpointer data)
2718{
2719 struct extra_type *pextra = data;
2720
2724}
2725
2726/************************************************************************/
2730 GVariant *parameter,
2731 gpointer data)
2732{
2733 struct extra_type *pextra = data;
2734
2737 pextra);
2739}
2740
2741/************************************************************************/
2745 GVariant *parameter,
2746 gpointer data)
2747{
2748 struct extra_type *pextra = data;
2749
2752 pextra);
2754}
2755
2756/************************************************************************/
2760 GVariant *parameter,
2761 gpointer data)
2762{
2763 struct extra_type *pextra = data;
2764
2767 pextra);
2769}
2770
2771/************************************************************************/
2775 GVariant *parameter,
2776 gpointer data)
2777{
2778 struct extra_type *pextra = data;
2779
2783 pextra);
2784 }
2786}
2787
2788/************************************************************************/
2792 GVariant *parameter,
2793 gpointer data)
2794{
2796}
2797
2798/************************************************************************/
2802 GVariant *parameter,
2803 gpointer data)
2804{
2806}
2807
2808/************************************************************************/
2812 GVariant *parameter,
2813 gpointer data)
2814
2815{
2817}
2818
2819/************************************************************************/
2828
2829/************************************************************************/
2838
2839/************************************************************************/
2843 GVariant *parameter,
2844 gpointer data)
2845{
2846 if (NULL != client.conn.playing) {
2848 }
2849}
2850
2851/************************************************************************/
2860
2861/************************************************************************/
2870
2871/************************************************************************/
2880
2881/************************************************************************/
2886{
2887 char actname[150];
2888 GMenuItem *item;
2889
2890 fc_snprintf(actname, sizeof(actname), "app.%s(%s)",
2891 info->action, info->state ? "true" : "false");
2892 item = g_menu_item_new(Q_(info->name), NULL);
2894
2895 if (info->accl != NULL) {
2896 const char *accls[2] = { info->accl, NULL };
2897
2899 }
2900
2901 return item;
2902}
2903
2904/************************************************************************/
2909{
2911}
2912
2913/************************************************************************/
2916static void menu_entry_init(GMenu *sub, const char *key)
2917{
2919
2920 if (info != NULL) {
2921 GMenuItem *item;
2922
2923 if (info->toggle != NULL) {
2925 } else {
2926 char actname[150];
2927
2928 fc_snprintf(actname, sizeof(actname), "app.%s", info->action);
2929 item = g_menu_item_new(Q_(info->name), actname);
2930 }
2931
2932 /* Should be menu_item_append_unref()? */
2935 }
2936}
2937
2938/************************************************************************/
2942{
2943 int i;
2944
2945 for (i = 0; meoms[i].menu_entry != NULL; i++) {
2946 struct menu_entry_info *info = menu_entry_info_find(meoms[i].menu_entry);
2947
2948 if (meoms[i].option != NULL) {
2949 info->state = *meoms[i].option;
2950 } else {
2951 info->state = FALSE; /* Best guess we have */
2952 }
2953 }
2954}
2955
2956/************************************************************************/
2960{
2961 int i;
2963
2964 /* Simple entries */
2967
2968 /* Toggles */
2969 for (i = 0; menu_entries[i].key != NULL; i++) {
2970 if (menu_entries[i].toggle != NULL) {
2971 GSimpleAction *act;
2972 GVariant *var = g_variant_new("b", TRUE);
2973
2976 g_signal_connect(act, "change-state",
2978 (gpointer)&(menu_entries[i]));
2979 }
2980 }
2981
2983
2984 for (i = 0; menu_entries[i].key != NULL; i++) {
2985 if (menu_entries[i].accl != NULL && menu_entries[i].toggle == NULL) {
2986 const char *accls[2] = { menu_entries[i].accl, NULL };
2987 char actname[150];
2988
2989 fc_snprintf(actname, sizeof(actname), "app.%s", menu_entries[i].action);
2990
2992 }
2993 }
2994}
2995
2996/************************************************************************/
2999static void register_bg_actions(GActionMap *map, int bg)
3000{
3001 GSimpleAction *act;
3002 char actname[256];
3003
3004 fc_snprintf(actname, sizeof(actname), "bg_select_%d", bg);
3007 g_signal_connect(act, "activate",
3009
3010 fc_snprintf(actname, sizeof(actname), "bg_assign_%d", bg);
3013 g_signal_connect(act, "activate",
3015
3016 fc_snprintf(actname, sizeof(actname), "bg_append_%d", bg);
3019 g_signal_connect(act, "activate",
3021}
3022
3023/************************************************************************/
3027{
3028 GMenu *menubar;
3029 GMenu *topmenu;
3030 GMenu *submenu;
3031 int i;
3032
3034
3035 menubar = g_menu_new();
3036
3037 topmenu = g_menu_new();
3038 menu_entry_init(topmenu, "CLEAR_CHAT_LOGS");
3039 menu_entry_init(topmenu, "SAVE_CHAT_LOGS");
3040
3042 menu_entry_init(options_menu, "LOCAL_OPTIONS");
3043 menu_entry_init(options_menu, "MESSAGE_OPTIONS");
3044 menu_entry_init(options_menu, "SERVER_OPTIONS");
3045 menu_entry_init(options_menu, "SAVE_OPTIONS");
3046 menu_entry_init(options_menu, "SAVE_OPTIONS_ON_EXIT");
3047
3049
3050#ifdef FREECIV_DEBUG
3051 menu_entry_init(topmenu, "RELOAD_TILESET");
3052#endif /* FREECIV_DEBUG */
3053
3054 menu_entry_init(topmenu, "GAME_SAVE");
3055 menu_entry_init(topmenu, "GAME_SAVE_AS");
3056 menu_entry_init(topmenu, "MAPIMG_SAVE");
3057 menu_entry_init(topmenu, "MAPIMG_SAVE_AS");
3058 menu_entry_init(topmenu, "LEAVE");
3059 menu_entry_init(topmenu, "QUIT");
3060
3062
3064
3065 menu_entry_init(edit_menu, "FIND_CITY");
3066 menu_entry_init(edit_menu, "WORKLISTS");
3067 menu_entry_init(edit_menu, "RALLY_DLG");
3068 menu_entry_init(edit_menu, "INFRA_DLG");
3069 menu_entry_init(edit_menu, "EDIT_MODE");
3070 menu_entry_init(edit_menu, "TOGGLE_FOG");
3071 menu_entry_init(edit_menu, "SCENARIO_PROPERTIES");
3072 menu_entry_init(edit_menu, "SCENARIO_SAVE");
3073 menu_entry_init(edit_menu, "CLIENT_LUA_SCRIPT");
3074
3076
3078
3079 menu_entry_init(view_menu, "SHOW_CITY_OUTLINES");
3080 menu_entry_init(view_menu, "SHOW_CITY_OUTPUT");
3081 menu_entry_init(view_menu, "SHOW_MAP_GRID");
3082 menu_entry_init(view_menu, "SHOW_NAT_BORDERS");
3083 menu_entry_init(view_menu, "SHOW_NATIVE_TILES");
3084 menu_entry_init(view_menu, "SHOW_CITY_FULL_BAR");
3085 menu_entry_init(view_menu, "SHOW_CITY_NAMES");
3086 menu_entry_init(view_menu, "SHOW_CITY_GROWTH");
3087 menu_entry_init(view_menu, "SHOW_CITY_PRODUCTIONS");
3088 menu_entry_init(view_menu, "SHOW_CITY_BUY_COST");
3089 menu_entry_init(view_menu, "SHOW_CITY_TRADE_ROUTES");
3090 menu_entry_init(view_menu, "SHOW_TERRAIN");
3091 menu_entry_init(view_menu, "SHOW_COASTLINE");
3092 menu_entry_init(view_menu, "SHOW_PATHS");
3093 menu_entry_init(view_menu, "SHOW_IRRIGATION");
3094 menu_entry_init(view_menu, "SHOW_MINES");
3095 menu_entry_init(view_menu, "SHOW_BASES");
3096 menu_entry_init(view_menu, "SHOW_RESOURCES");
3097 menu_entry_init(view_menu, "SHOW_HUTS");
3098 menu_entry_init(view_menu, "SHOW_POLLUTION");
3099 menu_entry_init(view_menu, "SHOW_CITIES");
3100 menu_entry_init(view_menu, "SHOW_UNITS");
3101 menu_entry_init(view_menu, "SHOW_UNIT_SOLID_BG");
3102 menu_entry_init(view_menu, "SHOW_UNIT_SHIELDS");
3103 menu_entry_init(view_menu, "SHOW_STACK_SIZE");
3104 menu_entry_init(view_menu, "SHOW_FOCUS_UNIT");
3105
3106 menu_entry_init(view_menu, "SHOW_FOG_OF_WAR");
3107
3108 menu_entry_init(view_menu, "FULL_SCREEN");
3109 menu_entry_init(view_menu, "CENTER_VIEW");
3110
3112
3113 topmenu = g_menu_new();
3114
3115 menu_entry_init(topmenu, "SELECT_SINGLE");
3116 menu_entry_init(topmenu, "SELECT_ALL_ON_TILE");
3117 menu_entry_init(topmenu, "SELECT_SAME_TYPE_TILE");
3118 menu_entry_init(topmenu, "SELECT_SAME_TYPE_CONT");
3119 menu_entry_init(topmenu, "SELECT_SAME_TYPE");
3120 menu_entry_init(topmenu, "SELECT_DLG");
3121
3123
3125
3126 menu_entry_init(unit_menu, "UNIT_GOTO");
3127
3128 /* Placeholder submenu (so that menu update has something to replace) */
3129 submenu = g_menu_new();
3131
3132 menu_entry_init(unit_menu, "UNIT_GOTO_CITY");
3133 menu_entry_init(unit_menu, "UNIT_RETURN");
3134 menu_entry_init(unit_menu, "UNIT_EXPLORE");
3135 menu_entry_init(unit_menu, "UNIT_PATROL");
3136 menu_entry_init(unit_menu, "UNIT_TELEPORT");
3137 menu_entry_init(unit_menu, "UNIT_SENTRY");
3138 menu_entry_init(unit_menu, "UNSENTRY_ALL");
3139 menu_entry_init(unit_menu, "UNIT_BOARD");
3140 menu_entry_init(unit_menu, "UNIT_DEBOARD");
3141 menu_entry_init(unit_menu, "UNIT_UNLOAD_TRANSPORTER");
3142 menu_entry_init(unit_menu, "UNIT_HOMECITY");
3143 menu_entry_init(unit_menu, "UNIT_UPGRADE");
3144 menu_entry_init(unit_menu, "UNIT_CONVERT");
3145 menu_entry_init(unit_menu, "UNIT_DISBAND");
3146 menu_entry_init(unit_menu, "DO_ACTION");
3147 menu_entry_init(unit_menu, "UNIT_WAIT");
3148 menu_entry_init(unit_menu, "UNIT_DONE");
3149
3151
3153 menu_entry_init(work_menu, "BUILD_CITY");
3154 menu_entry_init(work_menu, "AUTO_SETTLER");
3155
3156 /* Placeholder submenus (so that menu update has something to replace) */
3157 submenu = g_menu_new();
3159 submenu = g_menu_new();
3160 submenu_append_unref(work_menu, _("Build _Irrigation"), G_MENU_MODEL(submenu));
3161 submenu = g_menu_new();
3163 submenu = g_menu_new();
3164 submenu_append_unref(work_menu, _("_Clean Nuisance"), G_MENU_MODEL(submenu));
3165
3166 menu_entry_init(work_menu, "BUILD_ROAD");
3167 menu_entry_init(work_menu, "BUILD_IRRIGATION");
3168 menu_entry_init(work_menu, "BUILD_MINE");
3169 menu_entry_init(work_menu, "CULTIVATE");
3170 menu_entry_init(work_menu, "PLANT");
3171 menu_entry_init(work_menu, "TRANSFORM_TERRAIN");
3172 menu_entry_init(work_menu, "CONNECT_ROAD");
3173 menu_entry_init(work_menu, "CONNECT_RAIL");
3174 menu_entry_init(work_menu, "CONNECT_MAGLEV");
3175 menu_entry_init(work_menu, "CONNECT_IRRIGATION");
3176 menu_entry_init(work_menu, "CLEAN");
3177
3179
3181 menu_entry_init(combat_menu, "FORTIFY");
3182 menu_entry_init(combat_menu, "BUILD_FORTRESS");
3183 menu_entry_init(combat_menu, "BUILD_AIRBASE");
3184
3185 /* Placeholder submenu (so that menu update has something to replace) */
3186 submenu = g_menu_new();
3188
3190
3191 menu_entry_init(combat_menu, "PARADROP");
3192 menu_entry_init(combat_menu, "PILLAGE");
3193
3194 gov_menu = g_menu_new();
3195
3196 menu_entry_init(gov_menu, "MAP_VIEW");
3197 menu_entry_init(gov_menu, "REPORT_UNITS");
3198 menu_entry_init(gov_menu, "REPORT_NATIONS");
3199 menu_entry_init(gov_menu, "REPORT_CITIES");
3200 menu_entry_init(gov_menu, "REPORT_ECONOMY");
3201 menu_entry_init(gov_menu, "REPORT_RESEARCH");
3202 menu_entry_init(gov_menu, "TAX_RATES");
3203 menu_entry_init(gov_menu, "POLICIES");
3204
3205 /* Placeholder submenu (so that menu update has something to replace) */
3206 submenu = g_menu_new();
3208
3209 menu_entry_init(gov_menu, "REPORT_WOW");
3210 menu_entry_init(gov_menu, "REPORT_TOP_CITIES");
3211 menu_entry_init(gov_menu, "REPORT_MESSAGES");
3212 menu_entry_init(gov_menu, "REPORT_DEMOGRAPHIC");
3213 menu_entry_init(gov_menu, "REPORT_SPACESHIP");
3214 menu_entry_init(gov_menu, "REPORT_ACHIEVEMENTS");
3215
3216 submenu_append_unref(menubar, _("C_ivilization"), G_MENU_MODEL(gov_menu));
3217
3218 topmenu = g_menu_new();
3219
3220 /* Keys exist for 4 battle groups */
3222
3223 for (i = 0; i < MAX_NUM_BATTLEGROUPS; i++) {
3224 char key[128];
3225
3226 /* User side battle group numbers start from 1 */
3227 fc_snprintf(key, sizeof(key), "BG_SELECT_%d", i + 1);
3229 fc_snprintf(key, sizeof(key), "BG_ASSIGN_%d", i + 1);
3231 fc_snprintf(key, sizeof(key), "BG_APPEND_%d", i + 1);
3233
3235 }
3236
3237 submenu_append_unref(menubar, _("_Battle Groups"), G_MENU_MODEL(topmenu));
3238
3239 topmenu = g_menu_new();
3240
3241 menu_entry_init(topmenu, "HELP_OVERVIEW");
3242 menu_entry_init(topmenu, "HELP_PLAYING");
3243 menu_entry_init(topmenu, "HELP_POLICIES");
3244 menu_entry_init(topmenu, "HELP_TERRAIN");
3245 menu_entry_init(topmenu, "HELP_ECONOMY");
3246 menu_entry_init(topmenu, "HELP_CITIES");
3247 menu_entry_init(topmenu, "HELP_IMPROVEMENTS");
3248 menu_entry_init(topmenu, "HELP_WONDERS");
3249 menu_entry_init(topmenu, "HELP_UNITS");
3250 menu_entry_init(topmenu, "HELP_COMBAT");
3251 menu_entry_init(topmenu, "HELP_ZOC");
3252 menu_entry_init(topmenu, "HELP_GOVERNMENT");
3253 menu_entry_init(topmenu, "HELP_DIPLOMACY");
3254 menu_entry_init(topmenu, "HELP_TECH");
3255 menu_entry_init(topmenu, "HELP_SPACE_RACE");
3256 menu_entry_init(topmenu, "HELP_RULESET");
3257 menu_entry_init(topmenu, "HELP_TILESET");
3258 menu_entry_init(topmenu, "HELP_MUSICSET");
3259 menu_entry_init(topmenu, "HELP_NATIONS");
3260 menu_entry_init(topmenu, "HELP_CONNECTING");
3261 menu_entry_init(topmenu, "HELP_CONTROLS");
3262 menu_entry_init(topmenu, "HELP_GOVERNOR");
3263 menu_entry_init(topmenu, "HELP_CHATLINE");
3264 menu_entry_init(topmenu, "HELP_WORKLIST_EDITOR");
3265 menu_entry_init(topmenu, "HELP_LANGUAGES");
3266 menu_entry_init(topmenu, "HELP_COPYING");
3267 menu_entry_init(topmenu, "HELP_ABOUT");
3268
3270
3271 menus_built = TRUE;
3272
3274
3275 return menubar;
3276}
3277
3278/************************************************************************/
3281static struct menu_entry_info *menu_entry_info_find(const char *key)
3282{
3283 int i;
3284
3285 for (i = 0; menu_entries[i].key != NULL; i++) {
3286 if (!strcmp(key, menu_entries[i].key)) {
3287 return &(menu_entries[i]);
3288 }
3289 }
3290
3291 return NULL;
3292}
3293
3294/************************************************************************/
3298 struct menu_entry_info *info,
3300{
3301 GAction *act = g_action_map_lookup_action(map, info->action);
3302
3303 if (act != NULL) {
3305 }
3306}
3307
3308/************************************************************************/
3312 const char *key,
3314{
3316
3317 if (info != NULL) {
3319 }
3320}
3321
3322/************************************************************************/
3326 enum menu_entry_grouping group,
3328{
3329 int i;
3330
3331 for (i = 0; menu_entries[i].key != NULL; i++) {
3332 if (menu_entries[i].grouping == group || group == MGROUP_ALL) {
3334 }
3335 }
3336}
3337
3338/************************************************************************/
3341static void menus_rename(GMenu *parent, int index, const char *key,
3342 const char *new_name)
3343{
3345
3346 if (info != NULL) {
3347 char actname[150];
3348 GMenuItem *item;
3349
3350 fc_snprintf(actname, sizeof(actname), "app.%s", info->action);
3351 g_menu_remove(parent, index);
3352
3353 item = g_menu_item_new(new_name, actname);
3355 }
3356}
3357
3358/************************************************************************/
3362{
3363 /* The "full" city bar (i.e. the new way of drawing the
3364 * city name), can draw the city growth even without drawing
3365 * the city name. But the old method cannot. */
3367 menu_entry_set_sensitive(map, "SHOW_CITY_GROWTH", TRUE);
3368 menu_entry_set_sensitive(map, "SHOW_CITY_TRADE_ROUTES", TRUE);
3369 } else {
3370 menu_entry_set_sensitive(map, "SHOW_CITY_GROWTH", gui_options.draw_city_names);
3371 menu_entry_set_sensitive(map, "SHOW_CITY_TRADE_ROUTES",
3373 }
3374
3375 menu_entry_set_sensitive(map, "SHOW_CITY_BUY_COST",
3377 menu_entry_set_sensitive(map, "SHOW_COASTLINE", !gui_options.draw_terrain);
3378 menu_entry_set_sensitive(map, "SHOW_UNIT_SOLID_BG",
3380 menu_entry_set_sensitive(map, "SHOW_UNIT_SHIELDS",
3382 menu_entry_set_sensitive(map, "SHOW_FOCUS_UNIT", !gui_options.draw_units);
3383}
3384
3385/************************************************************************/
3391static const char *get_tile_change_menu_text(struct tile *ptile,
3392 enum unit_activity activity)
3393{
3394 struct tile *newtile = tile_virtual_new(ptile);
3395 const char *text;
3396
3397 tile_apply_activity(newtile, activity, NULL);
3398 text = tile_get_info_text(newtile, FALSE, 0);
3400
3401 return text;
3402}
3403
3404/************************************************************************/
3408{
3411 GMenu *submenu;
3412 int i, j;
3413 int tgt_kind_group;
3414 struct unit_list *punits;
3415 unsigned num_units;
3416 struct menu_entry_info *info;
3417 struct road_type *proad;
3418 struct extra_type_list *extras;
3419 bool conn_possible;
3420
3422 return;
3423 }
3424
3426
3427 submenu = g_menu_new();
3428
3429 i = 0;
3430 j = 0;
3431
3432 /* Add the new action entries grouped by target kind. */
3434 action_iterate(act_id) {
3435 struct action *paction = action_by_number(act_id);
3436 GSimpleAction *act;
3437 char actname[256];
3438 char name[256];
3439
3440 if (action_id_get_actor_kind(act_id) != AAK_UNIT) {
3441 /* This action isn't performed by a unit. */
3442 continue;
3443 }
3444
3446 /* Wrong group. */
3447 continue;
3448 }
3449
3450 if (!units_can_do_action(punits, act_id, TRUE)) {
3451 continue;
3452 }
3453
3454 /* Create and add the menu item. */
3455 fc_snprintf(actname, sizeof(actname), "action_%d", i);
3458
3459 fc_snprintf(name, sizeof(name), "%s",
3460 action_get_ui_name_mnemonic(act_id, "_"));
3461 fc_snprintf(actname, sizeof(actname), "app.action_%d", i++);
3462
3463 if (action_id_has_complex_target(act_id)) {
3465 char subname[256];
3466
3467#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
3468{ \
3469 fc_snprintf(actname, sizeof(actname), "subtgt_%d", j); \
3470 act = g_simple_action_new(actname, NULL); \
3471 g_action_map_add_action(map, G_ACTION(act)); \
3472 g_object_set_data(G_OBJECT(act), _sub_target_key_, _sub_target_); \
3473 g_signal_connect(act, "activate", G_CALLBACK(unit_goto_and_callback), \
3474 paction); \
3475 fc_snprintf(subname, sizeof(subname), "%s", _sub_target_name_); \
3476 fc_snprintf(actname, sizeof(actname), "app.subtgt_%d", j++); \
3477 menu_item_append_unref(sub_target_menu, \
3478 g_menu_item_new(subname, actname)); \
3479}
3480
3482 case ASTK_BUILDING:
3484 CREATE_SUB_ITEM(pimpr, "end_building",
3487 break;
3488 case ASTK_TECH:
3490 CREATE_SUB_ITEM(ptech, "end_tech",
3493 break;
3494 case ASTK_EXTRA:
3496 extra_type_iterate(pextra) {
3497 if (!actres_creates_extra(paction->result, pextra)
3498 && !actres_removes_extra(paction->result, pextra)) {
3499 /* Not relevant */
3500 continue;
3501 }
3502 CREATE_SUB_ITEM(pextra, "end_extra",
3503 extra_name_translation(pextra));
3505 break;
3506 case ASTK_NONE:
3507 /* Should not be here. */
3509 break;
3510 case ASTK_COUNT:
3511 /* Should not exits */
3513 break;
3514 }
3515
3516#undef CREATE_SUB_ITEM
3517
3519 } else {
3520 g_signal_connect(act, "activate",
3523 }
3525 }
3527 g_menu_insert_submenu(unit_menu, 1, _("Go to a_nd..."), G_MENU_MODEL(submenu));
3528
3529 submenu = g_menu_new();
3530
3532 menu_entry_init(submenu, "START_REVOLUTION");
3533 }
3534
3535 i = 0;
3538 char name[256];
3539 char actname[256];
3540 GSimpleAction *act;
3541
3542 fc_snprintf(actname, sizeof(actname), "government_%d", i);
3546 g_signal_connect(act, "activate", G_CALLBACK(government_callback), g);
3547
3548 /* TRANS: %s is a government name */
3549 fc_snprintf(name, sizeof(name), _("%s..."),
3551 fc_snprintf(actname, sizeof(actname), "app.government_%d", i++);
3553 }
3556 g_menu_insert_submenu(gov_menu, 8, _("_Government"), G_MENU_MODEL(submenu));
3557
3558 submenu = g_menu_new();
3559
3561 if (pextra->buildable) {
3562 char actname[256];
3563 GSimpleAction *act;
3564
3565 fc_snprintf(actname, sizeof(actname), "path_%d", i);
3570 pextra));
3572 g_signal_connect(act, "activate", G_CALLBACK(road_callback), pextra);
3573
3574 fc_snprintf(actname, sizeof(actname), "app.path_%d", i++);
3577 }
3579
3582
3583 submenu = g_menu_new();
3584
3586 if (pextra->buildable) {
3587 char actname[256];
3588 GSimpleAction *act;
3589
3590 fc_snprintf(actname, sizeof(actname), "irrig_%d", i);
3595 pextra));
3597 g_signal_connect(act, "activate", G_CALLBACK(irrigation_callback), pextra);
3598
3599 fc_snprintf(actname, sizeof(actname), "app.irrig_%d", i++);
3602 }
3604
3606 g_menu_insert_submenu(work_menu, 3, _("Build _Irrigation"), G_MENU_MODEL(submenu));
3607
3608 submenu = g_menu_new();
3609
3611 if (pextra->buildable) {
3612 char actname[256];
3613 GSimpleAction *act;
3614
3615 fc_snprintf(actname, sizeof(actname), "mine_%d", i);
3620 pextra));
3622 g_signal_connect(act, "activate", G_CALLBACK(mine_callback), pextra);
3623
3624 fc_snprintf(actname, sizeof(actname), "app.mine_%d", i++);
3627 }
3629
3632
3633 submenu = g_menu_new();
3634
3636 char actname[256];
3637 GSimpleAction *act;
3638
3639 fc_snprintf(actname, sizeof(actname), "clean_%d", i);
3644 pextra));
3646 g_signal_connect(act, "activate", G_CALLBACK(clean_menu_callback), pextra);
3647
3648 fc_snprintf(actname, sizeof(actname), "app.clean_%d", i++);
3652
3654 g_menu_insert_submenu(work_menu, 5, _("_Clean Nuisance"),
3656
3657 submenu = g_menu_new();
3658
3660 if (pextra->buildable) {
3661 char actname[256];
3662 GSimpleAction *act;
3663
3664 fc_snprintf(actname, sizeof(actname), "base_%d", i);
3669 pextra));
3671 g_signal_connect(act, "activate", G_CALLBACK(base_callback), pextra);
3672
3673 fc_snprintf(actname, sizeof(actname), "app.base_%d", i++);
3676 }
3678
3681
3683 char acttext[128], irrtext[128], mintext[128], transtext[128];
3684 char cultext[128], plantext[128];
3685 struct terrain *pterrain;
3686
3687 if (!can_client_change_view()) {
3688 return;
3689 }
3690
3692
3693 if (num_units > 0) {
3694 const struct tile *ptile = NULL;
3695 const struct unit_type *ptype = NULL;
3696
3698 fc_assert((ptile == NULL) == (ptype == NULL));
3699
3700 if (ptile || ptype) {
3701 if (unit_tile(punit) != ptile) {
3703 }
3704 if (unit_type_get(punit) != ptype) {
3706 }
3707 } else {
3708 ptile = unit_tile(punit);
3710 }
3712 }
3713
3718 num_units > 0
3720 && !editor_is_active());
3721
3722 menu_entry_set_sensitive(map, "GAME_SAVE_AS",
3724 menu_entry_set_sensitive(map, "GAME_SAVE",
3726
3727 menu_entry_set_sensitive(map, "SERVER_OPTIONS", client.conn.established);
3728
3729 menu_entry_set_sensitive(map, "LEAVE",
3731
3733 menu_entry_set_sensitive(map, "INFRA_DLG", terrain_control.infrapoints);
3734
3735 menu_entry_set_sensitive(map, "POLICIES", multiplier_count() > 0);
3736 menu_entry_set_sensitive(map, "REPORT_TOP_CITIES", game.info.top_cities_count > 0);
3737 menu_entry_set_sensitive(map, "REPORT_SPACESHIP",
3738 client_player() != NULL && client_player()->spaceship.state != SSHIP_NONE);
3739
3740 info = menu_entry_info_find("EDIT_MODE");
3741 if (info->state != game.info.is_edit_mode) {
3742 info->state = game.info.is_edit_mode;
3746
3747 menu_entry_set_sensitive(map, "EDIT_MODE",
3750 }
3751
3752 info = menu_entry_info_find("TOGGLE_FOG");
3753 if (info->state != game.client.fog_of_war) {
3754 info->state = game.client.fog_of_war;
3755
3759 }
3760
3761 {
3762 char road_buf[500];
3763
3765 if (proad != NULL) {
3766 /* TRANS: Connect with some road type (Road/Railroad) */
3767 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
3769 menus_rename(work_menu, 12, "CONNECT_ROAD", road_buf);
3770 }
3771
3773 if (proad != NULL) {
3774 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
3776 menus_rename(work_menu, 13, "CONNECT_RAIL", road_buf);
3777 }
3778 }
3779
3780 if (!can_client_issue_orders()) {
3781 return;
3782 }
3783
3784 if (!punits) {
3785 return;
3786 }
3787
3788 /* Remaining part of this function: Update Unit, Work, and Combat menus */
3789
3790 /* Enable the button for adding to a city in all cases, so we
3791 * get an eventual error message from the server if we try. */
3792 menu_entry_set_sensitive(map, "BUILD_CITY",
3797
3798 menu_entry_set_sensitive(map, "DO_ACTION",
3800
3801 menu_entry_set_sensitive(map, "UNIT_TELEPORT",
3803
3804 menu_entry_set_sensitive(map, "BUILD_ROAD",
3808 menu_entry_set_sensitive(map, "BUILD_IRRIGATION",
3810 menu_entry_set_sensitive(map, "BUILD_MINE",
3812 menu_entry_set_sensitive(map, "CULTIVATE",
3814 menu_entry_set_sensitive(map, "PLANT",
3816 menu_entry_set_sensitive(map, "TRANSFORM_TERRAIN",
3818 menu_entry_set_sensitive(map, "FORTIFY",
3821 menu_entry_set_sensitive(map, "PARADROP",
3823 menu_entry_set_sensitive(map, "PILLAGE",
3825 menu_entry_set_sensitive(map, "CLEAN",
3827 menu_entry_set_sensitive(map, "BUILD_FORTRESS",
3829 menu_entry_set_sensitive(map, "BUILD_AIRBASE",
3831 menu_entry_set_sensitive(map, "UNIT_SENTRY",
3833 menu_entry_set_sensitive(map, "UNSENTRY_ALL",
3836 menu_entry_set_sensitive(map, "UNIT_HOMECITY",
3838 menu_entry_set_sensitive(map, "UNIT_UPGRADE", units_can_upgrade(&(wld.map), punits));
3839 menu_entry_set_sensitive(map, "UNIT_CONVERT", units_can_convert(&(wld.map), punits));
3840 menu_entry_set_sensitive(map, "UNIT_DISBAND",
3842 TRUE));
3843
3844 menu_entry_set_sensitive(map, "AUTO_SETTLER",
3846 menu_entry_set_sensitive(map, "UNIT_EXPLORE",
3848 menu_entry_set_sensitive(map, "UNIT_BOARD",
3850 menu_entry_set_sensitive(map, "UNIT_DEBOARD",
3852 menu_entry_set_sensitive(map, "UNIT_UNLOAD_TRANSPORTER",
3854
3856 if (proad != NULL) {
3857 struct extra_type *tgt;
3858
3859 tgt = road_extra_get(proad);
3860
3862 } else {
3864 }
3865 menu_entry_set_sensitive(map, "CONNECT_ROAD", conn_possible);
3866
3868 if (proad != NULL) {
3869 struct extra_type *tgt;
3870
3871 tgt = road_extra_get(proad);
3872
3874 } else {
3876 }
3877 menu_entry_set_sensitive(map, "CONNECT_RAIL", conn_possible);
3878
3880 if (proad != NULL) {
3881 struct extra_type *tgt;
3882
3883 tgt = road_extra_get(proad);
3884
3886 } else {
3888 }
3889 menu_entry_set_sensitive(map, "CONNECT_MAGLEV", conn_possible);
3890
3892
3893 if (extra_type_list_size(extras) > 0) {
3894 struct extra_type *tgt;
3895
3896 tgt = extra_type_list_get(extras, 0);
3898 } else {
3900 }
3901 menu_entry_set_sensitive(map, "CONNECT_IRRIGATION", conn_possible);
3902
3903 menu_entry_set_sensitive(map, "TAX_RATES",
3906
3908 menus_rename(work_menu, 0, "BUILD_CITY",
3910 } else {
3911 bool city_on_tile = FALSE;
3912
3913 /* FIXME: This overloading doesn't work well with multiple focus
3914 * units. */
3916 if (tile_city(unit_tile(punit))) {
3918 break;
3919 }
3921
3923 TRUE)) {
3924 menus_rename(work_menu, 0, "BUILD_CITY",
3926 } else {
3927 /* Refresh default order */
3928 menus_rename(work_menu, 0, "BUILD_CITY",
3930 }
3931 }
3932
3934 menus_rename(work_menu, 6, "BUILD_ROAD",
3937 char road_item[500];
3938 struct extra_type *pextra = NULL;
3939
3940 /* FIXME: This overloading doesn't work well with multiple focus
3941 * units. */
3945 if (pextra != NULL) {
3946 break;
3947 }
3949
3950 if (pextra != NULL) {
3951 /* TRANS: Build road of specific type (Road/Railroad) */
3952 snprintf(road_item, sizeof(road_item), _("Build %s"),
3953 extra_name_translation(pextra));
3954 menus_rename(work_menu, 6, "BUILD_ROAD", road_item);
3955 }
3956 } else {
3957 menus_rename(work_menu, 6, "BUILD_ROAD", _("Build _Road"));
3958 }
3959
3960 if (units_all_same_type && num_units > 0) {
3961 struct unit *punit = unit_list_get(punits, 0);
3962 const struct unit_type *to_unittype
3964
3965 if (to_unittype) {
3966 /* TRANS: %s is a unit type. */
3967 fc_snprintf(acttext, sizeof(acttext), _("Upgr_ade to %s"),
3970 unit_type_get(punit))));
3971 } else {
3972 acttext[0] = '\0';
3973 }
3974 } else {
3975 acttext[0] = '\0';
3976 }
3977 if ('\0' != acttext[0]) {
3978 menus_rename(unit_menu, 13, "UNIT_UPGRADE", acttext);
3979 } else {
3980 menus_rename(unit_menu, 13, "UNIT_UPGRADE", _("Upgr_ade"));
3981 }
3982
3983 if (units_can_convert(&(wld.map), punits)) {
3984 if (units_all_same_type && num_units > 0) {
3985 struct unit *punit = unit_list_get(punits, 0);
3986
3987 /* TRANS: %s is a unit type. */
3988 fc_snprintf(acttext, sizeof(acttext), _("C_onvert to %s"),
3990 } else {
3991 acttext[0] = '\0';
3992 }
3993 } else {
3994 menu_entry_set_sensitive(map, "UNIT_CONVERT", FALSE);
3995 acttext[0] = '\0';
3996 }
3997 if ('\0' != acttext[0]) {
3998 menus_rename(unit_menu, 14, "UNIT_CONVERT", acttext);
3999 } else {
4000 menus_rename(unit_menu, 14, "UNIT_CONVERT", _("C_onvert"));
4001 }
4002
4003 if (units_all_same_tile && num_units > 0) {
4004 struct unit *first = unit_list_get(punits, 0);
4005
4006 pterrain = tile_terrain(unit_tile(first));
4007
4009 struct extra_type *pextra = NULL;
4010
4011 /* FIXME: this overloading doesn't work well with multiple focus
4012 * units. */
4016 if (pextra != NULL) {
4017 break;
4018 }
4020
4021 if (pextra != NULL) {
4022 /* TRANS: Build irrigation of specific type */
4023 snprintf(irrtext, sizeof(irrtext), _("Build %s"),
4024 extra_name_translation(pextra));
4025 } else {
4026 sz_strlcpy(irrtext, _("Build _Irrigation"));
4027 }
4028 } else {
4029 sz_strlcpy(irrtext, _("Build _Irrigation"));
4030 }
4031
4032 if (pterrain->cultivate_result != T_NONE) {
4033 fc_snprintf(cultext, sizeof(cultext), _("Change to %s"),
4036 } else {
4037 sz_strlcpy(cultext, _("_Cultivate"));
4038 }
4039
4041 struct extra_type *pextra = NULL;
4042
4043 /* FIXME: this overloading doesn't work well with multiple focus
4044 * units. */
4048 if (pextra != NULL) {
4049 break;
4050 }
4052
4053 if (pextra != NULL) {
4054 /* TRANS: Build mine of specific type */
4055 snprintf(mintext, sizeof(mintext), _("Build %s"),
4056 extra_name_translation(pextra));
4057 } else {
4058 sz_strlcpy(mintext, _("Build _Mine"));
4059 }
4060 } else {
4061 sz_strlcpy(mintext, _("Build _Mine"));
4062 }
4063
4064 if (pterrain->plant_result != T_NONE) {
4065 fc_snprintf(plantext, sizeof(plantext), _("Change to %s"),
4067 } else {
4068 sz_strlcpy(plantext, _("_Plant"));
4069 }
4070
4071 if (pterrain->transform_result != T_NONE
4072 && pterrain->transform_result != pterrain) {
4073 fc_snprintf(transtext, sizeof(transtext), _("Transf_orm to %s"),
4076 } else {
4077 sz_strlcpy(transtext, _("Transf_orm Terrain"));
4078 }
4079 } else {
4080 sz_strlcpy(irrtext, _("Build _Irrigation"));
4081 sz_strlcpy(cultext, _("_Cultivate"));
4082 sz_strlcpy(mintext, _("Build _Mine"));
4083 sz_strlcpy(plantext, _("_Plant"));
4084 sz_strlcpy(transtext, _("Transf_orm Terrain"));
4085 }
4086
4087 menus_rename(work_menu, 7, "BUILD_IRRIGATION", irrtext);
4088 menus_rename(work_menu, 9, "CULTIVATE", cultext);
4089 menus_rename(work_menu, 8, "BUILD_MINE", mintext);
4090 menus_rename(work_menu, 10, "PLANT", plantext);
4091 menus_rename(work_menu, 11, "TRANSFORM_TERRAIN", transtext);
4092
4093 menus_rename(unit_menu, 12, "UNIT_HOMECITY",
4095
4096 menus_rename(combat_menu, 1, "BUILD_FORTRESS",
4097 Q_(terrain_control.gui_type_base0));
4098 menus_rename(combat_menu, 2, "BUILD_AIRBASE",
4099 Q_(terrain_control.gui_type_base1));
4100}
4101
4102/************************************************************************/
4107{
4108 if (!menus_built) {
4109 return;
4110 }
4111
4112#ifdef MENUS_GTK3
4113
4114 if (!can_client_change_view()) {
4116
4117 return;
4118 }
4119
4122
4123 menu_entry_set_sensitive("SHOW_NATIONAL_BORDERS",
4125
4127#endif /* MENUS_GTK3 */
4128}
4129
4130/**********************************************************************/
4134{
4136
4137 if (enable) {
4138 if (main_menubar == NULL) {
4141 /* Ensure the menus are really created before performing any operations
4142 * on them. */
4143 while (g_main_context_pending(NULL)) {
4145 }
4146 }
4147
4150
4151 } else {
4154 }
4155
4156 /* Workaround for gtk bug that (re)setting the menubar after the window has
4157 * been already created is not noticed. */
4158 g_object_notify(G_OBJECT(gtk_settings_get_default()), "gtk-shell-shows-menubar");
4159}
4160
4161/**********************************************************************/
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Definition actions.c:1880
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
Definition actions.c:2019
static struct action * action_by_number(action_id act_id)
Definition actions.h:635
#define action_iterate_end
Definition actions.h:465
#define action_id_get_actor_kind(act_id)
Definition actions.h:648
#define action_iterate(_act_)
Definition actions.h:461
#define ACTION_ANY
Definition actions.h:308
#define action_id_get_target_kind(act_id)
Definition actions.h:652
#define action_id_has_complex_target(act_id)
Definition actions.h:670
bool actres_removes_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:803
bool actres_creates_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:782
struct civclient client
enum client_states client_state(void)
void send_report_request(enum report_type type)
bool can_client_issue_orders(void)
bool client_has_player(void)
bool can_client_change_view(void)
#define client_player()
@ C_S_DISCONNECTED
Definition client_main.h:45
@ C_S_RUNNING
Definition client_main.h:47
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
Definition climisc.c:1241
void disconnect_from_server(bool leaving_sound)
Definition clinet.c:306
char * incite_cost
Definition comments.c:75
@ REPORT_WONDERS_OF_THE_WORLD
Definition conn_types.h:50
@ REPORT_DEMOGRAPHIC
Definition conn_types.h:53
@ REPORT_WONDERS_OF_THE_WORLD_LONG
Definition conn_types.h:51
@ REPORT_ACHIEVEMENTS
Definition conn_types.h:54
@ REPORT_TOP_CITIES
Definition conn_types.h:52
void send_save_game(const char *filename)
bool is_server_running(void)
bool can_client_access_hack(void)
bool can_conn_enable_editing(const struct connection *pconn)
Definition connection.c:521
void key_coastline_toggle(void)
Definition control.c:3952
void key_irrigation_toggle(void)
Definition control.c:3968
void key_unit_sentry(void)
Definition control.c:3756
void key_city_output_toggle(void)
Definition control.c:3853
void request_unit_return(struct unit *punit)
Definition control.c:1552
void request_unit_fortify(struct unit *punit)
Definition control.c:2353
void request_unit_caravan_action(struct unit *punit, action_id action)
Definition control.c:2223
void key_focus_unit_toggle(void)
Definition control.c:4048
void key_unit_auto_explore(void)
Definition control.c:3577
void key_unit_auto_settle(void)
Definition control.c:3590
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
Definition control.c:3375
void key_city_full_bar_toggle(void)
Definition control.c:3885
void key_bases_toggle(void)
Definition control.c:3984
void key_map_native_toggle(void)
Definition control.c:3877
void key_resources_toggle(void)
Definition control.c:3992
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
Definition control.c:1130
void key_unit_paradrop(void)
Definition control.c:3479
struct unit_list * get_units_in_focus(void)
Definition control.c:177
void key_unit_teleport(void)
Definition control.c:3495
void key_unit_shields_toggle(void)
Definition control.c:4040
void key_city_productions_toggle(void)
Definition control.c:3919
void key_unit_plant(void)
Definition control.c:3696
void key_unit_fortress(void)
Definition control.c:3624
void key_unit_mine(void)
Definition control.c:3688
void key_unit_pillage(void)
Definition control.c:3708
void request_unit_unload(struct unit *pcargo)
Definition control.c:2194
void key_editor_toggle_fogofwar(void)
Definition control.c:4081
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
Definition control.c:1938
void key_unit_irrigate(void)
Definition control.c:3668
void request_unit_build_city(struct unit *punit)
Definition control.c:1817
void key_unit_unload_all(void)
Definition control.c:3517
void key_cities_toggle(void)
Definition control.c:4016
void key_city_outlines_toggle(void)
Definition control.c:3845
void key_unit_homecity(void)
Definition control.c:3641
void key_unit_patrol(void)
Definition control.c:3487
void key_unit_solid_bg_toggle(void)
Definition control.c:4032
void key_terrain_toggle(void)
Definition control.c:3944
void key_paths_toggle(void)
Definition control.c:3960
void key_unit_wakeup_others(void)
Definition control.c:3550
void key_unit_stack_size_toggle(void)
Definition control.c:3936
void key_huts_toggle(void)
Definition control.c:4000
void key_fog_of_war_toggle(void)
Definition control.c:4056
void key_unit_wait(void)
Definition control.c:3542
void key_units_toggle(void)
Definition control.c:4024
void key_unit_select_battlegroup(int battlegroup, bool append)
Definition control.c:3819
void key_map_grid_toggle(void)
Definition control.c:3861
void key_pollution_toggle(void)
Definition control.c:4008
void key_city_growth_toggle(void)
Definition control.c:3902
void key_unit_action_select_tgt(void)
Definition control.c:3406
void key_city_buycost_toggle(void)
Definition control.c:3911
int get_num_units_in_focus(void)
Definition control.c:185
void key_unit_transform(void)
Definition control.c:3768
void key_unit_done(void)
Definition control.c:3463
void key_city_trade_routes_toggle(void)
Definition control.c:3928
void key_city_names_toggle(void)
Definition control.c:3893
void request_unit_select(struct unit_list *punits, enum unit_select_type_mode seltype, enum unit_select_location_mode selloc)
Definition control.c:1621
void key_unit_airbase(void)
Definition control.c:3560
void key_unit_goto(void)
Definition control.c:3471
void key_unit_convert(void)
Definition control.c:3602
void key_unit_clean(void)
Definition control.c:3720
void key_editor_toggle(void)
Definition control.c:4064
void key_unit_assign_battlegroup(int battlegroup, bool append)
Definition control.c:3780
void key_unit_cultivate(void)
Definition control.c:3676
void key_mines_toggle(void)
Definition control.c:3976
void key_map_borders_toggle(void)
Definition control.c:3869
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
Definition control.h:43
#define can_units_do_activity_targeted_client(_punits_, _act_, _tgt_)
Definition control.h:47
#define can_units_do_activity_client(_punits_, _act_)
Definition control.h:45
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
bool editor_is_active(void)
Definition editor.c:346
@ OBJTYPE_GAME
Definition editor.h:31
struct extra_type * next_extra_for_tile(const struct tile *ptile, enum extra_cause cause, const struct player *pplayer, const struct unit *punit)
Definition extras.c:765
int extra_number(const struct extra_type *pextra)
Definition extras.c:161
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Definition extras.c:249
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:194
#define extra_type_iterate(_p)
Definition extras.h:315
#define extra_type_iterate_end
Definition extras.h:321
#define extra_type_by_rmcause_iterate_end
Definition extras.h:358
#define extra_type_by_rmcause_iterate(_rmcause, _extra)
Definition extras.h:353
#define extra_type_by_cause_iterate_end
Definition extras.h:339
#define extra_type_by_cause_iterate(_cause, _extra)
Definition extras.h:333
#define NO_TARGET
Definition fc_types.h:354
@ BORDERS_DISABLED
Definition fc_types.h:1037
#define Q_(String)
Definition fcintl.h:70
#define _(String)
Definition fcintl.h:67
#define N_(String)
Definition fcintl.h:69
struct civ_game game
Definition game.c:62
struct world wld
Definition game.c:63
const char * government_name_translation(const struct government *pgovern)
Definition government.c:143
bool untargeted_revolution_allowed(void)
Definition government.c:566
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Definition government.c:166
#define governments_iterate(NAME_pgov)
Definition government.h:124
#define governments_iterate_end
Definition government.h:127
void log_output_window(void)
Definition chatline.c:928
void clear_output_window(void)
Definition chatline.c:943
void city_report_dialog_popup(bool raise)
Definition cityrep.c:292
void unit_select_dialog_popup(struct tile *ptile)
Definition dialogs.c:377
void popup_upgrade_dialog(struct unit_list *punits)
Definition dialogs.c:1435
void popup_disband_dialog(struct unit_list *punits)
Definition dialogs.c:1473
void editgui_refresh(void)
Definition editgui.c:1796
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6291
struct property_editor * editprop_get_property_editor(void)
Definition editprop.c:6244
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6381
void popup_find_dialog(void)
Definition finddlg.c:58
void popup_multiplier_dialog(void)
Definition gamedlgs.c:383
void popup_rates_dialog(void)
Definition gamedlgs.c:533
void popup_goto_dialog(void)
Definition gotodlg.c:258
void fullscreen_opt_refresh(struct option *poption)
Definition gui_main.c:2433
gboolean map_canvas_focus(void)
Definition gui_main.c:359
GtkWidget * toplevel
Definition gui_main.c:125
void popup_quit_dialog(void)
Definition gui_main.c:2349
#define GUI_GTK_OPTION(optname)
Definition gui_main.h:25
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
void popup_help_dialog_string(const char *item)
Definition helpdlg.c:212
void infra_dialog_popup(void)
Definition infradlg.c:85
void luaconsole_dialog_popup(bool raise)
Definition luaconsole.c:126
void center_on_unit(void)
Definition mapctrl.c:496
static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:697
static void show_national_borders_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1207
static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1443
GtkWidget * setup_menus(GtkWidget *window)
Definition menu.c:2151
static void auto_settle_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1781
static void help_connecting_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:857
static void menus_rename(const char *key, const gchar *new_label)
Definition menu.c:2285
static void help_combat_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1065
static void menu_entry_group_set_sensitive(enum menu_entry_grouping group, gboolean is_sensitive)
Definition menu.c:2253
static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1009
static void select_single_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1513
static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1721
static void help_government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1105
static void report_achievements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:833
static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1454
static void help_zoc_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1073
static void show_city_productions_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1264
static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:817
static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1241
static void help_space_race_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1121
static void help_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1017
static void help_playing_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1001
static void plant_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1839
static struct menu_entry_info menu_entries[]
Definition menu.c:267
static void base_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2001
static void help_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1033
static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1685
static void center_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2041
static void unit_explore_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1669
static void build_mine_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1831
static void quit_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:749
static void unit_return_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1659
static void show_city_trade_routes_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1287
static void transform_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1911
static void help_wonders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1097
static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1298
static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1253
static void show_stack_size_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1432
static void multiplier_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1985
static void help_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1089
static void save_game_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:681
static void show_unit_solid_bg_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1410
static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1309
static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1485
static void show_city_full_bar_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1229
static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1162
static void help_chatline_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:873
static void show_paths_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1319
static void connect_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1847
static void help_overview_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:993
static void save_game_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:689
static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1113
static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1399
static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1329
static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1196
static void help_improvements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1049
static void find_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:757
static void report_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:781
static void report_demographic_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:825
static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:881
static void help_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1041
static void leave_local_game_response(GtkWidget *dialog, gint response)
Definition menu.c:714
static void help_language_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:841
static void server_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:657
static void leave_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:729
static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1537
static void unit_convert_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1746
static void select_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1553
static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1369
static void report_wow_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:789
static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1738
static void help_tech_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1081
static void unit_goto_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1593
static void clean_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2026
static void build_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1762
static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1677
void real_menus_init(void)
Definition menu.c:2915
menu_entry_grouping
Definition menu.c:91
@ MGROUP_ALL
Definition menu.c:92
@ MGROUP_PLAYING
Definition menu.c:91
@ MGROUP_PLAYER
Definition menu.c:92
@ MGROUP_SAFE
Definition menu.c:91
@ MGROUP_EDIT
Definition menu.c:91
@ MGROUP_UNIT
Definition menu.c:92
static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1561
static void help_about_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1145
static void build_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1789
static void local_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:641
static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1389
static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1730
static void menu_entry_set_sensitive(const char *key, gboolean is_sensitive)
Definition menu.c:2240
static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1379
static void save_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:665
static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:705
static void worklists_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:765
static void connect_maglev_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1879
static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1465
static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:801
static void help_controls_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:865
static void select_same_type_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1545
static void connect_rail_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1863
static void unit_wait_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1577
static const char * get_tile_change_menu_text(struct tile *ptile, enum unit_activity activity)
Definition menu.c:2338
static void build_airbase_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1945
static void report_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2057
static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1569
static void message_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:649
static void tax_rate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1977
static void help_musicset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1025
static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1649
static struct menu_entry_info * menu_entry_info_find(const char *key)
Definition menu.c:2211
static void government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1993
static void report_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2065
static void report_messages_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:809
static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1349
static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1529
static void save_options_on_exit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1153
static void show_native_tiles_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1218
static void menu_entry_init(GtkBuildable *item)
Definition menu.c:2091
static void show_unit_shields_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1421
static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:673
static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1493
static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:625
static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1711
static void help_policies_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:849
static void unit_done_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1585
static void help_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1129
static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1601
static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1185
static void show_city_outlines_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1174
static void save_scenario_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1505
static void help_copying_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1137
static void cultivate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1823
static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:633
void real_menus_update(void)
Definition menu.c:2353
static void report_spaceship_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2081
static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1521
static void show_city_buy_cost_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1276
static void build_fortress_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1927
#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_)
static void view_menu_update_sensitivity(void)
Definition menu.c:2306
static void unit_board_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1701
static void fortify_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1935
static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1359
static void connect_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1895
static void build_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1815
static void report_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2049
static void road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2013
static void unit_disband_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1754
static void help_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1057
static void report_research_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2073
static void map_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:773
void popup_messageopt_dialog(void)
Definition messagedlg.c:51
void meswin_dialog_popup(bool raise)
Definition messagewin.c:417
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:972
void save_mapimg_dialog_popup(void)
Definition pages.c:3551
void mapimg_client_save(const char *filename)
Definition pages.c:3570
void save_game_dialog_popup(void)
Definition pages.c:3487
void save_scenario_dialog_popup(void)
Definition pages.c:3522
void popup_players_dialog(bool raise)
Definition plrdlg.c:91
void rally_dialog_popup(void)
void science_report_dialog_popup(bool raise)
Definition repodlgs.c:716
void economy_report_dialog_popup(bool raise)
Definition repodlgs.c:1243
void units_report_dialog_popup(bool raise)
Definition repodlgs.c:1768
void science_report_dialog_popdown(void)
Definition repodlgs.c:740
void popup_spaceship_dialog(struct player *pplayer)
bool request_transport(struct unit *cargo, struct tile *ptile)
void popup_worklists_report(void)
Definition wldlg.c:287
static GtkApplication * fc_app
Definition gui_main.c:183
GtkApplication * gui_app(void)
Definition gui_main.c:2674
#define submenu_append_unref(menu, name, submenu)
Definition gui_stuff.h:165
#define menu_item_insert_unref(menu, index, item)
Definition gui_stuff.h:142
#define menu_item_append_unref(menu, item)
Definition gui_stuff.h:149
static void help_governor_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:1654
static void irrigation_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2744
static void bg_append_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2874
static void unsentry_all_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2345
static GMenu * combat_menu
Definition menu.c:89
static GMenuItem * create_toggle_menu_item_for_key(const char *key)
Definition menu.c:2908
static void pillage_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2657
void enable_menus(bool enable)
Definition menu.c:4133
static void setup_app_actions(GApplication *fc_app)
Definition menu.c:2959
static GMenu * options_menu
Definition menu.c:83
static void register_bg_actions(GActionMap *map, int bg)
Definition menu.c:2999
const GActionEntry acts[]
Definition menu.c:1042
static void revolution_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2705
@ VMENU_HUTS
Definition menu.c:1030
@ VMENU_MINES
Definition menu.c:1027
@ VMENU_COASTLINE
Definition menu.c:1024
@ VMENU_UNIT_SOLID_BG
Definition menu.c:1034
@ VMENU_CITY_NAMES
Definition menu.c:1018
@ VMENU_UNITS
Definition menu.c:1033
@ VMENU_CITY_FULL_BAR
Definition menu.c:1017
@ VMENU_CITY_OUTLINES
Definition menu.c:1012
@ VMENU_POLLUTION
Definition menu.c:1031
@ VMENU_FOCUS_UNIT
Definition menu.c:1037
@ VMENU_BASES
Definition menu.c:1028
@ VMENU_MAP_GRID
Definition menu.c:1014
@ VMENU_CITY_BUY_COST
Definition menu.c:1021
@ VMENU_TERRAIN
Definition menu.c:1023
@ VMENU_CITY_GROWTH
Definition menu.c:1019
@ VMENU_PATHS
Definition menu.c:1025
@ VMENU_CITIES
Definition menu.c:1032
@ VMENU_STACK_SIZE
Definition menu.c:1036
@ VMENU_UNIT_SHIELDS
Definition menu.c:1035
@ VMENU_IRRIGATION
Definition menu.c:1026
@ VMENU_NATIVE_TILES
Definition menu.c:1016
@ VMENU_CITY_OUTPUT
Definition menu.c:1013
@ VMENU_RESOURCES
Definition menu.c:1029
@ VMENU_CITY_PRODUCTIONS
Definition menu.c:1020
@ VMENU_CITY_TRADE_ROUTES
Definition menu.c:1022
@ VMENU_FULL_SCREEN
Definition menu.c:1039
@ VMENU_NAT_BORDERS
Definition menu.c:1015
@ VMENU_FOW
Definition menu.c:1038
static GMenu * view_menu
Definition menu.c:85
static GMenu * work_menu
Definition menu.c:88
menu_entry_grouping
Definition menu.c:80
static void bg_assign_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2864
static void menu_entry_set_sensitive_info(GActionMap *map, struct menu_entry_info *info, gboolean is_enabled)
Definition menu.c:3297
static bool menus_built
Definition menu.c:74
static void show_mines_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:1950
static GMenu * edit_menu
Definition menu.c:84
void menus_disable_unit_commands(void)
Definition menu.c:4164
static void unit_teleport_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2326
static void paradrop_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2647
const struct menu_entry_option_map meoms[]
Definition menu.c:1730
static GMenu * unit_menu
Definition menu.c:87
static void do_action_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2667
static void bg_select_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2854
static void mine_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2759
static GMenu * main_menubar
Definition menu.c:73
static GMenuItem * create_toggle_menu_item(struct menu_entry_info *info)
Definition menu.c:2885
void menus_set_initial_toggle_values(void)
Definition menu.c:2941
static void clean_menu_callback(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition menu.c:2774
static void view_menu_item_toggle(void(*cb)(void), bool updt_sensitivity, gpointer data)
Definition menu.c:1771
#define enable(id)
Definition widget.h:223
void popup_revolution_dialog(void)
Definition dialogs.c:112
#define HELP_MUSICSET_ITEM
#define HELP_CITIES_ITEM
#define HELP_TERRAIN_ITEM
#define HELP_LANGUAGES_ITEM
#define HELP_CONNECTING_ITEM
#define HELP_TILESET_ITEM
#define HELP_CHATLINE_ITEM
#define HELP_RULESET_ITEM
#define HELP_GOVERNMENT_ITEM
#define HELP_ABOUT_ITEM
#define HELP_MULTIPLIER_ITEM
#define HELP_PLAYING_ITEM
#define HELP_IMPROVEMENTS_ITEM
#define HELP_UNITS_ITEM
#define HELP_ZOC_ITEM
#define HELP_WORKLIST_EDITOR_ITEM
#define HELP_WONDERS_ITEM
#define HELP_COMBAT_ITEM
#define HELP_SPACE_RACE_ITEM
#define HELP_COPYING_ITEM
#define HELP_OVERVIEW_ITEM
#define HELP_NATIONS_ITEM
#define HELP_TECHS_ITEM
#define HELP_DIPLOMACY_ITEM
#define HELP_ECONOMY_ITEM
#define HELP_CMA_ITEM
#define HELP_CONTROLS_ITEM
Impr_type_id improvement_number(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
const char * name
Definition inputfile.c:127
#define fc_assert_ret(condition)
Definition log.h:191
#define fc_assert(condition)
Definition log.h:176
#define FC_STATIC_ASSERT(cond, tag)
Definition log.h:235
struct terrain_misc terrain_control
Definition map.c:69
Multiplier_type_id multiplier_count(void)
Definition multipliers.c:88
const struct option_set * server_optset
Definition options.c:4016
const struct option_set * client_optset
Definition options.c:1280
void options_save(option_save_log_callback log_cb)
Definition options.c:6089
struct client_options gui_options
Definition options.c:71
@ GUI_GTK_MSGCHAT_MERGED
Definition options.h:69
struct extra_type * road_extra_get(const struct road_type *proad)
Definition road.c:42
struct road_type * road_by_gui_type(enum road_gui_type gui_type)
Definition road.c:180
static char * grouping
Definition shared.c:98
@ SSHIP_NONE
Definition spaceship.h:84
bool fog_of_war
Definition game.h:121
struct packet_game_info info
Definition game.h:89
struct civ_game::@31::@34 client
struct government * government_during_revolution
Definition game.h:94
struct connection conn
Definition client_main.h:96
bool draw_native
Definition options.h:215
bool draw_specials
Definition options.h:207
bool draw_city_output
Definition options.h:194
bool draw_city_names
Definition options.h:196
bool draw_city_productions
Definition options.h:198
bool draw_mines
Definition options.h:205
bool draw_borders
Definition options.h:214
bool draw_fortress_airbase
Definition options.h:206
bool draw_city_buycost
Definition options.h:199
bool draw_unit_stack_size
Definition options.h:218
bool draw_irrigation
Definition options.h:204
bool draw_terrain
Definition options.h:201
bool draw_units
Definition options.h:211
bool draw_fog_of_war
Definition options.h:213
bool draw_city_trade_routes
Definition options.h:200
bool draw_unit_shields
Definition options.h:217
bool draw_cities
Definition options.h:210
bool save_options_on_exit
Definition options.h:125
bool draw_map_grid
Definition options.h:195
bool draw_city_growth
Definition options.h:197
bool draw_focus_unit
Definition options.h:212
bool draw_paths
Definition options.h:203
bool draw_city_outlines
Definition options.h:193
bool draw_coastline
Definition options.h:202
bool draw_full_citybar
Definition options.h:216
bool draw_pollution
Definition options.h:209
bool solid_color_behind_units
Definition options.h:149
bool established
Definition connection.h:140
struct player * playing
Definition connection.h:151
struct extra_type::@25 data
Definition climisc.h:82
Definition menu.c:97
const char * key
Definition menu.c:98
bool state
Definition menu.c:98
const char * accl
Definition menu.c:95
enum menu_entry_grouping grouping
Definition menu.c:103
GCallback cb
Definition menu.c:102
const char * name
Definition menu.c:99
const char * action
Definition menu.c:94
void(* toggle)(GSimpleAction *act, GVariant *value, gpointer data)
Definition menu.c:97
Definition menu.c:1724
const char * menu_entry
Definition menu.c:1725
bool * option
Definition menu.c:1726
int menu_pos
Definition menu.c:1727
enum borders_mode borders
struct terrain * cultivate_result
Definition terrain.h:215
struct terrain * plant_result
Definition terrain.h:218
struct terrain * transform_result
Definition terrain.h:229
Definition tile.h:50
Definition unit.h:138
struct civ_map map
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
#define sz_strlcpy(dest, src)
Definition support.h:195
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:290
Tech_type_id advance_number(const struct advance *padvance)
Definition tech.c:98
#define advance_iterate(_p)
Definition tech.h:275
#define advance_iterate_end
Definition tech.h:276
#define T_NONE
Definition terrain.h:56
void tile_virtual_destroy(struct tile *vtile)
Definition tile.c:1033
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
Definition tile.c:681
struct tile * tile_virtual_new(const struct tile *ptile)
Definition tile.c:981
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
Definition tile.c:771
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
#define tile_terrain(_tile)
Definition tile.h:110
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1355
bool unit_can_est_trade_route_here(const struct unit *punit)
Definition unit.c:284
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:448
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:481
bool can_unit_do_autosettlers(const struct unit *punit)
Definition unit.c:606
bool can_unit_teleport(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:806
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:822
bool unit_can_help_build_wonder_here(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:258
#define unit_tile(_pu)
Definition unit.h:397
@ ORDER_PERFORM_ACTION
Definition unit.h:47
#define unit_owner(_pu)
Definition unit.h:396
#define MAX_NUM_BATTLEGROUPS
Definition unit.h:189
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:349
bool units_are_occupied(const struct unit_list *punits)
Definition unitlist.c:273
bool can_units_do_base_gui(const struct unit_list *punits, enum base_gui_type base_gui)
Definition unitlist.c:180
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:161
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:334
bool units_can_unload(const struct unit_list *punits)
Definition unitlist.c:301
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
Definition unitlist.c:318
bool units_have_type_flag(const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag)
Definition unitlist.c:202
bool can_units_do(const struct unit_list *punits, bool(can_fn)(const struct unit *punit))
Definition unitlist.c:95
bool units_can_do_action(const struct unit_list *punits, action_id act_id, bool can_do)
Definition unitlist.c:239
bool units_can_load(const struct unit_list *punits)
Definition unitlist.c:287
bool can_units_do_on_map(const struct civ_map *nmap, const struct unit_list *punits, bool(can_fn)(const struct civ_map *nmap, const struct unit *punit))
Definition unitlist.c:111
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
#define unit_list_iterate_end
Definition unitlist.h:33
const struct unit_type * unit_type_get(const struct unit *punit)
Definition unittype.c:123
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Definition unittype.c:1703
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1560
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Definition unittype.c:371