-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raidboss: refactor trigger loading #5047
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
033afa1
merge #5038
trim21 c89701e
merge #5045
trim21 eec49c3
real change of this PR
trim21 7cac6c5
handle trigger override
trim21 3915822
use map to handle added trigger
trim21 c448a95
remove dead code
trim21 06aafa8
Update ui/raidboss/popup-text.ts
trim21 9453c34
Update ui/raidboss/popup-text.ts
trim21 54d6bf1
Merge remote-tracking branch 'upstream/main' into refactor-trigger-lo…
trim21 4fdec62
some code review
trim21 849c070
fix LooseTimelineTrigger
trim21 a1259ca
fix undefined id
trim21 263476d
fix always true case
trim21 a85117b
fix always true case
trim21 0d52a72
read from user set filename first
trim21 e9fb6e9
avoid override
trim21 2fec0f4
wip
trim21 3ade816
wip
trim21 e6f9d8f
code review
trim21 ecbffef
Update ui/raidboss/raidboss_options.ts
trim21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,10 +106,10 @@ export type TriggerField<Data extends RaidbossData, MatchType extends NetAnyMatc | |
// This trigger type is what we expect cactbot triggers to be written as, | ||
// in other words `id` is not technically required for triggers but for | ||
// built-in triggers it is. | ||
export type BaseTrigger< | ||
Data extends RaidbossData, | ||
Type extends TriggerTypes, | ||
> = Omit<BaseNetTrigger<Data, Type>, 'type' | 'netRegex'>; | ||
export type BaseTrigger<Data extends RaidbossData, Type extends TriggerTypes> = Omit< | ||
BaseNetTrigger<Data, Type>, | ||
'type' | 'netRegex' | ||
>; | ||
|
||
type BaseNetTrigger<Data extends RaidbossData, Type extends TriggerTypes> = { | ||
id: string; | ||
|
@@ -200,6 +200,26 @@ export type TriggerSet<Data extends RaidbossData = RaidbossData> = | |
// Less strict type for user triggers + built-in triggers, including deprecated fields. | ||
export type LooseTimelineTrigger = Partial<TimelineTrigger<RaidbossData>>; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
export type LegacyTrigger = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this could be combined into |
||
regexEn?: RegExp; | ||
regexDe?: RegExp; | ||
regexFr?: RegExp; | ||
regexCn?: RegExp; | ||
regexJa?: RegExp; | ||
regexKo?: RegExp; | ||
|
||
// @deprecated | ||
netRegexEn?: RegExp; | ||
netRegexFr?: RegExp; | ||
netRegexDe?: RegExp; | ||
netRegexCn?: RegExp; | ||
netRegexJa?: RegExp; | ||
netRegexKo?: RegExp; | ||
}; | ||
|
||
export type LooseTrigger = Partial<BaseNetTrigger<RaidbossData, 'None'> & PartialRegexTrigger>; | ||
|
||
export type LooseTriggerSet = | ||
|
@@ -209,7 +229,7 @@ export type LooseTriggerSet = | |
zoneRegex?: | ||
| RegExp | ||
| { [lang in Lang]?: RegExp }; | ||
triggers?: LooseTrigger[]; | ||
triggers?: (LooseTrigger & LegacyTrigger)[]; | ||
timelineTriggers?: LooseTimelineTrigger[]; | ||
}; | ||
|
||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this get used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regex${lang as LegacyLangSuffix}
netRegex${lang as LegacyLangSuffix}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't see what you're referring to. Which file is that in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used to get legacy
regexDe
/netRegexDe
property inpopup-text.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the confusion, I just don't see what you mean. Did you mean to add these changes and they didn't save/commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's strange, I remembered I used it in
popup-test.ts
, maybe I lost it by mistake.