Commit Graph

4537 Commits

Author SHA1 Message Date
Guangcong Luo
826f7dda62 Lower line length limit to 120 2019-03-17 10:43:09 +09:00
Guangcong Luo
7e27321790 Stub teambuilder implementation 2019-03-17 10:26:20 +09:00
Guangcong Luo
52b4a5e463 Add support for chat userlists and usercards
This involves a relatively substantial refactor to how panels work, but
it should be somewhat finalized now. Popups are now fully supported.
2019-03-17 10:26:20 +09:00
Guangcong Luo
efcdd9d557 Improve support for panel switching
Using arrow keys to switch rooms is now in! Unlike in the old client,
the new system supports switching to all rooms, and supports arrow keys
in all situations, rather than only being able to switch between chat
rooms, and only with textareas focused.

Also, focusing chat rooms now focuses the input box. This was
surprisingly hard to implement with React, which has an annoying
all-or-nothing approach to state it doesn't control.
2019-03-17 10:21:11 +09:00
Guangcong Luo
a3716c67da Support sending messages to rooms 2019-03-17 10:21:11 +09:00
Guangcong Luo
0f9f078b88 Support login handshake
You can't actually log in through the Preact client anyway, but now
if you set the right config file, you can _be_ logged in.
2019-03-17 10:21:11 +09:00
Guangcong Luo
d7b6c0978d Fix style errors caught by tslint 2019-03-17 10:21:11 +09:00
Guangcong Luo
4e654995d9 Router: Support hashes in testclient
This at least lets me test some router features without pushing it to
the live server.
2019-03-17 10:21:11 +09:00
Guangcong Luo
2a1a25835e Support uhtml 2019-03-17 10:21:11 +09:00
Guangcong Luo
e06bd66cc0 Use BattleLog for chat logs 2019-03-17 10:21:11 +09:00
Guangcong Luo
0f6537f9bf Stub chatroom support 2019-03-17 10:21:11 +09:00
Guangcong Luo
bbe73abb73 Add basic popup support 2019-03-17 10:21:11 +09:00
Guangcong Luo
79a5eee112 Add connection support
The actual connect function is commented out, because there's no reason
for it to do anything. But it can actually connect to a server now.
2019-03-17 10:21:11 +09:00
Guangcong Luo
185ef8ba9a Add a router
Unlike the old router, this one has no dependencies, and also tracks
left/right panel state, for more accurate back/forward button support.

It also sets the URL to the last selected panel, instead of always
using the left panel.
2019-03-17 10:21:11 +09:00
Guangcong Luo
e77597d501 Support joining/leaving rooms 2019-03-17 10:21:11 +09:00
Guangcong Luo
4e0feaf369 Flesh out Prefs, Teams, User models a bit
There's still a lot more to do, but this is a start
2019-03-17 10:21:11 +09:00
Guangcong Luo
eac724cce8 Improve room layout code
Room layout code is now better commented and more readable.
2019-03-17 10:21:11 +09:00
Guangcong Luo
f84bddfbe8 Rename client-frame.tsx -> panels.tsx
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.
2019-03-17 10:21:11 +09:00
Guangcong Luo
f92c4f20f6 Implement stub Main Menu and Rooms panels 2019-03-17 10:21:11 +09:00
Guangcong Luo
32fd4a1f14 Stub Main Menu 2019-03-17 10:21:11 +09:00
Guangcong Luo
6bb4e93f07 Move calculateLeftRoomWidth to PS main model
This is kind of a break of purity, because it reads
`window.offsetWidth`, but this is the lowest-overhead way to
automatically recalculate the leftRoom width whenever PS updates
(i.e. whenever leftRoom or rightRoom change).
2019-03-17 10:21:11 +09:00
Guangcong Luo
049c4d7bd7 TypeScript 3.1 thinks document.head is nullable
:|
2019-03-17 10:21:11 +09:00
Guangcong Luo
6526416209 Add architecture overview to CONTRIBUTING.md 2019-03-17 10:21:11 +09:00
Guangcong Luo
3f14956bf3 Stub Preact rewrite
HIGHLY UNFINISHED CODE
2019-03-17 10:21:11 +09:00
Ridaz
137dc317b7 Move animations: Fix xattack
...And the moves that use its animation
2019-03-14 16:23:39 +00:00
whales
d4f7d6668c Fix desktop notifications (#1251) 2019-03-14 19:29:05 +09:00
Guangcong Luo
13dfe03a3a Support "read more" element
This is just code to support using details/summary for a "read more"
system. The entire summary portion can be clicked to expand/collapse,
but the overall usability feels "better than before" to me.
2019-03-14 04:03:11 +09:00
Kirk Scheibelhut
8710f6cf0a Add Ctrl+ as a keyboard shortcut for code` (#1250) 2019-03-13 17:11:59 +09:00
Kirk Scheibelhut
74941fde52 Update README testclient instructions (#1249) 2019-03-12 13:11:50 -07:00
urkerab
8c075d4f8e Fix activation of Mummy (#1248) 2019-03-09 09:57:29 -06:00
whales
6a38e809bc Update nwjs API for later version (#1246) 2019-03-09 09:27:44 -06:00
asgdf
d843455588 Tooltips: Fix Flower Gift (#1247) 2019-03-09 12:27:19 +01:00
Guangcong Luo
06a9b34125 EV guesser: Fix Modest/Adamant spreads
Modest/Adamant spreads were accidentally more common than intended,
due to a simplification that went the wrong way.
2019-03-08 09:53:36 -06:00
Guangcong Luo
f94a242c63 Tooltips: Don't count copied/Z moves for limit 2019-03-07 16:36:29 -06:00
Guangcong Luo
c88d2a2ecb Stop showing stats for Transformed Pokémon 2019-03-06 13:49:17 -06:00
Guangcong Luo
a9b8155b5d Implement EV guesser test
Also improve existing battle test.
2019-03-06 13:49:17 -06:00
MacChaeger
5232273445 Don't intercept links in replay-uploaded popups (#1245) 2019-03-06 11:25:02 -06:00
Guangcong Luo
30c57c1a42 Correctly handle renames in BattleLog 2019-03-06 10:24:34 -05:00
Guangcong Luo
9c9675f2fc Don't intercept replay links on side servers 2019-03-06 10:24:34 -05:00
Guangcong Luo
5b850cb1f5 EV guesser: Fix detection for Fast Bulky Support 2019-03-06 10:24:34 -05:00
Guangcong Luo
06625b728c Don't pixelate avatars between 1x and 2x
Fixes #1196
2019-03-06 10:24:34 -05:00
Guangcong Luo
e88285a20f Refactor unlinkNodeList
This prevents the need for a closure, and also adds support logs
without preempt elements in BattleLog.
2019-03-04 15:38:05 -06:00
TheMezStrikes
df43f1f1f8 Update battle userlist on user rename (#1244) 2019-03-04 13:25:47 -06:00
Guangcong Luo
9c3a9addcd Improve EV guesser
"Suggested spread" is now renamed "Guessed spread", to make it clearer
that it's not exactly a suggestion, more of a guess of what might be a
good spread.

Speed EVs are now suggested a lot more often, with the new basic
threshold at 80+ Spe instead of 95+. (71+ Spe is still enough to get
Spe EVs on a non-bulky stat spread.)

EV spreads are now guessed based on post-Mega stats (so e.g. Mega
Metagross gets Spe EVs).

In addition, Speed EVs are now suggested for support spreads above 110
base Spe (mostly for support Starmie sets).

I wouldn't call the EV guesser _good_ by any means, but I still
strongly believe it's better than nothing.
2019-03-04 13:20:00 -06:00
Guangcong Luo
331a129644 Move EV suggester to battle-tooltips.ts
I mostly wanted this to be in TypeScript before I did any further work
on it, and also with the teambuilder at 3k lines, it needs to be broken
apart anyway.

I feel mildly bad about introducing ~600 lines of code that replays
will never need, but the EV suggester does fall under the general
category of "set insights" and is relevant to tooltips.
2019-03-04 13:20:00 -06:00
MacChaeger
957b231404 Fix "Open replay in new tab" link in replays (#1241) 2019-03-03 10:55:29 -06:00
urkerab
ebdd1b9075 Fix Protean and Color Change for replays (#1243) 2019-03-03 04:40:03 -06:00
MacChaeger
5a4d4da3a8 Tooltips: Fix Normalize (#1242) 2019-03-01 02:50:48 -06:00
Guangcong Luo
810da3b7d6 Default tab size in code blocks to width 4 2019-02-28 03:08:52 -05:00
Guangcong Luo
c9e46593ba Update build tools for Sim TypeScript 2019-02-28 03:08:31 -05:00