With the new version of Visual Studio bringing C# 12, we can revise our logic for better readability as well as use new methods/APIs introduced in the .NET 8.0 BCL.
Previous commit changed the behavior to not check SaveFile's CurrentBox, only keep current index. If we want a specific index (like a new SaveFile's latest box), we must pass it.
Handle all warnings
obviously the usage of null! could potentially be avoided if the object init wasn't such garbage, but here we are with years of old junk and lack of abstraction in the GUI project
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)
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.
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)
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
Make extrabytes a pkm property (don't mutate array pls)
reconfigure startup loading to only initialize after initial load of sav
& pkm (using blanks if not provided)
using keyboard instead of mouse can change box without moving mouse
outside the slot picturebox
trigger an update when the box is changed, but only if the updating
parent has the hovered child (ie a boxviewer changing box while hovering
the main window won't re-cry the main window slot since it wasn't
updated)
Closes#1940
add some gender threshold properties to personalinfo
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.
removed ability to have multiple single box popups
double click the Box tab when holding shift to bring it up
resize to preferences: https://i.imgur.com/XB2978R.png
fix roamer3 not setting IVs
fix usum z items rightmost pixel getting chopped off
use Gen* instead of GenNumber for specific cases (faster)
add WasGiftEgg location case for Gen7
remove some unnecessary array allocations