16 #define GETTEXT_DOMAIN "wesnoth-editor" 50 if (!
click_)
return nullptr;
59 std::string
label = old_label ? old_label->
text() :
"";
60 std::string team_name = old_label ? old_label->
team_name() :
"";
61 std::string category = old_label ? old_label->
category() :
"";
64 bool immutable = old_label ? old_label->
immutable() :
true;
69 std::unique_ptr<editor_action>
a;
71 a = std::make_unique<editor_action_label>(hex,
label, team_name, color
72 , visible_fog, visible_shroud, immutable, category);
92 return std::make_unique<editor_action_label_delete>(hex);
97 if (
click_)
return nullptr;
110 if (!dragged_label) {
118 auto chain = std::make_unique<editor_action_chain>();
119 chain->append_action(std::make_unique<editor_action_label_delete>(
clicked_on_));
120 chain->append_action(std::make_unique<editor_action_label_delete>(hex));
121 chain->append_action(
122 std::make_unique<editor_action_label>(
124 dragged_label->
text(),
126 dragged_label->
color(),
144 SDL_Rect r {6, 6, 0, 0};
145 sdl_blit(image60,
nullptr, image, &r);
std::unique_ptr< editor_action > drag_end_left(editor_display &disp, int x, int y) override
Replaces the label under the mouse with the dragged label.
virtual void set_mouse_overlay(editor_display &disp) override
Set the mouse overlay for this action.
surface get_image(const image::locator &i_locator, TYPE type)
Caches and returns an image.
const color_t & color() const
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...
static double get_zoom_factor()
Returns the current zoom factor.
const std::string & category() const
std::unique_ptr< editor_action > drag_left(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo) override
Drags a label.
const t_string & text() const
map_labels & get_labels()
const std::string & team_name() const
bool visible_in_shroud() const
surface scale_surface(const surface &surf, int w, int h)
Scale a surface using alpha-weighted modified bilinear filtering Note: causes artifacts with alpha gr...
bool show(const unsigned auto_close_time=0)
Shows the window.
map_context & get_current_map_context() const
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
std::unique_ptr< editor_action > up_right(editor_display &disp, int x, int y) override
Right click erases the label under the mouse.
std::string label
What to show in the filter's drop-down list.
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...
Dialog for editing gamemap labels.
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.
const terrain_label * get_label(const map_location &loc, const std::string &team_name) const
const color_t NORMAL_COLOR
Encapsulates the map of the game.
bool visible_in_fog() const
Base class for all editor actions.
bool on_board(const map_location &loc) const
Tell if a location is on the map.
std::unique_ptr< editor_action > click_left(editor_display &disp, int x, int y) override
A click, possibly the beginning of a drag.
std::unique_ptr< editor_action > up_left(editor_display &disp, int x, int y) override
Left click displays a dialog that is used for entering the label string.
const gamemap & get_map() const
To store label data Class implements logic for rendering.
editor_controller & get_controller()
Functions to load and save images from/to disk.
void adjust_surface_alpha(surface &surf, int32_t amount)
void sdl_blit(const surface &src, SDL_Rect *src_rect, surface &dst, SDL_Rect *dst_rect)
std::unique_ptr< editor_action > click_right(editor_display &disp, int x, int y) override
A click, possibly the beginning of a drag.