diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/css/jquery.contextMenu.css b/gemp-lotr/gemp-lotr-web/src/main/webapp/css/jquery.contextMenu.css new file mode 100644 index 000000000..0156724cb --- /dev/null +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/css/jquery.contextMenu.css @@ -0,0 +1,48 @@ +/* Generic context menu styles */ +.contextMenu { + position: absolute; + width: 200px; + z-index: 99999; + border: solid 1px #CCC; + background: #EEE; + padding: 0px; + margin: 0px; + display: none; +} + +.contextMenu LI { + list-style: none; + padding: 0px; + margin: 0px; + overflow: hidden; +} + +.contextMenu A { + color: #333; + text-decoration: none; + display: block; + line-height: 20px; + height: 20px; + background-position: 6px center; + background-repeat: no-repeat; + outline: none; + padding: 1px 5px; +} + +.contextMenu LI.hover A { + color: #FFF; + background-color: #3399FF; +} + +.contextMenu LI.disabled A { + color: #AAA; + cursor: default; +} + +.contextMenu LI.hover.disabled A { + background-color: transparent; +} + +.contextMenu LI.separator { + border-top: solid 1px #CCC; +} \ No newline at end of file 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 d26008fcb..c3a78864f 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/game.html @@ -116,6 +116,7 @@ } + 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 691977308..db224ec6f 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,9 @@ - Changed the main page after logging in to give access to additional documents. - Changed the play event animation so that player might actually recognize the card. - The animations are no longer shown to the player who initiated the effect, he should know what he played. +- Fixed Athelas and some other possessions, that could not be used during Fellowship phase if a valid transfer target +could be spotted. The problem was, that in that case there are 2 (or more) possible actions to do with 1 card. Now +a small context menu will show up in that case and user will be able to choose, which action to perform. 21 Sept. 2011 - Increased the time per game per player to 40 minutes, as 30 seems not enough. 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 00456f8ef..c61b956cd 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 @@ -241,7 +241,7 @@ var GempLotrGameUI = Class.extend({ if (event.shiftKey) { this.displayCardInfo(selectedCardElem.data("card")); } else if (selectedCardElem.hasClass("selectableCard")) - this.selectionFunction(selectedCardElem.data("card").cardId); + this.selectionFunction(selectedCardElem.data("card").cardId, event); } } } @@ -1182,12 +1182,12 @@ var GempLotrGameUI = Class.extend({ actions.push({ actionId: actionId, actionText: actionText }); } - that.selectionFunction = function(cardId) { + that.selectionFunction = function(cardId, event) { var cardIdElem = $(".card:cardId(" + cardId + ")"); var actions = cardIdElem.data("action"); - if (actions.length == 1) { - var action = actions[0]; - selectedCardIds.push(action.actionId); + + var selectActionFunction = function(actionId) { + selectedCardIds.push(actionId); if (that.settingsAutoAccept) { finishChoice(); } else { @@ -1195,6 +1195,13 @@ var GempLotrGameUI = Class.extend({ $(".card:cardId(" + cardId + ")").addClass("selectedCard"); processButtons(); } + }; + + if (actions.length == 1) { + var action = actions[0]; + selectActionFunction(action.actionId); + } else { + that.createActionChoiceContextMenu(actions, event, selectActionFunction); } }; @@ -1205,6 +1212,53 @@ var GempLotrGameUI = Class.extend({ processButtons(); }, + createActionChoiceContextMenu: function(actions, event, selectActionFunction) { + // Remove context menus that may be showing + $(".contextMenu").remove(); + + var div = $("