-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow PP Ups to be edited #2222
base: master
Are you sure you want to change the base?
Conversation
Client-side change. I'm not a web developer so a lot of the HTML/CSS may be messy. However, it seems like the general interface works; PP ups can be edited, and they are able to properly import/export as well as pack/unpack.
It doesn’t look like this will be a problem judging by the code, but those screenshots have me worried. Can you assure that both newly created teams and old teams from before this change will have their pp ups default to the max? |
They do default to max, and teams transferred to the new client should be able to unpack properly because moves without a defined PP up value get set to 3. |
In the current implementation, PP ups will update every time an update to a move is made; PP ups are associated with a move slot and not a move, so if a move is changed, changes to PP ups will carry over, but if a move is removed from a set by trying to add a move twice, any changes to PP ups will continue to be associated with the original move. |
I'm not sure this should be editable in the UI at all, as opposed to being something that is just changeable via importing. We're taking up a lot of real estate in the teambuilder for a feature that will go unused the vast majority of the time. |
Despite how much work I put in trying to create a UI, I honestly have to agree; having it be easily accessible to newbies is likely to confuse them, but those who know will know. |
Based on my experience with editable entities, my thoughts:
For paste formatting, Moves are currently formatted as
Pros/Cons:
|
Given that the original thread that suggested PP Up editing is still getting likes to this day, it's still a relevant suggestion and I wanted to revive this PR by making the export look less ugly. Not sure if we still want to have a UI in the teambuilder, as the PR thread suggests starting with changing the export format: https://www.smogon.com/forums/threads/editing-pp-on-showdown.3735890/ I'd also like to see if this works for server-side team storage, but I haven't figured out a way to test that.
// move PP ups | ||
if (buf.charAt(j) === ';') { | ||
j = buf.indexOf('|', i); | ||
set.movePPUps = buf.substring(i, j).split(',').map(number => parseInt(number)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set.movePPUps = buf.substring(i, j).split(',').map(number => parseInt(number)); | |
for (var q = 0; q < buf.substring(i, j).split(',').length; q++) { | |
var ppUpsUsed = parseInt(buf.substring(i, j).split(',')[q]); | |
set.movePPUps[q] = ppUpsUsed; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to pull buf.substring(i,j).split(,)
into a variable outside the for loop. Also set.movePPUps
needs to be initialized w/ an array before writing to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing the array with the values as strings and converting them to numbers works without crashing or upsetting Linter, so I've done that.
This should hopefully cover everything needed to implement PP Ups.
PP Ups values that are 3 will now be shown as empty in the packed format, and if every value would be empty, PP Ups do not get displayed. I made this change to be consistent with how EVs and IVs are handled.
Client-side change. I'm not a web designer so a lot of the HTML/CSS may be messy. However, it seems like the general interface works; PP ups can be edited, and they are able to properly import/export as well as pack/unpack. Pokemon sent into battle have the PP up changes applied.