Note this is only SV types, so moves that had their type changed (=>dark/steel/fairy) will be inaccurate in past game formats.
Would need time to dump the info.
Click affix ribbon via cosmetic tab to open Ribbons (same as Ribbons Button). None affixed, but ribbons/marked available, will show an empty square.
Click possessed ribbon to affix.
NET 8 will have a Shuffle method, which can get rid of the overload in Util.
Batch Editor no longer crashes the program when selecting OT_Trash/HT_Trash/Nickname_Trash via dropdown.
Instead of allocating a buffer for Storage/General, just point within the raw Data, as a Memory<byte> reference. Most of the uses were already using it as span.
Runtime/jit repoints these to the dll rather than heap if we're Little Endian (always, otherwise will allocate like before).
Eliminates quite a few static constructors, so even faster startup. Items later.
https://github.com/kwsch/PKHeX/issues/3758#issuecomment-1417458988
Removes the Level textbox behavior that resets the text to "1" when the textbox is empty. Can be left empty, and will be treated as 1 when values are stored.
Adds an accessibility label for the "Make Shiny" button
Adds an accessibility description and enter/space keypress to toggle similar to the click event.
For determining if something is shiny, if the Shiny button is not tab-able, it is shiny. I wasn't able to get the Shiny star/square indicator to be able to be tabbed to for some reason.
Pipes the Showdown Set description or object detail dump into the accessible property. When the control Enter event is fired, send an Automation notification so that the Narrator narrates what was just tabbed to.
Closes#3758
Closes#3757
Allows tabbing between windows, or pressing the keyboard's contextmenu key to pop up the context menu without ever needing to use the mouse.
changes pkmeditor dragout, box slot displays, sav-mystery gift r/w, and all the encounter/pkm db's
- Allow paradox species to receive master rank ribbon
- Resize & center IV/AV rand button (localizations
were too wide for AVs)
- Highlight blue the most recently toggled Ribbon
Un-fix main panel, guess this might help for scaling the GUI via OS settings. Add an overload to rescale ItemSize for the vertical tab control; don't think it is ever called though.
Make EvoChain get method public for archit
Updates from net46->net7, dropping support for mono in favor of using the latest runtime (along with the performance/API improvements). Releases will be posted as 64bit only for now.
Refactors a good amount of internal API methods to be more performant and more customizable for future updates & fixes.
Adds functionality for Batch Editor commands to `>`, `<` and <=/>=
TID/SID properties renamed to TID16/SID16 for clarity; other properties exposed for Gen7 / display variants.
Main window has a new layout to account for DPI scaling (8 point grid)
Fixed: Tatsugiri and Paldean Tauros now output Showdown form names as Showdown expects
Changed: Gen9 species now interact based on the confirmed National Dex IDs (closes#3724)
Fixed: Pokedex set all no longer clears species with unavailable non-base forms (closes#3720)
Changed: Hyper Training suggestions now apply for level 50 in SV. (closes#3714)
Fixed: B2/W2 hatched egg met locations exclusive to specific versions are now explicitly checked (closes#3691)
Added: Properties for ribbon/mark count (closes#3659)
Fixed: Traded SV eggs are now checked correctly (closes#3692)
Generation of version-less eggs is -1, so just default to the format it is.
Met location lists weren't reloading if the version was 0; could load a non-SV entity followed by an egg and it would keep the old lists. Fall back to the save file's group if no list is available.
Adds support for Scarlet & Violet.
Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
In this pull request I've changed a ton of method signatures to reflect the more-narrow types of Species, Move# and Form; additionally, I've narrowed other large collections that stored lists of species / permitted values, and reworked them to be more performant with the latest API spaghetti that PKHeX provides. Roamer met locations, usually in a range of [max-min]<64, can be quickly checked using a bitflag operation on a UInt64. Other collections (like "Is this from Colosseum or XD") were eliminated -- shadow state is not transferred COLO<->XD, so having a Shadow ID or matching the met location from a gift/wild encounter is a sufficient check for "originated in XD".
Disallow max moves from Sketch
Hide dmax moves from legal dropdown lists
Pass ushort for moves for validating memories
Internal class for move pp (hide empty class from dll users)
`Moveset` struct stores 4 moves, and exposes methods to interact with a moveset.
`IndividualValueSet` stores a 6 IV template (signed).
Performance impact:
* Less allocating on the heap: Moves - (8 bytes member ptr, 20 bytes heap->8 bytes member)
* Less allocating on the heap: IVs - (8 bytes member ptr, 28 bytes heap->8 bytes member)
* No heap pointers, no need to jump to grab data.
* Easy to inline logic for checking if moves are present (no linq usage with temporary collections).
End result is faster ctor times, less memory used, faster program.
Rewrites a good amount of legality APIs pertaining to:
* Legal moves that can be learned
* Evolution chains & cross-generation paths
* Memory validation with forgotten moves
In generation 8, there are 3 separate contexts an entity can exist in: SW/SH, BD/SP, and LA. Not every entity can cross between them, and not every entity from generation 7 can exist in generation 8 (Gogoat, etc). By creating class models representing the restrictions to cross each boundary, we are able to better track and validate data.
The old implementation of validating moves was greedy: it would iterate for all generations and evolutions, and build a full list of every move that can be learned, storing it on the heap. Now, we check one game group at a time to see if the entity can learn a move that hasn't yet been validated. End result is an algorithm that requires 0 allocation, and a smaller/quicker search space.
The old implementation of storing move parses was inefficient; for each move that was parsed, a new object is created and adjusted depending on the parse. Now, move parse results are `struct` and store the move parse contiguously in memory. End result is faster parsing and 0 memory allocation.
* `PersonalTable` objects have been improved with new API methods to check if a species+form can exist in the game.
* `IEncounterTemplate` objects have been improved to indicate the `EntityContext` they originate in (similar to `Generation`).
* Some APIs have been extended to accept `Span<T>` instead of Array/IEnumerable
Closes#3519
Usages weren't consistent; since `é` isn't accessible on usual english keyboards, just use regular `e` instead of alt-223 entry.
Not sure why VS preferred to save the text files without an encoding prefix; oh well.
Default settings do not flag, as Database view does not track the savefile (LegalityAnalysis only indirectly references the latest loaded save file, not the true source).
Bulk Analysis will flag them correctly if run. Can be turned off.
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH)
* Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games).
* Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1).
* Revises some APIs for better usage:
- `PKM` now exposes a `Context` to indicate the isolation context for legality purposes.
- Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation.
- Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
Old jank that makes stuff less obvious to follow. Very very few people want out-of-bounds levels, even in HaX.
We have the batch editor to mutate these properties if it is really desired; same as Status condition/etc.
Don't trigger event calls if sanitized value is same as input.
Update PKMEditor.cs
Many years ago, PKX used to be a >4,000 line bloated file, which spun off multiple classes like CommonEdits and most of the early non-GUI PKM related logic. Now, it's just a stub to source the latest generation & personal table.
Separate files = more concise info, and more room to grow to do more advanced things.
Makes the IsPresent methods public (no longer internal).
Add Get/Set Relearn method to PKM.cs
Alpha Mastered move now indicates incomplete text entry (like moves/relearn)
Split up legal move indication helper class, use DI to allow other implementations of DataSource to be returned (pkhex mobile?).
Remove unused gender refresh method (see previous added UserControl commit)
Add helper method to center control within control
Single underscore discards (one of the c# language revisions allowed reusing the single underscore discard).
Remove a temporary allocation in BDSP flag editor
Hold shift when dropping into discord to have discord auto-send it; bump time delay to 20s for file deletes
Seems like it just wanted Effects.Copy instead of Effects.Move, nice. Used to work for a while until it didn't.
Stop allocating an entire shadow copy of the save file whenever we create a new savefile object from file.
Prior commits added the clear SaveFileMetadata class to cleanly track the file path. Backups are copied from the original path.
* Accurately implement height/weight calc
* Handle GUI reads
Having Auto off will read and write the values correctly
F6 will handle all the decimal points possible
* Remove no longer needed tolerance check
Closes#3390
Remove focus from pending edits to the NumericUpDown, and only set scalars if not loading. Fixes switching between entries with pending NUD value changes.
Update 22.02.04
Individual commits from this PR are not cherry-pickable in a vacuum; these were manually re-committed from a staging repo in order to group together changes for general public viewing. There were over 250 commits on the private development repo for this update.
Existing `get`/`set` logic is flawed in that it doesn't work on Big Endian operating systems, and it allocates heap objects when it doesn't need to.
`System.Buffers.Binary.BinaryPrimitives` in the `System.Memory` NuGet package provides both Little Endian and Big Endian methods to read and write data; all the `get`/`set` operations have been reworked to use this new API. This removes the need for PKHeX's manual `BigEndian` class, as all functions are already covered by the BinaryPrimitives API.
The `StringConverter` has now been rewritten to accept a Span to read from & write to, no longer requiring a temporary StringBuilder.
Other Fixes included:
- The Super Training UI for Gen6 has been reworked according to the latest block structure additions.
- Cloning a Stadium2 Save File now works correctly (opening from the Folder browser list).
- Checksum & Sanity properties removed from parent PKM class, and is now implemented via interface.
The RAM is pretty dirty for unallocated poffins; slots that have never been filled will have junk with whatever the unallocated pointer was looking at.
An empty poffin slot is just marked as FF, ignores the stats for that slot. Not sure on the naming, but Matt had a single Level 60 poffin -> must be Mild? Thus, all the names are -1 from the textfile array...
Yay abstractions to hide away the quirks.
BDSP traded eggs set HT_Friendship and the CurrentHandler flag, but the HatchCounter is always the OT_Friendship value.
Trades always receive BaseFriendship, instead of a hardcoded 50. Necessary to not hardcode because it's immutable for eggs.
Clicking the hatch counter label now sets it to the legal minimum hatch counter (best), and control clicking sets it to the max (worst). Check the encounter template for the true maximum.
Big thanks to @SciresM @sora10pls @Lusamine @architdate @ReignOfComputer for testing and contributing code / test cases. Can't add co-authors from the PR menu :(
Builds will fail because azure pipelines not yet updated with net6.
* Providing pkm/sav files via command line (dragging files onto exe / associated file launched) will more intelligently source a partner sav/pkm object if not provided.
* Gen1/2 mainline save files now indicate if they are VC era or GB era (legality implications) in the program title bar.
* Fixes loading VC era save backups not being recognized as VC era (`.bak` extension hides `.dat`)
* Export BAK moved to the SAV tab, which allows Export main to be deleted and Export SAV to be used as the single-click for exporting saves. `CTRL-E` is still the hotkey.
Startup, load gen5 save file.
Immediately load a pk3; met location is converted to Poketransfer
When data is prepared, the validation fails and the selectedvalue is reset to 0
Future selectedvalue sets will work
Just force validation when we change the list, so that future value sets work.
Weird winforms quirk
https://stackoverflow.com/questions/14624129/setting-combobox-droppeddown-false-resets-selected-item