Skip to content
Permalink
Browse files

bugfix grouped lands (#742)

  • Loading branch information
lusbenjamin authored and Manuel-777 committed Nov 22, 2019
1 parent 48b9d03 commit a257a1850958cf3662a92cec955528bae03f0e74
@@ -41,7 +41,7 @@ const SCALAR = 0.71808510638; // ???

export interface CardDetailsWindowletProps {
arenaState: number;
card?: DbCardData | any; // TODO remove group lands hack
card?: DbCardData;
cardsSizeHoverCard: number;
editMode: boolean;
handleToggleEditMode: () => void;
@@ -124,7 +124,7 @@ to stop editing overlay positions`}
unmountOnExit
>
<div style={{ display: "flex" }}>
{!!card && <img {...imgProps} />}
{!!card && !isCardGroupedLands && <img {...imgProps} />}
{!!card && arenaState === ARENA_MODE_DRAFT && (
<div className="main_hover_ratings">
<DraftRatings card={card} />
@@ -160,6 +160,12 @@ export default function DeckList(props: DeckListProps): JSX.Element {
}
mainCards.get().sort(sortFunc);
mainCards.get().forEach((card: any, index: number) => {
// TODO remove group lands hack
const isCardGroupedLands =
card && card.id && card.id.id && card.id.id === 100;
if (isCardGroupedLands) {
card = card.id;
}
let quantity = card.quantity;
if (settings.mode === OVERLAY_MIXED) {
const odds = (card.chance !== undefined ? card.chance : "0") + "%";
@@ -180,10 +186,6 @@ export default function DeckList(props: DeckListProps): JSX.Element {
quantity = DRAFT_RANKS[rank];
}

// TODO remove group lands hack
const isCardGroupedLands =
card && card.id && card.id.id && card.id.id === 100;

let fullCard = card;
if (card && card.id && !isCardGroupedLands) {
fullCard = db.card(card.id);
@@ -19,7 +19,7 @@ import { DbCardData, Rarity } from "./types/Metadata";
import _ from "lodash";

export interface CardTileProps {
card: DbCardData | any; // TODO remove group lands hack
card: DbCardData;
deck?: Deck;
dfcCard?: DbCardData;
indent: string;
@@ -409,16 +409,11 @@ function FlatCardTile(props: CardTileProps): JSX.Element {

export default function CardTile(props: CardTileProps): JSX.Element {
const { card, quantity } = props;
// TODO remove group lands hack
const haxxorProps = { ...props };
if (card.id && typeof card.id === "object" && card.id.name) {
haxxorProps.card = card.id;
}
if (!card || quantity === 0) {
return <></>;
}
if (haxxorProps.style === CARD_TILE_FLAT) {
return FlatCardTile(haxxorProps);
if (props.style === CARD_TILE_FLAT) {
return FlatCardTile(props);
}
return ArenaCardTile(haxxorProps);
return ArenaCardTile(props);
}
@@ -12,7 +12,6 @@ function getDeckTypesAmount(deck: DeckData): { [key: string]: number } {
deck.mainDeck.forEach(function(card: CardData | any) {
// TODO remove group lands hack
if (card.id.id && card.id.id == 100) {
types.lan += card.quantity;
return;
}
const c = db.card(card.id);
@@ -21,14 +21,7 @@ export const cardTile = function(
) {
if (quantity === 0) return false;

let card;
if (grpId && typeof grpId == "object" && grpId.name) {
// TODO remove group lands hack
card = grpId;
grpId = grpId.id;
} else {
card = db.card(grpId);
}
const card = db.card(grpId);
let dfcCard;
if (card && card.dfcId) {
dfcCard = db.card(card.dfcId);

0 comments on commit a257a18

Please sign in to comment.
You can’t perform that action at this time.