Commit graph

137 commits

Author SHA1 Message Date
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Kurt
2cdb5d26db Clean up some method signatures
rename things to be a little more consistent in naming conventions
2020-06-16 21:46:22 -05:00
Kurt
8a0295e4e9 Minor clean
GetLanguageIndex never returns <0
2020-04-23 20:54:20 -07:00
Kurt
b8814d2448 Split GG into LGPE (GP/GE), GG (LGPE||GO)
Update usages
2020-04-16 12:48:18 -07:00
Kurt
270d984130 Minor clean
Remove unnecessary null checks
Mark some methods with nullable type
2020-04-04 19:30:50 -07:00
Kurt
98cd28d5d3
Swap string differentiation for HOME gifts
30018 is used by the gift; original fake WC's that EventsGallery created used the 40086 (now fixed on their repo)
2180608ed2
2020-03-16 12:05:33 -07:00
Kurt
3aaf318035 Update event database, handle HOME gifts horribly 2020-03-14 14:22:45 -07:00
Kurt
ffa70e7626 Move files
no functional change, just putting stuff in a more appropriate folder
2020-01-25 17:22:20 -08:00
Kurt
c730dfa1ba Remove empty ushort[1], improve item combo fetch
held item list now allocates less (concat arrays instead of ienumerables)
item list already prunes out of range items, so simplify data source fetch
simplify item list prune (return as list, so we can call RemoveAll instead of Where.ToList)
2020-01-24 23:29:45 -08:00
Kurt
843330a375 Remove unnecessary null checks
this is a null free project /s
dont provide null, else u deserve to get an exception
2020-01-18 16:57:25 -08:00
Kurt
0002f1d1ad Grab CXD location if encounter is COLO or XD 2019-12-31 12:15:48 -08:00
Kurt
5e1fd36b96 Account for memory feeling off-by-one bug
If the feeling is zero the game's string formatter will treat it as
null, and will newline before the period.

Gen6 (if I recall correctly) had "it was happy" as index 0
Gen8 (new) has "it was happy" as index 1, with 0 being invalid-bad.

Slice the array differently for gen8 to include the empty line as index
0.

Closes #2549 , ty @crzyc && @architdate for testing index 0 :)
2019-12-08 18:56:37 -08:00
Kurt
0dcd9b744a Include swsh held items to valid items list
Closes #2518
2019-11-24 22:34:51 -08:00
Kurt
256de0380f Swap order of vc1/vc2 in version dropdown
Closes #2464
2019-11-19 08:42:31 -08:00
Kurt
cefb56a749 Sword/Shield Update 2019-11-15 17:52:08 -08:00
Kurt
ba593800d8 Keep text/value as get properties
Needed for binding in winforms, oops
2019-10-27 12:47:09 -07:00
Kurt
9401b7a790 More readonly struct tweaks
help dat compiler
minor clean elsewhere
2019-10-26 23:18:25 -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
8d8adde2b1 sealed
sealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealed
2019-10-03 19:09:02 -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
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
0fe42a1db3 Minor tweaks
no functional change
2019-09-14 11:48:07 -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
3f4f02cee1 Add string quality tests
Expect no duplicates in met locations, items, or moves. These are arrays
with common duplicate strings (poor localizations).

Should help futureproof / help implementation for this type of err:

https://projectpokemon.org/home/forums/topic/53818-these-events-are-flagged/
2019-07-08 22:05:59 -07:00
Kurt
4eb3f8529b Filter Species & Moves for legal combobox display
LGPE will missingno your pokemon if it's not a Kanto/M&M, or one of its
moves is not obtainable. For the user's benefit, filter down these
sources to the non-baddata list.

Item filtering and ball filtering might be something to think about for
the future, but not much benefit vs effort.
2019-06-29 08:19:01 -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
de774ed131 readonly ComboItem
create once, never modified after
2019-06-01 19:12:41 -07:00
Kurt
a9152d36a4 Minor tweaks
make some enums non-int (in favor of byte etc)
return current nickname if desired
clamp nature top bound too
2019-05-29 22:40:07 -07:00
Kurt
55189a6967 Extract most common location numbers to class 2019-05-10 20:46:49 -07:00
Kurt
520c9da5c9 Update string loading
Remove usage of linq for sorting, use array.sort for in-place sorting.
Wasteful creating temp sorted buffers then enumerating them to dump into
the list.
2019-04-29 21:55:43 -07:00
Kurt
1a343c3b21 Add more xmldoc 2019-04-09 20:57:44 -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
5765ce8229 Extract gc version IDs to separate logic 2019-03-16 16:48:38 -07:00
Kurt
e8ade4dd63 Add swsh placeholders
no point adding for legality until much closer to game release
2019-02-27 06:37:11 -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
304203262d Add species & ability enumerations
remove hardcoded 810 in unit test, add ability test too
2019-02-10 21:28:32 -08:00
Kurt
383d4b7700 "" -> string.Empty
be explicit that the string is empty rather than possibly missing
disallow encrypted export for BK4 (they're not encrypted), removes type
check
simplify replaceall in showdownset (don't call ReplaceAll 4x, just get
valid chars and rebuild)
simplify get ribbon sprite name (precompute ToLower and appended values
2019-02-07 21:40:20 -08:00
Kurt
59b41937e1 Misc variable name changes
readability++
2019-02-06 23:28:02 -08:00
Kurt
29253ed636 More cleaning 2019-02-03 20:28:03 -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
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
d62a69a6a7 Misc fixes
Provide gen1/2 gb only version origin fetch for personal/moves ty
shadowmario (i assume this fixes things)
make listbox use ingame font for special characters

2f6e30bb3c (r31924945)
ty @pmarkive
2019-01-13 18:12:31 -08:00
Kurt
174eb81986 Fix xmldoc comment 2019-01-05 15:36:44 -08:00
Kurt
c2422d6927 Misc updates
possibly gonna update the iencounterable api for criteria
check/enforcement, rather than just generating random encounter data.
2018-12-29 22:19:44 -08:00
Kurt
75d2b8d0bc Split out location bank fetch
Getting a little congested in one method
2018-12-22 14:45:47 -08:00