More predictable default behavior

This commit is contained in:
Dustin Moore
2012-11-20 12:02:29 -08:00
parent 95ce88cfb3
commit 773828731c
5 changed files with 11 additions and 5 deletions

View File

@@ -1601,6 +1601,7 @@
*/
fn.set_player = function(col, row, no_player) {
var self = this;
var swap = false;
if (!no_player) {
this.empty_cells_player_occupies();
}
@@ -1637,13 +1638,14 @@
if(!$gr.is_widget(placeholder_cells.cols[0],placeholder_cells.rows[0])){
$gr.new_move_widget_to($w, placeholder_cells.cols[0], placeholder_cells.rows[0]);
$gr.set_placeholder(to_col, to_row);
swap = true;
}
}
}));
//If set to false smaller widgets will not displace larger widgets.
if(this.options.shift_larger_widgets_down){
if(this.options.shift_larger_widgets_down && !swap){
var constraints = this.widgets_constraints($overlapped_widgets);
this.manage_movements(constraints.can_go_up, to_col, to_row);