fix bug
This commit is contained in:
parent
9cdf02823b
commit
b99c3979cf
@ -122,9 +122,10 @@ export default class GemTab extends GuiObject {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
vGem.container.onpointerup = () => {
|
vGem.container.onpointerup = () => {
|
||||||
|
if (this.isSelectingGem) return;
|
||||||
let overlapping = null;
|
let overlapping = null;
|
||||||
Engine.GameScene.towerPanel.vGems.forEach((internVG) => {
|
Engine.GameScene.towerPanel.vGems.forEach((internVG) => {
|
||||||
if (overlapping) return;
|
if (overlapping || !this.dragAndDroppingGem) return;
|
||||||
let ddbb = this.dragAndDroppingGem.copyContainerToBB();
|
let ddbb = this.dragAndDroppingGem.copyContainerToBB();
|
||||||
let vb = internVG.copyContainerToBB();
|
let vb = internVG.copyContainerToBB();
|
||||||
let x = Engine.GameScene.towerPanel.container.x + vb.x;
|
let x = Engine.GameScene.towerPanel.container.x + vb.x;
|
||||||
@ -139,10 +140,8 @@ export default class GemTab extends GuiObject {
|
|||||||
if (overlapping) {
|
if (overlapping) {
|
||||||
let takenGem = Engine.GameScene.MissionStats.takeGem(gem);
|
let takenGem = Engine.GameScene.MissionStats.takeGem(gem);
|
||||||
Engine.GameScene.towerPanel.showingTower.SlotGem(takenGem, overlapping.i);
|
Engine.GameScene.towerPanel.showingTower.SlotGem(takenGem, overlapping.i);
|
||||||
} else {
|
|
||||||
console.warn('vGem couldnt find overlapping.');
|
|
||||||
}
|
}
|
||||||
// end
|
// clean up
|
||||||
this.isDragAndDroppingGem = false;
|
this.isDragAndDroppingGem = false;
|
||||||
this.dragAndDroppingGem = null;
|
this.dragAndDroppingGem = null;
|
||||||
this.RebuildInventoryVisual();
|
this.RebuildInventoryVisual();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user