1
0
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:
exane 2015-06-27 15:08:35 +02:00
parent 9b71d0d06b
commit d469585b89
3 changed files with 82 additions and 80 deletions

View File

@ -348,7 +348,7 @@ let BattleView = Backbone.View.extend({
});
if(key === "decoy"){
console.log("its decoy!!!");
//console.log("its decoy!!!");
this.user.set("waitForDecoy", id);
this.render();
}
@ -369,7 +369,7 @@ let BattleView = Backbone.View.extend({
if(this.user.get("setAgile")){
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;
this.app.send("agile:field", {
field: target
@ -379,7 +379,7 @@ let BattleView = Backbone.View.extend({
if(this.user.get("setHorn")){
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);
this.app.send("horn:field", {
field: target
@ -399,7 +399,7 @@ let BattleView = Backbone.View.extend({
},
openDiscard: function(e){
let $discard = $(e.target).closest(".field-discard");
console.log("opened discard");
//console.log("opened discard");
let side;
if($discard.parent().hasClass("player")){
side = this.yourSide;
@ -477,7 +477,7 @@ let BattleView = Backbone.View.extend({
if(!$card.parent().hasClass("player")) return;
if($card.find(".card").hasClass("disabled")) return;
console.log("click leader");
//console.log("click leader");
this.app.send("activate:leader")
@ -582,7 +582,7 @@ let MedicModal = Modal.extend({
"click .card": "onCardClick"
},
onCardClick: function(e){
console.log($(e.target).closest(".card"));
//console.log($(e.target).closest(".card"));
let id = $(e.target).closest(".card").data().id;
this.model.get("app").send("medic:chooseCardFromDiscard", {
cardID: id
@ -604,7 +604,7 @@ let ReDrawModal = Modal.extend({
"click .card": "onCardClick"
},
onCardClick: function(e){
console.log($(e.target).closest(".card"));
//console.log($(e.target).closest(".card"));
let id = $(e.target).closest(".card").data().id;
this.model.get("app").send("redraw:reDrawCard", {
cardID: id
@ -638,7 +638,7 @@ let User = Backbone.Model.extend({
});
app.receive("init:battle", function(data){
console.log("opponent found!");
//console.log("opponent found!");
self.set("roomSide", data.side);
/*
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){
self.set("room", roomID);
console.log("room id", self.get("room"));
//console.log("room id", self.get("room"));
})
app.receive("set:waiting", function(data){
@ -667,25 +667,25 @@ let User = Backbone.Model.extend({
})
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>')
})
app.receive("played:medic", function(data){
let cards = JSON.parse(data.cards);
console.log("played medic");
//console.log("played medic");
self.set("medicDiscard", {
cards: cards
});
})
app.receive("played:agile", function(data){
console.log("played agile");
//console.log("played agile");
self.set("setAgile", data.cardID);
})
app.receive("played:horn", function(data){
console.log("played horn");
//console.log("played horn");
self.set("setHorn", data.cardID);
})
@ -710,7 +710,7 @@ let User = Backbone.Model.extend({
app.receive("gameover", function(data){
let winner = data.winner;
console.log("gameover");
//console.log("gameover");
let model = Backbone.Model.extend({});
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});
},
setDeck: function(deckKey){
console.log("deck: ", deckKey);
//console.log("deck: ", deckKey);
this.set("deckKey", deckKey);
this.get("app").send("set:deck", {deck: deckKey});
}

View File

@ -29,7 +29,8 @@ $game-height: 800px;
.field {
//width: 100%;
height: 100px;
border: 1px solid black;/*
border: 1px solid black;
/*
overflow: hidden;
&:hover {
@ -45,7 +46,8 @@ $game-height: 800px;
}
}
.field-horn {/*
.field-horn {
/*
border: 1px solid green;*/
/*clear: both;*/
margin: 0px;
@ -72,12 +74,14 @@ $game-height: 800px;
}
}
.passing {/*
.passing {
/*
display: none;*/
}
.field-single {
border: 1px solid black;/*
border: 1px solid black;
/*
width: 85px;*/
/*margin: 5px;*/
height: 98px;
@ -195,6 +199,7 @@ $game-height: 800px;
background: url("../../assets/ruby.png");
}
}
}
.field {
&.field-frost {
@ -247,4 +252,3 @@ $game-height: 800px;
top: 30%;
}
}
}

View File

@ -2,10 +2,8 @@
<h3 class="bbm-modal__title">Discard of {{openDiscard.name}}</h3>
</div>
<div class="bbm-modal__section">
{{#each openDiscard.discard}}
<div class="card" data-key="{{_key}}" data-id="{{_id}}">
<img src="../assets/cards/{{_data.img}}.png">
</div>
{{#each openDiscard.discard as |val key|}}
{{>card val}}
{{/each}}
</div>
<div class="bbm-modal__bottombar">