updated graphics touch events to be mouse events

This commit is contained in:
Mikayla Fischler
2023-04-08 21:33:54 -04:00
parent 4aad591d3a
commit 67872a1053
11 changed files with 97 additions and 40 deletions

View File

@@ -171,15 +171,15 @@ end
function renderer.ui_ready() return engine.ui_ready end
-- handle a touch event
---@param event monitor_touch
function renderer.handle_touch(event)
---@param event mouse_interaction
function renderer.handle_mouse(event)
if event.monitor == engine.monitors.primary_name then
ui.main_layout.handle_touch(event)
ui.main_layout.handle_mouse(event)
else
for id, monitor in pairs(engine.monitors.unit_name_map) do
if event.monitor == monitor then
local layout = ui.unit_layouts[id] ---@type graphics_element
layout.handle_touch(event)
layout.handle_mouse(event)
end
end
end