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", gold),
963 name, turns,
PL_(
"turn",
"turns", turns));
974 editor->production_name->size.x =
editor->end_widget_list->area.x +
978 area.x =
editor->end_widget_list->area.x;
979 area.y =
editor->production_name->size.y;
981 area.h =
editor->production_name->size.h;
992 editor->production_progress->theme =
1020 PL_(
"( %d entry )",
"( %d entries )",
len),
len);
1026 editor->worklist_counter->size.x =
editor->end_widget_list->area.x +
1036 area.x =
editor->end_widget_list->area.x;
1037 area.y =
editor->worklist_counter->size.y;
1039 area.h =
editor->worklist_counter->size.h;
1055 int count = 0, turns;
1080 editor->global_worklist_id = -1;
1115 editor->end_widget_list = pwindow;
1117 area = pwindow->area;
1137 PL_(
"( %d entry )",
"( %d entries )",
len),
len);
1159 PL_(
"%s\n%d gold per turn",
1160 "%s\n%d gold per turn", gold),
1172 name, turns,
PL_(
"turn",
"turns", turns));
1245 editor->work->scroll->count = 0;
1247 editor->work->scroll->step = 1;
1270 editor->work->end_active_widget_list =
editor->work->end_widget_list;
1271 editor->work->begin_active_widget_list =
editor->work->begin_widget_list;
1272 editor->work->scroll->count++;
1288 prod.value.building),
1299 *((
int *)
buf->data.ptr) = count;
1305 if (count >
editor->work->scroll->active - 1) {
1313 editor->work->end_widget_list = last->prev;
1314 editor->work->end_active_widget_list =
editor->work->end_widget_list;
1317 editor->work->begin_active_widget_list =
editor->work->begin_widget_list;
1320 editor->work->end_widget_list = last;
1322 editor->work->begin_widget_list = last;
1327 editor->work->active_widget_list =
editor->work->end_active_widget_list;
1347 editor->work->scroll->count += count;
1348 last =
editor->work->begin_widget_list;
1375 editor->global->end_widget_list = last->prev;
1376 editor->global->end_active_widget_list =
editor->global->end_widget_list;
1377 editor->global->begin_widget_list =
buf;
1378 editor->global->begin_active_widget_list =
editor->global->begin_widget_list;
1381 editor->global->active_widget_list =
editor->global->end_active_widget_list;
1385 editor->global->scroll->down_right_button->size.w =
adj_size(122);
1395 last =
editor->global->begin_widget_list;
1434 state =
_(
"Obsolete");
1439 state =
_(
"Destroyed");
1441 state =
_(
"Great Wonder");
1447 state =
_(
"Small Wonder");
1465 PL_(
"shield",
"shields",
cost),
1470 PL_(
"shield",
"shields",
cost),
_(
"never"));
1476 PL_(
"shield",
"shields",
cost),
1477 turns,
PL_(
"turn",
"turns", turns));
1481 PL_(
"shield",
"shields",
cost),
1482 turns,
PL_(
"turn",
"turns", turns));
1491 "%d gold per turn", gold),
1505 PL_(
"shield",
"shields",
cost));
1509 PL_(
"shield",
"shields",
cost));
1531 dst.x = (icon->w -
zoomed->w) / 2;
1532 dst.y = (icon->h/2 -
zoomed->h) / 2;
1538 dst.y += ((icon->h - dst.y) - (
text_name->h + text->h)) / 2;
1541 dst.x = (icon->w - text->w) / 2;
1555 buf->data.city = pcity;
1601 _(
"(%d/%d/%s)\n%d/%d %s\nnever"),
1606 PL_(
"shield",
"shields",
cost));
1609 _(
"(%d/%d/%s)\n%d/%d %s\n%d %s"),
1614 PL_(
"shield",
"shields",
cost),
1615 turns,
PL_(
"turn",
"turns", turns));
1621 _(
"(%d/%d/%s)\n%d %s"),
1626 PL_(
"shield",
"shields",
cost));
1635 dst.x = (icon->w -
zoomed->w) / 2;
1636 dst.y = (icon->h / 2 -
zoomed->h) / 2;
1641 dst.y = icon->h / 2 + (icon->h / 2 - (
text_name->h + text->h)) / 2;
1644 dst.x = (icon->w - text->w) / 2;
1658 buf->data.city = pcity;
1672 editor->targets->end_widget_list = last->prev;
1673 editor->targets->begin_widget_list =
buf;
1674 editor->targets->end_active_widget_list =
editor->targets->end_widget_list;
1675 editor->targets->begin_active_widget_list =
editor->targets->begin_widget_list;
1676 editor->targets->active_widget_list =
editor->targets->end_active_widget_list;
1687 editor->begin_widget_list =
editor->targets->begin_widget_list;
1695 (pwindow->size.w - pwindow->area.w) + area.w,
1696 (pwindow->size.h - pwindow->area.h) + area.h)) {
1700 area = pwindow->area;
1713 dst.x, dst.y, dst.w - 1, dst.h - 1,
1716 dst.x + 2, dst.y + 2, dst.w - 5, dst.h - 5,
1726 dst.x, dst.y, dst.w - 1, dst.h - 1,
1733 dst.h = pwindow->size.h - dst.y -
adj_size(4);
1740 dst.x, dst.y, dst.w - 1, dst.h - 1,
1753 buf = pwindow->prev;
1760 buf->size.y =
buf->next->size.y +
buf->next->size.h;
1770 buf->size.y =
buf->next->size.y +
buf->next->size.h;
1797 editor->work->end_widget_list);
1810 (
editor->global->scroll ?
1811 editor->global->scroll->up_left_button->size.h + 1 : 0),
1813 editor->global->end_widget_list);
1815 if (
editor->global->scroll) {
1827 0, 0,
editor->targets->begin_widget_list,
1828 editor->targets->end_widget_list);
1830 if (
editor->targets->scroll) {
1853 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 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 universal production
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)