16 #define GETTEXT_DOMAIN "wesnoth-editor"
49 if (!
click_)
return nullptr;
58 std::string
label = old_label ? old_label->
text() :
"";
59 std::string team_name = old_label ? old_label->
team_name() :
"";
60 std::string category = old_label ? old_label->
category() :
"";
63 bool immutable = old_label ? old_label->
immutable() :
true;
68 std::unique_ptr<editor_action> a;
70 a = std::make_unique<editor_action_label>(hex,
label, team_name, color
71 , visible_fog, visible_shroud, immutable, category);
91 return std::make_unique<editor_action_label_delete>(hex);
96 if (
click_)
return nullptr;
109 if (!dragged_label) {
117 auto chain = std::make_unique<editor_action_chain>();
118 chain->append_action(std::make_unique<editor_action_label_delete>(
clicked_on_));
119 chain->append_action(std::make_unique<editor_action_label_delete>(hex));
120 chain->append_action(
121 std::make_unique<editor_action_label>(
123 dragged_label->
text(),
125 dragged_label->
color(),
142 "misc/blank-hex.png",
143 "~BLIT(icons/action/editor-tool-label_60.png,6,6)"
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...
Base class for all editor actions.
map_context & get_current_map_context() const
void set_mouseover_hex_overlay(const texture &image)
Sets texture to be drawn in hex under the mouse's location.
editor_controller & get_controller()
const editor_map & get_map() const
map_labels & get_labels()
std::unique_ptr< editor_action > drag_left(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo) override
Drags a label.
std::unique_ptr< editor_action > up_right(editor_display &disp, int x, int y) override
Right click erases the label under the mouse.
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.
std::unique_ptr< editor_action > click_left(editor_display &disp, int x, int y) override
A click, possibly the beginning of a drag.
virtual void set_mouse_overlay(editor_display &disp) override
Set the mouse overlay for this action.
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.
std::unique_ptr< editor_action > click_right(editor_display &disp, int x, int y) override
A click, possibly the beginning of a drag.
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.
bool on_board(const map_location &loc) const
Tell if a location is on the map.
Generic locator abstracting the location of an image.
const terrain_label * get_label(const map_location &loc, const std::string &team_name) const
To store label data Class implements logic for rendering.
bool visible_in_shroud() const
bool visible_in_fog() const
const color_t & color() const
const std::string & category() const
const t_string & text() const
const std::string & team_name() const
std::string label
What to show in the filter's drop-down list.
Manage the empty-palette in the editor.
const color_t NORMAL_COLOR
texture get_texture(const image::locator &i_locator, TYPE type, bool skip_cache)
Returns an image texture suitable for hardware-accelerated rendering.
The basic class for representing 8-bit RGB or RGBA colour values.
Encapsulates the map of the game.