Commit graph

309 commits

Author SHA1 Message Date
Kurt
025cf69eeb Switch pkm export formats to party format
Now dumps party format bytes
Cons: more space
Pros: stats are retained, especially when users drag-drop.

Closes #2419
2019-11-16 14:03:25 -08:00
Kurt
981ed9a253 Add technical record flag editor & api 2019-11-15 23:12:28 -08:00
Kurt
f0dfaa2e50 Add temp hotfix for broken swsh saves 2019-11-15 21:33:23 -08:00
Kurt
cefb56a749 Sword/Shield Update 2019-11-15 17:52:08 -08:00
Kurt
a6b6383538 Handle more messages
un-nest some classes, tooltip/menu disposing
2019-10-27 20:39:15 -07:00
Kurt
b8835facd5 Rename public "pkm" properties to non-lowercase
lowercase = local variable or private member
2019-10-27 12:57:04 -07:00
Kurt
46640d48a3 Misc clean
un-nest classes,
move some logic to core,
update some get-only properties that return arrays to methods
2019-10-26 12:58:55 -07:00
Kurt
e3efa65160 Cleanup
handle messages for dirty cleaning :)
2019-10-26 12:33:58 -07:00
Kurt
02420d3e93
PKHeX.Core Nullable cleanup (#2401)
* Handle some nullable cases

Refactor MysteryGift into a second abstract class (backed by a byte array, or fake data)
Make some classes have explicit constructors instead of { } initialization

* Handle bits more obviously without null

* Make SaveFile.BAK explicitly readonly again

* merge constructor methods to have readonly fields

* Inline some properties

* More nullable handling

* Rearrange box actions

define straightforward classes to not have any null properties

* Make extrabyte reference array immutable

* Move tooltip creation to designer

* Rearrange some logic to reduce nesting

* Cache generated fonts
* Split mystery gift album purpose
* Handle more tooltips
* Disallow null setters
* Don't capture RNG object, only type enum

* Unify learnset objects
Now have readonly properties which are never null
don't new() empty learnsets (>800 Learnset objects no longer created,
total of 2400 objects since we also new() a move & level array)
optimize g1/2 reader for early abort case

* Access rewrite
Initialize blocks in a separate object, and get via that object
removes a couple hundred "might be null" warnings since blocks are now readonly getters
some block references have been relocated, but interfaces should expose all that's needed
put HoF6 controls in a groupbox, and disable

* Readonly personal data
* IVs non nullable for mystery gift
* Explicitly initialize forced encounter moves
* Make shadow objects readonly & non-null
Put murkrow fix in binary data resource, instead of on startup
* Assign dex form fetch on constructor
Fixes legality parsing edge cases
also handle cxd parse for valid; exit before exception is thrown in FrameGenerator

* Remove unnecessary null checks
* Keep empty value until init
SetPouch sets the value to an actual one during load, but whatever

* Readonly team lock data
* Readonly locks
Put locked encounters at bottom (favor unlocked)

* Mail readonly data / offset
Rearrange some call flow and pass defaults
Add fake classes for SaveDataEditor mocking
Always party size, no need to check twice in stat editor
use a fake save file as initial data for savedata editor, and for
gamedata (wow i found a usage)
constrain eventwork editor to struct variable types (uint, int, etc),
thus preventing null assignment errors
2019-10-16 18:47:31 -07:00
Kurt
4baf745af8 Use some c#8 sugar
static local functions
switch expressions
using usings :)

nullable next?
2019-10-07 18:40:09 -07:00
Kurt
87f43a47d8 Bump lang version to 8
some lang upgrades
2019-10-04 20:10:50 -07:00
Kurt
ffe3a4ba15 Relocate resource naming for sprite fetch to draw 2019-10-03 18:23:40 -07:00
Kurt
c2d5d0cd42
Add .NET Core 3.0 build option for WinForms project (#2396)
* Move pkhex.drawing calls out of form constructors

designer doesn't like it; if Main can't be designed then there's some
call that it can't process for whatever reason

* Add netcore3 targeting

Closes #2198 by adding a netcore3 build option
Closes #2391 by retaining designer functionality and net46 builds
2019-10-01 18:12:08 -07:00
Kurt
94baab1c45
Split off image generation to separate project (#2395)
With the approaching games, PKM sprites are a different size from the 3DS era (as already hinted by LGPE, which has 56x68). It'll be a little easier to manage with this portion of the library walled off from the rest of the codebase.

Eventually the net46 target will use fody or something to merge in these extra dependency dll's automatically to not disturb the usual exe/dll experience.
2019-09-29 09:47:06 -07:00
Kurt
c5ebbbbe15 Minor clean
Magic number -> const usage
default(T) -> default (c#7.x feature)
remove some unused stuff
fix indentation in some spots
2019-09-10 22:07:50 -07:00
Kurt
6d8ff992e2
Clean up / fix external drag in (#2383)
* stash

* Consolidate some logic
2019-09-03 19:54:41 -07:00
Kurt
b81a1e1e29 Refactoring
Increase abstraction for arbitrary slot get/set operations, and fracture
SAV4 behavior for each game type.

Adds: Undo/Redo of party slot changes
Fixes: Fixed Gen5 daycare slot 2 reading, and EXP reading
Fixes: Some slot color glitchiness
Fixed: Box layout editor now hides the flag label if no flags are
present
Fixed: Gen7 box flags are now shown (unknown purpose lol)
Changed: savefile objects are generally smaller (removed a few shared
offset fields)
2019-09-02 19:30:58 -07:00
Kurt
bf6c25eca7 Break up SlotChangeManager logic
A little bit cleaner when the logic is separated
Keep an abstraction of BoxEdit to cache the current box contents.
Already fetched to show sprites; any future fetches (for preview text /
hover sprite) can reuse the already fetched pkm data.

Should probably rewrite this stuff completely, but effort better spent
elsewhere
2019-08-20 19:50:28 -07:00
Kurt
cbd039b18c Extract datasource filtered lists to object
GameInfo has been the storage for the current Game Language environment
When using GameInfo, only one environment is tracked at a time, which is
initialized by the PKM editor (items, moves). Rework things to allow
multiple filtered sources to exist, and keep the filtering logic in
PKHeX.Core for reuse in other programs... ;)
2019-06-22 10:50:32 -07:00
Kurt
523c36d982 Add qr parse util
used in pkhex.mobile, might as well migrate some logic into core
I'd rather not untangle the decode-api response parsing to use QRUtil.
2019-06-18 20:10:01 -07:00
Kurt
de774ed131 readonly ComboItem
create once, never modified after
2019-06-01 19:12:41 -07:00
Kurt
9cdbc46740 Relocate apply basic template out of gui 2019-05-29 22:40:39 -07:00
Kurt
56eeca0cbc Use custom savefile extension detection for err msg
#2305
Catches the following as SaveFiles:
"srm", // RetroArch save files
"fla", // flashcard
"SaveRAM", // BizHawk
and whatever else is added by the init
2019-05-13 15:58:36 -07:00
ReignOfComputer
6c42e3b1bb Enhance Invalid Convert Error (#2305)
Makes it clearer for conversion failure with Pokemon files - prevent confusion with save files.
2019-05-13 15:38:33 -07:00
Kurt
5dcf2f4dc8 Use enum instead of nullable bool tristate 2019-03-29 17:52:26 -07:00
Kurt
7e864c67b7 Update assembly info (version)
now reflects 19/03/11
2019-03-11 06:23:48 -07:00
Kurt
5b29e71954 Misc tweaks
no functional change, just rewrite some logic for better flow
fix subform popup count restriction (OwnedForms requires forms to be
added/removed manually; it doesn't automatically update)

sanitize box names when dumping boxes with separate folders (and bad box
names)
2019-02-23 14:58:48 -08:00
Kurt
60e05f181b Allow disabling of savefile path detection on fopen 2019-02-22 23:04:10 -08:00
Kurt
a8c7307d4b Update shortcuts
ctrl-n used to be settings, but encounter database now uses it
add ctrl-w to close settings editor (undocumented)
document more shortcuts
2019-02-17 15:08:14 -08:00
Kurt
5167a816b4 Add drawsettings as saved program setting 2019-02-17 14:51:35 -08:00
Kurt
202f911d45 Tidy up comboitem fetch naming 2019-02-15 11:47:35 -08:00
Kurt
d1f6a5a3ff Misc clean
no functional change
2019-02-15 11:46:46 -08:00
Kurt
858760fa28 Misc updates
relocate program language enum
test that test case is proper
move getcompatible & gettemplate to core
remove catch rate changing for pk1 (catchrate editor now used instead)
2019-02-15 00:50:23 -08:00
Kurt
6f76a3b1ae Add setting to ignore "Legal!" popup
just plays sound
change 'bad field data' sound to Hand
2019-02-12 20:17:09 -08:00
Kurt
e82b4de657 Misc clean
replace Friendship control click to match shortcut description (used to
do nothing)
Remove some duplicate translation strings
fix gameselect string formatting
apparently systemsounds changed in a recent win10 update, Question is
now silent?? Exclamation is now the same as Asterisk (same as Beep?) Use
hand instead of Exclamation.
only use asterisk for notifications
2019-02-11 22:39:12 -08:00
Kurt
dc5cdc34d7 Remove FieldsInitialized and rename check method 2019-02-09 17:07:44 -08:00
Kurt
19ae752937 Extract color config to separate class 2019-02-09 13:15:37 -08:00
Kurt
aa022fad40 Misc refactoring
remove some null usages, return an empty array instead
reduce as arg
2019-02-01 23:08:03 -08:00
Kurt
945d853c54 Rename setting to more accurately describe purpose 2019-01-27 22:04:10 -08:00
Kurt
3b8dc42f1a Allow hidden settings to be displayed
hold control
2019-01-27 21:57:26 -08:00
Kurt
13c13d5f49 Update 1MB invalid savefile message
trickles down to memcard, which is still invalid. Use a more generic
message if a memcard is the same size as a regular savefile.
2019-01-22 19:32:22 -08:00
Kurt
13090c0ced misc gen1 updates
sav1: assign personal table based on (detected/provided) version
catchrate editor: allow to use savefile personal
remove gb era prompt whenever gb/blank loaded; have it as a setting (can
be overridden for VC now). keep allowgbera as autodetect
personaltable: track format for debugging purposes/info

update translations
2019-01-21 20:06:02 -08:00
Kurt
8652677a79 Misc tweaks
showdownset: contains char instead of string
gameinfo: static readonly array instead of redefining new on update
legality: order of operation / value reuse / simplification / comments
pkx: compare char instead of single character string
header/footer: move assignment into method as an out instead of ref
2019-01-20 21:55:28 -08:00
Kurt
053118512c load blank save after changing
don't wait for program restart
2019-01-16 00:27:29 -08:00
Kurt
9fd6d86b1d Merge game selection alert & prompt to 1 popup
https://projectpokemon.org/home/forums/topic/49080-multiple-exceptions-when-selecting-gen-3-blank-saves/

ty BlackShark :)
2019-01-15 22:26:45 -08:00
Kurt
53b2ca93b8 Update blank sav3 behavior
can now be selected & loaded without exception/hassle
2019-01-15 22:14:19 -08:00
Kurt
f89452bd41 Disallow GO blank save selection 2019-01-14 16:25:54 -08:00
Kurt
9a4f12c279 Misc updates
rearrange pkm version groups for clear break between
twins/siblings/family
clear pokelist for sav7b on non-exportable saves (prevents b1s1 from
showing markings)
rename horohoro (pgo) to non romaji lol, hide daycare/party tabs on
nonexportable save
remove some unnecessary operations
rewrite getallcontrolsoftype to remove ToList() and make generic
2019-01-05 15:40:25 -08:00
Kurt
559435e82e Simplify splash screen operation
remove silly idle loop, call close manually

remove initialization check for generating sprite; now only calls at max
2x when starting up = not necessary to bypass with a special variable
2019-01-04 22:46:52 -08:00
Kurt
c371a008e2 Handle dragout cursor sprite with override & spec=0
holding ctrl-shift-alt bypasses pkmeditor restrictions, which normally
blocks exporting a pkm with 0 species.

fix catch error string (underlines the space, lol), use escape ampersand
Found while explaining #2227
2019-01-02 19:32:23 -08:00