Commit graph

242 commits

Author SHA1 Message Date
Kurt
ceb669c112
Update to .NET 9, c# 13 (#4390) 2024-11-17 13:13:58 -06:00
abcboy101
3707ee5eb1
Standardize language codes and improve locale handling (#4353)
Use standard BCP 47 language codes
Move Culture utils into WinFormsUtil
Detect system language on first launch
2024-09-04 18:51:35 -05:00
Kurt
f6bcc8a216 Minor clean
StringBuilder.Append has some fancy interpolation handling in the latest NET8 so it's more clean than multiple append calls.
2024-06-15 00:57:44 -05:00
Kurt
4f23efd939 Minor tweaks
Rival_Trash -> RivalTrash
BinaryCodedDecimal better method names
Gift dupe checker differentiate by species
2024-06-10 21:43:27 -05:00
Kurt
67fc0d0885 Misc tweaks
Add Cap Pikachu const value updating for USUM, also set Magearna const for USUM (not only SM)
Remove `NotDistributed` property from WC3 as only CXD events used it, no longer WC3 type.
Delete ArrayUtil; move remaining methods into the StorageUtil class that used them for compressing/inserting bulk into boxes.
Add shiny wormhole flag
Extract byte array strings into spans, faster tests and less overhead.
2024-06-09 08:52:32 -05:00
Kurt
637a0720a4 Extract manifest reader
Expose string cache dictionary for direct use
Allow plugins to reuse the EmbeddedResourceCache class for their own assembly's resources
2024-06-05 00:50:18 -05:00
Kurt
0bbba81fca Update 24.06.03
Stream translation text when loading. No need to allocate a few thousand strings and an array.
2024-06-03 23:32:45 -05:00
abcboy101
5014b0c891
Add country/region editor to Geonet editor (#4286)
Adds individual country/region-level editing to the Geonet/Unity Tower editors
2024-06-01 17:56:20 -05:00
Kurt
ca2bd3baf4 Minor clean
No functional change
2024-05-27 10:33:25 -05:00
Kurt
2d61c833bc MysteryGift drop: use extension-less method if w/o
New Korean WC9 is restrict:0 so just make it behave like restrict:3 -- verifies all possible versions that way.
2024-05-04 14:48:19 -05:00
Kurt
0f4024952e Minor clean
indexof -> contains
trailing space
some variable reuse
pcdata/boxdata less janky handling
2024-05-01 00:49:43 -05:00
Kurt
dca76f50f7 Catch more uninitialized file call stack paths
Closes #4223
2024-03-18 19:05:22 -05:00
Kurt
df7c25d43f Rename battle video classes, allow bv4 recognition 2024-03-07 00:34:21 -06:00
Kurt
4e87fd7eca Misc fixes
ty matt & foohyfooh
2024-03-04 23:46:11 -06:00
Kurt
fa80dac2ac
Refactoring: Rework saveblock to be Memory<byte> based (#4200) 2024-03-03 23:13:16 -06:00
abcboy101
32e888d871
Check nicknames/OTs against characters in font (#4146)
* Check nicknames/OTs against characters in font

* Update translations

* Do not show warning for Gen4 and earlier

* Use Gen5/7 font for Gen 3-4/1-2 transfers

* Minor style pref

* Remove font legality checks

* Add missing/update Switch fonts
2024-02-23 13:23:50 -06:00
Kurt
a93a626dad Add dialog message for empty/FF save files
Users incapable of saving in-game and using save states instead, or emulators not flushing save data on in-game save.
2024-02-11 21:55:37 -06:00
Kurt
069411d42e Modulo time spent for large gaps
Taking too many seconds to beat the storyline -> overflow on ticks. Since we already shave off the days portion, use the modulo to remove the day portion from the time portion.

Closes #4184
2024-02-10 00:25:22 -06:00
Kurt
10c5adadb8 Misc tweaks
Add more xmldoc
Move files/functions to better spot
Less allocation on hover glow
fix honeytree dppt group/slot/shake rand call (ty real.96)
2024-02-03 14:11:17 -06:00
Kurt
1b176eec53 Only ChangeType if enum is defined
Allows setting 99 (Stellar) to TeraTypeOverride now
2023-12-31 11:03:04 -08:00
Kurt
f7a888cc57 Extract some logic to SAV4
Closes #4128
I don't want to decipher to manual interactions to the Battle Frontier structures now. Prints were just work values, and fly flags were event flags.
2023-12-28 00:11:56 -08:00
Kurt
d47bb1d297
Update .NET Runtime to .NET 8.0 (#4082)
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.
2023-12-03 20:13:20 -08:00
Kurt
9df8f16ed3 Misc tweaks 2023-11-12 21:11:11 -08:00
abcboy101
894ea1d628
Add conversion for Gen 4 saves between KO and JP/INTL formats (#4057)
* Refactor Gen 4 extra blocks

* Replace FetchHallBlock with extra block getter

* Add UI to convert save to/from Korean

* Do not modify uninitialized General/Storage blocks

* Detect invalid extra blocks
2023-11-08 23:33:40 -08:00
Kurt
3df5478d11 Minor tweaks, add Gigantamax info class 2023-11-08 23:32:41 -08:00
Kurt
59dc7fb694 Misc tweaks 2023-11-05 14:20:35 -08:00
sora10pls
5c1d165f2d Enhance SV fashion unlocker for DLC 1
No point in having a billion categorizations for fashion, makes things too bloated as more items get introduced.
Add in DLC items, fix giving opposite-gender starting uniforms.
Closes #3994
2023-09-16 15:34:21 -04:00
Kurt
e1c8f52a07 Misc tweaks
Set met dates for gen9 static encounters (oops)
Check interface implementations for HasProperty
2023-09-02 15:53:51 -07:00
Kurt
fd02b97ce1 Misc tweaks
Allow nickname->species with span
add ConstantExpected annotations
Correct Gen8b ability set calling CommonEdits instead of direct setter
Slightly better perf on gen5/gen8+ location fetch
Misc pkm ctor fixes for b2w2 trade & wc3 eggs
wurmple evo now has an enum to be more explicit
no recursion for gen5 generator
fix showdown line length check allowing 86 instead of 80
2023-08-27 23:05:50 -07:00
Kurt
9855382b0a Misc encounter tweaks, annotations
EncounterEgg now indicates FixedBall(Poke) for Gen2-5
EncounterSlot2 now indicates Form Random for Gen2 Unown, database
EncounterStatic3 now generates FRLG Gen2 Roamers with correct location
EncounterCriteria now used more heavily for requested IVs
EncounterPossible3 now correctly skips Eggs if eggs are not requested
EncounterGift3Colo now generates Japanese Bonus disk gifts only in Japanese, doesn't validate non-Japanese
2023-08-17 00:07:54 -07:00
Kurt
f632aedd15
Encounter Templates: Searching and Creating (#3955)
We implement simple state machine iterators to iterate through every split type encounter array, and more finely control the path we iterate through. And, by using generics, we can have the compiler generate optimized code to avoid virtual calls.

In addition to this, we shift away from the big-5 encounter types and not inherit from an abstract class. This allows for creating a PK* of a specific type and directly writing properties (no virtual calls). Plus we can now fine-tune each encounter type to call specific code, and not have to worry about future game encounter types bothering the generation routines.
2023-08-12 16:01:16 -07:00
Kurt
ee9ae63c22 Misc tweaks
Move enum -> ushort instead of int
Redo handling of HOME Volt Tackle (disallow on SWSH Cap Pikachu)
Pass spans instead of strings to use span methods
Reset encounter filters on early abort
2023-07-13 22:18:34 -07:00
Kurt
26cabd022b Update 23.07.09 2023-07-09 14:10:40 -07:00
Pasquale Nardiello
3ca16b435c
[SV] Give All Clothing button (#3876)
* Mapped Fashion items for S/V and added injection logic
* Added 'Unlock Clothes' button in Trainer Editor's misc section alongside ComboBox to select type to add all.
2023-05-26 10:24:27 -07:00
Kurt
4aeea9e956 Allow TSV=0 for home accounts 2023-05-08 00:03:45 -07:00
Kurt
3285ecada9 Add MemoryCard detection as latest sav, pkmdb 2023-05-01 16:51:17 -07:00
Kurt
998b8f1ce0 Minor tweaks
Add unit test for VC kata/hiragana edge case
De-duplicate some slot change notifications
Span in more spots
2023-04-22 17:51:32 -07:00
Kurt
fa9a809751
Encapsulate item pouch arrays/etc for finer control (#3860)
* Extract/encapsulate inventory legal arrays to interface+class

Hiding them behind methods allows these to be left as ReadOnlySpan<ushort> and thus never allocate on the heap.
Also refactors out some logic for checking if an item is legal.

End result feels more maintainable and is less bloaty (no more passing in a nullable func)

Batch editing
* Add HasType filter

```
=HasType=11
.HeldItem=Meadow Plate
```

slaps a meadow plate on any pkm with grass type
Use `=PersonalType1=11` for only primary grass types; only-secondary-type grass will not match it.
2023-04-16 12:58:07 -07:00
Kurt
ecef31f167 Minor clean 2023-04-13 00:05:10 -07:00
Kurt
3b54ac6ecc Show affixedribbon next to markings
new Visual Studio version made my designer code ugly
maybe I should refactor the GUI like they recommend :P
2023-04-01 16:52:12 -07:00
Kurt
e6ebd20d83 Minor tweaks
Fix boxbin load being ignored
2023-03-28 11:29:29 -07:00
Kurt
5c13183d02 Less allocation, minor tweaks
NET 8 will have a Shuffle method, which can get rid of the overload in Util.
Batch Editor no longer crashes the program when selecting OT_Trash/HT_Trash/Nickname_Trash via dropdown.
2023-03-27 00:11:42 -07:00
Kurt
0087ccb44f Use span for savefile slot API
No more offset fetch
2023-03-25 23:14:50 -07:00
Kurt
5ce3e734b8
Skip initial cctor alloc on non-byte primitives (#3850)
Runtime/jit repoints these to the dll rather than heap if we're Little Endian (always, otherwise will allocate like before).

Eliminates quite a few static constructors, so even faster startup. Items later.
2023-03-25 17:55:55 -07:00
Kurt
4615e3577a Span-ify MoveSetApplicator 2023-03-21 21:02:13 -07:00
Kurt
224283b7f8 Better spanify nth entry tsv fetch
Closes #3846
2023-03-20 15:52:27 -07:00
Kurt
d13b39231a Fix unset geoloc gen4/5
Closes #3833
2023-03-10 19:34:49 -08:00
Kurt
7b93491025 Tab separated country/region tables
https://github.com/kwsch/PKHeX/pull/3810#issuecomment-1445519631

SuggestAppend for gen4/5 trainer country/region editor
Add country:0 for 3DS locale for consistency
Use — for "None"
2023-02-26 17:41:22 -08:00
abcboy101
30aa1cc9aa
Add Geonet location editing for Gen 4/5 (#3810)
* Add Geonet location to SAV4 and SAV5

* Allow commas to be escaped in subregion names

* Add missing 3DS subregions

* Add Geonet location editing

* Ensure null values are kept as the first option in GetCountryRegionList

* Add Geonet locations in CHS/CHT
2023-02-26 16:33:53 -08:00
frefire
f7179a7713
Gen 5 enhancements. (#3756)
* Gen 5 enhancements:
 -- BW: Dump/import black city/white forest data from each other.
 -- BW: Reset thundurus/tornadus flags so they can be roaming again by visiting the cabin at route 7.
      Reset this flag and switch your BW version with the same save file, you can catch the other pokemon that's limited to a sole version.

* Use work 192, fc5 ext

Adds a translatable message string to indicate the provided input size is incorrect.
2023-02-03 12:44:21 -08:00