feat(fishing-ui): improve fish information and localization features#2
feat(fishing-ui): improve fish information and localization features#2SychO3 wants to merge 2 commits intoLetsTussleBoiz:masterfrom
Conversation
- Add localized strings for fish-related UI in `zh.json` - Enhance fish tab display by introducing dynamic names via `DisplayName` - Update fish caught status labels to support localization - Refactor fish spawn conditions to handle "Here" condition explicitly - Introduce cache mechanism for location display names to improve performance - Adjust `VanillaProvider.cs` parsing logic for better data handling - Improve UI elements in `FishInformation.sml` to use localized tooltips and labels
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the fishing UI mod with comprehensive localization support and improved data handling. The changes add Chinese (zh) translations, refactor fish information display to use localized strings throughout the UI, and introduce performance optimizations through caching mechanisms.
Key Changes:
- Added complete Chinese localization file with 91 translated strings covering all UI elements
- Implemented localization for fish tab names, caught status labels, and tooltips in the fish information view
- Introduced location display name caching to reduce redundant string parsing operations
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| MatrixFishingUI/i18n/zh.json | Complete Chinese translation file with all UI strings |
| MatrixFishingUI/i18n/default.json | Added new localization keys for tabs, caught status, and labels |
| MatrixFishingUI/assets/views/FishInformation.sml | Updated UI elements to use localized strings instead of hardcoded text |
| MatrixFishingUI/Framework/Fish/VanillaProvider.cs | Enhanced parsing logic to handle null/empty values and use DisplayName |
| MatrixFishingUI/Framework/Fish/HudMenuData.cs | Added partial class modifier for code generation support |
| MatrixFishingUI/Framework/Fish/FishInfoData.cs | Added localized properties for caught status and tab display names |
| MatrixFishingUI/Framework/Fish/FishHelper.cs | Implemented location display name caching and improved "Here" season condition handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| return result.Count == 0 ? null : result; | ||
| if (result.Count == 0) | ||
| { | ||
| if (sawHere) return Enum.GetValues<Season>().ToHashSet(); |
There was a problem hiding this comment.
The expression Enum.GetValues<Season>().ToHashSet() is called every time 'Here' is encountered without explicit seasons. Consider caching this HashSet as a static readonly field to avoid repeated allocations and enum value retrievals.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zh.jsonDisplayNameVanillaProvider.csparsing logic for better data handlingFishInformation.smlto use localized tooltips and labels