513 Commits

Author SHA1 Message Date
Kurt
2f9d50308b Revise savefile subversion indication in title
Ensure all have dashes at front
for multiple strings, separate out the GB/VC to a separate tag.

No longer does the program show `SAV3FRLGUGBA` instead of `SAV3FRLG-U [GBA]`, which is a little more transparent to the end user.
2026-07-31 16:50:20 -05:00
Kurt
9a0fdcdcf4 Misc tweaks
No functional change
2026-07-13 22:36:00 -05:00
Alex
b9d85427cb Localize Settings, About shortcuts, Language menu, and save Block Data 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.
2026-07-03 19:18:41 -05:00
Kurt
65535efa55 Misc tweaks
Reflow inventory editor, gridlines and too-wide sprite column, row select
Make troubleshooting menu items visible for all builds, add localization
Show filename in label for savefile force loader
2026-06-11 23:31:22 -05:00
Kurt
7603943e25 Add save file force loader (CTRL-ALT-L)
Accessible on release builds too; now joined by the hex-clipboard &Import and the list-pl&Ugins

maybe I'll add these as a visible toolstrip. for now, feature is available to those in-the-know, and who should know-better.
does this allow loading of previous unsupported romhack savefiles? yeah. should it be used to do that? no.
2026-06-02 00:32:35 -05:00
Kurt
2b4a01512e Add setting to quiet every other sound made
Closes #4774
2026-04-10 00:48:34 -05:00
Kurt
5bf1e2cf45 PKM: Reduce allocation via in-place decryption logic (#4764) 2026-03-24 21:31:59 -05:00
Kurt
492aea166e main dragout: track drag operation, keep cursor
drag enter was triggering once the mouse moved, resetting to hand -- not anymore.
2026-03-22 14:16:36 -05:00
Kurt
bb363a7a3d Re-flow Stat editor for alignment/showing all text
Some languages have localized these labels to long strings; previously they were truncated (probably frustrating); now, they all show (wrapped text is the best I can do -- better than truncating?)
2026-03-12 01:29:58 -05:00
Kurt
5b42ff746d Handle handle leaks on dragdrop cursor icon
Also pass the tooltips to the components container so that they dispose of anything if needed too.
A user had a long-running script/session that drag-dropped a few thousand times, which exhausted the Windows GDI handle limit (10,000 per process).
2026-03-09 12:25:15 -05:00
Kurt
8b08f263e5 Minor tweaks
Remove GameSync/SecureValue from SAV tab (still lives in Block Data)
Remove inaccessible items from FRLG/E key items
2026-03-08 23:40:56 -05:00
Kurt
f382291de4 Improve translation of Extra Slots
SAV tab shows a bunch of extra slots from miscellaneous sources. The previous logic was a little clunky with fake labels; rewrite how it works so it's a little more transparent.

Misc is no more; I've created enum members with more descriptive names.

#4735
2026-03-01 09:58:40 -06:00
Kurt
d690f1c5d3 Check unsaved entity on sav export
Add setting to skip the unsaved entity check
Add setting to skip the overwrite? prompt and always call Save As

Change Overwrite prompt to have distinct buttons rather than rows that can be mis-clicked.

fix some comments/strings from Pokemon=>Pokémon

add some underline shortcut key for main menu for English translation
2026-02-22 11:11:16 -06:00
Kurt
29a08bf988 Allow box dumper to retain Main control
Allows for quickly flipping current boxes.
2026-02-16 23:33:51 -06:00
Kurt
ceb420a2a1 Misc gui tweaks
Only show Square shiny in Gen8 context (sw/sh only) to avoid confusion
Fix method name typo
Close subforms in reverse to avoid allocating a temp list
Close splash screen entirely async rather than dual Task.Run
Translate the entirety of the EntitySearchSetup (comparator button/menu now translates)
Launch box popup to the right of the main form, like the Search behavior
Fix dark mode coloring of popup box editor/group viewer images
Fix dark mode RichTextBox retaining border when it should be removed (white was annoying); was early-returning due to satisfying TextBoxBase
2026-02-15 02:19:09 -06:00
Kurt
20905cbe67 Add a search interface for visually filtering all slots (#4712)
* Add slot search to box editor
Alt-Click: Clears the current search.
Shift-Click: Jump to the next box with a result.
2026-02-09 22:03:18 -06:00
Kurt
19655ec2ec Misc tweaks
no functional change
HaX popup now uses Task Dialog api for cleaner impl
2026-01-12 21:48:28 -06:00
Kurt
0fe0b704d1 Minor tweaks
Allow localizing the Legality Report and File Overwrite dialogs added in .NET 10 update

Simplify evo restriction check
2026-01-10 19:27:45 -06:00
Kurt
2c541ad422 Update to .NET 10 (#4676)
* Update to .NET 10
* Property fields
* API signature updates
* Extension method blocks

* Completed dark mode support
  Outside of my control:
- vertical tab control (pkm editor)
- datetimepicker controls
- lgpe event flags (no idea)
- some control types having white-borders when they should really be gray

Box background is 50% transparency to effectively darken the image.

* Custom legality report popup
* Event diff dialog, version select dialog
* Add quick overwrite popup for export sav
* Extension methods
* Dark Mode: glow currently editing sprite
* Add invalid encounter hint for trade evolutions
* Extension properties
* Append legality hint on hover card
* Slot image loading: clear the screen-reader description if a slot is empty/invalid, rather than retain the previous description. Changing boxes would easily confuse users on this.
2025-12-31 01:42:05 -06:00
Kurt
b5c29b3de8 Minor tweaks
Allow dragdrop into menustrip/legal/vertical tabs to load file
ZA: Retain original criteria for cleanup application of IVs
Inline vertical tabs color choice
Simplify some expressions
2025-10-31 18:44:37 -05:00
Kurt
fd1c538cc5 Changes for Legends: Z-A support (#4596)
Refer to pull request notes and the eventual changelog for a high-level summary.

Co-authored-by: Matt <17801814+sora10pls@users.noreply.github.com>
Co-authored-by: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-authored-by: SciresM <8676005+SciresM@users.noreply.github.com>
2025-10-26 19:01:44 -05:00
Kurt
efa1211c07 Keep plugin load result
Closes #4556

Co-Authored-By: Chris Dailey <602691+nitz@users.noreply.github.com>
2025-09-08 10:22:52 -05:00
Kurt
ec47d75327 Misc tweaks 2025-09-07 17:29:19 -05:00
Kurt
ded9d54399 Misc tweaks
fixes legality report not showing localized
fixes pcjp5 seed->table generate
removes eternamax from go_home pkl
waiting for raids before hotfixing exe & pushing nuget
2025-08-31 17:12:20 -05:00
Kurt
9e8d8ccc62 Update 25.08.30 2025-08-31 00:01:14 -05:00
Kurt
f0423610af Add localization for ShowdownSet parse fail popup 2025-08-22 16:28:03 -05:00
Kurt
ea85d5e6b0 Minor clean 2025-08-16 09:21:16 -05:00
Kurt
f0c8b86728 Minor startup tweaks
Allow settings to skip Splash Screen (and just launch the main form without fuss, cuz why not?)
Handle scenario where PKHeX.Core.dll fails to bind during Settings fetch -- handle via static constructor instead of Program.Main() so that errors pipe to the Release error handlers.

Run update check in another thread, after Main is shown, so that offline users don't have to wait 3 extra seconds for it to timeout and show.

Revise the startup animation to just show the Main form rather than minimize->restore. The previous "hack" was designed so that if users clicked anywhere after launching the program (thus losing focus) the Main form would re-capture it. Activate() works fine now (maybe it didn't in the past?)

Removes "dark" startup arg; do via settings. Users really won't have a separate launch config like they might for HaX via .bat
2025-08-14 23:57:20 -05:00
Kurt
d658da44c6 Minor tweaks
Fixes conversion compatibility override being reverted when settings is reloaded by user (via GUI)
2025-08-13 22:05:43 -05:00
Kurt
93a381bfde Startup: load config before Main ctor
Allows specifying Dark mode in settings now.
Extracts reusable settings objects to PKHeX.Core (drawing/GUI stuff kept in WinForms).
Updating settings now refreshes backup paths/mgdb
2025-08-13 20:59:46 -05:00
Kurt
ff0f4727dd Extract logic from SaveUtil
BlankSaveFile -> creation of blank save files
SaveFileType -> listing of all savefile types

Blank save file arg passing is now clearer
Instead of SaveFile? return, use TryGet pattern with nullable annotations to indicate success
2025-08-09 21:55:55 -05:00
Kurt
f370c0cc39 Memory<byte> Refactoring (#4527)
`SaveFile` and `PKM` classes now use `Memory<byte>` instead of `byte[]` to store their primary backing array data.
2025-07-27 20:57:10 -05:00
Kurt
42835e9aac Misc tweaks
Adds a debug hex file loader from clipboard
sav1 current box if empty -> set if box is desync'd
wb7: add comment note of "real" value
2025-07-16 23:02:57 -05:00
Kurt
cdb5770f5f Minor tweaks
Fixes cosmetic issue on gen4 seed example times
no functional change otherwise
2025-07-08 23:00:27 -05:00
Kurt
c19a4605d5 Misc tweaks
No functional change
2025-07-04 01:32:25 -05:00
Kurt
ccfa58e5f1 Split PathUtil from Util, add more xmldoc 2025-06-08 16:33:31 -05:00
Kurt
d2594d7867 Misc tweaks
nothing needed for 4.0.0, everything works as-is
2025-06-02 21:01:16 -05:00
Kurt
602b1b6371 Add more xmldoc 2025-06-01 11:08:07 -05:00
Kurt
675c017a56 Merge branch 'master' of https://github.com/kwsch/PKHeX 2025-05-31 22:51:57 -05:00
Kurt
bf9e53efa1 Misc tweaks
Add more xmldoc
Simplify some expressions
Reduce unnecessary logic
2025-05-31 22:51:55 -05:00
Kurt
75cf9b0934 Use more modern PluginLoader implementation (#4503)
* Use System.Runtime.Loader to load plugins

Can now unload plugins if need be. Load->Update->Unload->Load(new) ?
2025-05-31 21:03:12 -05:00
Kurt
77f1b637c9 Misc tweaks 2025-05-02 01:34:49 -05:00
Kurt
f730f7d19a Feature: Localization of Battle Templates (Showdown Set) (#4482)
* Localization capability for each language, import & export
* Lines with stat names (IVs/EVs) can be configured to many representations (X/X/X/X/X/X, HABCDS, etc).
* Add nonstandard localizations
* Add token types for Showdown's new set format
* Add new program settings for hover & export styles. Allows users to select which presentation format they want for the hover previews, as well as the set export format.
* Revises preview hover GUI to use new settings
* Revises export events to use new settings
* Moves no longer indicate end of set
* Enhance robustness of stat parsing
* Expand all settings in settings editor on form load
* Extract clipboard -> sets operation to api for maintainability & reusability
2025-05-01 23:16:36 -05:00
Kurt
a6e2e08ecb Add pokepast.es url import
why not
2025-04-21 01:10:57 -05:00
Kurt
87eb8529ff Refactor Showdown team parsing methods
Renamed methods in ShowdownTeam.cs for clarity
Simplified IV validation logic in ShowdownSet.cs using AsSpan().ContainsAnyExcept, remove unnecessary xmldoc inherit
Updated references in Main.cs to reflect these changes.
2025-04-18 20:56:39 -05:00
Kurt
45d95d5742 Add showdown team import from url 2025-04-17 20:27:24 -05:00
Kurt
5ab6dbc0ac Add cancellation to savefile detection calls
5s timeout on detection, roughly
2025-04-06 22:25:37 -05:00
Kurt
8b5c07b07d Update Main.cs 2025-03-05 21:31:47 -06:00
Kurt
c8ec63992b Rework entity import settings param passing
Closes #4418

Introduce a readonly record struct to contain all the settings selected. Add simple static get for none/all to disable/force the updates.

Split the UpdateRecord behavior out of UpdatePKM (adapt to save file) so that it behaves similarly to UpdateDex.
Only AdaptToSaveFile when opening a file in the PKM Editor.
2025-02-23 15:50:17 -06:00
Kurt
7d59e3416a Minor tweaks
== null
to
is null
2025-01-27 16:37:37 -06:00