During ai turn, do highlight the hex where the unit moved from
(consistent with multiplayer). The unit being moved is still shown in the sidebar.
This commit is contained in:
parent
68f148c398
commit
c65409fdeb
3 changed files with 14 additions and 1 deletions
|
@ -416,7 +416,8 @@ gamemap::location ai_interface::move_unit_partial(location from, location to,
|
|||
// Stop the user from issuing any commands while the unit is moving.
|
||||
const events::command_disabler disable_commands;
|
||||
|
||||
info_.disp.select_hex(from);
|
||||
// show the unit in the sidebar without highlighting it
|
||||
info_.disp.display_unit_hex(from);
|
||||
info_.disp.update_display();
|
||||
|
||||
log_scope2(ai, "move_unit");
|
||||
|
|
|
@ -238,6 +238,14 @@ void game_display::highlight_hex(gamemap::location hex)
|
|||
}
|
||||
|
||||
|
||||
void game_display::display_unit_hex(gamemap::location hex)
|
||||
{
|
||||
if (units_.count(hex)) {
|
||||
displayedUnitHex_ = hex;
|
||||
invalidate_unit();
|
||||
}
|
||||
}
|
||||
|
||||
void game_display::invalidate_unit_after_move(const gamemap::location& src, const gamemap::location& dst)
|
||||
{
|
||||
if (src == displayedUnitHex_) {
|
||||
|
|
|
@ -75,6 +75,10 @@ public:
|
|||
//! while highlighting is used when a location has been moused over.
|
||||
virtual void highlight_hex(gamemap::location hex);
|
||||
|
||||
//! Change the unit to be displayed in the sidebar.
|
||||
//! This is used when selecting or highlighting is not wanted.
|
||||
void display_unit_hex(gamemap::location hex);
|
||||
|
||||
//! Sets the paths that are currently displayed as available
|
||||
//! for the unit to move along.
|
||||
//! All other paths will be greyed out.
|
||||
|
|
Loading…
Add table
Reference in a new issue