Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-gtk-3.0/menu.c Source File

Freeciv-3.1

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