Commit graph

53 commits

Author SHA1 Message Date
Kurt
4f3745e3c6 Change enumerate -> array fetch to force eval
https://projectpokemon.org/home/forums/topic/54426-pkhex-error/
trycatch will trip here rather than be uncaught when evaluated later
tbh I don't like pkhex's method chain (enumerable, bool, throws), but
this fixes the error.
2019-08-14 16:45:21 -07:00
Kurt
9ed47cc8fd Minor tweaks, no functional change 2019-07-21 12:30:21 -07:00
Kurt
894237449b Allow differentiation between SAV2 blanks
Choosing G/S will initialize as GS
Choosing C will initialize as C
calling via their own code (GSC/GS) will choose the most recent (crystal
if possible).
Closes #2359
2019-07-14 15:13:13 -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
1b028198ad
Split gen5-7 saves with inheritance (#2319)
refer to pull request comments for summary
2019-06-08 19:56:11 -07:00
ReignOfComputer
7625ab66b4 Fix Import Count on Load Boxes (#2308)
Calculation was wrong if non-overwrite is selected. Also fixed OCD-triggering extra space in output message.
2019-05-15 09:11:48 -07:00
Kurt
2f2512b09c Reduce allocations for checking file write time
FileInfo inherits from FileSystemInfo, which initializes a bunch of
strings that we don't need
this isn't a great optimization, just a fun exercise finding a quicker
approach to get these values
2019-04-05 18:45:59 -07:00
Kurt
e614aa9ac8 Relocate xd/batrev encryption
update some xmldoc too
2019-03-30 21:28:32 -07:00
Kurt
5dcf2f4dc8 Use enum instead of nullable bool tristate 2019-03-29 17:52:26 -07:00
Kurt
5765ce8229 Extract gc version IDs to separate logic 2019-03-16 16:48:38 -07:00
Kurt
13a6d16cb9 Relocate checksum/dexform logic 2019-03-16 12:01:21 -07:00
Kurt
30e36579be Misc updates
add more xmldoc
revise some comments for clarity
redo a little bit of logic for perf
rename some methods for better description
2019-02-24 13:57:10 -08:00
Kurt
993bb00a61 Remove powersave unused logic
unused & deprecated in favor of using cfw (powersaves price >>>
ntrboot-b9s flashcart)
2019-02-23 18:02:50 -08:00
Kurt
7ba21c5d8c Use subsection fetch 2019-02-23 17:59:46 -08: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
17f954b4e8 Xmldoc
Reorder to match parameter order
add more xmldoc
2019-02-23 14:57:35 -08:00
Kurt
ca51edbdcf Change sav.LoadBoxes to return int
make MysteryGift specific method flexible so that any IEncounterable
enumerable can be passed.
2019-02-23 14:37:06 -08:00
Kurt
a385a8481d Misc tweak to savefile export
Use flags to request header/footer in the output
gets rid of the DSV/GCI bool arguments
2019-02-18 21:59:57 -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
48e2bbcfed Refactor DumpBox to return 1 value
count < 0 implies an error; values >= 0 can be used to indicate actual
dumped count
2019-02-09 20:19:55 -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
PMArkive
194ddb7c18 add offsets & save-size for ranch's platinum update (#2248)
I don't know yet if the OT offset is the same though
2019-01-25 15:24:01 -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
ae6010f169 Add ranch r(/w?) support
not gonna edit the metadata

properly handle an irregular sized display box
2019-01-14 21:31:53 -08:00
Kurt
154f122369 Allow changing of default savefile type
kinda have to restrict these to 'valid' choices; should be enough of a
selection->result to be adequate for changing version

restart the program after changing the setting; won't take effect until
rebooted.
2019-01-05 15:42:20 -08:00
Kurt
7ab42e7cc2 Misc improvements
remove alloc on gc key advancement; advance keys in place
make g6 sizes an explicit comparison instead of new[].Contains
replace Any/Count with Array.Find calls (removes linq dependency from
savetype detection!)
2019-01-04 00:07:37 -08:00
Kurt
bdcabfa573 Update gen4 save detection
footer is different for Korean saves; checked JP/EN and they use the
2006 date. Probably the same for everyone-but-KO.

Simplify check further, only check the 0x4.... sav as it's the first
region saved to. No point wasting time checking the other!

a previous commit alluded to general/storage being initialized in
different slots
e8644280a1
, gonna ignore what was stated as I can't find any proof with the few
tests I did today (all init on second, and found no backups from that
time)
2019-01-03 23:37:49 -08:00
Kurt
e99c9a0999 Add pokestock gst/stk (3 & 4) bulk r/w
ezpz @kamronbatman
2019-01-02 21:56:33 -08:00
Kurt
2b5272a395 Simplify gen4 save type detection
footer identifiers work just fine for any legitimately created save
file; I might have had the checksum check code for pokesav blank
savefiles

dropping support for bad-blanks in favor of a non-negligible speedup is
favorable :)
2019-01-01 11:16:31 -08:00
Kurt
6f22599baf Prevent slot overwriting on bulk import
https://projectpokemon.org/home/forums/topic/48912-how-to-batch-import-pokemon-boxes-without-erasing-existing-pokemon/
2018-12-28 17:58:13 -08:00
Kurt
71fab815bf Provide more slot information
remove lockedslots, store & save all teamslots for sav7
differentiate locked slots from overwrite protected slots by emitting an
enum containing info about the slot

locked = can't be replaced, period.
starter/battleteam = can't be pasted over by bulk-pastes

can eventually show more specific sprite layers to denote party
indexes/team#/starter
2018-12-04 22:59:28 -08:00
Kurt
adeaaea0b4 Allow folder import to import mystery gifts & gp1
Closes #2176
2018-11-23 12:22:51 -08:00
Kurt
13e1debe3e Add sav7b object & detection util 2018-11-13 19:18:29 -08:00
Kurt
39f98a4a94 Misc qol updates
Check max case for level first, then iterate upwards (eliminates inner
if)
change wc* nature to sbyte (update comparisons, 0xFF too magic-y)
use Rand.Next(x) instead of (0, x)
2018-10-27 21:59:31 -07:00
Kurt
f7f5d78beb Misc perf tweaks
hopefully resolves the image corruption issue (dont use unsafe?)
remove some linq
2018-10-13 08:02:55 -07:00
Kurt
39c3a0eea7 Rework sav3 version detect
Might still be flaky for FRLG, but can now (99.99999999%) determine RS
vs E...
2018-09-16 13:57:09 -07:00
Kurt
316341e140 Misc updates
Remove unused sav properties
Add translatable strings for autodetect SAV error suggestion

add speculated gg dex formtable
- no eevee forms
- increments 1 for pikachu since it already exists in table
- stops at mewtwo (no other formed-species available)

im currently setting up skeleton stuff for lgpe since we're <70 days
from release; by doing some pre-work like prior games I can get a good
idea of what needs to be adjusted prior to crunchtime!
2018-09-06 20:35:55 -07:00
Kurt
42deb0ad12 Add extra backup locations for savedetect
Closes #2109
Program boots -> load extra locations rather than constantly fetching.
These files won't change location or presence (not an external drive).

just store the locations instead of constantly fetching, we already call
detect once when loading the form anyway.
2018-09-03 10:40:40 -07:00
Kurt
493bef75eb Misc updates
condense repeated logic
extract properties
extract reusable methods
2018-09-02 18:02:25 -07:00
Kurt
91c37ab573 Update legality check message string style
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.

updating the translation files with the remapped variable names shortly

remap list: https://pastebin.com/jybkVDAK
2018-09-01 14:11:12 -07:00
Kurt
d40b10f4a4 Remove unused method
SaveFile already has ModifyBoxes which has better built in checks for
locked slots.
2018-08-22 22:35:50 -07:00
Kurt
ebb1e8a704 Update 'cant hold item' message
#2101
2018-08-21 07:46:55 -07:00
Kurt
1486b7f14a Misc style & minor tweaks
Remove move combobox flicker hack (no longer necessary)
Add more Array.Empty usages
cache mysterygift sizes
seal some classes

no functionality changes
2018-08-02 20:11:42 -07:00
Kurt
32b90fab13 Simplify some logic 2018-07-29 21:54:02 -07:00
Kurt
d916be1020 Style updates 2018-07-29 13:27:48 -07:00
Kurt
64284eafef Add pk1/pk2 direct import checks
dragdrop: check
import files from folder: check
no other paths convert afaik

Closes #2074
2018-07-24 15:49:00 -07:00