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/***********************************************************************
15 menu.c - description
16 -------------------
17 begin : Wed Sep 04 2002
18 copyright : (C) 2002 by Rafał Bursig
19 email : Rafał Bursig <bursig@poczta.fm>
20***********************************************************************/
21
22#ifdef HAVE_CONFIG_H
23#include <fc_config.h>
24#endif
25
26/* SDL2 */
27#ifdef SDL2_PLAIN_INCLUDE
28#include <SDL.h>
29#else /* SDL2_PLAIN_INCLUDE */
30#include <SDL2/SDL.h>
31#endif /* SDL2_PLAIN_INCLUDE */
32
33/* utility */
34#include "fcintl.h"
35#include "log.h"
36
37/* common */
38#include "clientutils.h"
39#include "game.h"
40#include "road.h"
41#include "traderoutes.h"
42#include "unitlist.h"
43
44/* client */
45#include "client_main.h" /* client_state */
46#include "climisc.h"
47#include "control.h"
48
49/* gui-sdl2 */
50#include "dialogs.h"
51#include "gotodlg.h"
52#include "graphics.h"
53#include "gui_id.h"
54#include "gui_main.h"
55#include "gui_tilespec.h"
56#include "mapctrl.h"
57#include "mapview.h"
58#include "pages.h"
59#include "widget.h"
60
61#include "menu.h"
62
63extern struct widget *options_button;
64
67
80
81#define local_show(id) \
82 clear_wflag(get_widget_pointer_from_id(begin_order_widget_list, id, SCAN_FORWARD), \
83 WF_HIDDEN)
84
85#define local_hide(id) \
86 set_wflag(get_widget_pointer_from_id(begin_order_widget_list, id, SCAN_FORWARD), \
87 WF_HIDDEN )
88
89
90/**********************************************************************/
94{
96 struct unit *head_unit = head_of_units_in_focus();
97
98 set_wstate(order_widget, FC_WS_SELECTED);
99 selected_widget = order_widget;
100
101 if (!head_unit) {
102 return -1;
103 }
104
105 switch (order_widget->id) {
107 /* Enable the button for adding to a city in all cases, so we
108 get an eventual error message from the server if we try. */
110 break;
113 break;
116 break;
119 break;
122 break;
125 break;
128 break;
131 break;
134 break;
137 break;
140 break;
143 break;
146 break;
149 break;
152 break;
155 break;
158 break;
161 break;
164 break;
169 break;
174 break;
177 break;
182 break;
185 break;
187 {
188 struct extra_type_list *extras = extra_type_list_by_cause(EC_IRRIGATION);
189
190 if (extra_type_list_size(extras) > 0) {
191 struct extra_type *pextra;
192
193 pextra = extra_type_list_get(extra_type_list_by_cause(EC_IRRIGATION), 0);
194
195 key_unit_connect(ACTIVITY_IRRIGATE, pextra);
196 }
197 }
198 break;
200 {
201 struct road_type *proad = road_by_gui_type(ROAD_GUI_ROAD);
202
203 if (proad != NULL) {
204 struct extra_type *tgt;
205
206 tgt = road_extra_get(proad);
207
208 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
209 }
210 }
211 break;
213 {
214 struct road_type *prail = road_by_gui_type(ROAD_GUI_RAILROAD);
215
216 if (prail != NULL) {
217 struct extra_type *tgt;
218
219 tgt = road_extra_get(prail);
220
221 key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
222 }
223 }
224 break;
227 break;
230 break;
233 break;
236 break;
241 break;
243 popup_unit_upgrade_dlg(head_unit, FALSE);
244 break;
247 break;
249 popup_unit_disband_dlg(head_unit, FALSE);
250 break;
253 break;
255 request_unit_goto(ORDER_PERFORM_ACTION, ACTION_NUKE, -1);
256 break;
259 flush_dirty();
260 break;
263 flush_dirty();
264 break;
265
266 default:
267 break;
268 }
269 }
270
271 return -1;
272}
273
274/**********************************************************************/
277static Uint16 redraw_order_widgets(void)
278{
279 Uint16 count = 0;
281
282 while (TRUE) {
283 if (!(get_wflags(tmp_widget) & WF_HIDDEN)) {
286 }
289 count++;
290 }
291
293 break;
294 }
295
296 tmp_widget = tmp_widget->next;
297 }
298
299 return count;
300}
301
302/**********************************************************************/
306{
310 Sint16 sx, sy, xx, yy = 0;
311 int count = 0, lines = 1, w = 0, count_on_line;
312
313 xx = minimap->dst->dest_rect.x + minimap->size.w + adj_size(10);
314 w = (info_wind->dst->dest_rect.x - adj_size(10)) - xx;
315
316 if (w < (tmp_widget->size.w + adj_size(10)) * 2) {
317 if (minimap->size.h == info_wind->size.h) {
318 xx = 0;
319 w = main_window_width();
320 yy = info_wind->size.h;
321 } else {
322 if (minimap->size.h > info_wind->size.h) {
323 w = main_window_width() - xx - adj_size(20);
324 if (w < (tmp_widget->size.w + adj_size(10)) * 2) {
325 xx = 0;
326 w = minimap->size.w;
327 yy = minimap->size.h;
328 } else {
329 yy = info_wind->size.h;
330 }
331 } else {
332 w = info_wind->dst->dest_rect.x - adj_size(20);
333 if (w < (tmp_widget->size.w + adj_size(10)) * 2) {
334 xx = info_wind->dst->dest_rect.x;
335 w = info_wind->size.w;
336 yy = info_wind->size.h;
337 } else {
338 xx = adj_size(10);
339 yy = minimap->size.h;
340 }
341 }
342 }
343 }
344
345 count_on_line = w / (tmp_widget->size.w + adj_size(5));
346
347 /* find how many to reposition */
348 while (TRUE) {
349 if (!(get_wflags(tmp_widget) & WF_HIDDEN)) {
350 count++;
351 }
352
354 break;
355 }
356
357 tmp_widget = tmp_widget->next;
358 }
359
361
362 if (count - count_on_line > 0) {
363 lines = (count + (count_on_line - 1)) / count_on_line;
364
365 count = count_on_line - ((count_on_line * lines) - count);
366 }
367
368 sx = xx + (w - count * (tmp_widget->size.w + adj_size(5))) / 2;
369
370 sy = tmp_widget->dst->surface->h - yy - lines * (tmp_widget->size.h + adj_size(5));
371
372 while (TRUE) {
373 if (!(get_wflags(tmp_widget) & WF_HIDDEN)) {
374 tmp_widget->size.x = sx;
375 tmp_widget->size.y = sy;
376
377 count--;
378 sx += (tmp_widget->size.w + adj_size(5));
379 if (!count) {
380 count = count_on_line;
381 lines--;
382
383 sx = xx + (w - count * (tmp_widget->size.w + adj_size(5))) / 2;
384
385 sy = tmp_widget->dst->surface->h - yy - lines * (tmp_widget->size.h + adj_size(5));
386 }
387 }
388
390 break;
391 }
392
393 tmp_widget = tmp_widget->next;
394 }
395}
396
397/* ================================ PUBLIC ================================ */
398
399/**********************************************************************/
403{
404 struct widget *buf = NULL;
405 char cbuf[128];
406 struct road_type *proad;
407 struct road_type *prail;
408
409 /* No orders */
410 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("No Orders"),
411 /* TRANS: "Space" refers to the space bar on a keyboard. */
412 _("Space"));
413 buf = create_themeicon(current_theme->o_done_icon, main_data.gui,
419 buf->key = SDLK_SPACE;
421 /* --------- */
422
424
425 /* Wait */
426 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Wait"), "W");
427 buf = create_themeicon(current_theme->o_wait_icon, main_data.gui,
433 buf->key = SDLK_w;
435 /* --------- */
436
437 /* Explode Nuclear */
438 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
439 action_id_name_translation(ACTION_NUKE), "Shift+N");
440 buf = create_themeicon(current_theme->o_nuke_icon, main_data.gui,
446 buf->key = SDLK_n;
447 buf->mod = KMOD_SHIFT;
449 /* --------- */
450
451 /* Act against the specified tile. */
452 /* TRANS: Button to bring up the action selection dialog. */
453 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Do..."), "D");
454 buf = create_themeicon(current_theme->o_spy_icon, main_data.gui,
460 buf->key = SDLK_d;
462 /* --------- */
463
464 /* Disband */
465 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Disband Unit"), "Shift+D");
466 buf = create_themeicon(current_theme->o_disband_icon, main_data.gui,
472 buf->key = SDLK_d;
473 buf->mod = KMOD_SHIFT;
475 /* --------- */
476
477 /* Upgrade */
478 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Upgrade Unit"), "Shift+U");
479 buf = create_themeicon(current_theme->order_icon, main_data.gui,
485 buf->key = SDLK_u;
486 buf->mod = KMOD_SHIFT;
488 /* --------- */
489
490 /* Convert */
491 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Convert Unit"), "Shift+O");
492 buf = create_themeicon(current_theme->order_icon, main_data.gui,
498 buf->key = SDLK_o;
499 buf->mod = KMOD_SHIFT;
501 /* --------- */
502
503 /* Return to nearest city */
504 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
505 _("Return to Nearest City"), "Shift+G");
506 buf = create_themeicon(current_theme->o_return_icon, main_data.gui,
512 buf->key = SDLK_g;
513 buf->mod = KMOD_SHIFT;
515 /* --------- */
516
517 /* Goto City */
518 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Go to City"), "T");
519 buf = create_themeicon(current_theme->o_goto_city_icon, main_data.gui,
525 buf->key = SDLK_t;
527 /* --------- */
528
529 /* Airlift */
530 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Airlift to City"), "T");
531 buf = create_themeicon(current_theme->order_icon, main_data.gui,
537 buf->key = SDLK_t;
539 /* --------- */
540
541 /* Goto location */
542 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Go to Tile"), "G");
543 buf = create_themeicon(current_theme->o_goto_icon, main_data.gui,
549 buf->key = SDLK_g;
551 /* --------- */
552
553 /* Patrol */
554 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Patrol"), "Q");
555 buf = create_themeicon(current_theme->o_patrol_icon, main_data.gui,
561 buf->key = SDLK_q;
563 /* --------- */
564
565 /* Connect irrigation */
566 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
567 _("Connect With Irrigation"), "Ctrl+I");
568 buf = create_themeicon(current_theme->o_autoconnect_icon, main_data.gui,
574 buf->key = SDLK_i;
575 buf->mod = KMOD_CTRL;
577 /* --------- */
578
579 /* Connect road */
580 proad = road_by_gui_type(ROAD_GUI_ROAD);
581
582 if (proad != NULL) {
583 fc_snprintf(cbuf, sizeof(cbuf),
584 _("Connect With %s (%s)"),
586 "Ctrl+R");
587 buf = create_themeicon(current_theme->o_autoconnect_icon, main_data.gui,
593 buf->key = SDLK_r;
594 buf->mod = KMOD_CTRL;
596 }
597 /* --------- */
598
599 /* Connect railroad */
600 prail = road_by_gui_type(ROAD_GUI_RAILROAD);
601 if (prail != NULL) {
602 fc_snprintf(cbuf, sizeof(cbuf),
603 _("Connect With %s (%s)"),
605 "Ctrl+L");
606 buf = create_themeicon(current_theme->o_autoconnect_icon, main_data.gui,
612 buf->key = SDLK_l;
613 buf->mod = KMOD_CTRL;
615 }
616 /* --------- */
617
618 /* Auto-Explore */
619 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Auto Explore"), "X");
620 buf = create_themeicon(current_theme->o_autoexp_icon, main_data.gui,
626 buf->key = SDLK_x;
628 /* --------- */
629
630 /* Auto-Settler */
631 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Auto Settler"), "A");
632
633 buf = create_themeicon(current_theme->o_autosett_icon, main_data.gui,
639 buf->key = SDLK_a;
641 /* --------- */
642
643 /* Wake Up Others */
644 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
645 _("Unsentry All On Tile"), "Shift+S");
646 buf = create_themeicon(current_theme->o_wakeup_icon, main_data.gui,
652 buf->key = SDLK_s;
653 buf->mod = KMOD_SHIFT;
655 /* --------- */
656
657 /* Unload */
658 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
659 _("Unload All From Transporter"), "Shift+T");
660 buf = create_themeicon(current_theme->o_unload_icon, main_data.gui,
666 buf->mod = KMOD_SHIFT;
667 buf->key = SDLK_t;
669 /* --------- */
670
671 /* Board */
672 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Load Unit"), "L");
673 buf = create_themeicon(current_theme->o_load_icon, main_data.gui,
679 buf->key = SDLK_l;
681 /* --------- */
682
683 /* Deboard */
684 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Unload Unit"), "U");
685 buf = create_themeicon(current_theme->o_unload_icon, main_data.gui,
691 buf->key = SDLK_u;
693 /* --------- */
694
695 /* Find Homecity */
696 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
697 action_id_name_translation(ACTION_HOME_CITY), "H");
698 buf = create_themeicon(current_theme->o_homecity_icon, main_data.gui,
704 buf->key = SDLK_h;
706 /* --------- */
707
708 /* Pillage */
709 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Pillage"), "Shift+P");
710 buf = create_themeicon(current_theme->o_pillage_icon, main_data.gui,
716 buf->key = SDLK_p;
717 buf->mod = KMOD_SHIFT;
719 /* --------- */
720
721 /* Sentry */
722 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Sentry Unit"), "S");
723 buf = create_themeicon(current_theme->o_sentry_icon, main_data.gui,
729 buf->key = SDLK_s;
731 /* --------- */
732
733 /* Clean Nuclear Fallout */
734 /* Label will be replaced by real_menus_update() before it's seen */
735 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
736 buf = create_themeicon(current_theme->o_fallout_icon, main_data.gui,
742 buf->key = SDLK_n;
745 /* --------- */
746
747 /* Paradrop */
748 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
749 action_id_name_translation(ACTION_PARADROP), "J");
750 buf = create_themeicon(current_theme->o_paradrop_icon, main_data.gui,
756 buf->key = SDLK_j;
758 /* --------- */
759
760 /* Clean Pollution */
761 /* Label will be replaced by real_menus_update() before it's seen */
762 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
763 buf = create_themeicon(current_theme->o_pollution_icon, main_data.gui,
769 buf->key = SDLK_p;
772 /* --------- */
773
774 /* Build Airbase */
775 /* Label will be replaced by real_menus_update() before it's seen */
776 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
777 buf = create_themeicon(current_theme->o_airbase_icon, main_data.gui,
783 buf->key = SDLK_e;
784 buf->mod = KMOD_SHIFT;
787 /* --------- */
788
789 /* Fortify */
790 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Fortify Unit"), "F");
791 buf = create_themeicon(current_theme->o_fortify_icon, main_data.gui,
797 buf->key = SDLK_f;
799 /* --------- */
800
801 /* Build Fortress */
802 /* Label will be replaced by real_menus_update() before it's seen */
803 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
804 buf = create_themeicon(current_theme->o_fortress_icon, main_data.gui,
810 buf->key = SDLK_f;
811 buf->mod = KMOD_SHIFT;
814 /* --------- */
815
816 /* Transform Tile */
817 /* Label will be replaced by real_menus_update() before it's seen */
818 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
819 buf = create_themeicon(current_theme->o_transform_icon, main_data.gui,
825 buf->key = SDLK_o;
828 /* --------- */
829
830 /* Build Mine */
831 /* Label will be replaced by real_menus_update() before it's seen */
832 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
833 buf = create_themeicon(current_theme->o_mine_icon, main_data.gui,
839 buf->key = SDLK_m;
841
842 order_mine_button = buf;
843 /* --------- */
844
845 /* Build Irrigation */
846 /* Label will be replaced by real_menus_update() before it's seen */
847 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
848 buf = create_themeicon(current_theme->o_irrigation_icon, main_data.gui,
853 buf->key = SDLK_i;
856
858 /* --------- */
859
860 /* Cultivate */
861 /* Label will be replaced by real_menus_update() before it's seen */
862 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
863 buf = create_themeicon(current_theme->o_cultivate_icon, main_data.gui,
868 buf->key = SDLK_i;
869 buf->mod = KMOD_SHIFT;
872
874 /* --------- */
875
876 /* Plant */
877 /* Label will be replaced by real_menus_update() before it's seen */
878 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
879 buf = create_themeicon(current_theme->o_plant_icon, main_data.gui,
884 buf->key = SDLK_m;
885 buf->mod = KMOD_SHIFT;
888
889 order_plant_button = buf;
890 /* --------- */
891
892 /* Establish Trade route */
893 /* Label will be replaced by real_menus_update() before it's seen */
894 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
895 buf = create_themeicon(current_theme->o_trade_icon, main_data.gui,
901 buf->key = SDLK_r;
903
904 order_trade_button = buf;
905 /* --------- */
906
907 /* Build (Rail-)Road */
908 /* Label will be replaced by real_menus_update() before it's seen */
909 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
910 buf = create_themeicon(current_theme->o_road_icon, main_data.gui,
916 buf->key = SDLK_r;
918
919 order_road_button = buf;
920 /* --------- */
921
922 /* Help Build Wonder */
923 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
924 action_id_name_translation(ACTION_HELP_WONDER), "B");
925 buf = create_themeicon(current_theme->o_wonder_icon, main_data.gui,
931 buf->key = SDLK_b;
933 /* --------- */
934
935 /* Add to City / Build New City */
936 /* Label will be replaced by real_menus_update() before it's seen */
937 fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
938 buf = create_themeicon(current_theme->o_build_city_icon, main_data.gui,
944 buf->key = SDLK_b;
946
948 /* --------- */
949
951
953}
954
955/**********************************************************************/
959{
961
964 sdl2_client_flags &= ~CF_ORDERS_WIDGETS_CREATED;
965}
966
967/**********************************************************************/
975
976/**********************************************************************/
980{
982
983 if (tmp_widget == NULL) {
984 return;
985 }
986
987 while (TRUE) {
988 if (!(get_wflags(tmp_widget) & WF_HIDDEN) && (tmp_widget->gfx)) {
991 }
992
994 break;
995 }
996
997 tmp_widget = tmp_widget->next;
998 }
999}
1000
1001/* ============================== Native =============================== */
1002
1003/**********************************************************************/
1008{
1009 /* PORTME */
1010}
1011
1012/**********************************************************************/
1016{
1017 static Uint16 counter = 0;
1018 struct unit_list *punits = NULL;
1019 struct unit *punit = NULL;
1020 static char cbuf[128];
1021
1022 if ((C_S_RUNNING != client_state())
1023 || (get_client_page() != PAGE_GAME)) {
1024
1026
1031 }
1032
1035 }
1036
1037 } else {
1038 /* Running state */
1040 /* show options button */
1044 }
1045
1046 if (NULL == client.conn.playing) {
1047 /* Global observer */
1049 /* show minimap buttons and unitinfo buttons */
1052 /* disable minimap buttons and unitinfo buttons */
1055 }
1056
1057 return;
1058
1059 } else {
1060 /* running state with player */
1061
1064 }
1065
1066 if (counter) {
1068 }
1069
1071 sdl2_client_flags &= ~CF_GAME_JUST_STARTED;
1072
1073 /* show minimap buttons and unitinfo buttons */
1076
1077 counter = 0;
1078 }
1079 }
1080
1081 punits = get_units_in_focus();
1082 punit = unit_list_get(punits, 0);
1083
1084 if (punit && punit->ssa_controller == SSA_NONE) {
1085 struct city *homecity;
1086 int time;
1087 struct tile *ptile = unit_tile(punit);
1088 struct city *pcity = tile_city(ptile);
1089 struct terrain *pterrain = tile_terrain(ptile);
1090 struct base_type *pbase;
1091 struct extra_type *pextra;
1092
1093 if (!counter) {
1096
1099 }
1100
1101 /* Enable the button for adding to a city in all cases, so we
1102 * get an eventual error message from the server if we try. */
1103
1105 if (pcity != NULL) {
1106 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
1107 action_id_name_translation(ACTION_JOIN_CITY), "B");
1108 } else {
1109 fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
1110 action_id_name_translation(ACTION_FOUND_CITY), "B");
1111 }
1113 cbuf);
1115 } else {
1117 }
1118
1121 } else {
1123 }
1124
1125 pextra = next_extra_for_tile(ptile, EC_ROAD, unit_owner(punit), punit);
1126 if (pextra != NULL
1127 && can_unit_do_activity_targeted_client(punit, ACTIVITY_GEN_ROAD, pextra)) {
1128 struct road_type *proad = extra_road_get(pextra);
1130
1131 time = turns_to_activity_done(ptile, ACTIVITY_GEN_ROAD, pextra, punit);
1132
1133 /* TRANS: "Build Railroad (R) 3 turns" */
1134 fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
1135 extra_name_translation(pextra),
1136 "R", time,
1137 PL_("turn", "turns", time));
1138
1139 if (compat == ROCO_RAILROAD) {
1140 order_road_button->theme = current_theme->o_railroad_icon;
1141 } else {
1142 order_road_button->theme = current_theme->o_road_icon;
1143 }
1146 } else {
1148 }
1149
1150 /* unit_can_est_trade_route_here(punit) */
1152 ACTION_TRADE_ROUTE)
1153 && (homecity = game_city_by_number(punit->homecity))
1154 && can_cities_trade(homecity, pcity)) {
1155 int revenue = get_caravan_enter_city_trade_bonus(homecity, pcity,
1156 punit->carrying,
1157 TRUE);
1158
1159 if (can_establish_trade_route(homecity, pcity)) {
1160 fc_snprintf(cbuf, sizeof(cbuf),
1161 _("%s With %s ( %d one time bonus + %d trade ) (R)"),
1162 action_id_name_translation(ACTION_TRADE_ROUTE),
1163 city_name_get(homecity),
1164 revenue,
1165 trade_base_between_cities(homecity, pcity));
1166 } else {
1167 revenue = (revenue + 2) / 3;
1168 fc_snprintf(cbuf, sizeof(cbuf),
1169 _("%s Of %s ( %d one time bonus ) (R)"),
1170 action_id_name_translation(ACTION_MARKETPLACE),
1171 city_name_get(homecity),
1172 revenue);
1173 }
1176 } else {
1178 }
1179
1180 pextra = next_extra_for_tile(ptile, EC_IRRIGATION,
1182 if (pextra != NULL
1183 && can_unit_do_activity_targeted_client(punit, ACTIVITY_IRRIGATE, pextra)) {
1184 time = turns_to_activity_done(ptile, ACTIVITY_IRRIGATE,
1185 pextra, punit);
1186 /* TRANS: "Build Irrigation (I) 5 turns" */
1187 fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
1188 extra_name_translation(pextra), "I", time,
1189 PL_("turn", "turns", time));
1190 order_irrigation_button->theme = current_theme->o_irrigation_icon;
1191
1194 } else {
1196 }
1197
1198 pextra = next_extra_for_tile(ptile, EC_MINE,
1200 if (pextra != NULL
1201 && can_unit_do_activity_targeted_client(punit, ACTIVITY_MINE, pextra)) {
1202 time = turns_to_activity_done(ptile, ACTIVITY_MINE, pextra, punit);
1203 /* TRANS: "Build Mine (M) 5 turns" */
1204 fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
1205 extra_name_translation(pextra), "M", time,
1206 PL_("turn", "turns", time));
1207 order_mine_button->theme = current_theme->o_mine_icon;
1208
1211 } else {
1213 }
1214
1215 if (can_unit_do_activity_client(punit, ACTIVITY_CULTIVATE)) {
1216 /* Activity always results in terrain change */
1217 time = turns_to_activity_done(ptile, ACTIVITY_CULTIVATE, NULL, punit);
1218 fc_snprintf(cbuf, sizeof(cbuf), "%s %s (%s) %d %s",
1219 _("Cultivate to"),
1221 "Shift+I", time, PL_("turn", "turns", time));
1224 } else {
1226 }
1227
1228 if (can_unit_do_activity_client(punit, ACTIVITY_PLANT)) {
1229 /* Activity always results in terrain change */
1230 time = turns_to_activity_done(ptile, ACTIVITY_PLANT, NULL, punit);
1231 fc_snprintf(cbuf, sizeof(cbuf), "%s %s (%s) %d %s",
1232 _("Plant to"),
1234 "Shift+M", time, PL_("turn", "turns", time));
1237 } else {
1239 }
1240
1241 if (can_unit_do_activity_client(punit, ACTIVITY_TRANSFORM)) {
1242 /* Activity always results in terrain change */
1243 time = turns_to_activity_done(ptile, ACTIVITY_TRANSFORM, NULL, punit);
1244 fc_snprintf(cbuf, sizeof(cbuf), "%s %s (%s) %d %s",
1245 _("Transform to"),
1247 "O", time, PL_("turn", "turns", time));
1250 } else {
1252 }
1253
1254 pbase = get_base_by_gui_type(BASE_GUI_FORTRESS, punit, ptile);
1255 if (pbase != NULL) {
1256 struct extra_type *base_extra = base_extra_get(pbase);
1257
1258 time = turns_to_activity_done(ptile, ACTIVITY_BASE, base_extra, punit);
1259 /* TRANS: "Build Fortress (Shift+F) 5 turns" */
1260 fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
1261 extra_name_translation(base_extra), "Shift+F", time,
1262 PL_("turn", "turns", time));
1265 } else {
1267 }
1268
1269 if (can_unit_do_activity_client(punit, ACTIVITY_FORTIFYING)) {
1271 } else {
1273 }
1274
1275 pbase = get_base_by_gui_type(BASE_GUI_AIRBASE, punit, ptile);
1276 if (pbase != NULL) {
1277 struct extra_type *base_extra = base_extra_get(pbase);
1278
1279 time = turns_to_activity_done(ptile, ACTIVITY_BASE, base_extra, punit);
1280 /* TRANS: "Build Airbase (Shift+E) 5 turns" */
1281 fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
1282 extra_name_translation(base_extra), "Shift+E", time,
1283 PL_("turn", "turns", time));
1286 } else {
1288 }
1289
1290 pextra = prev_extra_in_tile(ptile, ERM_CLEANPOLLUTION,
1292 if (pextra != NULL
1293 && can_unit_do_activity_targeted_client(punit, ACTIVITY_POLLUTION, pextra)) {
1294 time = turns_to_activity_done(ptile, ACTIVITY_POLLUTION, pextra,
1295 punit);
1296 /* TRANS: "Clean Pollution (P) 3 turns" */
1297 fc_snprintf(cbuf, sizeof(cbuf), _("Clean %s (%s) %d %s"),
1298 extra_name_translation(pextra), "P", time,
1299 PL_("turn", "turns", time));
1302 } else {
1304 }
1305
1306 if (can_unit_paradrop(&(wld.map), punit)) {
1308 } else {
1310 }
1311
1312 pextra = prev_extra_in_tile(ptile, ERM_CLEANFALLOUT,
1314 if (pextra != NULL
1315 && can_unit_do_activity_targeted_client(punit, ACTIVITY_FALLOUT, pextra)) {
1316 time = turns_to_activity_done(ptile, ACTIVITY_FALLOUT, pextra,
1317 punit);
1318 /* TRANS: "Clean Fallout (N) 3 turns" */
1319 fc_snprintf(cbuf, sizeof(cbuf), _("Clean %s (%s) %d %s"),
1320 extra_name_translation(pextra), "N", time,
1321 PL_("turn", "turns", time));
1324 } else {
1326 }
1327
1328 if (can_unit_do_activity_client(punit, ACTIVITY_SENTRY)) {
1330 } else {
1332 }
1333
1334 if (can_unit_do_activity_client(punit, ACTIVITY_PILLAGE)) {
1336 } else {
1338 }
1339
1340 if (pcity != NULL && can_unit_change_homecity(&(wld.map), punit)
1341 && pcity->id != punit->homecity) {
1343 } else {
1345 }
1346
1347 if (punit->client.occupied) {
1349 } else {
1351 }
1352
1353 if (units_can_load(punits)) {
1355 } else {
1357 }
1358
1359 if (units_can_unload(punits)) {
1361 } else {
1363 }
1364
1365 if (is_unit_activity_on_tile(ACTIVITY_SENTRY, unit_tile(punit))) {
1367 } else {
1369 }
1370
1373 } else {
1375 }
1376
1377 if (can_unit_do_activity_client(punit, ACTIVITY_EXPLORE)) {
1379 } else {
1381 }
1382
1383 {
1384 bool conn_possible = FALSE;
1385 struct extra_type_list *extras;
1386
1387 extras = extra_type_list_by_cause(EC_IRRIGATION);
1388
1389 if (extra_type_list_size(extras) > 0) {
1390 struct extra_type *tgt;
1391
1392 tgt = extra_type_list_get(extras, 0);
1393 conn_possible = can_units_do_connect(punits, ACTIVITY_IRRIGATE, tgt);
1394 }
1395
1396 if (conn_possible) {
1398 } else {
1400 }
1401 }
1402
1403 {
1404 struct road_type *proad = road_by_gui_type(ROAD_GUI_ROAD);
1405 bool road_conn_possible;
1406
1407 if (proad != NULL) {
1408 struct extra_type *tgt;
1409
1410 tgt = road_extra_get(proad);
1411
1412 road_conn_possible = can_unit_do_connect(punit, ACTIVITY_GEN_ROAD, tgt);
1413 } else {
1414 road_conn_possible = FALSE;
1415 }
1416
1417 if (road_conn_possible) {
1419 } else {
1421 }
1422 }
1423
1424 {
1425 struct road_type *proad = road_by_gui_type(ROAD_GUI_RAILROAD);
1426 bool road_conn_possible;
1427
1428 if (proad != NULL) {
1429 struct extra_type *tgt;
1430
1431 tgt = road_extra_get(proad);
1432
1433 road_conn_possible = can_unit_do_connect(punit, ACTIVITY_GEN_ROAD, tgt);
1434 } else {
1435 road_conn_possible = FALSE;
1436 }
1437
1438 if (road_conn_possible) {
1440 } else {
1442 }
1443 }
1444
1447 } else {
1449 }
1450
1451 if (unit_can_do_action(punit, ACTION_NUKE)) {
1453 } else {
1455 }
1456
1457 if (pcity && pcity->airlift) {
1460 } else {
1463 }
1464
1466 unit_type_get(punit))) {
1468 } else {
1470 }
1471
1472 if (unit_can_convert(&(wld.map), punit)) {
1474 } else {
1476 }
1477
1479 counter = redraw_order_widgets();
1480
1481 } else {
1482 if (counter) {
1484 }
1485
1486 counter = 0;
1487 }
1488 }
1489}
1490
1491/**********************************************************************/
1500
1501/**********************************************************************/
const char * action_id_name_translation(action_id act_id)
Definition actions.c:1910
#define ACTION_ANY
Definition actions.h:290
struct extra_type * base_extra_get(const struct base_type *pbase)
Definition base.c:101
struct base_type * get_base_by_gui_type(enum base_gui_type type, const struct unit *punit, const struct tile *ptile)
Definition base.c:139
const char * city_name_get(const struct city *pcity)
Definition city.c:1115
struct civclient client
enum client_states client_state(void)
bool can_client_issue_orders(void)
@ C_S_RUNNING
Definition client_main.h:47
int turns_to_activity_done(const struct tile *ptile, Activity_type_id act, const struct extra_type *tgt, const struct unit *pmodunit)
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
Definition climisc.c:1235
void key_unit_sentry(void)
Definition control.c:3634
void key_unit_road(void)
Definition control.c:3616
void key_unit_pollution(void)
Definition control.c:3608
void request_unit_return(struct unit *punit)
Definition control.c:1547
void key_unit_build_city(void)
Definition control.c:3194
void key_unit_auto_explore(void)
Definition control.c:3410
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
Definition control.c:3216
void request_unit_load(struct unit *pcargo, struct unit *ptrans, struct tile *ptile)
Definition control.c:2083
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
Definition control.c:1129
void key_unit_paradrop(void)
Definition control.c:3320
struct unit_list * get_units_in_focus(void)
Definition control.c:177
void request_unit_autosettlers(const struct unit *punit)
Definition control.c:2068
bool can_unit_do_connect(struct unit *punit, enum unit_activity activity, struct extra_type *tgt)
Definition control.c:1410
void key_unit_build_wonder(void)
Definition control.c:3204
void key_unit_plant(void)
Definition control.c:3556
void key_unit_fortress(void)
Definition control.c:3465
void key_unit_mine(void)
Definition control.c:3548
void key_unit_pillage(void)
Definition control.c:3568
void request_unit_unload(struct unit *pcargo)
Definition control.c:2119
void key_unit_irrigate(void)
Definition control.c:3528
void key_unit_unload_all(void)
Definition control.c:3350
void key_unit_homecity(void)
Definition control.c:3482
void key_unit_patrol(void)
Definition control.c:3328
void key_unit_wakeup_others(void)
Definition control.c:3383
void key_unit_wait(void)
Definition control.c:3375
void key_unit_trade_route(void)
Definition control.c:3336
struct unit * head_of_units_in_focus(void)
Definition control.c:411
void key_unit_action_select_tgt(void)
Definition control.c:3247
void key_unit_fallout(void)
Definition control.c:3445
void key_unit_transform(void)
Definition control.c:3646
void key_unit_done(void)
Definition control.c:3304
void key_unit_airbase(void)
Definition control.c:3393
void key_unit_goto(void)
Definition control.c:3312
void key_unit_convert(void)
Definition control.c:3435
void key_unit_fortify(void)
Definition control.c:3453
void key_unit_cultivate(void)
Definition control.c:3536
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
Definition control.h:42
#define can_unit_do_activity_client(_punit_, _act_)
Definition control.h:40
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
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
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Definition extras.c:241
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
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:186
#define extra_road_get(_e_)
Definition extras.h:185
QString current_theme
Definition fc_client.cpp:65
road_compat
Definition fc_types.h:1105
@ ROCO_RAILROAD
Definition fc_types.h:1105
#define PL_(String1, String2, n)
Definition fcintl.h:71
#define _(String)
Definition fcintl.h:67
struct world wld
Definition game.c:58
struct city * game_city_by_number(int id)
Definition game.c:102
void popup_goto_dialog(void)
Definition gotodlg.c:257
void flush_dirty(void)
Definition mapview.c:450
void real_menus_init(void)
Definition menu.c:2841
void real_menus_update(void)
Definition menu.c:2317
void popup_unit_disband_dlg(struct unit *punit, bool city)
Definition dialogs.c:875
void popup_unit_upgrade_dlg(struct unit *punit, bool city)
Definition dialogs.c:680
void popup_airlift_dialog(void)
Definition gotodlg.c:407
int main_window_width(void)
Definition graphics.c:685
struct sdl2_data main_data
Definition graphics.c:57
Uint32 sdl2_client_flags
Definition gui_main.c:97
#define CF_MAP_UNIT_W_CREATED
Definition gui_main.h:43
#define CF_ORDERS_WIDGETS_CREATED
Definition gui_main.h:42
struct widget * selected_widget
Definition widget.c:48
#define adj_size(size)
Definition gui_main.h:138
#define CF_GAME_JUST_STARTED
Definition gui_main.h:46
#define PRESSED_EVENT(event)
Definition gui_main.h:68
struct widget * get_minimap_window_widget(void)
Definition mapctrl.c:2203
struct widget * get_unit_info_window_widget(void)
Definition mapctrl.c:2195
void hide_unitinfo_window_buttons(void)
Definition mapctrl.c:1593
void disable_minimap_window_buttons(void)
Definition mapctrl.c:1911
void show_minimap_window_buttons(void)
Definition mapctrl.c:1798
void hide_minimap_window_buttons(void)
Definition mapctrl.c:1836
void show_unitinfo_window_buttons(void)
Definition mapctrl.c:1569
void disable_unitinfo_window_buttons(void)
Definition mapctrl.c:1617
struct widget * options_button
Definition optiondlg.c:103
static struct widget * order_trade_button
Definition menu.c:79
static struct widget * order_airbase_button
Definition menu.c:70
void create_units_order_widgets(void)
Definition menu.c:402
void disable_order_buttons(void)
Definition menu.c:1494
static int unit_order_callback(struct widget *order_widget)
Definition menu.c:93
#define local_show(id)
Definition menu.c:81
#define local_hide(id)
Definition menu.c:85
static struct widget * order_fortress_button
Definition menu.c:71
static struct widget * order_irrigation_button
Definition menu.c:74
static Uint16 redraw_order_widgets(void)
Definition menu.c:277
static struct widget * order_plant_button
Definition menu.c:76
static struct widget * order_transform_button
Definition menu.c:78
void undraw_order_widgets(void)
Definition menu.c:979
static struct widget * order_fallout_button
Definition menu.c:68
static struct widget * begin_order_widget_list
Definition menu.c:65
static struct widget * order_road_button
Definition menu.c:77
static struct widget * order_cultivate_button
Definition menu.c:75
static void set_new_order_widget_start_pos(void)
Definition menu.c:305
static struct widget * order_pollution_button
Definition menu.c:69
void enable_order_buttons(void)
Definition menu.c:1504
static struct widget * order_build_add_to_city_button
Definition menu.c:72
static struct widget * order_mine_button
Definition menu.c:73
static struct widget * end_order_widget_list
Definition menu.c:66
void delete_units_order_widgets(void)
Definition menu.c:958
void update_order_widgets(void)
Definition menu.c:970
@ ID_UNIT_ORDER_NUKE
Definition gui_id.h:122
@ ID_UNIT_ORDER_AUTO_SETTLER
Definition gui_id.h:108
@ ID_UNIT_ORDER_SENTRY
Definition gui_id.h:101
@ ID_UNIT_ORDER_AIRBASE
Definition gui_id.h:97
@ ID_UNIT_ORDER_DEBOARD
Definition gui_id.h:106
@ ID_UNIT_ORDER_BUILD_WONDER
Definition gui_id.h:87
@ ID_UNIT_ORDER_IRRIGATE
Definition gui_id.h:90
@ ID_UNIT_ORDER_BUILD_CITY
Definition gui_id.h:86
@ ID_UNIT_ORDER_RETURN
Definition gui_id.h:117
@ ID_UNIT_ORDER_PATROL
Definition gui_id.h:113
@ ID_UNIT_ORDER_ROAD
Definition gui_id.h:88
@ ID_UNIT_ORDER_MINE
Definition gui_id.h:92
@ ID_UNIT_ORDER_DIPLOMAT_DLG
Definition gui_id.h:121
@ ID_UNIT_ORDER_DISBAND
Definition gui_id.h:120
@ ID_UNIT_ORDER_BOARD
Definition gui_id.h:105
@ ID_UNIT_ORDER_PLANT
Definition gui_id.h:93
@ ID_UNIT_ORDER_CONNECT_ROAD
Definition gui_id.h:110
@ ID_UNIT_ORDER_CONVERT
Definition gui_id.h:119
@ ID_UNIT_ORDER_AUTO_EXPLORE
Definition gui_id.h:109
@ ID_UNIT_ORDER_WAIT
Definition gui_id.h:123
@ ID_UNIT_ORDER_WAKEUP_OTHERS
Definition gui_id.h:107
@ ID_UNIT_ORDER_UNLOAD_TRANSPORTER
Definition gui_id.h:104
@ ID_UNIT_ORDER_UPGRADE
Definition gui_id.h:118
@ ID_UNIT_ORDER_GOTO_CITY
Definition gui_id.h:115
@ ID_UNIT_ORDER_FALLOUT
Definition gui_id.h:100
@ ID_UNIT_ORDER_POLLUTION
Definition gui_id.h:98
@ ID_UNIT_ORDER_FORTRESS
Definition gui_id.h:95
@ ID_UNIT_ORDER_TRANSFORM
Definition gui_id.h:94
@ ID_UNIT_ORDER_PILLAGE
Definition gui_id.h:102
@ ID_UNIT_ORDER_PARADROP
Definition gui_id.h:99
@ ID_UNIT_ORDER_HOMECITY
Definition gui_id.h:103
@ ID_UNIT_ORDER_CONNECT_IRRIGATE
Definition gui_id.h:112
@ ID_UNIT_ORDER_DONE
Definition gui_id.h:124
@ ID_UNIT_ORDER_GOTO
Definition gui_id.h:114
@ ID_UNIT_ORDER_FORTIFY
Definition gui_id.h:96
@ ID_UNIT_ORDER_AIRLIFT
Definition gui_id.h:116
@ ID_UNIT_ORDER_CULTIVATE
Definition gui_id.h:91
@ ID_UNIT_ORDER_TRADE_ROUTE
Definition gui_id.h:89
@ ID_UNIT_ORDER_CONNECT_RAILROAD
Definition gui_id.h:111
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
Definition gui_string.c:251
@ FONTO_DEFAULT
Definition gui_string.h:64
#define create_utf8_from_char_fonto(string_in, fonto)
Definition gui_string.h:107
char * lines
Definition packhand.c:129
enum client_pages get_client_page(void)
struct extra_type * road_extra_get(const struct road_type *proad)
Definition road.c:42
enum road_compat road_compat_special(const struct road_type *proad)
Definition road.c:151
struct road_type * road_by_gui_type(enum road_gui_type gui_type)
Definition road.c:180
static struct compatibility compat[]
Definition savecompat.c:101
Definition city.h:309
int id
Definition city.h:315
int airlift
Definition city.h:365
struct connection conn
Definition client_main.h:96
struct player * playing
Definition connection.h:156
struct gui_layer * gui
Definition graphics.h:215
SDL_Event event
Definition graphics.h:217
struct terrain * cultivate_result
Definition terrain.h:203
struct terrain * plant_result
Definition terrain.h:206
struct terrain * transform_result
Definition terrain.h:217
Definition tile.h:49
Definition unit.h:138
bool occupied
Definition unit.h:216
struct unit::@80::@82 client
int homecity
Definition unit.h:146
struct goods_type * carrying
Definition unit.h:186
enum server_side_agent ssa_controller
Definition unit.h:172
utf8_str * info_label
Definition widget.h:122
SDL_Keycode key
Definition widget.h:153
int(* action)(struct widget *)
Definition widget.h:157
struct container * cont
Definition widget.h:127
Uint16 mod
Definition widget.h:154
SDL_Surface * theme
Definition widget.h:118
Uint16 id
Definition widget.h:155
struct civ_map map
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:969
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
const char * terrain_name_translation(const struct terrain *pterrain)
Definition terrain.c:226
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
#define tile_terrain(_tile)
Definition tile.h:109
bool can_cities_trade(const struct city *pc1, const struct city *pc2)
int trade_base_between_cities(const struct city *pc1, const struct city *pc2)
int get_caravan_enter_city_trade_bonus(const struct city *pc1, const struct city *pc2, struct goods_type *pgood, const bool establish_trade)
bool can_establish_trade_route(const struct city *pc1, const struct city *pc2)
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:427
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:460
bool is_unit_activity_on_tile(enum unit_activity activity, const struct tile *ptile)
Definition unit.c:1142
bool can_unit_do_autosettlers(const struct unit *punit)
Definition unit.c:583
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
Definition unit.c:328
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:826
bool unit_can_help_build_wonder_here(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:260
bool unit_can_convert(const struct civ_map *nmap, const struct unit *punit)
Definition unit.c:2019
#define unit_tile(_pu)
Definition unit.h:395
@ ORDER_PERFORM_ACTION
Definition unit.h:47
#define unit_owner(_pu)
Definition unit.h:394
bool units_can_unload(const struct unit_list *punits)
Definition unitlist.c:305
bool units_can_load(const struct unit_list *punits)
Definition unitlist.c:291
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
#define unit_list_iterate_end
Definition unitlist.h:33
const struct unit_type * unit_type_get(const struct unit *punit)
Definition unittype.c:123
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Definition unittype.c:1755
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Definition unittype.c:443
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:585
void refresh_widget_background(struct widget *pwidget)
Definition widget.c:1150
void hide_group(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:914
#define enable_group(begin_group_widget_list, end_group_widget_list)
Definition widget.h:397
@ FC_WS_DISABLED
Definition widget.h:99
@ FC_WS_NORMAL
Definition widget.h:96
@ FC_WS_SELECTED
Definition widget.h:97
void clear_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:62
static void widget_mark_dirty(struct widget *pwidget)
Definition widget.h:286
#define disable_group(begin_group_widget_list, end_group_widget_list)
Definition widget.h:401
enum widget_flag get_wflags(const struct widget *pwidget)
Definition widget_core.c:86
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
enum widget_state get_wstate(const struct widget *pwidget)
Definition widget_core.c:70
static void widget_undraw(struct widget *pwidget)
Definition widget.h:296
@ WF_WIDGET_HAS_INFO_LABEL
Definition widget.h:88
@ WF_RESTORE_BACKGROUND
Definition widget.h:85
@ WF_HIDDEN
Definition widget.h:68
static int widget_redraw(struct widget *pwidget)
Definition widget.h:276
#define hide(id)
Definition widget.h:238
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
#define del_group(begin_group_widget_list, end_group_widget_list)
Definition widget.h:389
struct widget * create_themeicon(SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)