Commit graph

1014 commits

Author SHA1 Message Date
Kurt
812aa0a2d3 ThrowIfNull net7 2023-02-23 01:07:46 -08:00
Kurt
79a05caff5 Accessibility: narrate pictureboxes
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
2023-02-05 00:42:37 -08:00
Kurt
d8b8646de6 Use selectable picturebox
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
2023-02-04 14:52:38 -08:00
frefire
f7179a7713
Gen 5 enhancements. (#3756)
* Gen 5 enhancements:
 -- BW: Dump/import black city/white forest data from each other.
 -- BW: Reset thundurus/tornadus flags so they can be roaming again by visiting the cabin at route 7.
      Reset this flag and switch your BW version with the same save file, you can catch the other pokemon that's limited to a sole version.

* Use work 192, fc5 ext

Adds a translatable message string to indicate the provided input size is incorrect.
2023-02-03 12:44:21 -08:00
Kurt
3d29cc5a19 Misc tweaks
- 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
2023-02-01 16:55:38 -08:00
Kurt
9ecb8981a9 Expose criteria optimization for trade/headbutt
If the criteria template is optimized, we will be able to source moves from sibling game pairs that require indications of it being traded (yay strict logic...)

ex: encgenerator now yields X/Y eggs when ORAS tutors requested in moveset and game is X/Y
2023-01-31 23:23:12 -08:00
Kurt
8537bb56e1 Replace "Set All 6 Stars" with "Copy To Others"
Closes #3727
Hold shift to copy the seed too, otherwise it will keep the existing seed randomness.
2023-01-21 22:02:21 -08:00
Kurt
88830e0d00
Update from .NET Framework 4.6 to .NET 7 (#3729)
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)
2023-01-21 20:02:33 -08:00
Kurt
f5ea250975
Show star square for everything in Gen9 (#3689) 2022-12-18 00:16:29 -08:00
sora10pls
fcff2925f1 Add 7 Star Raid record editor 2022-12-02 22:20:43 -05:00
Kurt
eab43ad59b Remove "None" version from pkmdb/encdb/settings cb 2022-11-27 16:13:31 -08:00
Kurt
c790212291 Add Gen9 to pkmdb generation dropdown 2022-11-27 13:40:25 -08:00
sora10pls
b4253909d7 SV cheat adjustments and additions
Remove story scenario flags from fly loc cheat
Modify shrine work value to lift seals and make sub-legendaries ready to catch
Add cheats to unlock all TM recipes and bike upgrades
Closes #3635
2022-11-25 08:21:10 -05:00
Kurt
719ec1c6cc Add Collect All Stakes (sublegend x4) cheat button 2022-11-24 21:58:47 -08:00
Kurt
7d7d7e91c0 Add gen9 flyto unlock button 2022-11-24 21:25:52 -08:00
Kurt
d8dcdf146c Fix y/z coordinate flipflop
Closes #3631 ty @ih8ih8sn0w !
2022-11-24 19:58:33 -08:00
Kurt
03182ebd3d Update 22.11.24
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>
2022-11-24 17:42:17 -08:00
Kurt
3a085c6607 Show "Add" button next to batch command dropdowns 2022-09-17 02:00:06 -07:00
Kurt
d33b97bf67 Fix direct cast from object(->int)->ushort
https://projectpokemon.org/home/forums/topic/62327-error-occurs-when-trying-to-goto-a-specific-pokemon-through-combo-box-in-pokedex-editor/
ty liopds !
2022-09-17 01:16:11 -07:00
Kurt
787bf1a49b Export csv as unicode instead of UTF8
Better handles corrupt (invalid) chars from nick/OT strings.
https://projectpokemon.org/home/forums/topic/62312-error-occurs-when-trying-to-save-box-data-report-to-a-csv-file-in-gen-7/

Thanks liopds !
2022-09-14 19:34:23 -07:00
Kurt
06196e0440 Minor tweaks
Less alloc
2022-09-04 22:23:35 -07:00
Kurt
a1f3e9b081 Fix database search 2022-09-02 10:29:55 -07:00
Kurt
1960b335fd Remove PersonalInfo.Abilities, use interfaces
If you must get a list of abilities, then use the span extension methods.
Also reworks some initial moveset fetching to allocate less
2022-09-02 10:20:19 -07:00
Kurt
d350bb7fee Misc fixes & pickle updates 2022-08-30 21:15:07 -07:00
Kurt
66e0613d82 Minor clean 2022-08-30 15:00:45 -07:00
Kurt
319a671a6d Simplify munchlax tree list usage 2022-08-29 17:38:27 -07:00
Kurt
d8fe34011d Remove some bounds checks, int->byte form oops
https://github.com/kwsch/PKHeX/pull/3575#issuecomment-1229244453
ty @Kermalis !
2022-08-27 12:53:30 -07:00
Kurt
3c232505e5
Refactoring: Narrow some value types (Species, Move, Form) (#3575)
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".
2022-08-26 23:43:36 -07:00
Kurt
43871e856c Specify some lambdas as static
Rewrite some usages to be more clear
bikeshedding at its finest, ignoring more important things to update/fix :)
2022-08-23 23:11:26 -07:00
Kurt
26b1453002 Narrow ribbon count type from int->byte, split interface
Fix RibbonVerifier4 not checking gen4 contest ribbons correctly
Split IRibbonCommon6 to have memory ribbons separate, as they are not implemented in mystery gifts. Also, we can add the boolean flags to the interface, and check that the boolean is set if count is nonzero.
Fix adding ribbons to Gen8 gift templates
Improve Gen8 template ribbon fetch (no closure, faster IndexOf)
2022-08-23 21:25:22 -07:00
Kurt
6441bdadd8
Add specialized struct for Moveset and IV specs (#3572)
`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.
2022-08-21 17:34:32 -07:00
Kurt
5f341ae1e1 Fix translate dump of mgdb/encdb/pkmdb
EntityInstructionBuilder ctor triggers pkm fetch, which is a null ref on translate dump
Since there's nothing to translate in this user control, just translate before ctor.
2022-08-20 10:43:04 -07:00
Kurt
30f2450a30 Minor clean, xmldoc personal tables 2022-08-11 00:24:25 -07:00
Kurt
f53d468db2 Show complete form name if possible
Get rid of the pk3DS janky form naming :)
2022-08-09 19:16:55 -07:00
Kurt
94668b4672 Fix clearing of clones (off by 1 last box)
Clamp end box in the clear/modify actions too, just in case.
2022-08-05 11:24:54 -07:00
Kurt
ec45ca1a83 Set species flag on ck3/xk3->pk3
Make GetG3Species return ushort

Fixes regression caused by 5942a74147
Copying SpeciesID3 instead of Species is fine as it skips the map/unmap step, but it also skips the setting of the HasSpecies flag. So we'll just set it in the individual ConvertToPK3 methods.
2022-08-04 09:53:15 -07:00
Kurt
9166d0eb64
Refactoring: Move Source (Legality) (#3560)
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
2022-08-03 16:15:27 -07:00
Kurt
240fe8d60f Fix custom event work maximum
Closes #3547

clamp the index, not the value
replaces the combobox with a numericupdown
2022-07-06 11:19:39 -07:00
Kurt
70cab2aea7 Extract batch editor's entity raw value viewer
Add to the advanced tab of all 3 searchers (encdb/mgdb/pkmdb) per #3542
2022-06-27 19:59:36 -07:00
Kurt
12954a6369 Minor perf improvement (spans)
Remove PKM.EVs, do operations without heap allocation
Reduce usage of PKM.IVs/PKM.Moves, reuse spans if possible.
2022-06-25 23:08:28 -07:00
Kurt
fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00
Kurt
54cb4dc8c8 Minor comment fixes 2022-06-07 03:21:04 -07:00
Kurt
ab723af640 Expose Context for SaveFile/ITrainerInfo 2022-06-03 19:08:46 -07:00
Kurt
86814d014d Fix recog of Home fixed PID shinies
Not to be confused with Home fixed PID antishinies
WC8 is the only format to have fixed shinies, but let's copy the logic to WB8 and WA8 if they're ever added in the future.

Fix mgdb display filtering for SWSH & PLA (swapped oops)

Closes #3511
2022-06-02 19:04:27 -07:00
Kurt
5bcccc6d92
HOME 2.0.0: Handle conversion behavior & restrictions (#3506)
* 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.
2022-05-30 21:43:52 -07:00
Kurt
b0c489dd05 Guard against incorrect cgear skin pixel formats
Now shows the appropriate message.
2022-05-30 14:05:06 -07:00
Kurt
30e549faf5 Clamp subway/forest values for numeric control
stop with bad cheats lol
2022-05-27 12:20:49 -07:00
Kurt
d839437037 G5 Entree: Handle out-of-range species IDs 2022-05-16 18:57:58 -07:00
sora10pls
75f9f39cbf Add BDSP Hall of Origin unlock cheat 2022-05-13 17:25:18 -04:00
Kurt
bc054c09ed PK5: Clear party stats on import
Add property get/set for the undocumented fields
2022-05-08 18:36:18 -07:00