Commit graph

457 commits

Author SHA1 Message Date
Kurt
0ffb256052 Add slot source legality checks
Useful for save files with misplaced data (you really have to be using the program weirdly to get these flagged).
Stuff like Eggs deposited in Daycare, non-fuseable species in the Fused slots, etc.

Allow HaX to view any slot, & Delete if Set is allowed
2024-06-15 00:14:49 -05:00
Kurt
84d42807e0 Simplify discards on gui event methods 2024-06-08 01:34:32 -05:00
Kurt
093fca37ec Add enum to GUI translatable list
Improve perf of GUI scrape by only making forms once, don't fully set up Main
Add method to get a list of translated Enum names
Adds translatability for size markings
Closes #4266
2024-06-03 19:37:57 -05:00
Kurt
2d0d0236e3 Handle more RTC footer types
BizHawk Gambatte stores a 0x16 byte footer, but the correlation previously used isn't always true.
Just implement a generic detector that allows for a reasonably sized footer for the Gen1-3 formats.
2024-06-02 12:22:27 -05:00
Kurt
7d05e12c7f Misc tweaks
Fix pk6/7 pkmeditor export, now retaining status condition instead of wiping it
Abstract b2w2 key system to a save block; better documentation on its odd mechanics
Allow gen1-3 filename language/ver detect to work if the filename is ` `->`_` (discord attachments changing spaces to underscores); also revise canadian French emerald filename pattern
others: negligible perf/using standard library functions
2024-06-01 17:44:32 -05:00
Kurt
b7298a7361 Auto-clean save file names of duplicate suffixes
`main (17)` now backs up as `main [...].bak` instead of `main (17) [...]`
Adds a debug-callable method to clean the main backup folder via:
`CleanBackups(Main.BackupPath, true);`
2024-05-27 19:23:56 -05:00
Kurt
410be93358 Add opt-in boxdata dragdrop toggle
Can drag from the Box tab into another window or folder to copy the entire box's contents.
Closes #3933
2024-05-10 22:36:46 -05:00
Kurt
dcb23c7981 Allow adding/hiding extra properties in Report grid
#3933 3.
top level settings for Report

1. was already implemented with the file namer settings on dump

not sure how I want to do dragdrop-multi, but I did recently add a record type for `ConcatenatedEntitySet`...
2024-05-10 19:32:28 -05:00
Kurt
0f4024952e Minor clean
indexof -> contains
trailing space
some variable reuse
pcdata/boxdata less janky handling
2024-05-01 00:49:43 -05:00
Kurt
bb6e45db60 Refactor out legality settings, add more settings
Extract PP verifier
Add disabling of wordfilter for formats < 6
Add context-specific bypasses for nickname/handler checks
2024-04-26 14:33:03 -05:00
Kurt
9ff94455b9 Add setting to retain met date on 4->5 transfer 2024-04-24 02:11:14 -05:00
Kurt
1b294f7c97
Refactor: Split Gen1/2 string & pokelist conversion methods (#4251)
* Split Gen1/2 string & pokelist conversion methods

* Refactor pokelist to direct read/write, skip on save if blanked

* Add settings editor for SaveLanguage overrides
2024-04-22 14:42:22 -06:00
Kurt
a71d74b1ea Split gen3 memorycard into subfolder 2024-03-30 01:17:18 -05:00
Kurt
95eb008125 Misc tweaks
no functional change
2024-03-20 09:42:28 -05:00
Kurt
dca76f50f7 Catch more uninitialized file call stack paths
Closes #4223
2024-03-18 19:05:22 -05:00
Kurt
fa80dac2ac
Refactoring: Rework saveblock to be Memory<byte> based (#4200) 2024-03-03 23:13:16 -06:00
Kurt
4f568b1497 Add slot-set Count update bypass setting 2024-02-23 13:20:59 -06:00
Kurt
95fbf66a6e
Refactor: Gen3/4 Lead Encounters, property fixing (#4193)
In addition to the Method 1 (and other sibling PIDIV types) correlation, an encounter can only be triggered if the calls prior land on the Method {1} seed. The RNG community has dubbed these patterns as "Method J" (D/P/Pt), "Method K" (HG/SS), and "Method H" (Gen3, coined by yours truly). The basic gist of these is that they are pre-requisites, like the Shadow locks of Colosseum/XD. 

Rename/re-type a bunch of properties to get the codebase more in line with correct property names & more obvious underlying types.
2024-02-22 21:20:54 -06:00
Kurt
a93a626dad Add dialog message for empty/FF save files
Users incapable of saving in-game and using save states instead, or emulators not flushing save data on in-game save.
2024-02-11 21:55:37 -06:00
Kurt
d7473db6af Add plugin stub for notifying GUI language change 2024-01-08 19:56:04 -08:00
Kurt
a4ac8240b8 Allow replacing VC1/2 default transfer version
Exposed via settings
Conversion settings relocated from Advanced; `AllowIncompatibleConversion` will need to be re-set if you want to deviate from official rules.
2024-01-04 19:57:01 -08:00
Kurt
d25fab0e87 Change box dump to use a form
Closes #4122
2023-12-30 14:36:33 -08:00
Jonathan Herbert
07cd05d1c1
Fix Some Missed Conversions To Collection Expressions (#4096) 2023-12-17 16:38:53 -08:00
Kurt
d47bb1d297
Update .NET Runtime to .NET 8.0 (#4082)
With the new version of Visual Studio bringing C# 12, we can revise our logic for better readability as well as use new methods/APIs introduced in the .NET 8.0 BCL.
2023-12-03 20:13:20 -08:00
Kurt
c505b5a49d
Enhanced Slot Hover Preview (#4059)
Adds a new primary Hover Preview tooltip form. Users can change setting to use the old tooltip if they want.

When the user hovers over a slot in their Box / Party, PKHeX displays a tooltip indicating details about the Pokémon. This text tooltip shows the Showdown text (with some localization based on program setting), and includes details about the encounter the legality check matched it to.
2023-11-14 19:36:11 -08:00
BlackShark
cfadf86d27
Load plugins before initial files (#4020) 2023-09-28 07:04:12 -07:00
Kurt
18fd790657 Minor perf tweaks
Relocate checksum adders to Checksums class, improve performance by eliminating slice calls
Improve HOME sharing for GO8 and IMoveset encounters: actually sanity check GO8, and skip other non-PK7/PB7 cases.
2023-07-15 11:22:48 -07:00
Kurt
ee9ae63c22 Misc tweaks
Move enum -> ushort instead of int
Redo handling of HOME Volt Tackle (disallow on SWSH Cap Pikachu)
Pass spans instead of strings to use span methods
Reset encounter filters on early abort
2023-07-13 22:18:34 -07:00
Kurt
41762f4f67 Make Dpi scaling the default
Have settings toggle to fall back to Font based scaling
2023-05-09 10:50:15 -07:00
Kurt
f9ac5eae15 Pass box-to-show to ResetBoxNames
Previous commit changed the behavior to not check SaveFile's CurrentBox, only keep current index. If we want a specific index (like a new SaveFile's latest box), we must pass it.
2023-05-06 19:42:48 -07:00
Kurt
68c94a93b2
Make all AutoScaleMode.Inherit (#3874)
Also changes the Main form from Dpi to Font

Attempt to resolve:
https://projectpokemon.org/home/forums/topic/63374-text-sizing-with-windows-settings-ease-of-access-make-text-bigger/
2023-05-03 21:45:58 -07:00
Kurt
3285ecada9 Add MemoryCard detection as latest sav, pkmdb 2023-05-01 16:51:17 -07:00
Lusamine
62597d17e1 Update Designer automatic code generation 2023-04-21 23:29:50 -05:00
Kurt
c73264d4f3 Minor minor perf
Small changes to reduce some allocations
2023-04-15 01:58:37 -07:00
Kurt
3871b2f316 Add focus border setting
Can set to -1 to remove it
2023-02-06 18:11:30 -08:00
Kurt
dde075432b More accessibility tweaks
#3758
2023-02-05 15:00:31 -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
Kurt
60a53b6afa Skip closing other-thread popups on sav load
Plugins may have popups that were created on another thread as diagnostic messages; by trying to close these on our main GUI thread, the program crashes.

Just leave these other-thread forms open when we change save files instead of crashing or closing them on their proper thread.
2023-02-03 12:52:52 -08:00
Kurt
81487af9ba Revise update linklabel click
https://stackoverflow.com/a/53245993
2023-01-30 18:51:17 -08:00
Kurt
93c4abbbd5 Misc tweaks
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
2023-01-28 19:23:43 -08:00
Kurt
6a09311394 Use generated json serializer
Generated (de)serializer faster!
Shaves off a few non-trivial ms for startup
2023-01-23 23:31:41 -08:00
Kurt
146dbad387 More fixes
pk3->pk4 trash length copy
cross-thread main preview dragdrop (continue from same GUI thread)
rearrange csproj again, seems like SelfContained needs to go after the Publish content.
2023-01-22 11:43:13 -08:00
Kurt
1baba56a4f File scoped namespace program.cs
Also trim the Version for parsing
2023-01-21 23:32:18 -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
c5908b2b97 Disassociate metadata's SAV reference from clone
Necessary for gen3 manual overrides; the fetched properties for Metadata should refer to the cloned data that it is using, not the original reference.

Closes #3582
2022-09-11 09:59:00 -07:00
Kurt
66e0613d82 Minor clean 2022-08-30 15:00:45 -07:00
Kurt
59fad0e8cf Minor tweaks
Extract some logic (origin markings)
Revise directives for NET7 targeting, remove old net5 refs
2022-08-05 16:18:42 -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
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