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
74 enum clause_type
type,
int value);
104 if ((pdialog->treaty.plr0 == plr0 && pdialog->treaty.plr1 == plr1)
105 || (pdialog->treaty.plr0 == plr1 && pdialog->treaty.plr1 == plr0)) {
126 pdialog->treaty.accept0 = I_accepted;
127 pdialog->treaty.accept1 = other_accepted;
164 (
enum clause_type) ((pwidget->
data.
165 cont->value >> 16) & 0xFFFF),
176 enum clause_type
type,
int value)
202 enum clause_type
type,
int value)
268 clause_type = CLAUSE_CEASEFIRE;
271 clause_type = CLAUSE_PEACE;
274 clause_type = CLAUSE_ALLIANCE;
344 clause_type = CLAUSE_MAP;
347 clause_type = CLAUSE_SEAMAP;
410 CLAUSE_GOLD, amount);
414 _(
"Invalid amount of gold specified."));
462 struct widget *main_window,
469 unsigned scroll_w = 0;
494 area = pwindow->area;
575 _(
"Give shared vision"),
595 buf->string_utf8->fgcol
609 buf->string_utf8->fgcol
626 buf->string_utf8->fgcol
644 buf->string_utf8->fgcol
663 buf->string_utf8->fgcol
695 == TECH_PREREQS_KNOWN)) {
734 == TECH_PREREQS_KNOWN)) {
765 int i = 0, j = 0,
n = city_list_size(pplayer0->
cities);
766 struct city **city_list_ptrs;
772 city_list_ptrs[i] = pcity;
777 city_list_ptrs = NULL;
794 for (j = 0; j < i; j++) {
823 if (area.h < (count *
height)) {
842 (pwindow->size.w - pwindow->area.w) + area.w,
843 (pwindow->size.h - pwindow->area.h) + area.h);
845 area = pwindow->area;
893 SDL_Color bg_color = {255, 255, 255, 136};
894 struct player *pplayer0, *pplayer1;
934 pwindow->data.cont =
cont;
952 buf->private_data.cbox->state =
FALSE;
968 buf->private_data.cbox->state =
FALSE;
1007 area = pwindow->area;
1013 buf = pwindow->prev;
1451 pwindow->dst,
_(
"No"),
1468 buf->data.player = pplayer;
1472 buf->next->size.w =
buf->size.w;
1482 (pwindow->size.w - pwindow->area.w) +
area.w,
1483 (pwindow->size.h - pwindow->area.h) +
area.h);
1485 area = pwindow->area;
1500 buf = pwindow->prev;
1568 area = pwindow->area;
1574 "What are your wishes?"),
1578 "What are your wishes?"),
1608 buf->string_utf8->fgcol
1610 buf->data.player = pplayer;
1614 buf->next->size.w =
buf->size.w;
1626 _(
"Withdraw vision"),
1631 buf->data.player = pplayer;
1633 buf->string_utf8->fgcol
1637 buf->next->size.w =
buf->size.w;
1646 _(
"Call Diplomatic Meeting"),
1651 buf->data.player = pplayer;
1656 buf->next->size.w =
buf->size.w;
1663 _(
"Send them back"),
1688 (pwindow->size.w - pwindow->area.w) +
area.w,
1689 (pwindow->size.h - pwindow->area.h) +
area.h);
1691 area = pwindow->area;
1720 buf->size.x =
buf->next->size.x;
1729 buf->size.x =
buf->next->size.x;
1738 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)
int int initiated_from int int giver
int int initiated_from handle_diplomacy_remove_clause
handle_diplomacy_cancel_meeting
void init_treaty(struct Treaty *ptreaty, struct player *plr0, struct player *plr1)
bool add_clause(struct Treaty *ptreaty, struct player *pfrom, enum clause_type type, int val, struct player *client_player)
bool clause_enabled(enum clause_type type)
bool remove_clause(struct Treaty *ptreaty, struct player *pfrom, enum clause_type type, int val)
#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 player *plr0, struct player *plr1)
void handle_diplomacy_init_meeting(int counterpart, int initiated_from)
void diplomacy_dialog_init(void)
#define dialog_list_iterate_end
void handle_diplomacy_create_clause(int counterpart, int giver, enum clause_type type, int value)
void close_all_diplomacy_dialogs(void)
#define dialog_list_iterate(dialoglist, pdialog)
static struct dialog_list * dialog_list
void diplomacy_dialog_done(void)
void handle_diplomacy_accept_treaty(int counterpart, bool I_accepted, bool other_accepted)
static void popup_diplomacy_dialog(int other_player_id, int initiated_from)
SDL_Color * get_theme_color(enum theme_color themecolor)
static struct diplomacy_dialog * get_diplomacy_dialog(int other_player_id)
static int dipomatic_window_callback(struct widget *pwindow)
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 void remove_clause_widget_from_list(int counterpart, int giver, enum clause_type type, int value)
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 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
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)
#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 * active_widget_list
struct widget * end_widget_list
struct widget * begin_widget_list
struct widget * begin_active_widget_list
struct widget * end_active_widget_list
struct scroll_bar * scroll
SDL_Surface * false_theme
struct packet_game_info info
struct advanced_dialog * pdialog
struct advanced_dialog * pwants
struct advanced_dialog * poffers
bool tech_trade_allow_holes
struct city_list * cities
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_end
#define advance_index_iterate(_start, _index)
@ COLOR_THEME_DIPLODLG_MEETING_TEXT
@ COLOR_THEME_WARDLG_TEXT
@ COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT
@ COLOR_THEME_DIPLODLG_TEXT