Commit graph

65 commits

Author SHA1 Message Date
Kurt
d3bd37a950 tweak last saved string format
ty @sora10pls for testing
2019-11-26 23:10:28 -08:00
Kurt
bac6032152 Update last saved parsing
year is years-since-1900
month is months-since-jan (jan=0)
2019-11-26 19:15:05 -08:00
Ammako
acf5df07be Box Layout fixes (#2449)
* Enforce box name length in Box Layout

* Fix G4 box renaming

* Fix G7 box renaming
2019-11-18 16:01:36 -08:00
Kurt
cefb56a749 Sword/Shield Update 2019-11-15 17:52:08 -08:00
Kurt
a6b6383538 Handle more messages
un-nest some classes, tooltip/menu disposing
2019-10-27 20:39:15 -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
cf955e9fc7 Fix sav7 init
guess I never launched this format the entire week
2019-10-16 19:08:13 -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
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
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
b9246ece37 Extract y2k datetime logic, also wardrobe tweak
swsh gonna have wardrobe, so rename class and relocate some logic in for
better docs
2019-09-15 22:12:32 -07:00
Kurt
0d9c18e1c6 Minor clean
dual bounds check -> single check via uint cast
pkx: keep array reference for reuse in next check
format return to second line to stick out more; lines of code are cheap
:)
2019-09-11 22:17:16 -07:00
Kurt
40cbbaa695 Relocate to more appropriate util class 2019-09-11 18:39:49 -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
772a2715c0 Fix SecondsTo* read offset
copypasted from gen6's, oops
Thanks CreamatedReptile2018!
2019-07-07 08:43:04 -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
827eb94f3c Add GameSync r/w for lgpe
https://projectpokemon.org/home/forums/topic/52797-request-lgpe-game-sync-like-value-to-be-added/

ty @PP-theSLAYER !
2019-05-16 22:26:51 -07:00
Kurt
15f93216bd Fix record flag clearing
yay missing ~, Closes #2301 ty @CanoeHope !
rewrite flag loading to not use linq
2019-05-12 15:08:04 -07:00
Kurt
934595126f Simplify qr gender
use personalinfo object to do majority of work,
end result has the 4 sequential bytes set neatly
2019-04-15 15:43:48 -07:00
Kurt
27dfffd5b2 Add model-gender/starter-gender get/set
https://projectpokemon.org/home/forums/topic/52127-lgpe-save-research/?tab=comments#comment-243751
Thanks theSlayer!

(starter gender not modifiable via gui)
2019-04-10 17:03:05 -07:00
Kurt
82fb95b436 Add ConfigSave language get/set
This value is what determines what language the game runs with
2019-04-09 21:19:08 -07:00
Kurt
609db23dc5 Consolidate pouch load/set 2019-03-30 16:10:14 -07:00
Kurt
4f2b9baede
Add missing stamp
Closes #2274
2019-03-29 09:40:31 -07:00
Kurt
13a6d16cb9 Relocate checksum/dexform logic 2019-03-16 12:01:21 -07:00
Kurt
17f954b4e8 Xmldoc
Reorder to match parameter order
add more xmldoc
2019-02-23 14:57:35 -08:00
Kurt
df94afa711 Misc updates
extract some enums to core, use Enum.GetNames to do string fetch
make stamp listbox taller
clean up Display*ID setters
2019-02-21 21:54:41 -08:00
Kurt
e96ef76dcd Add xmldoc
no code changes
2019-02-09 20:24:38 -08:00
Kurt
9a93b20515 Minor rework
use hashset instead of new[] every call
precompute empty arr
allow criteria input for better gen requests
2019-02-09 20:07:15 -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
29253ed636 More cleaning 2019-02-03 20:28:03 -08:00
PMArkive
5cb93be681 add legendary pokemon to wormhole slots (#2252)
changed slot numbering from 0-4 to 1-15
fixed drapion's pokedex number in wormhole slot table
2019-01-27 10:40:19 -08:00
Kurt
0b5429ebbc Relocate wormhole edit logic to separate class
#2250
make arrays static (only spin up one copy ever)
2019-01-25 19:58:00 -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
9a4f12c279 Misc updates
rearrange pkm version groups for clear break between
twins/siblings/family
clear pokelist for sav7b on non-exportable saves (prevents b1s1 from
showing markings)
rename horohoro (pgo) to non romaji lol, hide daycare/party tabs on
nonexportable save
remove some unnecessary operations
rewrite getallcontrolsoftype to remove ToList() and make generic
2019-01-05 15:40:25 -08:00
Kurt
4fcee0ae7a Move wr7 to mysterygift folder 2018-12-29 23:34:34 -08:00
Kurt
e7531dca30 Add wr7->pkm
Not sure if one of the 'level' fields is a move ID instead. Pound=1,
Level=1
Maybe a Chansey record would shed more light.
2018-12-29 23:33:36 -08:00
Kurt
03ad20dd16 Improve card title/filename logic
mystery gift editor still fails to generate a description (heldItem < 0
-> exception), the fallback behavior is fine I guess.
2018-12-29 22:15:40 -08:00
Kurt
f5e3358aaf Split up WR7 to separate files
settled on the class name; looks like it'll be roughly readable as a
mystery gift so inherit some properties. maybe can get r/w in the
mystery gift editor :)
2018-12-29 22:09:27 -08:00
Kurt
71dc944cbd Add wb7 gift record rw
another block documented ;)

https://projectpokemon.org/docs/gen-7/lets-go-pikachu-eevee-wonder-card-album-r109/

names subject to change
2018-12-29 21:24:38 -08:00
Kurt
d7a501c168 Relocate some logic to interfaces 2018-12-18 17:15:35 -08:00
Kurt
8a98a89f6e Add height/weight and float->scalar
pgo transfer logic disassembly
FF 83 02 D1 FC 6F 04 A9  FA 67 05 A9 F8 5F 06 A9
2018-12-06 21:03:33 -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
5750eabcc8 Add user protection for moved starters
Closes #2191
2018-12-02 11:48:44 -08:00
Kurt
ab4c3fc7ac Add go park slot delete (&all)
Closes #2179
2018-11-23 12:15:25 -08:00
Kurt
17b3732a7d Rework filename / nickname checks
Closes #2178
2018-11-23 10:31:55 -08:00
Kurt
f27816e622 Add party pointer sort
Pulls party members (and follower index if not already in party?) to the
first slot(s) in the (current/all) box.
2018-11-22 23:02:57 -08:00