From c0d83078a2083f22c94cea98e9b45b35560fccdc Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 15 Mar 2012 11:39:18 +0000 Subject: [PATCH] - Selection action to use and selecting card (for example for assignments or another effect) have different card frame color now. --- .../gemp-lotr-web/src/main/webapp/game.html | 5 ++++ .../src/main/webapp/includes/changeLog.html | 2 ++ .../src/main/webapp/js/gameUi.js | 29 +++++++++++-------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html index 0c19d956f..10383f589 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html @@ -128,6 +128,11 @@ body { cursor: pointer; } +.actionableCard > .borderOverlay { + border-color: #0000af; + cursor: pointer; +} + .selectedCard > .borderOverlay { border-color: #009f9f; } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index e3470e20d..71e68f244 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -3,6 +3,8 @@ - "Mount Doom" should finally work. - In card info box in game you will see site owner. - You are able to browse your Adventure Deck now during game. +- Selection action to use and selecting card (for example for assignments or another effect) have different card frame +color now. 14 Mar. 2012 - "White Hand Destroyer" no longer has "Hunter 0" when you control no sites. diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js index 5740ef780..7692f88ec 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js @@ -495,7 +495,7 @@ var GempLotrGameUI = Class.extend({ if (!this.successfulDrag) { if (event.shiftKey) { this.displayCardInfo(selectedCardElem.data("card")); - } else if (selectedCardElem.hasClass("selectableCard") && !this.replayMode) + } else if ((selectedCardElem.hasClass("selectableCard") || selectedCardElem.hasClass("actionableCard")) && !this.replayMode) this.selectionFunction(selectedCardElem.data("card").cardId, event); event.stopPropagation(); } @@ -1375,9 +1375,13 @@ var GempLotrGameUI = Class.extend({ return cardDiv; }, - attachSelectionFunctions: function(cardIds) { - if (cardIds.length > 0) - $(".card:cardId(" + cardIds + ")").addClass("selectableCard"); + attachSelectionFunctions: function(cardIds, selection) { + if (selection) + if (cardIds.length > 0) + $(".card:cardId(" + cardIds + ")").addClass("selectableCard"); + else + if (cardIds.length > 0) + $(".card:cardId(" + cardIds + ")").addClass("actionableCard"); }, // Choosing cards from a predefined selection (for example stating fellowship) @@ -1464,7 +1468,7 @@ var GempLotrGameUI = Class.extend({ processButtons(); }; - that.attachSelectionFunctions(selectableCardIds); + that.attachSelectionFunctions(selectableCardIds, true); }; allowSelection(); @@ -1602,7 +1606,7 @@ var GempLotrGameUI = Class.extend({ } }; - that.attachSelectionFunctions(cardIds); + that.attachSelectionFunctions(cardIds, false); }; allowSelection(); @@ -1733,7 +1737,7 @@ var GempLotrGameUI = Class.extend({ } }; - that.attachSelectionFunctions(cardIds); + that.attachSelectionFunctions(cardIds, true); }; allowSelection(); @@ -1745,7 +1749,7 @@ var GempLotrGameUI = Class.extend({ $('.ui-dialog :button').blur(); }, - // Choosing some number of cards, for example to character + // Choosing some number of cards, for example to wound cardSelectionDecision: function(decision) { var id = decision.getAttribute("id"); var text = decision.getAttribute("text"); @@ -1809,7 +1813,7 @@ var GempLotrGameUI = Class.extend({ processButtons(); }; - that.attachSelectionFunctions(cardIds); + that.attachSelectionFunctions(cardIds, true); }; allowSelection(); @@ -1914,15 +1918,16 @@ var GempLotrGameUI = Class.extend({ that.doAssignments(freeCharacters, minions); }; - that.attachSelectionFunctions(freeCharacters); - that.attachSelectionFunctions([cardId]); + that.attachSelectionFunctions(freeCharacters, true); + that.attachSelectionFunctions([cardId], true); }; - this.attachSelectionFunctions(minions); + this.attachSelectionFunctions(minions, true); }, clearSelection: function() { $(".selectableCard").removeClass("selectableCard").data("action", null); + $(".actionableCard").removeClass("actionableCard").data("action", null); $(".selectedCard").removeClass("selectedCard"); this.selectionFunction = null; },