Commit graph

1003 commits

Author SHA1 Message Date
Kurt
1ea4683fbe Resize gen6 HoF editor sprite preview to large size 2021-08-05 18:23:39 -07:00
Kurt
d946ea4d88 Remove gen6/7 full dex language flag quirk
Was for cyber gadget save editor, restoring a segment that was all FF's causing it to corrupt.
Pretty sure they fixed the underlying error since it was originally found in 2014, but Cyber Gadget ceased operation of their save editor services back over a year ago, so this is no longer needed.

14/08/31 - New Update: (3900)
 - Added: Cyber screwup notification upon saving.
 - - If a 0x200 byte chunk is all 0xFF, your save will be corrupt when you write it back (not PKHeX's fault).
2021-08-05 18:20:50 -07:00
Kurt
ebb47867dd Use FileUtil tryget for pkm from path
GetPKMFormatFromExtension is now only used once internally.
2021-08-05 16:29:32 -07:00
Kurt
cc0397f087 Misc tweaks
Improved readability
2021-08-05 15:18:43 -07:00
Kurt
bd826eef5c Show trainer sprites gen6 2021-08-05 13:11:50 -07:00
Kurt
2dd3ec3e91 Update SAV_Database.Designer.cs 2021-08-05 12:27:26 -07:00
Kurt
a293f1b0b4 Handle slot delete correctly 2021-08-05 12:15:55 -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
c1e6693b9c Change GeoTrack props to byte too
if u say so, archit
2021-08-02 20:03:11 -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
a07880d1ba Localize super training flag names 2021-07-26 23:56:42 -07:00
Kurt
4ed0e30ace Minor tweaks
Muh infinitesimally small perf gainz found while waiting for next dota match
2021-07-26 23:33:56 -07:00
Kurt
c9640f8561 Comments: forme->form 2021-07-26 14:14:39 -07:00
Kurt
9c8bee19ca Gen5: Add give all musical props, b/w entree level changing
Abstract some things into their parent save block structure.
2021-07-25 23:44:03 -07:00
Kurt
4ee72b0020 Extract pass power enum from gui logic 2021-07-21 00:58:09 -07:00
Kurt
6bed33f7f1 Minor tweaks 2021-07-15 20:40:00 -07:00
Kurt
46f50a3a56 Use named consts for magic gender values
More personal magic value comparisons
2021-07-13 18:22:04 -07:00
Kurt
16c8a18928 Show box/slot offset by 1 when loading as SlotCache
Closes #3229
also revises parsing to not ToString(), and doesn't add a skip if the slot is empty
2021-07-03 09:28:35 -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
49488bb503 Use invariant culture for ToUpper/ToLower
Turkish is quite the language; let's try to prevent any errors down the road for internal/game string case changes.
2021-06-24 09:16:36 -07:00
Kurt
285876dcf7 Update SAV_Encounters.cs 2021-06-23 09:35:29 -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
9e427ad9a0 Update translatables with latest 2021-06-15 20:01:01 -07:00
Kurt
394c5c2c95 Minor clean
Shed some unused code
2021-06-15 20:00:51 -07:00
Kurt
a6ae8845c9 Reset gender if mismatch chain 2021-06-14 22:20:17 -07:00
Kurt
9c9f0f8a94 Get criteria from set details
pretty much futureproof I guess
2021-06-14 21:11:46 -07:00
Kurt
a1ddbc7930 Add settings to use pkm tabs as criteria for Enc->PKM
Some encounters might not use the criteria completely, so it might not listen 100% of the time.
2021-06-14 20:26:12 -07:00
Kurt
0686922d5c Rewrite gen6ao secret base handling, i/o, GUI
Closes #3177

Format sizes are now accurate to game structure sizes. Added a few more editable fields, rid of label/textbox/etc for general base editing -- use a PropertyGrid instead.

Feels nice having a bank of saves to reference + idb to discover the struct layout.
2021-06-13 00:38:47 -07:00
Kurt
665880e081 Include form in GetEncounters, iterate all forms for savefile 2021-06-11 10:58:38 -07:00
Kurt
24d6c0d713 Change "Some" EV train rating from [0,127] to (0,127] 2021-06-10 19:18:58 -07:00
Kurt
2abf95cdf8 Minor clean
expand some expressions, extract some methods, add comments
2021-06-08 20:14:55 -07:00
Kurt
71fd8b36e9 Enable batch filters for encounter database 2021-06-08 20:14:27 -07:00
Kurt
910fce9812 Change namespace to usual PKHeX.WinForms.Controls
no more oddball namespaces
2021-06-07 20:04:01 -07:00
Kurt
035584dc7c Extract templating from EditPKMUtil, rename methods 2021-06-07 20:02:57 -07:00
Kurt
5636e1ef4a Add setting to hide unavailable species.
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-06-03 17:48:32 -07:00
Kurt
34ec5416e5 Add setting to disable return-none if empty criteria
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-06-03 17:36:16 -07:00
Kurt
9ba683688e Clear tooltips when changing results
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-06-03 17:32:13 -07:00
Kurt
066aedfc21 Separate scblock ctor's
No longer need to set byte[] twice
Add value-setter checks for bad mutations (size change, bool1<->bool2 only)
2021-06-03 12:35:39 -07:00
Kurt
8c970ec991 Minor tweaks
no functional change, readability++
add more xmldoc
2021-06-03 12:04:19 -07:00
Kurt
7e32ff9b03 Add settings to toggle loading of saves for pkmdb
https://projectpokemon.org/home/forums/topic/58942-question-about-custom-backup-path-pkm-database-path-avoid-to-scan-sub-folders/
2021-06-02 10:52:20 -07:00
Kurt
138501da2f Minor clean
Condense some expressions
Use less linq
Rename some fields
2021-05-29 15:31:47 -07:00
Kurt
7a8d75aec4 Show gender in encounter browser
Extract methods, add some comments, simplify array fetch.
2021-05-27 10:27:50 -07:00
Kurt
386d9cc94f Repoint hall data fetches outside blocks
Reverts prior commit repointing which was incorrect; these are outside the sav general/storage blocks.

871f9b0627 (diff-3560dca7e50959e98ae8fa32d9403f8846b9243815d653c78a07f2a3455a1874L481)

Keep the first as General as it's some value index within the General block used to index which extrablock matches it, or something

Closes #3211
2021-05-25 22:16:04 -07:00
Kurt
8cc2967395 Update MemoryAmie.cs 2021-05-23 12:51:25 -07:00
Kurt
c9499f95be Add sociability to Memory editor, add legality checks 2021-05-23 11:22:09 -07:00
Kurt
15afd6f3bc Move mail get to sav obj 2021-05-22 09:28:04 -07:00
Kurt
f462017670 Fix padding mask
Closes #3205 -- padding char
Closes #3206 -- sav3rs doesn't use SecurityKey, it's always 0

Co-Authored-By: Michi97 <24464847+Michi97@users.noreply.github.com>
2021-05-20 08:27:08 -07:00
Kurt
1d71d151e8 Add gen8 to generation dropdown 2021-05-18 16:59:19 -07:00
Kurt
5355d251a6 Align shiny checkbox same as pkmdb 2021-05-18 16:59:01 -07:00
Kurt
53e9d31545 Allow searching encounter db for shiny state
random shinies behave like not-shinies
so it only really filters for "always shiny" or "can be nonshiny".
2021-05-18 16:17:57 -07:00
Kurt
74e0cba3b0 Minor tweaks
use assert instead of manual exceptions
span
remove some dead logic
2021-05-18 16:16:48 -07:00
Kurt
2c820bfbe9 Minor tweaks 2021-05-18 13:29:55 -07:00
Kurt
565f161226 Show shiny state of encounter in db
Force shiny state for GO encounters

For encounters, this interface property is mainly just for exposing metadata for sprites.
2021-05-18 10:36:45 -07:00
Kurt
acdbda4e12 Split DateUtil from Util class 2021-05-14 16:46:48 -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
871f9b0627 Convert checksum operations to span-based
Fix SAV.Data references in SAV_Misc4 to use the General block instead
2021-05-14 12:30:40 -07:00
Kurt
d21c1fb135 Set editing mode when loading data to form
Prevents wiping of Multiplayer sprite assignment
2021-05-12 15:44:28 -07:00
Kurt
d340642b09 Minor perf improvements 2021-05-10 01:01:45 -07:00
Kurt
9826067a18 Handle latest custom folder path buttons correctly
no longer tab separated paths; just show the parent folder name.
2021-05-03 16:58:23 -07:00
Kurt
b049c82284 Update SAV_MysteryGiftDB.cs 2021-04-21 19:36:10 -07:00
Kurt
8e1be1f911 Pre-filter gifts that aren't available for current save 2021-04-21 19:28:01 -07:00
Kurt
5607d833be Remove affixed on none-ribbon
don't care about remove all legal retaining if not removed
2021-04-21 19:19:58 -07:00
Kurt
778aacb9cf Show larger sprite box 2021-04-19 23:30:46 -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
329a2cbd44 Remove indirect data fetching 2021-04-09 19:44:14 -07:00
Kurt
0576b9dfba 68x56 2021-04-09 17:23:09 -07:00
Kurt
d73baebad2 Use wider sprite boxes for Mystery Gift album display 2021-04-09 16:37:32 -07:00
Kurt
c7b997865c Minor clean 2021-04-09 14:52:49 -07:00
Kurt
f8a2bb3229 Add missing research tab flag set
Closes #3187
2021-04-07 22:46:28 -07:00
Kurt
b0700ba281 Extract Gen7 HoF class, extend event flag count
4k flags exactly, and probably 4950 for USUM (alignment +1 byte for an even 4960)

The old flag + count (4 bytes total) are just +32 event flags.
2021-04-07 00:20:02 -07:00
Kurt
673c0d93a6 Extract event flag/work editing from GUI
now <200 lines for editing (ignoring the diff functions), yay
Opening the editor allocates less (no copying save file)
2021-04-05 20:52:49 -07:00
Kurt
790da981f0 Fix gen3 trainer card team list
don't bother casting
2021-04-01 14:16:33 -07:00
Kurt
645f2b4db5 Revert implicit casting
Looks like netstandard2.0 wasn't meant to receive that new c#9 goodie
2021-03-29 00:14:44 -07:00
Kurt
3822981590
Rework EncounterCriteria to be ability indexed rather than direct ability (#3179)
* Exploration: rework ability criteria to ability numbers desired

* Sync remaining changes

* Update EncounterCriteria.cs

* Add xmldoc

* Improve speed of IsDualGender check

* More xmldoc updates

Should be doing this on main but meh, this branch is gonna get merged later

* Fix typo

* Update WC7.cs

* Update PersonalInfo.cs
2021-03-23 17:05:15 -07:00
Kurt
8d3f990667 Make some properties into consts 2021-03-20 12:47:21 -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
154d95982a Error message on trying to interact with deleted/removed files 2021-03-08 11:37:46 -08:00
Kurt
49541e6073 Rework mainline sav3 to not operate off chunks
Previous style was to resize the sav buffer and concat all the storage chunks at the end. Allocated a double save file.

Now, just allocate 3 buffers.
2021-03-07 23:22:07 -08:00
Kurt
8145456ca8 Add u32 hex key -> enter to jump to key (ignoring named blocks) 2021-02-27 22:34:05 -08:00
Kurt
c11cf3d6d4 Extract gen4 pokedex logic 2021-02-21 09:59:10 -08:00
Kurt
a7a7be7c44 Allow loading of savpaths, load misc & party slots 2021-02-13 13:04:43 -08:00
Kurt
d5e9775081 Update RibbonEditor.Designer.cs
https://github.com/kwsch/PKHeX/issues/3146#issuecomment-777060691
2021-02-10 14:12:14 -08:00
Kurt
4cabbc49a2 Add affixed ribbon drop-down
Closes #3146
2021-02-10 13:34:49 -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
a7cc51f633 Show alolan height/weight records 2021-02-05 07:46:06 -08:00
Kurt
726f100496 Update SAV_Encounters.cs 2021-02-03 11:48:23 -08:00
Kurt
1e86fdcea8
Fracture the encounter matching checks to allow progressive validation (#3137)
## Issue

We want to discard-but-remember any slots that aren't a perfect fit, on the off chance that a better one exists later in the search space. If there's no better match, then we gotta go with what we got.

## Example:
Wurmple exists in area `X`, and also has a more rare slot for Silcoon, with the same level for both slots. 
* We have a Silcoon that we've leveled up a few times.

Was our Silcoon originally a Wurmple, or was it caught as a Silcoon? 
* To be sure, we have to check the EC/PID if the Wurmple wouldn't evolve into Cascoon instead.
* We don't want to wholly reject that Wurmple slot, as maybe the Met Level isn't within Silcoon's slot range.

---

Existing implementation would store "deferred" matches in a list; we only need to keep 1 of these matches around (less allocation!). We also want to differentiate between a "good" deferral and a "bad" deferral; I don't think this is necessary but it's currently used by Mystery Gift matching (implemented for the Eeveelution mystery gifts which matter for evolution moves).

The existing logic didn't use inheritance, and instead had static methods being reused across generations. Quite kludgy. Also, the existing logic was a pain to modify the master encounter yield methods, as one generation's quirks had to not impact all other generations that used the method.

---

The new implementation splits out the encounter yielding methods to be separate for each generation / subset. Now, things don't have to check `WasLink` for Gen7 origin, because Pokémon Link wasn't a thing in Gen7.

---

## Future
Maybe refactoring yielders into "GameCores" that expose yielding behaviors / properties, rather than the static logic. As more generations and side-gamegroups get added (thanks LGPE/GO/GameCube), all this switch stuff gets annoying to maintain instead of just overriding/inheritance.

## Conclusion

This shouldn't impact any legality results negatively; if you notice any regressions, report them! This should reduce false flags where we didn't defer-discard an encounter when we should have (wild area mons being confused with raids).
2021-01-29 17:55:27 -08:00
Kurt
4c49d489a8 Update SAV_Inventory.cs 2021-01-20 20:01:59 -08:00
Kurt
46b988b6fa Remove unused checkbox 2021-01-20 17:06:37 -08:00
Kurt
c31285fd6d Dump csv async
Skip Sprite column completely
2021-01-16 17:25:55 -08:00
Kurt
3c42978afa Use IndexOf instead of FindIndex when possible 2021-01-16 12:47:02 -08:00
Kurt
613e6db744 Use StringConverter api consistently; use stringbuilder when possible
Retain a stringbuilder to mutate the string rather than finalizing temporary strings

yields some speed improvements (less gen0 string objects allocated)
2021-01-14 22:50:13 -08:00
Kurt
3e0b52195a Minor clean 2021-01-08 13:17:59 -08:00
Kurt
f615814548 Add xmldoc, increase swish util flexibility 2021-01-07 15:34:26 -08:00
Kurt
6e741a0cf0 Minor tweaks
Add xmldoc
Remove linq from memecrypto code (speed lmao)
Hide some methods that shouldn't be called directly
Name variables better for accessor const's
2021-01-06 23:30:30 -08:00
Kurt
cc43550357 Simplify more expressions 2021-01-04 17:31:43 -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
2af9e800fb Add RotomAffection and rotoloto1/2 flag editing to GUI 2020-12-29 11:39:19 -08:00
Kurt
d9a4eacaf4 Allow deactivating all raids 2020-12-29 10:53:47 -08:00
Kurt
de840f40d4 Invert some "!is" to "is not" 2020-12-29 00:58:08 -08:00
Kurt
e8c23f6644 Simplify some repeated comparisons with expressions
Less prone for bugs since it uses the same value for all comparisons without re-specifying
2020-12-29 00:37:59 -08:00
Kurt
c119f18af3 spec->species 2020-12-28 22:22:52 -08:00
Kurt
0a46f45b00 Split MetDataSource from GameDataSource 2020-12-28 21:12:46 -08:00
Kurt
74ee22e66e Make ComboItem a record 2020-12-28 11:57:34 -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
4a8a495d04 Condense some switch expressions
Should be it for now; exhaustively searched for all that made sense to change
2020-12-25 10:58:33 -08:00
Kurt
93910df2c6 Use new switch statements 2020-12-23 17:14:38 -08:00
Kurt
7e4eb86e93 c#9 is not sugar 2020-12-22 21:24:41 -08:00
Kurt
e34c8df044 Revise some method signatures 2020-12-22 20:50:33 -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
63aa8dcd43 Bump langver to 9 for other subprojects 2020-12-21 19:12:24 -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
0eb7bf7a4b Add alert if database load fails
Task is executed without reporting exceptions; continue after the task with another that checks if it failed.
2020-11-28 14:53:32 -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
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
f3ad96d056 Update KChart.cs 2020-11-06 11:20:52 -08:00
sora10pls
5c401fa936 Update GetIsNative for KChart
We want to show that the Species is native if it appears in any Dex (Galar, Armor, Crown), not just the main Galar Dex.
2020-11-03 12:02:08 -05:00
Kurt
4012977c3c Adapt when loading new
See previous commit message
2020-10-31 09:22:13 -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
0a6534a208 Extend individual transfer count to 999mil
Closes #3028
Thanks @CarlosofKalos !

Setting 9999 for both on Rattata; capturing the 10,000th didn't increment, but transferring the 10,000th did.

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-10-12 14:16:55 -07:00
Kurt
bb65f2d2c2 Show trainer name&id for registered Stadium teams in dropdown 2020-10-09 20:31:13 -07:00
Kurt
9d21e5acdd Add GUI for Capture Records
Accessible from Pokedex window
ur welcome matt
2020-10-08 18:06:29 -07:00
Kurt
262561d5d1 Fix stad1 missing team types
off by 1 (8=>9, and EN has unused interstitial teams).
Fix last-viewed-slot indication color tracking
2020-10-03 19:48:56 -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
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
soopercool101
63be1fb0e7
Update Underground Editor UI (#2988) 2020-09-14 19:05:49 -07:00
Egzon
4b1a9a89da
Add support for reading and editing Underground Items (#2987)
Adds a sub-editor with localized support for editing Underground Items.
2020-09-13 14:55:50 -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
9191f023a3 Minor clean
Nullability annotations and some logic simplification
2020-09-06 11:24:54 -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
c2ec4d55e4 Minor clean
Add some xmldoc, remove some empty lines, move some small logic pieces to a better spot
2020-09-03 14:28:51 -07:00
Kurt
b03a5f2818 Fix pika beach score reading
fix reads as little endian instead of big endian
fix truncation if editor value from byte => ushort
Closes #2976
2020-09-01 16:05:52 -07:00
Kurt
9667e86446 Simplify dreamworld encounter init
precompute result size
set Gen5 as lumped group for common encounters
remove linq usage (besides Sum call, whatever)
GetEncounters now only filters the in-game static encounters rather than the dreamworld too, as those are already filtered by separate arrays.
2020-08-30 19:51:44 -07:00
Kurt
bd11affa13 Minor clean 2020-08-30 19:24:40 -07:00
Kurt
75da70069c Remove access to modified captured variable
Get the variable rather than indexing into the array each time

Simplify some expressions in sav7 for readability
Make SAV_EventFlags use comboitem explicitly by type rather than an anonymous type with same member names
2020-08-30 15:48:11 -07:00
Kurt
890f3375c9 Misc clean 2020-08-18 15:39:45 -07:00
Matt
f9b4c1950b
Add Catch Rate to KChart (#2972) 2020-08-15 16:13:15 -07:00
Kurt
541c9761df Minor clean
Make flag indexes immutable
Rename some properties for clarity
2020-08-14 20:23:54 -07:00
Kurt
12d9397c8c Split GO from "GG" gameversion
Make Gen7b as the combined ver for that expression
2020-08-06 18:24:20 -07:00
Kurt
85d1b0e7ad Split gen6/7 affection stats to interface
not in future formats, doesn't belong
2020-08-02 11:06:30 -07:00
Regnum
9e40fa132f
Improved Pokewalker Editing (#2958)
* Added PokeWalker Courses, Watts, and Steps editing

* Use util method for getting bitflags

* Keep old cheat method

Change signature so that the default value passed is to unlock all; can pass 0 instead to lock all

* Pass reference to derived sav4-type object

Wev'e already type-tested once, capture the reference and pass it into the appropriate load/save methods.

* Add control anchoring for window resizing

Also widen the labels for localization (longer strings possibly)
2020-08-01 09:20:13 -07:00
Kurt
e84ce77008 Split memories from main pkm class to interface
pk6/7/8, not pb7
2020-07-31 17:25:14 -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
36684ab867 Minor clean
Simplify some expressions
2020-07-31 11:20:48 -07:00
Kurt
6bb2612059 Restart program on settings reset 2020-07-25 09:51:56 -07:00
Kurt
318016e9e5 Fix re-layout on grid refresh
closes #2946
2020-07-21 23:50:23 -05:00
Kurt
a6a3c6eaaa Refactoring
change some expressions for better perf/readability
2020-07-19 17:48:45 -05:00
Kurt
851d77ed3a Show "NEW" for gen8 item edits
why not
2020-07-18 20:27:22 -05:00
Kurt
a21bb09c37 Perserve & Display Favorite flag for items
Also clamp give all for TMs to 1 instead of whatever the giveall value is, like for prior games' HMs

reuse the "free space" bool; no real benefit in increasing the amount of abstraction (even though that's my current urge for legality)
2020-07-18 20:15:41 -05:00
Kurt
993673f0de Minor clean
no functional change
2020-06-27 23:36:53 -05:00
Kurt
a7ba178005 Remove unreachable/const logic
Earlier compares result in some logic being unnecessary

The Gen7 level up move compare was actually an oversight, so it's a worthwhile fix :)
2020-06-27 22:44:14 -05:00
Kurt
0836d3191d Rewrite some magic gender value logic
it's always been a byte for ratios, but we never know; plus, it's a little more self documenting
2020-06-27 12:01:28 -05:00
Kurt
b53a29a0af Add flag for urshifu-1 gmax pokedex
ty @sora10pls
2020-06-20 20:00:35 -05:00
Kurt
45a234814b Fix raid seed editing
Because we pass in a reference to the raid block, rather than obtain the reference from the to-be-edited save file object (which was cloned), we need to restore the unmodified data to the save file instead of copying the modified save data.

Bad explanation, but we've edited the origin save data. Revert to original.
2020-06-19 20:13:26 -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
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
e338fce910 Minor simplification 2020-06-11 09:29:46 -07:00
Kurt
afa368823e Minor clean
handle some compiler messages
2020-05-26 16:59:47 -07:00
Kurt
46b443903d Fix SM dex form fetch for spewpa
Closes #2826

It doesn't find it in the SM table, but didn't return -1
rework logic flow to return when found, rather than after loop finishes.

Also fix display off-by-1 since we're not using zero indexing for our entry numbers.

Thanks @Ammako !
2020-05-24 20:42:45 -07:00
Matt
8c6d674472
Misc changes (#2838)
Allow for up to 16 characters in SWSH Box Names.
Fix Rockruff-1 big sprite display.
2020-05-21 16:19:25 -07:00
Kurt
6164884700 Merge IGeneration into IEncounterable
all but egg exposed it; now, just make egg expose it and remove the unnecessary interface

we still need to Set generation for non-eggs/mgift, so have a separate Settable interface for internal purposes.
2020-05-17 12:32:28 -07:00
Kurt
9f490a605e Rearrange order/anchoring for main tab
allows expanding the window to show location names
Closes #2825
2020-04-29 09:32:29 -07:00
Kurt
8c723b32ee Don't show/modify earned bp on RS saves
Closes #2819
2020-04-26 17:53:50 -07:00
Kurt
73045ba7a4 Hide fame time until selected
Closes #2820
2020-04-26 17:49:32 -07:00
Kurt
a8f967e935 Disallow scrolling in Trainer Stat/Record
Unfinished text edits aren't pushed until after the combobox changes index
#2820
can't tell the numericupdown to finalize entry, even with a Focus() call to the combobox (to change focus from the numericupdown).
2020-04-26 17:49:10 -07:00
Kurt
460062a07c add generic sav block editor 2020-04-26 16:23:06 -07:00
Kurt
d6171669e4 Add swsh box wallpapers
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
2020-04-16 14:50:41 -07:00
Kurt
546412e410 Rename class/method name 2020-04-14 10:59:16 -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
696bdf7cae Update 20.03.14 2020-03-14 14:58:36 -07:00
pi1024e
8a1e73e5b3
Change OT_Class to have an expression body (#2759) 2020-03-13 10:28:50 -07:00
Kurt
fbd533092d Fix misspelling of the word "Received"
Closes #2757

Co-Authored-By: pi1024e <pi1024e@users.noreply.github.com>
2020-03-12 15:05:34 -07:00
Kurt
dcb7336d92 Hide pika beach on !YW, add a few RS flags
Closes #2745 , ty @FeralFalcon

hidden items are meh, items can be hacked in.

Co-Authored-By: feralfalcon <feralfalcon@users.noreply.github.com>
2020-03-11 19:33:17 -07:00
Kurt
0aa6282d73 Sanity check value types via generic method 2020-03-11 16:31: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
d58426ebf5 Hide affection fields, remove setters for unused
#2738
2020-02-27 20:53:33 -08:00
Kurt
0d4cff81c6 Clean 2020-02-15 14:29:23 -08:00
ReignOfComputer
fbcbbc7b05
Batch Editor Alert Fix (#2703)
Running a batch editor job in the same window pops the alert message in incrementing numbers until the window is closed.
2020-02-12 09:58:46 -08:00
Kurt
8e9664ba6c Update database filters
Allow if it can exist in SWSH
2020-02-11 20:23:59 -08:00
Kurt
239b2f4b52 Fix entree randomization for encounters with no special move
https://projectpokemon.org/home/forums/topic/56211-error-an-unhandled-exception-has-ocurred/

ty Pocket Monsters
2020-02-08 20:56:16 -08:00
matty
06522c2235 quality of life improvements on the mystery gift form (#2664)
* delete received items with the delete key

mass selection of received items for mass deletion as well
improved index selection on deletion

* tab indexing for the form
2020-01-26 11:19:58 -08:00
Kurt
1ba271db50 Fix block dump changing type on load
Loading the window and assigning the datasource fired the index changed event, changing the first block (array) to the (selected index of type), which was bool1. Exporting the save caused a bad block type write, yielding a bad size.

Only add the event after the constructor is finished, so that it only fires via user interaction.

Similarly reported but not exactly noticed in #2658
Closes #2663

Gonna update the release with a hotfix
2020-01-26 09:24:00 -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
9b6a10df46 Extract metadata-reflection class to PKHeX.Core
separate GUI logic from non-gui logic :)
2020-01-24 17:57:47 -08:00
Kurt
0b0d534fd4 Order unknown blocks in dropdown by block type
Typing in the key to the combobox should immediately start filtering. We can't put the block type first, as we can't quickly fetch a block by key.
So, just trim off everything but the key when we start ordering things. They're already in order by ascending key -- the known blocks have already been pulled to the top and can be sorted without modification.
2020-01-24 17:38:31 -08:00
Kurt
46156b48c6 Add missing generation to accessor type name
Now matches Interface declaration style (iAccessorGenGame), and is consistently named with the other accessors already using the same naming style
plus they are now ordered in the file tree :)

no functional change
2020-01-23 23:22:54 -08:00
Kurt
fb02295c70 Use object block names in diff 2020-01-23 23:19:38 -08:00
Kurt
2adbca628b Add raw value edits
Not done for Array types or Object types
muh reflection, such spooky

mark Offset as non-browsable so it doesn't show up in propertygrid if the block is being edited by a grid :)

I imagine a struct-type-sensitive array property grid edit could be done via Buffer.BlockCopy to a dest array, but there's so few Array blocks... so meh
2020-01-23 21:30:39 -08:00
Kurt
52309fd0d2 Add PropertyGrid for direct block edits
Hold control when selecting the block to just view the hex like any other block
dunno how I wanna handle typeconverter for a valuetype block :\
2020-01-23 20:34:18 -08:00