15 #define GETTEXT_DOMAIN "wesnoth-lib"
41 const std::string& tod_id = disp.get_time_of_day(
loc).id;
42 tile_->rebuild_cache(tod_id, &tile_logs_);
55 listbox& list = find_widget<listbox>(
"layer_list");
64 const std::string& name =
img.get_filename();
73 data.emplace(
"index", item);
75 std::ostringstream image_steam;
78 SDL_Rect r {0,0,tz,tz};
86 ((tz * 3) / 4) * loc_cut.
x
87 , tz * loc_cut.
y + (tz / 2) * (loc_cut.
x % 2)
92 if(
img.get_center_x() >= 0 &&
img.get_center_y() >= 0) {
93 r.x += img_size.x / 2 -
img.get_center_x();
94 r.y += img_size.y / 2 -
img.get_center_y();
98 image_steam <<
"terrain/foreground.png";
103 rect r2{0, 0, img_size.x, img_size.y};
109 << r2.x <<
"," << r2.y <<
","
110 << r2.w <<
"," << r2.h <<
")"
111 <<
"," << r2.x - r.x <<
"," << r2.y - r.y
113 <<
"~MASK(" <<
"terrain/alphamask.png" <<
")";
116 item[
"label"] = image_steam.str();
117 data.emplace(
"image_used", item);
119 item[
"label"] = name +
"~SCALE(72,72)";
120 data.emplace(
"image_full", item);
122 item[
"label"] = name;
123 data.emplace(
"name", item);
126 data.emplace(
"loc", item);
128 item[
"label"] = std::to_string(ri->
layer);
129 data.emplace(
"layer", item);
131 item[
"label"] = std::to_string(ri->
basex);
132 data.emplace(
"base_x", item);
134 item[
"label"] = std::to_string(ri->
basey);
135 data.emplace(
"base_y", item);
138 data.emplace(
"center", item);
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
Abstract base class for all modal dialogs.
virtual void pre_show() override
Actions to be taken before showing the window.
terrain_builder::tile::logs tile_logs_
terrain_builder::tile * tile_
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
Generic locator abstracting the location of an image.
The class terrain_builder is constructed from a config object, and a gamemap object.
tile * get_tile(const map_location &loc)
map_display and display: classes which take care of displaying the map and game-data on the screen.
REGISTER_DIALOG(editor_edit_unit)
std::map< std::string, widget_item > widget_data
std::map< std::string, t_string > widget_item
std::string img(const std::string &src, const std::string &align, const bool floating)
std::string bullet_list(const T &v, std::size_t indent=4, const std::string &bullet=font::unicode_bullet)
Generates a new string containing a bullet list.
Encapsulates the map of the game.
An abstract description of a rectangle with integer coordinates.
std::vector< animated< image::locator > > images
An animated image locator built according to the image string.
int basex
The position of the image base (that is, the point where the image reaches the floor) for vertical la...
bool is_background() const
int layer
The layer of the image for horizontal layering.
int center_x
The position where the center of the image base should be.
Represent a rule_image applied with a random seed.
std::set< std::string > flags
The list of flags present in this tile.
std::pair< const rule_image_rand *, const rule_image_variant * > log_details