From d7438941058d330ec6584d8b0abab1b25e9cc77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Sun, 21 Nov 2021 20:19:51 +0900 Subject: [PATCH] CHG: Enable mouseover tooltips other than the first tile of convoy --- vehicle/vehicle.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vehicle/vehicle.cc b/vehicle/vehicle.cc index 2f93c2c6d0..9d1083be75 100644 --- a/vehicle/vehicle.cc +++ b/vehicle/vehicle.cc @@ -1136,8 +1136,20 @@ void vehicle_t::display_after(int xpos, int ypos, bool is_global) const tooltip_text[0] = 0; uint8 state = env_t::show_vehicle_states; if( state==1 || state==2 ) { + // mouse over check + bool mo_this_convoy = false; + const koord3d mouse_pos = world()->get_zeiger()->get_pos(); + if( mouse_pos==get_pos() ) { + mo_this_convoy = true; + } + else if( grund_t* mo_gr = world()->lookup(mouse_pos) ) { + if( vehicle_t* mo_veh = (vehicle_t*)mo_gr->get_convoi_vehicle() ) { + mo_this_convoy = mo_veh->get_convoi()==get_convoi(); + } + } + // only show when mouse over vehicle - if( welt->get_zeiger()->get_pos()==get_pos() ) { + if( mo_this_convoy ) { state = 3; } else {