Commit graph

868 commits

Author SHA1 Message Date
Kurt
ceb669c112
Update to .NET 9, c# 13 (#4390) 2024-11-17 13:13:58 -06:00
Kurt
8b071073d8 Improve BallApplicator performance
Previous logic would check a new LegalityAnalysis for each ball attempted, and would additionally allocate a new PKM for testing the balls.

With the refactoring to BallVerifier, we can just pass in the template and ball and get a truth, skipping the entire re-check. There might be a deficiency when the current ball invalidates the encounter (GO) but I don't think that's worth considering at this time.
2024-11-17 12:08:22 -06:00
Kurt
b0a2c7911e Fix Met tab startup binding
`ListControl._dataManager` is null until some event fires, which never happens until the Visible state is normally triggered by flipping to that tab.

The met tab Version/Location can skip Visibility changes on startup, resulting in never being initialized by the GUI framework, thus ignoring any calls to change SelectedValue. Really weird, but setting the BindingContext here forces it to create a `_dataManager` when setting a new `DataSource`.

Closes #4384
2024-11-11 15:11:47 -06:00
Kurt
3c574a45f1 Revise enc1/2 -> pk1/2 nickname set
Skip the IsNicknamed evaluation, saving at least 1 string allocation on ctor. Remember the IsNicknamed state when we set false.
GUI: provide the selected language rather than recalculate
2024-11-10 09:32:33 -06:00
BlackShark
693cb3a70b
Renamed DLC Editor button (#4372) 2024-10-24 11:14:25 -05:00
Kurt
ec24b8b8d5 Enhance Gen5 download content I/O
Initially just C-Gear, can do better!
Adds i/o for Pokedex skins, Musicals, Battle Videos, Movies & PWT (B2W2), and a research-only tab for Battle Test (never distributed by GameFreak, so doesn't work).
2024-10-06 01:10:32 -05:00
abcboy101
7632230edf
Support G2 mail in all languages (#4359)
* Support G2 mail in all languages

- Handle Japanese/Korean mail
- Handle both NPC and user-entered mail (#3470)
- Display European mail based on mail language (#4027)

* Fix shift

* Add support for Stad2 mail
2024-10-01 00:02:37 -05:00
Kurt
1c7bc9d455 Add settings to export/show record properties
For legality analysis exports to clipboard, and hovering slots in encounter db, can show all properties if desired. Was previously a debug mode only thing, but why not.
2024-09-23 00:47:43 -05: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
ba7646e7a2 Fix TopMost appearance for Group Slots viewer
SAV editor gui:
Used by stadium to show registered teams, the form would misbehave when showing hover previews if you change focus between main window and the popup form.
Copy the `form.Owner=ParentForm` behavior from the popup box viewer, which behaves correctly.
2024-08-25 10:16:38 -05:00
Kurt
04466ac209 Extract some AffixedRibbon logic
const now reused across entire sln
pkm editor GUI no longer crashes on hover of out of range affixed ribbon
pkm editor GUI now indicates the quantity of available affixed ribbons on hover (does not indicate if 1 and already affixed).
2024-08-19 21:11:08 -05:00
Kurt
97aa9805a9 Add GS Ball manual enable button
Adds a "misc" editor for Gen2 saves (only crystal for now), with a single button to enable the event (button enabled if the event is not yet enabled, lol)

746a06f1de/engine/menus/save.asm (L164-L175)

Closes #4335
2024-08-07 18:55:19 -05:00
Kurt
496c66bd46 Rename box storage slot flag fetch
`IsSlotX` is a little ambiguous; `IsBoxSlotX` much better.
2024-06-29 10:39:59 -05:00
Kurt
6b51250f88 Misc tweaks
PK5-PKMEditor no longer sets Hidden Ability flag for Rotom under HaX -- only set if unique hidden ability.
Differentiate move source tagging for HOME, DexNav, and GB-Evolution
fix some comma spacing
2024-06-15 18:38:05 -05:00
Kurt
0ffb256052 Add slot source legality checks
Useful for save files with misplaced data (you really have to be using the program weirdly to get these flagged).
Stuff like Eggs deposited in Daycare, non-fuseable species in the Fused slots, etc.

Allow HaX to view any slot, & Delete if Set is allowed
2024-06-15 00:14:49 -05:00
Kurt
84d42807e0 Simplify discards on gui event methods 2024-06-08 01:34:32 -05:00
Kurt
093fca37ec Add enum to GUI translatable list
Improve perf of GUI scrape by only making forms once, don't fully set up Main
Add method to get a list of translated Enum names
Adds translatability for size markings
Closes #4266
2024-06-03 19:37:57 -05:00
Kurt
7d05e12c7f Misc tweaks
Fix pk6/7 pkmeditor export, now retaining status condition instead of wiping it
Abstract b2w2 key system to a save block; better documentation on its odd mechanics
Allow gen1-3 filename language/ver detect to work if the filename is ` `->`_` (discord attachments changing spaces to underscores); also revise canadian French emerald filename pattern
others: negligible perf/using standard library functions
2024-06-01 17:44:32 -05:00
Kurt
650f23ab82 Misc tweaks
Rewrites super training editor to not need reflection and special handling for translation
Fixes trash check for traded egg
Fixes Scientist trash applying to Ultra Beasts -- much better comparison
2024-05-30 10:40:08 -05:00
Kurt
b7298a7361 Auto-clean save file names of duplicate suffixes
`main (17)` now backs up as `main [...].bak` instead of `main (17) [...]`
Adds a debug-callable method to clean the main backup folder via:
`CleanBackups(Main.BackupPath, true);`
2024-05-27 19:23:56 -05:00
Kurt
ca2bd3baf4 Minor clean
No functional change
2024-05-27 10:33:25 -05:00
Kurt
c493580b55 Fix type display dropdown in gen12 2024-05-24 12:22:36 -05:00
Kurt
0be5581638 Enhance type icon downscale
No need to override the interpolation settings, looks way better.
2024-05-24 12:01:06 -05:00
Kurt
a79581e965 Add EncounterTime interface for Gen2 encounters 2024-05-24 11:55:46 -05:00
Kurt
225e2e3ce5 Add type icon to move dropdown 2024-05-24 11:52:47 -05:00
abcboy101
4cb1048139
Implement GBA/GC string conversion (#4278)
* Swap GC nickname fields

The first nickname field is used for the displayed nickname, such as for EFIGS PKM whose names get truncated in Japanese games.
The second nickname field stores the actual nickname, which is restored when a PKM is traded back to the GBA games.

* Add StringFont3GC

* Add GC/GBA string conversion tables/logic

* Refactor GC region conversion

* Minor tweaks

Skip copying nickname/OT on generic conversion method; derived impl will remap the trash for us.
Extract the DisplayNickname truncation function and deduplicate. Use buffers directly when updating
Make CurrentRegion/OriginalRegion properties GCRegion instead of int/byte

Extract local func for font check skip for clarity
2024-05-22 12:22:41 -05:00
Kurt
96bf5a6891 Misc tweaks 2024-05-19 23:29:27 -05:00
Kurt
da51291364 PK1/2 edit: Use save language when detecting lang
GBPKM allow spa/ita lang as fallback (so that nicknamed species just use fallback)
SK2 GetNonNickname reuse the passed language ID instead of recomputing
2024-05-17 13:18:25 -05:00
Kurt
7b6abc0520 Reduce alloc for ot/nick by raw trash reads
Legality check now catches buffer overflow mons.
Now that I have each type exposing a trash length & charcount, should be easy to have some reusable trash byte measuring methods (see the old branch)
2024-05-12 14:46:58 -05:00
Kurt
d2e8d722e7 Add setting for pkmeditor selected tab colors 2024-05-10 23:17:22 -05:00
Kurt
410be93358 Add opt-in boxdata dragdrop toggle
Can drag from the Box tab into another window or folder to copy the entire box's contents.
Closes #3933
2024-05-10 22:36:46 -05:00
Kurt
969f733c2c Fix pkmeditor auto-set Nickname flag
Event was stolen via impossible-chars change, so just revert & call that method so only 1 method is hooked to the event.
2024-05-10 19:26:48 -05:00
Kurt
5af6678784 Update 24.05.05
Fix devutil text update
swap tox & poison icons, move picturebox to the right
add some Legality settings util functions
2024-05-05 23:24:32 -05:00
Kurt
e72ff1a899 Misc tweaks
No noticeable change besides correctly indicating N's Pokemon in hover text (instead of Dream Radar)
2024-05-05 15:33:30 -05:00
Kurt
bb6e45db60 Refactor out legality settings, add more settings
Extract PP verifier
Add disabling of wordfilter for formats < 6
Add context-specific bypasses for nickname/handler checks
2024-04-26 14:33:03 -05:00
Kurt
093264bc24 Add IStringConverter, impl on PKM & SaveFile
use in trash editor to translate strings, from PKM instead of SAV.
Closes #4222
2024-04-23 00:57:17 -05:00
Kurt
e1b964ad64 Use img instead of color
Still too big
2024-04-17 01:56:09 -05:00
Kurt
f630ad8271 Add setting to hide status condition view
Likely will be moved to the bottom right corner and shown with a language-less sprite. Feature preview on main :)
2024-04-17 00:44:31 -05:00
Kurt
35bf97eaf1 Add status indication & switcher popup
Shows on all tabs to make it clear.
Obviously, status condition is only saved in formats that save status condition in their slot's resting format. Gen3 box mons won't store Burn, etc.
2024-04-17 00:35:42 -05:00
Kurt
b60648627a Add setting to show Gender in Gen1
Default false, current behavior.
Previous commits (years ago) would show Gender, but only current-format properties are shown now.

Fix some form scaling settings that haven't been reported, match other controls.
PKM property copy now checks if src==dest property type; for Gen6<-Gen7 markings, converting ushort -> byte can cause the conversion to fail if more than 8 bits are used. Just ignore copying the marking value, by only copying properties that have the same name AND type.
2024-04-16 21:01:14 -05:00
Kurt
024bd85cc3 Minor tweaks
make PL6 use memory instead of byte[]
make GP1 use memory instead of byte[]
move IEncounterable properties higher to IEncounterTemplate
2024-03-24 20:12:33 -05:00
Kurt
f7900ed8b4 Enhance Text trash editor
#4222
SuggestAppend species dropdown
Indicate trash-to-be-applied when hovering on button
Fix ClickOT in pkmEditor applying English on Japanese Gen3 saves
2024-03-20 09:44:20 -05:00
Kurt
1241e6eff6 Double check some bounds checks
still have some issues with gen4 mystery gifts and some groundtile flagging (to be resolved later)
2024-03-13 00:08:10 -05:00
Jonathan Herbert
4435f032a5
Rename Obedience_Level To Match C# Naming Standard (#4215)
Change from Obedience_Level  to ObedienceLevel since it was missed when other properties we changed to match C# naming standard.
2024-03-11 20:39:31 -06:00
Kurt
8e32ab5008 Misc tweaks
Gen1 VC mew OT name set
Gen1 Japanese stadium language get
Tab control edge case index redraw
Home Tracker & EC control ordering now grouped by flowlayout panel
2024-03-10 21:28:50 -05:00
Kurt
a143c9a2ab Update SAVEditor.cs 2024-03-09 20:28:50 -06:00
Kurt
f32a1ddc7a Misc fixes
event flag editor gen5-7
rs/frlg/dp/hgss enc->pkm version choice
pb7 party stats loading
daycare slot now shows when present
remove unnecessary `GameVersion.Unknown`, use Invalid instead. Might be worth removing Invalid in favor of changing `Any=0` to `None=0`.
2024-03-05 09:42:20 -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
Kurt
8da8f34896 Use TimeProvider.System instead of manual impl
Introduced in .NET 8; use it.
Remove unnecessary [Serializable] tags (binary/XML serialization are not used), will eventually be obsoleted by c# ;)
2024-02-23 20:37:29 -06:00