Commit Graph

5827 Commits

Author SHA1 Message Date
Guangcong Luo
21de8d92c6 Remove old action.php and replays
Our new API replacement for action.php is in
https://github.com/smogon/pokemon-showdown-loginserver

I haven't completely deleted the old-replays folder because there
are some things we haven't replaced that I don't know what to do
with... I guess that'll come in a future commit.
2023-11-14 11:32:59 +00:00
Kris Johnson
dbd4a9ec66 Add Ivy Cudgel and Matcha Gotcha animations 2023-11-14 02:20:43 -07:00
Kris Johnson
e0e2ea0964
Add some new move animations (#2185)
* strt new nims

* Add moon image to other moon-y moves

* oopz

* build fix
2023-11-13 14:52:40 -07:00
Mia
626ececf17 Storage: Add colors to all 6 mainmenu buttons
Previously, it was only doing 5, which was hardcoded. I made this a top-level variable for future changes because this one took a while (finding all the references took a bit, numbers are not easily searched in this file.)
2023-11-13 09:13:47 -06:00
Mia
8750d6b985 Add home button for friends list
Z said this was fine.
2023-11-10 09:12:04 -06:00
Guangcong Luo
9219fb31b2 Fix another oversight from design refresh 2023-11-10 01:03:07 +00:00
Guangcong Luo
12a83e9628 Make sure replay downloading works correctly
Replays must be at their end before downloading replays works as
expected.

Before, fast-forwarding a battle would synchronously place replays
at their end, but it's now an async process as of
fc00e68231

Telling the user to click the Download button again is very hacky,
but this is a very rare situation not really worth the effort to
make it more elegant.
2023-11-10 00:59:11 +00:00
Guangcong Luo
910be168ed Clearer error message for teams corruption 2023-11-10 00:59:11 +00:00
Guangcong Luo
7c18649859 Workaround for large cookies
The FCCDCF cookie frequently goes oversize, and has recently
been causing people to be unable to access PS because their total
cookie size is going over 8KB, above Apache's default maximum.

https://business.safety.google/adscookies/

It looks like this cookie is set by Google and, according to the
internet, sometimes gets filled with junk? I don't know of an
easy way to fix this, but I'm hoping this does it.
2023-11-10 00:59:11 +00:00
Guangcong Luo
ed36b96882 Replays: Add Dark mode selector
Also makes sure Speed doesn't get desynced when switching between
battles.

I'm not particularly happy with how much UI space this gets, but
I guess it's a net positive.
2023-11-10 00:59:11 +00:00
Guangcong Luo
dc8e6cf254 Replays: Correct link previews
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.
2023-11-10 00:59:11 +00:00
Guangcong Luo
57e8302147 Replays: Support "music off, effects on" sound mode 2023-11-10 00:56:05 +00:00
LumarisX
a083b1dd42
Give all data/ files Access-Control-Allow-Origin header (#2183) 2023-11-09 14:20:27 -08:00
Guangcong Luo
3a8a793478 Support old replay search API
I completely missed that this was being used...
2023-11-07 20:56:33 +00:00
Mia
fb049bef90 Storage: Ensure teams of nonstandard length don't duplicate on load 2023-11-05 18:36:55 -06:00
Guangcong Luo
51a285cd55 Replays: Restore support for -restoreboost
I was watching an old replay and noticed it no longer worked.

Turn 7 of https://replay.pokemonshowdown.com/randombattle-247965078

Apparently when I did this rename, I didn't bother to make it
backwards compatible with old replays?

9aba6a3ce6
2023-11-05 23:37:14 +00:00
Guangcong Luo
7a2b323eaf Deploy New Replays
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.
2023-11-05 23:37:14 +00:00
Guangcong Luo
befbf585e6 Fix more design refresh bugs
- Teams in folders in the team dropdown were unstyled

- `.button.disabled` wasn't taking precedence over `.button.notifying`
2023-11-04 23:22:59 +00:00
Guangcong Luo
e3b82f2181 Restore downloaded replay CSS
PR #2162 removed the CSS on downloaded replays without any
explanation. I think it was intended to save space and/or make
things bigger? But it came with a number of bugs.

- downloaded replay logs are much wider than intended
- downloaded replays now have a "battle options" button that does
  nothing
- downloaded replays have some unstyled text in e.g. popups
- MOST IMPORTANTLY: downloaded replays are no longer styled when
  you don't have an internet connection

Anyway, reverting that change fixes all these issues, and doesn't
seem to cause any new ones? This is a temporary measure while
waiting for Karthik to explain why the CSS removal was done in
the first place.

Refs #2165
2023-11-04 23:20:33 +00:00
Guangcong Luo
9b605052e2 Move unpackTeam/exportTeam to battle-dex
PR #2164 added duplicate copies of these functions to battle.ts
which is already quite overloaded. This temporarily relocates them
to battle-dex, in preparation for a longer-term deduplication
probably involving moving the storage.js implementation there.

The API has been revised slightly, to match the server's
sim/teams.ts.
2023-11-04 23:14:29 +00:00
Guangcong Luo
6ca49c5178 Teambuilder: Fix desync bugs
Fixes #1991

(Removing a move by clicking on it in search didn't actually
remove it from the set.)

Fixes #2134

(Sorting and clicking on a filter would clear the currently
selected pokemon/move textbox, but this was only supposed to
happen when searching for a filter.)
2023-11-04 17:26:43 +00:00
Guangcong Luo
fb41336f9a Improve design
- Updates New Replays for the design refresh
- Updates STYLING.html for the design refresh

Fixes #2177
2023-11-04 16:20:50 +00:00
LumarisX
f9bc940eb5
Give JSON files the Access-Control-Allow-Origin: * header (#2172) 2023-11-04 00:04:15 -07:00
Guangcong Luo
e7814d3c6d
Design refresh (#2175)
Mostly this makes dark mode darker, but it does come with a whole suite
of other design improvements.
2023-11-03 20:40:16 -07:00
Kamila Borowska
d8b94d5da4
Update xfix's name in credits (#2176) 2023-11-03 16:04:08 -05:00
Mia
b64f89149d Account for custom challenges with best of default checks 2023-11-02 00:47:30 -05:00
Leonard Craft III
463948fa73
Support more variable best-of challenges (#2173) 2023-11-01 23:24:15 -05:00
Guangcong Luo
5e638d4d1f New Replays: Fix misc bugs
Specifically, the bugs fixed are to searches not updating correctly.
2023-11-02 00:54:40 +00:00
Kris Johnson
c99981e81d FIx LC teambuilder 2023-11-01 12:36:16 -06:00
Kris Johnson
32d5476ed9 Fix ADV ZU teambuilder 2023-11-01 12:21:28 -06:00
Kris Johnson
b24a8c8dbe Add ZU teambuilder support 2023-11-01 11:37:56 -06:00
Guangcong Luo
0951a7af45 New Replays: Support keyboard shortcuts 2023-10-30 04:20:10 +00:00
Guangcong Luo
357a1d60f1 New Replays: Support Download button
I nearly missed this feature from Old Replays, but I was comparing
the two side by side and noticed it.
2023-10-29 19:56:40 +00:00
Guangcong Luo
40ef9a2631 New Replays: Wider supported width
This makes the left sidebar less cramped on the biggest displays
(specifically, MacBook Pro 14" and up).
2023-10-29 18:11:44 +00:00
Guangcong Luo
177e3e97a0 New Replays: Support sorting by rating
This also includes some refactors. Polyfills are now gone from
utils.ts (I'm not sure why they were ever there; they're redundant
with ps-polyfill.js) and there's a new Net.decodeQuery.
2023-10-29 17:39:15 +00:00
Guangcong Luo
7305b5892b Rename switchSides -> switchViewpoint
New name is a lot clearer.
2023-10-29 04:51:14 +00:00
Guangcong Luo
0dcff6c2c3 New Replays: Support pagination in search results 2023-10-29 04:51:14 +00:00
Guangcong Luo
6d26acef8d New Replays: Support linking to viewpoints
New Replays now supports adding `?p2` to the end of a replay
URL, to see the replay from the opposing viewpoint.

Search results will now automatically be from the viewpoint of
the player you're searching for.

Viewpoint is now a selector rather than a "Switch sides" button,
which should hopefully be clearer about what it's doing.
2023-10-29 04:51:14 +00:00
Guangcong Luo
3bb2271bbc New Replays: Two column support
Old Replays's two column support was the Panel system most notably
shown off by PSDex. It was definitely very nice but a bit hard to
port to Preact.

This new one, written from scratch, has a few niceities:

- topbar can scroll offscreen
- only one scrollable area (scroll wheel works everywhere, and
  the PageUp/PageDown/Spacebar keys are unambiguous)
- uses very little JavaScript when resizing; most of the layout
  work is done by CSS

With the drawbacks:

- no animation
- only two columns supported (not relevant to Replays which has
  never used over two columns)
- uses a lot of modern CSS (overflow: sticky, and flexbox) but
  should degrade gracefully
2023-10-29 04:51:14 +00:00
Guangcong Luo
689531d3b4 New Replays: Support private replays & more
The headline feature here is that we now support being logged in and
searching for private replays. We also have a new button to instantly
find your own replays.

Also here is the basics of HTML5 history support. It's the first step
to having the two-column layout up and running!
2023-10-29 04:51:14 +00:00
Guangcong Luo
235056ba75 Update New Replays
The main difference is that the main search screen should look
much nicer now.

https://pokemonshowdown.com/replays/

Putting search/featured/recent in separate sections makes the new
design look much nicer. And dark mode is now fully supported.
2023-10-26 21:38:59 +00:00
Guangcong Luo
fd28aca33f WIP New Replays
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).
2023-10-26 14:56:05 +00:00
Guangcong Luo
e64b9a8732 Update Gen 1 battle background?
This has been sitting around uncommitted in the client. I'm sure
someone knows what's up with this, but I don't.
2023-10-25 17:20:34 +00:00
Guangcong Luo
399ab35dab Add <<formatsuggestions>> shortcut 2023-10-25 16:51:56 +00:00
Guangcong Luo
908fe3a320 Allow direct-linking lobby
In the distant past, Lobby was open by default, so people linking
to Lobby usually meant to link to PS itself, so links to Lobby
would just open PS.

This is no longer necessary, now that we no longer open Lobby by
default.

This commit also cleans up a bunch of other .htaccess entries,
for style/readability.
2023-10-25 16:51:50 +00:00
Guangcong Luo
1b04902c83 News: Support BBCode for italics 2023-10-25 16:51:46 +00:00
Guangcong Luo
44becdddbf Minor improvements to downtime messages 2023-10-25 16:51:41 +00:00
Guangcong Luo
07ad64a9b1 Gitignore node_modules 2023-10-25 16:51:37 +00:00
Guangcong Luo
4760516ce0 Website: Remove commented-out server URLs from server list
It's cluttering this code a lot for no reason.
2023-10-25 16:51:32 +00:00
Guangcong Luo
7fbb69cc60 Improve downloaded replays
They now support small windows/screens and dark mode.
2023-10-25 16:51:26 +00:00