19#ifdef SDL2_PLAIN_INCLUDE
60#define SPECLIST_TAG dialog
61#define SPECLIST_TYPE struct diplomacy_dialog
64#define dialog_list_iterate(dialoglist, pdialog) \
65 TYPED_LIST_ITERATE(struct diplomacy_dialog, dialoglist, pdialog)
66#define dialog_list_iterate_end LIST_ITERATE_END
104 if ((pdialog->treaty->plr0 ==
we && pdialog->treaty->plr1 ==
they)
105 || (pdialog->treaty->plr0 ==
they && pdialog->treaty->
plr1 ==
we)) {
164 cont->value >> 16) & 0xFFFF),
435 _(
"Invalid amount of gold specified."));
515 area = pwindow->area;
596 _(
"Give shared vision"),
616 buf->string_utf8->fgcol
630 buf->string_utf8->fgcol
647 buf->string_utf8->fgcol
665 buf->string_utf8->fgcol
680 buf->string_utf8->fgcol
700 buf->string_utf8->fgcol
739 buf->string_utf8->fgcol
752 buf->string_utf8->fgcol
758 buf->data.cont = cont;
781 buf->string_utf8->fgcol
787 buf->data.cont = cont;
823 buf->string_utf8->fgcol
833 for (j = 0; j <
i; j++) {
839 buf->string_utf8->fgcol
843 buf->data.cont = cont;
862 if (area.h < (count *
height)) {
881 (pwindow->size.w - pwindow->area.w) + area.w,
882 (pwindow->size.h - pwindow->area.h) + area.h);
884 area = pwindow->area;
974 pwindow->data.cont =
cont;
992 buf->private_data.cbox->state =
FALSE;
1008 buf->private_data.cbox->state =
FALSE;
1047 area = pwindow->area;
1053 buf = pwindow->prev;
1234 && (((
buf->data.cont->value >> 16) & 0xFFFF) == (
int)
type)
1235 && ((
buf->data.cont->value & 0xFFFF) == value))
1239 && ((
buf->data.cont->value >> 16) & 0xFFFF) == (
int)
type
1240 && (
buf->data.cont->value & 0xFFFF) == value)) {
1264 if (
buf->private_data.cbox->state) {
1266 src.w =
buf->private_data.cbox->false_theme->w / 4;
1267 src.h =
buf->private_data.cbox->false_theme->h;
1492 pwindow->dst,
_(
"No"),
1509 buf->data.player = pplayer;
1513 buf->next->size.w =
buf->size.w;
1523 (pwindow->size.w - pwindow->area.w) +
area.w,
1524 (pwindow->size.h - pwindow->area.h) +
area.h);
1526 area = pwindow->area;
1541 buf = pwindow->prev;
1609 area = pwindow->area;
1615 "What are your wishes?"),
1619 "What are your wishes?"),
1649 buf->string_utf8->fgcol
1651 buf->data.player = pplayer;
1655 buf->next->size.w =
buf->size.w;
1667 _(
"Withdraw vision"),
1672 buf->data.player = pplayer;
1674 buf->string_utf8->fgcol
1678 buf->next->size.w =
buf->size.w;
1687 _(
"Call Diplomatic Meeting"),
1692 buf->data.player = pplayer;
1697 buf->next->size.w =
buf->size.w;
1704 _(
"Send them back"),
1729 (pwindow->size.w - pwindow->area.w) +
area.w,
1730 (pwindow->size.h - pwindow->area.h) +
area.h);
1732 area = pwindow->area;
1761 buf->size.x =
buf->next->size.x;
1770 buf->size.x =
buf->next->size.x;
1779 buf->size.x =
buf->next->size.x;
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
void output_window_append(const struct ft_color color, const char *featured_text)
bool is_capital(const struct city *pcity)
const char * city_name_get(const struct city *pcity)
int city_name_compare(const void *p1, const void *p2)
#define city_list_iterate(citylist, pcity)
#define city_list_iterate_end
bool can_meet_with_player(const struct player *pplayer)
bool can_client_issue_orders(void)
void client_diplomacy_clause_string(char *buf, int bufsiz, struct Clause *pclause)
struct Treaty struct player struct player *initiator gui_recv_create_clause
struct Treaty struct player struct player *initiator struct Treaty struct player *they gui_recv_accept_treaty
struct Treaty struct player * they
bool clause_enabled(enum clause_type type)
#define clause_list_iterate_end
#define clause_list_iterate(clauselist, pclause)
const struct ft_color ftc_client
static void update_diplomacy_dialog(struct Diplomacy_dialog *pdialog)
static struct Diplomacy_dialog * create_diplomacy_dialog(struct Treaty *ptreaty, struct player *plr0, struct player *plr1)
void gui_init_meeting(struct Treaty *ptreaty, struct player *they, struct player *initiator)
void diplomacy_dialog_init(void)
#define dialog_list_iterate_end
void close_all_diplomacy_dialogs(void)
void gui_recv_remove_clause(struct Treaty *ptreaty, struct player *they)
#define dialog_list_iterate(dialoglist, pdialog)
static struct dialog_list * dialog_list
void diplomacy_dialog_done(void)
static void popup_diplomacy_dialog(struct Treaty *ptreaty, struct player *they, struct player *initiator)
void gui_prepare_clause_updt(struct Treaty *ptreaty, struct player *they)
SDL_Color * get_theme_color(enum theme_color themecolor)
static int dipomatic_window_callback(struct widget *pwindow)
static int shared_tiles_callback(struct widget *pwidget)
static int accept_treaty_callback(struct widget *pwidget)
static void update_clauses_list(struct diplomacy_dialog *pdialog)
static int remove_clause_callback(struct widget *pwidget)
static int cancel_pact_dlg_callback(struct widget *pwidget)
static void popdown_sdip_dialog(void)
static int sdip_window_callback(struct widget *pwindow)
static int withdraw_vision_dlg_callback(struct widget *pwidget)
static int cities_callback(struct widget *pwidget)
static int maps_callback(struct widget *pwidget)
static int cancel_meeting_callback(struct widget *pwidget)
static int embassy_callback(struct widget *pwidget)
static int gold_callback(struct widget *pwidget)
static void update_acceptance_icons(struct diplomacy_dialog *pdialog)
static void popdown_diplomacy_dialogs(void)
static void popdown_diplomacy_dialog(struct diplomacy_dialog *pdialog)
static int vision_callback(struct widget *pwidget)
static int techs_callback(struct widget *pwidget)
static int pact_callback(struct widget *pwidget)
static struct advanced_dialog * popup_diplomatic_objects(struct player *pplayer0, struct player *pplayer1, struct widget *main_window, bool L_R)
static struct diplomacy_dialog * get_diplomacy_dialog(struct player *they)
static int cancel_sdip_dlg_callback(struct widget *pwidget)
static int call_meeting_dlg_callback(struct widget *pwidget)
static void popup_war_dialog(struct player *pplayer)
static struct small_dialog * spy_dlg
static void remove_clause_widget_from_list(struct player *they, struct player *giver, enum clause_type type, int value)
int main_window_width(void)
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
struct sdl2_data main_data
int main_window_height(void)
#define PRESSED_EVENT(event)
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
#define FREEUTF8STR(pstr)
#define create_utf8_from_char_fonto(string_in, fonto)
@ COLOR_THEME_DIPLODLG_MEETING_TEXT
@ COLOR_THEME_WARDLG_TEXT
@ COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT
@ COLOR_THEME_DIPLODLG_TEXT
#define fc_assert(condition)
#define fc_calloc(n, esz)
const char * nation_adjective_for_player(const struct player *pplayer)
int dsend_packet_diplomacy_create_clause_req(struct connection *pc, int counterpart, int giver, enum clause_type type, int value)
int dsend_packet_diplomacy_cancel_pact(struct connection *pc, int other_player_id, enum clause_type clause)
int dsend_packet_diplomacy_init_meeting_req(struct connection *pc, int counterpart)
int dsend_packet_diplomacy_cancel_meeting_req(struct connection *pc, int counterpart)
int dsend_packet_diplomacy_remove_clause_req(struct connection *pc, int counterpart, int giver, enum clause_type type, int value)
int dsend_packet_diplomacy_accept_treaty_req(struct connection *pc, int counterpart)
struct player * player_by_number(const int player_id)
int player_number(const struct player *pplayer)
enum dipl_reason pplayer_can_make_treaty(const struct player *p1, const struct player *p2, enum diplstate_type treaty)
bool player_has_real_embassy(const struct player *pplayer, const struct player *pplayer2)
enum dipl_reason pplayer_can_cancel_treaty(const struct player *p1, const struct player *p2)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
bool gives_shared_vision(const struct player *me, const struct player *them)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
struct clause_list * clauses
struct widget * begin_active_widget_list
struct widget * end_widget_list
struct widget * end_active_widget_list
struct widget * active_widget_list
struct scroll_bar * scroll
struct widget * begin_widget_list
SDL_Surface * false_theme
struct packet_game_info info
struct advanced_dialog * pdialog
struct advanced_dialog * poffers
struct advanced_dialog * pwants
bool tech_trade_allow_holes
struct widget * begin_widget_list
struct widget * end_widget_list
int fc_snprintf(char *str, size_t n, const char *format,...)
struct advance * advance_by_number(const Tech_type_id atype)
const char * advance_name_translation(const struct advance *padvance)
#define advance_index_iterate_max(_start, _index, _max)
#define advance_index_iterate_max_end
static Tech_type_id advance_count(void)