mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
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:
parent
1809fb516a
commit
8bd1a9cde5
1 changed files with 10 additions and 2 deletions
|
|
@ -153,7 +153,14 @@ public class PickChoiceDialog extends MageDialog {
|
||||||
public void mouseMoved(MouseEvent e) {
|
public void mouseMoved(MouseEvent e) {
|
||||||
// hint show
|
// hint show
|
||||||
JList listSource = (JList) e.getSource();
|
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) {
|
if (index > -1) {
|
||||||
choiceHintShow(index);
|
choiceHintShow(index);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -255,7 +262,8 @@ public class PickChoiceDialog extends MageDialog {
|
||||||
|
|
||||||
private void choiceHintHide() {
|
private void choiceHintHide() {
|
||||||
switch (choice.getHintType()) {
|
switch (choice.getHintType()) {
|
||||||
case CARD: {
|
case CARD:
|
||||||
|
case CARD_DUNGEON: {
|
||||||
// as popup card
|
// as popup card
|
||||||
cardInfo.onMouseExited();
|
cardInfo.onMouseExited();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue