Commit graph

822 commits

Author SHA1 Message Date
Kurt
9a0f9f5119 Minor tweak 2022-03-15 19:23:13 -07:00
Kurt
218f8b05c3 Fix AV load
oops
2022-03-07 18:43:52 -08:00
Kurt
c51d51d381 More specific primitives for Memories/others 2022-03-06 12:01:47 -08:00
Kurt
9632ad44fd Span-ify HiddenPower methods
Zero heap allocation Hidden Power bruteforcing via Heap's algorithm
2022-03-06 00:43:49 -08:00
Kurt
e17483fe46 some linq reduction 2022-03-05 20:03:52 -08:00
Kurt
3d9c7dc750 Reduce IAwakened from int->byte 2022-03-05 18:46:03 -08:00
Kurt
b20566eb59 Use actual primitive instead of int
Some interfaces aren't needed to be exposed as int
2022-03-05 18:30:35 -08:00
Kurt
6ae59c509f IGanbaru int->byte fields 2022-03-04 22:34:11 -08:00
Kurt
bdbd9fc899 Add error message if user moves file for backup 2022-02-23 21:53:01 -08:00
Kurt
5b981f2832 Un-secret the bulk PKM validator
Now has its own button next to verify checksums.
2022-02-21 17:46:32 -08:00
sora10pls
3f6427f323 Hide held item for LA, display Hidden Power type for BDSP 2022-02-18 09:52:30 -05: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
c59b0947f0 idden Power base power next to type
No need to have two lines; simplifies the already complex user control slightly.
2022-02-08 22:25:14 -08:00
Kurt
ee15a15c9e Minor tweaks
Lower contest stat row
Lower IsNoble & IsAlpha
Prevent closing Splash Screen when interrupted by plugin dialogs
2022-02-08 21:46:16 -08:00
Kurt
9c5955c104
Emulate Height & Weight float calculations matching the game (#3417)
* 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
2022-02-08 18:56:11 -08:00
Kurt
b20fb39d77 Don't set dex on slot swap within save
Closes #3411
2022-02-07 15:03:26 -08:00
Kurt
3069d42ad4 Fix 16/16->G7 conversion
lol oops
Closes #3405
2022-02-06 16:00:51 -08:00
Kurt
a3595d1429 Update more values on height change & auto update
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.
2022-02-05 22:02:07 -08:00
Kurt
6683c1af01 Widen SAV editor popup buttons
Closes #3389
2022-02-05 09:31:02 -08:00
Kurt
eed5bb04e3
Merge pull request #3382 from kwsch/pla
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.
2022-02-04 18:28:17 -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
3389a224d1 Change stat label clicks to change nature instead
Document in shortcuts
Old behavior was undocumented, and was kinda janky.

Closes #3376
2022-01-25 16:45:41 -08:00
Kurt
47071b41f3
Refactoring: Span-based value writes and method signatures (#3361)
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.
2022-01-02 21:35:59 -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
aa968f56aa File scoped namespace for drawing projects
Extract color util to separate class as it's not entirely image related.
2021-12-10 00:15:04 -08:00
Kurt
cacd6e9965 More records/sealing 2021-12-05 23:54:59 -08:00
Kurt
c7de0154e3 Handle net6 warnings for nullability 2021-12-04 22:29:51 -08:00
Kurt
f55c5bea66 Minor clean
no functional change
2021-12-04 17:56:56 -08:00
Kurt
e48c81f685 Update met date & location when toggling IsEgg via GUI 2021-12-02 16:35:35 -08:00
matty
f94c431712
Add PKHeX icon to generic/simple/whatever editor (#3316)
Replaces the generic winforms icon with PKHeX's icon.
2021-11-28 08:19:33 -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
be3af9fba9 Add bdsp poffin editor
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...
2021-11-27 02:06:35 -08:00
Kurt
b7c9993bac Add Misc editor form for bdsp
Three clickables so people can stop getting confused about event-bound encounters like Darkrai/Shaymin/Spiritomb
2021-11-25 22:48:09 -08:00
Kurt
ae2c5080a5 Set nicknamed flag in GUI depending on encounter
#3311
2021-11-25 12:40:42 -08:00
Kurt
cce0111a9d Add scalar randomizer shortcut
Okay I'll be nice, fudge your values this way.
2021-11-24 19:32:12 -08:00
Kurt
d79864b049 Add seal list editor
Inject all the stickers you want.
2021-11-24 17:51:12 -08:00
Kurt
5374ca1db6 Simplify egg location set on version change 2021-11-24 14:14:11 -08:00
Kurt
29579d7b22 Autosize dropdown width for met locations
BDSP locations are pretty long.
2021-11-24 13:14:02 -08:00
Kurt
57cf384f44 Condense friendship shortcut's expression
decouples it from the GUI by doing things step by step
2021-11-22 19:03:42 -08:00
Kurt
cd5c220ddc Show correct HatchCounter value for BDSP traded eggs
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.
2021-11-21 19:53:13 -08:00
Kurt
829641d874 Set none location when eggifying 2021-11-21 18:47:57 -08:00
Kurt
2cb3b61e48 Fix egg toggling in GUI, egg location auto-select 2021-11-21 18:36:02 -08:00
Kurt
32edb660ce BDSP: Add underground item-inventory editor 2021-11-21 11:33:04 -08:00
Kurt
1d3d317665 Add initial Trainer Info editor for BDSP
Closes #3297
2021-11-20 10:34:20 -08:00
Kurt
93aaad6cd4 Revert net6 to net5
would rather have pipeline builds for those keen right now
2021-11-19 23:19:41 -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
77d1a990cd Add setting to auto-max IVs when changing HP type
https://projectpokemon.org/home/forums/topic/59634-hidden-power-improvement-feature-request/?do=findComment&comment=270001

Default is true.
2021-10-30 12:38:00 -07:00
Kurt
640cb3bad1 Update OT and language state when egging pk3
https://projectpokemon.org/home/forums/topic/59250-pkhex-210806/?do=findComment&comment=269850
2021-10-23 15:45:32 -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
Kurt
993a2d684c Update nature amps on PID text changed
Closes #3272
2021-10-15 18:27:16 -07:00
Kurt
4e6a38189b Force validation differently for met location list changes
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
2021-09-17 19:20:24 -07:00
Kurt
02af45cb30 Add LGPE to block editor
thanks for nobody noticing this yet :)
2021-09-16 14:06:52 -07:00
Kurt
80d1712b72 Mark stuff with enums, remove unused arrays
Fix shuffled comments for FormInfo
Remove unnecessary Reset on ctor, all fields are already the default
2021-09-07 20:57:19 -07:00
Kurt
28e7473f1a Condense some expressions 2021-08-22 01:26:28 -07:00
Kurt
bedc52943e Trailing commas
No functional change
2021-08-20 13:49:20 -07:00
sora10pls
803fe84f04 Add form strings for Eiscue, Morpeko, and Zacian/Zamazenta
Ice Face, Full Belly Mode, and Hero of Many Battles (strings trimmed where appropriate)
2021-08-07 13:22:14 -04:00
Kurt
c77543584e Widen pkm form dropdowns
Removes the hax form ID specifying; just use batch commands to mod the slot for out of bounds values.
2021-08-06 22:04:11 -07:00
Kurt
c784a0d992 Fix value -> gui
previous commits changed interface to byte; combo binding uses ints for value
2021-08-02 20:43:32 -07:00
Kurt
1efebe51d3 Simplify Country/Region/ConsoleRegion to byte from int
Only exists in gen6/7 games.
2021-08-02 19:43:57 -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
9215cc129b Allow readonly slots to be dragged out from
Show hand symbol on all draggable slots
Still disallow swap operation for readonly slots.
2021-07-24 00:16:51 -07:00
Kurt
b265c349ca Remove unnecessary null check
No paths into the method are null parameters
2021-07-21 00:58:30 -07:00
Kurt
5615d24c9c Fix conditional PID->EC copy on UpdateShiny
Should check 3-5, not 1-5, as VC transfers have separate ECs.
Replace the .Visible check; if the control isn't on the current tab page, it might report itself as invisible, and not update the text.
2021-07-16 08:40:53 -07:00
Kurt
6bed33f7f1 Minor tweaks 2021-07-15 20:40:00 -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
5a769312fd Finish renaming EncounterType->GroundTile
Update the localization for GroundTile for english (and Italian, which is untranslated)
2021-07-03 23:25:09 -07:00
Kurt
103aa9aa4b
Revise EncounterArea and EncounterType for clarity (#3228)
EncounterArea now stores a more specific type'd array for encounter slots. Better iteration and less casting, as the nonspecific `Slots` fetch is rarely referenced.

EncounterType renamed to GroundTile to reflect how it actually works in Gen4. Was previously an ambiguous field that was clarified a little; we can describe it a little better now. Keep the GUI the same to not scare the end users.

Change Trash Byte properties to get/set a Span. Trash Byte legality checking easier on the garbage collector?
2021-06-29 20:58:06 -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
1bd1c287fa Centralize gender label text/color update calls 2021-06-22 20:06:05 -07:00
Kurt
8bac5c259a Trycatch sound stop, only stop if a sound has been played
Closes #3224

mono's impl of soundplayer is different, hence the need to be a little safer here.
bdd772531d/mcs/class/System/System.Media/SoundPlayer.cs (L255)
https://referencesource.microsoft.com/#System/sys/system/Media/SoundPlayer.cs,455
2021-06-22 17:06:30 -07:00
Kurt
035584dc7c Extract templating from EditPKMUtil, rename methods 2021-06-07 20:02:57 -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
138501da2f Minor clean
Condense some expressions
Use less linq
Rename some fields
2021-05-29 15:31:47 -07:00
Kurt
2c820bfbe9 Minor tweaks 2021-05-18 13:29:55 -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
d340642b09 Minor perf improvements 2021-05-10 01:01:45 -07:00
Kurt
cea2edb3e9 Add controls in one action
reduces the amount of control redraws
2021-05-09 12:10:32 -07:00
Kurt
7bc733c900 Update SK2 language coercion
Closes #3194
Exports are fine, imports with an ambiguous language (can be either JPN or INT) while illegal don't result in the above branches passing it.

Inputs with <=6 chars for OT&Nick will be ambiguous; PKM editor.
2021-04-11 20:50:34 -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
4dea69e068 Fix met location list misbehavior
PKM Editor is so spaghetti anyway
2021-04-10 10:30:10 -07:00
Kurt
bfd581e89d Rearrange daycare for 68x56 layout 2021-04-09 17:20:42 -07:00
Kurt
c7b997865c Minor clean 2021-04-09 14:52:49 -07:00
Kurt
ecf1f361fe Show encounter's full details on hover (mgdb/encdb)
Won't work neatly for Mystery Gift types since those aren't record types.
2021-04-04 12:05:00 -07:00
Kurt
d6dc8a0410 fix signed g7id display
>2^31 would show a negative G7SID, no more!
2021-03-20 19:38:01 -07:00
Kurt
e547a9cf63 Extract report generation from LegalityAnalysis object functions
Can replace the default functionality with your own formatter, I guess.
2021-03-20 13:21:04 -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
4f6258e492 Add direct object editing for accessor type saves 2021-03-14 16:14:15 -07:00
Kurt
9e4f1d11cc Show misc encounter details on hover 2021-03-07 12:35:26 -08:00
Kurt
d4be8aa7be Update PKMEditor.cs 2021-02-10 14:02:25 -08:00
Kurt
b0fac2dd34 Update PKMEditor.cs 2021-02-09 08:46:03 -08:00
Kurt
666a1805ba Relocate formargument logic 2021-02-08 20:42:19 -08:00
Kurt
ff7817a749 Create FormArgument extension logic 2021-02-08 20:39:46 -08:00
Kurt
37cb15749e Update FormArgument handling for gen6/7
Disassociate pk4/pk6 backing byte[] when converting to pk5|pk7, as we no longer make a copy of the byte[] in the pkm's constructor.

Change UpdatePKM to include isParty, as we want it optional to update FormArgument too.

Change FormArgument saving to be handled by FormConverter; kinda not really good to have it there, but nothing else is handling FormArgument values.

Expand IFormArgument to have all FormArgument values exposed. "Maximum" is furfrou only.
PK6: Max is in the "FormArgument" u32, and the remain/elapsed is in party stats (hence the reverting when boxed)
PK7: u8 remain, u8 elapsed, u8 max, u8 unused.
PK8: assumedly the same as PK7, given the disassembly hints that it's the same as past games (even though Furfrou and Hoopa are not in SWSH).
2021-02-08 20:26:53 -08:00
Kurt
a0351efc81 Show preview tooltip in mgdb view
Show card header to differentiate gifts
2021-02-07 08:32:01 -08:00
Kurt
a2d5d7d769 Show preview for encounter database slots on hover 2021-02-06 22:33:13 -08:00
Kurt
a7f65554ad Update formarg handling 2021-02-05 16:52:46 -08:00
Kurt
ceb14c8468 Add consistent ctrl/alt modifiers for IV/EV/AV
Closes #3132
2021-01-20 22:09:25 -08:00
Kurt
803b8675fe Rework batrev current slot handling
Show all slots even if they're uninitialized. Empty first slots but present second slots caused errors on init.
2021-01-20 20:29:26 -08:00
Kurt
d805167e7c Save battle version value on value change 2021-01-18 18:18:42 -08:00
Kurt
6566b0ed1f Add Pokedex flag properties
Closes #2954 ; can set directly from propertygrid already, but might as well clean things up a little bit to match the disassembly logic.

Open the simple editor center parent rather than next-form-position
2021-01-09 23:27:22 -08:00
Kurt
cc43550357 Simplify more expressions 2021-01-04 17:31:43 -08:00
Kurt
cdcbc3750b Update PKMEditor.cs 2021-01-02 12:46:46 -08:00
Kurt
d02dd29e83 More version-location shenanigans
Should be behaving correctly for gen!2=>gen2 now
2021-01-02 10:35:48 -08:00
Kurt
09089da14e Use more expression return style
Reduces indentation & bracketing, a bit more concise
2021-01-01 17:08:49 -08:00
Kurt
813180453e Delete duplicate HT bit fetch method
Make expression methods
2021-01-01 16:39:33 -08:00
Kurt
7523e0e200 Make ContestStat fields byte (from int) 2021-01-01 13:39:08 -08:00
Kurt
d66486ac29 More pkm.form visibility/initialize tweaks
Gen7 started up showing a form=-1 marshadow, initialize the combobox with an empty string since we no longer set formlist if it has none
label/combobox visibility should be managed by gen2 flowlayout case below
2021-01-01 11:29:20 -08:00
Kurt
fb008be6a6 Condense some more expressions 2020-12-31 23:13:27 -08:00
Kurt
989c4314ae Hide formarg control when not present for format
Set initial visibility state to false for startup anyways; parent usercontrol should get set invisible by PKMEditor during its setup-format logic.
2020-12-31 15:15:22 -08:00
Kurt
d0d7895fa5 Only refresh localized data sources if needed (generation)
Faster same-type savefile loading
2020-12-31 15:10:37 -08:00
Kurt
ec4358372a Finish implementing form-argument control behavior 2020-12-30 00:32:17 -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
Kurt
a124168e87 Make FormArg editing a complex control
Shows a dropdown for alcremie only, and a number entry for everything else.

See 771086a222 for initial implementation; I don't want the lag anymore lol
2020-12-28 11:51:25 -08:00
Kurt
7298910f04 Simplify some logic
The save editor buttons were originally checked for visibility in order to determine if we should hide the groupbox completely. This didn't work if the groupbox wasn't being displayed (get visibility checks if it is currently rendered, in addition to can be shown). So the "enabled" state was used to determine if it should be shown.

Now that we have the "Blocks" raw editing always being shown, the GroupBox will always be shown. Can just set the visibility directly, rather than doing the workaround.

Make the hall of fame editors slightly less SaveFile_type-specific.
2020-12-28 10:26:08 -08:00
Kurt
ee5349ff98 moar is or 2020-12-25 12:30:26 -08:00
Kurt
4d0108331a Move LegalityAnalysis derived movesets out of class
LegalityAnalysis just does the analysis; no need to do unnecessary suggestion logic inside the object.
2020-12-24 16:36:50 -08:00
Kurt
43dd390f21 Split IContestStats, mark trades as records 2020-12-24 00:06:40 -08:00
Kurt
7e4eb86e93 c#9 is not sugar 2020-12-22 21:24:41 -08:00
Kurt
997e0751f3 Minor clean
Handle remainder of c#9 sugar
Fix some spelling mistakes
2020-12-21 23:37:07 -08:00
Kurt
514b60b447 Merge type check with usage in if statements
if x is y with z property true, then :D
2020-12-21 22:33:48 -08:00
Kurt
62018cce1a Unify concepts with different names
AltForm & Form & Forme => Form
GenNumber & Generation => Generation

Extract out SpeciesForm interface, and re-add IGeneration

For those using PKHeX as a dependency, this should be a pretty straightforward manual replacement... GenNumber and AltForm should be quick find-replace`s.
2020-12-10 20:42:30 -08:00
Kurt
6f7602f2ad Change signatures to use readonly if possible
Extract get/set team methods for battle video
2020-12-05 06:09:33 -08:00
Kurt
e72c80613e Extract metadata/state tracking from SaveFile obj 2020-12-05 05:36:23 -08:00
Kurt
9b178fefe2 Xmldoc, minor tweaks
Move form-info logic from FormConverter to AltFormInfo; now FormConverter is entirely form=>string[]
Add a bunch of xmldoc
Make pogo no-end-date cmp agaisnt UTCnow rather than local now.
2020-11-27 11:51:02 -08:00
Kurt
038903a2f9 Update BoxMenuStrip.cs
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2020-11-19 15:59:33 -08:00
Lusamine
6a91dfbaba
Fix parsing SID error (#3090) 2020-11-19 15:38:56 -08:00
Kurt
81110b4231 Upgrade netcore build to NET 5.0
keep with the times, kids

handle some compiler messages
2020-11-14 08:20:48 -08:00
Kurt
df5ebd1f54 Minor clean
Resolve some messages
2020-11-11 21:01:41 -08:00
Kurt
23e765e550 Add opening for rental team dumps
Dunno why anyone would want these, lol
Closes #3074
2020-11-03 20:12:42 -08:00
Kurt
28767df0fb Split gamesync details to interface 2020-10-31 11:43:57 -07:00
Kurt
80a5d8e451 Remove layer null check
Move to the place that triggered the null
2020-10-30 19:56:16 -07:00
ReignOfComputer
3767a61171
Fix Stat Tooltips (#3057)
Was only updating based on Stat Nature?
2020-10-27 09:18:12 -07:00
Kurt
9e380fdcde Update sprite on gmax field change 2020-10-25 13:47:42 -07:00
Kurt
9264150b2b Add shiny1 batch editor, add ctrl-shiny (1)
GUI: Ctrl click star to get shiny1, shift click for shiny0, any-click to get random

make Alt click modify the SID instead of PID

add SetShinySID shiny type
2020-10-25 10:42:48 -07:00
Kurt
3e1bc1f59d Show extra slots in the "Other" tab 2020-10-24 14:57:53 -07:00
Kurt
bc33c87c6c Add click handler for crown raids
oops
hotfixing exe soon
2020-10-24 12:28:59 -07:00
Kurt
8a2a25fde1 Update data structures for Crown Tundra
Adds a wild area Raid den detail editor like mainland/armor raids.
2020-10-24 11:09:29 -07:00
Kurt
cce4707604
Enable nullable for winforms csproj (#3037)
Handle all warnings
obviously the usage of null! could potentially be avoided if the object init wasn't such garbage, but here we are with years of old junk and lack of abstraction in the GUI project
2020-10-18 11:02:39 -07:00
Kurt
7a01b1249c Minor clean
Handle more messages, add more xmldoc
2020-10-18 09:43:41 -07:00
Kurt
3686ee9ec4 Set suggested Encounter Type on Met Location click too
Closes #3010
2020-10-08 15:01:23 -07:00
Kurt
61dc9a45ae Revise Shadow state detection
Closes #3012
2020-10-06 22:36:27 -07:00
Kurt
d4452ce3af SK2 coerce to load to a hint language
This format won't be supported cleanly, so let's just try to allow language detection to work as best as it can without storing metadata in the SK2 bytes.
2020-10-04 14:42:48 -07:00
Kurt
6938d2f94d Split VivillonTables into two classes
Indicate that the content is for 3DS specific logic
Reduce restriction for parameters requiring IGeoTrack => IRegionOrigin
2020-10-04 14:15:13 -07:00
Kurt
09c6359e3a Add flexibility for SK2 imports
Check language character table for English vs Japanese when loading for a destination
2020-10-04 10:25:34 -07:00
Kurt
f8de9fe1bf Minor tweaks
now that stadium saves all expose registered teams, can just call from the parent class
rental sk2's have no TID; add that to the requirement to not get flagged for missing OT
2020-10-04 09:26:15 -07:00
Kurt
7efaa5ab71 Minor clean
collapse some expressions
handle some compiler messages
2020-10-03 18:59:36 -07:00
Kurt
816f24e3db Add Misc pkm array viewer for Stadium saves
Readonly slots

Things could be expanded on to use interfaces and wrappers for a "SlotReference" and properties for readonly.

But that's kinda unnecessary
2020-10-03 18:22:29 -07:00
Kurt
52a67f2425 Add Stadium2 Support
Introducing a new PKM format: SK2
Split ICaughtData2 off of PK2 so it can be shared with SK2 when type-checks occur
Add conversion for PK2<->SK2
Split the split-buffer handling for GBPKM to GBPKML (what a name), so that I can reuse shared accessor logic for SK2.
2020-10-02 18:08:40 -07:00
Kurt
22f37910f0 Remove unnecessary single-member interfaces 2020-09-27 18:19:28 -07:00
Kurt
2b7e06e217 Refactoring
Extract some logic, suppress some compiler messages
2020-09-18 22:11:13 -07:00
Kurt
7a1c438b74 Minor tweaks
add method to randomize AVs from interface extension method
revise stat presence check to check ATK since HP is stored in gen1 format
2020-09-17 18:13:08 -07:00
soopercool101
1a1cfbda4a
Fix Hidden Power Power calculations (and add to UI) (#2989)
* Fix broken hidden power power calculation

* Fix broken Gen 2 Hidden Power calculation

* Add parentheses

* WIP UI

* Finalize UI, only show on gens 1-5

* Inline some logic to reduce allocations

* Add unit tests for both hidden power calculation cases

Co-authored-by: Kurt <kaphotics@gmail.com>
2020-09-14 20:06:11 -07:00
Kurt
01fb233e48 Minor tweaks
Extract some interfaces
Suppress some warning messages with commented reasons if appropriate
2020-09-09 12:47:24 -07:00
Kurt
5d3bc289b6 seal hunting
Mark things as sealed as they shouldn't be inherited from or overriden in a derived class.
2020-09-07 13:51:13 -07:00
Kurt
cf9e5ec37f Minor refactoring
Change Ability array to IReadOnlyList, add method to check ability index in personal data
Suppress some message warnings
Change EvolutionChain short-circuit for VC to jump from gen6 directly down to gen2. There aren't any notradeback 1 situations, so a notradeback1 will always start with g=1, so no need for the other if-continue.

Simplify pk5 conversion
2020-09-06 10:53:13 -07:00
Kurt
b7211000b0 Split Country/Region/ConsoleRegion from ITrainerInfo
Only present in mainline gen6/7 game pairs, so it's not wise to have it for all games
2020-07-31 13:53:42 -07:00
Kurt
27f15d2f20 Split Country/Region/ConsoleRegion to interface 2020-07-31 11:17:31 -07:00
Kurt
a221a27074 Click version/battleversion -> dropdown combobox
User error help
2020-07-25 09:58:21 -07:00
Kurt
65ecd3ca9a Sync missing change 2020-07-18 20:07:55 -05:00
Kurt
705822c965 Abstract some gen1/2 encounter types from their parent class 2020-07-18 15:36:30 -05:00
Kurt
523edecf7b Get actual value rather than magic index
logic doesn't really work for gen2/3, so gate it behind gen4+ format only
2020-07-06 17:32:40 -05:00
Kurt
993673f0de Minor clean
no functional change
2020-06-27 23:36:53 -05:00
Kurt
4f7845547e Minor clean
Remove met location dynamic sizing for C/XD (already resized for SWSH)
add some xmldoc comments
rename some parameters
2020-06-20 18:23:03 -05:00
Kurt
d6c5c6071d Hide armor raids when not available 2020-06-19 19:56:24 -05:00
Kurt
86a9711cc1 Show xor & tsv on gen3-5
TSV/PSV was never abused during these gens, but whatever, show the raw details.
Closes #2868
2020-06-19 18:59:00 -05:00
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Kurt
ce3f887a97 Handle dragdrop from zip (win explorer) 2020-06-16 21:53:24 -05:00
Kurt
2cdb5d26db Clean up some method signatures
rename things to be a little more consistent in naming conventions
2020-06-16 21:46:22 -05:00
Kurt
bfef634a1a Set shiny type regardless of format
Don't loop if not required to loop
2020-06-12 11:45:56 -07:00
Kurt
afa368823e Minor clean
handle some compiler messages
2020-05-26 16:59:47 -07:00
Kurt
460062a07c add generic sav block editor 2020-04-26 16:23:06 -07:00
Kurt
b8814d2448 Split GG into LGPE (GP/GE), GG (LGPE||GO)
Update usages
2020-04-16 12:48:18 -07:00
Kurt
ee1cfa8912 Hanle some compiler messages 2020-04-14 10:52:19 -07:00
Kurt
49e4fd396d Remove some unnecessary null checks 2020-04-14 10:08:56 -07:00
Kurt
33bdacebe8 Minor tweaks
Handle some compiler/extension suggestions
2020-04-12 16:07:59 -07:00
Kurt
e83f2a7dd0 Expand met location combobox
stupid long met location names in SW/SH; doesn't really hurt.
Not gonna measure all string lengths and dynamically stretch it -- not worth.
2020-04-12 13:26:35 -07:00
Kurt
30d21e4532 Extract out showdown set interface 2020-04-12 13:05:29 -07:00
Kurt
270d984130 Minor clean
Remove unnecessary null checks
Mark some methods with nullable type
2020-04-04 19:30:50 -07:00
Kurt
80bedf2140 Add HomeTracker to list of hideable secrets 2020-03-21 10:56:15 -07:00
Kurt
68324847bb Update PKMEditor.cs 2020-03-17 10:35:30 -07:00
Kurt
f1beef872f Reorder origin mark returns
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
2020-03-17 10:34:23 -07:00
Kurt
a885f6b48f Clean up PID/EC auto-update
Now loads & saves version-less data fine

Co-Authored-By: lusamine <lusamine@users.noreply.github.com>
2020-03-13 19:56:53 -07:00
Kurt
4c226340fe Add shiny sprites, alcremie sprites & big sprites for all
Keeping the 30x40 for now; might change my mind later.
Kept the gmax sprites but they're unused.
2020-03-03 20:22:57 -08:00
Kurt
9b30bb8a2f Don't copy PID->EC if bad GenNumber
Reading raw uncaptured data from RAM
2020-02-29 10:55:30 -08:00
Kurt
66efbaf407 Add box manip for heal all slots 2020-02-17 19:28:20 -08:00
Kurt
fc9d0b4b24 Add hint for pkm with dummied moves
Closes #2716
2020-02-16 12:17:36 -08:00
Kurt
5c845a3875 Hide home tracker on non pk8 formats 2020-02-14 11:54:04 -08:00
Kurt
e8759ee538 Determine shiny as square if fateful && shiny
regardless of xor value result
gotta make those shinies pop ;)
ty anubis
2020-02-13 16:51:14 -08:00
Kurt
92b22b9f44
Fix HOME tracker value GUI character entry length
Closes #2705 
It's recommended that you NOT set a "random" value here; instead, let HOME regenerate one for you.
Clearing it still functions properly.
2020-02-13 10:52:19 -08:00
Kurt
6346444db7 Extract home tracker to interface 2020-02-12 18:52:48 -08:00
Kurt
e77fa205a0 Add tracker editor 2020-02-12 18:10:03 -08:00
Kurt
d260249b5e Apply met location before suggestion check
Closes #2667
2020-01-28 18:29:05 -08:00
Kurt
dd07126d83 Relocate level suggestions to EncounterSuggestion 2020-01-28 16:21:38 -08:00
Kurt
e40f739494 Update tab ordering
Closes #2665
2020-01-27 17:15:58 -08:00
Kurt
410fcee85b Sort sav sub-editors on load 2020-01-27 17:14:18 -08:00
Kurt
c301ce88ab Update Random to be a bit more thread safe
Random isn't thread safe; users of PKHeX.Core.dll might run multithreaded operations (see PKSM + ALM), so we need to have a thread-specific RNG available.

Thread Local get; to improve performance, save the random object locally whenever it is used more than once in the method.

https://docs.microsoft.com/en-us/dotnet/api/system.threading.threadlocal-1?redirectedfrom=MSDN&view=netframework-4.8
https://stackoverflow.com/questions/18333885/threadstatic-v-s-threadlocalt-is-generic-better-than-attribute/18337158#18337158
2020-01-25 21:49:52 -08:00
Kurt
b5d48bc14f Split up portions of CommonEdits
Cuts out about half the size; there's still a bunch of apply-value logic but it's not really big enough for a separate class.

Rename BallRandomizer->BallApplicator
2020-01-25 16:47:44 -08:00
Kurt
225d5d0698 Refresh PP on applying suggested moves
Closes #2655
pretty sure the FieldsLoaded is preventing the pp refresh, so just manually do it
2020-01-22 09:24:25 -08:00