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).
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.
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.
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.
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)
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.
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.
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.
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.
- 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
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.
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).
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...