Starting decks working.
@@ -43,7 +43,7 @@
|
||||
1x5_81
|
||||
2x5_122
|
||||
3x5_83
|
||||
3x5_265
|
||||
3x4_265
|
||||
3x5_88
|
||||
3x4_287
|
||||
3x4_288
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
.borderOverlay {
|
||||
border: 2px solid #000000;
|
||||
border: 0px solid #000000;
|
||||
}
|
||||
|
||||
.foilOverlay {
|
||||
|
||||
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 131 KiB |
@@ -580,7 +580,7 @@ var GempLotrDeckBuildingUI = Class.extend({
|
||||
var blueprintIds = selection.split("|");
|
||||
for (var i = 0; i < blueprintIds.length; i++) {
|
||||
var card = new Card(blueprintIds[i], "selection", "selection" + i, "player");
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, card.isFoil(), false);
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, card.isFoil(), false, card.isPack());
|
||||
cardDiv.data("card", card);
|
||||
cardDiv.addClass("cardToSelect");
|
||||
this.selectionDialog.append(cardDiv);
|
||||
@@ -639,7 +639,7 @@ var GempLotrDeckBuildingUI = Class.extend({
|
||||
displayCardInfo: function(card) {
|
||||
this.infoDialog.html("");
|
||||
this.infoDialog.html("<div style='scroll: auto'></div>");
|
||||
this.infoDialog.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal));
|
||||
this.infoDialog.append(createFullCardDiv(card.imageUrl, card.foil, card.horizontal, card.isPack()));
|
||||
var windowWidth = $(window).width();
|
||||
var windowHeight = $(window).height();
|
||||
|
||||
@@ -695,7 +695,7 @@ var GempLotrDeckBuildingUI = Class.extend({
|
||||
|
||||
addCardToContainer: function(blueprintId, zone, container, tokens) {
|
||||
var card = new Card(blueprintId, zone, "deck", "player");
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, card.isFoil(), tokens);
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, card.isFoil(), tokens, card.isPack());
|
||||
cardDiv.data("card", card);
|
||||
container.append(cardDiv);
|
||||
return cardDiv;
|
||||
@@ -939,14 +939,14 @@ var GempLotrDeckBuildingUI = Class.extend({
|
||||
if (blueprintId.substr(0, 3) == "(S)") {
|
||||
var card = new Card(blueprintId, "pack", "collection" + i, "player");
|
||||
card.tokens = {"count":count};
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, false, true);
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, false, true, true);
|
||||
cardDiv.data("card", card);
|
||||
cardDiv.data("selection", packElem.getAttribute("contents"));
|
||||
cardDiv.addClass("selectionInCollection");
|
||||
} else {
|
||||
var card = new Card(blueprintId, "pack", "collection" + i, "player");
|
||||
card.tokens = {"count":count};
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, false, true);
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, false, true, true);
|
||||
cardDiv.data("card", card);
|
||||
cardDiv.addClass("packInCollection");
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ function deliveryService(xml) {
|
||||
var count = packElem.getAttribute("count");
|
||||
var card = new Card(blueprintId, "delivery", "deliveryPack" + i, "player");
|
||||
card.tokens = {"count":count};
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, card.isFoil(), true);
|
||||
var cardDiv = createCardDiv(card.imageUrl, null, card.isFoil(), true, true);
|
||||
cardDiv.data("card", card);
|
||||
deliveryDialogs[collectionName].append(cardDiv);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ function deliveryService(xml) {
|
||||
deliveryDialogs[collectionName].append(cardDiv);
|
||||
}
|
||||
|
||||
deliveryDialogs[collectionName].dialog("open");
|
||||
openSizeDialog(deliveryDialogs[collectionName]);
|
||||
deliveryDialogResize();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +359,10 @@ function layoutCardElem(cardElem, x, y, width, height, index) {
|
||||
var borderWidth = Math.floor(maxDimension / 30);
|
||||
|
||||
var borderOverlay = $(".borderOverlay", cardElem);
|
||||
if (borderOverlay.hasClass("noBorder"))
|
||||
borderWidth = 0;
|
||||
borderOverlay.css({position: "absolute", left: 0 + "px", top: 0 + "px", width: width - 2 * borderWidth, height: height - 2 * borderWidth, "border-width": borderWidth + "px"});
|
||||
|
||||
var sizeListeners = cardElem.data("sizeListeners");
|
||||
if (sizeListeners != null)
|
||||
for (var i = 0; i < sizeListeners.length; i++)
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
var cardCache = {};
|
||||
var cardScale = 357 / 497;
|
||||
var packBlueprints = {
|
||||
"FotR - League Starter": "/gemp-lotr/images/boosters/fotr_league_starter.png",
|
||||
|
||||
"FotR - Gandalf Starter": "/gemp-lotr/images/boosters/fotr_gandalf_starter.png",
|
||||
"FotR - Aragorn Starter": "/gemp-lotr/images/boosters/fotr_aragorn_starter.png",
|
||||
"FotR - Booster": "/gemp-lotr/images/boosters/fotr_booster.png",
|
||||
|
||||
"MoM - Gandalf Starter": "/gemp-lotr/images/boosters/mom_gandalf_starter.png",
|
||||
"MoM - Gimli Starter": "/gemp-lotr/images/boosters/mom_gimli_starter.png",
|
||||
"MoM - Booster": "/gemp-lotr/images/boosters/mom_booster.png",
|
||||
|
||||
"RotEL - Boromir Starter": "/gemp-lotr/images/boosters/rotel_boromir_starter.png",
|
||||
"RotEL - Legolas Starter": "/gemp-lotr/images/boosters/rotel_legolas_starter.png",
|
||||
"RotEL - Booster": "/gemp-lotr/images/boosters/rotel_booster.png",
|
||||
|
||||
"TTT - Aragorn Starter": "/gemp-lotr/images/boosters/ttt_aragorn_starter.png",
|
||||
"TTT - Theoden Starter": "/gemp-lotr/images/boosters/ttt_theoden_starter.png",
|
||||
"TTT - Booster": "/gemp-lotr/images/boosters/ttt_booster.png",
|
||||
|
||||
"BoHD - Eowyn Starter": "/gemp-lotr/images/boosters/bohd_eowyn_starter.png",
|
||||
"BoHD - Legolas Starter": "/gemp-lotr/images/boosters/bohd_legolas_starter.png",
|
||||
"BoHD - Booster": "/gemp-lotr/images/boosters/bohd_booster.png",
|
||||
|
||||
"EoF - Faramir Starter": "/gemp-lotr/images/boosters/eof_faramir_starter.png",
|
||||
"EoF - Witch-king Starter": "/gemp-lotr/images/boosters/eof_witch_king_starter.png",
|
||||
"EoF - Booster": "/gemp-lotr/images/boosters/eof_booster.png",
|
||||
};
|
||||
|
||||
var Card = Class.extend({
|
||||
blueprintId: null,
|
||||
@@ -57,6 +84,10 @@ var Card = Class.extend({
|
||||
return this.foil;
|
||||
},
|
||||
|
||||
isPack: function() {
|
||||
return packBlueprints[this.blueprintId] != null;
|
||||
},
|
||||
|
||||
isHorizontal: function(blueprintId) {
|
||||
var separator = blueprintId.indexOf("_");
|
||||
var setNo = parseInt(blueprintId.substr(0, separator));
|
||||
@@ -92,32 +123,8 @@ var Card = Class.extend({
|
||||
getUrlByBlueprintId: function(blueprintId) {
|
||||
if (blueprintId.substr(0, 3) == "(S)")
|
||||
return "/gemp-lotr/images/boosters/selection.png";
|
||||
if (blueprintId == "FotR - League Starter")
|
||||
return "/gemp-lotr/images/boosters/fotr_league_starter.png";
|
||||
if (blueprintId == "FotR - Gandalf Starter")
|
||||
return "/gemp-lotr/images/boosters/fotr_gandalf_starter.png";
|
||||
if (blueprintId == "FotR - Aragorn Starter")
|
||||
return "/gemp-lotr/images/boosters/fotr_aragorn_starter.png";
|
||||
if (blueprintId == "FotR - Booster")
|
||||
return "/gemp-lotr/images/boosters/fotr_booster.png";
|
||||
if (blueprintId == "MoM - Gandalf Starter")
|
||||
return "/gemp-lotr/images/boosters/mom_gandalf_starter.png";
|
||||
if (blueprintId == "MoM - Gimli Starter")
|
||||
return "/gemp-lotr/images/boosters/mom_gimli_starter.png";
|
||||
if (blueprintId == "MoM - Booster")
|
||||
return "/gemp-lotr/images/boosters/mom_booster.png";
|
||||
if (blueprintId == "RotEL - Boromir Starter")
|
||||
return "/gemp-lotr/images/boosters/rotel_boromir_starter.png";
|
||||
if (blueprintId == "RotEL - Legolas Starter")
|
||||
return "/gemp-lotr/images/boosters/rotel_legolas_starter.png";
|
||||
if (blueprintId == "RotEL - Booster")
|
||||
return "/gemp-lotr/images/boosters/rotel_booster.png";
|
||||
if (blueprintId == "TTT - Booster")
|
||||
return "/gemp-lotr/images/boosters/ttt_booster.png";
|
||||
if (blueprintId == "BoHD - Booster")
|
||||
return "/gemp-lotr/images/boosters/bohd_booster.png";
|
||||
if (blueprintId == "EoF - Booster")
|
||||
return "/gemp-lotr/images/boosters/eof_booster.png";
|
||||
if (packBlueprints[blueprintId] != null)
|
||||
return packBlueprints[blueprintId];
|
||||
|
||||
var separator = blueprintId.indexOf("_");
|
||||
var setNo = parseInt(blueprintId.substr(0, separator));
|
||||
@@ -177,7 +184,7 @@ var Card = Class.extend({
|
||||
}
|
||||
});
|
||||
|
||||
function createCardDiv(image, text, foil, tokens) {
|
||||
function createCardDiv(image, text, foil, tokens, noBorder) {
|
||||
var cardDiv = $("<div class='card'><img src='" + image + "' width='100%' height='100%'>" + ((text != null) ? text : "") + "</div>");
|
||||
if (foil) {
|
||||
var foilDiv = $("<div class='foilOverlay'><img src='/gemp-lotr/images/foil.gif' width='100%' height='100%'></div>");
|
||||
@@ -189,18 +196,25 @@ function createCardDiv(image, text, foil, tokens) {
|
||||
cardDiv.append(overlayDiv);
|
||||
}
|
||||
var borderDiv = $("<div class='borderOverlay'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
if (noBorder)
|
||||
borderDiv.addClass("noBorder");
|
||||
cardDiv.append(borderDiv);
|
||||
|
||||
return cardDiv;
|
||||
}
|
||||
|
||||
function createFullCardDiv(image, foil, horizontal) {
|
||||
function createFullCardDiv(image, foil, horizontal, noBorder) {
|
||||
if (horizontal) {
|
||||
var cardDiv = $("<div style='position: relative;width:497px;height:357px;'></div>");
|
||||
cardDiv.append("<div style='position:absolute'><img src='" + image + "' width='497' height='357'></div>");
|
||||
|
||||
var borderDiv = $("<div class='borderOverlay' style='position:absolute;width:465px;height:325px;border-width:16px'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
cardDiv.append(borderDiv);
|
||||
if (noBorder) {
|
||||
var borderDiv = $("<div class='borderOverlay,noBorder' style='position:absolute;width:497px;height:357px;border-width:0px'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
cardDiv.append(borderDiv);
|
||||
} else {
|
||||
var borderDiv = $("<div class='borderOverlay' style='position:absolute;width:465px;height:325px;border-width:16px'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
cardDiv.append(borderDiv);
|
||||
}
|
||||
|
||||
if (foil) {
|
||||
var foilDiv = $("<div class='foilOverlay' style='position:absolute;width:497px;height:357px'><img src='/gemp-lotr/images/foil.gif' width='100%' height='100%'></div>");
|
||||
@@ -210,8 +224,13 @@ function createFullCardDiv(image, foil, horizontal) {
|
||||
var cardDiv = $("<div style='position: relative;width:357px;height:497px;'></div>");
|
||||
cardDiv.append("<div style='position:absolute'><img src='" + image + "' width='357' height='497'></div>");
|
||||
|
||||
var borderDiv = $("<div class='borderOverlay' style='position:absolute;width:325px;height:465px;border-width:16px'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
cardDiv.append(borderDiv);
|
||||
if (noBorder) {
|
||||
var borderDiv = $("<div class='borderOverlay,noBorder' style='position:absolute;width:357px;height:497px;border-width:0px'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
cardDiv.append(borderDiv);
|
||||
} else {
|
||||
var borderDiv = $("<div class='borderOverlay' style='position:absolute;width:325px;height:465px;border-width:16px'><img class='actionArea' src='/gemp-lotr/images/pixel.png' width='100%' height='100%'></div>");
|
||||
cardDiv.append(borderDiv);
|
||||
}
|
||||
|
||||
if (foil) {
|
||||
var foilDiv = $("<div class='foilOverlay' style='position:absolute;width:357px;height:497px'><img src='/gemp-lotr/images/foil.gif' width='100%' height='100%'></div>");
|
||||
|
||||