fix(cbs/cursor): only accept input when cursor stand still
This commit is contained in:
parent
b38d478d5a
commit
7927146864
1 changed files with 4 additions and 6 deletions
|
@ -26,11 +26,12 @@ function Cursor:set(x, y, signal, subSignal)
|
|||
self.y = math.max(math.min(y, 07), 1)
|
||||
self.initialx = self.x
|
||||
self.initialy = self.y
|
||||
self.tx = self.x
|
||||
self.ty = self.y
|
||||
|
||||
self:placeInGrid()
|
||||
|
||||
self.tx = self.x
|
||||
self.ty = self.y
|
||||
|
||||
self.isActive = true
|
||||
self.signal = signal or ""
|
||||
self.subSignal = subSignal or ""
|
||||
|
@ -73,9 +74,6 @@ function Cursor:placeInGrid()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.tx = self.x
|
||||
self.ty = self.y
|
||||
end
|
||||
|
||||
function Cursor:setGrid(ox, oy, shape, size, direction, whitelistedEntity)
|
||||
|
@ -179,7 +177,7 @@ function Cursor:update(dt)
|
|||
end
|
||||
end
|
||||
|
||||
if (keys["A"].isPressed) then
|
||||
if (keys["A"].isPressed and self.x == self.tx and self.y == self.ty) then
|
||||
self.world:sendSignalToCurrentBattler(self.signal, self.subSignal)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue