Commit graph

146 commits

Author SHA1 Message Date
Kurt
4e12e54028 Replace regex parse with string find
Only remaining uses of regex in the sln are wordfilter (required), and unescape for QR replies from web api.

This is slightly faster -- cover all cases if the response json changes (shouldn't).
2021-05-15 12:39:37 -07:00
Kurt
ad4aec3439 Improve resource loading speed by precomputing full manifest lookup
no longer needing to compare manifest names with case insensitivity before finding the manifest name.
muh startup speed
2021-05-15 11:56:06 -07:00
Kurt
44affe3caa Add flag unit tests, more xmldoc 2021-05-15 11:32:25 -07:00
Kurt
acdbda4e12 Split DateUtil from Util class 2021-05-14 16:46:48 -07:00
Kurt
3ac1882151 Move BinaryCodedDecimal conversions to separate class
Add unit tests, clarify names
2021-05-14 16:32:26 -07:00
Kurt
50b15cd740 Use range/index
More in line with modernizing the codebase with latest c# syntax

improve web-qr decode speed slightly (no linq skiptake)
get money/coin mask without a temporary string (lol performance)
2021-05-14 15:30:55 -07:00
Kurt
014835ed14 Add BigEndian span conversions 2021-05-14 12:23:12 -07:00
Kurt
013aac602f Don't clone string resources on fetch
Hardcode egg names, don't rely on string resource loading order for SpeciesNames to get an un-mutated copy.

fixes the infrequent race condition for legality unit tests
2021-05-10 18:41:01 -07:00
Kurt
ef4857fa9f Improve perf of byte->hexstring parse
just use a stringbuilder
2021-05-10 16:07:25 -07:00
Kurt
01f75f8441 Add test for hex string (arbitrary length) convert 2021-05-09 23:33:54 -07:00
Kurt
96d941db69 Preformat csv files, remove header
Shaves off a few kb
2021-05-09 15:47:21 -07:00
Kurt
f25ad054ef Selectively TrimEnd without extra robust logic
TrimEnd has some loops and stuff which isn't necessary for single-char, single-time trims
2021-05-09 13:21:59 -07:00
Kurt
31142ee297 Replace some linq usage with direct logic 2021-05-06 23:26:38 -07:00
Kurt
f063014879 Improve clarity of plugin load failures 2021-05-02 18:27:04 -07:00
Kurt
0d45075d4b
Rewrite settings handling; enhance some user experiences (#3193)
- Settings now stored as json next to exe
- Settings now exposes all legality checking setttings that can be changed
- Slot hovering now can play cries in MGDB/PKMDB/etc, not just the main boxes.
- Enhanced hover text for mystery gifts and encounters that have movesets
- Show recently loaded save files in ctrl-f browser
- Toggle auto-load savefile setting to be none/detect-latest/last-loaded
- Custom extensions & extra backup paths can now be configured directly in the json settings
- Settings editor now uses propertygrid & tabs.
2021-04-11 18:09:54 -07:00
Kurt
6bce4eea14 Minor clean
Annotations (nullable), some switch cases for readability
2021-03-14 16:16:55 -07:00
Kurt
155e0283ce Inline some string logic, extract magic values, xmldoc 2021-03-09 21:31:53 -08:00
Kurt
41096fb56e Minor xmldoc / usage updates 2021-02-21 15:01:28 -08:00
Kurt
680e8b711d Add some code analysis for try-return with nullable out 2021-01-17 00:05:07 -08:00
Kurt
613e6db744 Use StringConverter api consistently; use stringbuilder when possible
Retain a stringbuilder to mutate the string rather than finalizing temporary strings

yields some speed improvements (less gen0 string objects allocated)
2021-01-14 22:50:13 -08:00
Kurt
1138cd44bc Minor rearranging 2021-01-07 18:05:21 -08:00
Kurt
934316d68d Simplify some expressions for game datasources
Reduce allocations for ball
Use a clean switch expression for version->met list
2020-12-28 13:32:36 -08:00
Kurt
d225f3391a Split up DataUtil to separate files
ya i know there's already a localizeutil class, whatever
2020-12-21 19:13:18 -08:00
Kurt
98be0f6739 Target type'd new 2020-12-21 17:17:56 -08:00
Kurt
0303eada32 this is not that
clearer than before, yay
2020-12-21 17:12:39 -08:00
Kurt
6d030831ab Bump PKHeX.Core to C#9 language version
Add FrameworkUtil.cs which is compiled if the build isn't net5+, needed to support init setters & records
2020-12-21 16:52:11 -08:00
Kurt
62018cce1a Unify concepts with different names
AltForm & Form & Forme => Form
GenNumber & Generation => Generation

Extract out SpeciesForm interface, and re-add IGeneration

For those using PKHeX as a dependency, this should be a pretty straightforward manual replacement... GenNumber and AltForm should be quick find-replace`s.
2020-12-10 20:42:30 -08:00
Kurt
23e765e550 Add opening for rental team dumps
Dunno why anyone would want these, lol
Closes #3074
2020-11-03 20:12:42 -08:00
Kurt
7132750c9b Placeholder crown tundra logic
To be updated:
- Tables8: magic numbers for maximums
- IGigantamax: any new gigantamax forms?
- FormConverter: any new forms? (calyrex)
2020-10-10 13:14:32 -07:00
Kurt
2c8e0bc8f7 Add automatic byteswap 2020-09-30 22:46:07 -07:00
Kurt
2b7e06e217 Refactoring
Extract some logic, suppress some compiler messages
2020-09-18 22:11:13 -07:00
Kurt
5d3bc289b6 seal hunting
Mark things as sealed as they shouldn't be inherited from or overriden in a derived class.
2020-09-07 13:51:13 -07:00
Kurt
9191f023a3 Minor clean
Nullability annotations and some logic simplification
2020-09-06 11:24:54 -07:00
Kurt
b03a5f2818 Fix pika beach score reading
fix reads as little endian instead of big endian
fix truncation if editor value from byte => ushort
Closes #2976
2020-09-01 16:05:52 -07:00
Kurt
9c99e7ab7b Add some overloads with 1 less allocation
kinda splitting hairs but whatever
2020-07-19 16:35:52 -05:00
Kurt
9f20aa2f4f Remove unnecessary comparison
in Array.Resize, an array is only created if the size is not equivalent
we're just repeating the same logic; let the jit optimize out the null check
2020-07-19 16:35:31 -05:00
Kurt
808ca8f307 Add a temp size that isn't 100% dlc sized
dunno what RoC did but it exists?
2020-06-19 19:58:56 -05:00
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
09cbe47240 Add battle tree scout edits
Closes #2833
2020-05-24 18:31:52 -07:00
Kurt
c4326698a5 Add prompt for loading new save with unsaved changes
Closes #2823

remove old gen6 powersaves decrypted-xorpad strings (unused logic)
remove gen8 save fixing beta-pkhex-caused corruption (behaved for 6months)
2020-05-24 11:03:23 -07:00
Kurt
e9406599e0 Remove more unnecessary null checks 2020-04-16 13:11:27 -07:00
Kurt
3100471299 Strip out some unnecessary logic
notnull => no need to check for null manually
2020-04-16 12:58:48 -07:00
Kurt
f4952faa6f Add zh2 trade localization
ye it's different from the zh strings, resulting in different nick/OT

ty @Lusamine !

add another gyarados location while we're here
2020-03-21 10:48:26 -07:00
Kurt
fbd533092d Fix misspelling of the word "Received"
Closes #2757

Co-Authored-By: pi1024e <pi1024e@users.noreply.github.com>
2020-03-12 15:05:34 -07:00
Kurt
e77fa205a0 Add tracker editor 2020-02-12 18:10:03 -08:00
Kurt
c301ce88ab Update Random to be a bit more thread safe
Random isn't thread safe; users of PKHeX.Core.dll might run multithreaded operations (see PKSM + ALM), so we need to have a thread-specific RNG available.

Thread Local get; to improve performance, save the random object locally whenever it is used more than once in the method.

https://docs.microsoft.com/en-us/dotnet/api/system.threading.threadlocal-1?redirectedfrom=MSDN&view=netframework-4.8
https://stackoverflow.com/questions/18333885/threadstatic-v-s-threadlocalt-is-generic-better-than-attribute/18337158#18337158
2020-01-25 21:49:52 -08:00
Kurt
9b062bc770 Remove unused legality check strings
Fix spanish translation messages not being loaded
2020-01-25 17:37:47 -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
99baa171f4 Indicate known block types at top
Uses reflection to grab a list of defined constants (block keys), and a list of defined block reader classes.

Show name of block in red for a more prominent hint that this block is somewhat editable :)
2020-01-23 20:11:39 -08:00