Commit graph

394 commits

Author SHA1 Message Date
Kurt
1c4a1af633 Misc updates
Detect channel, only detect Channel PIDIV for RS origin (only really
care about method1/2/4 being used when it shouldn't)
Channel does this weird thing called not setting the met level.

Refactor set suggested met location to a method that can suppress
popups.
2017-06-29 19:32:29 -07:00
sora10pls
ef822b12ae Misc Editor changes 2017-06-29 18:14:42 -04:00
Kurt
587d0ea9fc Misc ribbon editing qol
sort ribbon checkbox names alphabetically
hovering over ribbon displays ribbon name ('what is this ribbon
called?')
2017-06-29 09:03:56 -07:00
Kurt
bf6ef284b1 Move contest stat to separate usercontrol
#1272
Smart label now appears for gen 3-5
2017-06-25 10:57:35 -07:00
Evan Dixon
560f4eab0b Target netstanard1.3 and net46
I recently learned about targetting multiple frameworks in .Net Standard libraries. The main benefit here si taht PKHeX.WinForms and PKHeX.Tests no longer need to carry around the .Net Core DLLs. While it's now an option, I encourage PKHeX.Core to avoid framework-specific compiler directives.
2017-06-24 08:12:35 -05:00
Kurt
a4c0927d9c Fix batch editor filter check
passing an object with a type from another assembly will have
obj.GetType() return a System.RuntimeType, which is absolutely not what
we want.

supply the pkm derived GetType

why is this so wonky

Closes #1266
2017-06-23 21:19:22 -07:00
sora10pls
9cd85bf1db Misc4 updates 2017-06-23 15:47:52 -04:00
Kurt
5b5c9d0017 Move ribbon name resources to string dictionary
multilang support now possible, other language translation files added
from existing form translation file

feel free to submit a pull request to change anything for your native
language :)

Closes #1250
not gonna add the alt sprites/names for pk3's
2017-06-22 21:56:41 -07:00
Kurt
86e0374efc Update poketch dropdown/set
#1263
2017-06-22 19:18:14 -07:00
Kurt
f59782a479 Add remove all held items of boxdata
part of the winforms api, unused by pkhex
closes #1264
no need putting held items in inventory as the inventory can be edited
outright
2017-06-22 18:51:46 -07:00
Kurt
0aec466965 Fix loading boxdata/pcdata
the input == 0 checks only applied to gen4+; pk1/2/3 do not have a
sanity at 0x4
Closes #1262
2017-06-22 17:52:11 -07:00
Kurt
aa67a63893 Allow alt-click preview to import showdown
Alt-Click species may not always be visible, simple enough
2017-06-21 21:57:59 -07:00
Kurt
1815a7f273 Add current poketch app selection
Closes #1260
2017-06-21 21:07:07 -07:00
Kurt
606a091523 save/read gen2 pkrs
instead of ignoring it
#1257
2017-06-21 20:31:51 -07:00
Kurt
e697a9edc7 Block parties without battleable pkms
#1257
not perfect but less restrictive, probably more obvious.
2017-06-21 20:24:42 -07:00
Kurt
36b75179f3 Update level/egg behavior
Similar to how anything higher than 255 is dropped to 100, setting level
to 0 will overwrite it to 1. Current level is just a derived property
from EXP, so it's just a display property in the editor.

Toggling IsEgg for gen4 won't flag as nicknamed.

#1257
2017-06-20 22:57:22 -07:00
Kurt
5b15483914 Allow Old Sea Map to be skipped on nonJP
Closes #1255
2017-06-20 22:24:02 -07:00
Kurt
8cc3a36708 Add manaphy egg sprite
Closes #1256
2017-06-20 22:19:04 -07:00
Evan Dixon
2636e7ded8 Fixed another potential blank error message
I also added comments where appropriate, because it took far too long to understand what was going on when reviewing the commit that fixed the original bug.
2017-06-20 20:38:33 -05:00
Kurt
2db061d15d Fix blank error message
Closes #1251

Thanks @ReignOfComputer for finding the source :)
2017-06-20 18:16:29 -07:00
Kurt
1a9da12404 Misc updates
fields->properties, capitalize
fix pkm fields toggle referencing old pkm file, simplify that process
instead of constantly referencing Format
2017-06-20 17:57:23 -07:00
Kurt
b4222c756a Refactoring
reduce cross-class chatter, simplifly large methods to smaller pieces
some speed improvements
2017-06-18 22:27:40 -07:00
Kurt
5b4cedf14b Refactoring
Rewrote showdown set exporting to be much clearer, added auto-fixing of
relearn moves when importing showdown set (applies suggested relearn
moves)
Simplified main form loading routine (from ~160 to ~25 by extracting
methods)
2017-06-18 13:02:02 -07:00
Kurt
b5d2db6610 Add shinyleaf/pokeathlon stat legality check
#1236
2017-06-17 22:16:24 -07:00
Kurt
da6f880c16 Add Shiny Leaf editing
Closes #1236
pk4/bk4 only, obviously

side note, using static events is no-no, designer auto-removed them.
just manually reapply (as well to others that used it)
2017-06-17 21:49:14 -07:00
Kurt
13d3e515f0 Flag save as edited when unlocking friend safari
Closes #1241
2017-06-17 19:27:35 -07:00
Kurt
258f660a90 Misc fixes
Immediately hide legality indication if hax
invert blank sav check (refactoring oops)
Closes #1238
2017-06-17 19:20:37 -07:00
Kurt
3f38b123a3 Refactoring
mostly renaming things, includes a little bit of added sugar and
splitting methods to simplify the codebase.

all methods are now PascalCase
2017-06-17 18:37:19 -07:00
Kurt
5d50f58d86 Add pk1 catchrate refresher to current species
Label_Species already has a click event for showdown sets with a
modifierkey; add a default behavior which checks for pk1 and if so, sets
the catch rate to the current species.

Users shouldn't have to look up catch rate values or be responsible for
editing them; they are currently handled by the pk1 object. Setting a
species ID checks if the catch rate is within the species lineage, and
only updates it to the current species if the rate doesn't match any.
With this change, the user can force the catchrate to match the current
species (then change back to the evo form) instead of having to change
the species to a separate lineage that does not have the current (not
displayed) catch rate value.

Closes #1235
2017-06-16 18:56:17 -07:00
Kurt
8f833d8171 Simplify max item count give/modify
999 is true max, set suggested give count to -4 from max (or 1).
Apply giveAll's max value restriction to modifyAll
Prevent giveall/modifyall for PCItems/FreeSpace due to mixed item types.

Closes #1228
Closes #1227
2017-06-14 18:43:28 -07:00
Kurt
86720b547b Add <=gen3 pouch giveall
Closes #1225
Resizes array if too long, allows random set or standard (sequential)
set.
2017-06-14 08:42:49 -07:00
Kurt
8a4c40908b Enforce met location matching for crystal data
Only while format == 2
improve detection for gen1/2 ingame trades
2017-06-12 18:15:26 -07:00
Kurt
cf8f6573f2 Use savefile for personalinfo form count
BW has forms that aren't present in b2w2; expect the same for usum<->sm

splash screen opacity change for fanciness
2017-06-11 18:23:18 -07:00
Kurt
ffa7529e0f Misc database tweaks
delete now interacts with the box manager, now clears from any box
viewer that is open
filtering to just boxes now filters out the external sav pkm
filtering sources now is done prior to any field filtering
2017-06-11 11:08:03 -07:00
Kurt
5117f3a5c9 cap entry of Yellow pikachu friendship
gen1 trainer editor, 0-255

https://projectpokemon.org/forums/forums/topic/40817-request-autoset-yellow-pikachu-friendship-to-255-if-user-inserts-number-higher-than-255/
2017-06-11 00:25:21 -07:00
Kurt
21ab0296f3 small optimizations
Add ccitt method to checksum an existing array
reduce linq usage (faster save retrieval)

misc4 line endings?
2017-06-11 00:23:04 -07:00
pokecal
753964c138 fix Gen4 Misc Resources
add missing FlyDst and use MetLocation string.
add TrainerCard flags to FlagEditor.
add Pt resources.

fix HoneyTree, the BlockOffset needed.
2017-06-11 03:20:55 +09:00
Kurt
8a1691eb91 Let pkmdb fetch from save backups
Only if compiled in debug; bumps my searchables to 6 figures lol

bulk legality scan yielded one exception (bad CXD pidiv for starters)
bullk sav fetch yielded one exception (unknown type didn't define
SeenFlagOffsets)
2017-06-09 23:13:41 -07:00
Kurt
0f040fb6e0 remove typo
Closes #1210
2017-06-09 08:56:28 -07:00
Kurt
63b18ff51f Fix misc problems
flag undistributed gen3 events
fix gen3 string writing (resized then expanded yields 00, missing
terminator), closes #1204
fix stackoverflow, fix pkmeditor template loading save prompt, closes
#1207
2017-06-08 20:57:30 -07:00
Kurt
1433ffd823 Remove double close event
Closes #1203
2017-06-07 22:19:49 -07:00
Kurt
0c3333137b Relocate legality request to main form
changes to an event; no longer duplicates the behavior for the pkm tabs
show legality
#1193
2017-06-04 13:35:51 -07:00
Kurt
14225bbc2e misc fixes
encounterinvalid isegg no longer throws exceptions when parsing moves
dropping invalid file paths to main window are now ignored (downloads
from chrome can be manually deleted but still dragged from the downloads
bar)
add pidiv case for manaphy gift
2017-06-04 00:12:37 -07:00
pokecal
e85e155c65 add FRLG TrainerCard PokemonIcons
I don't know why Chimecho is listed at the very end.
2017-06-04 13:54:16 +09:00
Kurt
59ac78b70a Fix usercontrol clipping
set the usercontrol to inherit from whatever it is placed on; fixes the
clipping issue noted in the forums

Thanks english09, wejhvabewjty, & zkrxpdlf3!
2017-06-03 20:25:00 -07:00
Kurt
aed6dffce4 Merge pull request #1186 from pokecal/master
add BW2 resources
2017-06-03 14:00:57 -07:00
Kurt
32deb3879a Simplify Shiny SID creation
calculates a passing SID and applies random bits to not be too
predictable
no need to bruteforce
2017-06-03 08:58:30 -07:00
javierhimura
814e63aa1c Add Control key modifier to set shiny button to change the pokemon SID instead of the PID, that allow the change shiny of gen 3/4 pokemon without turn the pokemon in illegal because PID/IV mistmatch
Added Cherrygrove City to surf headbutt encounter locations, the upper right trees on the map can be reach from the water in route 30
2017-06-03 12:02:22 +02:00
pokecal
497f0c62b2 add BW2 FunfestMission controls
The entree level can display 9999 in game,
but fixed to 999 when it change.

MAX PassPowers require 9999 costs.
2017-06-03 14:35:24 +09:00
pokecal
c54cd30a3c add EventFlags resources BW2
resources about legendaries
2017-06-03 11:45:24 +09:00
Kurt
f70bd02d69 Fix wurmple evo lockup
while loop wasn't checking the modified EC value, thus looping forever
standardize usage across core
2017-06-01 18:41:22 -07:00
Kurt
2fb3cd5207 Fix template loading behavior
Closes #1181
move preview sprite fetch to the absolute end
2017-05-31 21:27:46 -07:00
Kurt
e522094679 Fix pkm editor behavior
Closes #1180
2017-05-30 20:50:15 -07:00
Kurt
11aab91eee Fix drag&drop exception
immediately after dropping the file, move the mouse outside of the box
slots
DoDragDrop re-performs the drop event at the same coordinate as the
mouse; if the mouse isn't outside of the box area it'll do nothing, thus
the need to create a new event to fire.

Closes #1178
2017-05-30 19:17:37 -07:00
Kurt
f60f36081a Fix relearnmove suggestion for set relearn moves 2017-05-30 18:28:06 -07:00
Kurt
2e30878e8b Update 170530
Update event binaries
unban gen3 mega evo stones
fix a lil bit of behaviors
2017-05-29 22:34:45 -07:00
Kurt
3eedf1a6d5 Run database search async
disable button while searching, prevents GUI locking up when searching a
large database.
2017-05-29 19:18:18 -07:00
Kurt
8b833c0c15 Add null check for invalid origin pkm
Closes #1173

info isn't set if the species is invalid or the origin generation is
invalid
lazy fix
2017-05-29 10:52:41 -07:00
Kurt
550153e3bc Improve gen3 sav detection
better detect RSE collisions
add auto-detection for japanese games
Closes #1172
2017-05-29 10:33:27 -07:00
Kurt
9a7dc9998c Misc fixes
Track gen1/2 origin game as well  as generation
fix pk2 gender setting (incorrect bitmask & wasn't set from tabs)
extend female gender check for gen2 to apply to GS encounters -- if met
location is missing, was traded to gen1 which clears gender.
2017-05-28 16:56:51 -07:00
Kurt
87e99bf183 Split reflection usage for winforms project
batch editor needs more powerful variant which can check the base
properties as well; just use the older code from before the .NET
standard commit.

Closes #1158
2017-05-28 14:49:36 -07:00
Kurt
8eed9f84ba Fix pk1 catch rate overwriting
CatchRateIsItem is always false, thus the catch rate was always
overwritten with the base species catch rate regardless of if the base
species was the encounter.
For species like Metapod who have different catch rates from their base
species, this would invalidate any Metapod capture. So all possible
catch rates are checked.

Instead of setting the catch rate to the base species catch rate, set it
to the current species. Allows user to set the exact catch rate by
toggling between a legendary and the target species...
2017-05-28 13:19:48 -07:00
Kurt
858aa50689 Refactor encounter matching
exercise in deferred execution/state machine, only calculate possible
matches until a sufficiently valid match is obtained. Previous setup
would try to calculate the 'best match' and had band-aid workarounds in
cases where a subsequent check may determine it to be a false match.

There's still more ways to improve speed:
- precalculate relationships for Encounter Slots rather than iterating
over every area
- yielding individual slots instead of an entire area
- group non-egg wondercards by ID in a dict/hashtable for faster
retrieval

reworked some internals:
- EncounterMatch is always an IEncounterable instead of an object, for
easy pattern matching.
- Splitbreed checking is done per encounter and is stored in the
EncounterEgg result
- Encounter validation uses Encounter/Move/RelearnMove/Evolution to
whittle to the final encounter.

As a part of the encounter matching, a lazy peek is used to check if an
invalid encounter should be retained instead of discarded; if another
encounter has not been checked, it'll stop the invalid checks and move
on. If it is the last encounter, no other valid encounters exist so it
will keep the parse for the invalid encounter.

If no encounters are yielded, then there is no encountermatch. An
EncounterInvalid is created to store basic details, and the parse is
carried out.

Breaks some legality checking features for flagging invalid moves in
more detail, but those can be re-added in a separate check (if
splitbreed & any move invalid -> check for other split moves).

Should now be easier to follow the flow & maintain 😄
2017-05-27 21:17:57 -07:00
Kurt
25bdeb8053 Merge branch 'master' of https://github.com/kwsch/PKHeX 2017-05-27 14:25:12 -07:00
Kurt
5ee918d62c Fix form being altered during load
Closes #1167
Thanks @Odaxis !
2017-05-27 14:25:07 -07:00
pokecal
32815d0c4b add BW2 KeySystem Unlock
I excepted first 8 keys(used for check selected value),
they are very easy to edit in game.
2017-05-27 19:32:19 +09:00
pokecal
0cae317770 add EventFlags resources BW
I recently noticed that some activation use TID/SID,
I will re-check past resources that have abnormal value(e.g.AzureFlute),
after researching BW2,Pt.
2017-05-26 19:17:28 +09:00
Kurt
be80a6b9da Fix HGSS wallpaper get/set & editing
the special wallpaper values are +0x10 (ie 0x20, 0x21... instead of
0x10, 0x11) from the contiguous sequence of regular box wallpaper IDs
(anti cheat probing?).

Xor tweak allows for single invert method; use this invert with the base
implementation's method.

Range check for setting the box wallpaper (just in case). The underlying
error was fixed; the 255 val was reading from the wrong offset (now
fixed).

Thanks Scarfy!

https://projectpokemon.org/forums/files/file/1-pkhex/?do=findComment&comment=344
2017-05-23 21:38:15 -07:00
Kurt
7e30d863b0 Revert dexlevel evotree fetch + re-implement fix
check requireslevelup during evolution validity check, not during tree
generation as movepool fetch treats the 'level' as the max possible
level it was at (not the level it was encountered).

fix dropping pkm from external source causing exception (final return
false caused it to proceed with regular dragdrop operation from source
slot).

#1163
2017-05-23 18:35:32 -07:00
Kurt
a98c904168 Tweak level/exp changing events
move from validated to textchanged as the user expects the values to
live update
only use the value-cap on validation if the input is not associated with
another control's value
this is now consistent with the IV/EV updating stats

#1163
2017-05-23 17:46:32 -07:00
Kurt
2e1c0b9c48 misc loading fix
gen1/2 games with new pkm editor no longer cause an exception on init
load
2017-05-23 08:28:53 -07:00
Kurt
11b2dc35d7 Refactor main form into smaller pieces
pkm editor, sav editor, menus, and a manager to glue the storage slots
together
decouples the pkm/sav editors from a static savefile reference.

improves dragdrop/click view/set/delete indication, hides unavailable
contextmenuitems, and fixes a few incorrect references. Box Subviewer
slots now have all the indication/events that the main save editor slots
have.

pls report behavior bugs 👍
2017-05-22 21:55:12 -07:00
pokecal
ea33a2cb77 add EventFlags resources HGSS
Fix DP for consistency.
(now all DP&HGSS flag/const position number is same as in game used)
Checked with HG. SS not checked. (Groudon flag unknown)
2017-05-19 11:21:27 +09:00
Kurt
46c0f4f30c Add exporting pkm/mg from mgdb
Closes #1151 by extending functionality instead of limiting it :)

Users can now export Mystery Gifts from the database in either
MysteryGift files or converted PKM form regardless of current generation
2017-05-18 18:10:58 -07:00
Kurt
da3d8c99be Misc refactoring
move some open/save file dialog events out of the main form
update main form logic to reflect newly flagged pkm cases
2017-05-17 22:00:06 -07:00
Kurt
a415ca78df Fix folder location fetch & x/c/bk# extension fetch
Closes #1149
2017-05-17 20:39:10 -07:00
sora10pls
c6c76c3983 Folder List enhancements 2017-05-17 21:25:48 -04:00
Kurt
de3b89c409 Tweak path loading
no Nintendo 3DS => null => getPathRoot(null) => exception
provide a fake root if the folder does not exist (to ensure that the
buttons are created with an unavailable path).
Closes #1140
2017-05-16 21:44:02 -07:00
Kurt
7edc2eb14f Add report exporting to clipboard
Closes #1141
cleaner look maybe in the future (colorized)
2017-05-16 21:15:32 -07:00
Kurt
f674d45854 Misc changes
Properly handle egg hatch counters for generated mystery gifts, as well
as HT friendship for gen6+
fetch form specific (friendship doesn't change but abilities fetch
species specific data later, so just fetch once up front). Do not depend
on save file as SAV7 importing PGF may have different abilities
allocated
Pad buttons for folder popup
fix double Japanese/International error message for importing jpk1<->pk1
2017-05-16 20:34:24 -07:00
Evan Dixon
e254ec7c37 Activate illegal mode with commandline arg
Workaround for PKHaX being broken. Trimming each argument allows "hax", "-hax", and "--hax" to all work for activating illegal mode.
2017-05-16 20:55:24 -05:00
Kurt
1659405dc4 Add quick folder open menu item
Closes #1137
allows loading of tab separated value text file "savpaths.txt" which can
also be used to 'favorite' locations (ie, the program checks for
duplicate paths and only adds the first).
folder availability checked on form creation

shortcut: press ctrl-F on main window

Thanks @sora10pls !
2017-05-16 16:27:43 -07:00
Kurt
f3ca370087 Merge branch 'master' of https://github.com/kwsch/PKHeX 2017-05-16 08:56:16 -07:00
Kurt
2bfa98db09 Refactor dragdrop managing logic
Relocate class out of main form for reusability/less lines in main.cs
refactored to be a bit more oop
2017-05-16 08:56:13 -07:00
Delphox
a7d9566963 Missing hash from gen 6 qr injection url 2017-05-15 17:07:07 -03:00
Kurt
6f64c9be8e Fix update check url
version txt was in core project prior to refactor

Also restrict 3IV randomization to gen6+ (sub)legends.
Closes #1131
2017-05-15 08:27:19 -07:00
Kurt
404651774a Further simplifications
Gender color display was copypasted everywhere, now just call the gender
color method.
2017-05-13 12:51:33 -07:00
Kurt
5ec3521d48 More c#7 shorthand
outs & pattern matching, other simplifications
2017-05-13 10:20:25 -07:00
Kurt
bbdb21c626 Separate forms from clone check
Only really useful for unowns that have been RNG'd to have the same
PID...
2017-05-13 00:04:04 -07:00
Kurt
5461cdaa4b Fix language translation fetch by name
wrong method was called, specify file by exact name
Closes #1127
2017-05-12 20:44:12 -07:00
Kurt
a70a4d5e3f Switch to c# 7 get/set expressions
Add gen5 battle box locked flags
no functional change otherwise, just shorter
2017-05-12 20:32:43 -07:00
pokecal
d134abcd4a add EventFlags resources DP
This resources include some flags, not all,
that be changed when defeated/captured in game,
but sufficient to repop.
2017-05-13 10:15:13 +09:00
Evan Dixon
4139d42e02 Merge pull request #1124 from kwsch/f/dotnet-core
Add missing package for MemeCrypto in .Net Framework
2017-05-12 17:16:23 -05:00
Evan Dixon
23f2c9dcaa Add missing package for MemeCrypto in .Net Framework
Closes #1123
2017-05-12 12:16:11 -05:00
Kurt
aeb90d262c Cleanup 2017-05-12 09:33:12 -07:00
Evan Dixon
916c352fba Added packages required by .Net Standard 2017-05-11 23:41:18 -05:00
Evan Dixon
52c4fbbe97 Converted PKHeX.Core to .Net Standard
Refactored and rearranged things as needed to allow the change
2017-05-11 23:34:18 -05:00
Kurt
83962419db Simplify trash editing load
Gen5 allows editing of the final terminator; just use the raw length as
the amount of trash byte entries to show.
2017-05-10 22:52:14 -07:00
Kurt
1b7e0e630c Add template loading when sav loaded
Closes #1114
Loads a template file (if it exists) instead of applying default
template info when a new save is loaded. No formats are hardcoded, as
ck3!=xk3!=pk3!=bk4
2017-05-10 19:24:58 -07:00
Kurt
6d9cbaaec0 Add IOException type write protection check
per recent forum thread
2017-05-10 19:01:01 -07:00