Commit Graph

330 Commits

Author SHA1 Message Date
Kurt
3c1e7bdc6c Misc tweaks
Overworld8a: acknowledge Nature request
8U/8N: remove unnecessary auto-mint (not applied anywhere else)
Nature: use extension properties, use the `IsFixed` check throughout codebase
Wallpaper: add PLA default to pasture (not-obvious prior behavior was removed in refactor).
Tests: fix ck3 file with OT trash bytes (now cleared)
Tests: fix pk3 file with OT trash bytes now passes (added 1 trash pattern, future work)
Trash3: initial stubs for default OT trash recognition (one included to pass above ^)
2026-03-18 01:17:17 -05:00
Kurt
306c1329ed Add gameversion for Champions (53) 2026-02-25 23:25:32 -06:00
Kurt
9792455f34 Refactor to use Context over Generation
Generation was always more weak; am I paranoid about potential VC3? maybe
Better indicates the move source for LGPE exclusive moves, etc.
2026-02-15 02:15:50 -06:00
Kurt
09d7fd9e31 Minor clean
Remove unused usings from bag refactor
remove unnecessary suppression (resharper fixed the ConstantExpected trickle up)
fix gen6/7 timestamp previous offset (has been broken for 6.5 years) 1b028198ad (diff-7e597cadc592f504e9105ba631f99ef9e1fe27ea9becbe191c15c00daa3272f2L211)
2026-02-08 01:22:21 -06:00
Kurt
18c4f2be26 Relocate trade name fetch to EncounterUtil
Simplifies ResourceUtil to no longer have specialized methods specific to Pokémon

duplicates the gen7 zh trade files; not an issue in duplication (will compress out) and simplifies the array fetching operation to be a single method rather than many.
2026-01-12 21:07:20 -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
ef374f2d22 Add Donut editor
thanks to everyone who watched along while I implemented this
2025-12-14 00:14:43 -06:00
Kurt
34f3624b64
Changes for Legends: Z-A (Mega Dimension) support (#4653)
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-12-12 01:30:35 -06:00
Kurt
d138755ed0 Hide nonsensical dropdowns for gender/shiny
Internal values that were loosely bundled. The Criteria tab in the encdb shouldn't show these.
2025-11-15 22:22:44 -06:00
Kurt
551c34b9ed Add latam spanish for enigma/transporter strings
#4632
2025-11-08 14:55:42 -06:00
abcboy101
724765e185
Remove es txt resource fallback logic (#4627)
No longer needed after commit 51a1caf628
2025-11-04 07:56:59 -06:00
abcboy101
ecbfe41f7f
Add LGPE/Gen 8/Gen 9 Wonder Card titles (#4625)
* Add LGPE/Gen 8/Gen 9 Wonder Card titles

* Fix CardTitleIndex
2025-11-03 19:49:30 -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
67b0217683 Fix met location duplication across sets
Kalos Gift starters when loaded to the GUI would mutate their met location to the wrong index (series 0) rather than retain the correct one (series 3). Wasn't apparent because the deduplication algorithm is different for Debug and Release builds.

Tested Release build, all unit tests now pass. Thanks pigeonsaint (discord) for reporting!
2025-10-27 12:21:08 -05:00
abcboy101
b5f5f35f2c
Update text resources from Z-A, support LATAM Spanish as a program language (#4599)
* Split zh text resources

* Reorganize language text resources

* Update language codes

Z-A uses the same abbreviations in all languages

* Update characteristics text from Z-A

* Update LATAM text resources from Z-A

* Support LATAM Spanish as a program language

* Handle duplicates
2025-10-27 11:03:48 -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
e25b2037e2 game->version 2025-08-16 09:21:16 -05:00
abcboy101
8f9fec0b13
PBR: Add Battle Pass, Gear, Trainer Info editors (#4540)
* Fix PBR checksums

* Fix PBR desyncs between Data/Container

- CurrentSlot.set reloads Data from Container, so copy other.Data to Data after
- When editing the OT name, use Data if the requested slot is the current slot

* Correct PBR party offset/size

* Add GameVersion.BATREV

* Add Gear Editor

* Add Battle Pass/Trainer Info Editor for PBR

* Minor tweaks

* Fix ResetGear/UpdatePresetIndexes
2025-08-10 22:43:03 -05:00
Kurt
d4bbb6dd02 Misc tweaks
Ball: all ball IDs are in a sequence +1'd. No need to have an array when we can just increment within the range. Ez removal of static constructor and allocation, and better iteration (and skips index 0!)
Disallow E/FR/LG item deposits of anything besides general pouch (R/S is like G/S/C, any pouch). Confirmed via testing in-game and matches Bulbapedia's testing.
Disallow Gen2 held item being an HM; no longer considered valid as a tradeback catch rate value. Oops that HMs were "allowed" for so long!
Encode Gen2 held items to bitflag array to not need to compute the merged array. Relocate duplicated logic to a single location in ItemConverter.
Fix gender-changing marill edge case comparing the wrong ratio
2025-08-08 23:43:22 -05:00
Kurt
b291378e78 Localizations: better thread safety init
No need for a dictionary, just allocate an array and index in via one of the supported languages.

Updates GameInfo to use the abstraction to prevent some duplicate work on a very-hot startup. Threads repeating the same work vs Thread n++ simply waiting for previous thread to finish init is the ~same amount of time, with less overall CPU usage (so this is a positive improvement).

EnterScope is "safer" than explicit `lock (x)` due to the using syntax releasing the lock even on exception (not expected, but might alleviate issues on developer-initiated feature upgrades).

Co-Authored-By: HexByt3 <80122551+hexbyt3@users.noreply.github.com>
2025-08-07 21:15:32 -05:00
Kurt
1d57facd22 Minor tweaks
extract max/min level to const
fix max species ID in filtered sources
2025-08-02 21:02:11 -05:00
Kurt
90cfa59102 Misc tweaks
Pass Analysis to external localizer
Cache index for bulk analysis flagged slots
2025-07-29 20:12:41 -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
13a4d472bc
Deferred Humanization of LegalityAnalysis (#4531) 2025-07-27 20:54:58 -05:00
Kurt
a02712e375 Add gen5 spin trade as valid link trade loc
ty Cappy for reporting, and @PP-theSLAYER & @Lusamine for testing.
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/page/32/#findComment-296214

gen4 spin trades in pt/hgss do not set the wrong value -- gen5 only bug.
2025-07-23 22:37:39 -05:00
Kurt
ccfa58e5f1 Split PathUtil from Util, add more xmldoc 2025-06-08 16:33:31 -05:00
Kurt
ba2245d7d8 Add more xmldoc
Updated PIDIV tests to use IV32 rather than IV sequence checks. Now marked as Obsolete to prevent myself from reusing PKM.IVs getter :)
2025-06-07 09:41:02 -05:00
Kurt
1d9fc99413 Misc tweaks
Add Count to IPersonalTable
Revise EncounterOrigin for evo chain search to use Context instead of Version
Use ITrainerID*ReadOnly as pivot for Trainer ID verification skip
Add more xmldoc
Reconfigure pla dex task fetch to be nullable, match fbs field ordering for clarity
2025-05-24 22:59:13 -05:00
Kurt
7442e86d65 level int -> byte
Might refactor the learnset level get to byte later as a TryGet so -1 is never returned.
2025-05-17 14:45: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
87d2f10c7f Misc tweaks
Add date validation for lgpe go park encounters (deferred, now finally remembered to implement?)
2025-04-21 00:57:23 -05:00
Kurt
154c370901 Merge branch 'master' of https://github.com/kwsch/PKHeX 2025-04-20 11:24:04 -05:00
abcboy101
d633202af3
Add accessors for PBR save language (#4475)
* Allow PBR saves with at least one valid half

* Add accessors for PBR save language
2025-04-20 11:17:16 -05:00
Kurt
972c432205 Minor tweaks
no functional change, just updating some style for readability
2025-04-20 11:08:10 -05:00
Kurt
383037db43 More xmldoc updates 2025-04-20 11:06:08 -05:00
Kurt
8a19968321 Minor clean 2025-04-13 11:55:20 -05:00
Kurt
9218f97971 Rename item pouch legal lists, make public
No longer need to protect for immutability since they're now ReadOnlySpan.
2025-04-13 11:42:59 -05:00
Kurt
92cd8feaf1 Use entitycontext for xmldoc instead of lump 2025-04-13 11:34:17 -05:00
Kurt
f538d2c4be Skip random level check if criteria not in range 2025-02-02 23:18:15 -06:00
Kurt
9dedd33694 Duplicate locations: across lists, not each array
BD/SP has Pokémon HOME as location 30018 and 40086; need to differentiate.
Revise the unit test to share the unique-check set across all location lists of that context

Ignore "empty" location values (dashes, empty). For deduplicating, ignore empty indexes as well.
2025-02-01 19:23:11 -06:00
sora10pls
f3f89c1f4b Update BDSP Met4 to match SWSH/LA 2025-01-29 20:33:13 -05:00
Kurt
93c7b765c3 Minor tweaks
Handle ARNG egg manaphy for gen4 trainer, force hatch
add xmldoc/comments
expand expressions for version/language selection, disallow languages correctly
2025-01-08 00:36:02 -06:00
Kurt
ab215d0721
Enhance EncounterCriteria and template->pkm adherance (#4411)
Change the EncounterCriteria object to a readonly record struct, and introduce extra properties to indicate how flexible we are with random results.
2025-01-04 22:45:30 -06:00
Kurt
37e4b06a9e Misc tweaks
Make nick/trainer'd encounters use RoM instead of string[] to truly make them readonly records, and skip 1 dereference on access
add some xmldoc
fix open file suggesting main from another folder
2025-01-04 21:43:55 -06:00
Kurt
9ef46b5f8c Correctly filter dummied moves in BDSP and SV
Less noise in the user drop-downs for moves that aren't available in the game. Unlike SW/SH that has all moves from the past, there's no need to confuse the user with impossible options (unless they turn on HaX, which is unchanged).

Add performant path for dummied move list fetch for Gen8a+
Skip duplicate work for Relearn list fetch (always same as Moves, except for Gen7 relearn)
2025-01-02 20:29:58 -06:00
Kurt
ceb669c112
Update to .NET 9, c# 13 (#4390) 2024-11-17 13:13:58 -06:00
abcboy101
3707ee5eb1
Standardize language codes and improve locale handling (#4353)
Use standard BCP 47 language codes
Move Culture utils into WinFormsUtil
Detect system language on first launch
2024-09-04 18:51:35 -05:00
Kurt
6e880f8e14 Add Emerald|FireRed|LeafGreen version group
Add new enum value to end to not break plugins using lumped values.

I think GameVersion needs to be reworked to remove all lumped values, and to instead implement a per-format enum (joy...)
2024-07-09 22:04:08 -05:00
Kurt
99ebc47866 Extract TrainerName const to static class
Central location for where these values are defined.
2024-07-06 01:35:50 -05:00
Kurt
07a08fa328 Add some xmldoc 2024-06-29 10:55:01 -05:00