Skip to content

Commit 86a1dec

Browse files
committed
Add PP Ups to Details
1 parent c6c4da7 commit 86a1dec

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

play.pokemonshowdown.com/js/client-teambuilder.js

+23
Original file line numberDiff line numberDiff line change
@@ -2926,6 +2926,22 @@
29262926
buf += '</div></div>';
29272927
}
29282928

2929+
console.log(set.movePPUps);
2930+
for (var i = 0; i <= 3; i++) {
2931+
buf += '<div class="formrow"><label class="formlabel" title="Move ' + (i + 1) + ' PP Ups">Move ' + (i + 1) + ' PP Ups:</label><div>';
2932+
var defaultPPUps = toID(set.moves[i]) === 'trumpcard' ? 0 : 3;
2933+
var movePPUps = defaultPPUps;
2934+
if (set.movePPUps && !isNaN(set.movePPUps[i])) movePPUps = set.movePPUps[i];
2935+
console.log(movePPUps);
2936+
buf += '<select name="move' + i + 'ppups" class="button">';
2937+
for (var j = 0; j <= 3; j++) {
2938+
if (movePPUps === j) console.log("match");
2939+
buf += '<option value="' + j + '" ' + (movePPUps === j ? 'selected' : '') + '>' + j + '</option>'
2940+
}
2941+
buf += '</select>';
2942+
buf += '</div></div>';
2943+
}
2944+
29292945
buf += '</form>';
29302946
if (species.cosmeticFormes) {
29312947
buf += '<button class="altform button">Change sprite</button>';
@@ -3008,6 +3024,13 @@
30083024
delete set.teraType;
30093025
}
30103026

3027+
// PP Ups
3028+
for (var i = 0; i <= 3; i++) {
3029+
if (!set.movePPUps) set.movePPUps = [];
3030+
var PPUps = this.$chart.find('select[name=move' + i + 'ppups]').val();
3031+
set.movePPUps[i] = parseInt(PPUps);
3032+
}
3033+
30113034
// update details cell
30123035
var buf = '';
30133036
var GenderChart = {

play.pokemonshowdown.com/style/client.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -2859,12 +2859,12 @@ a.ilink.yours {
28592859
}
28602860

28612861
.detailsform .formrow {
2862-
padding-left: 100px;
2862+
padding-left: 150px;
28632863
}
28642864
.detailsform .formrow .formlabel {
28652865
float: left;
2866-
margin-left: -100px;
2867-
width: 110px;
2866+
margin-left: -150px;
2867+
width: 165px;
28682868
text-align: right;
28692869
}
28702870
.changeform i {

0 commit comments

Comments
 (0)