mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Use caching for CombatView (plus some random NPE and concurrency fixes).
This commit is contained in:
@@ -45,6 +45,7 @@ import forge.view.CardView;
|
||||
import forge.view.CombatView;
|
||||
import forge.view.FView;
|
||||
import forge.view.GameEntityView;
|
||||
import forge.view.IGameView;
|
||||
import forge.view.arcane.CardPanel;
|
||||
|
||||
/**
|
||||
@@ -364,7 +365,10 @@ public enum TargetingOverlay {
|
||||
if (overlaystate == 0) { return; }
|
||||
|
||||
// Arc drawing
|
||||
assembleArcs(MatchUtil.getGameView().getCombat());
|
||||
final IGameView gameView = MatchUtil.getGameView();
|
||||
if (gameView != null) {
|
||||
assembleArcs(gameView.getCombat());
|
||||
}
|
||||
|
||||
if (arcsCombat.isEmpty() && arcsOther.isEmpty()) { return; }
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import forge.sound.MusicPlaylist;
|
||||
import forge.sound.SoundSystem;
|
||||
import forge.toolbox.FButton;
|
||||
import forge.view.FView;
|
||||
import forge.view.IGameView;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -207,7 +208,8 @@ public enum VMatchUI implements IVTopLevelUI {
|
||||
*/
|
||||
@Override
|
||||
public boolean onClosing(FScreen screen) {
|
||||
if (!MatchUtil.getGameView().isGameOver()) {
|
||||
final IGameView gameView = MatchUtil.getGameView();
|
||||
if (gameView != null && !gameView.isGameOver()) {
|
||||
MatchUtil.concede();
|
||||
return false; //delay hiding tab even if concede successful
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user