Commit graph

401 commits

Author SHA1 Message Date
Kurt
0389624508 Extract unnecessary stringbuilding from pkmconvert 2022-04-09 11:58:52 -07:00
Kurt
e6cf5d0baf Split PKMConverter into multiple classes
EntityFormat -> detects byte[] -> ctor() PKM
EntityConverter -> converts between pkm formats
RecentTrainerCache -> used by other classes (not within EntityConverter!)
EntityBlank -> creates blank PKM objects indirectly
2022-04-09 01:39:34 -07:00
Kurt
60de53063a Minor tweaks
Extract some logic
2022-03-26 15:51:12 -07:00
Kurt
51f2fe35a4 Trycatch backup file creation
Stop putting PKHeX in Program Files ya goofballs
2022-03-25 19:25:07 -07:00
Kurt
d02537f16e Make dragdrop work with exporting to discord
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.
2022-03-22 23:02:46 -07:00
Kurt
ae74ee7931 Minor tweaks
Translation util only for debug build (unused in release)
Simplify some plugin load expressions
2022-02-26 21:45:31 -08:00
Kurt
bc2549b24e
Minimize BAK file allocations (#3426)
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.
2022-02-09 16:48:55 -08:00
Kurt
e5c6b769b7 Fix update check for slower startups
Closes #3424
2022-02-09 10:47:07 -08:00
Kurt
ea327a5c03
Add all circle Pokémon images; add setting for sprite preference (#3402)
* Add sprite builder toggling for forced-circle sprites

* Add assets for all LA Pokémon sprites

Co-authored-by: sora10pls <17801814+sora10pls@users.noreply.github.com>
2022-02-05 14:54:01 -08:00
Kurt
18ecad9743 Update program GUI abstractions
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
2022-02-04 17:36:51 -08:00
Kurt
36bf73818e Source trainers for encounter database
Closes #3364
Related: #3358
2022-01-03 19:33:10 -08:00
Kurt
4b8adfe28d Bump winforms proj c# lang to 10
no functional change
2022-01-02 15:04:16 -08:00
Kurt
cc8ac7a4f1 Remove unnecessary warning suppression
fixed dat .editorconfig in vs22
Catching general exceptions is okay because this program handles user modified data that can potentially be corrupt.
2021-12-27 12:09:15 -08:00
Kurt
c7de0154e3 Handle net6 warnings for nullability 2021-12-04 22:29:51 -08:00
Kurt
bc809af06c Split PKHeX.Drawing into subprojects
Allows trimmed dll usage by keeping pkm sprites in one project, and all other cosmetic UI stuff in another project
2021-11-27 15:48:08 -08:00
Kurt
b5b57ffa90 Update PluginLoader.cs 2021-11-27 13:54:38 -08:00
Kurt
723514e89c
Update 21.11.19 - Brilliant Diamond & Shining Pearl (#3289)
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.
2021-11-19 18:23:49 -08:00
Kurt
3f44acf813 Don't show blank popup when saying No on group import
ty anubis
2021-10-31 12:20:19 -07:00
TcavemanT
135610124a
Added a tooltip to the legal PictureBox to better help new users. (#3280) 2021-10-30 22:04:44 -07:00
Kurt
009e37662f
Startup Enhancements, Gen1/2 Save Indication, Export SAV cleaned up (#3275)
* 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.
2021-10-21 22:13:21 -07:00
berichan
cc2f195359
Add load plugin method setting (#3263)
* Add load plugin method setting

* Remove static settings dependency, change compiler-time functions to enum-switch
2021-10-06 14:48:17 -07:00
Kurt
d2d71494e3 Update debug logging for plugin fails 2021-09-16 17:04:34 -07:00
Kurt
de2d3a43be Add toggleable setting for encounter background types
Fine archit and matt, have it whichever way you want :)
2021-08-24 19:52:06 -07:00
Kurt
a121f4d617 Add optional box slot coloring, add settings 2021-08-24 14:21:35 -07:00
Kurt
bedc52943e Trailing commas
No functional change
2021-08-20 13:49:20 -07:00
Kurt
44589e6fbb Minor tweaks
use switch expr for auto-backup load
trycatch plugin activator (just in case)
extract dialog prompt for easier reading
remove dead method
2021-08-13 15:37:21 -07:00
Kurt
59d480c834 Minor tweaks
Discard empty pkm files (species 0) when loading boxes or templates
Add more xmldoc
Simplify some method parameter names for readability
2021-08-05 17:05:39 -07:00
Kurt
4ec60916c1 Minor refactoring for pkmeditor GUI
Cleans up some interactions to be a little more obvious
2021-07-30 18:05:17 -07:00
Kurt
8e5e4487ba Change interface for method call to less restricted
Don't need "Name" or "LongName" for these methods.
2021-07-13 18:22:04 -07:00
Kurt
3fa311f6ed Misc tweaks
more annotations - all bool->out ? are annotated now
fix gender symbol inversion (forgot to set text)
extract some methods to reduce nesting
2021-07-06 08:42:15 -07:00
Kurt
de8e855116 Replace MC->MemoryCard
Simplify some interactions to be more clear
2021-07-05 14:32:09 -07:00
Kurt
4452c10beb Close popups when opening saves
Works around loading saves with different import/view permissions (Gen8 content not in Gen7, etc).
2021-07-03 12:46:52 -07:00
Kurt
3e7775fc44
Track a PKM's Box,Slot,StorageFlags,Identifier metadata separately (#3222)
* Track a PKM's Box,Slot,StorageFlags,Identifier metadata separately

Don't store within the object, track the slot origin data separately.

Batch editing now pre-filters if using Box/Slot/Identifier logic; split up mods/filters as they're starting to get pretty hefty.

- Requesting a Box Data report now shows all slots in the save file (party, misc)
- Can now exclude backup saves from database search via toggle (separate from settings preventing load entirely)
- Replace some linq usages with direct code

* Remove WasLink virtual in PKM

Inline any logic, since we now have encounter objects to indicate matching, rather than the proto-legality logic checking properties of a PKM.

* Use Fateful to directly check gen5 mysterygift origins

No other encounter types in gen5 apply Fateful

* Simplify double ball comparison

Used to be separate for deferral cases, now no longer needed to be separate.

* Grab move/relearn reference and update locally

Fix relearn move identifier

* Inline defog HM transfer preference check

HasMove is faster than getting moves & checking contains. Skips allocation by setting values directly.

* Extract more met location metadata checks: WasBredEgg

* Replace Console.Write* with Debug.Write*

There's no console output UI, so don't include them in release builds.

* Inline WasGiftEgg, WasEvent, and WasEventEgg logic

Adios legality tags that aren't entirely correct for the specific format. Just put the computations in EncounterFinder.
2021-06-22 20:23:48 -07:00
Kurt
412bd18139 Decouple incompatible conversion routes from HaX, make setting 2021-06-17 22:48:31 -07:00
Kurt
035584dc7c Extract templating from EditPKMUtil, rename methods 2021-06-07 20:02:57 -07:00
Kurt
e32daee3f3 Add setting to disable loading plugins 2021-06-04 14:19:22 -07:00
Kurt
3764e60b37 Show extra details for exported legality results (debug only)
same as encdb showing full encounter details, spit them out here too.
2021-06-03 17:59:53 -07:00
Kurt
aa55346bde Add setting to not show changelog on update 2021-05-20 15:03:15 -07:00
Kurt
50b15cd740 Use range/index
More in line with modernizing the codebase with latest c# syntax

improve web-qr decode speed slightly (no linq skiptake)
get money/coin mask without a temporary string (lol performance)
2021-05-14 15:30:55 -07:00
Kurt
f063014879 Improve clarity of plugin load failures 2021-05-02 18:27:04 -07:00
Kurt
0d45075d4b
Rewrite settings handling; enhance some user experiences (#3193)
- Settings now stored as json next to exe
- Settings now exposes all legality checking setttings that can be changed
- Slot hovering now can play cries in MGDB/PKMDB/etc, not just the main boxes.
- Enhanced hover text for mystery gifts and encounters that have movesets
- Show recently loaded save files in ctrl-f browser
- Toggle auto-load savefile setting to be none/detect-latest/last-loaded
- Custom extensions & extra backup paths can now be configured directly in the json settings
- Settings editor now uses propertygrid & tabs.
2021-04-11 18:09:54 -07:00
Kurt
b3b60894b6 Remove 40x30 sprite assets
Farewell; let's assume things are 68x56 from now on.
2021-04-09 16:24:19 -07:00
Kurt
2f4b754505 Fix incorrect event flag reference
Thanks SneakyPeekyFox!

Also fix crash if pressing escape on the save differentiation popup.
2021-04-06 17:26:13 -07:00
Kurt
4700fdd1e3 Set updated version when resetting personal
Closes #3180

Improves handling for corrupt gen3 saves (pokedex cheaters)
2021-04-01 13:37:39 -07:00
Kurt
33e2c64721 Split SAV3 into version classes
Begone are the version-switch cases for value fetching.
2021-03-15 23:51:58 -07:00
Kurt
6bce4eea14 Minor clean
Annotations (nullable), some switch cases for readability
2021-03-14 16:16:55 -07:00
Kurt
41096fb56e Minor xmldoc / usage updates 2021-02-21 15:01:28 -08:00
Kurt
680e8b711d Add some code analysis for try-return with nullable out 2021-01-17 00:05:07 -08:00
Kurt
de840f40d4 Invert some "!is" to "is not" 2020-12-29 00:58:08 -08:00
Kurt
6502c9df33 Condense some expressions, extract static class 2020-12-28 21:42:54 -08:00