✨ (gui) allow including oceania if cross-dc selected#110
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable option to include Oceania data center market data when using Cross-DC filtering for players in other regions (Japan, North America, Europe). The feature helps players access broader market data across all regions.
- Adds a new configuration property
IncludeOceaniaDC(default: true) to control Oceania DC inclusion - Implements market data fetching and merging logic to combine Oceania listings with the player's region when Cross-DC is selected
- Fixes region name detection to use
HomeWorldinstead ofCurrentWorld
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| MarketBoardPlugin/MBPluginConfig.cs | Adds new IncludeOceaniaDC configuration property with documentation |
| MarketBoardPlugin/GUI/MarketBoardWindow.cs | Updates region detection logic and implements Oceania data fetching/merging when Cross-DC filter is active |
| MarketBoardPlugin/GUI/MarketBoardConfigWindow.cs | Adds UI checkbox to toggle Oceania DC inclusion with config save and market data reset |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (this.marketData == null) | ||
| { | ||
| this.marketData = oceaniaMarketData; | ||
| } | ||
| else | ||
| { | ||
| foreach (var listing in oceaniaMarketData.Listings) | ||
| { | ||
| this.marketData.Listings.Add(listing); | ||
| } | ||
|
|
||
| foreach (var history in oceaniaMarketData.RecentHistory) | ||
| { | ||
| this.marketData.RecentHistory.Add(history); | ||
| } | ||
|
|
||
| this.marketData.Listings = this.marketData.Listings | ||
| .OrderBy(l => l.PricePerUnit) | ||
| .Take(this.plugin.Config.ListingCount) | ||
| .ToList(); | ||
| this.marketData.RecentHistory = this.marketData.RecentHistory | ||
| .OrderByDescending(h => h.Timestamp) | ||
| .Take(this.plugin.Config.HistoryCount) | ||
| .ToList(); | ||
| } |
There was a problem hiding this comment.
When merging Oceania market data with the existing region's data, the metadata fields (DcName, LastUploadTime, AveragePrice, AveragePriceNq, AveragePriceHq, SaleVelocity, SaleVelocityNq, SaleVelocityHq, and StackSizeHistogram fields) from the original response are not updated. This means the merged data will only reflect the metadata from the first region's response, which could be misleading since the data now includes listings and history from both regions. Consider recalculating or appropriately handling these metadata fields after merging.
No description provided.