(boolean visible0)
| 94 | } |
| 95 | |
| 96 | @Override |
| 97 | public void setVisible(boolean visible0) { |
| 98 | FThreads.assertExecutedByEdt(true); //prevent showing or hiding overlays from background thread |
| 99 | |
| 100 | if (this.isVisible() == visible0) { return; } |
| 101 | |
| 102 | //ensure task to hide temporary overlay cancelled and run if another overlay becomes shown or hidden |
| 103 | if (tempOverlay != this && hideTempOverlayTask.isScheduled()) { |
| 104 | hideTempOverlayTask.cancel(); |
| 105 | hideTempOverlayTask.run(); |
| 106 | } |
| 107 | |
| 108 | if (visible0) { |
| 109 | //rotate overlay to face top human player if needed |
| 110 | setRotate180(MatchController.getView() != null && MatchController.getView().isTopHumanPlayerActive()); |
| 111 | overlays.push(this); |
| 112 | openedOnScreen = Forge.getCurrentScreen(); |
| 113 | } |
| 114 | else { |
| 115 | openedOnScreen = null; |
| 116 | |
| 117 | if (!hidingAll) { //hiding all handles cleaning up overlay collection |
| 118 | if (overlays.get(overlays.size() - 1) == this) { |
| 119 | //after removing the top overlay, delay hiding overlay for a brief period |
| 120 | //to prevent back color flickering if another popup immediately follows |
| 121 | if (tempOverlay != this && backColor != null) { |
| 122 | tempOverlay = this; |
| 123 | Timer.schedule(hideTempOverlayTask, 0.025f); |
| 124 | return; |
| 125 | } |
| 126 | overlays.pop(); |
| 127 | } |
| 128 | else { |
| 129 | overlays.remove(this); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | super.setVisible(visible0); |
| 134 | } |
| 135 | |
| 136 | public FSkinColor getBackColor() { |
| 137 | return backColor; |
no test coverage detected