148 switch ((
enum gen_action)tgt_action_id) {
149 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
150 return ACTION_SPY_SABOTAGE_CITY;
151 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
152 return ACTION_SPY_SABOTAGE_CITY_ESC;
153 case ACTION_SPY_TARGETED_STEAL_TECH:
154 return ACTION_SPY_STEAL_TECH;
155 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
156 return ACTION_SPY_STEAL_TECH_ESC;
171 switch ((
enum gen_action)tgt_action_id) {
172 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
173 return ACTION_SPY_SABOTAGE_CITY_PRODUCTION;
174 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
175 return ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC;
176 case ACTION_STRIKE_BUILDING:
177 return ACTION_STRIKE_PRODUCTION;
296 int steal_advance =
MAX_ID - pwidget->
id;
302 if (steal_advance ==
A_UNSET) {
331 const struct research *presearch, *vresearch;
334 struct player *victim = NULL;
376 int target_id = vcity->
id;
387 cont->
id0 = vcity->
id;
398 pstr->
style |= TTF_STYLE_BOLD;
408 area = pwindow->
area;
420 buf->
key = SDLK_ESCAPE;
437 if (max_col * max_row < count) {
441 if (count < max_col + 1) {
444 if (count < max_col +
adj_size(3)) {
447 if (count < max_col +
adj_size(5)) {
477 if (count > (col * max_row)) {
520 count = (count + (col - 1)) / col;
521 if (count > max_row) {
536 (pwindow->
size.w - pwindow->
area.w) + area.w,
537 (pwindow->
size.h - pwindow->
area.h) + area.h)) {
541 area = pwindow->
area;
549 buf->
size.x = area.x + area.w - buf->
size.w - 1;
559 area.x + area.w, area.y,
709 int actor_id, target_id, sub_target;
782 case ASTK_EXTRA_NOT_THERE:
872 struct unit *act_unit,
873 struct tile *tgt_tile,
874 struct city *tgt_city,
875 struct unit *tgt_unit,
955 "Diplomat queue problem. Is another diplomat window open?");
980 pstr->
style |= TTF_STYLE_BOLD;
990 area = pwindow->
area;
1102 area.w =
MAX(area.w, buf->size.w);
1103 area.h += buf->size.h;
1110 buf->key = SDLK_ESCAPE;
1114 area.w =
MAX(area.w, buf->size.w);
1115 area.h += buf->size.h;
1122 (pwindow->
size.w - pwindow->
area.w) + area.w,
1123 (pwindow->
size.h - pwindow->
area.h) + area.h);
1125 area = pwindow->
area;
1133 buf = pwindow->
prev;
1136 area.y + 1, area.w, 0,
1262 int sabotage_improvement =
MAX_ID - pwidget->
id;
1270 if (sabotage_improvement == 1000) {
1271 sabotage_improvement = -1;
1276 if (sabotage_improvement ==
B_LAST) {
1279 diplomat_id, diplomat_target_id,
1280 sabotage_improvement,
"");
1281 }
else if (sabotage_improvement == -1) {
1284 diplomat_id, diplomat_target_id,
1285 sabotage_improvement,
"");
1289 diplomat_id, diplomat_target_id,
1290 sabotage_improvement,
"");
1305 const struct action *paction)
1310 SDL_Rect area, area2;
1311 int n, w = 0, h, imp_h = 0, y;
1331 cont->
id0 = pcity->
id;
1337 pstr->
style |= TTF_STYLE_BOLD;
1347 area = pwindow->
area;
1356 area.w += buf->size.w +
adj_size(10);
1359 buf->key = SDLK_ESCAPE;
1369 buf->data.cont = cont;
1374 area.w =
MAX(area.w, buf->size.w);
1375 area.h += buf->size.h;
1381 area.h += buf->next->size.h;
1389 if (pimprove->sabotage > 0) {
1393 buf->data.cont = cont;
1398 area.w =
MAX(area.w , buf->size.w);
1399 imp_h += buf->size.h;
1419 area.h += buf->next->size.h;
1433 buf->data.cont = cont;
1438 area.w =
MAX(area.w, buf->size.w);
1439 area.h += buf->size.h;
1450 imp_h = 10 * buf->
size.h;
1463 (pwindow->
size.w - pwindow->
area.w) + area.w,
1464 (pwindow->
size.h - pwindow->
area.h) + area.h);
1466 area = pwindow->
area;
1475 buf = pwindow->
prev;
1476 buf->
size.x = area.x + area.w - buf->size.w - 1;
1482 buf->size.x = area.x;
1483 buf->size.y = y = area.y + 1;
1497 buf->size.x = buf->next->size.x;
1498 buf->size.y = y = y + buf->next->size.h;
1505 area2.y = buf->size.h / 2 - 1;
1506 area2.w = buf->size.w -
adj_size(20);
1508 SDL_FillRect(buf->theme , &area2,
map_rgba(buf->theme->format,
1611 const struct action *paction)
1640 "Treasury contains %d gold.",
1688 _(
"City can't be incited!"),
NULL);
1698 PL_(
"Incite a revolt for %d gold?\n%s",
1699 "Incite a revolt for %d gold?\n%s",
cost),
cost,
tBuf);
1712 buf->data.city = pcity;
1749 PL_(
"Inciting a revolt costs %d gold.\n%s",
1750 "Inciting a revolt costs %d gold.\n%s",
cost),
cost,
tBuf);
1761 _(
"Traitors Demand Too Much!"),
NULL);
1874 const struct action *paction)
1903 "Treasury contains %d gold.",
1927 PL_(
"Bribe unit for %d gold?\n%s",
1977 PL_(
"Bribing the unit costs %d gold.\n%s",
1978 "Bribing the unit costs %d gold.\n%s",
cost),
cost,
tBuf);
1989 _(
"Traitors Demand Too Much!"),
NULL);
const char * action_prepare_ui_name(action_id act_id, const char *mnemonic, const struct act_prob prob, const char *custom)
enum action_actor_kind action_get_actor_kind(const struct action *paction)
bool action_prob_possible(const struct act_prob probability)
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
enum action_target_kind action_get_target_kind(const struct action *paction)
static struct action * action_by_number(action_id act_id)
#define action_iterate_end
#define action_id_get_actor_kind(act_id)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
const char * city_name_get(const struct city *pcity)
#define INCITE_IMPOSSIBLE_COST
#define city_owner(_pcity_)
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
void client_unit_init_act_prob_cache(struct unit *punit)
void action_selection_no_longer_in_progress(const int old_actor_id)
void request_do_action(action_id action, int actor_id, int target_id, int sub_tgt, const char *name)
void request_action_details(action_id action, int actor_id, int target_id)
void action_decision_clear_want(const int old_actor_id)
void auto_center_on_focus_unit(void)
void action_selection_next_in_focus(const int old_actor_id)
struct unit struct city struct unit * target_unit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id popup_bribe_dialog
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs action_selection_no_longer_in_progress_gui_specific
struct unit struct city struct unit struct tile * target_tile
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
struct unit struct city * target_city
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 int cost
struct unit struct city struct unit struct tile struct extra_type * target_extra
#define IDENTITY_NUMBER_ZERO
#define PL_(String1, String2, n)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
int action_selection_target_extra(void)
int action_selection_target_tile(void)
int action_selection_actor_unit(void)
static void spy_steal_popup_shared(GtkWidget *w, gpointer data)
void action_selection_close(void)
int action_selection_target_city(void)
static void action_entry(GtkWidget *shl, action_id act_id, const struct act_prob *act_probs, const char *custom, action_id act_num)
static void spy_steal_esc_popup(GtkWidget *w, gpointer data)
static void spy_steal_popup(GtkWidget *w, gpointer data)
static action_id get_non_targeted_action_id(action_id tgt_action_id)
static void found_city_callback(GtkWidget *w, gpointer data)
void action_selection_refresh(struct unit *actor_unit, struct city *target_city, struct unit *target_unit, struct tile *target_tile, struct extra_type *target_extra, const struct act_prob *act_probs)
static void simple_action_callback(GtkWidget *w, gpointer data)
static bool is_more_user_input_needed
static void act_sel_wait_callback(GtkWidget *w, gpointer data)
static action_id get_production_targeted_action_id(action_id tgt_action_id)
static bool did_not_decide
void popup_sabotage_dialog(struct unit *actor, struct city *pcity, const struct action *paction)
int action_selection_target_unit(void)
void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost, const struct action *paction)
static const GCallback af_map[ACTION_COUNT]
static void upgrade_callback(GtkWidget *w, gpointer data)
static struct diplomat_dialog * diplomat_dlg
static struct small_diplomat_dialog * incite_dlg
static int exit_incite_dlg_callback(struct widget *pwidget)
static int incite_dlg_window_callback(struct widget *pwindow)
static int spy_sabotage_request(struct widget *pwidget)
bool is_unit_move_blocked
static int diplomat_bribe_yes_callback(struct widget *pwidget)
static int spy_strike_bld_request(struct widget *pwidget)
static int sabotage_impr_callback(struct widget *pwidget)
static int bribe_dlg_window_callback(struct widget *pwindow)
static void act_sel_done_primary(int actor_unit_id)
static int diplomat_incite_yes_callback(struct widget *pwidget)
static int diplomat_close_callback(struct widget *pwidget)
static int spy_sabotage_esc_request(struct widget *pwidget)
static int diplomat_dlg_window_callback(struct widget *pwindow)
static int spy_incite_callback(struct widget *pwidget)
static void act_sel_done_secondary(int actor_unit_id)
void popdown_diplomat_dialog(void)
static int exit_bribe_dlg_callback(struct widget *pwidget)
void popdown_incite_dialog(void)
void popdown_bribe_dialog(void)
static int exit_spy_tgt_dlg_callback(struct widget *pwidget)
static int spy_steal_dlg_window_callback(struct widget *pwindow)
static int spy_steal_callback(struct widget *pwidget)
static int diplomat_bribe_callback(struct widget *pwidget)
static int diplomat_incite_callback(struct widget *pwidget)
int(* act_func)(struct widget *)
static struct small_diplomat_dialog * bribe_dlg
SDL_Color * get_theme_color(enum theme_color themecolor)
void put_window_near_map_tile(struct widget *pwindow, int window_width, int window_height, struct tile *ptile)
void popup_unit_upgrade_dlg(struct unit *punit, bool city)
int main_window_width(void)
struct sdl2_data main_data
SDL_Surface * create_surf(int width, int height, Uint32 flags)
int main_window_height(void)
#define map_rgba(format, color)
#define PRESSED_EVENT(event)
SDL_Surface * create_select_tech_icon(utf8_str *pstr, Tech_type_id tech_id, enum tech_info_mode mode)
@ ID_TERRAIN_ADV_DLG_WINDOW
@ ID_BRIBE_DLG_EXIT_BUTTON
@ ID_TERRAIN_ADV_DLG_EXIT_BUTTON
@ ID_INCITE_DLG_EXIT_BUTTON
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
utf8_str * create_utf8_str_fonto(char *in_text, size_t n_alloc, enum font_origin origin)
#define FREEUTF8STR(pstr)
#define create_utf8_from_char_fonto(string_in, fonto)
struct impr_type * improvement_by_number(const Impr_type_id id)
Impr_type_id improvement_number(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
#define fc_assert(condition)
#define fc_assert_ret_msg(condition, message,...)
#define fc_assert_action(condition, action)
#define fc_assert_ret_val_msg(condition, val, message,...)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
#define fc_calloc(n, esz)
int dsend_packet_city_name_suggestion_req(struct connection *pc, int unit_id16, int unit_id32)
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)
enum act_tgt_compl target_complexity
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
struct packet_game_info info
int sub_target_id[ASTK_COUNT]
struct advanced_dialog * pdialog
int target_ids[ATK_COUNT]
bool tech_steal_allow_holes
struct widget * begin_widget_list
struct widget * end_widget_list
struct small_dialog * pdialog
struct unit::@80::@82 client
struct act_prob * act_prob_cache
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)
struct advance * valid_advance_by_number(const Tech_type_id id)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)
const char * get_act_sel_action_custom_text(struct action *paction, const struct act_prob prob, const struct unit *actor_unit, const struct city *target_city)
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ COLOR_THEME_SABOTAGEDLG_SEPARATOR
struct theme * active_theme
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
const struct unit_type * unit_type_get(const struct unit *punit)
const char * unit_name_translation(const struct unit *punit)