Added right-click as an alternative to shift+click to zoom in-game and in the deckbuilder
This commit is contained in:
@@ -231,6 +231,15 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
function (event) {
|
function (event) {
|
||||||
return that.clickCardFunction(event);
|
return that.clickCardFunction(event);
|
||||||
});
|
});
|
||||||
|
$("body")[0].addEventListener("contextmenu",
|
||||||
|
function (event) {
|
||||||
|
if(!that.clickCardFunction(event))
|
||||||
|
{
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
$("body").mousedown(
|
$("body").mousedown(
|
||||||
function (event) {
|
function (event) {
|
||||||
return that.dragStartCardFunction(event);
|
return that.dragStartCardFunction(event);
|
||||||
@@ -646,10 +655,11 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
|
|
||||||
if (tar.hasClass("actionArea")) {
|
if (tar.hasClass("actionArea")) {
|
||||||
var selectedCardElem = tar.closest(".card");
|
var selectedCardElem = tar.closest(".card");
|
||||||
if (event.which == 1) {
|
if (event.which >= 1) {
|
||||||
if (!this.successfulDrag) {
|
if (!this.successfulDrag) {
|
||||||
if (event.shiftKey) {
|
if (event.shiftKey || event.which > 1) {
|
||||||
this.displayCardInfo(selectedCardElem.data("card"));
|
this.displayCardInfo(selectedCardElem.data("card"));
|
||||||
|
return false;
|
||||||
} else if (selectedCardElem.hasClass("cardInCollection")) {
|
} else if (selectedCardElem.hasClass("cardInCollection")) {
|
||||||
var cardData = selectedCardElem.data("card");
|
var cardData = selectedCardElem.data("card");
|
||||||
this.selectionFunc(cardData.blueprintId, cardData.zone);
|
this.selectionFunc(cardData.blueprintId, cardData.zone);
|
||||||
|
|||||||
@@ -92,6 +92,14 @@ var GempLotrGameUI = Class.extend({
|
|||||||
that.chatBox.appendMessage("Refresh the page (press F5) to resume the game, or press back on your browser to get back to the Game Hall.", "warningMessage");
|
that.chatBox.appendMessage("Refresh the page (press F5) to resume the game, or press back on your browser to get back to the Game Hall.", "warningMessage");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// window.onbeforeunload = function(event) {
|
||||||
|
// var e = e || window.event;
|
||||||
|
// if (e) {
|
||||||
|
// e.returnValue = "If you are done with this game, please go to the 'Options' tab and click the 'Concede Game' button first.";
|
||||||
|
// }
|
||||||
|
// return message;
|
||||||
|
// };
|
||||||
|
|
||||||
$.expr[':'].cardId = function (obj, index, meta, stack) {
|
$.expr[':'].cardId = function (obj, index, meta, stack) {
|
||||||
var cardIds = meta[3].split(",");
|
var cardIds = meta[3].split(",");
|
||||||
@@ -397,6 +405,17 @@ var GempLotrGameUI = Class.extend({
|
|||||||
function (event) {
|
function (event) {
|
||||||
return that.clickCardFunction(event);
|
return that.clickCardFunction(event);
|
||||||
});
|
});
|
||||||
|
var test = $("body");
|
||||||
|
$("body")[0].addEventListener("contextmenu",
|
||||||
|
function (event) {
|
||||||
|
//event.preventDefault();
|
||||||
|
if(!that.clickCardFunction(event))
|
||||||
|
{
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
$("body").mousedown(
|
$("body").mousedown(
|
||||||
function (event) {
|
function (event) {
|
||||||
$("body").bind("mousemove", dragFunc);
|
$("body").bind("mousemove", dragFunc);
|
||||||
|
|||||||
Reference in New Issue
Block a user