Display a icon into the movement hint where the unit can hide
(to replace the old sidebar use). Maybe later allow [hides] wml ability to choose the icon.
This commit is contained in:
parent
e53670fc74
commit
3e0d9927a7
4 changed files with 14 additions and 3 deletions
BIN
images/misc/hidden.png
Normal file
BIN
images/misc/hidden.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 671 B |
|
@ -675,6 +675,11 @@ void game_display::draw_movement_info(const gamemap::location& loc)
|
|||
int xpos = get_location_x(loc);
|
||||
int ypos = get_location_y(loc);
|
||||
|
||||
if (w->second.invisible) {
|
||||
surface hidden_surf = image::get_image("misc/hidden.png", image::UNMASKED);
|
||||
video().blit_surface(xpos, ypos, hidden_surf);
|
||||
}
|
||||
|
||||
if (w->second.zoc) {
|
||||
surface zoc_surf = image::get_image("misc/zoc.png", image::UNMASKED);
|
||||
video().blit_surface(xpos, ypos, zoc_surf);
|
||||
|
|
|
@ -254,7 +254,10 @@ int route_turns_to_complete(const unit& u, paths::route& rt, const team &viewing
|
|||
|| (viewing_team.is_enemy(u.side()) && viewing_team.fogged(*i)) );
|
||||
|
||||
++turns;
|
||||
rt.waypoints[*i] = paths::route::waypoint(turns, zoc, capture);
|
||||
|
||||
bool invisible = u.invisible(*i,units,teams,false);
|
||||
|
||||
rt.waypoints[*i] = paths::route::waypoint(turns, zoc, capture, invisible);
|
||||
|
||||
if (last_step) break; // finished and we used dummy move_cost
|
||||
|
||||
|
|
|
@ -111,11 +111,14 @@ struct paths
|
|||
int move_left; // movement unit will have left at end of the route.
|
||||
struct waypoint
|
||||
{
|
||||
waypoint(int t = 0, bool z = false, bool c = false)
|
||||
: turns(t), zoc(z), capture(c) {}
|
||||
waypoint(int turns_number = 0, bool in_zoc = false,
|
||||
bool do_capture = false, bool is_invisible = false)
|
||||
: turns(turns_number), zoc(in_zoc),
|
||||
capture(do_capture), invisible(is_invisible) {}
|
||||
int turns;
|
||||
bool zoc;
|
||||
bool capture;
|
||||
bool invisible;
|
||||
};
|
||||
std::map<gamemap::location, waypoint> waypoints;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue