Commit graph

29 commits

Author SHA1 Message Date
Kurt
a9892203c7 Refactoring
extract pkm loading routines to smaller methods
reduce code duplication (rely on empty setters to ignore some calls)

should be much easier to understand the load/save process; the original
setup (pk6) was following the structure from 0x00-end, no point still
doing that as everything is now abstracted.
2017-10-02 23:13:40 -07:00
Kurt
1e377c2963 interpolation++
no functional change (assumed)
2017-09-29 22:58:25 -07:00
Kurt
ed1b934374 Misc refactoring
expose some useful IEnumerable methods (sorting / bin->pkm / copy) to
simplify some common operations
change some explicit arrays to IList for flexibility
remove old memecrypto bool (no longer necessary as XP is not supported)
rename some methods for more clarity
2017-09-28 22:20:27 -07:00
Kurt
5b0e431347 Revert "Uncap max box ID for gen6 not-XY saves"
This reverts commit 9869335151.
2017-08-26 08:41:18 -07:00
Kurt
9869335151 Uncap max box ID for gen6 not-XY saves
Closes #1411
2017-08-25 17:25:42 -07:00
Kurt
47dcb56090 Misc fixes
static-wild encounter g4 collision (abra gift), closes #1390
off by one pokepuff strings
unshuffle bk4 ribbons
pgt bad sanity events now auto-sanitized
2017-08-10 20:51:27 -07:00
Kurt
c12eba2186 Add Gen6 mega evolution early-unlock edit
TrainerCard offset is 0x14000
http://i.imgur.com/XtsZLmL.png

via:
33011937 ekx
182491428 hbg
tyvm anon
2017-07-12 20:38:24 -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
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
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
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
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
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
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
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
36515b8178 Prevent moving boxes if any team slot is in box
Closes #1079
2017-04-19 20:54:49 -07:00
Kurt
691493cafe String editing refactor
Move all sanitization operations from PK* and SAV* to PKX; add general
method for fetching a generation specific string
Changes the Text subform editor to show trash bytes when appropriate.
Special characters to be shown can be easily inserted in the future.
2017-04-09 14:06:50 -07:00
Kurt
e779498aae Cap gen6 boxes unlocked at 30
Closes #975
Doesn't hide the 31st box from the editor, only prevents
adding&selecting 31 from the dropdown for unlocked count.
2017-03-23 18:17:22 -07:00
Kurt
127d2c2aaa static analysis fixes
fixes the friend safari form checks (if else were chained incorrectly)
argumentorder of some unused sections (BV date, canlearnmachinemove)
2017-03-20 00:03:31 -07:00
Kurt
19600263bd Fix 'complete dex' macro seen bit setting
Only set if the gender allows for it
Could possibly check the enabled state instead but this is more obvious

Closes #772
2017-03-04 17:32:07 -08:00
Kurt
a5e09bfe31 Fix legal move selection allowing future moves
Initially populated with a filtered list, was unfiltered when
repopulated for legal moves. Just split legal/illegal, have the main
form choose which one is the stored list.

Remove unnecessary linq for other forms
2017-02-13 21:20:10 -08:00
Kurt
1233a29661 Hide multiplayer icon (or/as) for X/Y saves. 2017-02-09 22:55:04 -08:00
Kurt
2f5b5790db Add xy trainer nickname
Closes #283
2017-02-07 16:25:13 -08:00
Kurt
25f6b5259b Refactoring
Add documentation for PKM/PKX, move some code around
2017-02-04 18:27:28 -08:00
Kurt
b370c26542 Fix g6 multiplayersprite clearing
Closes #743, thanks @PrometheusG !
2017-01-25 08:51:05 -08:00
Kurt
f4797e06a0 More refactoring
More extension methods for other types of images
2017-01-11 22:28:35 -08:00
Kurt
db5e084ef9 Further refactoring
Move System.Drawing usage out of Core to WinForms, as System.Drawing is
not in .NET Core/Standard. Simple methods to return resource name
strings have been added instead.
2017-01-11 17:55:42 -08:00
Kurt
1e3a46d760 Find replace is bad 2017-01-08 15:27:00 -08:00
Kurt
595c7eb4c5 Split winforms to separate project
resources still are associated with winforms, eh
program still runs fine and I've replicated the mono build options. lmk
if this breaks stuff
2017-01-07 23:54:09 -08:00