Freeciv-3.1
|
Go to the source code of this file.
Functions | |
int | get_citydlg_canvas_width (void) |
int | get_citydlg_canvas_height (void) |
void | generate_citydlg_dimensions (void) |
bool | city_to_canvas_pos (float *canvas_x, float *canvas_y, int city_x, int city_y, int city_radius_sq) |
bool | canvas_to_city_pos (int *city_x, int *city_y, int city_radius_sq, int canvas_x, int canvas_y) |
void | city_dialog_redraw_map (struct city *pcity, struct canvas *pcanvas) |
char * | city_production_cost_str (const struct city *pcity) |
void | get_city_dialog_production (struct city *pcity, char *buffer, size_t buffer_len) |
void | get_city_dialog_production_full (char *buffer, size_t buffer_len, struct universal *target, struct city *pcity) |
void | get_city_dialog_production_row (char *buf[], size_t column_size, struct universal *target, struct city *pcity) |
void | get_city_dialog_output_text (const struct city *pcity, Output_type_id otype, char *buffer, size_t bufsz) |
void | get_city_dialog_pollution_text (const struct city *pcity, char *buf, size_t bufsz) |
void | get_city_dialog_culture_text (const struct city *pcity, char *buf, size_t bufsz) |
void | get_city_dialog_illness_text (const struct city *pcity, char *buf, size_t bufsz) |
void | get_city_dialog_airlift_text (const struct city *pcity, char *buf, size_t bufsz) |
void | get_city_dialog_airlift_value (const struct city *pcity, char *buf, size_t bufsz) |
int | get_city_citizen_types (struct city *pcity, enum citizen_feeling index, enum citizen_category *categories) |
void | city_rotate_specialist (struct city *pcity, int citizen_index) |
void | activate_all_units (struct tile *ptile) |
int | city_change_production (struct city *pcity, struct universal *target) |
int | city_set_worklist (struct city *pcity, const struct worklist *pworklist) |
void | city_worklist_commit (struct city *pcity, struct worklist *pwl) |
bool | city_queue_insert (struct city *pcity, int position, struct universal *target) |
bool | city_queue_clear (struct city *pcity) |
bool | city_queue_insert_worklist (struct city *pcity, int position, const struct worklist *worklist) |
void | city_get_queue (struct city *pcity, struct worklist *pqueue) |
bool | city_set_queue (struct city *pcity, const struct worklist *pqueue) |
bool | city_can_buy (const struct city *pcity) |
int | city_sell_improvement (struct city *pcity, Impr_type_id sell_id) |
int | city_buy_production (struct city *pcity) |
int | city_change_specialist (struct city *pcity, Specialist_type_id from, Specialist_type_id to) |
int | city_toggle_worker (struct city *pcity, int city_x, int city_y) |
int | city_rename (struct city *pcity, const char *name) |
void activate_all_units | ( | struct tile * | ptile | ) |
Activate all units on the given map tile.
Definition at line 1240 of file citydlg_common.c.
Referenced by adv_unit_select_all_callback().
bool canvas_to_city_pos | ( | int * | city_x, |
int * | city_y, | ||
int | city_radius_sq, | ||
int | canvas_x, | ||
int | canvas_y | ||
) |
Converts a citymap canvas position to a (cartesian) city coordinate position. Returns TRUE iff the city position is valid.
Definition at line 115 of file citydlg_common.c.
Referenced by button_down_citymap(), city_map::context_menu(), left_button_down_citymap(), city_map::mousePressEvent(), resource_map_city_dlg_callback(), and right_button_down_citymap().
int city_buy_production | ( | struct city * | pcity | ) |
Buy the current production item in a given city. Return the request ID.
Definition at line 1527 of file citydlg_common.c.
Return TRUE iff the city can buy.
Definition at line 1499 of file citydlg_common.c.
Referenced by append_city_buycost_string(), buy_production_in_selected_cities(), city_dialog_update_building(), city_widget::display_list_menu(), enable_city_dlg_widgets(), popup_hurry_production_dialog(), production_widget::prod_selected(), real_city_dialog_popup(), real_info_city_report_dialog_update(), and redraw_city_dialog().
Change the production of a given city. Return the request ID.
Definition at line 1261 of file citydlg_common.c.
Referenced by base_city_queue_insert(), change_callback(), city_dialog::change_production(), change_production_callback(), city_set_queue(), city_worklist_commit(), client_change_all(), city_widget::display_list_menu(), impr_or_unit_iterate(), ok_worklist_editor_callback(), production_widget::prod_selected(), city_dialog::production_changed(), target_drag_data_received(), and target_drag_data_received().
int city_change_specialist | ( | struct city * | pcity, |
Specialist_type_id | from, | ||
Specialist_type_id | to | ||
) |
Change a specialist in the given city. Return the request ID.
Definition at line 1535 of file citydlg_common.c.
Referenced by apply_result_on_server(), and city_rotate_specialist().
Draw the full city map onto the canvas store. Works for both isometric and orthogonal views.
Definition at line 187 of file citydlg_common.c.
Referenced by city_dialog_update_map(), create_city_map(), and city_map::set_pixmap().
Get the city current production and the worklist, like it should be.
Definition at line 1444 of file citydlg_common.c.
Referenced by city_dialog::dbl_click_p(), production_widget::prod_selected(), refresh_worklist(), city_dialog::save_worklist(), city_dialog::update_improvements(), city_dialog::worklist_down(), and city_dialog::worklist_up().
char * city_production_cost_str | ( | const struct city * | pcity | ) |
Return a string describing the cost for the production of the city considering several build slots for units.
Definition at line 224 of file citydlg_common.c.
Referenced by cr_entry_building(), and get_city_dialog_production().
Clear the queue (all entries except the first one since that can't be cleared).
Note that the queue DOES include the current production.
Definition at line 1402 of file citydlg_common.c.
Insert an item into the city's queue.
Note that the queue DOES include the current production.
Definition at line 1386 of file citydlg_common.c.
Referenced by city_widget::display_list_menu(), production_widget::prod_selected(), worklist_first_impr_or_unit_iterate(), worklist_last_impr_or_unit_iterate(), worklist_next_impr_or_unit_iterate(), and worklist_next_to_last_impr_or_unit_iterate().
bool city_queue_insert_worklist | ( | struct city * | pcity, |
int | position, | ||
const struct worklist * | worklist | ||
) |
Insert the worklist into the city's queue at the given position.
Note that the queue DOES include the current production.
Definition at line 1414 of file citydlg_common.c.
Referenced by append_worklist_foreach(), city_widget::display_list_menu(), and city_dialog::display_worklist_menu().
int city_rename | ( | struct city * | pcity, |
const char * | name | ||
) |
Tell the server to rename the city. Return the request ID.
Definition at line 1579 of file citydlg_common.c.
Referenced by new_name_city_dlg_callback(), and rename_popup_callback().
void city_rotate_specialist | ( | struct city * | pcity, |
int | citizen_index | ||
) |
Rotate the given specialist citizen to the next type of citizen.
Definition at line 1212 of file citydlg_common.c.
Referenced by citizens_callback(), citizens_callback(), city_dlg_callback(), and city_label::mousePressEvent().
int city_sell_improvement | ( | struct city * | pcity, |
Impr_type_id | sell_id | ||
) |
Change the production of a given city. Return the request ID.
Definition at line 1519 of file citydlg_common.c.
Referenced by city_widget::display_list_menu(), impr_item::mouseDoubleClickEvent(), ok_sell_impr_callback(), sell_all_improvements(), sell_callback_response(), sell_impr_iterate(), and sell_imprvm_dlg_ok_callback().
Set the city current production and the worklist, like it should be.
Definition at line 1461 of file citydlg_common.c.
Referenced by commit_worklist(), city_dialog::dbl_click_p(), city_widget::display_list_menu(), city_dialog::display_worklist_menu(), production_widget::prod_selected(), set_worklist_foreach(), city_dialog::worklist_down(), and city_dialog::worklist_up().
Set the worklist for a given city. Return the request ID.
Note that the worklist does NOT include the current production.
Definition at line 1273 of file citydlg_common.c.
Referenced by city_queue_insert(), city_queue_insert_worklist(), city_set_queue(), city_worklist_commit(), city_dialog::clear_worklist(), clear_worklist_foreach_func(), city_widget::clear_worlist(), and ok_worklist_editor_callback().
bool city_to_canvas_pos | ( | float * | canvas_x, |
float * | canvas_y, | ||
int | city_x, | ||
int | city_y, | ||
int | city_radius_sq | ||
) |
Converts a (cartesian) city position to citymap canvas coordinates. Returns TRUE if the city position is valid.
Definition at line 93 of file citydlg_common.c.
int city_toggle_worker | ( | struct city * | pcity, |
int | city_x, | ||
int | city_y | ||
) |
Toggle a worker<->specialist at the given city tile. Return the request ID.
Definition at line 1547 of file citydlg_common.c.
Referenced by button_down_citymap(), left_button_down_citymap(), city_map::mousePressEvent(), and resource_map_city_dlg_callback().
Commit the changes to the worklist for the city.
Definition at line 1282 of file citydlg_common.c.
void generate_citydlg_dimensions | ( | void | ) |
Calculate the citydlg width and height.
Definition at line 67 of file citydlg_common.c.
Referenced by handle_map_info(), themespec_reread(), and tilespec_reread().
int get_city_citizen_types | ( | struct city * | pcity, |
enum citizen_feeling | idx, | ||
enum citizen_category * | categories | ||
) |
Provide a list of all citizens in the city, in order. "index" should be the happiness index (currently [0..4]; 4 = final happiness). "citizens" should be an array large enough to hold all citizens (use MAX_CITY_SIZE to be on the safe side).
Definition at line 1175 of file citydlg_common.c.
Referenced by city_dialog_update_citizens(), city_rotate_specialist(), refresh_feeling_surface(), refresh_feeling_surface(), and city_dialog::update_citizens().
void get_city_dialog_airlift_text | ( | const struct city * | pcity, |
char * | buf, | ||
size_t | bufsz | ||
) |
Return text describing airlift capacity.
Definition at line 1043 of file citydlg_common.c.
Referenced by show_info_popup(), show_info_popup(), and city_dialog::update_info_label().
void get_city_dialog_airlift_value | ( | const struct city * | pcity, |
char * | buf, | ||
size_t | bufsz | ||
) |
Return airlift capacity.
Definition at line 1113 of file citydlg_common.c.
Referenced by city_dialog_update_information(), city_dialog_update_information(), and city_dialog::update_info_label().
void get_city_dialog_culture_text | ( | const struct city * | pcity, |
char * | buf, | ||
size_t | bufsz | ||
) |
Return text describing the culture output.
Definition at line 993 of file citydlg_common.c.
Referenced by show_info_popup(), show_info_popup(), and city_dialog::update_info_label().
void get_city_dialog_illness_text | ( | const struct city * | pcity, |
char * | buf, | ||
size_t | bufsz | ||
) |
Return text describing the chance for a plague.
Definition at line 895 of file citydlg_common.c.
Referenced by show_info_popup(), show_info_popup(), and city_dialog::update_info_label().
void get_city_dialog_output_text | ( | const struct city * | pcity, |
Output_type_id | otype, | ||
char * | buf, | ||
size_t | bufsz | ||
) |
Return text describing the production output.
Definition at line 733 of file citydlg_common.c.
Referenced by show_info_popup(), show_info_popup(), and city_dialog::update_info_label().
void get_city_dialog_pollution_text | ( | const struct city * | pcity, |
char * | buf, | ||
size_t | bufsz | ||
) |
Return text describing the pollution output.
Definition at line 967 of file citydlg_common.c.
Referenced by show_info_popup(), show_info_popup(), and city_dialog::update_info_label().
void get_city_dialog_production | ( | struct city * | pcity, |
char * | buffer, | ||
size_t | buffer_len | ||
) |
Find the city dialog city production text for the given city, and place it into the buffer. This will check the concise_city_production option. pcity may be NULL; in this case a filler string is returned.
Definition at line 260 of file citydlg_common.c.
Referenced by city_dialog_update_building(), and city_dialog::update_building().
void get_city_dialog_production_full | ( | char * | buffer, |
size_t | buffer_len, | ||
struct universal * | target, | ||
struct city * | pcity | ||
) |
Pretty sprints the info about a production (name, info, cost, turns to build) into a single text string.
This is very similar to get_city_dialog_production_row(); the difference is that instead of placing the data into an array of strings it all goes into one long string. This means it can be used by frontends that do not use a tabled structure, but it also gives less flexibility.
Definition at line 324 of file citydlg_common.c.
void get_city_dialog_production_row | ( | char * | buf[], |
size_t | column_size, | ||
struct universal * | target, | ||
struct city * | pcity | ||
) |
Pretty sprints the info about a production in 4 columns (name, info, cost, turns to build). The columns must each have a size of column_size bytes. City may be NULL.
Definition at line 364 of file citydlg_common.c.
Referenced by append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), cell_render_func(), and city_widget::gen_production_labels().
int get_citydlg_canvas_height | ( | void | ) |
Return the height of the city dialog canvas.
Definition at line 59 of file citydlg_common.c.
Referenced by canvas_to_city_pos(), city_dialog_redraw_map(), city_map::city_map(), city_to_canvas_pos(), create_city_map(), init_citydlg_dimensions(), and unqueue_mapview_updates().
int get_citydlg_canvas_width | ( | void | ) |
Return the width of the city dialog canvas.
Definition at line 51 of file citydlg_common.c.
Referenced by canvas_to_city_pos(), city_dialog_redraw_map(), city_map::city_map(), city_to_canvas_pos(), create_city_map(), init_citydlg_dimensions(), and unqueue_mapview_updates().