Commit graph

2296 commits

Author SHA1 Message Date
Kurt
c3e51d414d Add click event for affixing ribbons easier
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.
2023-04-01 17:23:04 -07:00
Kurt
3b54ac6ecc Show affixedribbon next to markings
new Visual Studio version made my designer code ugly
maybe I should refactor the GUI like they recommend :P
2023-04-01 16:52:12 -07:00
Kurt
0d3bbe15b7 Add lechonk wc9 to pickle 2023-04-01 15:20:14 -07:00
Kurt
4384cadefc Add more xmldoc 2023-03-31 13:00:34 -07:00
sora10pls
bd05da2b94 Revise SV stake collection cheat
Chains in front of the ruins are now removed when activating the cheat
Also reorder and label more blocks
2023-03-28 18:25:56 -04:00
sora10pls
6b5d4ec3ea Add, label, and reorder more SV save blocks
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2023-03-28 16:01:21 -04:00
Kurt
79ca670044 Replace party/boxdata get with more performant use
Read directly from the save file.
Batch Editor no longer updates dex, HT details, or updates acquired counts when placing back in the SAV.
2023-03-28 12:49:21 -07:00
Kurt
5c13183d02 Less allocation, minor tweaks
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.
2023-03-27 00:11:42 -07:00
Kurt
82309cf99d Use Memory<byte> for Gen4 saves
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.
2023-03-26 15:16:12 -07:00
Kurt
aa13c93e65 Add misc generic constraints
Resolves some allocation analyzer issues
2023-03-25 23:28:28 -07:00
Kurt
0087ccb44f Use span for savefile slot API
No more offset fetch
2023-03-25 23:14:50 -07:00
Kurt
5ce3e734b8
Skip initial cctor alloc on non-byte primitives (#3850)
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.
2023-03-25 17:55:55 -07:00
Kurt
4615e3577a Span-ify MoveSetApplicator 2023-03-21 21:02:13 -07:00
Manu
f611c4a728
Update Italian translation (#3845) 2023-03-20 07:13:05 -07:00
javierhimura
7af65a4683
Filter Block Dump data (#3840)
* Allow the filter results in BlockDump combobox. Write a text in the dropdown
2023-03-19 12:33:12 -07:00
javierhimura
66d897c41a
ResetBoxNames in UpdateBoxViewers (#3839) 2023-03-19 10:33:55 -07:00
Kurt
662cc99141 Rework mail slot swapping
Closes #3831
2023-03-10 19:49:35 -08:00
BlackShark
cb0ef52676
Minor UI fixes (#3823)
* Resized SettingsEditor

* Fixed mislabeled Gen 3 MiscEditor
2023-03-03 00:52:19 -08:00
Kurt
57d32456f6 Update 23.02.27 2023-02-27 19:21:56 -08:00
Eelen
353ca40f42
Update CHS Translations (#3802)
Co-authored-by: wu professor <103500840+wubinwww@users.noreply.github.com>
2023-02-27 18:15:13 -08:00
Manu
8de4b8b90f
Update Italian translation for Copy Raid button (#3814) 2023-02-27 05:52:18 -08:00
Kurt
7b93491025 Tab separated country/region tables
https://github.com/kwsch/PKHeX/pull/3810#issuecomment-1445519631

SuggestAppend for gen4/5 trainer country/region editor
Add country:0 for 3DS locale for consistency
Use — for "None"
2023-02-26 17:41:22 -08:00
abcboy101
30aa1cc9aa
Add Geonet location editing for Gen 4/5 (#3810)
* Add Geonet location to SAV4 and SAV5

* Allow commas to be escaped in subregion names

* Add missing 3DS subregions

* Add Geonet location editing

* Ensure null values are kept as the first option in GetCountryRegionList

* Add Geonet locations in CHS/CHT
2023-02-26 16:33:53 -08:00
Lusamine
0fa4ec8dce Fully update button naming/localization for propagating SV raids
Standardizes capitalization of "raid" in the editor and updates
shortcuts to indicate holding Shift to propagate seed.

Closes #3807
2023-02-23 11:08:33 -06:00
Kurt
812aa0a2d3 ThrowIfNull net7 2023-02-23 01:07:46 -08:00
Eelen
92b841881d
Update CHS translations (#3776)
Co-authored-by: wu professor <103500840+wubinwww@users.noreply.github.com>
2023-02-12 11:16:56 -08:00
Kurt
39a7007541 Extract Bulk Analysis components 2023-02-08 17:24:47 -08:00
Kurt
b8b499a797 +1char lgpe CP textbox
Now 5 digits visible.
2023-02-07 21:52:31 -08:00
Kurt
3871b2f316 Add focus border setting
Can set to -1 to remove it
2023-02-06 18:11:30 -08:00
Lusamine
8f64f719ad Update shiny stars to modern game icon
This swaps the old red star to a red two-star icon from Switch games.
Improves visibility of the square shiny icon (red/white stars).

Closes #3749
2023-02-06 18:54:40 -06:00
Kurt
163ffac671 Fix gender GUI click event double toggle
Private event already toggles it
2023-02-06 09:05:34 -08:00
Kurt
dde075432b More accessibility tweaks
#3758
2023-02-05 15:00:31 -08:00
Eelen
e77244957d
Update CHS translations (#3765)
-Update flags_bw_zh.txt
-Update flags_oras_zh.txt
* Fix CHS translation errors
* Update lang_zh.txt
* Update CHS translations
-Update flags_b2w2_zh.txt

Co-authored-by: wu professor <103500840+wubinwww@users.noreply.github.com>
2023-02-05 11:46:16 -08:00
Kurt
839433792d Tweak gender accessibility
#3758
2023-02-05 11:31:12 -08:00
Kurt
3d7bfcfe11 Revise some GUI interactions, accessibility
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.
2023-02-05 11:18:05 -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
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
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
39fe454840 Revise natureamp clicks
now behaves correctly without off-by-1 behavior
2023-01-31 18:31:40 -08:00
Kurt
81487af9ba Revise update linklabel click
https://stackoverflow.com/a/53245993
2023-01-30 18:51:17 -08:00
Manu
0dc9deb137
Fix PKMEditor sidebar scaling (#3752)
Closes #3750
2023-01-30 10:22:02 -08:00
Kurt
5265643f3e Update 23.01.30 2023-01-29 23:39:42 -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
fi
24c9c388b0
Corrected incorrect Japanese translation (#3740)
A sentence that was incorrect as a Japanese translation has been corrected.
2023-01-27 09:20:42 -08:00
Kurt
3572097c96 Update 23.01.26
Hello .NET 7
2023-01-26 21:58:04 -08:00
Uiharu
0e897dc1f1
Update CHT and Japanese translations (#3738)
Update CHT and Japanese translations.
2023-01-26 19:03:28 -08:00
Manu
1205a2c0ae
update italian translation (#3737) 2023-01-26 19:03:19 -08:00
Kurt
5aca291a7a Update translatables via devutil dump 2023-01-25 20:36:47 -08:00
Uiharu
3cbd662ade
Remove the useless blank line in text_Natures_zh2.txt (#3736)
* Remove the useless blank line in text_Natures_zh2.txt

Remove the useless blank line to fix the Natures drop-down selection menu issue, which may be introduced from the last modification.

* Update some translation texts for better display

Update some translation texts for better display.
2023-01-25 19:29:35 -08:00
Easy World
c8e0d1d012
Translation revise (#3735) 2023-01-25 19:29:27 -08:00
Kurt
1c626ca412 Tweak tab order 2023-01-24 23:45:09 -08:00
Kurt
a804ca95c7 Misc gui tweaks 2023-01-24 20:10:08 -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
Manu
c5a9f0d6e3
update italian translation (#3734)
* it text updates

* update italian translation

* mistakenly renamed string in fr file
2023-01-23 10:48:19 -08:00
Uiharu
b47dd9c877
Update CHT translation (#3732) 2023-01-22 22:16:32 -08:00
BlackShark
38daf0975e
Updated German translation (#3731)
* Updated German language files

* More German translations
2023-01-22 14:58:04 -08:00
Kurt
71eeb7072b Fix gen4 set all TMHM bits
oops
make other personalinfo consistent
show legality triangles if previous parse failed (oops)
2023-01-22 14:55:35 -08:00
Easy World
f96de7d38c
i18n resource update (#3730)
* i18n resource update

* add chs and cht translation
* add other languages placeholders

Co-authored-by: Eelen <37260264+ppllouf@users.noreply.github.com>
2023-01-22 13:05:17 -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
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
0b5824321b Disable selfcontained for debug builds too
Cleaner folder.
2023-01-21 22:02:05 -08:00
Kurt
7b910504ce Use Current Level instead of Stat Level for pk1/2
Closes #3704
all other impl of LoadStats get CurrentLevel
2023-01-21 22:01:30 -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
Easy World
d4af464109
Translation tweak (#3717)
* Translation tweak

* add Main.B_RaidsSevenStar translation in 9 languages
* modify Main.B_Raids translation in chs and cht
* remove redundant Rotom form translation

* Add SAV_RaidSevenStar9 translation

Add SAV_RaidSevenStar9 language resources
2023-01-05 08:25:41 -08:00
Kurt
f5ea250975
Show star square for everything in Gen9 (#3689) 2022-12-18 00:16:29 -08:00
Kurt
1e086798fb Update 22.12.18 2022-12-18 00:06:04 -08:00
Kurt
d9982bcd47 Reset Version to 0 if SV IsEgg 2022-12-17 14:42:41 -08:00
Kurt
ee9f8f0558 Allow click correcting Gender icon 2022-12-17 14:04:22 -08:00
Kurt
1de869f541 Flag pp ups on non-PP up move IDs
Previous logic wouldn't flag "None" move w/ ppup>0
Also now flags sketch & revival blessing.
2022-12-17 13:29:06 -08:00
Kurt
ae2d13432b Aggressively hide formarg label on format change 2022-12-17 13:04:37 -08:00
sora10pls
715391e3b0 Hide 7 Star Raid editor on non-SAV9SV 2022-12-09 19:08:26 -05:00
Yarkis
5b1daaea33
Improvement of the French translation (#3677)
* Fixed some translation issues

* Update lang_fr.txt
2022-12-08 23:13:51 -08:00
dependabot[bot]
4cb4c1ab9b
Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /PKHeX.WinForms (#3679)
Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.2)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 20:46:30 -08:00
Kurt
72877b7f0c More fallback behavior for Met list population
Should probably rewrite this into an API that isn't so janky.

Closes #3669
2022-12-05 19:02:43 -08:00
Kurt
50e7e3204c Show egg TID format based on SAV, egg met list=sav
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.
2022-12-03 21:00:25 -08:00
sora10pls
fcff2925f1 Add 7 Star Raid record editor 2022-12-02 22:20:43 -05:00
Kurt
2e67526db1 Update 22.12.01 2022-12-01 22:40:11 -08:00
Easy World
aab554d1b6
add missing language resources (#3663) 2022-11-28 09:36:08 -08: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
Yarkis
ce0251004f
Improvement of the French translation (#3658)
* Update lang_fr.txt

* Update LegalityCheckStrings_fr.txt

* Update MessageStrings_fr.txt

* Update lang_fr.txt
2022-11-27 10:56:41 -08:00
Easy World
d22d5786a1
More translations (#3654) 2022-11-27 10:56:31 -08:00
Kurt
48ac105032 Update 22.11.26 2022-11-26 17:52:27 -08:00
Kurt
aecdb5c7f6 Show "Form Argument:" text label when formarg only
Rather than just an unlabeled NumericUpDown.

The table layout panel will hide the second label if Form+ComboBox is already showing.
2022-11-26 14:40:31 -08:00
Egzon
2757985d53
Update spanish translation (#3642)
* Update lang_es.txt

* Update lang_es.txt

* Update LegalityCheckStrings_es.txt

* Update LegalityCheckStrings_es.txt

* Update MessageStrings_es.txt

* Update LegalityCheckStrings_es.txt

* Update LegalityCheckStrings_es.txt

* Update LegalityCheckStrings_es.txt

* Update lang_es.txt

* Update lang_es.txt

* Update LegalityCheckStrings_es.txt

* Update lang_es.txt

* Update LegalityCheckStrings_es.txt
2022-11-25 14:57:17 -08:00
Uiharu
608e8c86d2
Update CHT translations of SV for PKHeX (#3638)
* Update CHT translations of SV for PKHeX

Update Traditional Chinese translations of SV for PKHeX.

* Remove useless blank line

Remove useless blank line.

* Minor tweak for GUI translations

Minor tweak for GUI translations.

* Minor tweak for GUI translations

Minor tweak for GUI translations.
2022-11-25 06:52:10 -08:00
Manu
e033205f29
Update Italian translation (#3636)
* Update Italian translation

* Translation for PLA dex task button
2022-11-25 06:50:41 -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
Easy World
f8b15846d7
Update lang_zh.txt (#3633)
Minor tweak
2022-11-24 23:12:43 -08: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
Easy World
f2ccf48318
Update Chinese translation (#3627) 2022-11-24 20:25:07 -08:00
Kurt
490a865e66 Regenerate localizations, remove System.String 2022-11-24 20:06:46 -08:00
Kurt
9131febef0 Remove incorrect line start for translation files 2022-11-24 20:03:05 -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
d012134d23 Improve display precision of size floats
Use the Round-trip format when converting to string.
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#RFormatString

The default behavior in net4.~ ToString doesn't use "R", hence me assuming F6 would be sufficient, but it does not display as a round-trip value.

netcore3+ changed the default behavior and aligned it with standards ~ https://devblogs.microsoft.com/dotnet/floating-point-parsing-and-formatting-improvements-in-net-core-3-0/

now, both net461 and net6 builds display the same values. Doesn't resolve the mono issue where legality check flags calc != stored.
2022-10-16 18:36:33 -07:00
Kurt
ba53f4a7bc Extract common csproj properties 2022-10-15 17:09:54 -07:00
Kitcham
d9b4a0c771
Fix 3DS-Region Display Bug in CHT GUI (#3599)
Fix 3DS region display bug in zh-HK traditional Chinese. Corresponding  3DSLocale text was omitted in previous commits.
Improve some expressions in zh-HK README + traditional Chinese GUI.
2022-10-05 06:05:26 -07:00
Kitcham
d70794668f
Add Traditional Chinese Support for PKHeX (#3597)
Add zh-HK README translation for README. It was wrote in Traditional Chinese Hong Kong style.

Add Traditional Chinese translation resource and make PKHeX support for tradition Chinese.
2022-10-02 13:15:58 -07:00
Kurt
f1dcc33168 Update movepp sig to use ushort 2022-09-18 23:06:02 -07: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
d8923fe3fb Keep GroupViewer in front when popped up
Closes #3588
2022-09-15 17:37:23 -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
5875d76468 Update 22.09.13 2022-09-12 23:55:30 -07: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
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
71e08222cf Update 22.08.31 2022-08-30 22:49:54 -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
d3c2d77d11 Misc move/memory tweaks
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)
2022-08-24 20:32:40 -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
eb2cef10c9 Minor clean
Stability intensifies
2022-08-22 23:18:53 -07:00
Kurt
553e9ac1b3 Disable events when loading ordered moves
Closes #3573
2022-08-21 20:45:35 -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
2cb2531288 Add more xmldoc 2022-08-21 01:39:16 -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
3dde8a7cfa Reduce linq usage, minor perf 2022-08-17 23:48:37 -07:00
Kurt
23d726e69a Add ShowLegalBallsFirst setting (default true)
Shows the legal (green background) balls before illegal (red background) balls.
Little easier than hunting around for the green background balls :)
2022-08-16 17:16:39 -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
berichan
ef0b3f9607
Prompt user for clipboard directory use if present for box dump/save (#3566) 2022-08-09 18:03:00 -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
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
BlackShark
7e7b2bb2d3
Improved IsOldPkhexCorePresent (#3541) 2022-06-27 22:32:03 -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
54a7966c75 Update 22.06.26
Split the 2020 changelog out of the release binary; archived for posterity.
2022-06-26 22:18:19 -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
d8c8a13885 Add bizhawk footer handler
Optimize some of the other handlers.
2022-06-25 11:14:00 -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
BlackShark
600c8f704f
Updated German translation (#3521)
* Updated German translation

* More translations

* And more

* Use correct language specific links in readmes
2022-06-12 15:29:04 -07:00
Kurt
f5bc23d8af Enhance setting suggested handling trainer via GUI 2022-06-12 09:18:55 -07:00
Kurt
c1eb70f57c Handle non-.NET assemblies in dll plugins
Trycatch situations where people put libz3.dll in the plugins folder.
2022-06-11 17:06:57 -07:00
Kurt
436588eb10 Replace é->e for code symbols
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.
2022-06-11 15:32:12 -07:00
Kurt
15a84d9d7e Minor clean 2022-06-11 09:51:43 -07:00
Kurt
b01ec96ac8 Dispose of discarded slots when adding new 2022-06-11 09:37:44 -07:00
Kurt
c75f543f8b Minor tweaks 2022-06-07 23:32:57 -07:00
Kurt
8c528855f4 Differentiate dragged PK8/PB8 better w/preferences
Better determine preference with file extension string
2022-06-07 03:33:45 -07:00
Kurt
54cb4dc8c8 Minor comment fixes 2022-06-07 03:21:04 -07:00
Kurt
428ce52c27 Add Current Handler checks & toggles
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.
2022-06-05 13:18:31 -07:00
Kurt
893b5d5293 Revise more PB7/PK8->Interface type checks 2022-06-04 21:03:25 -07:00
Kurt
1b70fb7053 Recalc h/w for PA8
Already did for PB7
2022-06-04 20:29:28 -07:00
Kurt
2cfccb8caf Load indexes with clamped minmax
Bad DynamaxLevel values no longer throw an exception, and just clamp back to the normal range.
2022-06-04 20:21:36 -07:00
Kurt
382ea5cd61 Extract move info api 2022-06-04 13:14:50 -07:00
Manu
7ae4e0769b
Translated MessageStrings_it.txt, text_ItemsG2_it.txt and some tweaks (#3514)
* Added Gen2 italian items text

* Italian translation text_ItemsG2_it.txt

* Translated MessageStrings_it.txt and improved some other italian messages/strings for better comprehension.

* Some tweaks
2022-06-04 01:00:33 -07:00
Kurt
db03a77c55 Refactor Marking access 2022-06-04 00:59:52 -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
48ace3ca49 Update translatables 2022-06-01 21:58:56 -07:00
Kurt
f2356f1865 Update 22.06.01 2022-06-01 21:27:54 -07:00
Manu
2f44d7486f
Italian translation for lang_it.txt and LegalityCheckStrings_it.txt (#3508)
* Italian translation for lang_it.txt and LegalityCheckStrings_it.txt

* Readme update

* Update README-it.md
2022-06-01 11:51:08 -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
5ae34854c7 Fix extrabyte load behavior
funny how nobody caught this for so long haha
Don't trigger a write on validation/during a load.
2022-05-30 18:17:12 -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
Kurt
25be6f77ab Remove HaX altering Stat_Level
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
2022-05-14 15:20:43 -07:00
Kurt
df2bbbeed5 Pixel alignment for pkm editor
Relearn Moves shifted down by 1px to match Moves
Relearn Moves groupbox shiftedto align with Moves
HT groupbox height +1px to match OT groupbox
2022-05-14 08:39:47 -07:00
sora10pls
75f9f39cbf Add BDSP Hall of Origin unlock cheat 2022-05-13 17:25:18 -04:00
Kurt
e741d34a44 Initialize gender sprite on component init 2022-05-13 12:03:00 -07: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
Kurt
781fa5c706 Change main window dragdrop behavior (move->copy)
Now allows dragging from box/party/etc into main window again
Use the ctrl hotkeys u keyboard-lackers
2022-05-08 13:01:08 -07:00
Kurt
8c4db878dd Extract logic to set initial mastery move flags
Are we done yet
2022-05-08 10:28:22 -07:00
Kurt
95054f0054 Clamp too-high numeric values from cheats
Closes #3493
2022-05-08 09:28:41 -07:00
Kurt
82fae7b350 Revise moveshop move suggest methods 2022-05-07 21:21:29 -07:00
Kurt
e34d03d2e5 Update 22.05.08 2022-05-07 14:30:16 -07:00
Kurt
178069f889 Minor tweaks 2022-05-07 11:47:01 -07:00
Kurt
6e13031217 Add cancellationtoken to cancel long searches
Close the window if you accidentally search all, and the program will stop searching rather than continue running in the background.
2022-05-07 09:25:59 -07:00
Kurt
a57f40ae7d Break up PKX into separate classes
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).
2022-05-06 20:38:55 -07:00
Kurt
59ceec3c65 Extract EffortValues class, add $rand + $suggest
Renames IV/EV verifier field objects for Legality Checks due to class name clashing.
2022-05-06 15:47:54 -07:00
Kurt
be9c947dd6 Use tuples and ComboItem, not anonymous class
Little more explicit
2022-05-06 15:43:51 -07:00
Kurt
75874b6b81 Show lock capsule slot in mystery gift editor
Closes #3487

editor getting hacky, but it works
2022-05-05 21:21:03 -07:00
Kurt
703a641b4a Show + retain free space sorting index: gen7 items
Closes #3485

PKHeX has ignored gen7 free space since the initial implementation, if I recall correctly -- no more :)
2022-05-03 16:28:07 -07:00
Kurt
7c8f52cbbf Minor clean
invert nesting, add missing if( space, group OT checks together
2022-05-02 23:48:25 -07:00
Kurt
41578132cf Minor tweaks
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
2022-05-02 18:11:31 -07:00
Kurt
af141581ee Minor tweaks
Single underscore discards (one of the c# language revisions allowed reusing the single underscore discard).
Remove a temporary allocation in BDSP flag editor
2022-04-26 19:48:09 -07:00
Kurt
5be9863ef4 Sanitize gender on species/form change
clean up some if expressions
2022-04-25 17:30:16 -07:00
Kurt
ecee948107 Add gender sprites for main GUI
Might trickle this out to the other editors that have gender toggles.
2022-04-24 20:28:56 -07:00
Kurt
1f49574be1 Fix g6 hof len 2022-04-23 22:05:51 -07:00
Kurt
f5358e0e37 Update HoF6 entity editing
Reusable entity struct, no more overlapping fields
Adds OT Gender, fixes some flags.

Thanks L1nk2futr3 !
https://projectpokemon.org/home/forums/topic/60977-hall-of-fame-tid-resetting-gen-6/?do=findComment&comment=275575
2022-04-23 10:42:56 -07:00
Kurt
a6561a91b1 Add clone deletion in savefile from pkmdb 2022-04-19 16:33:11 -07:00
Kurt
a61d8d1efc Extract IMultiplayerSprite from SaveFile
only used by gen6 saves
2022-04-15 14:58:40 -07:00
Kurt
a681783f1a Extract interface for SaveBlock, allow strict
External users shouldn't be using SaveBlock
2022-04-15 11:45:04 -07:00
Kurt
841fcde2b2 Enhance Pokerus api functions
Fixes #3480 ; (0,0) is a valid state regardless of format.
2022-04-14 14:05:32 -07:00
CanoeHope
cf901861e7
Update Shortcuts and Legality texts (#3477)
* Update LegalityCheckStrings_en.txt

* Update LegalityCheckStrings_de.txt

* Update LegalityCheckStrings_es.txt

* Update LegalityCheckStrings_fr.txt

* Update LegalityCheckStrings_it.txt

* Update shortcuts.txt
2022-04-11 15:09:42 -07:00
Kurt
a85737b8f6 Fix event flag row click set 2022-04-11 14:49:06 -07:00