mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Delegate network game communication to a new GameProtocol class
- Rename a method to make it compatible with the new protocol
This commit is contained in:
@@ -193,6 +193,9 @@ public final class CMatchUI
|
||||
FThreads.invokeInEdtNowOrLater(new Runnable() {
|
||||
@Override public final void run() {
|
||||
for (final VField f : getFieldViews()) {
|
||||
f.updateDetails();
|
||||
f.updateZones();
|
||||
f.updateManaPool();
|
||||
f.getTabletop().update();
|
||||
}
|
||||
for (final VHand h : getHandViews()) {
|
||||
@@ -457,29 +460,31 @@ public final class CMatchUI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSingleCard(final CardView c) {
|
||||
final ZoneType zone = c.getZone();
|
||||
if (zone == null) { return; }
|
||||
public void updateCards(final Iterable<CardView> cards) {
|
||||
for (final CardView c : cards) {
|
||||
final ZoneType zone = c.getZone();
|
||||
if (zone == null) { return; }
|
||||
|
||||
switch (zone) {
|
||||
case Battlefield:
|
||||
final VField battlefield = getFieldViewFor(c.getController());
|
||||
if (battlefield != null) {
|
||||
battlefield.getTabletop().updateCard(c, false);
|
||||
}
|
||||
break;
|
||||
case Hand:
|
||||
final VHand hand = getHandFor(c.getController());
|
||||
if (hand != null) {
|
||||
CardPanel cp = hand.getHandArea().getCardPanel(c.getId());
|
||||
if (cp != null) {
|
||||
cp.setCard(c); //ensure card view updated
|
||||
cp.repaintOverlays();
|
||||
switch (zone) {
|
||||
case Battlefield:
|
||||
final VField battlefield = getFieldViewFor(c.getController());
|
||||
if (battlefield != null) {
|
||||
battlefield.getTabletop().updateCard(c, false);
|
||||
}
|
||||
break;
|
||||
case Hand:
|
||||
final VHand hand = getHandFor(c.getController());
|
||||
if (hand != null) {
|
||||
final CardPanel cp = hand.getHandArea().getCardPanel(c.getId());
|
||||
if (cp != null) {
|
||||
cp.setCard(c); //ensure card view updated
|
||||
cp.repaintOverlays();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ public class FButton extends SkinnedButton implements ILocalRepaint, IButton {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextColor(FSkinProp color) {
|
||||
public void setImage(FSkinProp color) {
|
||||
setForeground(FSkin.getColor(Colors.fromSkinProp(color)));
|
||||
}
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ public class FLabel extends SkinnedLabel implements ILocalRepaint, IButton {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextColor(FSkinProp color) {
|
||||
public void setImage(FSkinProp color) {
|
||||
setForeground(FSkin.getColor(Colors.fromSkinProp(color)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user