Merge branch 'hover-hex'. Part of feature #16350.
This commit is contained in:
commit
00165dd5c0
5 changed files with 18 additions and 5 deletions
BIN
images/misc/hover-hex-enemy-bottom.png
Normal file
BIN
images/misc/hover-hex-enemy-bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
images/misc/hover-hex-enemy-top.png
Normal file
BIN
images/misc/hover-hex-enemy-top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
BIN
images/misc/hover-hex-yours-bottom.png
Normal file
BIN
images/misc/hover-hex-yours-bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
images/misc/hover-hex-yours-top.png
Normal file
BIN
images/misc/hover-hex-yours-top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6 KiB |
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue