Commit graph

157 commits

Author SHA1 Message Date
Vladimir Panteleev
3e17def067 assets/scripts.js: Fix handling of IDNT segment
This segment does not have an end-time, so treat all timestamps past
its start time as belonging to it.

Fixes #null appearing in hashes and stored locations.
2019-07-28 22:13:59 +00:00
Vladimir Panteleev
941c975e36 assets/scripts.js: Log previous persistentState values 2019-07-28 21:25:53 +00:00
Vladimir Panteleev
9bf91b095b assets/scripts.js: Initialize persistent state from data
Fixes JS errors when seeking past first choice with empty localStorage.
2019-07-28 21:25:31 +00:00
Vladimir Panteleev
9ea55f3c02 assets/scripts.js: Fix recording of breadcrumbs after jumps 2019-07-28 21:25:10 +00:00
Ali Zemani
a76a551fe9
Merge pull request #22 from CyberShadow/pull-20190727-205645
More fixes
2019-07-29 01:45:09 +04:30
Vladimir Panteleev
9df4416b2b assets/scripts.js: Use consistent variable name 2019-07-28 19:38:29 +00:00
Vladimir Panteleev
6d34768b11 assets/scripts.js: Fix case of unmapped segment
Fixes behavior and JS errors during the post-credit studio logos.
2019-07-28 19:36:33 +00:00
Vladimir Panteleev
ad877dfe1e assets/scripts.js: Make left/right arrow seeks "natural"
Unbreaks jumping to/past first choice with empty localStorage.
2019-07-28 19:04:54 +00:00
Vladimir Panteleev
96908eb3af assets/scripts.js: Fix jumping forward while paused 2019-07-28 19:04:53 +00:00
Vladimir Panteleev
e9a9719f21 Add Unlicense header to source files
As per f3a58d84bf
2019-07-28 19:04:43 +00:00
Vladimir Panteleev
7ad6dec786 assets/scripts.js: Fix comparing to strings in preconditions 2019-07-28 18:01:33 +00:00
Ali Zemani
a0984c1f46
Merge pull request #21 from CyberShadow/pull-20190727-205645
Many fixes and improvements
2019-07-28 14:25:26 +04:30
Vladimir Panteleev
4260f0ccf4 assets/scripts.js: Tweak precondition debug log 2019-07-28 08:38:34 +00:00
Vladimir Panteleev
3fbed6886b assets/scripts.js: Implement more precondition expression types 2019-07-28 08:38:34 +00:00
Vladimir Panteleev
f9b7bc840c assets/scripts.js: Simplify some precondition code 2019-07-28 08:35:23 +00:00
Vladimir Panteleev
60fd4fa882 assets/scripts.js: Check moment preconditions 2019-07-28 08:21:34 +00:00
Vladimir Panteleev
59782b0707 assets/scripts.js: Improve precondition handling 2019-07-28 08:16:55 +00:00
Vladimir Panteleev
bc81c00be8 Make the left-arrow key do the reverse of the right-arrow key
Track how we got to a certain scene through persistent breadcrumbs,
then follow them back to go along the path the user took.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
d228a13031 assets/scripts.js: Implement disableImmediateSceneTransition
Allow navigating from dead-end segments without waiting for the
segment to end.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
e7b80f431a assets/scripts.js: Improve choice handling
- Apply effects of the default choice even if the user didn't click
  anything

- Pave way for implementing disableImmediateSceneTransition
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
2fce7361e9 index.html: Disable looping
Pointless in this case.

Avoid inadvertently resetting all variables upon reaching the credits screen.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
d5b63699fe assets/scripts.js: Make choice timer bar animation smoother
It's still not smooth due to the ontimeupdate rate limit, but at least
it's less choppy (moves at a consistent speed).
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
39c3144e4c assets/scripts.js: Improve timer logic
Use end of ongoing moments and start of upcoming moments too.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
57166f7daa assets/scripts.js: Remember and restore playback position when reopening
Just like the real thing.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
bc5a6bf2b9 assets/scripts.js: Clean up some global variables 2019-07-28 08:16:55 +00:00
Vladimir Panteleev
449e112040 assets/scripts.js: Make persistent state actually persistent
Use localStorage to save persistent variables.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
336a65f31a assets/scripts.js: Pause and unpause on click
- By placing the event handler on the video element, we ensure we don't
  receive it when a choice item was clicked.

- Use preventDefault to avoid the pause-and-immediately-unpause
  problem due to the video element itself also handling the event.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
7989e92f2b assets/scripts.js: Fix Space not unpausing with visible controls
When the video controls are visible, the video is paused, and the
video element is focused, pressing Space would unpause the video and
then immediately pause it again.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
ea6ff3f69e assets/scripts.js: Use moments for right key
Allows stopping at false interactions (e.g. 2B/1).
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
783db22881 assets/scripts.js: Show choices on game-over screens, too 2019-07-28 08:16:55 +00:00
Vladimir Panteleev
ab29b0e5c8 assets/scripts.js: More seek/timing logic fixes 2019-07-28 08:16:55 +00:00
Vladimir Panteleev
9367a9fba9 assets/scripts.js: Add up/down keys to speed up/slow down video
Again, useful for debugging.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
925d950efb assets/scripts.js: Fix playing hash + pre-specified video src 2019-07-28 08:16:55 +00:00
Vladimir Panteleev
776c2d1aaa assets/scripts.js: Allow #t12345 hash syntax
Similar to YouTube's ?t=12345.

Mostly for debugging.
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
363b1e32a8 assets/scripts.js: Improve title and hash updates
- Update them when the playback position changes by any means, not
  just when playing a certain chapter

- Include moments (choices) in hash and title

- Use choice descriptions in titles

- Allow meaningful back/forward navigation through chapters and choices
2019-07-28 08:16:55 +00:00
Vladimir Panteleev
c5fafb4c16 assets/scripts.js: Allow jumping to a chapter by setting the hash 2019-07-28 01:27:28 +00:00
Vladimir Panteleev
b4e04bccd1 assets/scripts.js: Improve handling of seeking
- Don't apply impressions when the player seeks into moments with
  impression data

- Fix false positives when seeking within the first few seconds of a
  segment
2019-07-28 01:20:34 +00:00
Vladimir Panteleev
588036f80e assets/scripts.js: Rename generateJs to preconditionToJS 2019-07-28 01:20:34 +00:00
Vladimir Panteleev
350a2caead assets/scripts.js: Fix undefined error for choices without descriptions 2019-07-28 01:20:34 +00:00
Vladimir Panteleev
4195108b0d assets/scripts.js: Track time and moments properly
WIP.

- Fixes a family of bugs such as pausing the video during a choice
  resulting in the video resuming at the default choice (while still
  paused) after a while.

- Unifies tracking of moments and cleans up redundant code.

- Fixes unnecessary stutter when transitioning between two segments
  that are adjacent in the video file.
2019-07-28 01:20:34 +00:00
Vladimir Panteleev
2c987cd81e assets/scripts.js: Improve handling of pre-specified video src
Fixes behavior if HTML is edited to indicate the video source.
2019-07-28 01:20:34 +00:00
Vladimir Panteleev
7e26ff3ddb assets/scripts.js: Don't hardcode initial segment 2019-07-28 01:20:34 +00:00
Vladimir Panteleev
68ec8bb628 assets/scripts.js: Fix check for undefined 2019-07-28 01:20:34 +00:00
Vladimir Panteleev
64bad02a3b assets/scripts.js: Do not trigger key events with modifier keys
These key combinations usually mean something else and are not
intended for the web page.
2019-07-28 01:20:34 +00:00
Vladimir Panteleev
afc3abb81c Fix onload JS error 2019-07-28 01:20:34 +00:00
Vladimir Panteleev
19c8003e62 assets/scripts.js: Delete unused function 2019-07-28 01:20:34 +00:00
Vladimir Panteleev
2826849ee0 assets/scripts.js: Fix JS warnings 2019-07-28 01:20:34 +00:00
Ali Zemani
65b9e0f437 update subtitle list on index.html 2019-07-15 16:56:54 +04:30
Ali Zemani
4a71282d1b Add Indonesian Subtitle 2019-07-15 16:51:07 +04:30
Ali Zemani
41d447dce7 Add Polish Subtitle 2019-07-15 16:48:12 +04:30