Fixed program mouse not having converted coordinates
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ testWorkflows
|
|||||||
.vscode
|
.vscode
|
||||||
todo.txt
|
todo.txt
|
||||||
Flexbox2.lua
|
Flexbox2.lua
|
||||||
|
markdown2.lua
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ end
|
|||||||
|
|
||||||
---@private
|
---@private
|
||||||
function BasaltProgram:resume(event, ...)
|
function BasaltProgram:resume(event, ...)
|
||||||
|
local args = {...}
|
||||||
|
if(event:find("mouse_"))then
|
||||||
|
args[2], args[3] = self.program:getRelativePosition(args[2], args[3])
|
||||||
|
end
|
||||||
if self.coroutine==nil or coroutine.status(self.coroutine)=="dead" then self.program.set("running", false) return end
|
if self.coroutine==nil or coroutine.status(self.coroutine)=="dead" then self.program.set("running", false) return end
|
||||||
if(self.filter~=nil)then
|
if(self.filter~=nil)then
|
||||||
if(event~=self.filter)then return end
|
if(event~=self.filter)then return end
|
||||||
@@ -113,7 +117,7 @@ function BasaltProgram:resume(event, ...)
|
|||||||
end
|
end
|
||||||
local current = term.current()
|
local current = term.current()
|
||||||
term.redirect(self.window)
|
term.redirect(self.window)
|
||||||
local ok, result = coroutine.resume(self.coroutine, event, ...)
|
local ok, result = coroutine.resume(self.coroutine, event, table.unpack(args))
|
||||||
term.redirect(current)
|
term.redirect(current)
|
||||||
|
|
||||||
if ok then
|
if ok then
|
||||||
|
|||||||
Reference in New Issue
Block a user