Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'hover-hex'. Part of feature #16350.

  • Loading branch information...
commit 00165dd5c0e54d3fae1b919e742f6ba06ccccbd1 2 parents 6b02a92 + 3840321
Alexander van Gessel authored June 11, 2013
BIN  images/misc/hover-hex-enemy-bottom.png
BIN  images/misc/hover-hex-enemy-top.png
BIN  images/misc/hover-hex-yours-bottom.png
BIN  images/misc/hover-hex-yours-top.png
23  src/game_display.cpp
@@ -274,13 +274,26 @@ void game_display::draw_hex(const map_location& loc)
274 274
 
275 275
 	if(on_map && loc == mouseoverHex_) {
276 276
 		tdrawing_layer hex_top_layer = LAYER_MOUSEOVER_BOTTOM;
277  
-		if( get_visible_unit(loc, (*teams_)[viewing_team()] ) != NULL ) {
  277
+		const unit *u = get_visible_unit(loc, (*teams_)[viewing_team()] );
  278
+		if( u != NULL ) {
278 279
 			hex_top_layer = LAYER_MOUSEOVER_TOP;
279 280
 		}
280  
-		drawing_buffer_add( hex_top_layer,
281  
-						   loc, xpos, ypos, image::get_image("misc/hover-hex-top.png", image::SCALED_TO_HEX));
282  
-		drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
283  
-						   loc, xpos, ypos, image::get_image("misc/hover-hex-bottom.png", image::SCALED_TO_HEX));
  281
+		if(u != NULL && (*teams_)[currentTeam_].is_enemy(u->side())) {
  282
+			drawing_buffer_add( hex_top_layer,
  283
+				loc, xpos, ypos, image::get_image("misc/hover-hex-enemy-top.png", image::SCALED_TO_HEX));
  284
+			drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
  285
+				loc, xpos, ypos, image::get_image("misc/hover-hex-enemy-bottom.png", image::SCALED_TO_HEX));
  286
+		} else if(u != NULL && (*teams_)[currentTeam_].side() == u->side()) {
  287
+			drawing_buffer_add( hex_top_layer,
  288
+				loc, xpos, ypos, image::get_image("misc/hover-hex-yours-top.png", image::SCALED_TO_HEX));
  289
+			drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
  290
+				loc, xpos, ypos, image::get_image("misc/hover-hex-yours-bottom.png", image::SCALED_TO_HEX));
  291
+		} else {
  292
+			drawing_buffer_add( hex_top_layer,
  293
+				loc, xpos, ypos, image::get_image("misc/hover-hex-top.png", image::SCALED_TO_HEX));
  294
+			drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
  295
+				loc, xpos, ypos, image::get_image("misc/hover-hex-bottom.png", image::SCALED_TO_HEX));
  296
+		}
284 297
 	}
285 298
 
286 299
 

0 notes on commit 00165dd

Please sign in to comment.
Something went wrong with that request. Please try again.