Commit Graph

24 Commits

Author SHA1 Message Date
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
f6c03e0370 Implement new battle-text-parser
All battle text messages have been moved out of `src/battle.ts` and
into its own file `data/text.js`.

Code for handling this is in the new files `src/battle-log.ts` and
`src/battle-text-parser.ts`.

`data/text.js` is now extremely self-contained, and nearly ready for
translation support!

This is a significant modernization of battle.ts. In addition to moving
messages out:

Functions for getting names (`pokemon.getLowerName()` etc) have been
removed.

`battle.minorQueue` has been removed. Minor lines are now processed
directly on the main queue, with a new `battle.waitForAnimations`
flag to decide whether or not the main queue should wait for animations
to finish before moving on to the next line.

`battle.waitForResult()` and `battle.endPrevAction()` have been
removed. These confusingly-named functions closed the messagebar (and
flush the minor queue). They've been replaced with
`scene.maybeCloseMessagebar()`.

`pokemon.markMove()` and `pokemon.markAbility()` have been renamed
`pokemon.rememberMove()` and `pokemon.rememberAbility()`.
2018-11-15 18:52:53 -06:00
Guangcong Luo
5f05adc856 Split battle-log.ts off from battle-dex.ts
This splits battle-dex.ts up into:

- `battle-dex.ts`
  - dex data access, misc tools
- `battle-log.ts`
  - manipulating HTML, especially in battle logs

This turned out to be a pretty significant portion of what was
previously battle-dex.
2018-11-15 18:52:53 -06:00
Dan Huang
ee91a72dc6 Support headless client Battle (#1151) 2018-10-16 02:48:59 -05:00
Guangcong Luo
4e7f998afa TypeScript data/graphics.js 2018-05-18 17:10:58 -05:00
Guangcong Luo
d247364027 Migrate js/battle.js to TypeScript
This is only a first step and doesn't pass strictNullChecks.

I'm committing now because skipping straight to refactoring will be
easier than trying to make it pass strictNullChecks as-is.

TypeScript found at least a few bugs here, which is nice.
2018-05-16 19:49:25 -05:00
Guangcong Luo
194e07e6d0 Disable package-lock.json
For detailed justification, see the commit message for the
corresponding server change:

2e85de348f
2018-05-14 17:14:27 -05:00
Guangcong Luo
a15ec64d1d Move battledata.js to TypeScript
This is the first step of moving the entire client over to
TypeScript + Preact!!!!

The main change here is that battledata.js has been split into three
files:
- `src/battle-dex.ts`
- `src/battle-dex-data.ts`
- `src/battle-dex-misc.js`

These are concatenated back into `battledata.js` in the client, so
third parties (and specifically, old replay files) should be
unaffected. Also, this makes sure that we don't have more than two
dependencies right now.

The compilation is done with Babel 7 beta, because no stable version
of Babel supports TypeScript. We're not using `tsc` because it can't
compile to ES3 and it doesn't support preserving line numbers.

`toRoomid` has been moved from client.js to battle-dex.ts.
2018-05-14 12:53:34 -05:00
Guangcong Luo
644d5ccf91 Support Google login (two-factor auth) (#999)
This doesn't support setting accounts up for Google login: that still
has to be manually done via the database by setting the email field to
`username@gmail.com@`, where the second `@` denotes that it's using
Gmail login.

If the email field does end in `@`, `getassertion` will note this by
sending `;;@gmail`, to convey that the server is expecting a Google
login token rather than a password.

Upon receiving `;;@gmail`, the client will replace the password box will
with a Google login button, and then send the resulting Google login
token to the server in the `password` field. The server will validate
the "password" using the Google server libraries, and otherwise handle
the login as normal.

Note that Google login requires various features that a paranoid person
might disable; most notably 3rd-party cookies.

Fixes Zarel/Pokemon-Showdown#3394
2017-09-13 16:20:38 -04:00
Guangcong Luo
e96b9b9fd1 Improve animated sprite update script
BW animated sprites are now also automatically generated. In addition,
the generation script can now handle female sprites and cosmetic forms.

The storage format has also changed to be more concise.
2016-12-29 15:32:26 -05:00
Guangcong Luo
1c18bf0f4d Move config.js to /config/ 2016-10-20 13:16:06 -04:00
Ivo Julca
c73ef9ed39 Git: ignore npm-debug.log 2016-03-05 22:09:16 -05:00
Ivo Julca
4f5aa8cecf Git: Ignore automatically built data files 2016-03-04 18:47:27 -05:00
Guangcong Luo
02f0c8e82c Add githooks/build-indexes
This is the search index build script from the Gen 6 Learnsets
repository, slightly rewritten for the PS client environment. It
expects a checkout of the server respository in
`data/Pokemon-Showdown`.
2015-12-21 20:09:55 -06:00
Ivo Julca
d694099484 Implement basic linting 2015-12-03 03:36:01 -05:00
Guangcong Luo
a61ecb88e3 .gitignore node_modules 2015-07-02 13:21:10 -04:00
ascriptmaster
08cec5b0cc .gitignore now ignores Windows-specific Thumbs.db 2014-11-15 13:53:47 -08:00
Guangcong Luo
c883db6e07 Support both static/dynamic index pages 2013-10-04 16:56:27 -05:00
Guangcong Luo
daaa6f3bfd Embed news into HTML for faster loading 2013-09-20 16:48:31 -05:00
Guangcong Luo
3e9f3ba83d Add .DS_Store to .gitignore 2013-09-01 14:05:48 -05:00
Cathy J. Fitzpatrick
c31ca67713 index.php is now index.html 2013-04-16 01:55:14 -07:00
Cathy J. Fitzpatrick
6904aa9c6c Move link whitelist to a config file 2013-03-07 12:58:33 -07:00
Guangcong Luo
3de94d4b1a Some changes to index.php templating
- index.php is gitignored
- soundManager doesn't get a query string
2013-01-26 13:01:00 -08:00
Guangcong Luo
b16c1527da Populate with current state of client 2013-01-23 16:39:14 -08:00