Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Taiko Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Taiko Web
Commits
fcc3235b
Commit
fcc3235b
authored
Aug 28, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pausing during autoplay
parent
2f717614
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
public/src/js/keyboard.js
public/src/js/keyboard.js
+16
-3
public/src/js/soundsystem.js
public/src/js/soundsystem.js
+4
-0
No files found.
public/src/js/keyboard.js
View file @
fcc3235b
...
@@ -12,17 +12,30 @@ function Keyboard(controller){
...
@@ -12,17 +12,30 @@ function Keyboard(controller){
// Disable back navigation when pressing backspace
// Disable back navigation when pressing backspace
e
.
preventDefault
();
e
.
preventDefault
();
if
(
!
controller
.
autoPlay
(
)){
if
(
_this
.
buttonEnabled
(
e
.
which
)){
_this
.
setKey
(
e
.
which
,
true
);
_this
.
setKey
(
e
.
which
,
true
);
}
}
});
});
$
(
document
).
keyup
(
function
(
e
){
$
(
document
).
keyup
(
function
(
e
){
if
(
!
controller
.
autoPlay
(
)){
if
(
_this
.
buttonEnabled
(
e
.
which
)){
_this
.
setKey
(
e
.
which
,
false
);
_this
.
setKey
(
e
.
which
,
false
);
}
}
});
});
this
.
buttonEnabled
=
function
(
keyCode
){
if
(
controller
.
autoPlay
()){
switch
(
keyCode
){
case
86
:
case
66
:
case
67
:
case
78
:
return
false
}
}
return
true
}
this
.
checkGameKeys
=
function
(){
this
.
checkGameKeys
=
function
(){
if
(
_keys
[
86
]
&&
!
_this
.
isWaitingForKeyup
(
86
,
"
sound
"
)){
if
(
_keys
[
86
]
&&
!
_this
.
isWaitingForKeyup
(
86
,
"
sound
"
)){
...
@@ -58,7 +71,7 @@ function Keyboard(controller){
...
@@ -58,7 +71,7 @@ function Keyboard(controller){
controller
.
songSelection
();
controller
.
songSelection
();
}
}
if
(
_keys
[
81
]
&&
!
_this
.
isWaitingForKeyup
(
81
,
"
menu
"
)){
if
(
_keys
[
81
]
&&
!
_this
.
isWaitingForKeyup
(
81
,
"
menu
"
)){
//
P
, pause the game
//
Q
, pause the game
_this
.
waitForKeyup
(
81
,
"
menu
"
);
_this
.
waitForKeyup
(
81
,
"
menu
"
);
controller
.
togglePauseMenu
();
controller
.
togglePauseMenu
();
}
}
...
...
public/src/js/soundsystem.js
View file @
fcc3235b
...
@@ -29,6 +29,10 @@ function soundSystem(controller){
...
@@ -29,6 +29,10 @@ function soundSystem(controller){
}
}
}
}
this
.
pauseSound
=
function
(){
_sounds
[
"
main-music
"
].
pause
();
}
this
.
fadeOutMusic
=
function
(){
this
.
fadeOutMusic
=
function
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment