Skip to content

Commit

Permalink
rename and make more common
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentarctagon committed Jan 31, 2024
1 parent fe68e32 commit acefe99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/image_modifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ surface gs_modification::operator()(const surface& src) const
return greyscale_image(src);
}

surface crop_to_fit_modification::operator()(const surface& src) const
surface crop_transparency_modification::operator()(const surface& src) const
{
return get_non_transparent_portion(src);
}
Expand Down Expand Up @@ -756,9 +756,9 @@ REGISTER_MOD_PARSER(GS, )
}

// crop transparent padding
REGISTER_MOD_PARSER(CROP_TO_FIT, )
REGISTER_MOD_PARSER(CROP_TRANSPARENCY, )
{
return std::make_unique<crop_to_fit_modification>();
return std::make_unique<crop_transparency_modification>();
}

// Black and white
Expand Down
4 changes: 2 additions & 2 deletions src/image_modifications.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ class gs_modification : public modification
};

/**
* Crop transparent padding (CROP_TO_FIT) modification.
* Crop transparent padding (CROP_TRANSPARENCY) modification.
*/
class crop_to_fit_modification : public modification
class crop_transparency_modification : public modification
{
public:
virtual surface operator()(const surface& src) const;
Expand Down
16 changes: 8 additions & 8 deletions src/reports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ static config image_report(const std::string &image,
using font::span_color;

static void add_status(config &r,
char const *path, char const *desc1, char const *desc2)
const std::string& path, char const *desc1, char const *desc2)
{
std::ostringstream s;
s << translation::gettext(desc1) << translation::gettext(desc2);
add_image(r, path, s.str());
add_image(r, path+"~CROP_TRANSPARENCY()", s.str());
}

static std::string flush(std::ostringstream &s)
Expand Down Expand Up @@ -338,27 +338,27 @@ static config unit_status(const reports::context& rc, const unit* u)
config res;
map_location displayed_unit_hex = rc.screen().displayed_unit_hex();
if (rc.map().on_board(displayed_unit_hex) && u->invisible(displayed_unit_hex)) {
add_status(res, "misc/invisible.png~CROP_TO_FIT()", N_("invisible: "),
add_status(res, "misc/invisible.png", N_("invisible: "),
N_("This unit is invisible. It cannot be seen or attacked by enemy units."));
}
if (u->get_state(unit::STATE_SLOWED)) {
add_status(res, "misc/slowed.png~CROP_TO_FIT()", N_("slowed: "),
add_status(res, "misc/slowed.png", N_("slowed: "),
N_("This unit has been slowed. It will only deal half its normal damage when attacking and its movement cost is doubled."));
}
if (u->get_state(unit::STATE_POISONED)) {
add_status(res, "misc/poisoned.png~CROP_TO_FIT()", N_("poisoned: "),
add_status(res, "misc/poisoned.png", N_("poisoned: "),
N_("This unit is poisoned. It will lose 8 HP every turn until it can seek a cure to the poison in a village or from a friendly unit with the ‘cures’ ability.\n\nUnits cannot be killed by poison alone. The poison will not reduce it below 1 HP."));
}
if (u->get_state(unit::STATE_PETRIFIED)) {
add_status(res, "misc/petrified.png~CROP_TO_FIT()", N_("petrified: "),
add_status(res, "misc/petrified.png", N_("petrified: "),
N_("This unit has been petrified. It may not move or attack."));
}
if (u->get_state(unit::STATE_UNHEALABLE)) {
add_status(res, "misc/unhealable.png~CROP_TO_FIT()", N_("unhealable: "),
add_status(res, "misc/unhealable.png", N_("unhealable: "),
N_("This unit is unhealable. It cannot be healed by healers or villages and doesn’t benefit from resting."));
}
if (u->get_state(unit::STATE_INVULNERABLE)) {
add_status(res, "misc/invulnerable.png~CROP_TO_FIT()", N_("invulnerable: "),
add_status(res, "misc/invulnerable.png", N_("invulnerable: "),
N_("This unit is invulnerable. It cannot be harmed by any attack."));
}
return res;
Expand Down

0 comments on commit acefe99

Please sign in to comment.