212 "Treasury contains %d gold.",
218 PL_(
"Upgrade as many %s to %s as possible for %d gold each?\n%s",
219 "Upgrade as many %s to %s as possible for %d gold each?\n%s",
255 pwindow->dst,
_(
"No"),
276 buf->next->size.w =
buf->size.w;
286 (pwindow->size.w - pwindow->area.w) +
area.w,
287 (pwindow->size.h - pwindow->area.h) +
area.h);
310 buf->size.y =
buf->next->size.y;
361 struct widget *pwindow, *last;
367 bool upgrade =
FALSE;
919 if (
pbuf->prev->prev->prev->prev->prev->prev->prev ==
937 if (pwidget !=
NULL) {
1228 x =
motion->horiz_src->size.x;
1232 x =
motion->horiz_dst->size.x;
1233 if (((
x + (-1 * dir)) >
motion->max) || ((
x + (-1 * dir)) <
motion->min)) {
1265 motion->horiz_src->size.x += dir;
1267 motion->horiz_dst->size.x -= dir;
1412 int science, luxury, tax;
1423 buf =
buf->next->next->next;
1424 luxury = *(
int *)
buf->data.ptr;
1427 tax = 100 - luxury - science;
1542 if (!
pcity->did_sell
1619 if (!
pcity->did_sell
1628 _(
"We have %d of %s\n(total value is : %d)\n"
1629 "We can sell %d of them for %d gold."),
1635 _(
"We can't sell any %s in this turn."),
1651 area = pwindow->area;
1668 pwindow->dst,
_(
"No"),
1686 buf->data.ptr = (
void *)pwidget;
1690 buf->next->size.w =
buf->size.w;
1700 (pwindow->size.w - pwindow->area.w) +
area.w,
1701 (pwindow->size.h - pwindow->area.h) +
area.h);
1703 area = pwindow->area;
1719 buf = pwindow->prev;
1726 buf->size.y =
buf->next->size.y;
1783 if (tax - total < 0) {
1816#define TARGETS_ROW 2
1817#define TARGETS_COL 4
1828 struct widget *pwindow , *last;
1832 int i, count , h = 0;
1874 area = pwindow->
area;
1914 w =
MAX(w,
buf->size.w +
buf->next->size.w);
1963 if (tax - total < 0) {
2110 0, 0, background->w - 1, background->h - 1,
2143 dst.x = (surf->w -
zoomed->w) / 2;
2144 dst.y = (surf->h / 2 -
zoomed->h) / 2;
2150 dst.y += ((surf->h - dst.y) -
2157 for (count = 0; count < p->
cost; count++) {
2172 dst.x = (surf->w -
zoomed->w) / 2;
2178 dst.x = (surf->w - text->w) / 2;
2232 (pwindow->
size.w - pwindow->
area.w) + area.w,
2233 (pwindow->
size.h - pwindow->
area.h) + area.h)) {
2237 area = pwindow->
area;
2254 buf->size.y =
buf->next->size.y +
buf->next->size.h;
2262 buf->size.y =
buf->next->size.y +
buf->next->size.h;
2270 buf->size.y =
buf->next->size.y +
buf->next->size.h;
2278 buf->size.y =
buf->next->size.y +
buf->next->size.h;
2293 dst.x, dst.y, dst.w - 1, dst.h - 1,
2341 dst.x, dst.y, dst.w - 1, dst.h - 1,
2346 buf->size.x = dst.x -
buf->size.w;
2352 buf->size.y = dst.y -1;
2357 buf->size.y = dst.y + 1;
2364 dst.x, dst.y, dst.w - 1, dst.h - 1,
2369 buf->size.x = dst.x -
buf->size.w;
2375 buf->size.y = dst.y -1;
2380 buf->size.y = dst.y + 1;
2384 buf->size.x = dst.x + (dst.w -
buf->size.w) / 2;
2389 buf->size.x = area.x + area.w -
buf->size.w - 1;
2401 area.x + area.w - 1,
2403 area.h - h - 1,
TRUE);
2461 0,0, surf->w - 1, surf->h - 1,
2469 dst.y = (surf->h - text->h) / 2;
2475 dst.x = (
adj_size(35) - text->w) / 2;
2476 dst.y = (surf->h - text->h) / 2;
2483 dst.x = (surf->w - text->w) / 2;
2490 dst.x = (surf->w -
tmp->w) / 2;
2509 dst.x = (surf->w - 2 *
surf_array[0]->w) / 2;
2519 dst.x += (*buf_array)->w;
2524 dst.x = (surf->w - 2 * (*buf_array)->w) / 2;
2526 dst.x = (surf->w - (*buf_array)->w) / 2;
2528 dst.y += (*buf_array)->h;
2550 dst.x = (surf->w -
zoomed->w) / 2;
2566 dst.x = (surf->w - (
surf_array[0]->w * 2) * zoom - 2) / 2;
2579 dst.x = (surf->w - 2 *
zoomed->w - 2 ) / 2;
2581 dst.x = (surf->w -
zoomed->w) / 2;
2721 dest.x - 1, dest.y - 1, dest.w, dest.h,
2750 dest.x +=
msurf->w + 1;
2827 dest.x +=
msurf->w + 1;
2996 if (
max_col * max_row < count) {
3051 count = (count + (
col - 1)) /
col;
3052 if (count > max_row) {
3186 if (
max_col * max_row < count) {
3222 PL_(
"step",
"steps", num));
3249 count = (count + (
col-1)) /
col;
3250 if (count > max_row) {
3369 struct widget *pwidget, *pwindow;
3396#ifdef GUI_SDL2_SMALL_SCREEN
3409 pwindow->
size.h, 1);
3534 PL_(
"%2d: The %s ruler %s scored %d point\n",
3535 "%2d: The %s ruler %s scored %d points\n",
3542 _(
"The Greatest Civilizations in the world."),
SDL_Surface * zoomSurface(SDL_Surface *src, double zoomx, double zoomy, int smooth)
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
struct @130::my_agent entries[MAX_AGENTS]
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
bool city_production_build_units(const struct city *pcity, bool add_production, int *num_units)
#define city_list_iterate(citylist, pcity)
#define output_type_iterate(output)
#define city_list_iterate_end
#define output_type_iterate_end
int city_sell_improvement(struct city *pcity, Impr_type_id sell_id)
enum client_states client_state(void)
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 struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
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
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
#define PL_(String1, String2, n)
const char * government_name_translation(const struct government *pgovern)
struct government * government_of_player(const struct player *pplayer)
void units_report_dialog_popdown(void)
void science_report_dialog_popup(bool raise)
void endgame_report_dialog_start(const struct packet_endgame_report *packet)
void real_units_report_dialog_update(void *unused)
void real_economy_report_dialog_update(void *unused)
void economy_report_dialog_popdown(void)
void economy_report_dialog_popup(bool raise)
void units_report_dialog_popup(bool raise)
void science_report_dialog_redraw(void)
void science_report_dialog_popdown(void)
void real_science_report_dialog_update(void *unused)
SDL_Color * get_theme_color(enum theme_color themecolor)
SDL_Surface * resize_surface(const SDL_Surface *psrc, Uint16 new_width, Uint16 new_height, int smooth)
int main_window_width(void)
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
void create_line(SDL_Surface *dest, Sint16 x0, Sint16 y0, Sint16 x1, Sint16 y1, SDL_Color *pcolor)
SDL_Surface * crop_rect_from_surface(SDL_Surface *psource, SDL_Rect *prect)
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
struct sdl2_data main_data
SDL_Surface * create_surf(int width, int height, Uint32 flags)
void create_frame(SDL_Surface *dest, Sint16 left, Sint16 top, Sint16 width, Sint16 height, SDL_Color *pcolor)
int main_window_height(void)
#define map_rgba(format, color)
@ ID_SCIENCE_CANCEL_DLG_BUTTON
@ ID_CHANGE_TAXRATE_DLG_SCI_SCROLLBAR
@ ID_SCIENCE_DLG_CHANGE_GOAL_CANCEL_BUTTON
@ ID_SCIENCE_DLG_CHANGE_GOAL_WINDOW
@ ID_CHANGE_TAXRATE_DLG_LUX_BLOCK_CHECKBOX
@ ID_ECONOMY_DIALOG_WINDOW
@ ID_TERRAIN_ADV_DLG_EXIT_BUTTON
@ ID_SCIENCE_DLG_CHANGE_REASARCH_WINDOW
@ ID_CHANGE_TAXRATE_DLG_SCI_LABEL
@ ID_CHANGE_TAXRATE_DLG_LUX_SCROLLBAR
@ ID_CHANGE_TAXRATE_DLG_OK_BUTTON
@ ID_SCIENCE_DLG_CHANGE_REASARCH_BUTTON
@ ID_CHANGE_TAXRATE_DLG_LUX_LABEL
@ ID_CHANGE_TAXRATE_DLG_SCI_BLOCK_CHECKBOX
@ ID_SCIENCE_DLG_CHANGE_GOAL_BUTTON
@ ID_CHANGE_TAXRATE_DLG_CANCEL_BUTTON
int FilterMouseMotionEvents(void *data, SDL_Event *event)
Uint16 gui_event_loop(void *data, void(*loop_action)(void *data), Uint16(*key_down_handler)(SDL_Keysym key, void *data), Uint16(*key_up_handler)(SDL_Keysym key, void *data), Uint16(*textinput_handler)(const char *text, void *data), Uint16(*finger_down_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*finger_up_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*finger_motion_handler)(SDL_TouchFingerEvent *touch_event, void *data), Uint16(*mouse_button_down_handler)(SDL_MouseButtonEvent *button_event, void *data), Uint16(*mouse_button_up_handler)(SDL_MouseButtonEvent *button_event, void *data), Uint16(*mouse_motion_handler)(SDL_MouseMotionEvent *motion_event, void *data))
#define CF_CHANGE_TAXRATE_SCI_BLOCK
struct widget * selected_widget
#define DEFAULT_MOVE_STEP
#define PRESSED_EVENT(event)
#define CF_CHANGE_TAXRATE_LUX_BLOCK
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
utf8_str * create_utf8_str_fonto(char *in_text, size_t n_alloc, enum font_origin origin)
SDL_Surface * create_text_surf_smaller_than_w(utf8_str *pstr, int w)
#define create_utf8_from_char(string_in, ptsize)
#define FREEUTF8STR(pstr)
#define create_utf8_from_char_fonto(string_in, fonto)
SDL_Color * get_tech_color(Tech_type_id tech_id)
SDL_Surface * get_tech_icon(Tech_type_id tech)
static SDL_Surface * get_building_surface(const struct impr_type *pimprove)
static SDL_Surface * get_unittype_surface(const struct unit_type *punittype, enum direction8 facing)
void popup_tech_info(Tech_type_id tech)
struct widget * get_research_widget(void)
struct widget * get_tax_rates_widget(void)
static int popdown_science_dialog_callback(struct widget *pwidget)
static void popup_change_research_goal_dialog(void)
static int sell_impr_window_callback(struct widget *pwindow)
static int eg_player_count
static int eg_players_received
static struct advanced_dialog * units_dlg
static int exit_economy_dialog_callback(struct widget *pwidget)
static int ok_sell_impr_callback(struct widget *pwidget)
static int cancel_sell_impr_callback(struct widget *pwidget)
static int horiz_taxrate_callback(struct widget *horiz_src)
SDL_Surface * create_select_tech_icon(utf8_str *pstr, Tech_type_id tech_id, enum tech_info_mode mode)
static int ok_upgrade_unit_window_callback(struct widget *pwidget)
void science_report_dialogs_popdown_all(void)
static struct small_dialog * science_dlg
static int change_research_goal_callback(struct widget *pwidget)
static int economy_dialog_callback(struct widget *pwindow)
static struct advanced_dialog * change_tech_dlg
static int apply_taxrates_callback(struct widget *button)
static int toggle_block_callback(struct widget *pcheckbox)
static void real_activeunits_report_dialog_update(struct units_entry *units, struct units_entry *total)
static void enable_economy_dlg(void)
static int cancel_upgrade_unit_callback(struct widget *pwidget)
static struct small_dialog * economy_sell_dlg
static int popup_change_research_goal_dialog_callback(struct widget *pwidget)
static char eg_buffer[150 *MAX_NUM_PLAYERS]
static void popup_change_research_dialog(void)
static int change_research_goal_dialog_callback(struct widget *pwindow)
static int exit_change_tech_dlg_callback(struct widget *pwidget)
static int exit_units_dlg_callback(struct widget *pwidget)
static void disable_science_dialog(void)
static void enable_science_dialog(void)
static int popup_change_research_dialog_callback(struct widget *pwidget)
static void get_units_report_data(struct units_entry *entries, struct units_entry *total)
static struct advanced_dialog * economy_dlg
static Uint16 report_scroll_mouse_button_up(SDL_MouseButtonEvent *button_event, void *data)
static int upgrade_unit_window_callback(struct widget *pwindow)
static int units_dialog_callback(struct widget *pwindow)
static int popup_upgrade_unit_callback(struct widget *pwidget)
static int popup_sell_impr_callback(struct widget *pwidget)
static Uint16 report_scroll_mouse_motion_handler(SDL_MouseMotionEvent *motion_event, void *data)
static int science_dialog_callback(struct widget *pwindow)
static int change_research_callback(struct widget *pwidget)
static struct small_dialog * units_upg_dlg
static void disable_economy_dlg(void)
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ BACKGROUND_CHANGERESEARCHDLG
@ COLOR_THEME_ECONOMYDLG_TEXT
@ COLOR_THEME_SCIENCEDLG_MED_TECHICON_BG
@ COLOR_THEME_UNITUPGRADE_TEXT
@ COLOR_THEME_UNITSREP_FRAME
@ COLOR_THEME_ECONOMYDLG_FRAME
@ COLOR_THEME_SELLIMPR_TEXT
@ COLOR_THEME_UNITSREP_TEXT
@ COLOR_THEME_ECONOMYDLG_NEG_TEXT
@ COLOR_THEME_SCIENCEDLG_FRAME
@ COLOR_THEME_SCIENCEDLG_TEXT
struct theme * active_theme
struct impr_type * improvement_by_number(const Impr_type_id id)
int impr_sell_gold(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_calloc(n, esz)
const char * nation_adjective_for_player(const struct player *pplayer)
int dsend_packet_player_rates(struct connection *pc, int tax, int luxury, int science)
int dsend_packet_player_tech_goal(struct connection *pc, int tech)
int dsend_packet_player_research(struct connection *pc, int tech)
int dsend_packet_unit_type_upgrade(struct connection *pc, Unit_type_id type)
const char * science_dialog_text(void)
struct player * player_by_number(const int player_id)
const char * player_name(const struct player *pplayer)
void get_economy_report_data(struct improvement_entry *entries, int *num_entries_used, int *total_cost, int *total_income)
endgame_report_dialog_player
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
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 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
struct city_list * cities
struct player_economic economic
struct widget * label_dst
struct widget * label_src
struct widget * horiz_src
struct widget * horiz_dst
struct widget * begin_widget_list
struct widget * end_widget_list
struct unit::@84::@86 client
const struct unit_type * utype
int fc_snprintf(char *str, size_t n, const char *format,...)
int cat_snprintf(char *str, size_t n, const char *format,...)
struct advance * advance_by_number(const Tech_type_id atype)
bool is_future_tech(Tech_type_id tech)
const char * advance_name_translation(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_index_iterate_max(_start, _index, _max)
#define advance_index_iterate_end
#define advance_index_iterate_max_end
static Tech_type_id advance_count(void)
#define advance_index_iterate(_start, _index)
const char * get_science_target_text(double *percent)
const char * get_science_goal_text(Tech_type_id goal)
int tileset_full_tile_width(const struct tileset *t)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
bool is_tech_req_for_utype(const struct unit_type *ptype, struct advance *padv)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
struct unit_type * utype_by_number(const Unit_type_id id)
Unit_type_id utype_number(const struct unit_type *punittype)
Unit_type_id utype_index(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
int unit_upgrade_price(const struct player *pplayer, const struct unit_type *from, const struct unit_type *to)
#define unit_type_iterate(_p)
#define unit_type_iterate_end