Commit graph

2204 commits

Author SHA1 Message Date
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
18fd790657 Minor perf tweaks
Relocate checksum adders to Checksums class, improve performance by eliminating slice calls
Improve HOME sharing for GO8 and IMoveset encounters: actually sanity check GO8, and skip other non-PK7/PB7 cases.
2023-07-15 11:22:48 -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
a49508b354 Check scale copy in non-SV formats
Rather than ignoring it
2023-07-11 11:05:55 -07:00
Kurt
4f560c3ba6 Indicate moves currently known in TechRecordEditor 2023-07-11 09:12:24 -07:00
Kurt
0876c8044a Set TR flags for all evos, indicate yellow 2023-07-10 18:41:56 -07:00
Kurt
26cabd022b Update 23.07.09 2023-07-09 14:10:40 -07:00
Kurt
2ea6ee4e10 Misc fixes
Add sound for adding all XY fashion items (was silent)

Fix Gen7 Resort PKM loading (4 bytes extra per slot)
Fix Gen6 HallOfFame TID/SID validation dropping leading zeroes
Fix Gen6 Best Friends ribbon validation
Treat GO8 as server date restricted, give detailed message outside window
HasTracker => must have HT name
2023-07-08 20:00:41 -07:00
Kurt
04e7baaeee Fix Stat Editor randomize buttons centering
Hiding and Showing doesn't trigger an update to the FlowLayoutPanel's width; force a layout to happen so the size updates prior to re-centering controls. Only move if it is a different X coordinate (perf?)
2023-07-08 19:29:46 -07:00
Kurt
cbb5ab0971 Fix Memory editor Gen7 editor of Geolocation
set up binding for both comboboxes before setting data source
skip setting up if entity does not expose these
2023-07-08 18:21:17 -07:00
Kurt
79729de90c Misc fixes
ty matt
2023-07-08 08:40:57 -07:00
Kurt
014cd8c738 Ban voltorb-1 ball inheritance 2023-07-07 21:20:15 -07:00
Kurt
00b3e111f8 Extract some CGear logic
More span based interaction, less allocation.
2023-07-06 22:20:25 -07:00
Kurt
dcc0e79435
Evotree: Evolution Traversal Enhancements (#3936)
Like move validation, evolutions are the earliest thing we wish to traverse when determining what encounters may have originated the current Pokémon. To determine the permitted species-form-levels a Pokémon could originate with, we must devolve a Pokémon by traveling down-generation to origin. Once we have an encounter, we can then evolve it to the current species, traversing upwards from origin to the current format.
2023-07-05 21:14:09 -07:00
Eelen
84694c63df
Update CHS translations (#3915)
Update CHS translations

Co-authored-by: Leo <103500840+wubinwww@users.noreply.github.com>
2023-06-18 23:43:21 -07:00
Kurt
e06368ea1d Don't add tickets on full pouch
-1 for first empty index => full
clean up initial sanity checks
https://projectpokemon.org/home/forums/topic/63498-pkhex-230603/?do=findComment&comment=283990
2023-06-13 10:18:58 -07:00
abcboy101
b0da14b71e
Add Geonet/Unity Tower editor (#3909)
Adds a basic editor for recorded Geonet/Unity Tower locations for the Gen 4/5 games, building on this [post by Danius88](https://projectpokemon.org/home/forums/topic/62055-bw-b2w2-unity-tower-geonet-and-passerby-research/).
So far, I've implemented buttons that set all locations (including unused ones), set all legal locations, and clear all recorded locations; and checkboxes to toggle whether the whole globe is visible (used in Japanese games) and whether the ferry to Unity Tower is unlocked.

Haven't implemented any UI for editing the status of individual locations, since I'm not sure how to lay it out.
Also haven't implemented anything related to how the data of the other players in Unity Tower is stored.
2023-06-11 09:38:24 -07:00
Eelen
f94c4f4420
Update CHS Translations (#3903)
Update CHS Translations

Co-authored-by: Leo <103500840+wubinwww@users.noreply.github.com>
2023-06-04 23:43:09 -07:00
Kurt
e3d8d167be Update 23.06.03 2023-06-03 18:29:07 -07:00
Kurt
941a8fa13e Update SAV_Inventory.cs
Closes #3892
2023-05-28 02:01:36 -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
ae07937de6 Enhance TechRecord editor
Closes #3888
Closes #3879

Adds type sprite indication and green if the flag is legal to be set.
Allow sort by has-flag, index, type, and move name.
Sorting by Type will sort by type->valid->name for a nicely ordered view.
2023-05-25 20:26:58 -07:00
Kurt
1ed6efd465 Remove HighDpiMode.PerMonitorV2 2023-05-12 08:26:42 -07:00
Lusamine
e77b39635b Precisely realign Gen 9 Trainer Editor GUI elements 2023-05-12 01:26:32 -05:00
Kurt
401c545ca8 Update 23.05.11 2023-05-11 21:44:36 -07:00
Kurt
ad7e05d66e Update translatables 2023-05-11 21:08:09 -07:00
Kurt
34f4df3d4b Misc tweaks
Closes #3878

Pictures are Zoom instead of AutoSize so there's no need to downscale or dynamically position the smaller 2.
Fix my oopsie on docked tabs (hid the Cancel/Save button!), change sizing.
2023-05-11 20:56:45 -07:00
Pasquale Nardiello
d915bb6039
Img visualizer (#3875)
* Added Boxes to view Current Trainer photo and Trainer Icons

* Adjusted Images Visualization

* Updated Pictures decompression to final DXT1 version
2023-05-10 23:50:50 -07:00
Kurt
a0200ec7e5 Remove more autoscale override settings
68c94a93b2
2023-05-09 12:22:43 -07:00
Kurt
41762f4f67 Make Dpi scaling the default
Have settings toggle to fall back to Font based scaling
2023-05-09 10:50:15 -07:00
sora10pls
ea052fb6d1 Update ContextMenuSAV.cs 2023-05-08 08:15:24 -04:00
Kurt
70020dc7e4 Minor behavior tweak for apply all/none
Button closes form when modifying all indexes, so don't bother loading them back to the GUI. The form will immediately close after.
Only read indexes from the GUI if they're kept.
2023-05-07 13:36:04 -07:00
Kurt
e75da5d3b7 Misc tweaks
More readonlyspan for the rest of the defined ushort[] arrays, less dictionary/hashset
Simplify some slot-empty checks, makes it easier to see an api for slot interaction (future?)
2023-05-07 13:32:29 -07:00
Kurt
f9ac5eae15 Pass box-to-show to ResetBoxNames
Previous commit changed the behavior to not check SaveFile's CurrentBox, only keep current index. If we want a specific index (like a new SaveFile's latest box), we must pass it.
2023-05-06 19:42:48 -07:00
Kurt
8e177708b7 Skip box name repop if same names 2023-05-05 14:16:58 -07:00
Kurt
68c94a93b2
Make all AutoScaleMode.Inherit (#3874)
Also changes the Main form from Dpi to Font

Attempt to resolve:
https://projectpokemon.org/home/forums/topic/63374-text-sizing-with-windows-settings-ease-of-access-make-text-bigger/
2023-05-03 21:45:58 -07:00
Kurt
3285ecada9 Add MemoryCard detection as latest sav, pkmdb 2023-05-01 16:51:17 -07:00
sora10pls
d55bf21466 Minor fix to LGPE fashion cheat
oops
2023-04-30 12:14:05 -04:00
sora10pls
6eb82e3847 Add unlock all fashion cheat for LGPE 2023-04-30 12:01:08 -04:00
Eelen
ce431d1df4
Update CHS translations (#3869)
Co-authored-by: Leo <103500840+wubinwww@users.noreply.github.com>
2023-04-27 15:35:10 -07:00
Kurt
583a036d65 Remove eager check of Current
The SaveUtil's ienumerable can be of different collection types, and the result is usually is a collection with >0 count
I think I was initially confused (years and years ago) about "MoveNext" if it discarded the first result.

Remove the eager check of the enumerator's current value because it hasn't yet been moved from the uninitialized state.

Closes #3871

Dispose of the enumerator on the early empty return, since the later async code will dispose once all have been iterated.
2023-04-26 21:41:38 -07:00
Lusamine
62597d17e1 Update Designer automatic code generation 2023-04-21 23:29:50 -05:00
Lusamine
18cbb8158c Standardize MinDate/MaxDate values
3DS ranges from 1/1/2000 to 12/31/2050. After that, it rolls to
1/1/2050. Switch ranges from 1/1/2000 to 12/31/2060 as the settable
range. However, date continues advancing normally after 12/31/2060.
Allow the maximum Switch date range to be 12/31/2099 to match maximum
Met date. This should be comfortably far in advance for anyone who is
alive today.
2023-04-21 22:27:22 -05:00
Kurt
5bdc6b9ef8
Privatize some static fields, more robust legal helper classes. (#3865)
* Uses LearnSource more throughout the codebase when appropriate, rather than loosely coupled pivot methods.
* Hides Learnset/EggMove data inside the LearnSource classes.
* Extracts functionality from the large Legal class & partial Table*.cs files into better performing helper classes.
* Cleans up some code from prior LearnSource commits.
2023-04-20 21:23:15 -07:00
Kurt
9a768dded3 Permit pkrs strain 0 & 8 on Gen3+ context
Ruby & Sapphire had a bug that only looped when (rand) == 0 !!! instead of (rand & 7) == 0.
End result is that the pkrs giving method yields strains 0 & 8 with 30/255 & 1/255 rarity.

Gen2: z80 assembly does NOT work as intended, and has a separate bug that causes strains 9+ to never be obtainable. So close to a neat statistical separation.

Revise the GUI to disable the events on field loading, and allow for selecting Strain0 w/ days !0.
VC2->7 does not transfer pkrs; not that it matters since Gen3++ transfers can spread every strain.

Thanks @SNBeast for clarification on Gen2's assembly logic and repro!

Co-Authored-By: SNBeast <21327530+snbeast@users.noreply.github.com>
2023-04-20 21:20:25 -07:00
Lusamine
b08581aecf Final adjustments to SV Trainer Editor, update localization files 2023-04-16 18:16:41 -05:00
Lusamine
78031f09f1 Better align components of gen 9 Trainer Data Editor 2023-04-16 18:16:41 -05:00
Jonathan Herbert
8fca2075d9
Add Game Start Time Editor For Scarlet and Violet (#3861) 2023-04-16 13:16:34 -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
c73264d4f3 Minor minor perf
Small changes to reduce some allocations
2023-04-15 01:58:37 -07:00