201 _(
"Change tile terrain.\nShortcut: t\n"
202 "Select terrain type: shift+t or right-click here."));
205 _(
"Change tile terrain resources.\nShortcut: r\n"
206 "Select resource type: shift+r or right-click here."));
209 _(
"Modify tile specials.\nShortcut: s\n"
210 "Select special type: shift+s or right-click here."));
213 _(
"Modify roads on tile.\nShortcut: p\n"
214 "Select road type: shift+p or right-click here."));
217 _(
"Create a military base.\nShortcut: m\n"
218 "Select base type: shift+m or right-click here."));
221 _(
"Create unit.\nShortcut: u\nSelect unit "
222 "type: shift+u or right-click here."));
224 _(
"Create city.\nShortcut: c"));
226 _(
"Modify player's tile knowledge.\nShortcut: v"));
228 _(
"Place a start position which allows any nation to "
229 "start at the tile. To allow only certain nations to "
230 "start there, middle click on the start position on "
231 "the map and use the property editor.\nShortcut: b"));
234 _(
"Copy and paste tiles.\n"
235 "Shortcut for copy mode: shift-c\n"
236 "Shoftcut for paste mode: shift-v"));
499 int ett = -1, value = 0;
587 for (
i = count - 1;
i >= 0;
i--) {
594 if (special !=
NULL) {
623 return ptile !=
NULL;
868 const struct tile *ptile, *
old;
1302 return sprites->
road;
1306 return sprites->
unit;
1309 return sprites->
city;
1489 const struct tile *center,
1492 if (!
ebuf || !center || radius < 1) {
1511 if (!
ebuf || !ptile) {
1608 const struct tile *ptile)
1611 const struct terrain *pterrain;
1613 if (!packet || !ptile) {
1635 packet->
label[0] =
'\0';
1738 const struct tile *origin, *ptile;
1741 if (!
ebuf || !dest) {
1791 return _(
"Erase Value");
1803 log_error(
"Unrecognized editor tool mode %d "
1804 "in editor_tool_get_mode_name().",
etm);
1819 return _(
"Toggle erase mode.\nShortcut: shift-d");
1822 return _(
"Toggle copy mode.\nShortcut: shift-c");
1825 return _(
"Toggle paste mode.\nShortcut: shift-v");
1848 return sprites->
brush;
1851 return sprites->
erase;
1854 return sprites->
copy;
1857 return sprites->
paste;
1887 fmt =
PL_(
"%d tile copied.",
"%d tiles copied.", total);
1899 const struct tile *ptile)
1904 ebuf->origin = ptile;
1915 return ebuf->origin;
1937 const struct tile *origin, *center;
Base_type_id base_count(void)
struct canvas int int canvas_y
struct canvas int canvas_x
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
const char * city_name_get(const struct city *pcity)
struct city * create_city_virtual(struct player *pplayer, struct tile *ptile, const char *name)
void city_size_set(struct city *pcity, citizens size)
void city_add_improvement(struct city *pcity, const struct impr_type *pimprove)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
bool client_is_global_observer(void)
int client_player_number(void)
bool client_has_player(void)
bool can_conn_edit(const struct connection *pconn)
void connection_do_buffer(struct connection *pc)
void connection_do_unbuffer(struct connection *pc)
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
int edit_buffer_get_status_string(const struct edit_buffer *ebuf, char *buf, int buflen)
bool editor_is_active(void)
void editor_selection_remove(const struct tile *ptile)
bool edit_buffer_has_type(const struct edit_buffer *ebuf, int type)
int editor_tool_get_size(enum editor_tool_type ett)
static void paste_tile(struct edit_buffer *ebuf, const struct tile *vtile, const struct tile *ptile_dest)
void editor_set_tool(enum editor_tool_type ett)
void editor_mouse_button_press(int canvas_x, int canvas_y, int button, int modifiers)
void editor_set_current_tile(const struct tile *ptile)
void editor_mouse_move(int canvas_x, int canvas_y, int modifiers)
enum editor_tool_mode editor_tool_get_mode(enum editor_tool_type ett)
bool editor_tool_has_value_erase(enum editor_tool_type ett)
void editor_tool_set_count(enum editor_tool_type ett, int count)
void editor_tool_toggle_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
static void tool_init(enum editor_tool_type ett, const char *name, int flags, const char *tooltip)
void editor_selection_add(const struct tile *ptile)
const char * editor_tool_get_value_name(enum editor_tool_type emt, int value)
void editor_notify_edit_finished(void)
int editor_tool_get_value(enum editor_tool_type ett)
static void editor_end_selection_rectangle(int canvas_x, int canvas_y)
struct edit_buffer * edit_buffer_new(int type_flags)
struct edit_buffer * editor_get_copy_buffer(void)
void editor_tool_set_applied_player(enum editor_tool_type ett, int player_no)
const char * editor_tool_get_mode_name(enum editor_tool_type ett, enum editor_tool_mode etm)
void editor_tool_cycle_mode(enum editor_tool_type ett)
static void editor_grab_applied_player(const struct tile *ptile)
int editor_tool_get_count(enum editor_tool_type ett)
const struct tile * edit_buffer_get_origin(const struct edit_buffer *ebuf)
void edit_buffer_copy(struct edit_buffer *ebuf, const struct tile *ptile)
int editor_selection_count(void)
void editor_tool_set_size(enum editor_tool_type ett, int size)
const char * editor_get_mode_tooltip(enum editor_tool_mode etm)
bool editor_tool_is_usable(enum editor_tool_type ett)
enum editor_tool_type editor_get_tool(void)
bool editor_tool_has_applied_player(enum editor_tool_type ett)
bool editor_tool_has_size(enum editor_tool_type ett)
void edit_buffer_clear(struct edit_buffer *ebuf)
void editor_tool_set_value(enum editor_tool_type ett, int value)
bool editor_tool_has_value(enum editor_tool_type ett)
static void popup_properties(struct tile *ptile)
const char * editor_tool_get_tooltip(enum editor_tool_type ett)
void editor_selection_clear(void)
void editor_mouse_button_release(int canvas_x, int canvas_y, int button, int modifiers)
static void editor_grab_tool(const struct tile *ptile)
static bool tile_really_has_any_specials(const struct tile *ptile)
void edit_buffer_copy_square(struct edit_buffer *ebuf, const struct tile *center, int radius)
static void editor_start_selection_rectangle(int canvas_x, int canvas_y)
struct sprite * editor_tool_get_sprite(enum editor_tool_type ett)
const struct tile * editor_get_current_tile(void)
void editor_apply_tool_to_selection(void)
void editor_apply_tool(const struct tile *ptile, bool part_of_selection)
bool editor_tile_is_selected(const struct tile *ptile)
void edit_buffer_set_origin(struct edit_buffer *ebuf, const struct tile *ptile)
static bool can_edit_tile_properties(struct tile *ptile)
void edit_buffer_paste(struct edit_buffer *ebuf, const struct tile *dest)
const struct tile * editor_get_selection_center(void)
bool editor_tool_has_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
struct unit * editor_unit_virtual_create(void)
static void editor_draw_selrect(void)
void editor_ruleset_changed(void)
int editor_tool_get_applied_player(enum editor_tool_type ett)
bool editor_tool_has_count(enum editor_tool_type ett)
struct sprite * editor_get_mode_sprite(enum editor_tool_mode etm)
static void editor_resize_selection_rectangle(int canvas_x, int canvas_y)
static void fill_tile_edit_packet(struct packet_edit_tile *packet, const struct tile *ptile)
const char * editor_tool_get_name(enum editor_tool_type ett)
static void tool_set_init_value(enum editor_tool_type ett)
static struct editor_state * editor
void edit_buffer_free(struct edit_buffer *ebuf)
void editor_tool_set_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
#define edit_buffer_type_iterate_end
#define edit_buffer_type_iterate(ARG_ebuf, NAME_type)
#define PL_(String1, String2, n)
void editgui_popup_properties(const struct tile_list *tiles, int objtype)
void editgui_refresh(void)
void draw_selection_rectangle(int canvas_x, int canvas_y, int w, int h)
bool is_improvement(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define log_error(message,...)
struct tile * map_pos_to_tile(const struct civ_map *nmap, int map_x, int map_y)
void map_distance_vector(int *dx, int *dy, const struct tile *tile0, const struct tile *tile1)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
#define MAP_TILE_OWNER_NULL
#define index_to_map_pos(pmap_x, pmap_y, mindex)
void recenter_button_pressed(int canvas_x, int canvas_y)
void update_map_canvas_visible(void)
struct tile * canvas_pos_to_tile(float canvas_x, float canvas_y, float zoom)
void update_map_canvas(int canvas_x, int canvas_y, int width, int height)
void refresh_tile_mapcanvas(struct tile *ptile, bool full_refresh, bool write_to_screen)
#define gui_rect_iterate_end
#define gui_rect_iterate(GRI_x0, GRI_y0, GRI_width, GRI_height, _t, _e, _c, _zoom)
#define fc_calloc(n, esz)
int dsend_packet_edit_city_create(struct connection *pc, int owner, int tile, int size, int tag)
int dsend_packet_edit_startpos(struct connection *pc, int id, bool removal, int tag)
int dsend_packet_edit_unit_remove(struct connection *pc, int owner, int tile, Unit_type_id type, int count)
int dsend_packet_edit_unit_create(struct connection *pc, int owner, int tile, Unit_type_id type, int count, int tag)
int dsend_packet_edit_tile_extra(struct connection *pc, int tile, int extra_type_id, bool removal, int eowner, int size)
int send_packet_edit_tile(struct connection *pc, const struct packet_edit_tile *packet)
int send_packet_edit_check_tiles(struct connection *pc)
int dsend_packet_edit_tile_terrain(struct connection *pc, int tile, Terrain_type_id terrain, int size)
int dsend_packet_edit_city_remove(struct connection *pc, int id)
int dsend_packet_edit_player_vision(struct connection *pc, int player, int tile, bool known, int size)
struct player * player_by_number(const int player_id)
int player_number(const struct player *pplayer)
Road_type_id road_count(void)
struct packet_ruleset_control control
const struct tile * origin
struct tile_list * vtiles
struct sprite * terrain_special
struct sprite * terrain_resource
struct sprite * copypaste
struct sprite * military_base
struct tile_hash * selected_tile_table
enum selection_modes selection_mode
struct editor_tool tools[NUM_EDITOR_TOOL_TYPES]
struct edit_buffer * copybuf
enum editor_tool_type tool
const struct tile * current_tile
Resource_type_id resource
struct player * extras_owner
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)
Terrain_type_id terrain_count(void)
const char * terrain_name_translation(const struct terrain *pterrain)
struct terrain * terrain_by_number(const Terrain_type_id type)
Terrain_type_id terrain_number(const struct terrain *pterrain)
void tile_add_extra(struct tile *ptile, const struct extra_type *pextra)
void tile_set_terrain(struct tile *ptile, struct terrain *pterrain)
void tile_virtual_destroy(struct tile *vtile)
struct tile * tile_virtual_new(const struct tile *ptile)
void tile_set_resource(struct tile *ptile, struct extra_type *presource)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
void tile_set_worked(struct tile *ptile, struct city *pcity)
#define tile_hash_iterate(hash, ptile)
#define tile_resource(_tile)
#define tile_list_iterate(tile_list, ptile)
#define tile_terrain(_tile)
#define tile_hash_iterate_end
#define tile_list_iterate_end
static const bv_extras * tile_extras(const struct tile *ptile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
int tileset_tile_height(const struct tileset *t)
int tileset_tile_width(const struct tileset *t)
const struct editor_sprites * get_editor_sprites(const struct tileset *t)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
bool unit_transported(const struct unit *pcargo)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
enum unit_move_type utype_move_type(const struct unit_type *punittype)
Unit_type_id utype_count(void)
struct unit_class * unit_class_get(const struct unit *punit)
struct unit_type * utype_by_number(const Unit_type_id id)
Unit_type_id utype_number(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)