Skip to content
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

Adjustment for when Rainbow Rocket avatars are added #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/javascript/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function WebclientUI() {
content.find("#useravatar").val(poStorage.get("player.avatar") || 0);
var setAvatar = function() {
var num = parseInt(content.find("#useravatar").val());
if (isNaN(num) || num < 0 || num > 844) {
if (isNaN(num) || num < 0 || num > 852) {
// nothing or invalid avatar given, do not change
return;
}
Expand Down Expand Up @@ -478,7 +478,7 @@ function WebclientUI() {
poStorage.set("user", userName);
poStorage.set("player.color", userColor);
poStorage.set("player.info", userInfo);
poStorage.set("player.avatar", Math.floor(Math.min(844, Math.max(userAvatar, 0))));
poStorage.set("player.avatar", Math.floor(Math.min(852, Math.max(userAvatar, 0))));

var update = {};

Expand Down
2 changes: 1 addition & 1 deletion views/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="form-group avatar-selector">
<label for="useravatar">Avatar</label>
<img src="/images/trainers/167.png" id="settings-avatar-image" class="form-control player-avatar">
<input type="number" class="avatar-number-input form-control" min="0" max="844" width="40" class="form-control" id="useravatar">
<input type="number" class="avatar-number-input form-control" min="0" max="852" width="40" class="form-control" id="useravatar">
</div>
<div class="stretchX">
<div class="form-group">
Expand Down