Freeciv-3.3
Loading...
Searching...
No Matches
plrdlg.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/* SDL2 */
19#ifdef SDL2_PLAIN_INCLUDE
20#include <SDL.h>
21#else /* SDL2_PLAIN_INCLUDE */
22#include <SDL2/SDL.h>
23#endif /* SDL2_PLAIN_INCLUDE */
24
25/* utility */
26#include "astring.h"
27#include "fcintl.h"
28
29/* common */
30#include "nation.h"
31
32/* client */
33#include "client_main.h"
34#include "climisc.h"
35
36/* gui-sdl2 */
37#include "chatline.h"
38#include "colors.h"
39#include "diplodlg.h"
40#include "graphics.h"
41#include "gui_id.h"
42#include "gui_main.h"
43#include "gui_tilespec.h"
44#include "inteldlg.h"
45#include "mapview.h"
46#include "sprite.h"
47#include "themespec.h"
48#include "widget.h"
49
50#include "plrdlg.h"
51
52#ifndef M_PI
53#define M_PI 3.14159265358979323846 /* pi */
54#endif
55#ifndef M_PI_2
56#define M_PI_2 1.57079632679489661923 /* pi/2 */
57#endif
58
60
61static int player_nation_callback(struct widget *pwidget);
62
63/**********************************************************************/
66static int exit_players_dlg_callback(struct widget *pwidget)
67{
71 }
72
73 return -1;
74}
75
76/**********************************************************************/
79static int player_callback(struct widget *pwidget)
80{
81 /* We want exactly same functionality that the small dialog has. */
82 return player_nation_callback(pwidget);
83}
84
85/**********************************************************************/
88static int players_window_dlg_callback(struct widget *pwindow)
89{
94 } else {
96 widget_flush(pwindow);
97 }
98 }
99 }
100
101 return -1;
102}
103
104/**********************************************************************/
107static int toggle_draw_war_status_callback(struct widget *pwidget)
108{
110 /* exit button -> neutral -> war -> casefire -> peace -> alliance */
111 struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev;
112
114 do {
115 pplayer = pplayer->prev;
116 FREESURFACE(pplayer->gfx);
117 } while (pplayer != pplayers_dlg->begin_widget_list);
118
120 }
121
122 return -1;
123}
124
125/**********************************************************************/
129{
131 /* exit button -> neutral -> war -> casefire -> peace -> alliance */
132 struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev;
133
135 do {
136 pplayer = pplayer->prev;
137 FREESURFACE(pplayer->gfx);
138 } while (pplayer != pplayers_dlg->begin_widget_list);
139
141 }
142
143 return -1;
144}
145
146/**********************************************************************/
149static int toggle_draw_peace_status_callback(struct widget *pwidget)
150{
152 /* exit button -> neutral -> war -> casefire -> peace -> alliance */
153 struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev;
154
156 do {
157 pplayer = pplayer->prev;
158 FREESURFACE(pplayer->gfx);
159 } while (pplayer != pplayers_dlg->begin_widget_list);
160
162 }
163
164 return -1;
165}
166
167/**********************************************************************/
171{
173 /* exit button -> neutral -> war -> casefire -> peace -> alliance */
174 struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev;
175
177 do {
178 pplayer = pplayer->prev;
179 FREESURFACE(pplayer->gfx);
180 } while (pplayer != pplayers_dlg->begin_widget_list);
181
183 }
184
185 return -1;
186}
187
188/**********************************************************************/
192{
194 /* exit button -> neutral -> war -> casefire -> peace -> alliance */
195 struct widget *pplayer = pplayers_dlg->end_widget_list->prev->prev->prev->prev->prev->prev;
196
198 do {
199 pplayer = pplayer->prev;
200 FREESURFACE(pplayer->gfx);
201 } while (pplayer != pplayers_dlg->begin_widget_list);
202
204 }
205
206 return -1;
207}
208
209/**********************************************************************/
212static bool have_diplomat_info_about(struct player *pplayer)
213{
214 return (pplayer == client.conn.playing
215 || (pplayer != client.conn.playing
216 && team_has_embassy(client.conn.playing->team, pplayer)));
217}
218
219/**********************************************************************/
223{
224 if (pplayers_dlg) {
225 struct widget *pplayer0, *pplayer1;
226 struct player *pplayer;
227 int i;
228 struct astring astr = ASTRING_INIT;
229
230 /* redraw window */
232
233 /* exit button -> neutral -> war -> casefire -> peace -> alliance */
235 do {
238 pplayer = pplayer0->data.player;
239
240 for (i = 0; i < num_player_dlg_columns; i++) {
242 switch (player_dlg_columns[i].type) {
243 case COL_TEXT:
244 case COL_RIGHT_TEXT:
246 player_dlg_columns[i].func(pplayer));
247 break;
248 case COL_BOOLEAN:
250 player_dlg_columns[i].bool_func(pplayer) ?
251 _("Yes") : _("No"));
252 break;
253 default:
254 break;
255 }
256 }
257 }
258
260
261 astr_free(&astr);
262
263 /* now add some eye candy ... */
266
267 dst0.x = pplayer0->size.x + pplayer0->size.w / 2;
268 dst0.y = pplayer0->size.y + pplayer0->size.h / 2;
269
270 do {
271 pplayer1 = pplayer1->prev;
272 if (have_diplomat_info_about(pplayer)
273 || have_diplomat_info_about(pplayer1->data.player)) {
274
275 dst1.x = pplayer1->size.x + pplayer1->size.w / 2;
276 dst1.y = pplayer1->size.y + pplayer1->size.h / 2;
277
278 switch (player_diplstate_get(pplayer,
279 pplayer1->data.player)->type) {
280 case DS_ARMISTICE:
282 create_line(pplayer1->dst->surface,
283 dst0.x, dst0.y, dst1.x, dst1.y,
285 }
286 break;
287 case DS_WAR:
289 create_line(pplayer1->dst->surface,
290 dst0.x, dst0.y, dst1.x, dst1.y,
292 }
293 break;
294 case DS_CEASEFIRE:
296 create_line(pplayer1->dst->surface,
297 dst0.x, dst0.y, dst1.x, dst1.y,
299 }
300 break;
301 case DS_PEACE:
303 create_line(pplayer1->dst->surface,
304 dst0.x, dst0.y, dst1.x, dst1.y,
306 }
307 break;
308 case DS_ALLIANCE:
310 create_line(pplayer1->dst->surface,
311 dst0.x, dst0.y, dst1.x, dst1.y,
313 }
314 break;
315 default:
316 /* no contact */
317 break;
318 }
319 }
321 }
323
324 /* -------------------- */
325 /* redraw */
329
330 flush_dirty();
331 }
332}
333
334/**********************************************************************/
338{
339 struct widget *pwindow = NULL, *buf = NULL;
341 utf8_str *pstr;
343 int i, n, h;
344 double a, b, r;
346
347 if (pplayers_dlg) {
348 return;
349 }
350
351 n = 0;
352 players_iterate(pplayer) {
353 if (is_barbarian(pplayer)) {
354 continue;
355 }
356 n++;
358
359 if (n < 2) {
360 return;
361 }
362
363 pplayers_dlg = fc_calloc(1, sizeof(struct small_dialog));
364
365 pstr = create_utf8_from_char_fonto(Q_("?header:Players"),
367 pstr->style |= TTF_STYLE_BOLD;
368
369 pwindow = create_window_skeleton(NULL, pstr, 0);
370
372 set_wstate(pwindow, FC_WS_NORMAL);
373
374 add_to_gui_list(ID_WINDOW, pwindow);
375 pplayers_dlg->end_widget_list = pwindow;
376 /* ---------- */
377 /* Exit button */
378 buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
380 buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"),
384 buf->key = SDLK_ESCAPE;
385
387 /* ---------- */
388
389 for (i = 0; i < DS_LAST; i++) {
390 switch (i) {
391 case DS_ARMISTICE:
392 buf = create_checkbox(pwindow->dst,
396 buf->key = SDLK_n;
397 break;
398 case DS_WAR:
399 buf = create_checkbox(pwindow->dst,
403 buf->key = SDLK_w;
404 break;
405 case DS_CEASEFIRE:
406 buf = create_checkbox(pwindow->dst,
410 buf->key = SDLK_c;
411 break;
412 case DS_PEACE:
413 buf = create_checkbox(pwindow->dst,
417 buf->key = SDLK_p;
418 break;
419 case DS_ALLIANCE:
420 buf = create_checkbox(pwindow->dst,
424 buf->key = SDLK_a;
425 break;
426 default:
427 /* no contact */
428 continue;
429 break;
430 }
433 }
434 /* ---------- */
435
436 players_iterate(pplayer) {
437 if (is_barbarian(pplayer)) {
438 continue;
439 }
440
442 pstr->style |= (TTF_STYLE_BOLD|SF_CENTER);
443
445 {
446 /* Aim for a flag height of 60 pixels, but draw smaller flags if there
447 * are more players */
448 double zoom = DEFAULT_ZOOM * (60.0 - n) / logo->h;
449
450 zoomed = zoomSurface(logo, zoom, zoom, 1);
451 }
452
453 buf = create_icon2(zoomed, pwindow->dst,
455 | WF_FREE_THEME);
456 buf->info_label = pstr;
457
458 if (!pplayer->is_alive) {
460 pstr->style |= TTF_STYLE_BOLD;
464
465 dst.x = (zoomed->w - logo->w) / 2;
466 dst.y = (zoomed->h - logo->h) / 2;
467 alphablit(logo, NULL, zoomed, &dst, 255);
469 }
470
471 if (pplayer->is_alive) {
473 }
474
475 buf->data.player = pplayer;
476
477 buf->action = player_callback;
478
480
482
484
485 resize_window(pwindow, NULL, NULL, adj_size(500), adj_size(400));
486
487 area = pwindow->area;
488
489 r = MIN(area.w, area.h);
490 r -= ((MAX(buf->size.w, buf->size.h) * 2));
491 r /= 2;
492 a = (2.0 * M_PI) / n;
493
494 widget_set_position(pwindow,
495 (main_window_width() - pwindow->size.w) / 2,
496 (main_window_height() - pwindow->size.h) / 2);
497
498 /* exit button */
499 buf = pwindow->prev;
500
501 buf->size.x = area.x + area.w - buf->size.w - 1;
502 buf->size.y = pwindow->size.y + adj_size(2);
503
504 n = area.y;
506 pstr->style |= TTF_STYLE_BOLD;
507 pstr->bgcol = (SDL_Color) {0, 0, 0, 0};
508
509 for (i = 0; i < DS_LAST; i++) {
510 switch (i) {
511 case DS_ARMISTICE:
513 break;
514 case DS_WAR:
516 break;
517 case DS_CEASEFIRE:
519 break;
520 case DS_PEACE:
522 break;
523 case DS_ALLIANCE:
525 break;
526 default:
527 /* no contact */
528 continue;
529 break;
530 }
531
534
535 buf = buf->prev;
536 h = MAX(buf->size.h, logo->h);
537 buf->size.x = area.x + adj_size(5);
538 buf->size.y = n + (h - buf->size.h) / 2;
539
540 dst.x = adj_size(5) + buf->size.w + adj_size(6);
541 dst.y = n + (h - logo->h) / 2;
542 alphablit(logo, NULL, pwindow->theme, &dst, 255);
543 n += h;
545 }
547
548 /* first player shield */
549 buf = buf->prev;
550 buf->size.x = area.x + area.w / 2 - buf->size.w / 2;
551 buf->size.y = area.y + area.h / 2 - r - buf->size.h / 2;
552
553 n = 1;
555 do {
556 buf = buf->prev;
557 b = M_PI_2 + n * a;
558 buf->size.x = area.x + area.w / 2 - r * cos(b) - buf->size.w / 2;
559 buf->size.y = area.y + area.h / 2 - r * sin(b) - buf->size.h / 2;
560 n++;
561 } while (buf != pplayers_dlg->begin_widget_list);
562 }
563
565}
566
567/**********************************************************************/
578
579
580/* ============================== SHORT =============================== */
582
583/**********************************************************************/
587{
588 return -1;
589}
590
591/**********************************************************************/
594static int exit_players_nations_dlg_callback(struct widget *pwidget)
595{
598 flush_dirty();
599 }
600
601 return -1;
602}
603
604/**********************************************************************/
607static int player_nation_callback(struct widget *pwidget)
608{
609 struct player *pplayer = pwidget->data.player;
610 bool try_dlg = FALSE;
611 bool popdown = FALSE;
612
613 if (main_data.event.type == SDL_MOUSEBUTTONDOWN) {
614 switch (main_data.event.button.button) {
615#if 0
616 case SDL_BUTTON_LEFT:
617
618 break;
620
621 break;
622#endif /* 0 */
623 case SDL_BUTTON_RIGHT:
624 popup_intel_dialog(pplayer);
625
626 popdown = TRUE;
627 break;
628 default:
629 try_dlg = TRUE;
630 break;
631 }
632 } else if (PRESSED_EVENT(main_data.event)) {
633 try_dlg = TRUE;
634 }
635
636 if (try_dlg && pplayer != client_player()) {
637 const struct player_diplstate *ds;
638
640
641 if (ds->type != DS_NO_CONTACT
642 && (ds->type != DS_WAR
643 || can_meet_with_player(pplayer)
644 || can_intel_with_player(pplayer))) {
645 popup_diplomacy_dialog(pplayer);
646
647 popdown = TRUE;
648 } else {
649 set_output_window_text(_("You cannot interact with that player "
650 "with your current contact state - "
651 "Try right mouse button for intelligence."));
652 }
653 }
654
655 if (popdown) {
656 /* We came from one of these dialogs. Just try to pop down both -
657 * the one open will react. */
660 }
661
662 return -1;
663}
664
665/**********************************************************************/
669{
670 struct widget *pwindow = NULL, *buf = NULL;
672 utf8_str *pstr;
673 char cbuf[128], *state;
674 int n = 0, w = 0, units_h = 0;
676
677 if (short_players_dlg) {
678 return;
679 }
680
681 short_players_dlg = fc_calloc(1, sizeof(struct advanced_dialog));
682
683 /* TRANS: Nations report title */
685 pstr->style |= TTF_STYLE_BOLD;
686
687 pwindow = create_window_skeleton(NULL, pstr, 0);
688
690 set_wstate(pwindow, FC_WS_NORMAL);
691
692 add_to_gui_list(ID_WINDOW, pwindow);
694
695 area = pwindow->area;
696
697 /* ---------- */
698 /* Exit button */
699 buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
701 buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"),
703 area.w = MAX(area.w, buf->size.w + adj_size(10));
706 buf->key = SDLK_ESCAPE;
707
709 /* ---------- */
710
711 players_iterate(pplayer) {
712 if (pplayer != client.conn.playing) {
713 const struct player_diplstate *ds;
714
715 if (!pplayer->is_alive || is_barbarian(pplayer)) {
716 continue;
717 }
718
720
721 if (is_ai(pplayer)) {
722 state = _("AI");
723 } else {
724 if (pplayer->is_connected) {
725 if (pplayer->phase_done) {
726 state = _("done");
727 } else {
728 state = _("moving");
729 }
730 } else {
731 state = _("disconnected");
732 }
733 }
734
735 if (ds->type == DS_CEASEFIRE) {
736 fc_snprintf(cbuf, sizeof(cbuf), "%s(%s) - %d %s",
738 state,
739 ds->turns_left, PL_("turn", "turns", ds->turns_left));
740 } else {
741 fc_snprintf(cbuf, sizeof(cbuf), "%s(%s)",
743 state);
744 }
745
747 pstr->style |= TTF_STYLE_BOLD;
748
750
751 buf = create_iconlabel(logo, pwindow->dst, pstr,
753
754 /* At least RMB works always */
756
757 /* Now add some eye candy ... */
758 switch (ds->type) {
759 case DS_ARMISTICE:
760 buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_ARMISTICE);
761 break;
762 case DS_WAR:
763 if (can_meet_with_player(pplayer) || can_intel_with_player(pplayer)) {
764 buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_WAR);
765 } else {
766 buf->string_utf8->fgcol = *(get_theme_color(COLOR_THEME_PLRDLG_WAR_RESTRICTED));
767 }
768 break;
769 case DS_CEASEFIRE:
770 buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_CEASEFIRE);
771 break;
772 case DS_PEACE:
773 buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_PEACE);
774 break;
775 case DS_ALLIANCE:
776 buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_PLRDLG_ALLIANCE);
777 break;
778 case DS_NO_CONTACT:
779 buf->string_utf8->fgcol = *(get_theme_color(COLOR_THEME_PLRDLG_NO_CONTACT));
780 break;
781 case DS_TEAM:
782 case DS_LAST:
783 break;
784 }
785
786 buf->string_utf8->bgcol = (SDL_Color) {0, 0, 0, 0};
787
788 buf->data.player = pplayer;
789
790 buf->action = player_nation_callback;
791
793
794 area.w = MAX(w, buf->size.w);
795 area.h += buf->size.h;
796
797 if (n > 19) {
799 }
800
801 n++;
802 }
804
809
810
811 /* ---------- */
812 if (n > 20) {
815
816 n = units_h;
817 area.w += n;
818
819 units_h = 20 * buf->size.h;
820
821 } else {
822 units_h = area.h;
823 }
824
825 /* ---------- */
826
827 area.h = units_h;
828
829 resize_window(pwindow, NULL, NULL,
830 (pwindow->size.w - pwindow->area.w) + area.w,
831 (pwindow->size.h + pwindow->area.h) + area.h);
832
833 area = pwindow->area;
834
835 widget_set_position(pwindow,
836 ((main_data.event.motion.x + pwindow->size.w + adj_size(10) < main_window_width()) ?
837 (main_data.event.motion.x + adj_size(10)) :
838 (main_window_width() - pwindow->size.w - adj_size(10))),
839 ((main_data.event.motion.y - adj_size(2) + pwindow->size.h < main_window_height()) ?
840 (main_data.event.motion.y - adj_size(2)) :
841 (main_window_height() - pwindow->size.h - adj_size(10))));
842
843 w = area.w;
844
846 w -= n;
847 }
848
849 /* exit button */
850 buf = pwindow->prev;
851 buf->size.x = area.x + area.w - buf->size.w - 1;
852 buf->size.y = pwindow->size.y + adj_size(2);
853
854 /* cities */
855 buf = buf->prev;
856 setup_vertical_widgets_position(1, area.x, area.y, w, 0,
858 buf);
859
862 area.x + area.w, area.y,
863 area.h, TRUE);
864 }
865
866 /* -------------------- */
867 /* redraw */
869 widget_mark_dirty(pwindow);
870
871 flush_dirty();
872}
873
874/**********************************************************************/
SDL_Surface * zoomSurface(SDL_Surface *src, double zoomx, double zoomy, int smooth)
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
void astr_free(struct astring *astr)
Definition astring.c:148
void astr_add_line(struct astring *astr, const char *format,...)
Definition astring.c:283
#define n
Definition astring.c:77
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
Definition astring.h:93
#define ASTRING_INIT
Definition astring.h:44
bool can_meet_with_player(const struct player *pplayer)
bool can_intel_with_player(const struct player *pplayer)
struct civclient client
#define client_player()
char * incite_cost
Definition comments.c:76
QString current_theme
Definition fc_client.cpp:64
#define Q_(String)
Definition fcintl.h:70
#define PL_(String1, String2, n)
Definition fcintl.h:71
#define _(String)
Definition fcintl.h:67
static void popup_diplomacy_dialog(struct treaty *ptreaty, struct player *they, struct player *initiator)
Definition diplodlg.c:205
void popup_intel_dialog(struct player *p)
Definition inteldlg.c:167
void flush_dirty(void)
Definition mapview.c:468
void popdown_players_dialog(void)
Definition plrdlg.c:105
void real_players_dialog_update(void *unused)
Definition plrdlg.c:730
void popup_players_dialog(bool raise)
Definition plrdlg.c:91
const char * title
Definition repodlgs.c:1314
GType type
Definition repodlgs.c:1313
@ COL_TEXT
Definition unitselect.c:50
#define set_output_window_text(_pstr_)
Definition chatline.h:31
SDL_Color * get_theme_color(enum theme_color themecolor)
Definition colors.c:47
int main_window_width(void)
Definition graphics.c:685
void create_line(SDL_Surface *dest, Sint16 x0, Sint16 y0, Sint16 x1, Sint16 y1, SDL_Color *pcolor)
Definition graphics.c:1381
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
Definition graphics.c:199
struct sdl2_data main_data
Definition graphics.c:57
int main_window_height(void)
Definition graphics.c:693
#define DEFAULT_ZOOM
Definition graphics.h:198
#define FREESURFACE(ptr)
Definition graphics.h:322
@ ID_BUTTON
Definition gui_id.h:29
@ ID_LABEL
Definition gui_id.h:27
@ ID_CHECKBOX
Definition gui_id.h:35
@ ID_WINDOW
Definition gui_id.h:30
Uint32 sdl2_client_flags
Definition gui_main.c:102
#define CF_DRAW_PLAYERS_ALLIANCE_STATUS
Definition gui_main.h:62
#define CF_DRAW_PLAYERS_CEASEFIRE_STATUS
Definition gui_main.h:60
#define CF_DRAW_PLAYERS_PEACE_STATUS
Definition gui_main.h:61
#define CF_DRAW_PLAYERS_NEUTRAL_STATUS
Definition gui_main.h:63
#define adj_size(size)
Definition gui_main.h:141
#define CF_DRAW_PLAYERS_WAR_STATUS
Definition gui_main.h:59
#define PRESSED_EVENT(event)
Definition gui_main.h:71
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
Definition gui_string.c:251
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
Definition gui_string.c:425
utf8_str * create_utf8_str_fonto(char *in_text, size_t n_alloc, enum font_origin origin)
Definition gui_string.c:241
#define FREEUTF8STR(pstr)
Definition gui_string.h:93
#define SF_CENTER
Definition gui_string.h:40
@ FONTO_DEFAULT
Definition gui_string.h:65
@ FONTO_ATTENTION
Definition gui_string.h:67
#define create_utf8_from_char_fonto(string_in, fonto)
Definition gui_string.h:108
static SDL_Surface * get_nation_flag_surface(const struct nation_type *pnation)
static struct advanced_dialog * short_players_dlg
Definition plrdlg.c:581
void popdown_players_nations_dialog(void)
Definition plrdlg.c:877
static int toggle_draw_alliance_status_callback(struct widget *pwidget)
Definition plrdlg.c:170
void popup_players_nations_dialog(void)
Definition plrdlg.c:668
static int exit_players_nations_dlg_callback(struct widget *pwidget)
Definition plrdlg.c:594
static int player_callback(struct widget *pwidget)
Definition plrdlg.c:79
static int toggle_draw_neutral_status_callback(struct widget *pwidget)
Definition plrdlg.c:191
static int players_window_dlg_callback(struct widget *pwindow)
Definition plrdlg.c:88
static int toggle_draw_war_status_callback(struct widget *pwidget)
Definition plrdlg.c:107
static int toggle_draw_peace_status_callback(struct widget *pwidget)
Definition plrdlg.c:149
static int exit_players_dlg_callback(struct widget *pwidget)
Definition plrdlg.c:66
#define M_PI_2
Definition plrdlg.c:56
static int player_nation_callback(struct widget *pwidget)
Definition plrdlg.c:607
#define M_PI
Definition plrdlg.c:53
static int players_nations_window_dlg_callback(struct widget *pwindow)
Definition plrdlg.c:586
static int toggle_draw_ceasefire_status_callback(struct widget *pwidget)
Definition plrdlg.c:128
static bool have_diplomat_info_about(struct player *pplayer)
Definition plrdlg.c:212
static struct small_dialog * pplayers_dlg
Definition plrdlg.c:59
@ COLOR_THEME_PLRDLG_CEASEFIRE
@ COLOR_THEME_PLRDLG_ALLIANCE
@ COLOR_THEME_PLRDLG_PEACE
@ COLOR_THEME_PLRDLG_TEXT
@ COLOR_THEME_PLRDLG_NO_CONTACT
@ COLOR_THEME_PLRDLG_WAR_RESTRICTED
@ COLOR_THEME_PLRDLG_WAR
@ COLOR_THEME_PLRDLG_ARMISTICE
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:586
bool move_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:1016
bool select_window_group_dialog(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:998
int setup_vertical_widgets_position(int step, Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h, struct widget *begin, struct widget *end)
Definition widget.c:1051
Uint16 redraw_group(const struct widget *begin_group_widget_list, const struct widget *end_group_widget_list, int add_to_update)
Definition widget.c:720
void popdown_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:983
static void widget_set_position(struct widget *pwidget, int x, int y)
Definition widget.h:266
@ FC_WS_NORMAL
Definition widget.h:96
static void widget_mark_dirty(struct widget *pwidget)
Definition widget.h:286
static void widget_flush(struct widget *pwidget)
Definition widget.h:291
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
@ WF_WIDGET_HAS_INFO_LABEL
Definition widget.h:88
@ WF_RESTORE_BACKGROUND
Definition widget.h:85
@ WF_HIDDEN
Definition widget.h:68
@ WF_FREE_THEME
Definition widget.h:72
@ WF_DRAW_TEXT_LABEL_WITH_SPACE
Definition widget.h:87
#define show(id)
Definition widget.h:235
static int widget_redraw(struct widget *pwidget)
Definition widget.h:276
void set_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:54
struct widget * create_checkbox(struct gui_layer *pdest, bool state, Uint32 flags)
struct widget * create_themeicon(SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)
struct widget * create_icon2(SDL_Surface *icon, struct gui_layer *pdest, Uint32 flags)
struct widget * create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint32 flags)
void setup_vertical_scrollbar_area(struct scroll_bar *scroll, Sint16 start_x, Sint16 start_y, Uint16 height, bool swap_start_x)
Uint32 create_vertical_scrollbar(struct advanced_dialog *dlg, Uint8 step, Uint8 active, bool create_scrollbar, bool create_buttons)
bool resize_window(struct widget *pwindow, SDL_Surface *bcgd, SDL_Color *pcolor, Uint16 new_w, Uint16 new_h)
struct widget * create_window_skeleton(struct gui_layer *pdest, utf8_str *title, Uint32 flags)
get_token_fn_t func
Definition inputfile.c:128
#define fc_calloc(n, esz)
Definition mem.h:38
#define FC_FREE(ptr)
Definition mem.h:41
const char * nation_adjective_for_player(const struct player *pplayer)
Definition nation.c:169
struct nation_type * nation_of_player(const struct player *pplayer)
Definition nation.c:444
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
Definition player.c:220
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
Definition player.c:324
#define players_iterate_end
Definition player.h:542
#define players_iterate(_pplayer)
Definition player.h:537
static bool is_barbarian(const struct player *pplayer)
Definition player.h:491
#define is_ai(plr)
Definition player.h:232
struct player_dlg_column player_dlg_columns[]
const int num_player_dlg_columns
@ COL_BOOLEAN
@ COL_RIGHT_TEXT
void players_dialog_update(void)
#define MIN(x, y)
Definition shared.h:55
#define MAX(x, y)
Definition shared.h:54
struct widget * begin_active_widget_list
Definition widget.h:184
struct widget * end_widget_list
Definition widget.h:182
struct widget * end_active_widget_list
Definition widget.h:185
struct widget * active_widget_list
Definition widget.h:186
struct scroll_bar * scroll
Definition widget.h:187
struct widget * begin_widget_list
Definition widget.h:181
struct connection conn
Definition client_main.h:96
struct player * playing
Definition connection.h:151
enum diplstate_type type
Definition player.h:199
struct team * team
Definition player.h:261
SDL_Event event
Definition graphics.h:217
struct widget * begin_widget_list
Definition widget.h:175
struct widget * end_widget_list
Definition widget.h:176
SDL_Surface * theme
Definition widget.h:118
struct player * player
Definition widget.h:130
union widget::@223 data
struct widget * prev
Definition widget.h:114
struct gui_layer * dst
Definition widget.h:116
int(* action)(struct widget *)
Definition widget.h:157
SDL_Rect area
Definition widget.h:149
SDL_Surface * gfx
Definition widget.h:120
SDL_Rect size
Definition widget.h:145
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47