15 #define GETTEXT_DOMAIN "wesnoth-editor"
39 std::set<map_location> adjacent_set;
43 for (
int i = 0;
i < 6;
i++)
44 adjacent_set.insert(adjacent[
i]);
51 if (unit_it != units.
end()) {
60 std::stringstream str;
61 str <<
N_(
"Identifier: ") << unit_it->id() <<
"\n"
62 <<
N_(
"Name: ") << unit_it->name() <<
"\n"
63 <<
N_(
"Type: ") << unit_it->type_name() <<
"\n"
64 <<
N_(
"Level: ") << unit_it->level() <<
"\n"
65 <<
N_(
"Cost: ") << unit_it->cost() <<
"\n"
66 <<
N_(
"Recruit: ") <<
utils::join(unit_it->recruits()) <<
"\n";
85 if (unit_it != units.
end())
101 if (!
click_)
return nullptr;
115 if (!new_unit_type) {
117 ERR_ED <<
"create unit dialog returned inexistent or unusable unit_type id '" << type_id <<
"'" << std::endl;
131 if (
click_)
return nullptr;
140 if (unit_it == units.
end())
235 std::stringstream filename;
virtual void set_mouse_overlay(editor_display &disp)
Set the mouse overlay for this action.
surface get_image(const image::locator &i_locator, TYPE type)
function to get the surface corresponding to an image.
editor_action * drag_left(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
Drag operation.
const Item & selected_fg_item() const
Return the currently selected foreground/background item.
map_location previous_move_hex_
The hex previously used in move operations.
bool invalidate(const map_location &loc)
Function to invalidate a specific tile for redrawing.
void set_unit_mouse_overlay(editor_display &disp, const unit_type &u)
GLuint GLuint GLsizei GLenum type
void get_adjacent_tiles(const map_location &a, map_location *res)
Function which, given a location, will place all adjacent locations in res.
GLenum GLsizei GLenum GLenum const GLvoid * image
const map_location hex_clicked_on(int x, int y) const
given x,y co-ordinates of an onscreen pixel, will return the location of the hex that this pixel corr...
unit_type_data unit_types
const std::string & image() const
double get_zoom_factor() const
Returns the current zoom factor.
int get_location_x(const map_location &loc) const
Functions to get the on-screen positions of hexes.
GLint GLint GLint GLint GLint GLint y
surface scale_surface(const surface &surf, int w, int h)
int get_location_y(const map_location &loc) const
void move(editor_display &disp, const map_location &hex)
Mouse move (not a drag).
const std::string & flag_rgb() const
surface adjust_surface_alpha(const surface &surf, fixed_t amount, bool optimize)
const std::vector< unit_race::GENDER > & genders() const
The returned vector will not be empty, provided this has been built to the HELP_INDEXED status...
void update_brush_highlights(editor_display &disp, const map_location &hex)
Unconditionally update the brush highlights for the current tool when hex is the center location...
GLclampf GLclampf GLclampf alpha
editor_action * click_left(editor_display &disp, int x, int y)
TODO.
void set_mouseover_hex_overlay(const surface &image)
mouseover_hex_overlay_ require a prerendered surface and is drawn underneath the mouse's location ...
Manage the empty-palette in the editor.
editor_action * up_left(editor_display &disp, int x, int y)
TODO.
const unit_map & get_units() const
std::string join(T const &v, const std::string &s=",")
Generates a new string joining container items in a list.
Encapsulates the map of the game.
editor_action * drag_end_left(editor_display &disp, int x, int y)
Drag end replaces the unit when clicked left, or adjusts the facing when clicked right.
place a new unit on the map
Base class for all editor actions.
GLint GLint GLint GLint GLint x
bool on_board(const map_location &loc) const
Tell if a location is on the map.
unit_palette & unit_palette_
Contains the SDL_Rect helper code.
const gamemap & get_map() const
Container associating units to locations.
static std::string get_side_color_index(int side)
const unit_type * find(const std::string &key, unit_type::BUILD_STATUS status=unit_type::FULL) const
Finds a unit_type by its id() and makes sure it is built to the specified level.
unit_iterator find(size_t id)
int hex_size() const
Function which returns the size of a hex in pixels (from top tip to bottom tip or left edge to right ...
GLsizei const GLcharARB ** string
const std::string & id() const
The id for this unit_type.