158 const struct tile *ptile);
163 const struct tile *center,
int radius);
169 #define edit_buffer_type_iterate(ARG_ebuf, NAME_type) \
175 for (NAME_type = 1; NAME_type < EBT_ALL; NAME_type <<= 1) { \
176 if (!(edit_buffer_has_type((ARG_ebuf), NAME_type))) { \
180 #define edit_buffer_type_iterate_end \
int edit_buffer_get_status_string(const struct edit_buffer *ebuf, char *buf, int buflen)
Fill the supplied buffer with a translated string describing the edit buffer's current state.
void editor_selection_remove(const struct tile *ptile)
Remove the given tile from the current selection.
const struct tile * editor_get_current_tile()
Get the tile that the user's mouse pointer is currently over.
bool edit_buffer_has_type(const struct edit_buffer *ebuf, int type)
Returns TRUE if the edit buffer was created with the given type flag.
const char * editor_tool_get_mode_name(enum editor_tool_type ett, enum editor_tool_mode etm)
Returns the translated string name for the given mode.
const char * editor_get_mode_tooltip(enum editor_tool_mode etm)
Returns a translated tooltip string assumed to be used for the toggle button for this tool mode in th...
int editor_tool_get_size(enum editor_tool_type ett)
Returns the current size parameter for the given editor tools.
void editor_mouse_button_press(int canvas_x, int canvas_y, int button, int modifiers)
Handle a user's mouse button press at the given point on the map canvas.
void editor_set_current_tile(const struct tile *ptile)
Sets the tile currently assumed to be under the user's mouse pointer.
void editor_mouse_move(int canvas_x, int canvas_y, int modifiers)
Handle the mouse moving over the map canvas.
enum editor_tool_mode editor_tool_get_mode(enum editor_tool_type ett)
Get the mode for the tool.
bool editor_tool_has_value_erase(enum editor_tool_type ett)
Returns TRUE if erase mode for the given tool erases by sub-value instead of any object corresponding...
void editor_tool_set_count(enum editor_tool_type ett, int count)
Sets the 'count' parameter of the tool to the given value.
struct edit_buffer * editor_get_copy_buffer()
Returns the copy buffer for the given tool.
void editor_tool_toggle_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
Toggle the current tool mode between the given mode and ETM_PAINT (or ETM_COPY for the copy & paste t...
void editor_selection_add(const struct tile *ptile)
Add the given tile to the current selection.
int editor_tool_get_value(enum editor_tool_type ett)
Get the current tool sub-value.
void editor_tool_set_applied_player(enum editor_tool_type, int player_no)
Sets the editor tool's applied player number to the given value.
void editor_set_tool(enum editor_tool_type emt)
Set the current tool to be used by the editor.
void editor_tool_cycle_mode(enum editor_tool_type ett)
Set the editor tool mode to the next available mode.
void editor_free()
Free the client's editor.
void editor_ruleset_changed()
Adjust editor for changed ruleset.
int editor_tool_get_count(enum editor_tool_type ett)
Returns the 'count' parameter for the editor tool.
void edit_buffer_copy(struct edit_buffer *ebuf, const struct tile *ptile)
Append a single tile to the copy buffer.
void editor_tool_set_size(enum editor_tool_type ett, int size)
Sets the size parameter for the given tool.
const char * editor_tool_get_tooltip(enum editor_tool_type ett)
Returns a translated "tooltip" description for the given tool type.
bool editor_tool_is_usable(enum editor_tool_type ett)
Returns TRUE if the given tool should be made available to the user via the editor GUI.
void editor_init()
Initialize the client's editor state information to some suitable default values.
bool editor_tool_has_applied_player(enum editor_tool_type ett)
Returns TRUE if the given tool makes use of the editor's applied player number.
const struct tile * edit_buffer_get_origin(const struct edit_buffer *ebuf)
Return the previously set origin, or nullptr if none.
void editor_notify_edit_finished()
Notify the server that a batch of edits has completed.
bool editor_tool_has_size(enum editor_tool_type ett)
Return TRUE if the given editor tool uses the 'size' parameter.
void edit_buffer_clear(struct edit_buffer *ebuf)
Remove all copy data stored in the edit buffer.
void editor_clear()
Clear the editor data which is game dependent.
QPixmap * editor_get_mode_sprite(enum editor_tool_mode etm)
Returns the editor sprite corresponding to the tool mode.
void editor_tool_set_value(enum editor_tool_type ett, int value)
Set the value ID for the given tool.
bool editor_tool_has_value(enum editor_tool_type ett)
Returns TRUE if the given tool type has sub-values (e.g.
void editor_mouse_button_release(int canvas_x, int canvas_y, int button, int modifiers)
Handle the release of a mouse button click.
const char * editor_tool_get_name(enum editor_tool_type ett)
Get the translated name of the given tool type.
enum editor_tool_type editor_get_tool()
Get the current tool used by the editor.
void edit_buffer_copy_square(struct edit_buffer *ebuf, const struct tile *center, int radius)
Copy from a square region of half-width 'radius' centered around 'center' into the buffer.
void editor_apply_tool_to_selection()
Apply the current editor tool to all tiles in the current selection.
void editor_apply_tool(const struct tile *ptile, bool part_of_selection)
Apply the current editor tool to the given tile.
bool editor_tile_is_selected(const struct tile *ptile)
Returns TRUE if the given tile is selected.
void edit_buffer_set_origin(struct edit_buffer *ebuf, const struct tile *ptile)
Set the "origin" for subsequent copy operations.
bool editor_is_active()
Returns TRUE if the client is in edit mode.
void edit_buffer_paste(struct edit_buffer *ebuf, const struct tile *dest)
Paste the entire contents of the edit buffer using 'dest' as the origin.
const struct tile * editor_get_selection_center()
Returns the "center" tile of a group of selected tiles, or nullptr.
bool editor_tool_has_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
Return TRUE if the given tool supports the given mode.
const char * editor_tool_get_value_name(enum editor_tool_type ett, int value)
Get the translated name of the given tool value.
int editor_tool_get_applied_player(enum editor_tool_type ett)
Returns the current applied player number for the editor tool.
void editor_selection_clear()
Unselect all selected tiles.
struct edit_buffer * edit_buffer_new(int type_flags)
Create a new edit buffer corresponding to all types set in 'type_flags'.
editor_keyboard_modifiers
struct unit * editor_unit_virtual_create()
Creates a virtual unit (like unit_virtual_create) based on the current editor state.
bool editor_tool_has_count(enum editor_tool_type ett)
Return TRUE if it is meaningful for the given tool to use the 'count' parameter.
void edit_buffer_free(struct edit_buffer *ebuf)
Free all memory allocated for the edit buffer.
QPixmap * editor_tool_get_sprite(enum editor_tool_type ett)
Returns a sprite containing an icon for the given tool type.
void editor_tool_set_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
Set the mode for the editor tool.