feat: allow clicking timeline chapter indicators

I don't like this solution, but anything cleaner would probably require converting chapter indicators into individual elements and than managing/updating their positions and sizes in relation to growing timeline, which seems like a lot more work and code, so this'll have to suffice.

closes #370
This commit is contained in:
tomasklaen
2022-11-16 15:23:44 +01:00
parent 682fd81a85
commit 6b2476bace
5 changed files with 79 additions and 25 deletions

View File

@@ -118,10 +118,14 @@ end
-- Disabled elements don't receive these events.
---@param name string Event name.
function Elements:proximity_trigger(name, ...)
for _, element in self:ipairs() do
local stop_normal, stop_global = false, false
for i = #self.itable, 1, -1 do
local element = self.itable[i]
if element.enabled then
if element.proximity_raw == 0 then element:trigger(name, ...) end
element:trigger('global_' .. name, ...)
if element.proximity_raw == 0 then
if element:trigger(name, ...) == 'stop_propagation' then break end
end
if element:trigger('global_' .. name, ...) == 'stop_propagation' then break end
end
end
end