Skip to content

Commit

Permalink
A little less ugly export formatting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dot-Comfey committed Oct 12, 2024
1 parent db511a6 commit c815bbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions play.pokemonshowdown.com/js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1369,9 +1369,10 @@ Storage.importTeam = function (buffer, teams) {
if (line === 'Frustration' && curSet.happiness === undefined) {
curSet.happiness = 0;
}
var [move, movePPUps] = line.split(';', 2);
var [move, movePPUps] = line.split(' (PP Ups: ', 2);
curSet.moves.push(move);
if (!curSet.movePPUps) curSet.movePPUps = [];
if (movePPUps && movePPUps.length > 1) movePPUps = movePPUps.charAt(0);
if (isNaN(movePPUps)) {
curSet.movePPUps.push(3);
} else {
Expand Down Expand Up @@ -1526,7 +1527,7 @@ Storage.exportTeam = function (team, gen, hidestats) {
}
if (move) {
text += '- ' + move;
if (curSet.movePPUps && curSet.movePPUps[j] < 3) text += ";" + curSet.movePPUps[j];
if (curSet.movePPUps && curSet.movePPUps[j] < 3) text += " (PP Ups: " + curSet.movePPUps[j] + ")";
text += " \n";
}
}
Expand Down

0 comments on commit c815bbc

Please sign in to comment.