First pass at a new method of supplying offsets to multiple regions #34
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.
Currently LL supports two regions, global and CN .
With the upcoming TraditionalChinese version that has received numerous inquiries about its support I wanted reduce the burden of supporting multiple game regions.
Most patterns transition from global->CN , but require manually adjusting them when a new CN version comes out by adding a OffsetCN attribute to the field.
This new system introduces a flag enum that specifies how granular a offset should be.
Now when a new global version is introduced, the old Offset attribute can be replaced with a OffsetNG attribute. This attribute indicates that non global versions should search for this pattern. Multiple OffsetNG attributes can be placed on a single field and they will all be searched.
This means when a new CN, TC, KR version is released a new LL is not needed, the existing patterns will be scanned.
If there is a offset that requires a specific pattern, the Offset attribute takes an optional flag that can restrict which versions should use that offset.
There are a few things that can be improved for this PR:
OffsetAttributeExtensions.GetPattern currently returns a empty string as now a field may have multiple patterns
ForceClientMode hasn't been tested
It might make sense to add optional priority to OffsetNG to indicate which ones should be searched first
How to handle offsets when transitioning to a new expansion
Probably not ready to be merged without some discussion.