`makeLoadTracker` is deprecated in favor of `PSObservable` in the new
client, and has no reason to remain in battle-dex, which is now has a
specific role rather than its previous role as "random useful
functions".
This splits battle-dex.ts up into:
- `battle-dex.ts`
- dex data access, misc tools
- `battle-log.ts`
- manipulating HTML, especially in battle logs
This turned out to be a pretty significant portion of what was
previously battle-dex.
We now just use JSON.parse and JSON.stringify - it's supported by all
browsers supported by the client.
Tools.safeJSON has also been moved to Storage.safeJSON, since it's not
used in replays at all.
Restoring a backup previously required all teams to be packed, or all
teams to be unpacked. Now, we support pasting a mix of packed and
unpacked teams.
Team backup/restore was previously always unpacked, which is good for
readability but bad for memory usage. At high team counts, this can be a
serious problem, so with this change, if you have more than 350 teams,
your teams will be backed up in packed format.
"Showdown: Charizards" makes the attribution bleed over to the second
column. Workaround is to just write "Charizards" there. Will have to
think of a different workaround if we ever get a background with a long
artist name and a long title.
I seriously doubt any third-party server will do the work of obtaining
an SSL cert, but...
Well, I guess it wouldn't be too hard to write a script to automate
getting a Let's Encrypt cert... We'll see. This will help with testing,
regardless.
We now officially require a generation mark at the beginning of all
formats. Formats whose ID do not start with "gen" will have "[Gen 6]"
prepended to their name.
This commit will prepend "gen6" to all existing formats in the
teambuilder, so that e.g. "OU" and "[Gen 6] OU" will be the same format
in the teambuilder.
A version of Chrome suddenly started complaining about PS's
cross-origin communication system. These changes seem to mostly
solve the issue.
This is kind of voodoo programming, but oh well. You do what you have
to to work around obscure client bugs.
Also merge showjoins and showroomjoins and provide automatic conversion
from the old format to the new one. Additionally, have each server use
their own namespace for showroomjoins.
I'm not sure why this only recently started becoming a problem; I've
been told this only recently became commonly reported in Help, but the
code I've fixed seems to have been around for a long time. Maybe some
recent change exacerbated it or something.
Anyway, this should make team saving much more frequent, matching how
team saving works in the browser.
Formes like Hoopa-Unbound would previously default their nickname
to "Hoopa-Unbound". Their default nicknames are now "Hoopa", matching
in-game names.
Our data structures now intentionally leave set.name blank to mean
"default nickname". Older teams are "unaffected", although Nickname
Clause makes the final nickname "Hoopa" anyway.
Fixes#92
In addition to format folders, we now support regular folders that
behave as you'd expect. These folders even map to actual
directories in the downloadable client!
Folders are delimited by `/` in team names in all storage formats
(including export, and packed saving), and are stored in the
`.folder` field of team objects.
Because of this, `/` is no longer an acceptable character in team
names. This improves interoperability with teams and filesystems,
so we should probably have done this anyway.
I also added back a friendly message to the top of the teambuilder.
Default backgrounds are still left-aligned, mainly for Horizon and
Waterfall which are designed for their left side to be visible, but
custom backgrounds are now centered on the assumption that that's
what most users want.