mirror of
https://github.com/exane/not-gwent-online
synced 2024-11-23 19:36:53 +00:00
minor fixes
This commit is contained in:
parent
9b71d0d06b
commit
d469585b89
@ -348,7 +348,7 @@ let BattleView = Backbone.View.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(key === "decoy"){
|
if(key === "decoy"){
|
||||||
console.log("its decoy!!!");
|
//console.log("its decoy!!!");
|
||||||
this.user.set("waitForDecoy", id);
|
this.user.set("waitForDecoy", id);
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ let BattleView = Backbone.View.extend({
|
|||||||
if(this.user.get("setAgile")){
|
if(this.user.get("setAgile")){
|
||||||
let $field = $(e.target).closest(".field.active").find(".field-close, .field-range");
|
let $field = $(e.target).closest(".field.active").find(".field-close, .field-range");
|
||||||
|
|
||||||
console.log($field);
|
//console.log($field);
|
||||||
let target = $field.hasClass("field-close") ? 0 : 1;
|
let target = $field.hasClass("field-close") ? 0 : 1;
|
||||||
this.app.send("agile:field", {
|
this.app.send("agile:field", {
|
||||||
field: target
|
field: target
|
||||||
@ -379,7 +379,7 @@ let BattleView = Backbone.View.extend({
|
|||||||
if(this.user.get("setHorn")){
|
if(this.user.get("setHorn")){
|
||||||
let $field = $(e.target).closest(".field.active").find(".field-close, .field-range, .field-siege");
|
let $field = $(e.target).closest(".field.active").find(".field-close, .field-range, .field-siege");
|
||||||
|
|
||||||
console.log($field);
|
//console.log($field);
|
||||||
let target = $field.hasClass("field-close") ? 0 : ($field.hasClass("field-range") ? 1 : 2);
|
let target = $field.hasClass("field-close") ? 0 : ($field.hasClass("field-range") ? 1 : 2);
|
||||||
this.app.send("horn:field", {
|
this.app.send("horn:field", {
|
||||||
field: target
|
field: target
|
||||||
@ -399,7 +399,7 @@ let BattleView = Backbone.View.extend({
|
|||||||
},
|
},
|
||||||
openDiscard: function(e){
|
openDiscard: function(e){
|
||||||
let $discard = $(e.target).closest(".field-discard");
|
let $discard = $(e.target).closest(".field-discard");
|
||||||
console.log("opened discard");
|
//console.log("opened discard");
|
||||||
let side;
|
let side;
|
||||||
if($discard.parent().hasClass("player")){
|
if($discard.parent().hasClass("player")){
|
||||||
side = this.yourSide;
|
side = this.yourSide;
|
||||||
@ -477,7 +477,7 @@ let BattleView = Backbone.View.extend({
|
|||||||
if(!$card.parent().hasClass("player")) return;
|
if(!$card.parent().hasClass("player")) return;
|
||||||
if($card.find(".card").hasClass("disabled")) return;
|
if($card.find(".card").hasClass("disabled")) return;
|
||||||
|
|
||||||
console.log("click leader");
|
//console.log("click leader");
|
||||||
|
|
||||||
|
|
||||||
this.app.send("activate:leader")
|
this.app.send("activate:leader")
|
||||||
@ -582,7 +582,7 @@ let MedicModal = Modal.extend({
|
|||||||
"click .card": "onCardClick"
|
"click .card": "onCardClick"
|
||||||
},
|
},
|
||||||
onCardClick: function(e){
|
onCardClick: function(e){
|
||||||
console.log($(e.target).closest(".card"));
|
//console.log($(e.target).closest(".card"));
|
||||||
let id = $(e.target).closest(".card").data().id;
|
let id = $(e.target).closest(".card").data().id;
|
||||||
this.model.get("app").send("medic:chooseCardFromDiscard", {
|
this.model.get("app").send("medic:chooseCardFromDiscard", {
|
||||||
cardID: id
|
cardID: id
|
||||||
@ -604,7 +604,7 @@ let ReDrawModal = Modal.extend({
|
|||||||
"click .card": "onCardClick"
|
"click .card": "onCardClick"
|
||||||
},
|
},
|
||||||
onCardClick: function(e){
|
onCardClick: function(e){
|
||||||
console.log($(e.target).closest(".card"));
|
//console.log($(e.target).closest(".card"));
|
||||||
let id = $(e.target).closest(".card").data().id;
|
let id = $(e.target).closest(".card").data().id;
|
||||||
this.model.get("app").send("redraw:reDrawCard", {
|
this.model.get("app").send("redraw:reDrawCard", {
|
||||||
cardID: id
|
cardID: id
|
||||||
@ -638,7 +638,7 @@ let User = Backbone.Model.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.receive("init:battle", function(data){
|
app.receive("init:battle", function(data){
|
||||||
console.log("opponent found!");
|
//console.log("opponent found!");
|
||||||
self.set("roomSide", data.side);
|
self.set("roomSide", data.side);
|
||||||
/*
|
/*
|
||||||
self.set("channel:battle", app.socket.subscribe(self.get("room")));*/
|
self.set("channel:battle", app.socket.subscribe(self.get("room")));*/
|
||||||
@ -653,7 +653,7 @@ let User = Backbone.Model.extend({
|
|||||||
|
|
||||||
app.receive("response:joinRoom", function(roomID){
|
app.receive("response:joinRoom", function(roomID){
|
||||||
self.set("room", roomID);
|
self.set("room", roomID);
|
||||||
console.log("room id", self.get("room"));
|
//console.log("room id", self.get("room"));
|
||||||
})
|
})
|
||||||
|
|
||||||
app.receive("set:waiting", function(data){
|
app.receive("set:waiting", function(data){
|
||||||
@ -667,25 +667,25 @@ let User = Backbone.Model.extend({
|
|||||||
})
|
})
|
||||||
|
|
||||||
app.receive("foe:left", function(){
|
app.receive("foe:left", function(){
|
||||||
console.log("your foe left the room");
|
//console.log("your foe left the room");
|
||||||
$(".container").prepend('<div class="alert alert-danger">Your foe left the battle!</div>')
|
$(".container").prepend('<div class="alert alert-danger">Your foe left the battle!</div>')
|
||||||
})
|
})
|
||||||
|
|
||||||
app.receive("played:medic", function(data){
|
app.receive("played:medic", function(data){
|
||||||
let cards = JSON.parse(data.cards);
|
let cards = JSON.parse(data.cards);
|
||||||
console.log("played medic");
|
//console.log("played medic");
|
||||||
self.set("medicDiscard", {
|
self.set("medicDiscard", {
|
||||||
cards: cards
|
cards: cards
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
app.receive("played:agile", function(data){
|
app.receive("played:agile", function(data){
|
||||||
console.log("played agile");
|
//console.log("played agile");
|
||||||
self.set("setAgile", data.cardID);
|
self.set("setAgile", data.cardID);
|
||||||
})
|
})
|
||||||
|
|
||||||
app.receive("played:horn", function(data){
|
app.receive("played:horn", function(data){
|
||||||
console.log("played horn");
|
//console.log("played horn");
|
||||||
self.set("setHorn", data.cardID);
|
self.set("setHorn", data.cardID);
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -710,7 +710,7 @@ let User = Backbone.Model.extend({
|
|||||||
app.receive("gameover", function(data){
|
app.receive("gameover", function(data){
|
||||||
let winner = data.winner;
|
let winner = data.winner;
|
||||||
|
|
||||||
console.log("gameover");
|
//console.log("gameover");
|
||||||
|
|
||||||
let model = Backbone.Model.extend({});
|
let model = Backbone.Model.extend({});
|
||||||
let modal = new WinnerModal({model: new model({winner: winner})});
|
let modal = new WinnerModal({model: new model({winner: winner})});
|
||||||
@ -742,7 +742,7 @@ let User = Backbone.Model.extend({
|
|||||||
this.get("app").send("request:name", {name: name});
|
this.get("app").send("request:name", {name: name});
|
||||||
},
|
},
|
||||||
setDeck: function(deckKey){
|
setDeck: function(deckKey){
|
||||||
console.log("deck: ", deckKey);
|
//console.log("deck: ", deckKey);
|
||||||
this.set("deckKey", deckKey);
|
this.set("deckKey", deckKey);
|
||||||
this.get("app").send("set:deck", {deck: deckKey});
|
this.get("app").send("set:deck", {deck: deckKey});
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,8 @@ $game-height: 800px;
|
|||||||
.field {
|
.field {
|
||||||
//width: 100%;
|
//width: 100%;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border: 1px solid black;/*
|
border: 1px solid black;
|
||||||
|
/*
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@ -45,7 +46,8 @@ $game-height: 800px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-horn {/*
|
.field-horn {
|
||||||
|
/*
|
||||||
border: 1px solid green;*/
|
border: 1px solid green;*/
|
||||||
/*clear: both;*/
|
/*clear: both;*/
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
@ -72,12 +74,14 @@ $game-height: 800px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.passing {/*
|
.passing {
|
||||||
|
/*
|
||||||
display: none;*/
|
display: none;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-single {
|
.field-single {
|
||||||
border: 1px solid black;/*
|
border: 1px solid black;
|
||||||
|
/*
|
||||||
width: 85px;*/
|
width: 85px;*/
|
||||||
/*margin: 5px;*/
|
/*margin: 5px;*/
|
||||||
height: 98px;
|
height: 98px;
|
||||||
@ -195,6 +199,7 @@ $game-height: 800px;
|
|||||||
background: url("../../assets/ruby.png");
|
background: url("../../assets/ruby.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.field {
|
.field {
|
||||||
&.field-frost {
|
&.field-frost {
|
||||||
@ -247,4 +252,3 @@ $game-height: 800px;
|
|||||||
top: 30%;
|
top: 30%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
<h3 class="bbm-modal__title">Discard of {{openDiscard.name}}</h3>
|
<h3 class="bbm-modal__title">Discard of {{openDiscard.name}}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="bbm-modal__section">
|
<div class="bbm-modal__section">
|
||||||
{{#each openDiscard.discard}}
|
{{#each openDiscard.discard as |val key|}}
|
||||||
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
|
{{>card val}}
|
||||||
<img src="../assets/cards/{{_data.img}}.png">
|
|
||||||
</div>
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
<div class="bbm-modal__bottombar">
|
<div class="bbm-modal__bottombar">
|
||||||
|
Loading…
Reference in New Issue
Block a user