mirror of
https://github.com/Relintai/mtg-forge-ios.git
synced 2024-11-14 04:17:19 +01:00
- Fixed split cards not being foiled correctly in all cases because the game assumed the foil effect to be stored on one of the halves instead of on the original card state.
- A more comprehensive fix for rotating split cards with foil in mobile Forge that does not break them in hand/graveyard/whatever. Also, turned it into an option since it doesn't look good in portrait mode, especially on smaller cellphones and in single card zoom mode. git-svn-id: http://svn.slightlymagic.net/forge/trunk@35829 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
parent
51ab22ded9
commit
d91b3ab068
@ -17,19 +17,11 @@
|
||||
*/
|
||||
package forge.game.card;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import forge.card.CardEdition;
|
||||
import forge.card.CardRarity;
|
||||
import forge.card.CardType;
|
||||
import forge.card.CardTypeView;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.*;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaCostParser;
|
||||
import forge.game.ForgeScript;
|
||||
@ -43,6 +35,9 @@ import forge.game.trigger.Trigger;
|
||||
import forge.util.collect.FCollection;
|
||||
import forge.util.collect.FCollectionView;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class CardState extends GameObject {
|
||||
private String name = "";
|
||||
private CardType type = new CardType();
|
||||
@ -328,12 +323,12 @@ public class CardState extends GameObject {
|
||||
}
|
||||
public final void setSVar(final String var, final String str) {
|
||||
sVars.put(var, str);
|
||||
view.updateFoilIndex(this);
|
||||
view.updateFoilIndex(card.getState(CardStateName.Original));
|
||||
}
|
||||
public final void setSVars(final Map<String, String> newSVars) {
|
||||
sVars = Maps.newTreeMap();
|
||||
sVars.putAll(newSVars);
|
||||
view.updateFoilIndex(this);
|
||||
view.updateFoilIndex(card.getState(CardStateName.Original));
|
||||
}
|
||||
public final void removeSVar(final String var) {
|
||||
if (sVars.containsKey(var)) {
|
||||
|
@ -1,26 +1,11 @@
|
||||
package forge.card;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.properties.ForgePreferences;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import forge.Graphics;
|
||||
import forge.assets.FBufferedImage;
|
||||
import forge.assets.FSkinColor;
|
||||
import forge.assets.FSkinFont;
|
||||
import forge.assets.FSkinImage;
|
||||
import forge.assets.FSkinTexture;
|
||||
import forge.assets.ImageCache;
|
||||
import forge.assets.TextRenderer;
|
||||
import forge.assets.*;
|
||||
import forge.card.CardDetailUtil.DetailColors;
|
||||
import forge.card.CardRenderer.CardStackPosition;
|
||||
import forge.card.mana.ManaCost;
|
||||
@ -28,9 +13,16 @@ import forge.game.GameView;
|
||||
import forge.game.card.CardView;
|
||||
import forge.game.card.CardView.CardStateView;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.screens.FScreen;
|
||||
import forge.screens.match.MatchController;
|
||||
import forge.util.Utils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CardImageRenderer {
|
||||
private static final float BASE_IMAGE_WIDTH = 360;
|
||||
@ -346,15 +338,16 @@ public class CardImageRenderer {
|
||||
float new_h = h*wh_Adj;
|
||||
float new_x = ForgeConstants.isGdxPortLandscape && isCurrentCard ? (dispW - new_w) / 2:x;
|
||||
float new_y = ForgeConstants.isGdxPortLandscape && isCurrentCard ? (dispH - new_h) / 2:y;
|
||||
if(FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_PLANE_OR_PHENOMENON)
|
||||
&& (card.getCurrentState().isPhenomenon() || card.getCurrentState().isPlane()))
|
||||
boolean rotateSplit = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_SPLIT_CARDS);
|
||||
boolean rotatePlane = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ROTATE_PLANE_OR_PHENOMENON);
|
||||
if (rotatePlane && (card.getCurrentState().isPhenomenon() || card.getCurrentState().isPlane()))
|
||||
g.drawRotatedImage(image, new_x, new_y, new_w, new_h, new_x + new_w / 2, new_y + new_h / 2, -90);
|
||||
else if(isCurrentCard && card.isSplitCard())
|
||||
else if (rotateSplit && isCurrentCard && card.isSplitCard())
|
||||
g.drawRotatedImage(image, new_x, new_y, new_w, new_h, new_x + new_w / 2, new_y + new_h / 2, card.getText().contains("Aftermath") ? 90:-90);
|
||||
else
|
||||
g.drawImage(image, x, y, w, h);
|
||||
}
|
||||
CardRenderer.drawFoilEffect(g, card, x, y, w, h);
|
||||
CardRenderer.drawFoilEffect(g, card, x, y, w, h, true);
|
||||
}
|
||||
|
||||
public static void drawDetails(Graphics g, CardView card, GameView gameView, boolean altState, float x, float y, float w, float h) {
|
||||
|
@ -355,7 +355,7 @@ public class CardRenderer {
|
||||
if (card.getCurrentState().getFoilIndex() == 0) { //if foil finish not yet established, assign a random one
|
||||
card.getCurrentState().setFoilIndexOverride(-1);
|
||||
}
|
||||
drawFoilEffect(g, card, x, y, w, h);
|
||||
drawFoilEffect(g, card, x, y, w, h, false);
|
||||
}
|
||||
}
|
||||
else { //draw cards without textures as just a black rectangle
|
||||
@ -376,7 +376,7 @@ public class CardRenderer {
|
||||
else
|
||||
g.drawImage(image, x, y, w, h);
|
||||
}
|
||||
drawFoilEffect(g, card, x, y, w, h);
|
||||
drawFoilEffect(g, card, x, y, w, h, false);
|
||||
}
|
||||
else { //draw cards without textures as just a black rectangle
|
||||
g.fillRect(Color.BLACK, x, y, w, h);
|
||||
@ -664,11 +664,12 @@ public class CardRenderer {
|
||||
CardFaceSymbols.drawManaCost(g, cost, x + (w - manaCostWidth) / 2, y + (h - manaSymbolSize) / 2, manaSymbolSize);
|
||||
}
|
||||
|
||||
public static void drawFoilEffect(Graphics g, CardView card, float x, float y, float w, float h) {
|
||||
public static void drawFoilEffect(Graphics g, CardView card, float x, float y, float w, float h, boolean inZoomer) {
|
||||
if (isPreferenceEnabled(FPref.UI_OVERLAY_FOIL_EFFECT) && MatchController.instance.mayView(card)) {
|
||||
boolean rotateSplit = isPreferenceEnabled(FPref.UI_ROTATE_SPLIT_CARDS) && card.isSplitCard() && inZoomer;
|
||||
int foil = card.getCurrentState().getFoilIndex();
|
||||
if (foil > 0) {
|
||||
CardFaceSymbols.drawOther(g, String.format("foil%02d", foil), x, y, w, h, card.isSplitCard());
|
||||
CardFaceSymbols.drawOther(g, String.format("foil%02d", foil), x, y, w, h, rotateSplit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -232,8 +232,12 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
||||
ForgeConstants.DISP_CURRENT_COLORS_CHANGED, ForgeConstants.DISP_CURRENT_COLORS_MULTI_OR_CHANGED,
|
||||
ForgeConstants.DISP_CURRENT_COLORS_ALWAYS}),
|
||||
4);
|
||||
lstSettings.addItem(new BooleanSetting(FPref.UI_ROTATE_SPLIT_CARDS,
|
||||
"Rotate Zoom Image of Split Cards",
|
||||
"Rotates the zoomed image of split cards."),
|
||||
4);
|
||||
lstSettings.addItem(new BooleanSetting(FPref.UI_ROTATE_PLANE_OR_PHENOMENON,
|
||||
"Rotate Zoom Image of Planes/Phenomenon",
|
||||
"Rotate Zoom Image of Planes/Phenomena",
|
||||
"Rotates the zoomed image of Plane or Phenomenon cards."),
|
||||
4);
|
||||
lstSettings.addItem(new BooleanSetting(FPref.UI_DYNAMIC_PLANECHASE_BG,
|
||||
|
@ -95,6 +95,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
||||
UI_CARD_COUNTER_DISPLAY_LOCATION(ForgeConstants.CounterDisplayLocation.TOP.getName()),
|
||||
UI_ANDROID_MINIMIZE_ON_SCRLOCK("false"),
|
||||
UI_ROTATE_PLANE_OR_PHENOMENON("false"),
|
||||
UI_ROTATE_SPLIT_CARDS("true"),
|
||||
UI_DYNAMIC_PLANECHASE_BG("false"),
|
||||
UI_DISABLE_IMAGES_EFFECT_CARDS("false"),
|
||||
UI_ALLOW_ORDER_GRAVEYARD_WHEN_NEEDED ("Never"),
|
||||
|
Loading…
Reference in New Issue
Block a user