Skip to content

fix(career): localize missing mission data errors - #31

Merged
hzqst merged 1 commit into
mainfrom
fix/career-data-error-localization
Oct 25, 2026
Merged

hzqst merged 1 commit into
mainfrom
fix/career-data-error-localization

Conversation

@hzqst

@hzqst hzqst commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Fixes MetaHookSv/MetaHookSv#952.

When Career mission data is missing or corrupt, native CCareerMapFrame::OnThink creates a modal MessageBox with literal English title/body strings. Neither string starts with a localization token, so adding translations alone cannot translate this window. This path is separate from the plugin's profile-storage ShowError and the #951 confirmation-dialog fix.

Reuse the existing gamedata-resolved narrow MessageBox constructor and hook it only for czero, excluding Deleted Scenes. Replace the exact native title/body pair with two plugin tokens when each translation exists. The original constructor, error checks and modal lifecycle remain in use; missing translations retain the native English strings.

  • Add VGUI2Extension_CareerDataErrorTitle and VGUI2Extension_CareerDataErrorText in UTF-16 LE BOM English and Simplified Chinese resources.
  • Explicitly load plugin English first and the effective game language second during GameUI initialization, including -forcelang selection.
  • Document translation entry points and record verification. No new gamedata records or native object-layout assumptions are needed.

Validation:

  • MSVC x86 Release build, pinned format-check (66 files), all 8 existing CTests, staged install, and git diff --check passed.
  • Live czero build 10210 at 1280x720: Simplified Chinese title/body, English title/body, and native-English fallback in a fresh Simplified Chinese process with both plugin language files absent. OK returned to profile selection.
  • Runtime used a temporary mission pack with empty Maps to reach the same native no-triplet error branch. This was not a direct deleted-Normal.vdf test: missing per-pack files can fall back to global CareerGame<difficulty>.vdf. The checksum-failure branch and other engine builds were not separately exercised.
  • All task-owned game processes exited cleanly; the temporary pack/profile was moved out and all 21 backed-up game files were restored and SHA256-verified.

Static diagnosis: MetaHookSv/MetaHookSv#952 (comment)

Co-Authored-By: Codex <codex@openai.com>
@hzqst
hzqst merged commit 8ba72a3 into main Oct 25, 2026
3 checks passed
@hzqst
hzqst deleted the fix/career-data-error-localization branch October 25, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VGUI2Extension][czero] 任务包数据丢失的报错窗口无法本地化

1 participant