Add 2 or 3 lines of code allowing to use a 2-hex Attack Direction Indicator

I also commit some placeholder images, to show how it works and hoping
that someone will improve them

I use a not-too-much-visible quick-gimp, in case it stay longer than
expected, but still a-bit-ugly to motivate some artist to improve them
(and because i can't do better in less than 1 day of gimp-work :-/ )
This commit is contained in:
Ali El Gariani 2007-08-07 17:02:27 +00:00
parent 43651cf3a4
commit 31f423668c
8 changed files with 8 additions and 5 deletions

BIN
images/misc/attack-to-n.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/misc/attack-to-s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -384,7 +384,13 @@ void game_display::draw(bool update,bool force)
// draw the attack direction indicator
if(*it == attack_indicator_to_) {
tile_stack_append(image::get_image(attack_indicator_image_, image::UNMASKED));
const std::string dir = gamemap::location::write_direction(
attack_indicator_to_.get_relative_dir(attack_indicator_from_));
tile_stack_append(image::get_image("misc/attack-from-" + dir + ".png", image::UNMASKED));
} else if (*it == attack_indicator_from_) {
const std::string dir = gamemap::location::write_direction(
attack_indicator_from_.get_relative_dir(attack_indicator_to_));
tile_stack_append(image::get_image("misc/attack-to-" + dir + ".png", image::UNMASKED));
}
// apply shroud anf fog
@ -1104,8 +1110,6 @@ void game_display::set_attack_indicator(const gamemap::location& from, const gam
attack_indicator_from_ = from;
attack_indicator_to_ = to;
std::string dir = gamemap::location::write_direction(to.get_relative_dir(from));
attack_indicator_image_ = "misc/attack-from-" + dir + ".png";
invalidate(attack_indicator_from_);
invalidate(attack_indicator_to_);

View file

@ -193,10 +193,9 @@ private:
unit *temp_unit_;
gamemap::location temp_unit_loc_;
//location and direction of the attack direction indicator
//locations of the attack direction indicator's parts
gamemap::location attack_indicator_to_;
gamemap::location attack_indicator_from_;
std::string attack_indicator_image_;
//function which finds the start and end rows on the energy bar image
//where white pixels are substituted for the colour of the energy