Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-gtk-3.22/menu.c Source File

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-3.22 */
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
73#ifndef GTK_STOCK_EDIT
74#define GTK_STOCK_EDIT NULL
75#endif
76
77 static GtkBuilder *ui_builder = NULL;
78
79static void menu_entry_set_active(const char *key,
80 gboolean is_active);
81static void menu_entry_set_sensitive(const char *key,
82 gboolean is_sensitive);
83#ifndef FREECIV_DEBUG
84static void menu_entry_set_visible(const char *key,
85 gboolean is_visible,
86 gboolean is_sensitive);
87#endif /* FREECIV_DEBUG */
88
89static void view_menu_update_sensitivity(void);
90
91 enum menu_entry_grouping { MGROUP_SAFE, MGROUP_EDIT, MGROUP_PLAYING,
92 MGROUP_UNIT, MGROUP_PLAYER, MGROUP_ALL };
93
94static void menu_entry_group_set_sensitive(enum menu_entry_grouping group,
95 gboolean is_sensitive);
96
97 struct menu_entry_info {
98 const char *key;
99 const char *name;
100 guint accel;
101 GdkModifierType accel_mod;
102 GCallback cb;
103 enum menu_entry_grouping grouping;
104};
105
106static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data);
107static void save_chat_logs_callback(GtkMenuItem *item, gpointer data);
108static void local_options_callback(GtkMenuItem *item, gpointer data);
109static void message_options_callback(GtkMenuItem *item, gpointer data);
110static void server_options_callback(GtkMenuItem *item, gpointer data);
111static void save_options_callback(GtkMenuItem *item, gpointer data);
112static void reload_tileset_callback(GtkMenuItem *item, gpointer data);
113static void save_game_callback(GtkMenuItem *item, gpointer data);
114static void save_game_as_callback(GtkMenuItem *item, gpointer data);
115static void save_mapimg_callback(GtkMenuItem *item, gpointer data);
116static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data);
117static void find_city_callback(GtkMenuItem *item, gpointer data);
118static void worklists_callback(GtkMenuItem *item, gpointer data);
119static void client_lua_script_callback(GtkMenuItem *item, gpointer data);
120static void leave_callback(GtkMenuItem *item, gpointer data);
121static void quit_callback(GtkMenuItem *item, gpointer data);
122static void map_view_callback(GtkMenuItem *item, gpointer data);
123static void report_units_callback(GtkMenuItem *item, gpointer data);
124static void report_nations_callback(GtkMenuItem *item, gpointer data);
125static void report_cities_callback(GtkMenuItem *item, gpointer data);
126static void report_wow_callback(GtkMenuItem *item, gpointer data);
127static void report_top_cities_callback(GtkMenuItem *item, gpointer data);
128static void report_messages_callback(GtkMenuItem *item, gpointer data);
129static void report_demographic_callback(GtkMenuItem *item, gpointer data);
130static void bg_select0_callback(GtkMenuItem *item, gpointer data);
131static void bg_assign0_callback(GtkMenuItem *item, gpointer data);
132static void bg_append0_callback(GtkMenuItem *item, gpointer data);
133static void bg_select1_callback(GtkMenuItem *item, gpointer data);
134static void bg_assign1_callback(GtkMenuItem *item, gpointer data);
135static void bg_append1_callback(GtkMenuItem *item, gpointer data);
136static void bg_select2_callback(GtkMenuItem *item, gpointer data);
137static void bg_assign2_callback(GtkMenuItem *item, gpointer data);
138static void bg_append2_callback(GtkMenuItem *item, gpointer data);
139static void bg_select3_callback(GtkMenuItem *item, gpointer data);
140static void bg_assign3_callback(GtkMenuItem *item, gpointer data);
141static void bg_append3_callback(GtkMenuItem *item, gpointer data);
142static void help_overview_callback(GtkMenuItem *item, gpointer data);
143static void help_playing_callback(GtkMenuItem *item, gpointer data);
144static void help_policies_callback(GtkMenuItem *item, gpointer data);
145static void help_terrain_callback(GtkMenuItem *item, gpointer data);
146static void help_economy_callback(GtkMenuItem *item, gpointer data);
147static void help_cities_callback(GtkMenuItem *item, gpointer data);
148static void help_improvements_callback(GtkMenuItem *item, gpointer data);
149static void help_wonders_callback(GtkMenuItem *item, gpointer data);
150static void help_units_callback(GtkMenuItem *item, gpointer data);
151static void help_combat_callback(GtkMenuItem *item, gpointer data);
152static void help_zoc_callback(GtkMenuItem *item, gpointer data);
153static void help_government_callback(GtkMenuItem *item, gpointer data);
154static void help_diplomacy_callback(GtkMenuItem *item, gpointer data);
155static void help_tech_callback(GtkMenuItem *item, gpointer data);
156static void help_space_race_callback(GtkMenuItem *item, gpointer data);
157static void help_ruleset_callback(GtkMenuItem *item, gpointer data);
158static void help_tileset_callback(GtkMenuItem *item, gpointer data);
159static void help_musicset_callback(GtkMenuItem *item, gpointer data);
160static void help_nations_callback(GtkMenuItem *item, gpointer data);
161static void help_connecting_callback(GtkMenuItem *item, gpointer data);
162static void help_controls_callback(GtkMenuItem *item, gpointer data);
163static void help_cma_callback(GtkMenuItem *item, gpointer data);
164static void help_chatline_callback(GtkMenuItem *item, gpointer data);
165static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data);
166static void help_language_callback(GtkMenuItem *item, gpointer data);
167static void help_copying_callback(GtkMenuItem *item, gpointer data);
168static void help_about_callback(GtkMenuItem *item, gpointer data);
169static void save_options_on_exit_callback(GtkCheckMenuItem *item,
170 gpointer data);
171static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data);
172static void show_city_outlines_callback(GtkCheckMenuItem *item,
173 gpointer data);
174static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data);
175static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data);
176static void show_national_borders_callback(GtkCheckMenuItem *item,
177 gpointer data);
178static void show_native_tiles_callback(GtkCheckMenuItem *item,
179 gpointer data);
180static void show_city_full_bar_callback(GtkCheckMenuItem *item,
181 gpointer data);
182static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data);
183static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data);
184static void show_city_productions_callback(GtkCheckMenuItem *item,
185 gpointer data);
186static void show_city_buy_cost_callback(GtkCheckMenuItem *item,
187 gpointer data);
188static void show_city_trade_routes_callback(GtkCheckMenuItem *item,
189 gpointer data);
190static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data);
191static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data);
192static void show_paths_callback(GtkCheckMenuItem *item, gpointer data);
193static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data);
194static void show_mine_callback(GtkCheckMenuItem *item, gpointer data);
195static void show_bases_callback(GtkCheckMenuItem *item, gpointer data);
196static void show_resources_callback(GtkCheckMenuItem *item, gpointer data);
197static void show_huts_callback(GtkCheckMenuItem *item, gpointer data);
198static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data);
199static void show_cities_callback(GtkCheckMenuItem *item, gpointer data);
200static void show_units_callback(GtkCheckMenuItem *item, gpointer data);
201static void show_unit_solid_bg_callback(GtkCheckMenuItem *item,
202 gpointer data);
203static void show_unit_shields_callback(GtkCheckMenuItem *item,
204 gpointer data);
205static void show_stack_size_callback(GtkCheckMenuItem *item,
206 gpointer data);
207static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data);
208static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data);
209static void full_screen_callback(GtkCheckMenuItem *item, gpointer data);
210static void recalc_borders_callback(GtkMenuItem *item, gpointer data);
211static void toggle_fog_callback(GtkMenuItem *item, gpointer data);
212static void scenario_properties_callback(GtkMenuItem *item, gpointer data);
213static void save_scenario_callback(GtkMenuItem *item, gpointer data);
214static void center_view_callback(GtkMenuItem *item, gpointer data);
215static void report_economy_callback(GtkMenuItem *item, gpointer data);
216static void report_research_callback(GtkMenuItem *item, gpointer data);
217static void multiplier_callback(GtkMenuItem *item, gpointer data);
218static void report_spaceship_callback(GtkMenuItem *item, gpointer data);
219static void report_achievements_callback(GtkMenuItem *item, gpointer data);
220static void government_callback(GtkMenuItem *item, gpointer data);
221static void tax_rate_callback(GtkMenuItem *item, gpointer data);
222static void select_single_callback(GtkMenuItem *item, gpointer data);
223static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data);
224static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data);
225static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data);
226static void select_same_type_callback(GtkMenuItem *item, gpointer data);
227static void select_dialog_callback(GtkMenuItem *item, gpointer data);
228static void rally_dialog_callback(GtkMenuItem *item, gpointer data);
229static void infra_dialog_callback(GtkMenuItem *item, gpointer data);
230static void unit_wait_callback(GtkMenuItem *item, gpointer data);
231static void unit_done_callback(GtkMenuItem *item, gpointer data);
232static void unit_goto_callback(GtkMenuItem *item, gpointer data);
233static void unit_goto_city_callback(GtkMenuItem *item, gpointer data);
234static void unit_return_callback(GtkMenuItem *item, gpointer data);
235static void unit_explore_callback(GtkMenuItem *item, gpointer data);
236static void unit_patrol_callback(GtkMenuItem *item, gpointer data);
237static void unit_sentry_callback(GtkMenuItem *item, gpointer data);
238static void unit_unsentry_callback(GtkMenuItem *item, gpointer data);
239static void unit_board_callback(GtkMenuItem *item, gpointer data);
240static void unit_deboard_callback(GtkMenuItem *item, gpointer data);
241static void unit_unload_transporter_callback(GtkMenuItem *item,
242 gpointer data);
243static void unit_homecity_callback(GtkMenuItem *item, gpointer data);
244static void unit_upgrade_callback(GtkMenuItem *item, gpointer data);
245static void unit_convert_callback(GtkMenuItem *item, gpointer data);
246static void unit_disband_callback(GtkMenuItem *item, gpointer data);
247static void build_city_callback(GtkMenuItem *item, gpointer data);
248static void auto_settle_callback(GtkMenuItem *item, gpointer data);
249static void build_road_callback(GtkMenuItem *item, gpointer data);
250static void build_irrigation_callback(GtkMenuItem *item, gpointer data);
251static void cultivate_callback(GtkMenuItem *item, gpointer data);
252static void build_mine_callback(GtkMenuItem *item, gpointer data);
253static void plant_callback(GtkMenuItem *item, gpointer data);
254static void connect_road_callback(GtkMenuItem *item, gpointer data);
255static void connect_rail_callback(GtkMenuItem *item, gpointer data);
256static void connect_maglev_callback(GtkMenuItem *item, gpointer data);
257static void connect_irrigation_callback(GtkMenuItem *item, gpointer data);
258static void transform_terrain_callback(GtkMenuItem *item, gpointer data);
259static void clean_nuisance_callback(GtkMenuItem *item, gpointer data);
260static void fortify_callback(GtkMenuItem *item, gpointer data);
261static void build_fortress_callback(GtkMenuItem *item, gpointer data);
262static void build_airbase_callback(GtkMenuItem *item, gpointer data);
263static void do_paradrop_callback(GtkMenuItem *item, gpointer data);
264static void do_pillage_callback(GtkMenuItem *item, gpointer data);
265static void diplomat_action_callback(GtkMenuItem *item, gpointer data);
266
267 static struct menu_entry_info menu_entries[] =
268{
269 { "MENU_GAME", N_("_Game"), 0, 0, NULL, MGROUP_SAFE },
270 { "MENU_OPTIONS", N_("_Options"), 0, 0, NULL, MGROUP_SAFE },
271 { "MENU_EDIT", N_("_Edit"), 0, 0, NULL, MGROUP_SAFE },
272 { "MENU_VIEW", N_("?verb:_View"), 0, 0, NULL, MGROUP_SAFE },
273 { "MENU_IMPROVEMENTS", N_("_Improvements"), 0, 0,
274 NULL, MGROUP_SAFE },
275 { "MENU_CIVILIZATION", N_("C_ivilization"), 0, 0,
276 NULL, MGROUP_SAFE },
277 { "MENU_BATTLE_GROUPS", N_("_Battle Groups"), 0, 0,
278 NULL, MGROUP_PLAYING },
279 { "MENU_HELP", N_("_Help"), 0, 0, NULL, MGROUP_SAFE },
280 { "CLEAR_CHAT_LOGS", N_("_Clear Chat Log"), 0, 0,
281 G_CALLBACK(clear_chat_logs_callback), MGROUP_SAFE },
282 { "SAVE_CHAT_LOGS", N_("Save Chat _Log"), 0, 0,
283 G_CALLBACK(save_chat_logs_callback), MGROUP_SAFE },
284 { "LOCAL_OPTIONS", N_("_Local Client"), 0, 0,
285 G_CALLBACK(local_options_callback), MGROUP_SAFE },
286 { "MESSAGE_OPTIONS", N_("_Message"), 0, 0,
287 G_CALLBACK(message_options_callback), MGROUP_SAFE },
288 { "SERVER_OPTIONS", N_("_Remote Server"), 0, 0,
289 G_CALLBACK(server_options_callback), MGROUP_SAFE },
290 { "SAVE_OPTIONS", N_("Save Options _Now"), 0, 0,
291 G_CALLBACK(save_options_callback), MGROUP_SAFE },
292 { "RELOAD_TILESET", N_("_Reload Tileset"),
293 GDK_KEY_r, GDK_MOD1_MASK | GDK_CONTROL_MASK,
294 G_CALLBACK(reload_tileset_callback), MGROUP_SAFE },
295 { "GAME_SAVE", N_("_Save Game"), GDK_KEY_s, GDK_CONTROL_MASK,
296 G_CALLBACK(save_game_callback), MGROUP_SAFE },
297 { "GAME_SAVE_AS", N_("Save Game _As..."), 0, 0,
298 G_CALLBACK(save_game_as_callback), MGROUP_SAFE },
299 { "MAPIMG_SAVE", N_("Save Map _Image"), 0, 0,
300 G_CALLBACK(save_mapimg_callback), MGROUP_SAFE },
301 { "MAPIMG_SAVE_AS", N_("Save _Map Image As..."), 0, 0,
302 G_CALLBACK(save_mapimg_as_callback), MGROUP_SAFE },
303 { "LEAVE", N_("_Leave"), 0, 0, G_CALLBACK(leave_callback), MGROUP_SAFE },
304 { "QUIT", N_("_Quit"), GDK_KEY_q, GDK_CONTROL_MASK,
305 G_CALLBACK(quit_callback), MGROUP_SAFE },
306 { "FIND_CITY", N_("_Find City"), GDK_KEY_f, GDK_CONTROL_MASK,
307 G_CALLBACK(find_city_callback), MGROUP_SAFE },
308 { "WORKLISTS", N_("Work_lists"),
309 GDK_KEY_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
310 G_CALLBACK(worklists_callback), MGROUP_SAFE },
311 { "RALLY_DLG", N_("Rally point dialog"),
312 GDK_KEY_r, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
313 G_CALLBACK(rally_dialog_callback), MGROUP_SAFE },
314 { "INFRA_DLG", N_("Infra dialog"),
315 GDK_KEY_f, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
316 G_CALLBACK(infra_dialog_callback), MGROUP_SAFE },
317 { "CLIENT_LUA_SCRIPT", N_("Client _Lua Script"), 0, 0,
318 G_CALLBACK(client_lua_script_callback), MGROUP_SAFE },
319 { "MAP_VIEW", N_("?noun:_View"), GDK_KEY_F1, 0,
320 G_CALLBACK(map_view_callback), MGROUP_SAFE },
321 { "REPORT_UNITS", N_("_Units"), GDK_KEY_F2, 0,
322 G_CALLBACK(report_units_callback), MGROUP_SAFE },
323 { "REPORT_NATIONS", N_("_Nations"), GDK_KEY_F3, 0,
324 G_CALLBACK(report_nations_callback), MGROUP_SAFE },
325 { "REPORT_CITIES", N_("_Cities"), GDK_KEY_F4, 0,
326 G_CALLBACK(report_cities_callback), MGROUP_SAFE },
327 { "REPORT_WOW", N_("_Wonders of the World"), GDK_KEY_F7, 0,
328 G_CALLBACK(report_wow_callback), MGROUP_SAFE },
329 { "REPORT_TOP_CITIES", N_("Top Cities"), GDK_KEY_F8, 0,
330 G_CALLBACK(report_top_cities_callback), MGROUP_SAFE },
331 { "REPORT_MESSAGES", N_("_Messages"), GDK_KEY_F9, 0,
332 G_CALLBACK(report_messages_callback), MGROUP_SAFE },
333 { "REPORT_DEMOGRAPHIC", N_("_Demographics"), GDK_KEY_F11, 0,
334 G_CALLBACK(report_demographic_callback), MGROUP_SAFE },
335
336 /* Battle Groups menu */
337 /* Note that user view: 1 - 4, internal: 0 - 3 */
338 { "BATTLE_GROUP_SELECT_0", N_("Select Battle Group 1"),
339 GDK_KEY_F1, GDK_SHIFT_MASK,
340 G_CALLBACK(bg_select0_callback), MGROUP_SAFE },
341 { "BATTLE_GROUP_ASSIGN_0", N_("Assign Battle Group 1"),
342 GDK_KEY_F1, GDK_CONTROL_MASK,
343 G_CALLBACK(bg_assign0_callback), MGROUP_SAFE },
344 { "BATTLE_GROUP_APPEND_0", N_("Append to Battle Group 1"),
345 GDK_KEY_F1, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
346 G_CALLBACK(bg_append0_callback), MGROUP_SAFE },
347 { "BATTLE_GROUP_SELECT_1", N_("Select Battle Group 2"),
348 GDK_KEY_F2, GDK_SHIFT_MASK,
349 G_CALLBACK(bg_select1_callback), MGROUP_SAFE },
350 { "BATTLE_GROUP_ASSIGN_1", N_("Assign Battle Group 2"),
351 GDK_KEY_F2, GDK_CONTROL_MASK,
352 G_CALLBACK(bg_assign1_callback), MGROUP_SAFE },
353 { "BATTLE_GROUP_APPEND_1", N_("Append to Battle Group 2"),
354 GDK_KEY_F2, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
355 G_CALLBACK(bg_append1_callback), MGROUP_SAFE },
356 { "BATTLE_GROUP_SELECT_2", N_("Select Battle Group 3"),
357 GDK_KEY_F3, GDK_SHIFT_MASK,
358 G_CALLBACK(bg_select2_callback), MGROUP_SAFE },
359 { "BATTLE_GROUP_ASSIGN_2", N_("Assign Battle Group 3"),
360 GDK_KEY_F3, GDK_CONTROL_MASK,
361 G_CALLBACK(bg_assign2_callback), MGROUP_SAFE },
362 { "BATTLE_GROUP_APPEND_2", N_("Append to Battle Group 3"),
363 GDK_KEY_F3, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
364 G_CALLBACK(bg_append2_callback), MGROUP_SAFE },
365 { "BATTLE_GROUP_SELECT_3", N_("Select Battle Group 4"),
366 GDK_KEY_F4, GDK_SHIFT_MASK,
367 G_CALLBACK(bg_select3_callback), MGROUP_SAFE },
368 { "BATTLE_GROUP_ASSIGN_3", N_("Assign Battle Group 4"),
369 GDK_KEY_F4, GDK_CONTROL_MASK,
370 G_CALLBACK(bg_assign3_callback), MGROUP_SAFE },
371 { "BATTLE_GROUP_APPEND_3", N_("Append to Battle Group 4"),
372 GDK_KEY_F4, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
373 G_CALLBACK(bg_append3_callback), MGROUP_SAFE },
374
375 { "HELP_OVERVIEW", N_("?help:Overview"), 0, 0,
376 G_CALLBACK(help_overview_callback), MGROUP_SAFE },
377 { "HELP_PLAYING", N_("Strategy and Tactics"), 0, 0,
378 G_CALLBACK(help_playing_callback), MGROUP_SAFE },
379 { "HELP_POLICIES", N_("Policies"), 0, 0,
380 G_CALLBACK(help_policies_callback), MGROUP_SAFE },
381 { "HELP_TERRAIN", N_("Terrain"), 0, 0,
382 G_CALLBACK(help_terrain_callback), MGROUP_SAFE },
383 { "HELP_ECONOMY", N_("Economy"), 0, 0,
384 G_CALLBACK(help_economy_callback), MGROUP_SAFE },
385 { "HELP_CITIES", N_("Cities"), 0, 0,
386 G_CALLBACK(help_cities_callback), MGROUP_SAFE },
387 { "HELP_IMPROVEMENTS", N_("City Improvements"), 0, 0,
388 G_CALLBACK(help_improvements_callback), MGROUP_SAFE },
389 { "HELP_WONDERS", N_("Wonders of the World"), 0, 0,
390 G_CALLBACK(help_wonders_callback), MGROUP_SAFE },
391 { "HELP_UNITS", N_("Units"), 0, 0,
392 G_CALLBACK(help_units_callback), MGROUP_SAFE },
393 { "HELP_COMBAT", N_("Combat"), 0, 0,
394 G_CALLBACK(help_combat_callback), MGROUP_SAFE },
395 { "HELP_ZOC", N_("Zones of Control"), 0, 0,
396 G_CALLBACK(help_zoc_callback), MGROUP_SAFE },
397 { "HELP_GOVERNMENT", N_("Government"), 0, 0,
398 G_CALLBACK(help_government_callback), MGROUP_SAFE },
399 { "HELP_DIPLOMACY", N_("Diplomacy"), 0, 0,
400 G_CALLBACK(help_diplomacy_callback), MGROUP_SAFE },
401 { "HELP_TECH", N_("Technology"), 0, 0,
402 G_CALLBACK(help_tech_callback), MGROUP_SAFE },
403 { "HELP_SPACE_RACE", N_("Space Race"), 0, 0,
404 G_CALLBACK(help_space_race_callback), MGROUP_SAFE },
405 { "HELP_RULESET", N_("About Current Ruleset"), 0, 0,
406 G_CALLBACK(help_ruleset_callback), MGROUP_SAFE },
407 { "HELP_TILESET", N_("About Current Tileset"), 0, 0,
408 G_CALLBACK(help_tileset_callback), MGROUP_SAFE },
409 { "HELP_MUSICSET", N_("About Current Musicset"), 0, 0,
410 G_CALLBACK(help_musicset_callback), MGROUP_SAFE },
411 { "HELP_NATIONS", N_("About Nations"), 0, 0,
412 G_CALLBACK(help_nations_callback), MGROUP_SAFE },
413 { "HELP_CONNECTING", N_("Connecting"), 0, 0,
414 G_CALLBACK(help_connecting_callback), MGROUP_SAFE },
415 { "HELP_CONTROLS", N_("Controls"), 0, 0,
416 G_CALLBACK(help_controls_callback), MGROUP_SAFE },
417 { "HELP_CMA", N_("Citizen Governor"), 0, 0,
418 G_CALLBACK(help_cma_callback), MGROUP_SAFE },
419 { "HELP_CHATLINE", N_("Chatline"), 0, 0,
420 G_CALLBACK(help_chatline_callback), MGROUP_SAFE },
421 { "HELP_WORKLIST_EDITOR", N_("Worklist Editor"), 0, 0,
422 G_CALLBACK(help_worklist_editor_callback), MGROUP_SAFE },
423 { "HELP_LANGUAGES", N_("Languages"), 0, 0,
424 G_CALLBACK(help_language_callback), MGROUP_SAFE },
425 { "HELP_COPYING", N_("Copying"), 0, 0,
426 G_CALLBACK(help_copying_callback), MGROUP_SAFE },
427 { "HELP_ABOUT", N_("About Freeciv"), 0, 0,
428 G_CALLBACK(help_about_callback), MGROUP_SAFE },
429 { "SAVE_OPTIONS_ON_EXIT", N_("Save Options on _Exit"), 0, 0,
430 G_CALLBACK(save_options_on_exit_callback), MGROUP_SAFE },
431 { "EDIT_MODE", N_("_Editing Mode"), GDK_KEY_e, GDK_CONTROL_MASK,
432 G_CALLBACK(edit_mode_callback), MGROUP_SAFE },
433 { "SHOW_CITY_OUTLINES", N_("Cit_y Outlines"), GDK_KEY_y, GDK_CONTROL_MASK,
434 G_CALLBACK(show_city_outlines_callback), MGROUP_SAFE },
435 { "SHOW_CITY_OUTPUT", N_("City Output"), GDK_KEY_v, GDK_CONTROL_MASK,
436 G_CALLBACK(show_city_output_callback), MGROUP_SAFE },
437 { "SHOW_MAP_GRID", N_("Map _Grid"), GDK_KEY_g, GDK_CONTROL_MASK,
438 G_CALLBACK(show_map_grid_callback), MGROUP_SAFE },
439 { "SHOW_NATIONAL_BORDERS", N_("National _Borders"), GDK_KEY_b, GDK_CONTROL_MASK,
440 G_CALLBACK(show_national_borders_callback), MGROUP_SAFE },
441 { "SHOW_NATIVE_TILES", N_("Native Tiles"), GDK_KEY_n, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
442 G_CALLBACK(show_native_tiles_callback), MGROUP_SAFE },
443 { "SHOW_CITY_FULL_BAR", N_("City Full Bar"), 0, 0,
444 G_CALLBACK(show_city_full_bar_callback), MGROUP_SAFE },
445 { "SHOW_CITY_NAMES", N_("City _Names"), GDK_KEY_n, GDK_CONTROL_MASK,
446 G_CALLBACK(show_city_names_callback), MGROUP_SAFE },
447 { "SHOW_CITY_GROWTH", N_("City G_rowth"), GDK_KEY_o, GDK_CONTROL_MASK,
448 G_CALLBACK(show_city_growth_callback), MGROUP_SAFE },
449 { "SHOW_CITY_PRODUCTIONS", N_("City _Production"), GDK_KEY_p, GDK_CONTROL_MASK,
450 G_CALLBACK(show_city_productions_callback), MGROUP_SAFE },
451 { "SHOW_CITY_BUY_COST", N_("City Buy Cost"), 0, 0,
452 G_CALLBACK(show_city_buy_cost_callback), MGROUP_SAFE },
453 { "SHOW_CITY_TRADE_ROUTES", N_("City Tra_deroutes"), GDK_KEY_d, GDK_CONTROL_MASK,
454 G_CALLBACK(show_city_trade_routes_callback), MGROUP_SAFE },
455 { "SHOW_TERRAIN", N_("_Terrain"), 0, 0,
456 G_CALLBACK(show_terrain_callback), MGROUP_SAFE },
457 { "SHOW_COASTLINE", N_("C_oastline"), 0, 0,
458 G_CALLBACK(show_coastline_callback), MGROUP_SAFE },
459 { "SHOW_PATHS", N_("_Paths"), 0, 0,
460 G_CALLBACK(show_paths_callback), MGROUP_SAFE },
461 { "SHOW_IRRIGATION", N_("_Irrigation"), 0, 0,
462 G_CALLBACK(show_irrigation_callback), MGROUP_SAFE },
463 { "SHOW_MINES", N_("_Mines"), 0, 0,
464 G_CALLBACK(show_mine_callback), MGROUP_SAFE },
465 { "SHOW_BASES", N_("_Bases"), 0, 0,
466 G_CALLBACK(show_bases_callback), MGROUP_SAFE },
467 { "SHOW_RESOURCES", N_("_Resources"), 0, 0,
468 G_CALLBACK(show_resources_callback), MGROUP_SAFE },
469 { "SHOW_HUTS", N_("_Huts"), 0, 0,
470 G_CALLBACK(show_huts_callback), MGROUP_SAFE },
471 { "SHOW_POLLUTION", N_("Po_llution & Fallout"), 0, 0,
472 G_CALLBACK(show_pollution_callback), MGROUP_SAFE },
473 { "SHOW_CITIES", N_("Citi_es"), 0, 0,
474 G_CALLBACK(show_cities_callback), MGROUP_SAFE },
475 { "SHOW_UNITS", N_("_Units"), 0, 0,
476 G_CALLBACK(show_units_callback), MGROUP_SAFE },
477 { "SHOW_UNIT_SOLID_BG", N_("Unit Solid Background"), 0, 0,
478 G_CALLBACK(show_unit_solid_bg_callback), MGROUP_SAFE },
479 { "SHOW_UNIT_SHIELDS", N_("Unit shields"), 0, 0,
480 G_CALLBACK(show_unit_shields_callback), MGROUP_SAFE },
481 { "SHOW_STACK_SIZE", N_("Unit Stack Size"),
482 GDK_KEY_plus, GDK_CONTROL_MASK,
483 G_CALLBACK(show_stack_size_callback), MGROUP_SAFE },
484 { "SHOW_FOCUS_UNIT", N_("Focu_s Unit"), 0, 0,
485 G_CALLBACK(show_focus_unit_callback), MGROUP_SAFE },
486 { "SHOW_FOG_OF_WAR", N_("Fog of _War"), 0, 0,
487 G_CALLBACK(show_fog_of_war_callback), MGROUP_SAFE },
488 { "FULL_SCREEN", N_("_Fullscreen"), GDK_KEY_Return, GDK_MOD1_MASK,
489 G_CALLBACK(full_screen_callback), MGROUP_SAFE },
490
491 { "RECALC_BORDERS", N_("Recalculate _Borders"), 0, 0,
492 G_CALLBACK(recalc_borders_callback), MGROUP_EDIT },
493 { "TOGGLE_FOG", N_("Toggle Fog of _War"), GDK_KEY_w,
494 GDK_CONTROL_MASK | GDK_SHIFT_MASK,
495 G_CALLBACK(toggle_fog_callback), MGROUP_EDIT },
496 { "SCENARIO_PROPERTIES", N_("Game/Scenario Properties"), 0, 0,
497 G_CALLBACK(scenario_properties_callback), MGROUP_EDIT },
498 { "SAVE_SCENARIO", N_("Save Scenario"), 0, 0,
499 G_CALLBACK(save_scenario_callback), MGROUP_EDIT },
500
501 { "CENTER_VIEW", N_("_Center View"), GDK_KEY_c, 0,
502 G_CALLBACK(center_view_callback), MGROUP_PLAYER },
503 { "REPORT_ECONOMY", N_("_Economy"), GDK_KEY_F5, 0,
504 G_CALLBACK(report_economy_callback), MGROUP_PLAYER },
505 { "REPORT_RESEARCH", N_("_Research"), GDK_KEY_F6, 0,
506 G_CALLBACK(report_research_callback), MGROUP_PLAYER },
507 { "POLICIES", N_("_Policies..."),
508 GDK_KEY_p, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
509 G_CALLBACK(multiplier_callback), MGROUP_PLAYER },
510 { "REPORT_SPACESHIP", N_("_Spaceship"), GDK_KEY_F12, 0,
511 G_CALLBACK(report_spaceship_callback), MGROUP_PLAYER },
512 { "REPORT_ACHIEVEMENTS", N_("_Achievements"), GDK_KEY_asterisk, 0,
513 G_CALLBACK(report_achievements_callback), MGROUP_PLAYER },
514
515 { "MENU_SELECT", N_("_Select"), 0, 0, NULL, MGROUP_UNIT },
516 { "MENU_UNIT", N_("_Unit"), 0, 0, NULL, MGROUP_UNIT },
517 { "MENU_WORK", N_("_Work"), 0, 0, NULL, MGROUP_UNIT },
518 { "MENU_COMBAT", N_("_Combat"), 0, 0, NULL, MGROUP_UNIT },
519 { "MENU_BUILD_BASE", N_("Build _Base"), 0, 0, NULL, MGROUP_UNIT },
520 { "MENU_BUILD_PATH", N_("Build _Path"), 0, 0, NULL, MGROUP_UNIT },
521 { "MENU_CLEAN", N_("_Clean Nuisance"), 0, 0, NULL, MGROUP_UNIT },
522 { "SELECT_SINGLE", N_("_Single Unit (Unselect Others)"), GDK_KEY_z, 0,
523 G_CALLBACK(select_single_callback), MGROUP_UNIT },
524 { "SELECT_ALL_ON_TILE", N_("_All On Tile"), GDK_KEY_v, 0,
525 G_CALLBACK(select_all_on_tile_callback), MGROUP_UNIT },
526 { "SELECT_SAME_TYPE_TILE", N_("Same Type on _Tile"),
527 GDK_KEY_v, GDK_SHIFT_MASK,
528 G_CALLBACK(select_same_type_tile_callback), MGROUP_UNIT },
529 { "SELECT_SAME_TYPE_CONT", N_("Same Type on _Continent"),
530 GDK_KEY_c, GDK_SHIFT_MASK,
531 G_CALLBACK(select_same_type_cont_callback), MGROUP_UNIT },
532 { "SELECT_SAME_TYPE", N_("Same Type _Everywhere"), GDK_KEY_x, GDK_SHIFT_MASK,
533 G_CALLBACK(select_same_type_callback), MGROUP_UNIT },
534 { "SELECT_DLG", N_("Unit Selection Dialog"), 0, 0,
535 G_CALLBACK(select_dialog_callback), MGROUP_UNIT },
536 { "UNIT_WAIT", N_("_Wait"), GDK_KEY_w, 0,
537 G_CALLBACK(unit_wait_callback), MGROUP_UNIT },
538 { "UNIT_DONE", N_("_Done"), GDK_KEY_space, 0,
539 G_CALLBACK(unit_done_callback), MGROUP_UNIT },
540 { "UNIT_GOTO", N_("_Go to"), GDK_KEY_g, 0,
541 G_CALLBACK(unit_goto_callback), MGROUP_UNIT },
542 { "MENU_GOTO_AND", N_("Go to a_nd..."), 0, 0, NULL, MGROUP_UNIT },
543 { "UNIT_GOTO_CITY", N_("Go _to/Airlift to City..."), GDK_KEY_t, 0,
544 G_CALLBACK(unit_goto_city_callback), MGROUP_UNIT },
545 { "UNIT_RETURN", N_("_Return to Nearest City"), GDK_KEY_g, GDK_SHIFT_MASK,
546 G_CALLBACK(unit_return_callback), MGROUP_UNIT },
547 { "UNIT_EXPLORE", N_("Auto E_xplore"), GDK_KEY_x, 0,
548 G_CALLBACK(unit_explore_callback), MGROUP_UNIT },
549 { "UNIT_PATROL", N_("_Patrol"), GDK_KEY_q, 0,
550 G_CALLBACK(unit_patrol_callback), MGROUP_UNIT },
551 { "UNIT_SENTRY", N_("_Sentry"), GDK_KEY_s, 0,
552 G_CALLBACK(unit_sentry_callback), MGROUP_UNIT },
553 { "UNIT_UNSENTRY", N_("Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK,
554 G_CALLBACK(unit_unsentry_callback), MGROUP_UNIT },
555 { "UNIT_BOARD", N_("_Load"), GDK_KEY_l, 0,
556 G_CALLBACK(unit_board_callback), MGROUP_UNIT },
557 { "UNIT_DEBOARD", N_("_Unload"), GDK_KEY_u, 0,
558 G_CALLBACK(unit_deboard_callback), MGROUP_UNIT },
559 { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"),
560 GDK_KEY_t, GDK_SHIFT_MASK,
561 G_CALLBACK(unit_unload_transporter_callback), MGROUP_UNIT },
562 { "UNIT_HOMECITY", N_("Set _Home City"), GDK_KEY_h, 0,
563 G_CALLBACK(unit_homecity_callback), MGROUP_UNIT },
564 { "UNIT_UPGRADE", N_("Upgr_ade"), GDK_KEY_u, GDK_SHIFT_MASK,
565 G_CALLBACK(unit_upgrade_callback), MGROUP_UNIT },
566 { "UNIT_CONVERT", N_("C_onvert"), GDK_KEY_o, GDK_SHIFT_MASK,
567 G_CALLBACK(unit_convert_callback), MGROUP_UNIT },
568 { "UNIT_DISBAND", N_("_Disband"), GDK_KEY_d, GDK_SHIFT_MASK,
569 G_CALLBACK(unit_disband_callback), MGROUP_UNIT },
570 { "BUILD_CITY", N_("_Build City"), GDK_KEY_b, 0,
571 G_CALLBACK(build_city_callback), MGROUP_UNIT },
572 { "AUTO_SETTLER", N_("_Auto Settler"), GDK_KEY_a, 0,
573 G_CALLBACK(auto_settle_callback), MGROUP_UNIT },
574 { "BUILD_ROAD", N_("Build _Road"), GDK_KEY_r, 0,
575 G_CALLBACK(build_road_callback), MGROUP_UNIT },
576 { "BUILD_IRRIGATION", N_("Build _Irrigation"), GDK_KEY_i, 0,
577 G_CALLBACK(build_irrigation_callback), MGROUP_UNIT },
578 { "CULTIVATE", N_("Cultivate"), GDK_KEY_i, GDK_SHIFT_MASK,
579 G_CALLBACK(cultivate_callback), MGROUP_UNIT },
580 { "BUILD_MINE", N_("Build _Mine"), GDK_KEY_m, 0,
581 G_CALLBACK(build_mine_callback), MGROUP_UNIT },
582 { "PLANT", N_("Plant"), GDK_KEY_m, GDK_SHIFT_MASK,
583 G_CALLBACK(plant_callback), MGROUP_UNIT },
584 { "CONNECT_ROAD", N_("Connect With Roa_d"), GDK_KEY_r, GDK_CONTROL_MASK,
585 G_CALLBACK(connect_road_callback), MGROUP_UNIT },
586 { "CONNECT_RAIL", N_("Connect With Rai_l"), GDK_KEY_l, GDK_CONTROL_MASK,
587 G_CALLBACK(connect_rail_callback), MGROUP_UNIT },
588 { "CONNECT_MAGLEV", N_("Connect With _Maglev"), GDK_KEY_m, GDK_CONTROL_MASK,
589 G_CALLBACK(connect_maglev_callback), MGROUP_UNIT },
590 { "CONNECT_IRRIGATION", N_("Connect With Irri_gation"),
591 GDK_KEY_i, GDK_CONTROL_MASK,
592 G_CALLBACK(connect_irrigation_callback), MGROUP_UNIT },
593 { "TRANSFORM_TERRAIN", N_("Transf_orm Terrain"), GDK_KEY_o, 0,
594 G_CALLBACK(transform_terrain_callback), MGROUP_UNIT },
595 { "CLEAN", N_("_Clean"), GDK_KEY_p, 0,
596 G_CALLBACK(clean_nuisance_callback), MGROUP_UNIT },
597 { "FORTIFY", N_("Fortify"), GDK_KEY_f, 0,
598 G_CALLBACK(fortify_callback), MGROUP_UNIT },
599 { "BUILD_FORTRESS", N_("Build Fortress"), GDK_KEY_f, GDK_SHIFT_MASK,
600 G_CALLBACK(build_fortress_callback), MGROUP_UNIT },
601 { "BUILD_AIRBASE", N_("Build Airbase"), GDK_KEY_e, GDK_SHIFT_MASK,
602 G_CALLBACK(build_airbase_callback), MGROUP_UNIT },
603 { "DO_PARADROP", N_("P_aradrop"), GDK_KEY_j, 0,
604 G_CALLBACK(do_paradrop_callback), MGROUP_UNIT },
605 { "DO_PILLAGE", N_("_Pillage"), GDK_KEY_p, GDK_SHIFT_MASK,
606 G_CALLBACK(do_pillage_callback), MGROUP_UNIT },
607 { "DIPLOMAT_ACTION", N_("_Do..."), GDK_KEY_d, 0,
608 G_CALLBACK(diplomat_action_callback), MGROUP_UNIT },
609
610 { "MENU_GOVERNMENT", N_("_Government"), 0, 0,
611 NULL, MGROUP_PLAYING },
612 { "TAX_RATE", N_("_Tax Rates..."), GDK_KEY_t, GDK_CONTROL_MASK,
613 G_CALLBACK(tax_rate_callback), MGROUP_PLAYING },
614 { "START_REVOLUTION", N_("_Revolution..."),
615 GDK_KEY_g, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
616 G_CALLBACK(government_callback), MGROUP_PLAYING },
617 { NULL }
618};
619
620static struct menu_entry_info *menu_entry_info_find(const char *key);
621
622/************************************************************************/
625 static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
626{
627 clear_output_window();
628}
629
630/************************************************************************/
633 static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
634{
635 log_output_window();
636}
637
638/************************************************************************/
641 static void local_options_callback(GtkMenuItem *item, gpointer data)
642{
643 option_dialog_popup(_("Set local options"), client_optset);
644}
645
646/************************************************************************/
649 static void message_options_callback(GtkMenuItem *item, gpointer data)
650{
651 popup_messageopt_dialog();
652}
653
654/************************************************************************/
657 static void server_options_callback(GtkMenuItem *item, gpointer data)
658{
659 option_dialog_popup(_("Game Settings"), server_optset);
660}
661
662/************************************************************************/
665 static void save_options_callback(GtkMenuItem *item, gpointer data)
666{
667 options_save(NULL);
668}
669
670/************************************************************************/
673 static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
674{
675 tilespec_reread(NULL, TRUE, 1.0);
676}
677
678/************************************************************************/
681 static void save_game_callback(GtkMenuItem *item, gpointer data)
682{
683 send_save_game(NULL);
684}
685
686/************************************************************************/
689 static void save_game_as_callback(GtkMenuItem *item, gpointer data)
690{
691 save_game_dialog_popup();
692}
693
694/************************************************************************/
697 static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
698{
699 mapimg_client_save(NULL);
700}
701
702/************************************************************************/
705 static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
706{
707 save_mapimg_dialog_popup();
708}
709
710/************************************************************************/
714 static void leave_local_game_response(GtkWidget *dialog, gint response)
715{
716 gtk_widget_destroy(dialog);
717 if (response == GTK_RESPONSE_OK) {
718 /* It might be killed already */
719 if (client.conn.used) {
720 /* It will also kill the server */
721 disconnect_from_server(TRUE);
722 }
723 }
724}
725
726/************************************************************************/
729 static void leave_callback(GtkMenuItem *item, gpointer data)
730{
731 if (is_server_running()) {
732 GtkWidget* dialog =
733 gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_WARNING,
734 GTK_BUTTONS_OK_CANCEL,
735 _("Leaving a local game will end it!"));
736 setup_dialog(dialog, toplevel);
737 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
738 g_signal_connect(dialog, "response",
739 G_CALLBACK(leave_local_game_response), NULL);
740 gtk_window_present(GTK_WINDOW(dialog));
741 } else {
742 disconnect_from_server(TRUE);
743 }
744}
745
746/************************************************************************/
749 static void quit_callback(GtkMenuItem *item, gpointer data)
750{
751 popup_quit_dialog();
752}
753
754/************************************************************************/
757 static void find_city_callback(GtkMenuItem *item, gpointer data)
758{
759 popup_find_dialog();
760}
761
762/************************************************************************/
765 static void worklists_callback(GtkMenuItem *item, gpointer data)
766{
767 popup_worklists_report();
768}
769
770/************************************************************************/
773 static void map_view_callback(GtkMenuItem *item, gpointer data)
774{
775 map_canvas_focus();
776}
777
778/************************************************************************/
781 static void report_nations_callback(GtkMenuItem *item, gpointer data)
782{
783 popup_players_dialog(TRUE);
784}
785
786/************************************************************************/
789 static void report_wow_callback(GtkMenuItem *item, gpointer data)
790{
791 send_report_request(REPORT_WONDERS_OF_THE_WORLD);
792}
793
794/************************************************************************/
797 static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
798{
799 send_report_request(REPORT_TOP_CITIES);
800}
801
802/************************************************************************/
805 static void report_messages_callback(GtkMenuItem *item, gpointer data)
806{
807 meswin_dialog_popup(TRUE);
808}
809
810/************************************************************************/
813 static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
814{
815 luaconsole_dialog_popup(TRUE);
816}
817
818/************************************************************************/
821 static void report_demographic_callback(GtkMenuItem *item, gpointer data)
822{
823 send_report_request(REPORT_DEMOGRAPHIC);
824}
825
826/************************************************************************/
829 static void report_achievements_callback(GtkMenuItem *item, gpointer data)
830{
831 send_report_request(REPORT_ACHIEVEMENTS);
832}
833
834/************************************************************************/
837 static void help_language_callback(GtkMenuItem *item, gpointer data)
838{
839 popup_help_dialog_string(HELP_LANGUAGES_ITEM);
840}
841
842/************************************************************************/
845 static void help_policies_callback(GtkMenuItem *item, gpointer data)
846{
847 popup_help_dialog_string(HELP_MULTIPLIER_ITEM);
848}
849
850/************************************************************************/
853 static void help_connecting_callback(GtkMenuItem *item, gpointer data)
854{
855 popup_help_dialog_string(HELP_CONNECTING_ITEM);
856}
857
858/************************************************************************/
861 static void help_controls_callback(GtkMenuItem *item, gpointer data)
862{
863 popup_help_dialog_string(HELP_CONTROLS_ITEM);
864}
865
866/************************************************************************/
869 static void help_chatline_callback(GtkMenuItem *item, gpointer data)
870{
871 popup_help_dialog_string(HELP_CHATLINE_ITEM);
872}
873
874/************************************************************************/
877 static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
878{
879 popup_help_dialog_string(HELP_WORKLIST_EDITOR_ITEM);
880}
881
882/************************************************************************/
885 static void help_cma_callback(GtkMenuItem *item, gpointer data)
886{
887 popup_help_dialog_string(HELP_CMA_ITEM);
888}
889
890/************************************************************************/
893 static void bg_select0_callback(GtkMenuItem *item, gpointer data)
894{
895 key_unit_select_battlegroup(0, FALSE);
896}
897
898/************************************************************************/
901 static void bg_assign0_callback(GtkMenuItem *item, gpointer data)
902{
903 key_unit_assign_battlegroup(0, FALSE);
904}
905
906/************************************************************************/
909 static void bg_append0_callback(GtkMenuItem *item, gpointer data)
910{
911 key_unit_assign_battlegroup(0, TRUE);
912}
913
914/************************************************************************/
917 static void bg_select1_callback(GtkMenuItem *item, gpointer data)
918{
919 key_unit_select_battlegroup(1, FALSE);
920}
921
922/************************************************************************/
925 static void bg_assign1_callback(GtkMenuItem *item, gpointer data)
926{
927 key_unit_assign_battlegroup(1, FALSE);
928}
929
930/************************************************************************/
933 static void bg_append1_callback(GtkMenuItem *item, gpointer data)
934{
935 key_unit_assign_battlegroup(1, TRUE);
936}
937
938/************************************************************************/
941 static void bg_select2_callback(GtkMenuItem *item, gpointer data)
942{
943 key_unit_select_battlegroup(2, FALSE);
944}
945
946/************************************************************************/
949 static void bg_assign2_callback(GtkMenuItem *item, gpointer data)
950{
951 key_unit_assign_battlegroup(2, FALSE);
952}
953
954/************************************************************************/
957 static void bg_append2_callback(GtkMenuItem *item, gpointer data)
958{
959 key_unit_assign_battlegroup(2, TRUE);
960}
961
962/************************************************************************/
965 static void bg_select3_callback(GtkMenuItem *item, gpointer data)
966{
967 key_unit_select_battlegroup(3, FALSE);
968}
969
970/************************************************************************/
973 static void bg_assign3_callback(GtkMenuItem *item, gpointer data)
974{
975 key_unit_assign_battlegroup(3, FALSE);
976}
977
978/************************************************************************/
981 static void bg_append3_callback(GtkMenuItem *item, gpointer data)
982{
983 key_unit_assign_battlegroup(3, TRUE);
984}
985
986/************************************************************************/
989 static void help_overview_callback(GtkMenuItem *item, gpointer data)
990{
991 popup_help_dialog_string(HELP_OVERVIEW_ITEM);
992}
993
994/************************************************************************/
997 static void help_playing_callback(GtkMenuItem *item, gpointer data)
998{
999 popup_help_dialog_string(HELP_PLAYING_ITEM);
1000}
1001
1002/************************************************************************/
1005 static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
1006{
1007 popup_help_dialog_string(HELP_RULESET_ITEM);
1008}
1009
1010/************************************************************************/
1013 static void help_tileset_callback(GtkMenuItem *item, gpointer data)
1014{
1015 popup_help_dialog_string(HELP_TILESET_ITEM);
1016}
1017
1018/************************************************************************/
1021 static void help_musicset_callback(GtkMenuItem *item, gpointer data)
1022{
1023 popup_help_dialog_string(HELP_MUSICSET_ITEM);
1024}
1025
1026/************************************************************************/
1029 static void help_economy_callback(GtkMenuItem *item, gpointer data)
1030{
1031 popup_help_dialog_string(HELP_ECONOMY_ITEM);
1032}
1033
1034/************************************************************************/
1037 static void help_cities_callback(GtkMenuItem *item, gpointer data)
1038{
1039 popup_help_dialog_string(HELP_CITIES_ITEM);
1040}
1041
1042/************************************************************************/
1045 static void help_improvements_callback(GtkMenuItem *item, gpointer data)
1046{
1047 popup_help_dialog_string(HELP_IMPROVEMENTS_ITEM);
1048}
1049
1050/************************************************************************/
1053 static void help_units_callback(GtkMenuItem *item, gpointer data)
1054{
1055 popup_help_dialog_string(HELP_UNITS_ITEM);
1056}
1057
1058/************************************************************************/
1061 static void help_combat_callback(GtkMenuItem *item, gpointer data)
1062{
1063 popup_help_dialog_string(HELP_COMBAT_ITEM);
1064}
1065
1066/************************************************************************/
1069 static void help_zoc_callback(GtkMenuItem *item, gpointer data)
1070{
1071 popup_help_dialog_string(HELP_ZOC_ITEM);
1072}
1073
1074/************************************************************************/
1077 static void help_tech_callback(GtkMenuItem *item, gpointer data)
1078{
1079 popup_help_dialog_string(HELP_TECHS_ITEM);
1080}
1081
1082/************************************************************************/
1085 static void help_terrain_callback(GtkMenuItem *item, gpointer data)
1086{
1087 popup_help_dialog_string(HELP_TERRAIN_ITEM);
1088}
1089
1090/************************************************************************/
1093 static void help_wonders_callback(GtkMenuItem *item, gpointer data)
1094{
1095 popup_help_dialog_string(HELP_WONDERS_ITEM);
1096}
1097
1098/************************************************************************/
1101 static void help_government_callback(GtkMenuItem *item, gpointer data)
1102{
1103 popup_help_dialog_string(HELP_GOVERNMENT_ITEM);
1104}
1105
1106/************************************************************************/
1109 static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
1110{
1111 popup_help_dialog_string(HELP_DIPLOMACY_ITEM);
1112}
1113
1114/************************************************************************/
1117 static void help_space_race_callback(GtkMenuItem *item, gpointer data)
1118{
1119 popup_help_dialog_string(HELP_SPACE_RACE_ITEM);
1120}
1121
1122/************************************************************************/
1125 static void help_nations_callback(GtkMenuItem *item, gpointer data)
1126{
1127 popup_help_dialog_string(HELP_NATIONS_ITEM);
1128}
1129
1130/************************************************************************/
1133 static void help_copying_callback(GtkMenuItem *item, gpointer data)
1134{
1135 popup_help_dialog_string(HELP_COPYING_ITEM);
1136}
1137
1138/************************************************************************/
1141 static void help_about_callback(GtkMenuItem *item, gpointer data)
1142{
1143 popup_help_dialog_string(HELP_ABOUT_ITEM);
1144}
1145
1146/************************************************************************/
1149 static void save_options_on_exit_callback(GtkCheckMenuItem *item,
1150 gpointer data)
1151{
1152 gui_options.save_options_on_exit = gtk_check_menu_item_get_active(item);
1153}
1154
1155/************************************************************************/
1158 static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
1159{
1160 if (game.info.is_edit_mode ^ gtk_check_menu_item_get_active(item)) {
1161 key_editor_toggle();
1162 /* Unreachable techs in reqtree on/off */
1163 science_report_dialog_popdown();
1164 }
1165}
1166
1167/************************************************************************/
1170 static void show_city_outlines_callback(GtkCheckMenuItem *item,
1171 gpointer data)
1172{
1173 if (gui_options.draw_city_outlines ^ gtk_check_menu_item_get_active(item)) {
1174 key_city_outlines_toggle();
1175 }
1176}
1177
1178/************************************************************************/
1181 static void show_city_output_callback(GtkCheckMenuItem *item,
1182 gpointer data)
1183{
1184 if (gui_options.draw_city_output ^ gtk_check_menu_item_get_active(item)) {
1185 key_city_output_toggle();
1186 }
1187}
1188
1189/************************************************************************/
1192 static void show_map_grid_callback(GtkCheckMenuItem *item,
1193 gpointer data)
1194{
1195 if (gui_options.draw_map_grid ^ gtk_check_menu_item_get_active(item)) {
1196 key_map_grid_toggle();
1197 }
1198}
1199
1200/************************************************************************/
1203 static void show_national_borders_callback(GtkCheckMenuItem *item,
1204 gpointer data)
1205{
1206 if (gui_options.draw_borders ^ gtk_check_menu_item_get_active(item)) {
1207 key_map_borders_toggle();
1208 }
1209}
1210
1211/************************************************************************/
1214 static void show_native_tiles_callback(GtkCheckMenuItem *item,
1215 gpointer data)
1216{
1217 if (gui_options.draw_native ^ gtk_check_menu_item_get_active(item)) {
1218 key_map_native_toggle();
1219 }
1220}
1221
1222/************************************************************************/
1225 static void show_city_full_bar_callback(GtkCheckMenuItem *item,
1226 gpointer data)
1227{
1228 if (gui_options.draw_full_citybar ^ gtk_check_menu_item_get_active(item)) {
1229 key_city_full_bar_toggle();
1230 view_menu_update_sensitivity();
1231 }
1232}
1233
1234/************************************************************************/
1237 static void show_city_names_callback(GtkCheckMenuItem *item,
1238 gpointer data)
1239{
1240 if (gui_options.draw_city_names ^ gtk_check_menu_item_get_active(item)) {
1241 key_city_names_toggle();
1242 view_menu_update_sensitivity();
1243 }
1244}
1245
1246/************************************************************************/
1249 static void show_city_growth_callback(GtkCheckMenuItem *item,
1250 gpointer data)
1251{
1252 if (gui_options.draw_city_growth ^ gtk_check_menu_item_get_active(item)) {
1253 key_city_growth_toggle();
1254 }
1255}
1256
1257/************************************************************************/
1260 static void show_city_productions_callback(GtkCheckMenuItem *item,
1261 gpointer data)
1262{
1263 if (gui_options.draw_city_productions ^ gtk_check_menu_item_get_active(item)) {
1264 key_city_productions_toggle();
1265 view_menu_update_sensitivity();
1266 }
1267}
1268
1269/************************************************************************/
1272 static void show_city_buy_cost_callback(GtkCheckMenuItem *item,
1273 gpointer data)
1274{
1275 if (gui_options.draw_city_buycost ^ gtk_check_menu_item_get_active(item)) {
1276 key_city_buycost_toggle();
1277 }
1278}
1279
1280/************************************************************************/
1283 static void show_city_trade_routes_callback(GtkCheckMenuItem *item,
1284 gpointer data)
1285{
1286 if (gui_options.draw_city_trade_routes ^ gtk_check_menu_item_get_active(item)) {
1287 key_city_trade_routes_toggle();
1288 }
1289}
1290
1291/************************************************************************/
1294 static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
1295{
1296 if (gui_options.draw_terrain ^ gtk_check_menu_item_get_active(item)) {
1297 key_terrain_toggle();
1298 view_menu_update_sensitivity();
1299 }
1300}
1301
1302/************************************************************************/
1305 static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
1306{
1307 if (gui_options.draw_coastline ^ gtk_check_menu_item_get_active(item)) {
1308 key_coastline_toggle();
1309 }
1310}
1311
1312/************************************************************************/
1315 static void show_paths_callback(GtkCheckMenuItem *item, gpointer data)
1316{
1317 if (gui_options.draw_paths ^ gtk_check_menu_item_get_active(item)) {
1318 key_paths_toggle();
1319 }
1320}
1321
1322/************************************************************************/
1325 static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
1326{
1327 if (gui_options.draw_irrigation ^ gtk_check_menu_item_get_active(item)) {
1328 key_irrigation_toggle();
1329 }
1330}
1331
1332/************************************************************************/
1335 static void show_mine_callback(GtkCheckMenuItem *item, gpointer data)
1336{
1337 if (gui_options.draw_mines ^ gtk_check_menu_item_get_active(item)) {
1338 key_mines_toggle();
1339 }
1340}
1341
1342/************************************************************************/
1345 static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
1346{
1347 if (gui_options.draw_fortress_airbase ^ gtk_check_menu_item_get_active(item)) {
1348 key_bases_toggle();
1349 }
1350}
1351
1352/************************************************************************/
1355 static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
1356{
1357 if (gui_options.draw_specials ^ gtk_check_menu_item_get_active(item)) {
1358 key_resources_toggle();
1359 }
1360}
1361
1362/************************************************************************/
1365 static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
1366{
1367 if (gui_options.draw_huts ^ gtk_check_menu_item_get_active(item)) {
1368 key_huts_toggle();
1369 }
1370}
1371
1372/************************************************************************/
1375 static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
1376{
1377 if (gui_options.draw_pollution ^ gtk_check_menu_item_get_active(item)) {
1378 key_pollution_toggle();
1379 }
1380}
1381
1382/************************************************************************/
1385 static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
1386{
1387 if (gui_options.draw_cities ^ gtk_check_menu_item_get_active(item)) {
1388 key_cities_toggle();
1389 }
1390}
1391
1392/************************************************************************/
1395 static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
1396{
1397 if (gui_options.draw_units ^ gtk_check_menu_item_get_active(item)) {
1398 key_units_toggle();
1399 view_menu_update_sensitivity();
1400 }
1401}
1402
1403/************************************************************************/
1406 static void show_unit_solid_bg_callback(GtkCheckMenuItem *item,
1407 gpointer data)
1408{
1409 if (gui_options.solid_color_behind_units ^ gtk_check_menu_item_get_active(item)) {
1410 key_unit_solid_bg_toggle();
1411 }
1412}
1413
1414/************************************************************************/
1417 static void show_unit_shields_callback(GtkCheckMenuItem *item,
1418 gpointer data)
1419{
1420 if (gui_options.draw_unit_shields ^ gtk_check_menu_item_get_active(item)) {
1421 key_unit_shields_toggle();
1422 }
1423}
1424
1425/************************************************************************/
1428 static void show_stack_size_callback(GtkCheckMenuItem *item,
1429 gpointer data)
1430{
1431 if (gui_options.draw_unit_stack_size ^ gtk_check_menu_item_get_active(item)) {
1432 key_unit_stack_size_toggle();
1433 }
1434}
1435
1436/************************************************************************/
1439 static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
1440{
1441 if (gui_options.draw_focus_unit ^ gtk_check_menu_item_get_active(item)) {
1442 key_focus_unit_toggle();
1443 view_menu_update_sensitivity();
1444 }
1445}
1446
1447/************************************************************************/
1450 static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
1451{
1452 if (gui_options.draw_fog_of_war ^ gtk_check_menu_item_get_active(item)) {
1453 key_fog_of_war_toggle();
1454 view_menu_update_sensitivity();
1455 }
1456}
1457
1458/************************************************************************/
1461 static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
1462{
1463 if (GUI_GTK_OPTION(fullscreen) ^ gtk_check_menu_item_get_active(item)) {
1464 GUI_GTK_OPTION(fullscreen) ^= 1;
1465
1466 fullscreen_opt_refresh(NULL);
1467 }
1468}
1469
1470/************************************************************************/
1473 static void recalc_borders_callback(GtkMenuItem *item, gpointer data)
1474{
1475 key_editor_recalculate_borders();
1476}
1477
1478/************************************************************************/
1481 static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
1482{
1483 key_editor_toggle_fogofwar();
1484}
1485
1486/************************************************************************/
1489 static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
1490{
1491 struct property_editor *pe;
1492
1493 pe = editprop_get_property_editor();
1494 property_editor_reload(pe, OBJTYPE_GAME);
1495 property_editor_popup(pe, OBJTYPE_GAME);
1496}
1497
1498/************************************************************************/
1501 static void save_scenario_callback(GtkMenuItem *item, gpointer data)
1502{
1503 save_scenario_dialog_popup();
1504}
1505
1506/************************************************************************/
1509 static void select_single_callback(GtkMenuItem *item, gpointer data)
1510{
1511 request_unit_select(get_units_in_focus(), SELTYPE_SINGLE, SELLOC_TILE);
1512}
1513
1514/************************************************************************/
1517 static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
1518{
1519 request_unit_select(get_units_in_focus(), SELTYPE_ALL, SELLOC_TILE);
1520}
1521
1522/************************************************************************/
1525 static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
1526{
1527 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_TILE);
1528}
1529
1530/************************************************************************/
1533 static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
1534{
1535 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_CONT);
1536}
1537
1538/************************************************************************/
1541 static void select_same_type_callback(GtkMenuItem *item, gpointer data)
1542{
1543 request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_WORLD);
1544}
1545
1546/************************************************************************/
1549 static void select_dialog_callback(GtkMenuItem *item, gpointer data)
1550{
1551 unit_select_dialog_popup(NULL);
1552}
1553
1554/************************************************************************/
1557 static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
1558{
1559 rally_dialog_popup();
1560}
1561
1562/************************************************************************/
1565 static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
1566{
1567 infra_dialog_popup();
1568}
1569
1570/************************************************************************/
1573 static void unit_wait_callback(GtkMenuItem *item, gpointer data)
1574{
1575 key_unit_wait();
1576}
1577
1578/************************************************************************/
1581 static void unit_done_callback(GtkMenuItem *item, gpointer data)
1582{
1583 key_unit_done();
1584}
1585
1586/************************************************************************/
1589 static void unit_goto_callback(GtkMenuItem *item, gpointer data)
1590{
1591 key_unit_goto();
1592}
1593
1594/************************************************************************/
1597 static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
1598{
1599 int sub_target = NO_TARGET;
1600 struct action *paction = g_object_get_data(G_OBJECT(item), "end_action");
1601
1602 fc_assert_ret(paction != NULL);
1603
1604 switch (action_get_sub_target_kind(paction)) {
1605 case ASTK_BUILDING:
1606 {
1607 struct impr_type *pbuilding = g_object_get_data(G_OBJECT(item),
1608 "end_building");
1609 fc_assert_ret(pbuilding != NULL);
1610 sub_target = improvement_number(pbuilding);
1611 }
1612 break;
1613 case ASTK_TECH:
1614 {
1615 struct advance *ptech = g_object_get_data(G_OBJECT(item),
1616 "end_tech");
1617 fc_assert_ret(ptech != NULL);
1618 sub_target = advance_number(ptech);
1619 }
1620 break;
1621 case ASTK_EXTRA:
1622 case ASTK_EXTRA_NOT_THERE:
1623 {
1624 struct extra_type *pextra = g_object_get_data(G_OBJECT(item),
1625 "end_extra");
1626 fc_assert_ret(pextra != NULL);
1627 sub_target = extra_number(pextra);
1628 }
1629 break;
1630 case ASTK_NONE:
1631 sub_target = NO_TARGET;
1632 break;
1633 case ASTK_COUNT:
1634 /* Should not exits */
1635 fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
1636 break;
1637 }
1638
1639 request_unit_goto(ORDER_PERFORM_ACTION, paction->id, sub_target);
1640}
1641
1642/************************************************************************/
1645 static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
1646{
1647 if (get_num_units_in_focus() > 0) {
1648 popup_goto_dialog();
1649 }
1650}
1651
1652/************************************************************************/
1655 static void unit_return_callback(GtkMenuItem *item, gpointer data)
1656{
1657 unit_list_iterate(get_units_in_focus(), punit) {
1658 request_unit_return(punit);
1659 } unit_list_iterate_end;
1660}
1661
1662/************************************************************************/
1665 static void unit_explore_callback(GtkMenuItem *item, gpointer data)
1666{
1667 key_unit_auto_explore();
1668}
1669
1670/************************************************************************/
1673 static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
1674{
1675 key_unit_patrol();
1676}
1677
1678/************************************************************************/
1681 static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
1682{
1683 key_unit_sentry();
1684}
1685
1686/************************************************************************/
1689 static void unit_unsentry_callback(GtkMenuItem *item, gpointer data)
1690{
1691 key_unit_wakeup_others();
1692}
1693
1694/************************************************************************/
1697 static void unit_board_callback(GtkMenuItem *item, gpointer data)
1698{
1699 unit_list_iterate(get_units_in_focus(), punit) {
1700 request_transport(punit, unit_tile(punit));
1701 } unit_list_iterate_end;
1702}
1703
1704/************************************************************************/
1707 static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
1708{
1709 unit_list_iterate(get_units_in_focus(), punit) {
1710 request_unit_unload(punit);
1711 } unit_list_iterate_end;
1712}
1713
1714/************************************************************************/
1717 static void unit_unload_transporter_callback(GtkMenuItem *item,
1718 gpointer data)
1719{
1720 key_unit_unload_all();
1721}
1722
1723/************************************************************************/
1726 static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
1727{
1728 key_unit_homecity();
1729}
1730
1731/************************************************************************/
1734 static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
1735{
1736 popup_upgrade_dialog(get_units_in_focus());
1737}
1738
1739/************************************************************************/
1742 static void unit_convert_callback(GtkMenuItem *item, gpointer data)
1743{
1744 key_unit_convert();
1745}
1746
1747/************************************************************************/
1750 static void unit_disband_callback(GtkMenuItem *item, gpointer data)
1751{
1752 popup_disband_dialog(get_units_in_focus());
1753}
1754
1755/************************************************************************/
1758 static void build_city_callback(GtkMenuItem *item, gpointer data)
1759{
1760 unit_list_iterate(get_units_in_focus(), punit) {
1761 /* FIXME: this can provide different items for different units...
1762 * not good! */
1763 /* Enable the button for adding to a city in all cases, so we
1764 get an eventual error message from the server if we try. */
1765 if (unit_can_add_or_build_city(punit)) {
1766 request_unit_build_city(punit);
1767 } else if (utype_can_do_action(unit_type_get(punit),
1768 ACTION_HELP_WONDER)) {
1769 request_unit_caravan_action(punit, ACTION_HELP_WONDER);
1770 }
1771 } unit_list_iterate_end;
1772}
1773
1774/************************************************************************/
1777 static void auto_settle_callback(GtkMenuItem *action, gpointer data)
1778{
1779 key_unit_auto_settle();
1780}
1781
1782/************************************************************************/
1785 static void build_road_callback(GtkMenuItem *action, gpointer data)
1786{
1787 unit_list_iterate(get_units_in_focus(), punit) {
1788 /* FIXME: this can provide different actions for different units...
1789 * not good! */
1790 struct extra_type *tgt = next_extra_for_tile(unit_tile(punit),
1791 EC_ROAD,
1792 unit_owner(punit),
1793 punit);
1794 bool building_road = FALSE;
1795
1796 if (tgt != NULL
1797 && can_unit_do_activity_targeted_client(punit, ACTIVITY_GEN_ROAD, tgt)) {
1798 request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD, tgt);
1799 building_road = TRUE;
1800 }
1801
1802 if (!building_road && unit_can_est_trade_route_here(punit)) {
1803 request_unit_caravan_action(punit, ACTION_TRADE_ROUTE);
1804 }
1805 } unit_list_iterate_end;
1806}
1807
1808/************************************************************************/
1811 static void build_irrigation_callback(GtkMenuItem *action, gpointer data)
1812{
1813 key_unit_irrigate();
1814}
1815
1816/************************************************************************/
1819 static void cultivate_callback(GtkMenuItem *action, gpointer data)
1820{
1821 key_unit_cultivate();
1822}
1823
1824/************************************************************************/
1827 static void build_mine_callback(GtkMenuItem *action, gpointer data)
1828{
1829 key_unit_mine();
1830}
1831
1832/************************************************************************/
1835 static void plant_callback(GtkMenuItem *action, gpointer data)
1836{
1837 key_unit_plant();
1838}
1839
1840/************************************************************************/
1843 static void connect_road_callback(GtkMenuItem *action, gpointer data)
1844{
1845 struct road_type *proad = road_by_gui_type(ROAD_GUI_ROAD);
1846
1847 if (proad != NULL) {
1848 struct extra_type *tgt;
1849
1850 tgt = road_extra_get(proad);
1851
1852 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1853 }
1854}
1855
1856/************************************************************************/
1859 static void connect_rail_callback(GtkMenuItem *action, gpointer data)
1860{
1861 struct road_type *prail = road_by_gui_type(ROAD_GUI_RAILROAD);
1862
1863 if (prail != NULL) {
1864 struct extra_type *tgt;
1865
1866 tgt = road_extra_get(prail);
1867
1868 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1869 }
1870}
1871
1872/************************************************************************/
1875 static void connect_maglev_callback(GtkMenuItem *action, gpointer data)
1876{
1877 struct road_type *pmaglev = road_by_gui_type(ROAD_GUI_MAGLEV);
1878
1879 if (pmaglev != NULL) {
1880 struct extra_type *tgt;
1881
1882 tgt = road_extra_get(pmaglev);
1883
1884 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
1885 }
1886}
1887
1888/************************************************************************/
1891 static void connect_irrigation_callback(GtkMenuItem *action, gpointer data)
1892{
1893 struct extra_type_list *extras = extra_type_list_by_cause(EC_IRRIGATION);
1894
1895 if (extra_type_list_size(extras) > 0) {
1896 struct extra_type *pextra;
1897
1898 pextra = extra_type_list_get(extra_type_list_by_cause(EC_IRRIGATION), 0);
1899
1900 key_unit_connect(ACTIVITY_IRRIGATE, pextra);
1901 }
1902}
1903
1904/************************************************************************/
1907 static void transform_terrain_callback(GtkMenuItem *action, gpointer data)
1908{
1909 key_unit_transform();
1910}
1911
1912/************************************************************************/
1915 static void clean_nuisance_callback(GtkMenuItem *action, gpointer data)
1916{
1917 key_unit_clean();
1918}
1919
1920/************************************************************************/
1923 static void build_fortress_callback(GtkMenuItem *action, gpointer data)
1924{
1925 key_unit_fortress();
1926}
1927
1928/************************************************************************/
1931 static void fortify_callback(GtkMenuItem *action, gpointer data)
1932{
1933 unit_list_iterate(get_units_in_focus(), punit) {
1934 request_unit_fortify(punit);
1935 } unit_list_iterate_end;
1936}
1937
1938/************************************************************************/
1941 static void build_airbase_callback(GtkMenuItem *action, gpointer data)
1942{
1943 key_unit_airbase();
1944}
1945
1946/************************************************************************/
1949 static void do_paradrop_callback(GtkMenuItem *action, gpointer data)
1950{
1951 key_unit_paradrop();
1952}
1953
1954/************************************************************************/
1957 static void do_pillage_callback(GtkMenuItem *action, gpointer data)
1958{
1959 key_unit_pillage();
1960}
1961
1962/************************************************************************/
1965 static void diplomat_action_callback(GtkMenuItem *action, gpointer data)
1966{
1967 key_unit_action_select_tgt();
1968}
1969
1970/************************************************************************/
1973 static void tax_rate_callback(GtkMenuItem *action, gpointer data)
1974{
1975 popup_rates_dialog();
1976}
1977
1978/************************************************************************/
1981 static void multiplier_callback(GtkMenuItem *action, gpointer data)
1982{
1983 popup_multiplier_dialog();
1984}
1985
1986/************************************************************************/
1989 static void government_callback(GtkMenuItem *item, gpointer data)
1990{
1991 popup_revolution_dialog((struct government *) data);
1992}
1993
1994/************************************************************************/
1997 static void base_callback(GtkMenuItem *item, gpointer data)
1998{
1999 struct extra_type *pextra = data;
2000
2001 unit_list_iterate(get_units_in_focus(), punit) {
2002 request_new_unit_activity_targeted(punit, ACTIVITY_BASE, pextra);
2003 } unit_list_iterate_end;
2004}
2005
2006/************************************************************************/
2009 static void road_callback(GtkMenuItem *item, gpointer data)
2010{
2011 struct extra_type *pextra = data;
2012
2013 unit_list_iterate(get_units_in_focus(), punit) {
2014 request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD,
2015 pextra);
2016 } unit_list_iterate_end;
2017}
2018
2019/************************************************************************/
2022 static void clean_callback(GtkMenuItem *item, gpointer data)
2023{
2024 struct extra_type *pextra = data;
2025
2026 unit_list_iterate(get_units_in_focus(), punit) {
2027 if (can_unit_do_activity_targeted_client(punit, ACTIVITY_CLEAN, pextra)) {
2028 request_new_unit_activity_targeted(punit, ACTIVITY_CLEAN,
2029 pextra);
2030 }
2031 } unit_list_iterate_end;
2032}
2033
2034/************************************************************************/
2037 static void center_view_callback(GtkMenuItem *action, gpointer data)
2038{
2039 center_on_unit();
2040}
2041
2042/************************************************************************/
2045 static void report_units_callback(GtkMenuItem *action, gpointer data)
2046{
2047 units_report_dialog_popup(TRUE);
2048}
2049
2050/************************************************************************/
2053 static void report_cities_callback(GtkMenuItem *action, gpointer data)
2054{
2055 city_report_dialog_popup(TRUE);
2056}
2057
2058/************************************************************************/
2061 static void report_economy_callback(GtkMenuItem *action, gpointer data)
2062{
2063 economy_report_dialog_popup(TRUE);
2064}
2065
2066/************************************************************************/
2069 static void report_research_callback(GtkMenuItem *action, gpointer data)
2070{
2071 science_report_dialog_popup(TRUE);
2072}
2073
2074/************************************************************************/
2077 static void report_spaceship_callback(GtkMenuItem *action, gpointer data)
2078{
2079 if (NULL != client.conn.playing) {
2080 popup_spaceship_dialog(client.conn.playing);
2081 }
2082}
2083
2084/************************************************************************/
2087 static void menu_entry_init(GtkBuildable *item)
2088{
2089 const char *key = gtk_buildable_get_name(item);
2090 struct menu_entry_info *info = menu_entry_info_find(key);
2091
2092 if (info != NULL) {
2093 gtk_menu_item_set_label(GTK_MENU_ITEM(item),
2094 Q_(info->name));
2095 gtk_menu_item_set_use_underline(GTK_MENU_ITEM(item), TRUE);
2096 if (info->cb != NULL) {
2097 g_signal_connect(item, "activate", info->cb, NULL);
2098 }
2099
2100 if (info->accel != 0) {
2101 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
2102
2103 if (path == NULL) {
2104 char buf[512];
2105
2106 fc_snprintf(buf, sizeof(buf), "<MENU>/%s", key);
2107 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), buf);
2108 path = buf; /* Not NULL, but not usable either outside this block */
2109 }
2110
2111 if (path != NULL) {
2112 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item)),
2113 info->accel, info->accel_mod);
2114 }
2115 }
2116
2117 return;
2118 }
2119
2120 /* temporary naming solution */
2121 gtk_menu_item_set_label(GTK_MENU_ITEM(item), key);
2122}
2123
2124/************************************************************************/
2127 static const gchar *get_ui_filename(void)
2128{
2129 static char filename[256];
2130 const char *name;
2131
2132 if ((name = getenv("FREECIV_MENUS"))
2133 || (name = fileinfoname(get_data_dirs(), "gtk3.22_menus.xml"))) {
2134 sz_strlcpy(filename, name);
2135 } else {
2136 log_error("Gtk menus: file definition not found");
2137 filename[0] = '\0';
2138 }
2139
2140 log_verbose("ui menu file is \"%s\".", filename);
2141 return filename;
2142}
2143
2144/************************************************************************/
2147 GtkWidget *setup_menus(GtkWidget *window)
2148{
2149 GtkWidget *menubar = NULL;
2150 GError *error = NULL;
2151
2152 ui_builder = gtk_builder_new();
2153 if (!gtk_builder_add_from_file(ui_builder, get_ui_filename(), &error)) {
2154 log_error("Gtk menus: %s", error->message);
2155 g_error_free(error);
2156 } else {
2157 GSList *entries;
2158 GSList *next;
2159
2160 entries = gtk_builder_get_objects(ui_builder);
2161 next = entries;
2162
2163 while (next != NULL) {
2164 GObject *obj = next->data;
2165
2166 if (GTK_IS_MENU_ITEM(obj)) {
2167 if (!GTK_IS_SEPARATOR_MENU_ITEM(obj)) {
2168 menu_entry_init(GTK_BUILDABLE(obj));
2169 }
2170 } else if (GTK_IS_MENU(obj)) {
2171 const char *key = gtk_buildable_get_name(GTK_BUILDABLE(obj));
2172
2173 if (key[0] == '<') {
2174 GtkAccelGroup *ac_group = gtk_menu_get_accel_group(GTK_MENU(obj));
2175
2176 if (ac_group == NULL) {
2177 ac_group = gtk_accel_group_new();
2178 gtk_menu_set_accel_group(GTK_MENU(obj), ac_group);
2179 }
2180
2181 gtk_window_add_accel_group(GTK_WINDOW(window), ac_group);
2182
2183 gtk_menu_set_accel_path(GTK_MENU(obj), key);
2184 }
2185 }
2186
2187 next = next->next;
2188 }
2189
2190 g_slist_free(entries);
2191
2192 menubar = GTK_WIDGET(gtk_builder_get_object(ui_builder, "MENU"));
2193 gtk_widget_set_visible(menubar, TRUE);
2194 gtk_widget_show_all(menubar);
2195 }
2196
2197#ifndef FREECIV_DEBUG
2198 menu_entry_set_visible("RELOAD_TILESET", FALSE, FALSE);
2199#endif /* FREECIV_DEBUG */
2200
2201 return menubar;
2202}
2203
2204/************************************************************************/
2207 static struct menu_entry_info *menu_entry_info_find(const char *key)
2208{
2209 int i;
2210
2211 for (i = 0; menu_entries[i].key != NULL; i++) {
2212 if (!strcmp(key, menu_entries[i].key)) {
2213 return &(menu_entries[i]);
2214 }
2215 }
2216
2217 return NULL;
2218}
2219
2220/************************************************************************/
2223 static void menu_entry_set_active(const char *key,
2224 gboolean is_active)
2225{
2226 GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(ui_builder, key));
2227
2228 if (item != NULL) {
2229 gtk_check_menu_item_set_active(item, is_active);
2230 }
2231}
2232
2233/************************************************************************/
2236 static void menu_entry_set_sensitive(const char *key,
2237 gboolean is_sensitive)
2238{
2239 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2240
2241 if (item != NULL) {
2242 gtk_widget_set_sensitive(item, is_sensitive);
2243 }
2244}
2245
2246/************************************************************************/
2249 static void menu_entry_group_set_sensitive(enum menu_entry_grouping group,
2250 gboolean is_sensitive)
2251{
2252 int i;
2253
2254 for (i = 0; menu_entries[i].key != NULL; i++) {
2255 if (menu_entries[i].grouping == group || group == MGROUP_ALL) {
2256 menu_entry_set_sensitive(menu_entries[i].key, is_sensitive);
2257 }
2258 }
2259}
2260
2261/************************************************************************/
2264#ifndef FREECIV_DEBUG
2265 static void menu_entry_set_visible(const char *key,
2266 gboolean is_visible,
2267 gboolean is_sensitive)
2268{
2269 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2270
2271 if (item != NULL) {
2272 gtk_widget_set_visible(item, is_visible);
2273 gtk_widget_set_sensitive(item, is_sensitive);
2274 }
2275}
2276#endif /* FREECIV_DEBUG */
2277
2278/************************************************************************/
2281 static void menus_rename(const char *key,
2282 const gchar *new_label)
2283{
2284 GtkWidget *item = GTK_WIDGET(gtk_builder_get_object(ui_builder, key));
2285
2286 if (item != NULL) {
2287 gtk_menu_item_set_label(GTK_MENU_ITEM(item), new_label);
2288 }
2289}
2290
2291/************************************************************************/
2294 static GtkMenu *find_menu(const char *key)
2295{
2296 return GTK_MENU(gtk_builder_get_object(ui_builder, key));
2297}
2298
2299/************************************************************************/
2302 static void view_menu_update_sensitivity(void)
2303{
2304 /* The "full" city bar (i.e. the new way of drawing the
2305 * city name), can draw the city growth even without drawing
2306 * the city name. But the old method cannot. */
2307 if (gui_options.draw_full_citybar) {
2308 menu_entry_set_sensitive("SHOW_CITY_GROWTH", TRUE);
2309 menu_entry_set_sensitive("SHOW_CITY_TRADE_ROUTES", TRUE);
2310 } else {
2311 menu_entry_set_sensitive("SHOW_CITY_GROWTH", gui_options.draw_city_names);
2312 menu_entry_set_sensitive("SHOW_CITY_TRADE_ROUTES",
2313 gui_options.draw_city_names);
2314 }
2315
2316 menu_entry_set_sensitive("SHOW_CITY_BUY_COST",
2317 gui_options.draw_city_productions);
2318 menu_entry_set_sensitive("SHOW_COASTLINE", !gui_options.draw_terrain);
2319 menu_entry_set_sensitive("SHOW_UNIT_SOLID_BG",
2320 gui_options.draw_units || gui_options.draw_focus_unit);
2321 menu_entry_set_sensitive("SHOW_UNIT_SHIELDS",
2322 gui_options.draw_units || gui_options.draw_focus_unit);
2323 menu_entry_set_sensitive("SHOW_STACK_SIZE",
2324 gui_options.draw_units || gui_options.draw_focus_unit);
2325 menu_entry_set_sensitive("SHOW_FOCUS_UNIT", !gui_options.draw_units);
2326}
2327
2328/************************************************************************/
2334 static const char *get_tile_change_menu_text(struct tile *ptile,
2335 enum unit_activity activity)
2336{
2337 struct tile *newtile = tile_virtual_new(ptile);
2338 const char *text;
2339
2340 tile_apply_activity(newtile, activity, NULL);
2341 text = tile_get_info_text(newtile, FALSE, 0);
2342 tile_virtual_destroy(newtile);
2343 return text;
2344}
2345
2346/************************************************************************/
2349 void real_menus_update(void)
2350{
2351 struct unit_list *punits = NULL;
2352 bool units_all_same_tile = TRUE, units_all_same_type = TRUE;
2353 GtkMenu *menu;
2354 char acttext[128], irrtext[128], mintext[128], transtext[128];
2355 char cultext[128], plantext[128];
2356 struct terrain *pterrain;
2357 bool conn_possible;
2358 struct road_type *proad;
2359 struct extra_type_list *extras;
2360
2361 if (ui_builder == NULL || !can_client_change_view()) {
2362 return;
2363 }
2364
2365 if (get_num_units_in_focus() > 0) {
2366 const struct tile *ptile = NULL;
2367 const struct unit_type *ptype = NULL;
2368
2369 punits = get_units_in_focus();
2370 unit_list_iterate(punits, punit) {
2371 fc_assert((ptile == NULL) == (ptype == NULL));
2372
2373 if (ptile || ptype) {
2374 if (unit_tile(punit) != ptile) {
2375 units_all_same_tile = FALSE;
2376 }
2377 if (unit_type_get(punit) != ptype) {
2378 units_all_same_type = FALSE;
2379 }
2380 } else {
2381 ptile = unit_tile(punit);
2382 ptype = unit_type_get(punit);
2383 }
2384 } unit_list_iterate_end;
2385 }
2386
2387 menu_entry_group_set_sensitive(MGROUP_EDIT, editor_is_active());
2388 menu_entry_group_set_sensitive(MGROUP_PLAYING, can_client_issue_orders()
2389 && !editor_is_active());
2390 menu_entry_group_set_sensitive(MGROUP_UNIT, can_client_issue_orders()
2391 && !editor_is_active() && punits != NULL);
2392
2393 menu_entry_set_active("EDIT_MODE", game.info.is_edit_mode);
2394 menu_entry_set_sensitive("EDIT_MODE",
2395 can_conn_enable_editing(&client.conn));
2396 editgui_refresh();
2397 menu_entry_set_sensitive("RALLY_DLG", can_client_issue_orders());
2398 menu_entry_set_sensitive("INFRA_DLG", terrain_control.infrapoints);
2399
2400 {
2401 char road_buf[500];
2402
2403 proad = road_by_gui_type(ROAD_GUI_ROAD);
2404 if (proad != NULL) {
2405 /* TRANS: Connect with some road type (Road/Railroad) */
2406 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2407 extra_name_translation(road_extra_get(proad)));
2408 menus_rename("CONNECT_ROAD", road_buf);
2409 }
2410
2411 proad = road_by_gui_type(ROAD_GUI_RAILROAD);
2412 if (proad != NULL) {
2413 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2414 extra_name_translation(road_extra_get(proad)));
2415 menus_rename("CONNECT_RAIL", road_buf);
2416 }
2417
2418 proad = road_by_gui_type(ROAD_GUI_MAGLEV);
2419 if (proad != NULL) {
2420 snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
2421 extra_name_translation(road_extra_get(proad)));
2422 menus_rename("CONNECT_MAGLEV", road_buf);
2423 }
2424 }
2425
2426 {
2427 char top_cities_buf[128];
2428
2429 if (game.info.top_cities_count > 0) {
2430 fc_snprintf(top_cities_buf, sizeof(top_cities_buf),
2431 PL_("Top %d City", "Top %d Cities",
2432 game.info.top_cities_count),
2433 game.info.top_cities_count);
2434 menus_rename("REPORT_TOP_CITIES", top_cities_buf);
2435 } else {
2436 menus_rename("REPORT_TOP_CITIES", _("Top Cities"));
2437 }
2438
2439 menu_entry_set_sensitive("REPORT_TOP_CITIES", game.info.top_cities_count > 0);
2440 }
2441
2442 if (!can_client_issue_orders()) {
2443 return;
2444 }
2445
2446 /* Set government sensitivity. */
2447 if ((menu = find_menu("<MENU>/GOVERNMENT"))) {
2448 GList *list, *iter;
2449 struct government *pgov;
2450
2451 list = gtk_container_get_children(GTK_CONTAINER(menu));
2452 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2453 pgov = g_object_get_data(G_OBJECT(iter->data), "government");
2454 if (NULL != pgov) {
2455 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2456 can_change_to_government(client_player(),
2457 pgov));
2458 } else {
2459 /* Revolution without target government */
2460 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2461 untargeted_revolution_allowed());
2462 }
2463 }
2464 g_list_free(list);
2465 }
2466
2467 if (!punits) {
2468 return;
2469 }
2470
2471 /* Remaining part of this function: Update Unit, Work, and Combat menus */
2472
2473 /* Set base sensitivity. */
2474 if ((menu = find_menu("<MENU>/BUILD_BASE"))) {
2475 GList *list, *iter;
2476 struct extra_type *pextra;
2477
2478 list = gtk_container_get_children(GTK_CONTAINER(menu));
2479 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2480 pextra = g_object_get_data(G_OBJECT(iter->data), "base");
2481 if (NULL != pextra) {
2482 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2483 can_units_do_activity_targeted_client(punits,
2484 ACTIVITY_BASE,
2485 pextra));
2486 }
2487 }
2488 g_list_free(list);
2489 }
2490
2491 /* Set road sensitivity. */
2492 if ((menu = find_menu("<MENU>/BUILD_PATH"))) {
2493 GList *list, *iter;
2494 struct extra_type *pextra;
2495
2496 list = gtk_container_get_children(GTK_CONTAINER(menu));
2497 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2498 pextra = g_object_get_data(G_OBJECT(iter->data), "road");
2499 if (NULL != pextra) {
2500 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2501 can_units_do_activity_targeted_client(punits,
2502 ACTIVITY_GEN_ROAD,
2503 pextra));
2504 }
2505 }
2506 g_list_free(list);
2507 }
2508
2509 /* Set cleaning menu sensitivity. */
2510 if ((menu = find_menu("<MENU>/CLEAN"))) {
2511 GList *list, *iter;
2512 struct extra_type *pextra;
2513
2514 list = gtk_container_get_children(GTK_CONTAINER(menu));
2515 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2516 pextra = g_object_get_data(G_OBJECT(iter->data), "nuisance");
2517 if (NULL != pextra) {
2518 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2519 can_units_do_activity_targeted_client(punits,
2520 ACTIVITY_CLEAN,
2521 pextra));
2522 }
2523 }
2524 g_list_free(list);
2525 }
2526
2527 /* Set Go to and... action visibility. */
2528 if ((menu = find_menu("<MENU>/GOTO_AND"))) {
2529 GList *list, *iter;
2530 struct action *paction;
2531
2532 bool can_do_something = FALSE;
2533
2534 /* Enable a menu item if it is theoretically possible that one of the
2535 * selected units can perform it. Checking if the action can be performed
2536 * at the current tile is pointless since it should be performed at the
2537 * target tile. */
2538 list = gtk_container_get_children(GTK_CONTAINER(menu));
2539 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2540 paction = g_object_get_data(G_OBJECT(iter->data), "end_action");
2541 if (NULL != paction) {
2542 if (units_can_do_action(get_units_in_focus(),
2543 paction->id, TRUE)) {
2544 gtk_widget_set_visible(GTK_WIDGET(iter->data), TRUE);
2545 gtk_widget_set_sensitive(GTK_WIDGET(iter->data), TRUE);
2546 can_do_something = TRUE;
2547 } else {
2548 gtk_widget_set_visible(GTK_WIDGET(iter->data), FALSE);
2549 gtk_widget_set_sensitive(GTK_WIDGET(iter->data), FALSE);
2550 }
2551 }
2552 }
2553 g_list_free(list);
2554
2555 /* Only sensitive if an action may be possible. */
2556 menu_entry_set_sensitive("MENU_GOTO_AND", can_do_something);
2557 }
2558
2559 /* Enable the button for adding to a city in all cases, so we
2560 * get an eventual error message from the server if we try. */
2561 menu_entry_set_sensitive("BUILD_CITY",
2562 (can_units_do(punits, unit_can_add_or_build_city)
2563 || can_units_do(punits, unit_can_help_build_wonder_here)));
2564 menu_entry_set_sensitive("BUILD_ROAD",
2565 (can_units_do_any_road(&(wld.map), punits)
2566 || can_units_do(punits,
2567 unit_can_est_trade_route_here)));
2568 menu_entry_set_sensitive("BUILD_IRRIGATION",
2569 can_units_do_activity_client(punits, ACTIVITY_IRRIGATE));
2570 menu_entry_set_sensitive("CULTIVATE",
2571 can_units_do_activity_client(punits, ACTIVITY_CULTIVATE));
2572 menu_entry_set_sensitive("BUILD_MINE",
2573 can_units_do_activity_client(punits, ACTIVITY_MINE));
2574 menu_entry_set_sensitive("PLANT",
2575 can_units_do_activity_client(punits, ACTIVITY_PLANT));
2576 menu_entry_set_sensitive("TRANSFORM_TERRAIN",
2577 can_units_do_activity_client(punits, ACTIVITY_TRANSFORM));
2578 menu_entry_set_sensitive("FORTIFY",
2579 can_units_do_activity_client(punits,
2580 ACTIVITY_FORTIFYING));
2581 menu_entry_set_sensitive("BUILD_FORTRESS",
2582 can_units_do_base_gui(punits, BASE_GUI_FORTRESS));
2583 menu_entry_set_sensitive("BUILD_AIRBASE",
2584 can_units_do_base_gui(punits, BASE_GUI_AIRBASE));
2585 menu_entry_set_sensitive("CLEAN",
2586 can_units_do_activity_client(punits, ACTIVITY_CLEAN));
2587 menu_entry_set_sensitive("UNIT_SENTRY",
2588 can_units_do_activity_client(punits, ACTIVITY_SENTRY));
2589 menu_entry_set_sensitive("DO_PARADROP",
2590 can_units_do_on_map(&(wld.map), punits, can_unit_paradrop));
2591 /* FIXME: should conditionally rename "Pillage" to "Pillage..." in cases
2592 * where selecting the command results in a dialog box listing options of
2593 * what to pillage */
2594 menu_entry_set_sensitive("DO_PILLAGE",
2595 can_units_do_activity_client(punits, ACTIVITY_PILLAGE));
2596 menu_entry_set_sensitive("UNIT_DISBAND",
2597 units_can_do_action(punits, ACTION_DISBAND_UNIT,
2598 TRUE));
2599 menu_entry_set_sensitive("UNIT_UPGRADE",
2600 units_can_upgrade(&(wld.map), punits));
2601 /* "UNIT_CONVERT" dealt with below */
2602 menu_entry_set_sensitive("UNIT_HOMECITY",
2603 can_units_do(punits, can_unit_change_homecity));
2604 menu_entry_set_sensitive("UNIT_UNLOAD_TRANSPORTER",
2605 units_are_occupied(punits));
2606 menu_entry_set_sensitive("UNIT_BOARD",
2607 units_can_load(punits));
2608 menu_entry_set_sensitive("UNIT_DEBOARD",
2609 units_can_unload(punits));
2610 menu_entry_set_sensitive("UNIT_UNSENTRY",
2611 units_have_activity_on_tile(punits,
2612 ACTIVITY_SENTRY));
2613 menu_entry_set_sensitive("AUTO_SETTLER",
2614 can_units_do(punits, can_unit_do_autosettlers));
2615 menu_entry_set_sensitive("UNIT_EXPLORE",
2616 can_units_do_activity_client(punits, ACTIVITY_EXPLORE));
2617
2618 proad = road_by_gui_type(ROAD_GUI_ROAD);
2619 if (proad != NULL) {
2620 struct extra_type *tgt;
2621
2622 tgt = road_extra_get(proad);
2623
2624 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2625 } else {
2626 conn_possible = FALSE;
2627 }
2628 menu_entry_set_sensitive("CONNECT_ROAD", conn_possible);
2629
2630 proad = road_by_gui_type(ROAD_GUI_RAILROAD);
2631 if (proad != NULL) {
2632 struct extra_type *tgt;
2633
2634 tgt = road_extra_get(proad);
2635
2636 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2637 } else {
2638 conn_possible = FALSE;
2639 }
2640 menu_entry_set_sensitive("CONNECT_RAIL", conn_possible);
2641
2642 proad = road_by_gui_type(ROAD_GUI_MAGLEV);
2643 if (proad != NULL) {
2644 struct extra_type *tgt;
2645
2646 tgt = road_extra_get(proad);
2647
2648 conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
2649 } else {
2650 conn_possible = FALSE;
2651 }
2652 menu_entry_set_sensitive("CONNECT_MAGLEV", conn_possible);
2653
2654 extras = extra_type_list_by_cause(EC_IRRIGATION);
2655
2656 if (extra_type_list_size(extras) > 0) {
2657 struct extra_type *tgt;
2658
2659 tgt = extra_type_list_get(extras, 0);
2660 conn_possible = can_units_do_connect(punits, ACTIVITY_IRRIGATE, tgt);
2661 } else {
2662 conn_possible = FALSE;
2663 }
2664 menu_entry_set_sensitive("CONNECT_IRRIGATION", conn_possible);
2665
2666 menu_entry_set_sensitive("DIPLOMAT_ACTION",
2667 units_can_do_action(punits, ACTION_ANY, TRUE));
2668
2669 if (units_can_do_action(punits, ACTION_HELP_WONDER, TRUE)) {
2670 menus_rename("BUILD_CITY",
2671 action_get_ui_name_mnemonic(ACTION_HELP_WONDER, "_"));
2672 } else {
2673 bool city_on_tile = FALSE;
2674
2675 /* FIXME: this overloading doesn't work well with multiple focus
2676 * units. */
2677 unit_list_iterate(punits, punit) {
2678 if (tile_city(unit_tile(punit))) {
2679 city_on_tile = TRUE;
2680 break;
2681 }
2682 } unit_list_iterate_end;
2683
2684 if (city_on_tile && units_can_do_action(punits, ACTION_JOIN_CITY,
2685 TRUE)) {
2686 menus_rename("BUILD_CITY",
2687 action_get_ui_name_mnemonic(ACTION_JOIN_CITY, "_"));
2688 } else {
2689 /* refresh default order */
2690 menus_rename("BUILD_CITY",
2691 action_get_ui_name_mnemonic(ACTION_FOUND_CITY, "_"));
2692 }
2693 }
2694
2695 if (units_can_do_action(punits, ACTION_TRADE_ROUTE, TRUE)) {
2696 menus_rename("BUILD_ROAD",
2697 action_get_ui_name_mnemonic(ACTION_TRADE_ROUTE, "_"));
2698 } else if (units_have_type_flag(punits, UTYF_SETTLERS, TRUE)) {
2699 char road_item[500];
2700 struct extra_type *pextra = NULL;
2701
2702 /* FIXME: this overloading doesn't work well with multiple focus
2703 * units. */
2704 unit_list_iterate(punits, punit) {
2705 pextra = next_extra_for_tile(unit_tile(punit), EC_ROAD,
2706 unit_owner(punit), punit);
2707 if (pextra != NULL) {
2708 break;
2709 }
2710 } unit_list_iterate_end;
2711
2712 if (pextra != NULL) {
2713 /* TRANS: Build road of specific type (Road/Railroad/Maglev) */
2714 snprintf(road_item, sizeof(road_item), _("Build %s"),
2715 extra_name_translation(pextra));
2716 menus_rename("BUILD_ROAD", road_item);
2717 }
2718 } else {
2719 menus_rename("BUILD_ROAD", _("Build _Road"));
2720 }
2721
2722 if (units_all_same_type) {
2723 struct unit *punit = unit_list_get(punits, 0);
2724 const struct unit_type *to_unittype =
2725 can_upgrade_unittype(client_player(), unit_type_get(punit));
2726 if (to_unittype) {
2727 /* TRANS: %s is a unit type. */
2728 fc_snprintf(acttext, sizeof(acttext), _("Upgr_ade to %s"),
2729 utype_name_translation(
2730 can_upgrade_unittype(client_player(),
2731 unit_type_get(punit))));
2732 } else {
2733 acttext[0] = '\0';
2734 }
2735 } else {
2736 acttext[0] = '\0';
2737 }
2738 if ('\0' != acttext[0]) {
2739 menus_rename("UNIT_UPGRADE", acttext);
2740 } else {
2741 menus_rename("UNIT_UPGRADE", _("Upgr_ade"));
2742 }
2743
2744 if (units_can_convert(&(wld.map), punits)) {
2745 menu_entry_set_sensitive("UNIT_CONVERT", TRUE);
2746 if (units_all_same_type) {
2747 struct unit *punit = unit_list_get(punits, 0);
2748
2749 /* TRANS: %s is a unit type. */
2750 fc_snprintf(acttext, sizeof(acttext), _("C_onvert to %s"),
2751 utype_name_translation(unit_type_get(punit)->converted_to));
2752 } else {
2753 acttext[0] = '\0';
2754 }
2755 } else {
2756 menu_entry_set_sensitive("UNIT_CONVERT", FALSE);
2757 acttext[0] = '\0';
2758 }
2759 if ('\0' != acttext[0]) {
2760 menus_rename("UNIT_CONVERT", acttext);
2761 } else {
2762 menus_rename("UNIT_CONVERT", _("C_onvert"));
2763 }
2764
2765 if (units_all_same_tile) {
2766 struct unit *first = unit_list_get(punits, 0);
2767
2768 pterrain = tile_terrain(unit_tile(first));
2769
2770 if (units_have_type_flag(punits, UTYF_SETTLERS, TRUE)) {
2771 struct extra_type *pextra = NULL;
2772
2773 /* FIXME: this overloading doesn't work well with multiple focus
2774 * units. */
2775 unit_list_iterate(punits, punit) {
2776 pextra = next_extra_for_tile(unit_tile(punit), EC_IRRIGATION,
2777 unit_owner(punit), punit);
2778 if (pextra != NULL) {
2779 break;
2780 }
2781 } unit_list_iterate_end;
2782
2783 if (pextra != NULL) {
2784 /* TRANS: Build irrigation of specific type */
2785 snprintf(irrtext, sizeof(irrtext), _("Build %s"),
2786 extra_name_translation(pextra));
2787 } else {
2788 sz_strlcpy(irrtext, _("Build _Irrigation"));
2789 }
2790 } else {
2791 sz_strlcpy(irrtext, _("Build _Irrigation"));
2792 }
2793
2794 if (pterrain->cultivate_result != T_NONE) {
2795 fc_snprintf(cultext, sizeof(cultext), _("Change to %s"),
2796 get_tile_change_menu_text(unit_tile(first),
2797 ACTIVITY_CULTIVATE));
2798 } else {
2799 sz_strlcpy(cultext, _("_Cultivate"));
2800 }
2801
2802 if (units_have_type_flag(punits, UTYF_SETTLERS, TRUE)) {
2803 struct extra_type *pextra = NULL;
2804
2805 /* FIXME: this overloading doesn't work well with multiple focus
2806 * units. */
2807 unit_list_iterate(punits, punit) {
2808 pextra = next_extra_for_tile(unit_tile(punit), EC_MINE,
2809 unit_owner(punit), punit);
2810 if (pextra != NULL) {
2811 break;
2812 }
2813 } unit_list_iterate_end;
2814
2815 if (pextra != NULL) {
2816 /* TRANS: Build mine of specific type */
2817 snprintf(mintext, sizeof(mintext), _("Build %s"),
2818 extra_name_translation(pextra));
2819 } else {
2820 sz_strlcpy(mintext, _("Build _Mine"));
2821 }
2822 } else {
2823 sz_strlcpy(mintext, _("Build _Mine"));
2824 }
2825
2826 if (pterrain->plant_result != T_NONE) {
2827 fc_snprintf(plantext, sizeof(plantext), _("Change to %s"),
2828 get_tile_change_menu_text(unit_tile(first), ACTIVITY_PLANT));
2829 } else {
2830 sz_strlcpy(plantext, _("_Plant"));
2831 }
2832
2833 if (pterrain->transform_result != T_NONE
2834 && pterrain->transform_result != pterrain) {
2835 fc_snprintf(transtext, sizeof(transtext), _("Transf_orm to %s"),
2836 get_tile_change_menu_text(unit_tile(first),
2837 ACTIVITY_TRANSFORM));
2838 } else {
2839 sz_strlcpy(transtext, _("Transf_orm Terrain"));
2840 }
2841 } else {
2842 sz_strlcpy(irrtext, _("Build _Irrigation"));
2843 sz_strlcpy(cultext, _("_Cultivate"));
2844 sz_strlcpy(mintext, _("Build _Mine"));
2845 sz_strlcpy(plantext, _("_Plant"));
2846 sz_strlcpy(transtext, _("Transf_orm Terrain"));
2847 }
2848
2849 menus_rename("BUILD_IRRIGATION", irrtext);
2850 menus_rename("CULTIVATE", cultext);
2851 menus_rename("BUILD_MINE", mintext);
2852 menus_rename("PLANT", plantext);
2853 menus_rename("TRANSFORM_TERRAIN", transtext);
2854
2855 menus_rename("UNIT_HOMECITY",
2856 action_get_ui_name_mnemonic(ACTION_HOME_CITY, "_"));
2857}
2858
2859/************************************************************************/
2862 static void menu_unit_goto_and_add_accel(GtkWidget *item, action_id act_id,
2863 const guint accel_key,
2864 const GdkModifierType accel_mods)
2865{
2866 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item));
2867
2868 if (path == NULL) {
2869 char buf[MAX_LEN_NAME + strlen("<MENU>/GOTO_AND/")];
2870
2871 fc_snprintf(buf, sizeof(buf), "<MENU>/GOTO_AND/%s",
2872 action_id_rule_name(act_id));
2873 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), buf);
2874 path = buf; /* Not NULL, but not usable either outside this block */
2875 }
2876
2877 if (path != NULL) {
2878 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(item)),
2879 accel_key, accel_mods);
2880 }
2881}
2882
2883/************************************************************************/
2886 static void menu_remove_previous_entries(GtkMenu *menu)
2887{
2888 GList *list, *iter;
2889 GtkWidget *sub_menu;
2890
2891 list = gtk_container_get_children(GTK_CONTAINER(menu));
2892 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2893 if ((sub_menu = gtk_menu_item_get_submenu(iter->data)) != NULL) {
2894 menu_remove_previous_entries(GTK_MENU(sub_menu));
2895 gtk_widget_destroy(sub_menu);
2896 }
2897 gtk_widget_destroy(GTK_WIDGET(iter->data));
2898 }
2899 g_list_free(list);
2900}
2901
2902/************************************************************************/
2906 void real_menus_init(void)
2907{
2908 GtkMenu *menu;
2909
2910 if (ui_builder == NULL) {
2911 return;
2912 }
2913
2914 menu_entry_set_sensitive("GAME_SAVE_AS",
2915 can_client_access_hack()
2916 && C_S_RUNNING <= client_state());
2917 menu_entry_set_sensitive("GAME_SAVE",
2918 can_client_access_hack()
2919 && C_S_RUNNING <= client_state());
2920
2921 menu_entry_set_active("SAVE_OPTIONS_ON_EXIT",
2922 gui_options.save_options_on_exit);
2923 menu_entry_set_sensitive("SERVER_OPTIONS", client.conn.established);
2924
2925 menu_entry_set_sensitive("LEAVE",
2926 client.conn.established);
2927
2928 if (!can_client_change_view()) {
2929 menu_entry_group_set_sensitive(MGROUP_ALL, FALSE);
2930
2931 return;
2932 }
2933
2934 menus_rename("BUILD_FORTRESS", Q_(terrain_control.gui_type_base0));
2935 menus_rename("BUILD_AIRBASE", Q_(terrain_control.gui_type_base1));
2936
2937 if ((menu = find_menu("<MENU>/GOVERNMENT"))) {
2938 GList *list, *iter;
2939 GtkWidget *item;
2940 char buf[256];
2941
2942 /* Remove previous government entries. */
2943 list = gtk_container_get_children(GTK_CONTAINER(menu));
2944 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2945 if (g_object_get_data(G_OBJECT(iter->data), "government") != NULL
2946 || GTK_IS_SEPARATOR_MENU_ITEM(iter->data)) {
2947 gtk_widget_destroy(GTK_WIDGET(iter->data));
2948 }
2949 }
2950 g_list_free(list);
2951
2952 /* Add new government entries. */
2953 item = gtk_separator_menu_item_new();
2954 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2955 gtk_widget_show(item);
2956
2957 governments_iterate(g) {
2958 if (g != game.government_during_revolution) {
2959 /* TRANS: %s is a government name */
2960 fc_snprintf(buf, sizeof(buf), _("%s..."),
2961 government_name_translation(g));
2962 item = gtk_menu_item_new_with_label(buf);
2963 g_object_set_data(G_OBJECT(item), "government", g);
2964 g_signal_connect(item, "activate",
2965 G_CALLBACK(government_callback), g);
2966 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2967 gtk_widget_show(item);
2968 }
2969 } governments_iterate_end;
2970 }
2971
2972 if ((menu = find_menu("<MENU>/BUILD_BASE"))) {
2973 GList *list, *iter;
2974 GtkWidget *item;
2975
2976 /* Remove previous base entries. */
2977 list = gtk_container_get_children(GTK_CONTAINER(menu));
2978 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
2979 gtk_widget_destroy(GTK_WIDGET(iter->data));
2980 }
2981 g_list_free(list);
2982
2983 /* Add new base entries. */
2984 extra_type_by_cause_iterate(EC_BASE, pextra) {
2985 if (pextra->buildable) {
2986 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
2987 g_object_set_data(G_OBJECT(item), "base", pextra);
2988 g_signal_connect(item, "activate", G_CALLBACK(base_callback), pextra);
2989 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
2990 gtk_widget_show(item);
2991 }
2992 } extra_type_by_cause_iterate_end;
2993 }
2994
2995 if ((menu = find_menu("<MENU>/BUILD_PATH"))) {
2996 GList *list, *iter;
2997 GtkWidget *item;
2998
2999 /* Remove previous road entries. */
3000 list = gtk_container_get_children(GTK_CONTAINER(menu));
3001 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
3002 gtk_widget_destroy(GTK_WIDGET(iter->data));
3003 }
3004 g_list_free(list);
3005
3006 /* Add new road entries. */
3007 extra_type_by_cause_iterate(EC_ROAD, pextra) {
3008 if (pextra->buildable) {
3009 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
3010 g_object_set_data(G_OBJECT(item), "road", pextra);
3011 g_signal_connect(item, "activate", G_CALLBACK(road_callback), pextra);
3012 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3013 gtk_widget_show(item);
3014 }
3015 } extra_type_by_cause_iterate_end;
3016 }
3017
3018 if ((menu = find_menu("<MENU>/CLEAN"))) {
3019 GList *list, *iter;
3020 GtkWidget *item;
3021
3022 /* Remove previous cleaning entries. */
3023 list = gtk_container_get_children(GTK_CONTAINER(menu));
3024 for (iter = list; NULL != iter; iter = g_list_next(iter)) {
3025 gtk_widget_destroy(GTK_WIDGET(iter->data));
3026 }
3027 g_list_free(list);
3028
3029 /* Add new cleaning entries. */
3030 extra_type_by_rmcause_iterate(ERM_CLEAN, pextra) {
3031 item = gtk_menu_item_new_with_label(extra_name_translation(pextra));
3032 g_object_set_data(G_OBJECT(item), "nuisance", pextra);
3033 g_signal_connect(item, "activate", G_CALLBACK(clean_callback), pextra);
3034 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3035 gtk_widget_show(item);
3036 } extra_type_by_rmcause_iterate_end;
3037 }
3038
3039 /* Initialize the Go to and... actions. */
3040 if ((menu = find_menu("<MENU>/GOTO_AND"))) {
3041 GtkWidget *item;
3042 int tgt_kind_group;
3043
3044 /* Remove previous action entries. */
3045 menu_remove_previous_entries(menu);
3046
3047 /* Add the new action entries grouped by target kind. */
3048 for (tgt_kind_group = 0; tgt_kind_group < ATK_COUNT; tgt_kind_group++) {
3049 action_iterate(act_id) {
3050 struct action *paction = action_by_number(act_id);
3051
3052 if (action_id_get_actor_kind(act_id) != AAK_UNIT) {
3053 /* This action isn't performed by a unit. */
3054 continue;
3055 }
3056
3057 if (action_id_get_target_kind(act_id) != tgt_kind_group) {
3058 /* Wrong group. */
3059 continue;
3060 }
3061
3062 /* Create and add the menu item. It will be hidden or shown based on
3063 * unit type. */
3064 item = gtk_menu_item_new_with_mnemonic(
3065 action_get_ui_name_mnemonic(act_id, "_"));
3066 g_object_set_data(G_OBJECT(item), "end_action", paction);
3067
3068 if (action_id_has_complex_target(act_id)) {
3069 GtkWidget *sub_target_menu = gtk_menu_new();
3070
3071#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
3072 GtkWidget *sub_item = gtk_menu_item_new_with_label(_sub_target_name_); \
3073 g_object_set_data(G_OBJECT(sub_item), "end_action", paction); \
3074 g_object_set_data(G_OBJECT(sub_item), _sub_target_key_, _sub_target_); \
3075 g_signal_connect(sub_item, "activate", \
3076 G_CALLBACK(unit_goto_and_callback), paction); \
3077 gtk_menu_shell_append(GTK_MENU_SHELL(sub_target_menu), sub_item); \
3078 gtk_widget_show(sub_item);
3079
3080 switch (action_get_sub_target_kind(paction)) {
3081 case ASTK_BUILDING:
3082 improvement_iterate(pimpr) {
3083 CREATE_SUB_ITEM(pimpr, "end_building",
3084 improvement_name_translation(pimpr));
3085 } improvement_iterate_end;
3086 break;
3087 case ASTK_TECH:
3088 advance_iterate(ptech) {
3089 CREATE_SUB_ITEM(ptech, "end_tech",
3090 advance_name_translation(ptech));
3091 } advance_iterate_end;
3092 break;
3093 case ASTK_EXTRA:
3094 case ASTK_EXTRA_NOT_THERE:
3095 extra_type_iterate(pextra) {
3096 if (!actres_creates_extra(paction->result, pextra)
3097 && !actres_removes_extra(paction->result, pextra)) {
3098 /* Not relevant */
3099 continue;
3100 }
3101 CREATE_SUB_ITEM(pextra, "end_extra",
3102 extra_name_translation(pextra));
3103 } extra_type_iterate_end;
3104 break;
3105 case ASTK_NONE:
3106 /* Should not be here. */
3107 fc_assert(action_get_sub_target_kind(paction) != ASTK_NONE);
3108 break;
3109 case ASTK_COUNT:
3110 /* Should not exits */
3111 fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
3112 break;
3113 }
3114
3115#undef CREATE_SUB_ITEM
3116
3117 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), sub_target_menu);
3118 } else {
3119 g_signal_connect(item, "activate",
3120 G_CALLBACK(unit_goto_and_callback), paction);
3121
3122#define ADD_OLD_ACCELERATOR(wanted_action_id, accel_key, accel_mods) \
3123 if (act_id == wanted_action_id) { \
3124 menu_unit_goto_and_add_accel(item, act_id, accel_key, accel_mods); \
3125 }
3126
3127 /* Add the keyboard shortcuts for "Go to and..." menu items that
3128 * existed independently before the "Go to and..." menu arrived.
3129 */
3130 ADD_OLD_ACCELERATOR(ACTION_FOUND_CITY, GDK_KEY_b, GDK_SHIFT_MASK);
3131 ADD_OLD_ACCELERATOR(ACTION_JOIN_CITY, GDK_KEY_j, GDK_SHIFT_MASK);
3132 ADD_OLD_ACCELERATOR(ACTION_NUKE, GDK_KEY_n, GDK_SHIFT_MASK);
3133 }
3134
3135 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
3136 gtk_widget_show(item);
3137 } action_iterate_end;
3138 }
3139 }
3140
3141 menu_entry_group_set_sensitive(MGROUP_SAFE, TRUE);
3142 menu_entry_group_set_sensitive(MGROUP_PLAYER, client_has_player());
3143
3144 menu_entry_set_sensitive("TAX_RATE",
3145 game.info.changable_tax
3146 && can_client_issue_orders());
3147 menu_entry_set_sensitive("POLICIES",
3148 multiplier_count() > 0);
3149
3150 menu_entry_set_active("SHOW_CITY_OUTLINES",
3151 gui_options.draw_city_outlines);
3152 menu_entry_set_active("SHOW_CITY_OUTPUT",
3153 gui_options.draw_city_output);
3154 menu_entry_set_active("SHOW_MAP_GRID",
3155 gui_options.draw_map_grid);
3156 menu_entry_set_active("SHOW_NATIONAL_BORDERS",
3157 gui_options.draw_borders);
3158 menu_entry_set_sensitive("SHOW_NATIONAL_BORDERS",
3159 BORDERS_DISABLED != game.info.borders);
3160 menu_entry_set_active("SHOW_NATIVE_TILES",
3161 gui_options.draw_native);
3162 menu_entry_set_active("SHOW_CITY_FULL_BAR",
3163 gui_options.draw_full_citybar);
3164 menu_entry_set_active("SHOW_CITY_NAMES",
3165 gui_options.draw_city_names);
3166 menu_entry_set_active("SHOW_CITY_GROWTH",
3167 gui_options.draw_city_growth);
3168 menu_entry_set_active("SHOW_CITY_PRODUCTIONS",
3169 gui_options.draw_city_productions);
3170 menu_entry_set_active("SHOW_CITY_BUY_COST",
3171 gui_options.draw_city_buycost);
3172 menu_entry_set_active("SHOW_CITY_TRADE_ROUTES",
3173 gui_options.draw_city_trade_routes);
3174 menu_entry_set_active("SHOW_TERRAIN",
3175 gui_options.draw_terrain);
3176 menu_entry_set_active("SHOW_COASTLINE",
3177 gui_options.draw_coastline);
3178 menu_entry_set_active("SHOW_PATHS",
3179 gui_options.draw_paths);
3180 menu_entry_set_active("SHOW_IRRIGATION",
3181 gui_options.draw_irrigation);
3182 menu_entry_set_active("SHOW_MINES",
3183 gui_options.draw_mines);
3184 menu_entry_set_active("SHOW_BASES",
3185 gui_options.draw_fortress_airbase);
3186 menu_entry_set_active("SHOW_RESOURCES",
3187 gui_options.draw_specials);
3188 menu_entry_set_active("SHOW_HUTS",
3189 gui_options.draw_huts);
3190 menu_entry_set_active("SHOW_POLLUTION",
3191 gui_options.draw_pollution);
3192 menu_entry_set_active("SHOW_CITIES",
3193 gui_options.draw_cities);
3194 menu_entry_set_active("SHOW_UNITS",
3195 gui_options.draw_units);
3196 menu_entry_set_active("SHOW_UNIT_SOLID_BG",
3197 gui_options.solid_color_behind_units);
3198 menu_entry_set_active("SHOW_UNIT_SHIELDS",
3199 gui_options.draw_unit_shields);
3200 menu_entry_set_active("SHOW_STACK_SIZE",
3201 gui_options.draw_unit_stack_size);
3202 menu_entry_set_active("SHOW_FOCUS_UNIT",
3203 gui_options.draw_focus_unit);
3204 menu_entry_set_active("SHOW_FOG_OF_WAR",
3205 gui_options.draw_fog_of_war);
3206
3207 view_menu_update_sensitivity();
3208
3209 menu_entry_set_active("FULL_SCREEN", GUI_GTK_OPTION(fullscreen));
3210}
3211
3212/**************************************************************************
3213 Free resources allocated by the menu system.
3214**************************************************************************/
3215 void menus_free(void)
3216{
3217 if (ui_builder != NULL) {
3218 g_object_unref(ui_builder);
3219 ui_builder = NULL;
3220 }
3221}
action_id_rule_name
const char * action_id_rule_name(action_id act_id)
Definition actions.c:1991
action_get_sub_target_kind
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Definition actions.c:1871
action_get_ui_name_mnemonic
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
Definition actions.c:2010
action_by_number
static struct action * action_by_number(action_id act_id)
Definition actions.h:633
action_iterate_end
#define action_iterate_end
Definition actions.h:463
action_id_get_actor_kind
#define action_id_get_actor_kind(act_id)
Definition actions.h:646
action_iterate
#define action_iterate(_act_)
Definition actions.h:459
ACTION_ANY
#define ACTION_ANY
Definition actions.h:306
action_id_get_target_kind
#define action_id_get_target_kind(act_id)
Definition actions.h:650
action_id_has_complex_target
#define action_id_has_complex_target(act_id)
Definition actions.h:668
actres_removes_extra
bool actres_removes_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:806
actres_creates_extra
bool actres_creates_extra(enum action_result result, const struct extra_type *pextra)
Definition actres.c:785
entries
struct @126::my_agent entries[MAX_AGENTS]
client
struct civclient client
Definition client_main.c:150
client_state
enum client_states client_state(void)
Definition client_main.c:1026
send_report_request
void send_report_request(enum report_type type)
Definition client_main.c:836
can_client_issue_orders
bool can_client_issue_orders(void)
Definition client_main.c:1264
client_has_player
bool client_has_player(void)
Definition client_main.c:1364
can_client_change_view
bool can_client_change_view(void)
Definition client_main.c:1312
client_main.h
client_player
#define client_player()
Definition client_main.h:106
C_S_RUNNING
@ C_S_RUNNING
Definition client_main.h:47
can_units_do_connect
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
Definition climisc.c:1230
list
static struct fc_sockaddr_list * list
Definition clinet.c:102
disconnect_from_server
void disconnect_from_server(bool leaving_sound)
Definition clinet.c:306
clinet.h
incite_cost
char * incite_cost
Definition comments.c:74
REPORT_WONDERS_OF_THE_WORLD
@ REPORT_WONDERS_OF_THE_WORLD
Definition conn_types.h:50
REPORT_DEMOGRAPHIC
@ REPORT_DEMOGRAPHIC
Definition conn_types.h:53
REPORT_ACHIEVEMENTS
@ REPORT_ACHIEVEMENTS
Definition conn_types.h:54
REPORT_TOP_CITIES
@ REPORT_TOP_CITIES
Definition conn_types.h:52
send_save_game
void send_save_game(const char *filename)
Definition connectdlg_common.c:743
is_server_running
bool is_server_running(void)
Definition connectdlg_common.c:124
can_client_access_hack
bool can_client_access_hack(void)
Definition connectdlg_common.c:141
connectdlg_common.h
can_conn_enable_editing
bool can_conn_enable_editing(const struct connection *pconn)
Definition connection.c:521
key_coastline_toggle
void key_coastline_toggle(void)
Definition control.c:3923
key_irrigation_toggle
void key_irrigation_toggle(void)
Definition control.c:3939
key_unit_sentry
void key_unit_sentry(void)
Definition control.c:3727
key_city_output_toggle
void key_city_output_toggle(void)
Definition control.c:3824
request_unit_return
void request_unit_return(struct unit *punit)
Definition control.c:1526
request_unit_fortify
void request_unit_fortify(struct unit *punit)
Definition control.c:2324
key_editor_recalculate_borders
void key_editor_recalculate_borders(void)
Definition control.c:4043
request_unit_caravan_action
void request_unit_caravan_action(struct unit *punit, action_id action)
Definition control.c:2194
key_focus_unit_toggle
void key_focus_unit_toggle(void)
Definition control.c:4019
key_unit_auto_explore
void key_unit_auto_explore(void)
Definition control.c:3548
key_unit_auto_settle
void key_unit_auto_settle(void)
Definition control.c:3561
key_unit_connect
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
Definition control.c:3346
key_city_full_bar_toggle
void key_city_full_bar_toggle(void)
Definition control.c:3856
key_bases_toggle
void key_bases_toggle(void)
Definition control.c:3955
key_map_native_toggle
void key_map_native_toggle(void)
Definition control.c:3848
key_resources_toggle
void key_resources_toggle(void)
Definition control.c:3963
request_unit_goto
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
Definition control.c:1104
key_unit_paradrop
void key_unit_paradrop(void)
Definition control.c:3450
get_units_in_focus
struct unit_list * get_units_in_focus(void)
Definition control.c:177
key_unit_shields_toggle
void key_unit_shields_toggle(void)
Definition control.c:4011
key_city_productions_toggle
void key_city_productions_toggle(void)
Definition control.c:3890
key_unit_plant
void key_unit_plant(void)
Definition control.c:3667
key_unit_fortress
void key_unit_fortress(void)
Definition control.c:3595
key_unit_mine
void key_unit_mine(void)
Definition control.c:3659
key_unit_pillage
void key_unit_pillage(void)
Definition control.c:3679
request_unit_unload
void request_unit_unload(struct unit *pcargo)
Definition control.c:2165
key_editor_toggle_fogofwar
void key_editor_toggle_fogofwar(void)
Definition control.c:4052
request_new_unit_activity_targeted
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
Definition control.c:1912
key_unit_irrigate
void key_unit_irrigate(void)
Definition control.c:3639
request_unit_build_city
void request_unit_build_city(struct unit *punit)
Definition control.c:1791
key_unit_unload_all
void key_unit_unload_all(void)
Definition control.c:3488
key_cities_toggle
void key_cities_toggle(void)
Definition control.c:3987
key_city_outlines_toggle
void key_city_outlines_toggle(void)
Definition control.c:3816
key_unit_homecity
void key_unit_homecity(void)
Definition control.c:3612
key_unit_patrol
void key_unit_patrol(void)
Definition control.c:3458
key_unit_solid_bg_toggle
void key_unit_solid_bg_toggle(void)
Definition control.c:4003
key_terrain_toggle
void key_terrain_toggle(void)
Definition control.c:3915
key_paths_toggle
void key_paths_toggle(void)
Definition control.c:3931
key_unit_wakeup_others
void key_unit_wakeup_others(void)
Definition control.c:3521
key_unit_stack_size_toggle
void key_unit_stack_size_toggle(void)
Definition control.c:3907
key_huts_toggle
void key_huts_toggle(void)
Definition control.c:3971
key_fog_of_war_toggle
void key_fog_of_war_toggle(void)
Definition control.c:4027
key_unit_wait
void key_unit_wait(void)
Definition control.c:3513
key_units_toggle
void key_units_toggle(void)
Definition control.c:3995
key_unit_select_battlegroup
void key_unit_select_battlegroup(int battlegroup, bool append)
Definition control.c:3790
key_map_grid_toggle
void key_map_grid_toggle(void)
Definition control.c:3832
key_pollution_toggle
void key_pollution_toggle(void)
Definition control.c:3979
key_city_growth_toggle
void key_city_growth_toggle(void)
Definition control.c:3873
key_unit_action_select_tgt
void key_unit_action_select_tgt(void)
Definition control.c:3377
key_city_buycost_toggle
void key_city_buycost_toggle(void)
Definition control.c:3882
get_num_units_in_focus
int get_num_units_in_focus(void)
Definition control.c:185
key_unit_transform
void key_unit_transform(void)
Definition control.c:3739
key_unit_done
void key_unit_done(void)
Definition control.c:3434
key_city_trade_routes_toggle
void key_city_trade_routes_toggle(void)
Definition control.c:3899
key_city_names_toggle
void key_city_names_toggle(void)
Definition control.c:3864
request_unit_select
void request_unit_select(struct unit_list *punits, enum unit_select_type_mode seltype, enum unit_select_location_mode selloc)
Definition control.c:1595
key_unit_airbase
void key_unit_airbase(void)
Definition control.c:3531
key_unit_goto
void key_unit_goto(void)
Definition control.c:3442
key_unit_convert
void key_unit_convert(void)
Definition control.c:3573
key_unit_clean
void key_unit_clean(void)
Definition control.c:3691
key_editor_toggle
void key_editor_toggle(void)
Definition control.c:4035
key_unit_assign_battlegroup
void key_unit_assign_battlegroup(int battlegroup, bool append)
Definition control.c:3751
key_unit_cultivate
void key_unit_cultivate(void)
Definition control.c:3647
key_mines_toggle
void key_mines_toggle(void)
Definition control.c:3947
key_map_borders_toggle
void key_map_borders_toggle(void)
Definition control.c:3840
control.h
can_unit_do_activity_targeted_client
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
Definition control.h:43
can_units_do_activity_targeted_client
#define can_units_do_activity_targeted_client(_punits_, _act_, _tgt_)
Definition control.h:47
can_units_do_activity_client
#define can_units_do_activity_client(_punits_, _act_)
Definition control.h:45
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
editor_is_active
bool editor_is_active(void)
Definition editor.c:346
OBJTYPE_GAME
@ OBJTYPE_GAME
Definition editor.h:31
next_extra_for_tile
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
extra_number
int extra_number(const struct extra_type *pextra)
Definition extras.c:161
extra_type_list_by_cause
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Definition extras.c:249
extras
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
extra_name_translation
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:194
extra_type_iterate
#define extra_type_iterate(_p)
Definition extras.h:315
extra_type_iterate_end
#define extra_type_iterate_end
Definition extras.h:321
extra_type_by_rmcause_iterate_end
#define extra_type_by_rmcause_iterate_end
Definition extras.h:358
extra_type_by_rmcause_iterate
#define extra_type_by_rmcause_iterate(_rmcause, _extra)
Definition extras.h:353
extra_type_by_cause_iterate_end
#define extra_type_by_cause_iterate_end
Definition extras.h:339
extra_type_by_cause_iterate
#define extra_type_by_cause_iterate(_cause, _extra)
Definition extras.h:333
NO_TARGET
#define NO_TARGET
Definition fc_types.h:357
action_id
int action_id
Definition fc_types.h:392
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
BORDERS_DISABLED
@ BORDERS_DISABLED
Definition fc_types.h:1038
fcintl.h
Q_
#define Q_(String)
Definition fcintl.h:70
PL_
#define PL_(String1, String2, n)
Definition fcintl.h:71
_
#define _(String)
Definition fcintl.h:67
N_
#define N_(String)
Definition fcintl.h:69
game
struct civ_game game
Definition game.c:62
wld
struct world wld
Definition game.c:63
game.h
government_name_translation
const char * government_name_translation(const struct government *pgovern)
Definition government.c:143
untargeted_revolution_allowed
bool untargeted_revolution_allowed(void)
Definition government.c:565
can_change_to_government
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Definition government.c:166
government.h
governments_iterate
#define governments_iterate(NAME_pgov)
Definition government.h:120
governments_iterate_end
#define governments_iterate_end
Definition government.h:123
log_output_window
void log_output_window(void)
Definition chatline.c:928
clear_output_window
void clear_output_window(void)
Definition chatline.c:943
city_report_dialog_popup
void city_report_dialog_popup(bool raise)
Definition cityrep.c:292
unit_select_dialog_popup
void unit_select_dialog_popup(struct tile *ptile)
Definition dialogs.c:377
popup_upgrade_dialog
void popup_upgrade_dialog(struct unit_list *punits)
Definition dialogs.c:1435
popup_disband_dialog
void popup_disband_dialog(struct unit_list *punits)
Definition dialogs.c:1473
editgui_refresh
void editgui_refresh(void)
Definition editgui.c:1796
property_editor_popup
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6250
editprop_get_property_editor
struct property_editor * editprop_get_property_editor(void)
Definition editprop.c:6203
property_editor_reload
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
Definition editprop.c:6340
popup_find_dialog
void popup_find_dialog(void)
Definition finddlg.c:58
popup_multiplier_dialog
void popup_multiplier_dialog(void)
Definition gamedlgs.c:383
popup_rates_dialog
void popup_rates_dialog(void)
Definition gamedlgs.c:533
popup_goto_dialog
void popup_goto_dialog(void)
Definition gotodlg.c:258
fullscreen_opt_refresh
void fullscreen_opt_refresh(struct option *poption)
Definition gui_main.c:2455
map_canvas_focus
gboolean map_canvas_focus(void)
Definition gui_main.c:382
toplevel
GtkWidget * toplevel
Definition gui_main.c:125
popup_quit_dialog
void popup_quit_dialog(void)
Definition gui_main.c:2371
GUI_GTK_OPTION
#define GUI_GTK_OPTION(optname)
Definition gui_main.h:25
setup_dialog
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
popup_help_dialog_string
void popup_help_dialog_string(const char *item)
Definition helpdlg.c:212
infra_dialog_popup
void infra_dialog_popup(void)
Definition infradlg.c:85
luaconsole_dialog_popup
void luaconsole_dialog_popup(bool raise)
Definition luaconsole.c:126
center_on_unit
void center_on_unit(void)
Definition mapctrl.c:496
save_mapimg_callback
static void save_mapimg_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:697
show_national_borders_callback
static void show_national_borders_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1203
show_focus_unit_callback
static void show_focus_unit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1439
setup_menus
GtkWidget * setup_menus(GtkWidget *window)
Definition menu.c:2147
auto_settle_callback
static void auto_settle_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1777
help_connecting_callback
static void help_connecting_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:853
menus_rename
static void menus_rename(const char *key, const gchar *new_label)
Definition menu.c:2281
help_combat_callback
static void help_combat_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1061
menu_entry_group_set_sensitive
static void menu_entry_group_set_sensitive(enum menu_entry_grouping group, gboolean is_sensitive)
Definition menu.c:2249
help_ruleset_callback
static void help_ruleset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1005
select_single_callback
static void select_single_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1509
unit_unload_transporter_callback
static void unit_unload_transporter_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1717
bg_assign1_callback
static void bg_assign1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:925
bg_append3_callback
static void bg_append3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:981
help_government_callback
static void help_government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1101
report_achievements_callback
static void report_achievements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:829
show_fog_of_war_callback
static void show_fog_of_war_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1450
help_zoc_callback
static void help_zoc_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1069
show_city_productions_callback
static void show_city_productions_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1260
do_pillage_callback
static void do_pillage_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1957
bg_select0_callback
static void bg_select0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:893
menu_remove_previous_entries
static void menu_remove_previous_entries(GtkMenu *menu)
Definition menu.c:2886
client_lua_script_callback
static void client_lua_script_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:813
bg_select2_callback
static void bg_select2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:941
show_city_names_callback
static void show_city_names_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1237
help_space_race_callback
static void help_space_race_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1117
help_tileset_callback
static void help_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1013
help_playing_callback
static void help_playing_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:997
plant_callback
static void plant_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1835
menu_entries
static struct menu_entry_info menu_entries[]
Definition menu.c:267
base_callback
static void base_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1997
help_economy_callback
static void help_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1029
clean_nuisance_callback
static void clean_nuisance_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1915
unit_sentry_callback
static void unit_sentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1681
center_view_callback
static void center_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2037
unit_explore_callback
static void unit_explore_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1665
build_mine_callback
static void build_mine_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1827
quit_callback
static void quit_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:749
unit_return_callback
static void unit_return_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1655
ui_builder
static GtkBuilder * ui_builder
Definition menu.c:77
show_city_trade_routes_callback
static void show_city_trade_routes_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1283
transform_terrain_callback
static void transform_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1907
help_wonders_callback
static void help_wonders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1093
find_menu
static GtkMenu * find_menu(const char *key)
Definition menu.c:2294
show_terrain_callback
static void show_terrain_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1294
show_city_growth_callback
static void show_city_growth_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1249
show_stack_size_callback
static void show_stack_size_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1428
get_ui_filename
static const gchar * get_ui_filename(void)
Definition menu.c:2127
multiplier_callback
static void multiplier_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1981
help_terrain_callback
static void help_terrain_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1085
save_game_callback
static void save_game_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:681
show_unit_solid_bg_callback
static void show_unit_solid_bg_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1406
show_coastline_callback
static void show_coastline_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1305
toggle_fog_callback
static void toggle_fog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1481
show_city_full_bar_callback
static void show_city_full_bar_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1225
edit_mode_callback
static void edit_mode_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1158
help_chatline_callback
static void help_chatline_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:869
show_paths_callback
static void show_paths_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1315
menus_free
void menus_free(void)
Definition menu.c:3215
connect_road_callback
static void connect_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1843
bg_append2_callback
static void bg_append2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:957
help_overview_callback
static void help_overview_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:989
save_game_as_callback
static void save_game_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:689
help_diplomacy_callback
static void help_diplomacy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1109
show_units_callback
static void show_units_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1395
show_irrigation_callback
static void show_irrigation_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1325
show_map_grid_callback
static void show_map_grid_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1192
help_improvements_callback
static void help_improvements_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1045
bg_append1_callback
static void bg_append1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:933
recalc_borders_callback
static void recalc_borders_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1473
find_city_callback
static void find_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:757
report_nations_callback
static void report_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:781
report_demographic_callback
static void report_demographic_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:821
help_worklist_editor_callback
static void help_worklist_editor_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:877
help_cities_callback
static void help_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1037
leave_local_game_response
static void leave_local_game_response(GtkWidget *dialog, gint response)
Definition menu.c:714
help_language_callback
static void help_language_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:837
show_mine_callback
static void show_mine_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1335
server_options_callback
static void server_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:657
bg_append0_callback
static void bg_append0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:909
leave_callback
static void leave_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:729
select_same_type_cont_callback
static void select_same_type_cont_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1533
unit_convert_callback
static void unit_convert_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1742
select_dialog_callback
static void select_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1549
show_huts_callback
static void show_huts_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1365
report_wow_callback
static void report_wow_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:789
menu_entry_set_active
static void menu_entry_set_active(const char *key, gboolean is_active)
Definition menu.c:2223
unit_upgrade_callback
static void unit_upgrade_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1734
menu_unit_goto_and_add_accel
static void menu_unit_goto_and_add_accel(GtkWidget *item, action_id act_id, const guint accel_key, const GdkModifierType accel_mods)
Definition menu.c:2862
help_tech_callback
static void help_tech_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1077
unit_goto_callback
static void unit_goto_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1589
clean_callback
static void clean_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2022
build_city_callback
static void build_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1758
bg_select3_callback
static void bg_select3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:965
unit_patrol_callback
static void unit_patrol_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1673
real_menus_init
void real_menus_init(void)
Definition menu.c:2906
menu_entry_grouping
menu_entry_grouping
Definition menu.c:91
MGROUP_ALL
@ MGROUP_ALL
Definition menu.c:92
MGROUP_PLAYING
@ MGROUP_PLAYING
Definition menu.c:91
MGROUP_PLAYER
@ MGROUP_PLAYER
Definition menu.c:92
MGROUP_SAFE
@ MGROUP_SAFE
Definition menu.c:91
MGROUP_EDIT
@ MGROUP_EDIT
Definition menu.c:91
MGROUP_UNIT
@ MGROUP_UNIT
Definition menu.c:92
rally_dialog_callback
static void rally_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1557
help_about_callback
static void help_about_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1141
bg_assign0_callback
static void bg_assign0_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:901
build_road_callback
static void build_road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1785
local_options_callback
static void local_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:641
show_cities_callback
static void show_cities_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1385
unit_homecity_callback
static void unit_homecity_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1726
menu_entry_set_sensitive
static void menu_entry_set_sensitive(const char *key, gboolean is_sensitive)
Definition menu.c:2236
show_pollution_callback
static void show_pollution_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1375
save_options_callback
static void save_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:665
save_mapimg_as_callback
static void save_mapimg_as_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:705
worklists_callback
static void worklists_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:765
connect_maglev_callback
static void connect_maglev_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1875
full_screen_callback
static void full_screen_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1461
report_top_cities_callback
static void report_top_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:797
help_controls_callback
static void help_controls_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:861
select_same_type_callback
static void select_same_type_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1541
connect_rail_callback
static void connect_rail_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1859
unit_wait_callback
static void unit_wait_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1573
get_tile_change_menu_text
static const char * get_tile_change_menu_text(struct tile *ptile, enum unit_activity activity)
Definition menu.c:2334
build_airbase_callback
static void build_airbase_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1941
report_cities_callback
static void report_cities_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2053
help_cma_callback
static void help_cma_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:885
infra_dialog_callback
static void infra_dialog_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1565
message_options_callback
static void message_options_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:649
tax_rate_callback
static void tax_rate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1973
help_musicset_callback
static void help_musicset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1021
unit_goto_city_callback
static void unit_goto_city_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1645
menu_entry_info_find
static struct menu_entry_info * menu_entry_info_find(const char *key)
Definition menu.c:2207
bg_select1_callback
static void bg_select1_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:917
government_callback
static void government_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1989
report_economy_callback
static void report_economy_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2061
report_messages_callback
static void report_messages_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:805
do_paradrop_callback
static void do_paradrop_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1949
show_bases_callback
static void show_bases_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1345
select_same_type_tile_callback
static void select_same_type_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1525
unit_unsentry_callback
static void unit_unsentry_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1689
save_options_on_exit_callback
static void save_options_on_exit_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1149
show_native_tiles_callback
static void show_native_tiles_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1214
menu_entry_init
static void menu_entry_init(GtkBuildable *item)
Definition menu.c:2087
show_unit_shields_callback
static void show_unit_shields_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1417
reload_tileset_callback
static void reload_tileset_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:673
scenario_properties_callback
static void scenario_properties_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1489
clear_chat_logs_callback
static void clear_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:625
unit_deboard_callback
static void unit_deboard_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1707
help_policies_callback
static void help_policies_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:845
unit_done_callback
static void unit_done_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1581
help_nations_callback
static void help_nations_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1125
unit_goto_and_callback
static void unit_goto_and_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1597
show_city_output_callback
static void show_city_output_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1181
show_city_outlines_callback
static void show_city_outlines_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1170
save_scenario_callback
static void save_scenario_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1501
ADD_OLD_ACCELERATOR
#define ADD_OLD_ACCELERATOR(wanted_action_id, accel_key, accel_mods)
help_copying_callback
static void help_copying_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1133
cultivate_callback
static void cultivate_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1819
save_chat_logs_callback
static void save_chat_logs_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:633
real_menus_update
void real_menus_update(void)
Definition menu.c:2349
report_spaceship_callback
static void report_spaceship_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2077
select_all_on_tile_callback
static void select_all_on_tile_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1517
show_city_buy_cost_callback
static void show_city_buy_cost_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1272
build_fortress_callback
static void build_fortress_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1923
CREATE_SUB_ITEM
#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_)
view_menu_update_sensitivity
static void view_menu_update_sensitivity(void)
Definition menu.c:2302
unit_board_callback
static void unit_board_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1697
menu_entry_set_visible
static void menu_entry_set_visible(const char *key, gboolean is_visible, gboolean is_sensitive)
Definition menu.c:2265
fortify_callback
static void fortify_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1931
bg_assign3_callback
static void bg_assign3_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:973
show_resources_callback
static void show_resources_callback(GtkCheckMenuItem *item, gpointer data)
Definition menu.c:1355
connect_irrigation_callback
static void connect_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1891
build_irrigation_callback
static void build_irrigation_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1811
bg_assign2_callback
static void bg_assign2_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:949
report_units_callback
static void report_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2045
road_callback
static void road_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2009
unit_disband_callback
static void unit_disband_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1750
help_units_callback
static void help_units_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1053
report_research_callback
static void report_research_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:2069
diplomat_action_callback
static void diplomat_action_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:1965
map_view_callback
static void map_view_callback(GtkMenuItem *item, gpointer data)
Definition menu.c:773
popup_messageopt_dialog
void popup_messageopt_dialog(void)
Definition messagedlg.c:51
meswin_dialog_popup
void meswin_dialog_popup(bool raise)
Definition messagewin.c:417
option_dialog_popup
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:972
save_mapimg_dialog_popup
void save_mapimg_dialog_popup(void)
Definition pages.c:3535
mapimg_client_save
void mapimg_client_save(const char *filename)
Definition pages.c:3554
save_game_dialog_popup
void save_game_dialog_popup(void)
Definition pages.c:3471
save_scenario_dialog_popup
void save_scenario_dialog_popup(void)
Definition pages.c:3506
popup_players_dialog
void popup_players_dialog(bool raise)
Definition plrdlg.c:91
rally_dialog_popup
void rally_dialog_popup(void)
Definition rallypointdlg.c:66
science_report_dialog_popup
void science_report_dialog_popup(bool raise)
Definition repodlgs.c:716
economy_report_dialog_popup
void economy_report_dialog_popup(bool raise)
Definition repodlgs.c:1243
units_report_dialog_popup
void units_report_dialog_popup(bool raise)
Definition repodlgs.c:1768
science_report_dialog_popdown
void science_report_dialog_popdown(void)
Definition repodlgs.c:740
popup_spaceship_dialog
void popup_spaceship_dialog(struct player *pplayer)
Definition spaceshipdlg.c:146
request_transport
bool request_transport(struct unit *cargo, struct tile *ptile)
Definition transportdlg.c:82
popup_worklists_report
void popup_worklists_report(void)
Definition wldlg.c:287
editgui.h
editprop.h
gamedlgs.h
gui_stuff.h
infradlg.h
menu_entry_grouping
menu_entry_grouping
Definition menu.c:80
rallypointdlg.h
unitselect.h
chatline.h
cityrep.h
popup_revolution_dialog
void popup_revolution_dialog(void)
Definition dialogs.c:112
dialogs.h
finddlg.h
gotodlg.h
gui_main.h
helpdlg.h
luaconsole.h
mapctrl.h
menu.h
messagedlg.h
messagewin.h
optiondlg.h
pages.h
plrdlg.h
ratesdlg.h
repodlgs.h
spaceshipdlg.h
sprite.h
wldlg.h
HELP_MUSICSET_ITEM
#define HELP_MUSICSET_ITEM
HELP_CITIES_ITEM
#define HELP_CITIES_ITEM
HELP_TERRAIN_ITEM
#define HELP_TERRAIN_ITEM
HELP_LANGUAGES_ITEM
#define HELP_LANGUAGES_ITEM
HELP_CONNECTING_ITEM
#define HELP_CONNECTING_ITEM
HELP_TILESET_ITEM
#define HELP_TILESET_ITEM
HELP_CHATLINE_ITEM
#define HELP_CHATLINE_ITEM
HELP_RULESET_ITEM
#define HELP_RULESET_ITEM
HELP_GOVERNMENT_ITEM
#define HELP_GOVERNMENT_ITEM
HELP_ABOUT_ITEM
#define HELP_ABOUT_ITEM
HELP_MULTIPLIER_ITEM
#define HELP_MULTIPLIER_ITEM
HELP_PLAYING_ITEM
#define HELP_PLAYING_ITEM
HELP_IMPROVEMENTS_ITEM
#define HELP_IMPROVEMENTS_ITEM
HELP_UNITS_ITEM
#define HELP_UNITS_ITEM
HELP_ZOC_ITEM
#define HELP_ZOC_ITEM
HELP_WORKLIST_EDITOR_ITEM
#define HELP_WORKLIST_EDITOR_ITEM
HELP_WONDERS_ITEM
#define HELP_WONDERS_ITEM
HELP_COMBAT_ITEM
#define HELP_COMBAT_ITEM
HELP_SPACE_RACE_ITEM
#define HELP_SPACE_RACE_ITEM
HELP_COPYING_ITEM
#define HELP_COPYING_ITEM
HELP_OVERVIEW_ITEM
#define HELP_OVERVIEW_ITEM
HELP_NATIONS_ITEM
#define HELP_NATIONS_ITEM
HELP_TECHS_ITEM
#define HELP_TECHS_ITEM
HELP_DIPLOMACY_ITEM
#define HELP_DIPLOMACY_ITEM
HELP_ECONOMY_ITEM
#define HELP_ECONOMY_ITEM
HELP_CMA_ITEM
#define HELP_CMA_ITEM
HELP_CONTROLS_ITEM
#define HELP_CONTROLS_ITEM
improvement_number
Impr_type_id improvement_number(const struct impr_type *pimprove)
Definition improvement.c:184
improvement_name_translation
const char * improvement_name_translation(const struct impr_type *pimprove)
Definition improvement.c:243
improvement_iterate_end
#define improvement_iterate_end
Definition improvement.h:205
improvement_iterate
#define improvement_iterate(_p)
Definition improvement.h:199
name
const char * name
Definition inputfile.c:127
log.h
fc_assert_ret
#define fc_assert_ret(condition)
Definition log.h:191
log_verbose
#define log_verbose(message,...)
Definition log.h:109
fc_assert
#define fc_assert(condition)
Definition log.h:176
log_error
#define log_error(message,...)
Definition log.h:103
terrain_control
struct terrain_misc terrain_control
Definition map.c:69
mapview_common.h
multiplier_count
Multiplier_type_id multiplier_count(void)
Definition multipliers.c:88
server_optset
const struct option_set * server_optset
Definition options.c:4019
client_optset
const struct option_set * client_optset
Definition options.c:1279
options_save
void options_save(option_save_log_callback log_cb)
Definition options.c:6090
gui_options
struct client_options gui_options
Definition options.c:71
options.h
road_extra_get
struct extra_type * road_extra_get(const struct road_type *proad)
Definition road.c:42
road_by_gui_type
struct road_type * road_by_gui_type(enum road_gui_type gui_type)
Definition road.c:180
road.h
grouping
static char * grouping
Definition shared.c:98
fileinfoname
const char * fileinfoname(const struct strvec *dirs, const char *filename)
Definition shared.c:1101
get_data_dirs
const struct strvec * get_data_dirs(void)
Definition shared.c:893
shared.h
action
Definition actions.h:360
advance
Definition tech.h:124
civ_game::info
struct packet_game_info info
Definition game.h:89
civ_game::government_during_revolution
struct government * government_during_revolution
Definition game.h:94
civclient::conn
struct connection conn
Definition client_main.h:96
client_options::draw_native
bool draw_native
Definition options.h:215
client_options::draw_specials
bool draw_specials
Definition options.h:207
client_options::draw_city_output
bool draw_city_output
Definition options.h:194
client_options::draw_city_names
bool draw_city_names
Definition options.h:196
client_options::draw_city_productions
bool draw_city_productions
Definition options.h:198
client_options::draw_mines
bool draw_mines
Definition options.h:205
client_options::draw_borders
bool draw_borders
Definition options.h:214
client_options::draw_fortress_airbase
bool draw_fortress_airbase
Definition options.h:206
client_options::draw_city_buycost
bool draw_city_buycost
Definition options.h:199
client_options::draw_unit_stack_size
bool draw_unit_stack_size
Definition options.h:218
client_options::draw_irrigation
bool draw_irrigation
Definition options.h:204
client_options::draw_terrain
bool draw_terrain
Definition options.h:201
client_options::draw_units
bool draw_units
Definition options.h:211
client_options::draw_fog_of_war
bool draw_fog_of_war
Definition options.h:213
client_options::draw_city_trade_routes
bool draw_city_trade_routes
Definition options.h:200
client_options::draw_unit_shields
bool draw_unit_shields
Definition options.h:217
client_options::draw_cities
bool draw_cities
Definition options.h:210
client_options::save_options_on_exit
bool save_options_on_exit
Definition options.h:125
client_options::draw_map_grid
bool draw_map_grid
Definition options.h:195
client_options::draw_city_growth
bool draw_city_growth
Definition options.h:197
client_options::draw_huts
bool draw_huts
Definition options.h:208
client_options::draw_focus_unit
bool draw_focus_unit
Definition options.h:212
client_options::draw_paths
bool draw_paths
Definition options.h:203
client_options::draw_city_outlines
bool draw_city_outlines
Definition options.h:193
client_options::draw_coastline
bool draw_coastline
Definition options.h:202
client_options::draw_full_citybar
bool draw_full_citybar
Definition options.h:216
client_options::draw_pollution
bool draw_pollution
Definition options.h:209
client_options::solid_color_behind_units
bool solid_color_behind_units
Definition options.h:149
connection::established
bool established
Definition connection.h:140
connection::playing
struct player * playing
Definition connection.h:151
connection::used
bool used
Definition connection.h:139
extra_type
Definition extras.h:88
extra_type::data
struct extra_type::@25 data
government
Definition government.h:52
impr_type
Definition improvement.h:50
item
Definition climisc.h:80
menu_entry_info
Definition menu.c:97
menu_entry_info::accel_mod
GdkModifierType accel_mod
Definition menu.c:101
menu_entry_info::accel
guint accel
Definition menu.c:100
menu_entry_info::key
const char * key
Definition menu.c:98
menu_entry_info::grouping
enum menu_entry_grouping grouping
Definition menu.c:103
menu_entry_info::cb
GCallback cb
Definition menu.c:102
menu_entry_info::name
const char * name
Definition menu.c:99
packet_game_info::borders
enum borders_mode borders
Definition packets_gen.h:130
packet_game_info::changable_tax
bool changable_tax
Definition packets_gen.h:138
packet_game_info::is_edit_mode
bool is_edit_mode
Definition packets_gen.h:185
packet_game_info::top_cities_count
int top_cities_count
Definition packets_gen.h:245
property_editor
Definition editprop.c:646
road_type
Definition road.h:71
terrain
Definition terrain.h:182
terrain::cultivate_result
struct terrain * cultivate_result
Definition terrain.h:215
terrain::plant_result
struct terrain * plant_result
Definition terrain.h:218
terrain::transform_result
struct terrain * transform_result
Definition terrain.h:229
tile
Definition tile.h:50
unit_type
Definition unittype.h:500
unit
Definition unit.h:138
world::map
struct civ_map map
Definition world_object.h:38
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:189
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
advance_name_translation
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:290
advance_number
Tech_type_id advance_number(const struct advance *padvance)
Definition tech.c:98
advance_iterate
#define advance_iterate(_p)
Definition tech.h:275
advance_iterate_end
#define advance_iterate_end
Definition tech.h:276
T_NONE
#define T_NONE
Definition terrain.h:56
tile_virtual_destroy
void tile_virtual_destroy(struct tile *vtile)
Definition tile.c:1033
tile_apply_activity
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
Definition tile.c:681
tile_virtual_new
struct tile * tile_virtual_new(const struct tile *ptile)
Definition tile.c:981
tile_get_info_text
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
Definition tile.c:771
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile_terrain
#define tile_terrain(_tile)
Definition tile.h:110
tilespec_reread
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1355
tilespec.h
can_unit_change_homecity
bool can_unit_change_homecity(const struct unit *punit)
Definition unit.c:481
unit_can_est_trade_route_here
bool unit_can_est_trade_route_here(const struct unit *punit)
Definition unit.c:286
unit_can_add_or_build_city
bool unit_can_add_or_build_city(const struct unit *punit)
Definition unit.c:450
can_unit_do_autosettlers
bool can_unit_do_autosettlers(const struct unit *punit)
Definition unit.c:602
unit_can_help_build_wonder_here
bool unit_can_help_build_wonder_here(const struct unit *punit)
Definition unit.c:261
can_unit_paradrop
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:819
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:390
ORDER_PERFORM_ACTION
@ ORDER_PERFORM_ACTION
Definition unit.h:47
unit_owner
#define unit_owner(_pu)
Definition unit.h:389
units_can_convert
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:349
units_are_occupied
bool units_are_occupied(const struct unit_list *punits)
Definition unitlist.c:273
can_units_do_base_gui
bool can_units_do_base_gui(const struct unit_list *punits, enum base_gui_type base_gui)
Definition unitlist.c:180
can_units_do_any_road
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:161
units_can_upgrade
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
Definition unitlist.c:334
units_can_unload
bool units_can_unload(const struct unit_list *punits)
Definition unitlist.c:301
units_have_activity_on_tile
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
Definition unitlist.c:318
units_have_type_flag
bool units_have_type_flag(const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag)
Definition unitlist.c:202
can_units_do
bool can_units_do(const struct unit_list *punits, bool(can_fn)(const struct unit *punit))
Definition unitlist.c:95
units_can_do_action
bool units_can_do_action(const struct unit_list *punits, action_id act_id, bool can_do)
Definition unitlist.c:239
units_can_load
bool units_can_load(const struct unit_list *punits)
Definition unitlist.c:287
can_units_do_on_map
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
unit_list_iterate
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
unit_list_iterate_end
#define unit_list_iterate_end
Definition unitlist.h:33
unit_type_get
const struct unit_type * unit_type_get(const struct unit *punit)
Definition unittype.c:123
can_upgrade_unittype
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Definition unittype.c:1703
utype_name_translation
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1560
utype_can_do_action
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Definition unittype.c:371