/**************************************************************** Ask the server how much the bribe is *****************************************************************/ static void diplomat_bribe_callback(GtkWidget *w, gpointer data) { if (NULL != game_unit_by_number(diplomat_id) && NULL != game_unit_by_number(diplomat_target_id)) { request_diplomat_answer(DIPLOMAT_BRIBE, diplomat_id, diplomat_target_id, 0); } gtk_widget_destroy(diplomat_dialog); }
/**************************************************************** Requests up-to-date list of improvements, the return of which will trigger the popup_sabotage_dialog() function. *****************************************************************/ static void spy_request_sabotage_list(GtkWidget *w, gpointer data) { if (NULL != game_unit_by_number(diplomat_id) && NULL != game_city_by_number(diplomat_target_id)) { request_diplomat_answer(DIPLOMAT_SABOTAGE, diplomat_id, diplomat_target_id, 0); } gtk_widget_destroy(diplomat_dialog); }
/**************************************************************** ... Ask the server how much the revolt is going to cost us *****************************************************************/ static void diplomat_incite_callback(GtkWidget *w, gpointer data) { if (NULL != game_unit_by_number(diplomat_id) && NULL != game_city_by_number(diplomat_target_id[ATK_CITY])) { request_diplomat_answer(DIPLOMAT_INCITE, diplomat_id, diplomat_target_id[ATK_CITY], 0); } gtk_widget_destroy(diplomat_dialog); }
/************************************************************************** Asks the server how much the bribe is **************************************************************************/ static void diplomat_bribe_callback(Widget w, XtPointer client_data, XtPointer call_data) { destroy_message_dialog(w); if (NULL != game_unit_by_number(diplomat_id) && NULL != game_unit_by_number(diplomat_target_id)) { request_diplomat_answer(DIPLOMAT_BRIBE, diplomat_id, diplomat_target_id, 0); } }
/************************************************************************** Requests up-to-date list of improvements, the return of which will trigger the popup_sabotage_dialog() function. **************************************************************************/ static void spy_request_sabotage_list(Widget w, XtPointer client_data, XtPointer call_data) { destroy_message_dialog(w); diplomat_dialog = NULL; if (NULL != game_unit_by_number(diplomat_id) && NULL != game_city_by_number(diplomat_target_id)) { request_diplomat_answer(DIPLOMAT_SABOTAGE, diplomat_id, diplomat_target_id, 0); } }
/**************************************************************** Requests up-to-date list of improvements, the return of which will trigger the popup_sabotage_dialog() function. *****************************************************************/ static int spy_sabotage_request(struct widget *pWidget) { if (NULL != game_unit_by_number(pDiplomat_Dlg->diplomat_id) && NULL != game_city_by_number(pDiplomat_Dlg->diplomat_target_id)) { request_diplomat_answer(DIPLOMAT_SABOTAGE, pDiplomat_Dlg->diplomat_id, pDiplomat_Dlg->diplomat_target_id, 0); } popdown_diplomat_dialog(); return -1; }
/**************************************************************** ... Ask the server how much the bribe is *****************************************************************/ static int diplomat_bribe_callback(struct widget *pWidget) { if (Main.event.button.button == SDL_BUTTON_LEFT) { if (NULL != game_unit_by_number(pDiplomat_Dlg->diplomat_id) && NULL != game_unit_by_number(pDiplomat_Dlg->diplomat_target_id)) { request_diplomat_answer(DIPLOMAT_BRIBE, pDiplomat_Dlg->diplomat_id, pDiplomat_Dlg->diplomat_target_id, 0); } popdown_diplomat_dialog(); } return -1; }