131 &&
editor->worklist_copy.entries[
i].value.building ==
132 editor->worklist_copy.entries[j].value.building) {
144 &&
editor->worklist_copy.entries[
i].value.building ==
145 editor->currently_building.value.building) {
255 if (
editor->work->begin_active_widget_list) {
256 dock =
editor->work->begin_active_widget_list;
268 editor->work->scroll->up_left_button->size.h + 1,
270 editor->work->end_widget_list);
302 if (
one->kind !=
two->kind) {
334 editor->currently_building = *prod;
457 if (
item->data.ptr) {
461 if (
buf !=
editor->work->begin_active_widget_list) {
464 *((
int *)
buf->data.ptr) = *((
int *)
buf->data.ptr) - 1;
465 }
while (
buf !=
editor->work->begin_active_widget_list);
481 if (
buf !=
editor->work->begin_active_widget_list) {
484 *((
int *)
buf->data.ptr) = *((
int *)
buf->data.ptr) - 1;
485 }
while (
buf !=
editor->work->begin_active_widget_list);
498 editor->work->end_widget_list);
530 bool changed =
FALSE;
533 if (
item ==
editor->work->begin_active_widget_list) {
538 text =
item->string_utf8->text;
542 if (
item->data.ptr) {
544 int row = *((
int *)
item->data.ptr);
559 item->string_utf8->text =
item->prev->string_utf8->text;
562 item->prev->string_utf8->text = text;
585 char *text =
item->string_utf8->text;
587 bool changed =
FALSE;
591 if (
item ==
editor->work->end_active_widget_list) {
598 if (
item->data.ptr && *((
int *)
item->data.ptr) > 0) {
600 int row = *((
int *)
item->data.ptr);
617 item->string_utf8->text =
item->next->string_utf8->text;
620 item->next->string_utf8->text = text;
708 pworklist->entries[count].value.building),
722 buf,
editor->work->begin_active_widget_list,
779 if (
buf !=
editor->work->begin_active_widget_list) {
781 if (
buf !=
editor->work->begin_active_widget_list) {
785 }
while (
buf !=
editor->work->begin_active_widget_list);
820 *((
int *)
buf->data.ptr) = count;
905 *progress = ((
float)stock /
cost) * 100.0;
906 if (!
width && stock) {
949 PL_(
"%s\n%d gold per turn",
950 "%s\n%d gold per turn", output),
955 PL_(
"%s\n%d infrapoint per turn",
956 "%s\n%d infrapoints per turn", output),
969 name, turns,
PL_(
"turn",
"turns", turns));
980 editor->production_name->size.x =
editor->end_widget_list->area.x +
984 area.x =
editor->end_widget_list->area.x;
985 area.y =
editor->production_name->size.y;
987 area.h =
editor->production_name->size.h;
998 editor->production_progress->theme =
1026 PL_(
"( %d entry )",
"( %d entries )",
len),
len);
1032 editor->worklist_counter->size.x =
editor->end_widget_list->area.x +
1042 area.x =
editor->end_widget_list->area.x;
1043 area.y =
editor->worklist_counter->size.y;
1045 area.h =
editor->worklist_counter->size.h;
1061 int count = 0, turns;
1086 editor->global_worklist_id = -1;
1121 editor->end_widget_list = pwindow;
1123 area = pwindow->area;
1143 PL_(
"( %d entry )",
"( %d entries )",
len),
len);
1165 PL_(
"%s\n%d gold per turn",
1166 "%s\n%d gold per turn", output),
1170 PL_(
"%s\n%d infrapoint per turn",
1171 "%s\n%d infrapoints per turn", output),
1177 if (
pcity->shield_stock < count) {
1183 name, turns,
PL_(
"turn",
"turns", turns));
1256 editor->work->scroll->count = 0;
1258 editor->work->scroll->step = 1;
1281 editor->work->end_active_widget_list =
editor->work->end_widget_list;
1282 editor->work->begin_active_widget_list =
editor->work->begin_widget_list;
1283 editor->work->scroll->count++;
1299 prod.value.building),
1310 *((
int *)
buf->data.ptr) = count;
1316 if (count >
editor->work->scroll->active - 1) {
1324 editor->work->end_widget_list = last->prev;
1325 editor->work->end_active_widget_list =
editor->work->end_widget_list;
1328 editor->work->begin_active_widget_list =
editor->work->begin_widget_list;
1331 editor->work->end_widget_list = last;
1333 editor->work->begin_widget_list = last;
1338 editor->work->active_widget_list =
editor->work->end_active_widget_list;
1358 editor->work->scroll->count += count;
1359 last =
editor->work->begin_widget_list;
1386 editor->global->end_widget_list = last->prev;
1387 editor->global->end_active_widget_list =
editor->global->end_widget_list;
1388 editor->global->begin_widget_list =
buf;
1389 editor->global->begin_active_widget_list =
editor->global->begin_widget_list;
1392 editor->global->active_widget_list =
editor->global->end_active_widget_list;
1396 editor->global->scroll->down_right_button->size.w =
adj_size(122);
1406 last =
editor->global->begin_widget_list;
1445 state =
_(
"Obsolete");
1450 state =
_(
"Destroyed");
1452 state =
_(
"Great Wonder");
1458 state =
_(
"Small Wonder");
1476 PL_(
"shield",
"shields",
cost),
1481 PL_(
"shield",
"shields",
cost),
_(
"never"));
1487 PL_(
"shield",
"shields",
cost),
1488 turns,
PL_(
"turn",
"turns", turns));
1492 PL_(
"shield",
"shields",
cost),
1493 turns,
PL_(
"turn",
"turns", turns));
1502 "%d gold per turn", output),
1506 "%d infrapoints per turn", output),
1520 PL_(
"shield",
"shields",
cost));
1524 PL_(
"shield",
"shields",
cost));
1548 dst.x = (icon->w -
zoomed->w) / 2;
1549 dst.y = (icon->h/2 -
zoomed->h) / 2;
1555 dst.y += ((icon->h - dst.y) - (
text_name->h + text->h)) / 2;
1558 dst.x = (icon->w - text->w) / 2;
1618 _(
"(%d/%d/%s)\n%d/%d %s\nnever"),
1623 PL_(
"shield",
"shields",
cost));
1626 _(
"(%d/%d/%s)\n%d/%d %s\n%d %s"),
1631 PL_(
"shield",
"shields",
cost),
1632 turns,
PL_(
"turn",
"turns", turns));
1638 _(
"(%d/%d/%s)\n%d %s"),
1643 PL_(
"shield",
"shields",
cost));
1652 dst.x = (icon->w -
zoomed->w) / 2;
1653 dst.y = (icon->h / 2 -
zoomed->h) / 2;
1658 dst.y = icon->h / 2 + (icon->h / 2 - (
text_name->h + text->h)) / 2;
1661 dst.x = (icon->w - text->w) / 2;
1689 editor->targets->end_widget_list = last->prev;
1690 editor->targets->begin_widget_list =
buf;
1691 editor->targets->end_active_widget_list =
editor->targets->end_widget_list;
1692 editor->targets->begin_active_widget_list =
editor->targets->begin_widget_list;
1693 editor->targets->active_widget_list =
editor->targets->end_active_widget_list;
1704 editor->begin_widget_list =
editor->targets->begin_widget_list;
1712 (pwindow->size.w - pwindow->area.w) + area.w,
1713 (pwindow->size.h - pwindow->area.h) + area.h)) {
1717 area = pwindow->area;
1730 dst.x, dst.y, dst.w - 1, dst.h - 1,
1733 dst.x + 2, dst.y + 2, dst.w - 5, dst.h - 5,
1743 dst.x, dst.y, dst.w - 1, dst.h - 1,
1750 dst.h = pwindow->size.h - dst.y -
adj_size(4);
1757 dst.x, dst.y, dst.w - 1, dst.h - 1,
1770 buf = pwindow->prev;
1777 buf->size.y =
buf->next->size.y +
buf->next->size.h;
1787 buf->size.y =
buf->next->size.y +
buf->next->size.h;
1814 editor->work->end_widget_list);
1827 (
editor->global->scroll ?
1828 editor->global->scroll->up_left_button->size.h + 1 : 0),
1830 editor->global->end_widget_list);
1832 if (
editor->global->scroll) {
1844 0, 0,
editor->targets->begin_widget_list,
1845 editor->targets->end_widget_list);
1847 if (
editor->targets->scroll) {
1870 editor->end_widget_list);
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 canvas int int struct sprite int int int width
int city_turns_to_build(const struct city *pcity, const struct universal *target, bool include_shield_stock)
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
int city_production_build_shield_cost(const struct city *pcity)
const char * city_name_get(const struct city *pcity)
bool can_city_build_later(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
int city_change_production_penalty(const struct city *pcity, const struct universal *target)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
bool city_production_is_genus(const struct city *pcity, enum impr_genus_id genus)
bool can_city_build_improvement_later(const struct city *pcity, const struct impr_type *pimprove)
bool can_city_build_unit_later(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
const char * city_production_name_translation(const struct city *pcity)
int city_set_worklist(struct city *pcity, const struct worklist *pworklist)
int city_change_production(struct city *pcity, struct universal *target)
cid cid_encode_building(const struct impr_type *pimprove)
cid cid_encode(struct universal target)
struct universal cid_decode(cid id)
cid cid_encode_unit(const struct unit_type *punittype)
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
static struct editor_state * editor
#define PL_(String1, String2, n)
struct global_worklist * global_worklist_by_id(int id)
bool global_worklist_set(struct global_worklist *pgwl, const struct worklist *pwl)
const char * global_worklist_name(const struct global_worklist *pgwl)
int global_worklist_id(const struct global_worklist *pgwl)
const struct worklist * global_worklist_get(const struct global_worklist *pgwl)
void global_worklist_set_name(struct global_worklist *pgwl, const char *name)
#define global_worklists_iterate(pgwl)
#define global_worklists_iterate_end
bool city_dialog_is_open(struct city *pcity)
void update_worklist_report_dialog(void)
void enable_city_dlg_widgets(void)
SDL_Color * get_theme_color(enum theme_color themecolor)
int main_window_width(void)
void layer_rect_to_screen_rect(struct gui_layer *gui_layer, SDL_Rect *dest_rect)
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, 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)
#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)
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 FREEUTF8STR(pstr)
#define create_utf8_from_char_fonto(string_in, fonto)
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_impr_info(Impr_type_id impr)
void popup_unit_info(Unit_type_id type_id)
void dirty_sdl_rect(SDL_Rect *Rect)
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ COLOR_THEME_WLDLG_FRAME
struct theme * active_theme
static void get_target_help_data(struct widget *target)
static void add_target_to_worklist(struct widget *target)
static void set_global_worklist(struct widget *pwidget)
static bool are_prods_same_class(const struct universal *one, const struct universal *two)
static const char * get_production_name(struct city *pcity, struct universal prod, int *cost)
static int window_worklist_editor_callback(struct widget *pwidget)
static void add_target_to_production(struct widget *target)
static void swap_item_down_from_worklist(struct widget *item)
static int popdown_worklist_editor_callback(struct widget *pwidget)
static int ok_worklist_editor_callback(struct widget *pwidget)
static SDL_Surface * get_progress_icon(int stock, int cost, int *progress)
void popup_worklist_editor(struct city *pcity, struct global_worklist *gwl)
static void remove_item_from_worklist(struct widget *item)
static void refresh_worklist_count_label(void)
static int worklist_editor_item_callback(struct widget *pwidget)
static int global_worklist_callback(struct widget *pwidget)
void popdown_worklist_editor(void)
static int worklist_editor_targets_callback(struct widget *pwidget)
static void add_global_worklist(struct widget *pwidget)
static void swap_item_up_from_worklist(struct widget *item)
static int rename_worklist_editor_callback(struct widget *pwidget)
static void change_production(struct universal *prod)
static void refresh_production_label(int stock)
bool great_wonder_is_built(const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_later(const struct player *p, const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
bool can_player_build_improvement_now(const struct player *p, struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
bool small_wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
bool is_convert_improvement(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
#define fc_calloc(n, esz)
const char * move_points_text(int mp, bool reduce)
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
struct widget * worklist_counter
struct worklist worklist_copy
struct widget * production_name
struct advanced_dialog * global
char worklist_name[MAX_LEN_NAME]
struct universal currently_building
struct widget * production_progress
struct advanced_dialog * targets
struct advanced_dialog * work
struct widget * begin_widget_list
struct widget * end_widget_list
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
#define sz_strlcpy(dest, src)
const struct unit_type * utype
const struct impr_type * building
Unit_type_id utype_number(const struct unit_type *punittype)
bool can_player_build_unit_later(const struct player *p, const struct unit_type *punittype)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
bool can_player_build_unit_now(const struct player *p, const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
void worklist_advance(struct worklist *pwl)
void worklist_copy(struct worklist *dst, const struct worklist *src)
void worklist_init(struct worklist *pwl)
bool worklist_peek_ith(const struct worklist *pwl, struct universal *prod, int idx)
bool worklist_is_empty(const struct worklist *pwl)
bool worklist_append(struct worklist *pwl, const struct universal *prod)
void worklist_remove(struct worklist *pwl, int idx)
int worklist_length(const struct worklist *pwl)
#define worklist_iterate_end
#define worklist_iterate(_list, _p)