raidboss: add support for timeline blocks#853
Draft
jacob-keller wants to merge 1 commit intoOverlayPlugin:mainfrom
Draft
raidboss: add support for timeline blocks#853jacob-keller wants to merge 1 commit intoOverlayPlugin:mainfrom
jacob-keller wants to merge 1 commit intoOverlayPlugin:mainfrom
Conversation
Add new `blockbegin` and `blockend` keywords for the timeline file. These implement basic "block" support by allowing a timeline to identify collections of entries that belong together. To start a block, the timeline should use `blockbegin "name"` where "name" is a unique block name. This also creates an implicit label for the start of the block. To end a block the `blockend` keyword on its own line should be used. To avoid complexity with making the actual timeline logic handle blocks, implement support via a clever hack in the timeline parser to offset all entries. Keep track of the current block, and the largest time offset found so far. When a `blockbegin` keyword is found, use the largest known offset to generate a new "offset". To ensure a decent gap, add 500 seconds to that time then round up to the next multiple of 1000. For all entries until the next `blockend`, add this offset to their encoded time. This essentially automatically offsets blocks in the timeline instead of requiring manual offset configuration. Entries outside of blocks do not get modified. For jumps by label, add "block scoping" where a label is prefixed by the blockname separated by a ':'. Currently no timelines actually use ':' in their label name so this should be safe. A jump with a ':' in its name will always jump to the block label without implicit handling. Labels without ':' will get implicit handling in the following priority, with the first existing option being chosen 1) A label within the same block 2) A label outside any block 3) The start of a block by name This means that timeline files can re-use labels across blocks, and that blocks get implicit labels that do not override explicit ones. This solution is very much a hack, but it avoids a massive refactor that would be required for explicit block handling within many parts of the codebase. Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Collaborator
|
@jacob-keller Thanks for your contribution! 🌵🚀 |
Author
|
I am not certain if this is the best path, but its definitely the simplest path to getting timeline blocks working. I don't think I'd have the energy to properly refactor all of the mess that makes timelines work, and this solution basically automates what our existing timelines had to do manually. |
Author
|
@xiashtra would like your opinion on this when you get a chance |
Collaborator
I'm not going to have time to give this the attention it deserves until after the holidays, unfortunately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new
blockbeginandblockendkeywords for the timeline file.These implement basic "block" support by allowing a timeline to identify
collections of entries that belong together.
To start a block, the timeline should use
blockbegin "name"where"name" is a unique block name. This also creates an implicit label for
the start of the block.
To end a block the
blockendkeyword on its own line should be used.To avoid complexity with making the actual timeline logic handle blocks,
implement support via a clever hack in the timeline parser to offset all
entries.
Keep track of the current block, and the largest time offset found so
far. When a
blockbeginkeyword is found, use the largest known offsetto generate a new "offset". To ensure a decent gap, add 500 seconds to
that time then round up to the next multiple of 1000.
For all entries until the next
blockend, add this offset to theirencoded time. This essentially automatically offsets blocks in the
timeline instead of requiring manual offset configuration. Entries
outside of blocks do not get modified.
For jumps by label, add "block scoping" where a label is prefixed by the
blockname separated by a ':'. Currently no timelines actually use ':' in
their label name so this should be safe.
A jump with a ':' in its name will always jump to the block label
without implicit handling. Labels without ':' will get implicit handling
in the following priority, with the first existing option being chosen
This means that timeline files can re-use labels across blocks, and that
blocks get implicit labels that do not override explicit ones.
This solution is very much a hack, but it avoids a massive refactor that
would be required for explicit block handling within many parts of the
codebase.
Signed-off-by: Jacob Keller jacob.keller@gmail.com