Commit Graph

5281 Commits

Author SHA1 Message Date
Guangcong Luo
f951b6f113 Partial drag/drop panel tab rearranging
Not full support, but basic rearranging is now possible!
2021-02-01 20:18:47 -08:00
Mia
868244d49f
Improve banning servers (#1719) 2021-02-01 13:18:38 -08:00
Mia
b3239205fc
Fix broadcasting /help (#1715) 2021-01-31 00:36:56 -08:00
Guangcong Luo
e9bc53d899 Fix crash in sorting users
Reported here: https://www.smogon.com/forums/threads/make-command-to-undo-ioo.3677346/#post-8736801
2021-01-31 01:23:53 -05:00
Guangcong Luo
f94d89887e Improve design of "Show password" button 2021-01-31 01:23:44 -05:00
urkerab
c621da6a01
Explicitly mark more non-submit buttons with their type (#1718) 2021-01-30 22:13:23 -08:00
Adam Tran
ba2b18d012
Preact: Page Panel (#1716) 2021-01-29 18:53:35 -08:00
SirKira(!Uzumaki)
d52c29d485
Add "Show password" button (#1704) 2021-01-29 12:06:47 -08:00
Adam Tran
a9f8adfa39
Preact Client: Ladder (#1709) 2021-01-29 08:10:36 -08:00
Guangcong Luo
3e4b83298c
Update Battle class API (#1686)
The client Battle class API has been pretty old and crusty, so this
updates it to be saner.

The constructor now takes an options object. Any setting you'd want to
initialize with is now a constructor option, instead of needing to call
methods after the constructor.

(Deprecated settings `roomid` and `joinButtons` still need to be set
separately.)

The old callback system is removed. It's replaced with a subscription
system vaguely resembling `PSStreamModel`. Any callbacks only intended
to be used by the warstory generator are removed (anyone who wants to
write their own warstory generator should extend `BattleSceneStub`
instead).

Battles no longer start paused. You can still start them paused by
passing `paused: true` as an option.

Playback state tracking had a bunch of rearrangement:

- `playbackState` no longer exists; state should be directly read from
  `paused`, `atQueueEnd`, `turn`, and `seeking`.

- `turn` is now initialized to `-1`. `-1` now means "we haven't reached
  `|teampreview|` or `|start|` yet". Reaching those sets turn to `0`.

- "Fast forwarding" and "seeking" are now consistently named "seeking".
  - `seeking` tracks seek state; changes from `fastForward`:
    - `null` means not seeking (replaces `0`)
    - `0` means seeking the start (replaces `0.5`)
    - `Infinity` means seeking the end (replaces `-1`)
  - `fastForward` deprecated and replaced with `seeking`
  - `fastForwardTo()` deprecated and replaced with `seekTurn()`

- `resultWaiting` is removed (it's unused)

- The "activity queue" has been renamed the "step queue", which means
  some renamed properties:
  - `activityQueue` to `stepQueue`
  - `activityStep` to `currentStep`
  - `nextActivity()` to `nextStep()`

- new property: `atQueueEnd` to track if animation has caught up to the
  end of the step queue (replaces checking `playbackState`)

- new property/option: `isReplay` - will automatically set `ended` when
  reaching the end of a replay (stopping music and showing a message),
  if the replay was saved before the end of the battle

- both replay players (`replay.pokemonshowdown.com` and downloaded
  files) have been rewritten to use an observer system, instead of the
  previous manual updating

- `reset(true)` has been renamed `resetStep()`
2021-01-23 13:17:23 -08:00
Konrad Borowski
0005f1f79f
Use JSON.parse for parsing teambuilder tables (#1714)
This optimizes JavaScript parsing performance. V8 developers
recommend applying this optimization for objects of 10 kB or
larger, see <https://v8.dev/blog/cost-of-javascript-2019#json>
for more details. Teambuilder tables are 3.5 MBs which is much
more than 10 kB.
2021-01-23 09:45:20 -08:00
Guangcong Luo
934eb7be2c Update ladders and docs 2021-01-22 12:38:50 -05:00
Guangcong Luo
abc5bffa65 Port Net library over
We can't share code because the client uses XHR and the server uses Node's
HTTP/HTTPS libraries, but we're now sharing a lot of the API, which should
make it more familiar.
2021-01-20 09:59:18 -05:00
Adam Tran
1d9fadde06
Tooling: Preact Client server by URL; tslint (#1711) 2021-01-20 04:44:36 -08:00
Kris Johnson
1693ccfe06
Remove LC Uber references (#1712)
And (Uber) from National Dex teambuilder.
2021-01-19 03:34:01 +04:00
Kris Johnson
5e26ecf5fd
Add custom filters for Gmax formes (#1710) 2021-01-19 02:31:17 +04:00
Adam Tran
4b92869c96
Add support for Preact fragments (#1708) 2021-01-16 07:06:16 -08:00
Guangcong Luo
ab26ad9023 Update to Preact 10.5.10
Duplicating #1708, but for security reasons I always take binary blobs
directly from trusted sources.
2021-01-16 07:03:50 -08:00
Adam Tran
1f3c8cf450
Add sourceMaps and vscode debug configurations (#1707)
* launch json

* vscode updates

* clientUrl rename
2021-01-10 16:58:28 -08:00
Kris Johnson
e1ab227783
Refactor /highlight (#1702)
* Refactor /highlight

* oops

* v

* apply suggestions
2021-01-05 14:14:24 -08:00
Leonard Craft III
af44ff326a
Disable Max Guard choice on Taunt / Assault Vest (#1701) 2021-01-03 09:47:33 -05:00
Marcell
646c07efc1
Translate RNG article to German (#1604)
* Translate rng faq to german

I translated the rng faq to german.

* Improve german RNG article phrasing
2020-12-30 17:47:59 -08:00
Marcell
222caf2e80
Improve RNG article phrasing (#1605) 2020-12-29 08:41:41 -08:00
Marty-D
65cdb2a889
Add Miasmite minisprite 2020-12-28 11:06:00 -05:00
Distrib
55fadf4361
Improve /help challenge for custom rules (#1695)
* Add /battlerules for help challenge

I added the /battlerules for the help challenge and an alias for help (h) 
https://www.smogon.com/forums/threads/add-custom-rules-page-to-help-challenge.3674780/

* Update js/client-chat.js

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>

* Update js/client-chat.js

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-12-25 04:07:48 -08:00
Mia
c7a536632f
Fix conflict with local fixes (#1700) 2020-12-24 03:08:30 -05:00
Mia
f3a77dc28a
Comply with Google API ToS properly (#1698)
* Update compliance

* Add note to the rules page

* OK

* Update src/battle-log.ts

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>

* Update battle-log.ts

* Update website/pages/privacy.md

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>

* Update website/pages/rules.md

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>

* Update src/battle-log.ts

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2020-12-23 00:27:02 -08:00
SirKira(!Uzumaki)
036f1dd062
Add a horizontal scroll bar for "infobox-limited" class (#1699)
Ig infobox-limited class is in room intros and in the event box. On mobile phones, it is hard to check the whole room intro or event and you can slide because overflow for the x axis is hidden. So just removing overflow-x: hidden.
2020-12-22 23:55:29 -08:00
Leonard Craft III
b952f1afaa
Update forme cries (#1696) 2020-12-19 18:48:54 -05:00
Mia
b761cc3656
Youtube tag: Fix regex (#1694) 2020-12-13 11:56:23 -08:00
Annika
871817ec81
BattleRoom: Fix bug with autotimer (#1693) 2020-12-12 16:05:37 -08:00
MacChaeger
bfdcc946a9
Desktop client: Save boxes as boxes (#1692) 2020-12-05 07:58:19 -08:00
MacChaeger
073750b5d9
Max Guard is always Normal Type (#1691) 2020-12-04 16:23:52 -08:00
Annika
471635e0a3
Automatic timer: Only activate for players (#1690) 2020-12-03 14:09:09 -08:00
Guangcong Luo
fb2e17e3ed Update Credits for pyuk's new username 2020-12-03 15:08:34 -05:00
Guangcong Luo
d27f2d3bf9 Fix typo second try 2020-12-01 17:36:55 +00:00
Guangcong Luo
e494c86ef4 Fix typo 2020-12-01 16:34:42 +00:00
MacChaeger
83b91f861a
Close uploaded replay when opening a new one (#1668) 2020-12-01 07:11:57 -08:00
MacChaeger
c9756b5aaa
Fix teambuilder for the downloadable client (#1688) 2020-12-01 06:58:47 -08:00
SirKira(!Uzumaki)
28c7b870f0
Add <spotify> tag (#1684) 2020-12-01 06:44:39 -08:00
Kris Johnson
d5c1f886c3
Update client support for StAAAbmons (#1689) 2020-12-01 14:44:45 +04:00
MacChaeger
607fab9720
Properly interpret Max Moves from base move type (#1687) 2020-11-30 10:18:07 -08:00
Guangcong Luo
d44b94e841 Support minimal replay files
Normally, replay-embed expects the full file structure provided
from downloaded replay files.

This new version will create it, so it only needs

    <!DOCTYPE html>
    <script type="text/plain" class="battle-log-data">

The DOCTYPE is unfortunately still needed to force strict mode.
2020-11-29 09:17:47 -05:00
MacChaeger
75ec25c8ba
Tooltips: Show Reckless boost for High Jump Kick (#1685) 2020-11-27 16:07:39 +04:00
MacChaeger
c786e2eb3c
Fix tooltips for switchables after rejoining (#1683) 2020-11-26 02:01:32 -08:00
MacChaeger
87c6e91f7b
Tooltips: Always show previous item if it exists (#1682) 2020-11-25 02:59:01 -08:00
The Immortal
90dbced0ad Add Poison Fang and Soak as useful moves 2020-11-25 04:52:17 +04:00
majorlyps
1cc0d9bd9f
Support halved Toxic damage when in Dynamaxed (#1627) 2020-11-25 04:26:38 +04:00
MacChaeger
2329993a95
Max Move Tooltips: Account for memories and drives (#1681) 2020-11-24 09:00:09 -08:00
MacChaeger
c6a7c6595a
Fix relative sprite y position logic (#1680) 2020-11-24 06:44:32 -08:00