added function 'reset_bug' that resets the close-tab-bug
This commit is contained in:
parent
982cdc4140
commit
d315d38c39
1 changed files with 18 additions and 2 deletions
|
@ -104,7 +104,6 @@
|
|||
cur_sel.sel_bon();
|
||||
}
|
||||
else {
|
||||
console.log("Hide UIBON");
|
||||
$('#uibon').hide();
|
||||
}
|
||||
cur_sel.printoutput();
|
||||
|
@ -124,6 +123,9 @@
|
|||
cur_sel.printoutput();
|
||||
}
|
||||
});
|
||||
this.bind('KeyUp', function(e) {
|
||||
cur_sel.printoutput();
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
@ -151,10 +153,24 @@
|
|||
|
||||
/* At the end, disable mouse-control for all creatures
|
||||
*/
|
||||
var focused = false;
|
||||
var last_sel;
|
||||
var end_init = function() {
|
||||
Crafty("Creature").each( function() {
|
||||
this.disableControl();
|
||||
});
|
||||
$(window).focus( function() {
|
||||
last_sel = cur_sel;
|
||||
});
|
||||
};
|
||||
|
||||
var reset_bug = function() {
|
||||
Crafty("Thing").each( function() {
|
||||
this._movement.x=0;
|
||||
this._movement.y=0;
|
||||
});
|
||||
var g= last_sel.graphelement;
|
||||
g.attr("x",g.old_pos.x);
|
||||
g.attr("y", g.old_pos.y);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue