mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Refactoring changes and other updates:
- Completely refactor continuous static effects. Layers are now implemented properly in the sense that every effect applies the relevant parts in the relevant layer, while locking in the set of cards to which it applies. - Refactor the (un)freezing of Trackable objects to a per-game Tracker object rather than static methods, to allow multiple games hosted on the same machine. - Refactor the changing of card colours to match other parts of the code (like type and P/T changing) more closely. Also get rid of some static parameters in that code. - Some changes in how split cards on the stack are handled to make them more robust. - Some more minor changes/cleanup.
This commit is contained in:
@@ -204,14 +204,17 @@ public class GuiChoose {
|
||||
@Override
|
||||
public void valueChanged(final ListSelectionEvent ev) {
|
||||
final T sel = list.getSelectedValue();
|
||||
if (sel instanceof InventoryItem) {
|
||||
CMatchUI.SINGLETON_INSTANCE.setCard((InventoryItem) list.getSelectedValue());
|
||||
return;
|
||||
}
|
||||
|
||||
final CardView card;
|
||||
if (sel instanceof CardStateView) {
|
||||
card = ((CardStateView) sel).getCard();
|
||||
}
|
||||
else if (sel instanceof CardView) {
|
||||
} else if (sel instanceof CardView) {
|
||||
card = (CardView) sel;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
card = null;
|
||||
}
|
||||
if (card != null) {
|
||||
@@ -220,9 +223,6 @@ public class GuiChoose {
|
||||
GuiUtils.clearPanelSelections();
|
||||
GuiUtils.setPanelSelection(card);
|
||||
}
|
||||
if (list.getSelectedValue() instanceof InventoryItem) {
|
||||
CMatchUI.SINGLETON_INSTANCE.setCard((InventoryItem) list.getSelectedValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public class VAssignDamage {
|
||||
}
|
||||
else if (defender instanceof PlayerView) {
|
||||
final PlayerView p = (PlayerView)defender;
|
||||
fakeCard = new CardView(-1, defender.toString(), p, CMatchUI.SINGLETON_INSTANCE.avatarImages.get(p.getLobbyPlayerName()));
|
||||
fakeCard = new CardView(-1, null, defender.toString(), p, CMatchUI.SINGLETON_INSTANCE.avatarImages.get(p.getLobbyPlayerName()));
|
||||
}
|
||||
addPanelForDefender(pnlDefenders, fakeCard);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user