mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
allow devmode to find custom cards
This commit is contained in:
@@ -236,6 +236,10 @@ public class StaticData {
|
|||||||
return commonCards;
|
return commonCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CardDb getCustomCards() {
|
||||||
|
return customCards;
|
||||||
|
}
|
||||||
|
|
||||||
public CardDb getVariantCards() {
|
public CardDb getVariantCards() {
|
||||||
return variantCards;
|
return variantCards;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2569,12 +2569,18 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
|
|
||||||
final CardDb carddb = FModel.getMagicDb().getCommonCards();
|
final CardDb carddb = FModel.getMagicDb().getCommonCards();
|
||||||
final List<ICardFace> faces = Lists.newArrayList(carddb.getAllFaces());
|
final List<ICardFace> faces = Lists.newArrayList(carddb.getAllFaces());
|
||||||
|
final CardDb customDb = FModel.getMagicDb().getCustomCards();
|
||||||
|
final List<ICardFace> customFaces = Lists.newArrayList(customDb.getAllFaces());
|
||||||
List<CardFaceView> choices = new ArrayList<>();
|
List<CardFaceView> choices = new ArrayList<>();
|
||||||
CardFaceView cardFaceView;
|
CardFaceView cardFaceView;
|
||||||
for (ICardFace cardFace : faces) {
|
for (ICardFace cardFace : faces) {
|
||||||
cardFaceView = new CardFaceView(CardTranslation.getTranslatedName(cardFace.getName()), cardFace.getName());
|
cardFaceView = new CardFaceView(CardTranslation.getTranslatedName(cardFace.getName()), cardFace.getName());
|
||||||
choices.add(cardFaceView);
|
choices.add(cardFaceView);
|
||||||
}
|
}
|
||||||
|
for (ICardFace cardFace : customFaces) {
|
||||||
|
cardFaceView = new CardFaceView(CardTranslation.getTranslatedName(cardFace.getName()), cardFace.getName());
|
||||||
|
choices.add(cardFaceView);
|
||||||
|
}
|
||||||
Collections.sort(choices);
|
Collections.sort(choices);
|
||||||
|
|
||||||
// use standard forge's list selection dialog
|
// use standard forge's list selection dialog
|
||||||
@@ -2583,10 +2589,13 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final PaperCard c = carddb.getUniqueByName(f.getOracleName());
|
PaperCard c = carddb.getUniqueByName(f.getOracleName());
|
||||||
|
if (c == null)
|
||||||
|
c = customDb.getUniqueByName(f.getOracleName());
|
||||||
final Card forgeCard = Card.fromPaperCard(c, p);
|
final Card forgeCard = Card.fromPaperCard(c, p);
|
||||||
forgeCard.setTimestamp(getGame().getNextTimestamp());
|
forgeCard.setTimestamp(getGame().getNextTimestamp());
|
||||||
|
|
||||||
|
PaperCard finalC = c;
|
||||||
getGame().getAction().invoke(new Runnable() {
|
getGame().getAction().invoke(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -2618,7 +2627,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (c.getRules().getType().isLand()) {
|
if (finalC.getRules().getType().isLand()) {
|
||||||
// this is needed to ensure land abilities fire
|
// this is needed to ensure land abilities fire
|
||||||
getGame().getAction().moveToHand(forgeCard, null);
|
getGame().getAction().moveToHand(forgeCard, null);
|
||||||
getGame().getAction().moveToPlay(forgeCard, null);
|
getGame().getAction().moveToPlay(forgeCard, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user