Skip to content

Commit

Permalink
Merge branch 'hover-hex'. Part of feature #16350.
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 committed Jun 11, 2013
2 parents 6b02a92 + 3840321 commit 00165dd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
Binary file added images/misc/hover-hex-enemy-bottom.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/misc/hover-hex-enemy-top.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/misc/hover-hex-yours-bottom.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/misc/hover-hex-yours-top.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions src/game_display.cpp
Expand Up @@ -274,13 +274,26 @@ void game_display::draw_hex(const map_location& loc)

if(on_map && loc == mouseoverHex_) {
tdrawing_layer hex_top_layer = LAYER_MOUSEOVER_BOTTOM;
if( get_visible_unit(loc, (*teams_)[viewing_team()] ) != NULL ) {
const unit *u = get_visible_unit(loc, (*teams_)[viewing_team()] );
if( u != NULL ) {
hex_top_layer = LAYER_MOUSEOVER_TOP;
}
drawing_buffer_add( hex_top_layer,
loc, xpos, ypos, image::get_image("misc/hover-hex-top.png", image::SCALED_TO_HEX));
drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
loc, xpos, ypos, image::get_image("misc/hover-hex-bottom.png", image::SCALED_TO_HEX));
if(u != NULL && (*teams_)[currentTeam_].is_enemy(u->side())) {
drawing_buffer_add( hex_top_layer,
loc, xpos, ypos, image::get_image("misc/hover-hex-enemy-top.png", image::SCALED_TO_HEX));
drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
loc, xpos, ypos, image::get_image("misc/hover-hex-enemy-bottom.png", image::SCALED_TO_HEX));
} else if(u != NULL && (*teams_)[currentTeam_].side() == u->side()) {
drawing_buffer_add( hex_top_layer,
loc, xpos, ypos, image::get_image("misc/hover-hex-yours-top.png", image::SCALED_TO_HEX));
drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
loc, xpos, ypos, image::get_image("misc/hover-hex-yours-bottom.png", image::SCALED_TO_HEX));
} else {
drawing_buffer_add( hex_top_layer,
loc, xpos, ypos, image::get_image("misc/hover-hex-top.png", image::SCALED_TO_HEX));
drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
loc, xpos, ypos, image::get_image("misc/hover-hex-bottom.png", image::SCALED_TO_HEX));
}
}


Expand Down

0 comments on commit 00165dd

Please sign in to comment.