Commit graph

6041 commits

Author SHA1 Message Date
Kurt
39d11f5f2f Simplify font logic
dont bother trycatching stuff that shouldn't fail
2019-10-26 23:14:00 -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
fcc993784b Rename abstract pkm inherited class names
leading underscore for a class name = pls no
2019-10-26 12:42:33 -07:00
Kurt
e3efa65160 Cleanup
handle messages for dirty cleaning :)
2019-10-26 12:33:58 -07:00
Kurt
64a5c30356 Add 4th uint of fashion data
struct is really 16 bytes, and female uses 8 bits of the final uint
Closes #2407
2019-10-25 19:54:50 -07:00
Kurt
1c418e8394 Add advanced format output
groups together by encounter slottype (grass, water, etc) for a little
more detail
2019-10-25 19:53:32 -07:00
Kurt
5dcee4fb9a Set random moves if GetMoveSet yields invalid set
Closes #2406
No clean way to check for these edge scenarios, so just double check the
moveset and return random moves if we fail
2019-10-24 18:11:25 -07:00
Kurt
4be35890e7 Make some usages generic 2019-10-24 18:10:23 -07:00
Kurt
f0b320eb28 Remove [Relic Gold] from g7 item banlist
Closes #2404 ty @CaptainBarnaklez (aka Glitch Guide Gabe on Discord)
2019-10-20 15:55:13 -07:00
Kurt
08a88b876f Dispose dialog forms after use 2019-10-19 20:33:37 -07:00
Kurt
bb84ec4e89 Handle some vs message suggestions 2019-10-19 20:33:17 -07:00
Kurt
12a8dc66b6 Fix displayed bit set for gen6
Zukan5/6 was pushing 0 for the formBit, which was an incorrect value. I
probably should have abstracted things since gen5/6 don't behave the
same as gen7

rewrite the SetDisplayedFlag for more clarity, and to early-return
without checking displayed state if the flag is being cleared.
2019-10-19 18:24:37 -07:00
Kurt
923b581fed Fix language flag set
looks like it was unfinished
2019-10-19 18:18:44 -07:00
Kurt
f77f0e8a4b Keep gen6 dex form flags
oops, forgot to include ...(+ i)

ty @Ammako

https://projectpokemon.org/home/forums/topic/55244-pokedex-displays-shiny-version-of-transfered-pokemon/?do=findComment&comment=249665

no need to set editing flag as I'm not changing anything

have sav6xy use the sav6xy accessor interface instead of the main one
2019-10-19 17:38:01 -07:00
Kurt
3b0fd81aae Rework & fix party slot deletion
Two birds with one stone:
- sav4 doesn't use Data (instead uses General/Storage), so we need to
use the abstracted method calls instead of trying to do things manually.
- setting a blank pkm at a party slot will decrease the party count!
don't decrease things twice.
2019-10-18 21:10:39 -07:00
Kurt
c3a6fd2a64 Handle bad gennumber indexes
Maybe returning 0 for "bad gen" will prevent bad array indexing...
2019-10-18 20:50:38 -07:00
Kurt
d4ce0644c8 Simplify block property names
[...]Block -> [...]  since it's kinda redundant, we already know by its
type.
Rename offset ints that collide
2019-10-18 20:42:03 -07:00
Kurt
4302347366 Show missing editors
yay useless integer stores instead of checking if an interface is
implemented
2019-10-18 20:26:41 -07:00
Kurt
abe87eb369 Relocate maison stats to block access 2019-10-18 20:13:21 -07:00
Ethan Dye
0551cec6eb Optimize all png images in PKHeX.Drawing (#2402) 2019-10-18 18:21:28 -07:00
Kurt
e05d75eeb7 More training bags
giff swsh
2019-10-17 23:02:01 -07:00
Kurt
546ff01e5e Minor tweak
don't allocate byte array, just set directly
2019-10-17 20:16:03 -07:00
Kurt
c24851129f Add super training block details & to block access
Use some properties in the super training editor, not gonna rewrite that
even though it really needs it :)
2019-10-17 20:13:17 -07:00
Kurt
fee92e4f32 Handle past gen transfer evochain for new evos
basically Math.Max(2, format);
we always want permissible evo chains when fetching encounters
Closes #2403 ty @Rayqo !
2019-10-17 18:23:50 -07:00
Kurt
be26074e1a Remove explicit mono build, update readme
With the FontUtil rewrite removing any platform specific code, there is
no need to have two separate builds.

Remove the unused ClickOnce target, never implemented.
2019-10-16 20:52:09 -07:00
Kurt
cf955e9fc7 Fix sav7 init
guess I never launched this format the entire week
2019-10-16 19:08:13 -07:00
Kurt
2367fbd69a Add docs for super training block 2019-10-16 18:49:01 -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
a70769dc76 Remove static encounter voltorb def
unused ingame; only electrodes are static

Closes #2399, ty @steph9009 !
2019-10-11 08:19:35 -07:00
Kurt
72aee7540d Enable nullable for drawing project
Found one NRE: daycare slot graying
Found one missing reference: GO icon (due to netcore3 refactor)
2019-10-07 19:10:38 -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
a792e58d49 Fix poketch logic
ushort poketch_def
{
enabled:1
unk1:1
unk2:1
color:3
unk40:1
unk80:1
unk:8
}
byte currentapp;
u825] unlockedflags
...app-specific data follows
2019-10-06 20:27:34 -07:00
Kurt
d249975895 Make current box reads s8 instead of s32
https://projectpokemon.org/home/forums/topic/55168-bug-report-pkhex-unable-to-load-pokemon-platinum-save/

saves with un-initialized boxes (FF'd) have 00 FF FF FF in the first 4
bytes
2019-10-05 14:32:40 -07:00
Kurt
e81deff512 Use pokegrid for encounter db browser
Add icons for the database contextmenu items
2019-10-05 14:29:15 -07:00
Kurt
40db929166 Re-add resources for inventory editor
Closes #2398
2019-10-04 21:23:54 -07:00
Kurt
87f43a47d8 Bump lang version to 8
some lang upgrades
2019-10-04 20:10:50 -07:00
Kurt
255cdc6ae0 Seal r2
https://www.reddit.com/r/csharp/comments/dd5c1o/til_sealed_override_modifier/

only a few instances for now
2019-10-04 15:56:22 -07:00
Kurt
d3b0c392b2 Minor tweaks
no functional change
2019-10-03 22:21:33 -07:00
Kurt
8d8adde2b1 sealed
sealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealed
2019-10-03 19:09:02 -07:00
Kurt
e104436924 Extract out filename fetch logic 2019-10-03 18:35:33 -07:00
Kurt
08561236f7 Relocate content not associated to SAVEditor 2019-10-03 18:29:53 -07:00
Kurt
ffe3a4ba15 Relocate resource naming for sprite fetch to draw 2019-10-03 18:23:40 -07:00
Kurt
39eedb1db2 Make PCBinary a method instead of get prop 2019-10-03 17:45:19 -07:00
Kurt
c0cdf81ca5 Default LGPE backgrounds to clean
Could iterate up and use the xy special backgrounds; just keep em simple
ty @sora10pls for pointing out this unintended behavior
2019-10-02 20:11:21 -07:00
Matt
72a751b9ce Update GO Shiny Banlist (#2397)
oddish family
2019-10-02 20:04:49 -07:00
Kurt
43e8b08ba8 Dynamically generate slot grids
Gen1/2 INT: 20 slots => 4 wide x 5 high
Gen7lgpe: 25 slots => 5x5
otherwise: 6x5
(maintain 5 rows)

Database(s): 6x11

Could probably wrap the initialization logic (grabbing savefile, etc)
but works for now

This is all in prep for box sprite resizing (56x68 as evident by lgpe
sprites); figured I'd add some display flexibility to handle prior games
with non-30/box layouts.

shave off a couple pixels for popup box view to make the edges of the
box directly at the edge (-2 bot, -1 right side)
2019-10-02 20:04:12 -07:00
Kurt
93ebbb10a7 Weave net46 dlls into single exe
back to the 1-file distribution strategy
2019-10-01 19:55:12 -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
7db0657711 Fix context view/set/delete action
oops, dunno what commit broke it
2019-09-28 19:29:15 -07:00