Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Merge upstream#4

Open
Glazelf wants to merge 3019 commits into
Glazelf:masterfrom
kwsch:master
Open

Merge upstream#4
Glazelf wants to merge 3019 commits into
Glazelf:masterfrom
kwsch:master

Conversation

@Glazelf

@Glazelf Glazelf commented Nov 22, 2021

Copy link
Copy Markdown
Owner

I don't feel like actually updating all this

@Glazelf Glazelf self-assigned this Nov 22, 2021
@kwsch
kwsch force-pushed the master branch 2 times, most recently from bfccdae to fbb9e0b Compare December 26, 2021 02:44
@Glazelf Glazelf linked an issue Feb 1, 2022 that may be closed by this pull request
@Glazelf Glazelf added the enhancement New feature or request label Feb 1, 2022
@kwsch
kwsch force-pushed the master branch 2 times, most recently from c460f5b to ecee948 Compare April 25, 2022 03:29
@kwsch
kwsch force-pushed the master branch 2 times, most recently from fcadbda to 2bbd767 Compare September 11, 2022 05:54
@kwsch
kwsch force-pushed the master branch 3 times, most recently from 81c04d8 to 5d5d913 Compare November 26, 2022 04:54
@kwsch
kwsch force-pushed the master branch 2 times, most recently from 362a728 to 9a768dd Compare April 21, 2023 04:20
@kwsch
kwsch force-pushed the master branch 4 times, most recently from 9bf94f5 to 1e985d6 Compare May 11, 2023 04:05
kwsch and others added 30 commits June 20, 2026 13:48
BD/SP => HOME sanitizes -1=>0 and 0=>658. HOME is therefore "clean" so the other side-data do not need to know about BD/SP goofiness.
Handles 658 for mainline-legitimate values (none?), better to be correct.
Adds in a link traded egg checks for unhatched static eggs in Gen6 (previously unchecked)
SelectionLength => Select (avoid winapi fetch of SelectionStart), no functional change
Rename DisallowSearch => IsSearchAllowed (check a positive, not a negative)
Fix some stale xmldoc refs
Remove some unused usings
Small preference tweaks (aka resharper yelling at me)
ty anubis, santacrab, and Bowarcky for testing & data aggregation

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-Authored-By: santacrab2 <79347566+santacrab2@users.noreply.github.com>
Co-Authored-By: Bowarcky <54773567+bowarcky@users.noreply.github.com>
Closes #4493
Future pull requests may be added with other font files to add game-specific font files (such as Gen1/2 having JPN/KOR/INT in the pixelated style like SciresM/Rhydon)

For now, the Control provides via EntityContext. If we need to provide different granularity, maybe another enum would be OK. Possibly add that as a property to IStringConverter.
…a editors (#4829)

* Localize Settings PropertyGrid, Language menu, and About shortcuts

- Add PropertyGridLocalization: a TypeDescriptor-based wrapper that
  localizes the Settings editor PropertyGrid using the existing
  lang_*.txt resources - tab names, property display names, categories,
  bool/enum values, dropdown standard values, and expandable object
  summaries. Translated enum/bool text is mapped back to the original
  value on write; ambiguous translations defer to the default converter.
  Providers are registered once per settings instance (tracked via
  ConditionalWeakTable) so repeated openings do not stack providers, and
  the localizer dictionary is swapped on language change.
- Replace the Options -> Language ToolStripComboBox with a regular
  drop-down submenu of checkable language items.
- Load the About window Shortcuts tab from a per-language
  shortcuts_*.txt resource matching the current program language,
  falling back to the English resource when no localized copy exists.
- Add the new translation keys for all 10 supported languages;
  zh-Hans/zh-Hant additionally include translated property names
  (other languages fall back to the raw property name).
- Update shortcuts.txt to reference the current Unicode setting path
  (Options -> Settings -> Display -> Unicode).

* Localize remaining Settings options and SAV Block Data editors

- Settings: add zh display names for the property names, nested type
  names, and settings sections that were previously missing; translate
  GameVersion enum dropdown values in all 10 languages by sourcing each
  language''s own game-name strings (combined versions like RSE/FRLG
  hand-translated for zh, English elsewhere).
- SAV tab Block Data: route all three PropertyGrid editors through
  PropertyGridLocalization - the Simple Editor fallback form (Gen1-4,
  now with a translated title), SAV_Accessor (Gen5-7), and
  SAV_BlockDump8 (Gen8+). Add zh display names for the Gen3 save file
  properties shown in the Simple Editor.

* Localize SAV property view records, plain objects, and Gen3 coverage

- Record types (SaveFileMetadata/SaveFileState) now synthesize localized
  summaries instead of the compiler ToString; plain PKHeX objects without
  a meaningful ToString override show a translatable type name instead of
  the namespace-qualified default (ValueType.ToString is not treated as
  an override).
- Add zh-Hans/zh-Hant keys covering the SAV3 R/S/E/FR/LG property
  surface, nested block types, Memory segments, EntityContext and
  TrainerIDFormat enums, and the checksum-valid value string.

* Translate new localization keys for all supported languages

Replace the English placeholder values and add the previously zh-only
display-name keys with real translations for de/es/es-419/fr/it/ja/ko:
settings tabs, property display names, category/bool/collection values,
enum dropdown values, nested type names, and the SAV block-data
property surface. English keeps the raw property-name display.
Game pair names use each language's official game titles.

* Adjustments for maintenance purposes

Translation key=value pairs are automatically generated and the list grows/trims automatically as elements are added to the GUI. The pull request did not update the reflection traversal of the assembly -- key=values must survive the regeneration process (aka, be traversed automatically or manually) in order to stay in the translation file. It is not a manually curated file for add/remove.

Typename localization not very worthwhile. Property name localization and enums are a value add.

DevUtil crawler now adds enums to the translation file as it discovers them used in a property's type.

Am going to strictly refuse PropertyGrid localization of SaveFile/Accessor property grid displays. There are far too many properties to localize, and the property names are subject to change as the codebase is maintained. Settings are much more "stable" and thus acceptable for property name localization.

Downside: the shortcuts text file was very tedious to update every time I added a new hidden shortcut. A better path forward would be to use attributes on methods to tag them as "hey a shortcut exists here, the hotkeys trigger `behavior` string", and the program dumps them into the shortcut log.

The WinFormsTranslator probably needs to be rewritten to be an object (less primitive obsession) so that it can store multiple kvp sets for a language, and dump them to separate files with specific serializer methods. The GUI localization for form controls can be one, shortcuts another, property grid another. The property grid localization can be better arranged so that LocalizedDescription is alphabetically logged below the PropertyName, and can also have PropertyType if it is class-based.

Too much effort for very little value add, at least for me.

Order tabs in Settings order alphabetically.
Removed non-saved-gameversion selections. Stuff like E/FRLG are currently workarounds for Encounter Templates that shouldn't use GameVersion like that. I have a long-term goal to eventually remove the lumped GameVersion values entirely, and have a GameVersionRestriction enum specific for each game, and an interface that can check if a GameVersion can arise from the restriction.
Converts EVs and displays the associated values it would have if transferred to Champions.
* Localize additional settings PropertyGrid editors

* Handle [Flags] enum with multiple flagged values

* Regenerate translation file

Can be done by pressing CTRL-ALT-D on the Main form when running a debug build of the program.

Also includes new translations for Champions SP stat export for battle templates from an unrelated commit.
Tab indexing in save force loader, some anchoring/visibility preference
Hide SID on Trainer control update when in gen1/2 (refactor miss)
special moves and hard to verify vblanks, just prefer the special move source first. I guess it's also the more statistically likely (players using swarms to catch the species that are much less common otherwise?)
No functional change
Fixes #4836 wrt gender mismatch
Battle Revolution uses more of the sanity flags (probably as quarantine) and the checksum algorithm probably isn't updated/stale. Just ignore it for now.
Needed because RK4 reserves 10char for the handler.
Closes #4837

refer pkl generation code that appends the scraped restriction info to the end of the concatenated bin:
kwsch/PKHeX.TemplateRegen@1ae1742

other adjustments:
- remove Nature set on pgf->pk5 ctor, already set later in SetPINGA
- ensure sane language/version on ctor, distrust OT if language incompatible (not perfect but better)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legends Arceus support