GUI: fixed that dungeon card hint doesn't hide after choose dialog, fixed working card hint on empty space in choose dialog (#8012);

This commit is contained in:
Oleg Agafonov 2021-08-30 10:10:26 +04:00
parent 1809fb516a
commit 8bd1a9cde5

View file

@ -153,7 +153,14 @@ public class PickChoiceDialog extends MageDialog {
public void mouseMoved(MouseEvent e) {
// hint show
JList listSource = (JList) e.getSource();
int index = listSource.locationToIndex(e.getPoint());
// workaround to raise on real element, not empty space
int index = -1;
Rectangle r = listSource.getCellBounds(0, listSource.getLastVisibleIndex());
if (r != null && r.contains(e.getPoint())) {
index = listSource.locationToIndex(e.getPoint());
}
if (index > -1) {
choiceHintShow(index);
} else {
@ -255,7 +262,8 @@ public class PickChoiceDialog extends MageDialog {
private void choiceHintHide() {
switch (choice.getHintType()) {
case CARD: {
case CARD:
case CARD_DUNGEON: {
// as popup card
cardInfo.onMouseExited();
break;