mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
don't use place in gridlogic -> the current values should be in the root of the object
This commit is contained in:
@@ -131,6 +131,7 @@ export default {
|
||||
y: item.y,
|
||||
w: item.w,
|
||||
h: item.h,
|
||||
pinned: item.pinned,
|
||||
weight: item.weight || 0,
|
||||
data: item
|
||||
}
|
||||
@@ -150,7 +151,8 @@ export default {
|
||||
x: this.correctedPositionUpdates[item.index].x === undefined ? item.x : this.correctedPositionUpdates[item.index].x,
|
||||
y: this.correctedPositionUpdates[item.index].y === undefined ? item.y : this.correctedPositionUpdates[item.index].y,
|
||||
w: this.correctedPositionUpdates[item.index].w === undefined ? item.w : this.correctedPositionUpdates[item.index].w,
|
||||
h: this.correctedPositionUpdates[item.index].h === undefined ? item.h : this.correctedPositionUpdates[item.index].h
|
||||
h: this.correctedPositionUpdates[item.index].h === undefined ? item.h : this.correctedPositionUpdates[item.index].h,
|
||||
pinned: item.pinned
|
||||
};
|
||||
});
|
||||
},
|
||||
@@ -169,8 +171,8 @@ export default {
|
||||
x: this.tempPositionUpdates[item.index].x === undefined ? item.x : this.tempPositionUpdates[item.index].x,
|
||||
y: this.tempPositionUpdates[item.index].y === undefined ? item.y : this.tempPositionUpdates[item.index].y,
|
||||
w: this.tempPositionUpdates[item.index].w === undefined ? item.w : this.tempPositionUpdates[item.index].w,
|
||||
h: this.tempPositionUpdates[item.index].h === undefined ? item.h : this.tempPositionUpdates[item.index].h
|
||||
|
||||
h: this.tempPositionUpdates[item.index].h === undefined ? item.h : this.tempPositionUpdates[item.index].h,
|
||||
pinned: item.pinned
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
@@ -84,7 +84,7 @@ class GridLogic {
|
||||
}
|
||||
}
|
||||
move(item, x, y) {
|
||||
if (item.data.place[this.w]?.pinned)
|
||||
if (item.pinned)
|
||||
return [];
|
||||
if (item.x == x && item.y == y)
|
||||
return [];
|
||||
@@ -195,13 +195,13 @@ class GridLogic {
|
||||
let targetframe;
|
||||
switch(dir) {
|
||||
case DIR_UP:
|
||||
if (this.data[index].data?.place[this.w]?.pinned || this.data[index].y - amount < 0)
|
||||
if (this.data[index].pinned || this.data[index].y - amount < 0)
|
||||
return false;
|
||||
targetframe = this.data[index].frame.map(i => i-this.w*amount);
|
||||
move.y = -amount;
|
||||
break;
|
||||
case DIR_DOWN:
|
||||
if (this.data[index].data?.place[this.w]?.pinned)
|
||||
if (this.data[index].pinned)
|
||||
return false;
|
||||
if (this.data[index].y + this.data[index].h + amount > this.h)
|
||||
cost += .4;
|
||||
@@ -209,13 +209,13 @@ class GridLogic {
|
||||
move.y = amount;
|
||||
break;
|
||||
case DIR_LEFT:
|
||||
if (this.data[index].data?.place[this.w]?.pinned || this.data[index].x - amount < 0)
|
||||
if (this.data[index].pinned || this.data[index].x - amount < 0)
|
||||
return false;
|
||||
targetframe = this.data[index].frame.map(i => i-amount);
|
||||
move.x = -amount;
|
||||
break;
|
||||
case DIR_RIGHT:
|
||||
if (this.data[index].data?.place[this.w]?.pinned || this.data[index].x + this.data[index].w + amount > this.w)
|
||||
if (this.data[index].pinned || this.data[index].x + this.data[index].w + amount > this.w)
|
||||
return false;
|
||||
targetframe = this.data[index].frame.map(i => i+amount);
|
||||
move.x = amount;
|
||||
|
||||
Reference in New Issue
Block a user