25 for (
int i = 0;; ++i) {
26 auto buffer = QStringLiteral(
"city.t_food_%1").arg(i);
33 for (
int i = 0;; ++i) {
34 auto buffer = QStringLiteral(
"city.t_shields_%1").arg(i);
41 for (
int i = 0;; ++i) {
42 auto buffer = QStringLiteral(
"city.t_trade_%1").arg(i);
51 std::vector<QPixmap *>
colors;
52 for (
int i = 0;; ++i) {
53 auto buffer = QStringLiteral(
"colors.overlay_%1").arg(i);
62 _(
"Missing overlay-color sprite colors.overlay_0."));
65 auto worked_base =
load_sprite({
"mask.worked_tile"},
true);
66 auto unworked_base =
load_sprite({
"mask.unworked_tile"},
true);
70 for (
const auto &color :
colors) {
71 auto color_mask = std::unique_ptr<QPixmap>(
74 crop_sprite(color_mask.get(), 0, 0, W, H, worked_base, 0, 0));
76 crop_sprite(color_mask.get(), 0, 0, W, H, unworked_base, 0, 0));
83 std::vector<drawn_sprite>
86 const unit *punit)
const
88 std::vector<drawn_sprite> sprs;
94 unit *psettler =
nullptr;
105 if (!citymode && pcity->client.colored) {
107 int idx = pcity->client.color_index %
m_worked.size();
108 if (pwork && pwork == pcity) {
113 }
else if (pwork && pwork == pcity
140 }
else if (psettler && psettler->
client.colored) {
QPixmap crop_sprite(const QPixmap *sprite)
Helper function to crop a sprite.
int city_tile_output_now(const struct city *pcity, const struct tile *ptile, Output_type_id otype)
Calculate the production output the given tile is capable of producing for the city.
bool city_base_to_city_map(int *city_map_x, int *city_map_y, const struct city *const pcity, const struct tile *map_tile)
Finds the city map coordinate for a given map position and a city.
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
Returns TRUE when a tile is available to be worked, or the city itself is currently working the tile ...
struct city * is_any_city_dialog_open()
layer_overlays(struct tileset *ts)
void load_sprites() override
Loads all sprites that do not depend on the ruleset.
std::vector< QPixmap * > m_food
std::vector< std::unique_ptr< QPixmap > > m_worked
std::vector< QPixmap * > m_prod
std::vector< QPixmap * > m_trade
std::vector< drawn_sprite > fill_sprite_array(const tile *ptile, const tile_edge *pedge, const tile_corner *pcorner, const unit *punit) const override
Fill in the given sprite array with any needed overlays sprites.
std::vector< std::unique_ptr< QPixmap > > m_unworked
A layer when drawing the map.
QPixmap * load_sprite(const QStringList &possible_names, bool required=false, bool verbose=true) const
Shortcut to load a sprite from the tileset.
struct tileset * tileset() const
enum known_type client_tile_get_known(const struct tile *ptile)
A tile's "known" field is used by the server to store whether each player knows the tile.
#define fc_assert_action(condition, action)
client_options * gui_options
#define CLIP(lower, current, upper)
struct packet_game_info info
struct unit::@76::@78 client
#define tile_worked(_tile)
const QPixmap * get_attention_crosshair_sprite(const struct tileset *t)
Returns a sprite with the "user-attention" crosshair graphic.
bool tileset_is_isometric(const struct tileset *t)
Return whether the current tileset is isometric.
const QPixmap * get_mask_sprite(const struct tileset *t)
Return tile mask sprite.
int tileset_tile_height(const struct tileset *t)
Return the tile height of the current tileset.
void tileset_error(struct tileset *t, QtMsgType level, const char *format,...)
Called when ever there's problem in ruleset/tileset compatibility.
int tileset_tile_width(const struct tileset *t)
Return the tile width of the current tileset.
struct city * find_city_or_settler_near_tile(const struct tile *ptile, struct unit **punit)
Find the "best" city/settlers to associate with the selected tile.
bool mapdeco_is_crosshair_set(const struct tile *ptile)
Returns TRUE if there is a "crosshair" decoration set at the given tile.