Commit Graph

413 Commits

Author SHA1 Message Date
Ben Davies
e3fcaa492c
Properly set the encoding to UTF-8 on all HTML pages (#1467)
This adds the BOM to all HTTP pages as per the HTML5 spec and ensures
all pages use UTF-8 as their meta charset (which is still kept for
compatibility with older browsers).
2020-02-23 00:13:56 -08:00
Guangcong Luo
72717a7559 Bold usergroup descriptions
Fixes #1319
2019-11-28 15:29:48 +13:00
Guangcong Luo
88bb2ea435 Improve appearance of in-PM Challenge button 2019-11-15 06:12:00 +13:00
jordanhui19
8f7674f5d8 Add "Challenge" and "..." buttons to top of chat windows (#1385) 2019-11-03 20:37:27 +10:30
Guangcong Luo
5d6304eeb6 Support PM windows
These are now called `mini-window`s by the client code, and they're now
generic in the sense that any PS room can be a mini-window, not just
PMs and News.

This also adds BattleTextParser as a dependency of client-main,
removing some duplicate code in exchange for a hopefully-negligible
difference in load time.
2019-10-15 19:14:32 +10:30
Guangcong Luo
9e06e72a35 Add support for watching battles
Playing battles is, of course, a lot harder, but watching them
is at least implemented now.
2019-09-06 02:46:54 -05:00
Guangcong Luo
6a3b62cdc9 Support Challenge menu
This adds support for a Challenge menu to the new Preact client.

- New: Support for "Controls", allowing Preact to render JSX at the
  bottom of chat scrollback - intended for challenge menus and battle
  controls in PS Mobile.

- New: <<pm-[userid]>> and <<challenge-[userid]>> links

- New: Support for client-side commands: /j, /chall, etc

- New: PMs have a user list

Actually challenging people isn't supported yet.
2019-08-31 00:04:45 -05:00
Guangcong Luo
898280c5e5 Improve format/team selector
This introduces a new TeamForm component, which can be used to choose
formats and teams.
2019-08-22 11:08:43 -07:00
kanmingxu00
9863615c69 Support folders in the battle team selector (#1343) 2019-08-14 00:56:26 -07:00
Kirk Scheibelhut
7951e4ac90 HP Type -> Hidden Power 2019-07-27 14:14:18 +02:00
Guangcong Luo
62e6c8e617 Make room for two rows of Japanese in status text 2019-07-16 11:53:49 -04:00
Guangcong Luo
ac741d2352 Limit userstatus size 2019-07-15 13:18:09 -04:00
Kirk Scheibelhut
0dfda499da Wrap long custom status messages 2019-07-10 19:23:03 -07:00
Guangcong Luo
b47708efa0 Implement teambuilder dropdown selector
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.
2019-06-25 00:51:27 -07:00
Guangcong Luo
9114cb9894 Make minor tweaks to teambuilder
Most of these update the pokemon/item/etc lists to be slightly more
modern, in preparation for their use in the Preact client.

(Also update TypeScript)
2019-06-07 18:36:36 -05:00
Guangcong Luo
bb6fe7ec3e Improve teambuilder stub
This should give an idea of the direction I want to take the
teambuilder in: a text editor, but with special features.

This neatly sidesteps a lot of UI questions, especially all the export
and input buttons, because the regular editing mode can be used to
import and export without anything fancy.

This also makes way for a better way to implement team/set comments:
comments are just invalid Pokémon in a team.
2019-05-16 01:27:19 +04:00
Kirk Scheibelhut
883cd91fc8 Handle AFK '@-in-names' protocol (take 2) (#1270) 2019-05-05 22:43:54 +09:30
Guangcong Luo
5348d1312e Revert "Handle AFK '@-in-names' protocol (#1265)"
There were several major crashes arising from it.

This reverts commit ba1e6d31bf.
2019-04-22 09:38:06 +09:30
Kirk Scheibelhut
ba1e6d31bf Handle AFK '@-in-names' protocol (#1265) 2019-04-22 06:41:46 +09:30
Guangcong Luo
7d52fd8c30 Implement TeamDropdown
Currently it's in the Main Menu where the old team dropdown was, but
the plan is for "Battle!" to eventually open a separate Search window.
2019-04-05 17:34:20 +08:00
Guangcong Luo
9c3dcd6233 Improve readmore box appearance 2019-03-22 18:51:44 +09:00
Guangcong Luo
fbaceafac1 Implement Rooms room 2019-03-21 20:16:01 +09:00
Guangcong Luo
6622e50234 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 19:02:53 +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
Guangcong Luo
06625b728c Don't pixelate avatars between 1x and 2x
Fixes #1196
2019-03-06 10:24:34 -05:00
Guangcong Luo
810da3b7d6 Default tab size in code blocks to width 4 2019-02-28 03:08:52 -05:00
Guangcong Luo
d2ef03c07a Fix tooltips in downloaded replays 2019-02-20 03:09:59 -05:00
Guangcong Luo
54535213e0 Fix mobile device tooltip support
For the first time since original tooltips, we have a pressed-down
animation for move/switch buttons!

More importantly, long-presses are no longer weird, and now just
lock in the tooltip instead of also opening a context menu.

In addition, clicking on a locked tooltip dismisses it, which should
help address complaints about locked tooltips being hard to dismiss.
This makes it slightly harder to select text in locked tooltips, but
clicking and dragging on desktop still works.
2019-02-20 03:09:47 -05:00
Guangcong Luo
e372b6f24b Fix bugs in tooltip refactor 2019-02-19 00:17:58 -05:00
Guangcong Luo
5c983df6d3 Massively improve tooltips
- 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
2019-02-18 22:38:13 -06:00
Guangcong Luo
e45256d98b Pixelate trainersprites/types on Retina screens 2018-12-16 16:16:07 -06:00
Guangcong Luo
3004f2f0b6 Add line breaks to spacers
Makes battle logs look nicer when copy/pasted as plaintext.
2018-11-23 01:40:15 -06:00
Guangcong Luo
6214e1c185 Make sure fake buttons don't wrap
The .button class now has display: inline-block, which should fix the
issue with <a> buttons wrapping.
2018-11-22 06:05:12 -05:00
Guangcong Luo
f75d85fdaf Reimplement "ignore nicknames" without CSS
Honestly, the CSS solution was really cool. It was just incompatible
with the new system. It also had enough other flaws (like, bad
accessibility) that I don't feel _too_ bad about ripping it out.

The new version is less code, anyway, although it does have the flaw of
needing to replay the battle if you turn nicknames on or off.
Fortunately, that should be a rare enough occurrence not to be a big
deal.
2018-11-15 18:52:53 -06:00
Guangcong Luo
6d80607312 Fix Play/Resume button location 2018-06-11 03:24:32 -07:00
Guangcong Luo
c590a0c370 Add new BattleScene animation engine
battle.js is probably PS's oldest code. It's received minor touch-ups:
a refactor to prototypes early on, and then a refactor to TypeScript
and classes recently, but otherwise it's had basically zero maintenance
until now.

That's probably why this refactor took me over a week.

The biggest change is that the animation engine strewn around
Pokemon, Side, and Battle has been broken out into a new class named
BattleScene.

Pokemon, Side, and Battle now only track state; all animation is now
done in BattleScene and PokemonSprite.

The fates of major classes:

battle.ts:Pokemon - animation has been moved, mostly to PokemonSprite
battle.ts:Side - animation has been moved, to PokemonSprite/BattleScene
battle.ts:Battle - animation has been moved, mostly to BattleScene

Major changes:

- Many many variables have been renamed to be much clearer about what
  they mean. For instance, `animationDelay` is now `timeOffset`, and
  `activityDelay` is now `minWait`. A few bugs relating to me mixing
  up these two variables have also been fixed. jQuery variables named
  like `fooElem` have been renamed like `$foo`.

- The unnecessarily complicated queue1/queue2/activeQueue system,
  previously used for telling the animation engine to stop after Pause
  was pressed, has been replaced with a simple `interruptionCount`
  counter.

- The entire scene can now be reconstructed from scratch, which means
  that the `fastForward` system no longer needs to touch the DOM
  outside of the battle log. "Prev turn" and "Skip to turn" should be
  faster in 1000-turn battles now.

- The animation engine now supports displaying weather and terrain
  simultaneously.

- During a replay, Team Preview is shown for a second (instead of
  immediately skipping to the battle).

- Various aspects of the animation engine should be much less brittle
  now.

- Many bugs were fixed (and new ones were introduced).
2018-06-07 02:22:36 -07:00
asgdf
420eb1db77 Fix styling of first teambuilder search result in dark mode (#1100) 2018-04-03 17:09:27 -05:00
urkerab
8994e9e704 Show userlist widget in battles (#1092) 2018-03-25 19:09:57 -05:00
HoeenHero
1ad75e9891 Make disabled select boxes readable in dark mode (#1078) 2018-01-31 18:01:53 -06:00
Guangcong Luo
32d6b14b63 Teambuilder: Adjust slider alignment 2017-12-25 01:16:14 -05:00
Guangcong Luo
5120e59f5e Drop jslider dependency
jslider was incredibly buggy, and most likely the cause of the problems
with the teambuilder on mobile, and required some pretty ridiculous
hacks, and leaked memory.

We're now using HTML5 sliders, like we are with the volume controls.

HTML5 sliders aren't supported by IE9, but they're supported by most
other browsers PS cares about. If not, well, they won't look too ugly
probably...
2017-12-21 05:05:22 -06:00
Guangcong Luo
0d17726529 Give summary elements clicky cursors 2017-12-17 03:52:11 -05:00
Jeremy Piemonte
ab1b16c1a8 Fix issues with horizontal scroll bar in Chrome (#1047)
Several users have been complaining that a horizontal scroll bar is getting in the way in chat rooms and PM boxes, this fixes that.
2017-11-21 05:08:38 -06:00
Guangcong Luo
5d363f4c44 Lighten cyan/blue usernames slightly 2017-10-21 14:51:12 -04:00
Guangcong Luo
c624235456 Add tabbar CSS to replay.css
They're used in replay searches now.
2017-10-21 13:10:58 -04:00
Guangcong Luo
be0ca58192 Remove Credits popup
The Teambuilder Credits link is now just a link to
http://pokemonshowdown.com/credits
2017-10-21 13:10:44 -04:00
Guangcong Luo
c29566cab0 Dark mode: Improve select/team button styling
Fixes #1030
2017-10-15 20:23:37 -04:00
Guangcong Luo
f2f723e40c Dark mode: Improve teambuilder results styling 2017-10-15 19:54:25 -04:00
Guangcong Luo
8c48261640 Make self-highlight slightly more visible 2017-10-15 19:54:08 -04:00
Wally
c2ad1ad8d3 Dark mode: Improve some more teambuilder colors (#1032) 2017-10-15 18:31:03 -05:00