We're using Font Awesome 5 Pro on the live site for duotone icons,
but I'm still retaining support for Font Awesome 4 for licensing
reasons.
Both are colored now, which makes for a better look, too.
This isn't actually too hard to backport to the old client, but I'll
leave that for someone else.
This is here partly as a tech demo of the syntax highligher, which I
plan to use in the teambuilder.
Files meant to be served have been moved into
`play.pokemonshowdown.com/` and `pokemonshowdown.com/`.
We now have three directories for the three subdomains handled by this
repo:
- `pokemonshowdown.com/`
- `play.pokemonshowdown.com/`
- `replay.pokemonshowdown.com/`
Naming them after the subdomains will make it much easier to tell where
the files for each go.
The diff is probably useless; it'll be easier if you just look at the
new tree:
https://github.com/smogon/pokemon-showdown-client/tree/reorganize
This should make Google search results and Discord link previews
for replays work correctly.
This actually involved a ton of work, but at least this work also
makes replays load faster.
The idea is to eventually move all client parts to their domain name
subdirectory, for clarity and better organization. New Replays is
just first.
Anyway, yeah, minor updates to New Replays, but otherwise it's just
getting deployed as-is, straight to
https://replay.pokemonshowdown.com/
The old URLs are getting taken down; they were only used for
development anyway.
New Replays isn't done yet but I've done a lot of work on it and
probably it deserves a commit.
Why rewrite Replays:
- I redesigned pokemonshowdown.com to look more modern and support
dark mode, and rejiggering Old Replays would be a lot of work
anyway.
- It'd be nice to actually deploy some of PS's whole Preact
infrastructure somewhere, instead of it just being in development
hell.
- Nice to get a second look at the relevant code, leading to fixes
like fc00e68231 and f28b1e9bf3.
- Replays is due for a migration from JS/PHP to TS anyway.
Anyway, feel free to try out New Replays, it's live in:
https://pokemonshowdown.com/replays/
Old Replays will stick around until we hit feature parity, but
that shouldn't be too long (I know, famous last words).
This keeps ads/analytics out of the repository, since they
shouldn't be used in forks and dev machines anyway.
Hiding ads in `website/news/include.php` was a thing I did in
the early days because one of the devs was ashamed of ads, and
`website/` wasn't in a public repository at the time. At this
point, though, I'm done being ashamed of it. You can obviously
see ads on the website and everyone knows they fund the server.
This makes it so that new files in `src/` no longer require updating
`.gitignore` and `.eslintignore`.
The existing files still in the repo are mostly deprecated at this
point, anyway.
All sound stuff is now handled directly by BattleSound, using the
HTML5 audio API.
The main complicated thing we do with sound is loop music with an intro.
This is unfortunately not supported by ANY sound library out there
(I had to manually add support for it myself to soundManager!)
https://github.com/scottschiller/SoundManager2/pull/13
In the end, I don't think the existing libraries out there actually
give us anything I care about.
This should be a much nicer architecture than the old
`client-battle.js`.
In particular, much of the logic of choosing moves/switches has been
moved into a new `battle-choices.ts`, with `panel-battle.tsx` only
covering the UI.
`learnsets-g6` has always been versioned because in Gen 6, it contained
START move order.
For instance, Clefairy in BW2 has the following level-up moveset:
- START: Pound
- START: Growl
- L4: Encore
- L7: Sing
- L10: Double Slap
If you catch a wild level-10 Clefairy, its moveset will be: Growl,
Encore, Sing, Double Slap. A level-10 wild Clefairy will always have
Growl and never have Pound, because the order of its first two moves
matters.
PS's regular learnsets file doesn't take this into account, so we
tracked a `learnsets-g6` file that did, but also needed to keep in sync
with new game updates.
Well, these are no longer necessary. We've updated to Gen 7 and now
Gen 8, and we've never had START ordering for any of them. Anyone who
wants START ordering for Gen 6 can find it here:
https://github.com/Zarel/Pokemon-Gen-6-Learnsets
For this repo, though, `learnsets-g6` is still around (used only by
PSdex), but it can now be automatically built from `learnsets` without
losing anything, and so it can finally be `.gitignore`d.
This took way too long to get to a presentable state.
- search.js has been refactored into battle-search.ts (search logic)
and battle-searchresults.tsx (display)
- panel-teambuilder.tsx has been split into teambuilder (team list) and
teambuilder-team (team editor).
- The teambuilder's text editor can now detect which line it's on,
and show the appropriate search result panel.
- The teambuilder's text editor now detects sets dynamically, and has
the beginnings of support for set comments.
Currently, everything here is really basic, and mostly just a tech
demo for people to play around with and understand the direction of
the new teambuilder, but it'll be improved over time.
This required a new architecture for serving replays from inside the
client repository, because that seems like a better call than
introducing yet another PS repository.
(Experience gives me the impression that separating repositories wasn't
a good idea, and we should be working to make PS more mono-repo-like,
rather than less.)
License for replay code is tentatively AGPLv3, although feel free to ask
for a more permissive license if you have plans to use it in an
open-source project that requires it.
Considering all the individual panels start with `panel-`, this should
make it easier to find and in general be a more intuitive name.
All other tsx files will start with `panel-`, putting them together in
one place when sorting alphabetically.
- Tooltips work in replays now
- Calculation is better (correctly handles more corner cases)
- Explanations are better (better messages for Magic Room etc)
- Tooltips for sidebar pokemon
- Support "locking" tooltips with long-click / long-tap
- Can copy/paste from locked tooltips
- Increased font size
All battle text messages have been moved out of `src/battle.ts` and
into its own file `data/text.js`.
Code for handling this is in the new files `src/battle-log.ts` and
`src/battle-text-parser.ts`.
`data/text.js` is now extremely self-contained, and nearly ready for
translation support!
This is a significant modernization of battle.ts. In addition to moving
messages out:
Functions for getting names (`pokemon.getLowerName()` etc) have been
removed.
`battle.minorQueue` has been removed. Minor lines are now processed
directly on the main queue, with a new `battle.waitForAnimations`
flag to decide whether or not the main queue should wait for animations
to finish before moving on to the next line.
`battle.waitForResult()` and `battle.endPrevAction()` have been
removed. These confusingly-named functions closed the messagebar (and
flush the minor queue). They've been replaced with
`scene.maybeCloseMessagebar()`.
`pokemon.markMove()` and `pokemon.markAbility()` have been renamed
`pokemon.rememberMove()` and `pokemon.rememberAbility()`.
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.
This is only a first step and doesn't pass strictNullChecks.
I'm committing now because skipping straight to refactoring will be
easier than trying to make it pass strictNullChecks as-is.
TypeScript found at least a few bugs here, which is nice.
This is the first step of moving the entire client over to
TypeScript + Preact!!!!
The main change here is that battledata.js has been split into three
files:
- `src/battle-dex.ts`
- `src/battle-dex-data.ts`
- `src/battle-dex-misc.js`
These are concatenated back into `battledata.js` in the client, so
third parties (and specifically, old replay files) should be
unaffected. Also, this makes sure that we don't have more than two
dependencies right now.
The compilation is done with Babel 7 beta, because no stable version
of Babel supports TypeScript. We're not using `tsc` because it can't
compile to ES3 and it doesn't support preserving line numbers.
`toRoomid` has been moved from client.js to battle-dex.ts.
This doesn't support setting accounts up for Google login: that still
has to be manually done via the database by setting the email field to
`username@gmail.com@`, where the second `@` denotes that it's using
Gmail login.
If the email field does end in `@`, `getassertion` will note this by
sending `;;@gmail`, to convey that the server is expecting a Google
login token rather than a password.
Upon receiving `;;@gmail`, the client will replace the password box will
with a Google login button, and then send the resulting Google login
token to the server in the `password` field. The server will validate
the "password" using the Google server libraries, and otherwise handle
the login as normal.
Note that Google login requires various features that a paranoid person
might disable; most notably 3rd-party cookies.
FixesZarel/Pokemon-Showdown#3394
BW animated sprites are now also automatically generated. In addition,
the generation script can now handle female sprites and cosmetic forms.
The storage format has also changed to be more concise.