mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format
This commit is contained in:
@@ -16,10 +16,11 @@ public class DayTimeAi extends SpellAbilityAi {
|
||||
// If it involves a cost that may put us at a disadvantage, better activate before own turn if possible
|
||||
if (!SpellAbilityAi.isSorcerySpeed(sa)) {
|
||||
return ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn() == aiPlayer;
|
||||
} else {
|
||||
return ph.is(PhaseType.MAIN2, aiPlayer); // Give other things a chance to be cast (e.g. Celestus)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: more logic for when it may not be desirable to do this. Special logic for Celestus?
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ public class CPrompt implements ICDoc {
|
||||
}
|
||||
|
||||
public void setMessage(final String s0) {
|
||||
String header = FControl.instance.getCurrentScreen().getDaytime() != null ? "[" + Localizer.getInstance().getMessage("lbl"+FControl.instance.getCurrentScreen().getDaytime()) + "]\n\n" : "[---]\n\n";
|
||||
String header = FControl.instance.getCurrentScreen().getDaytime() != null ? "[" + Localizer.getInstance().getMessage("lbl"+FControl.instance.getCurrentScreen().getDaytime()) + "]\n\n" : "";
|
||||
header += s0;
|
||||
view.getTarMessage().setText(FSkin.encodeSymbols(header, false));
|
||||
view.setCardView(null);
|
||||
|
||||
@@ -68,7 +68,10 @@ public class FDeckImportDialog extends FDialog {
|
||||
|
||||
callback = callback0;
|
||||
controller = new DeckImportController(dateTimeCheck, monthDropdown, yearDropdown, replacingDeck);
|
||||
txtInput.setText(Forge.getClipboard().getContents()); //just pull import directly off the clipboard
|
||||
String contents = Forge.getClipboard().getContents();
|
||||
if (contents == null)
|
||||
contents = ""; //prevent NPE
|
||||
txtInput.setText(contents);
|
||||
|
||||
if (FDeckEditor.editorTypesAllowsReplacement(editorType)) {
|
||||
GameType gameType = GameType.valueOf(editorType.name());
|
||||
|
||||
@@ -1036,7 +1036,10 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
//labelname
|
||||
g.drawText(item.getName(), GROUP_HEADER_FONT, Color.WHITE, x + PADDING, y + PADDING*2, w - 2 * PADDING, h - 2 * PADDING, true, Align.center, false);
|
||||
} else {
|
||||
if (!dp.isGeneratedDeck()){
|
||||
if (!dp.isGeneratedDeck()) {
|
||||
if (dp.getDeck().isEmpty()) {
|
||||
g.drawImage(FSkin.getDeckbox().get(2), FSkin.getDeckbox().get(2), x, y-(h*0.25f), w, h, Color.RED, selected);
|
||||
} else {
|
||||
//If deck has Commander, use it as cardArt reference
|
||||
PaperCard paperCard = dp.getDeck().getCommanders().isEmpty() ? dp.getHighestCMCCard() : dp.getDeck().getCommanders().get(0);
|
||||
FImageComplex cardArt = CardRenderer.getCardArt(paperCard);
|
||||
@@ -1047,6 +1050,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
} else {
|
||||
g.drawDeckBox(cardArt, scale, FSkin.getDeckbox().get(1), FSkin.getDeckbox().get(2), x, y, w, h, Color.GREEN, selected);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//generic box
|
||||
g.drawImage(FSkin.getDeckbox().get(2), FSkin.getDeckbox().get(2), x, y-(h*0.25f), w, h, Color.GREEN, selected);
|
||||
@@ -1070,12 +1074,16 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
//vertical mana icons
|
||||
CardFaceSymbols.drawColorSet(g, deckColor, x +(w-symbolSize), y+(h/8), symbolSize, true);
|
||||
if(!dp.isGeneratedDeck()) {
|
||||
if (dp.getDeck().isEmpty()) {
|
||||
g.drawImage(Forge.hdbuttons ? FSkinImage.HDYIELD : FSkinImage.WARNING, x, y, symbolSize, symbolSize);
|
||||
} else {
|
||||
if (Forge.hdbuttons)
|
||||
g.drawImage(DeckPreferences.getPrefs(dp).getStarCount() > 0 ? FSkinImage.HDSTAR_FILLED : FSkinImage.HDSTAR_OUTLINE, x, y, symbolSize, symbolSize);
|
||||
else
|
||||
g.drawImage(DeckPreferences.getPrefs(dp).getStarCount() > 0 ? FSkinImage.STAR_FILLED : FSkinImage.STAR_OUTLINE, x, y, symbolSize, symbolSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
String deckname = TextUtil.fastReplace(item.getName(),"] #", "]\n#");
|
||||
//deckname fakeshadow
|
||||
g.drawText(deckname, GROUP_HEADER_FONT, Color.BLACK, (x + PADDING)-1f, (y + (h/10) + PADDING)+1f, w - 2 * PADDING, h - 2 * PADDING, true, Align.center, true);
|
||||
|
||||
Reference in New Issue
Block a user