Commit graph

418 commits

Author SHA1 Message Date
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
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
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
Kurt
f47382e34f Fix GetUnderlyingControl call from ContextMenuStrip
https://projectpokemon.org/home/forums/topic/55096-unhandled-exception-error-pkmdb/?tab=comments#comment-249235
had recently moved the contextmenu to the designer, event handler has
sender as the ContextMenuStrip

use recursion -> while loop so that the input can be any of the 3 cases;
it'll drill down until it gets a picturebox or none.
make generic for giggles, update usages so Array.IndexOf uses
picturebox[] instead of object[]
2019-09-24 18:14:15 -07:00
Kurt
ab0b8979e9
Add swsh content placeholders (#2392)
placeholder content until real data is dumped
2019-09-23 16:56:47 -07:00
Kurt
7819c16792 Use slice operation instead of linq chain
Reuse IsRangeAll for smdemo detect
reset dragdrop on dropping folder (early returned)
2019-09-23 15:13:22 -07:00
Kurt
b41f2a3062 Extract logic from PKX
Extract Species Name logic to SpeciesName
Extract Language logic to Language
Remove FormConverter wrapper for string[] fetch
Rearrange some logic to more appropriate locations, update access
modifiers / types
Move some pkm array methods to arrayutil, make generic

PKX.GetVCLanguage was a dupe of _K12.GuessedLanguage() so just expose
the method

PKX is now back to pkm data manip only
2019-09-18 19:58:23 -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
02f36655a0 Reload box data cache on resetting slots
clear box and other calls to ResetSlots weren't reloading with the NEW
modified pkms.
2019-09-09 20:23:18 -07:00
Kurt
6d8ff992e2
Clean up / fix external drag in (#2383)
* stash

* Consolidate some logic
2019-09-03 19:54:41 -07:00
Kurt
11bc9f064f Make slots visible after resetting
Had removed the Visible=true from the inner UpdateSlot call in the
refactor; place here.
2019-09-03 18:44:35 -07:00
Kurt
61bee67908 Misc fixes
revert HoF reads as they are stored outside the general/storage blocks
2019-09-02 20:25:38 -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
f0df115ccd Fix box load on uninitialized box load
Closes #2376
probably will be rewritten at a later time; am reworking the slot info
messaging for drag/drop/display
2019-08-23 18:03:10 -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
39f5500d8a Show summary tooltip on mouse enter
Thanks SadisticMystic for the suggestion!
2019-08-14 22:51:49 -07:00
Kurt
7424cf6fb0 Remove GSC/C differentiation in PK2
Allows for no adjusting the game group
2019-07-28 13:26:39 -07:00
Kurt
a608e0b252 Minor clean
Remove some unnecessary properties from SaveFile
Enumerate checksum flag results for GC memcard checking
Remove unnecessary checks on savefile type
Add some documentation
Decapitalize some method parameters
2019-07-14 15:06:45 -07:00
Kurt
f2ac29ff4e Relocate some logic
slightly reduces savefile.cs footprint
2019-07-05 22:02:29 -07:00
Kurt
39b837c252 Fix boxeditor show wallpaper
Closes #2334 ty @sora10pls
was unnoticed for >2y lol

parameter is expecting box index, not the wallpaper index
2019-06-25 17:50:09 -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
1b028198ad
Split gen5-7 saves with inheritance (#2319)
refer to pull request comments for summary
2019-06-08 19:56:11 -07:00
Kurt
0007904cb4 Allow party only forms in party/bbox/daycare
Closes #2317 thanks @iiippppk !
2019-06-06 19:53:11 -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
5879cc8a18 Extract some pkm gui logic
probably won't stay this way if things are eventually rewritten; too
much business logic in the pkmeditor.cs, would need a ton of abstraction
2019-05-29 21:35:52 -07:00
Kurt
b5b4b67263 Fix template IVs getting overwritten on startup
Closes #2296
setting datasource triggers a changed event, which updates IVs
set flag to indicate this isn't the user doing this change
2019-05-05 12:57:56 -07:00
Kurt
706a9f2555 Disallow setting EVs for pb7 via label click shortcut
apply AVs instead
2019-04-29 17:35:31 -07:00
Kurt
9861128b63 Minor img processing update
Extract magic pixel shifting numbers for layering imgs -- SWSH will
likely use the large boxsprites, as hinted by LGPE's upsizing.
Remove new[] color array creation, just pass byte values
break up glowedges into steps
2019-04-22 22:25:14 -07:00
Kurt
95267afb2d Add bulk check to Checksums button
Hold control to have the Bulk Legality analysis spit out its results to
the clipboard.
2019-04-14 09:08:33 -07:00
Kurt
e6fd8560ee Only show reset key value for int/ko saves
e1a3c8edb3 (commitcomment-32979627)
2019-03-31 16:59:01 -07:00
Kurt
e1a3c8edb3 Add RTC reset, allows game to define on continue
Closes #2273 , thanks @SatoMew !
2019-03-30 12:34:51 -07:00
Kurt
bb8cf5d3d8 Simplify get/decrypt pkm access 2019-03-29 19:43:33 -07:00
Kurt
5dcf2f4dc8 Use enum instead of nullable bool tristate 2019-03-29 17:52:26 -07:00
Kurt
82a40cb965 Misc updates
add comboitem list to string[]
add regions list as cached comboitem list
lock resource cache on fetch
extract alola time list generating
2019-03-18 21:34:21 -07:00
Kurt
9ca4ef1e09 Move pkx hidden power logic to HiddenPower.cs 2019-03-16 12:07:22 -07:00
Kurt
c9e894a46d Misc reductions
hide setters for LegalInfo outside assembly (shouldn't overwrite the
stored values)
update GenNumber to Gen* if appropriate; GenNumber checks for first Gen*
to match, is a little more explicit and quicker than calling twice when
checking a range
2019-02-21 20:41:04 -08:00
Kurt
d3dd4fb2a5 Track slot modified count on sort/delete/mod
Sorting will always show multiples of boxcount since it repositions
empty slots
2019-02-20 17:59:54 -08:00
Kurt
98b21eaaa8 Add clone deletion quick action
kinda slow, if a save has 900 mons, it has to check 900*900 which is
O(n^2), takes a few seconds
as opposed to just doing a hashset checking contains, would be O(n)
gotta do some fun stuff to make it faster
2019-02-18 17:00:16 -08:00
Kurt
9171055fd4 Add box sort by encounter type
grabs encounter name and orders by that (Egg/Static/Wild etc)
2019-02-18 15:34:55 -08:00
Kurt
dab2300cc5 Flip gender colors
oops
extract config line load
2019-02-17 21:17:16 -08:00
Kurt
956f5ce499 Trycatch color settings load
updates in the future might break, be defensive
2019-02-17 15:13:56 -08:00
Kurt
5167a816b4 Add drawsettings as saved program setting 2019-02-17 14:51:35 -08:00
Kurt
4aa103a320 Misc clean
lowercase input parameters
2019-02-16 19:53:14 -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