Commit graph

37 commits

Author SHA1 Message Date
Kurt
3fd21db51e Style & function extracting 2018-07-29 16:39:15 -07:00
Kurt
b749db10d8 Null check property value
EggMetDate, if none set, returns null.

https://projectpokemon.org/home/forums/topic/46265-batch-editor-bug-systemnullreferenceexception/
2018-07-15 08:46:31 -07:00
Kurt
8cf70770cf clean up batch editor
refactor some logic to make it easier to reuse
add some xmldoc
2018-05-18 19:19:15 -07:00
Kurt
d772a82953 Move batch editor logic to core
previous hurdle a year ago was propertyinfo fetching not looking at the
base class's properties; dig deeper for all properties to mimic existing
code for netframework

end result is batch editing now possible without gui
2018-05-17 22:43:07 -07:00
Kurt
e818a587ff Split Boxes and Party in batch editor
Closes #1948
2018-05-16 16:51:38 -07:00
Kurt
99005d8fc0 Refactoring
more discards & simplifications
2018-05-12 12:28:48 -07:00
Kurt
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
Kurt
e91cb806e5 Extract extension->prefer format method
fails for 'pkx' (returned 8 instead of 6); establish standard behavior
2018-04-21 14:38:18 -07:00
Kurt
1d4e815689 Extract more mesage strings
all common strings in forms used by multiple generations

would rather rework the individual generation strings to be unnecessary
with better interaction instead (if possible), as translating hundreds
of limited exposure strings is a drag.
2018-04-06 21:23:09 -07:00
Kurt
9ed2c594f2 Reorder form init 2018-04-02 20:36:13 -07:00
Kurt
42f5f9b051 Add smart move[] setter
Closes #1871 (smart-move setting is also done by batch editor)
2018-03-20 08:35:41 -07:00
Kurt
24982fe8c5 Misc simplifications 2018-02-28 21:05:50 -08:00
Kurt
a00f3ed894 random IVs with specified count
Closes #1553
removes duplicate logic in batch editor
2017-11-02 09:05:44 -07:00
Kurt
8c2dcb2dd3 Use generation specific species name
nickname resetting should use the generation specific value
2017-10-24 20:59:58 -07:00
Kurt
07133e22fd Add $suggest for HyperTrainFlags
#1521 didn't consider trick room speed IVs
can possibly consider EVs in the suggestion, but meh
2017-10-13 17:31:53 -07:00
Kurt
a28fe9d6a0 Allow batch editor to process many instructionsets
Closes #1521
separate each list with ;

=CurrentLevel=100
!IV_HP=31
.HT_HP=True
;
=CurrentLevel=100
!IV_ATK=0
!IV_ATK=1
!IV_ATK=31
.HT_ATK=True
2017-10-13 17:24:26 -07:00
Kurt
c7dfc3d9b0 Cleanup
union / count usages
remove unnecessary stuff
2017-10-06 21:03:23 -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
072f1ba83d Refactor level-evolution checks slightly
Allows evolution met level check to be skipped
Adds minimum level constraint for evolution chain generating

Closes #1430

also adds deferral to the gen3 encounter generator as encounterstatic
gifts can collide with wild encounters when transferred
2017-08-28 18:12:57 -07:00
Kurt
d4aff0632e Add ability to batch edit trashbytes
Raw editing of byte fields

.Nickname_Trash=$[]43,00,65,00,72,00,66,00,72,00,6F,00,75,00,73,00,73,00,65,00,00,00,00,00

only use cases are OT/Nickname trash bytes

not too concerned about speed re-parsing values or storing it to an auto
property; it's fast enough.
2017-07-04 22:22:04 -07:00
Kurt
4e9b6be8e5 Convert console output to debug output
output messages are now no longer in release builds, as they are only
visible when debugging in an IDE.
2017-07-01 19:43:51 -07:00
Kurt
788bd5ef8c Don't batch edit if no data to iterate over
Closes #1287
Setting PartyData with Length==0 throws an exception from the SAV
object; only process if necessary.

Felt like splitting the method up into smaller pieces.
2017-07-01 16:07:02 -07: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
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
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
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
Kurt
5bf14642e5 Expand logging for invalid batch edits
Closes #1003
If the pkm has a bad checksum/sanity or is in a locked slot, it never
incremented the counter. Just increment the counter anyway and write the
msg to console.
2017-04-20 21:04:51 -07:00
Kurt
68fe715774 Add party data editing for batch editor
functions properly for games without a party (RS BOX) by checking if a
party exists
if there's ever a game that doesn't have a box, it'll work for that too
:P
2017-03-21 19:27:45 -07:00
Kurt
0a1a30eb5a Update 170308
Tweak batch editor behavior to show Any first (used by any pk* type),
sort alphabetically too. Highlights the propertytype text if the
property is not present for the type.
2017-03-08 00:16:34 -08:00
Kurt
5c7ef42b54 Update reflection property fetching
Closes #919

Properties fetched would return PKM.cs properties (not declared in XK3
or PK3), such as Hidden Power Type.

The setter for Hidden Power type is unused everywhere, but was called
via reflection on transfer away from xk3/ck3 format. This caused IVs to
be tampered with in most cases.

By only fetching Declared properties (ie, within XK3.cs only), only the
'real' shared properties will be transferred. Extending this to the
batch editor, we can use this Declared-only filtering to grab more pkm
formats. While things are being updated, throw in pk1/pk2/bk4/ck3/xk3
formats to the dropdown.
2017-03-02 21:00:41 -08:00
Kurt
d248cdd280 Simplify batch editing
changes IV3 to faster variant used elsewhere,
sort properties alphabetically,
simplify 'any' intersection,
un-duplicate database filtering
un-duplicate box/folder per-pkm processing

-25 lines, a little bit of reorganization since the form has grown since
its initial inception
2017-02-10 23:54:36 -08:00
Kurt
3dc5e9d579 Add legality suggestion commands to batch editor
Closes #842
Adds in ability for custom properties
Suggestables are called via $suggest
Only properties supported are Met_Location, Moves, and RelearnMoves
2017-02-09 22:45:58 -08:00
Kurt
fa145ec510 Add nickname clearing for batch editor
.IsNicknamed=False
results in the species name being applied.
Closes #839
2017-02-09 20:52:24 -08:00
Kurt
b86321c142 Expand pk6/pk7 checks
As per comments on 75d460e
2017-01-27 23:33:36 -08:00
Kurt
37b3e58979 Add batch editor smart ability instruction
$0 or $1 or $2 for ability 1/2/4 (just think of it with 012345...).
Will set the hidden ability for every mon (AbilityNumber=4 and
Ability=PInfo.Abils[2])

#749 as promised
2017-01-25 23:03:57 -08:00
Kurt
1fcdffc654 Add pkm value indication
Grab an example PKM (from main window) to get the current value to
assist users in creating their modification scripts.

Added 3 tooltips for hovering over property/type/value controls
2017-01-08 21:06:15 -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
Renamed from PKHeX/Subforms/PKM Editors/BatchEditor.cs (Browse further)