Is your feature request related to a problem? Please describe.
I think it would be nice if PKHeX automatically will hide illegal ribbons, so when pressing "Give All" it would only give otainable ribbons. Since the number of obtainable ribbons is different from Pokemon to Pokemon and from game to game, I think it would be a really nice QoL addition.
Describe the solution you'd like
Either hide the ribbons, or add a button to hide them or just make it so when pressing "Give All" only legal ribbons would be given.
Describe alternatives you've considered
The only thing I can think of is either manually adding only the legal ribbons to each Pokemon, or maybe for someone to create a spreadsheet of which ribbons can each Pokemon have.
The underlying question that has to be solved is "what ribbon is legal for the pkm". A possible approach is similar to the Ball Editor popup; background highlight red/green if it's a legal ribbon or not after individually checking each state.
It's kinda computationally intensive since the Legality Check doesn't compute what ribbons are legal, it only checks if the current ribbon state is permitted or not. This is the same type of check that is done for balls. The Ball Editor just bruteforces using each ball (clone pkm, set ball, check legality) since the legality check is pretty fast (a couple of milliseconds). With Ribbons, there's more than a few dozen, so it won't be as quick.
However, certain edge cases exist.
For futureproofing, the method should repeat itself until no new ribbons are added, thus requiring the return value to indicate if a ribbon was successfully flipped on.
The underlying question that has to be solved is "what ribbon is legal for the pkm". A possible approach is similar to the Ball Editor popup; background highlight red/green if it's a legal ribbon or not after individually checking each state.
It's kinda computationally intensive since the Legality Check doesn't compute what ribbons are legal, it only checks if the current ribbon state is permitted or not. This is the same type of check that is done for balls. The Ball Editor just bruteforces using each ball (clone pkm, set ball, check legality) since the legality check is pretty fast (a couple of milliseconds). With Ribbons, there's more than a few dozen, so it won't be as quick.
However, certain edge cases exist.
- For pk4's, you can't get a Gen3 Master Contest ribbon without obtaining a ribbon in the prior contest levels. Fortunately they are sequential, so flipping an earlier bit would make the next bit now legal.
- For pk6's, the Contest Star ribbon requires all the contest ribbons to be set; these bits are after the Contest Star. So we'd want to repeat the ribbon bruteforce at least once.
For futureproofing, the method should repeat itself until no new ribbons are added, thus requiring the return value to indicate if a ribbon was successfully flipped on.
So.. if I'm getting this right, the biggest issue is that it would take time to do the checks? If that's the case then it doesn't sound that bad, honestly.
Included in latest commit via RibbonApplicator.cs; hold shift when clicking GiveAll / RemoveAll and it'll do the legal edit for you and close the window.
Most helpful comment
The underlying question that has to be solved is "what ribbon is legal for the pkm". A possible approach is similar to the Ball Editor popup; background highlight red/green if it's a legal ribbon or not after individually checking each state.
It's kinda computationally intensive since the Legality Check doesn't compute what ribbons are legal, it only checks if the current ribbon state is permitted or not. This is the same type of check that is done for balls. The Ball Editor just bruteforces using each ball (clone pkm, set ball, check legality) since the legality check is pretty fast (a couple of milliseconds). With Ribbons, there's more than a few dozen, so it won't be as quick.
However, certain edge cases exist.
For futureproofing, the method should repeat itself until no new ribbons are added, thus requiring the return value to indicate if a ribbon was successfully flipped on.