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
0e1283c5
Commit
0e1283c5
authored
Oct 15, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add autoplay toggle, fix notes not being skipped on autoplay
parent
925e6b44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
9 deletions
+40
-9
public/src/css/debug.css
public/src/css/debug.css
+4
-1
public/src/js/debug.js
public/src/js/debug.js
+31
-3
public/src/js/game.js
public/src/js/game.js
+4
-5
public/src/views/debug.html
public/src/views/debug.html
+1
-0
No files found.
public/src/css/debug.css
View file @
0e1283c5
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
width
:
260px
;
width
:
260px
;
height
:
240px
;
background
:
#fff
;
background
:
#fff
;
border
:
1px
solid
#333
;
border
:
1px
solid
#333
;
color
:
#000
;
color
:
#000
;
...
@@ -111,3 +110,7 @@
...
@@ -111,3 +110,7 @@
#debug
.exit-btn
{
#debug
.exit-btn
{
margin-left
:
3px
;
margin-left
:
3px
;
}
}
#debug
.autoplay-label
{
display
:
none
;
}
public/src/js/debug.js
View file @
0e1283c5
...
@@ -13,6 +13,8 @@ class Debug{
...
@@ -13,6 +13,8 @@ class Debug{
this
.
offsetDiv
=
this
.
debugDiv
.
getElementsByClassName
(
"
offset
"
)[
0
]
this
.
offsetDiv
=
this
.
debugDiv
.
getElementsByClassName
(
"
offset
"
)[
0
]
this
.
measureNumDiv
=
this
.
debugDiv
.
getElementsByClassName
(
"
measure-num
"
)[
0
]
this
.
measureNumDiv
=
this
.
debugDiv
.
getElementsByClassName
(
"
measure-num
"
)[
0
]
this
.
restartCheckbox
=
this
.
debugDiv
.
getElementsByClassName
(
"
change-restart
"
)[
0
]
this
.
restartCheckbox
=
this
.
debugDiv
.
getElementsByClassName
(
"
change-restart
"
)[
0
]
this
.
autoplayLabel
=
this
.
debugDiv
.
getElementsByClassName
(
"
autoplay-label
"
)[
0
]
this
.
autoplayCheckbox
=
this
.
debugDiv
.
getElementsByClassName
(
"
autoplay
"
)[
0
]
this
.
restartBtn
=
this
.
debugDiv
.
getElementsByClassName
(
"
restart-btn
"
)[
0
]
this
.
restartBtn
=
this
.
debugDiv
.
getElementsByClassName
(
"
restart-btn
"
)[
0
]
this
.
exitBtn
=
this
.
debugDiv
.
getElementsByClassName
(
"
exit-btn
"
)[
0
]
this
.
exitBtn
=
this
.
debugDiv
.
getElementsByClassName
(
"
exit-btn
"
)[
0
]
...
@@ -23,6 +25,7 @@ class Debug{
...
@@ -23,6 +25,7 @@ class Debug{
pageEvents
.
add
(
this
.
minimiseDiv
,
"
click
"
,
this
.
minimise
.
bind
(
this
))
pageEvents
.
add
(
this
.
minimiseDiv
,
"
click
"
,
this
.
minimise
.
bind
(
this
))
pageEvents
.
add
(
this
.
restartBtn
,
"
click
"
,
this
.
restartSong
.
bind
(
this
))
pageEvents
.
add
(
this
.
restartBtn
,
"
click
"
,
this
.
restartSong
.
bind
(
this
))
pageEvents
.
add
(
this
.
exitBtn
,
"
click
"
,
this
.
clean
.
bind
(
this
))
pageEvents
.
add
(
this
.
exitBtn
,
"
click
"
,
this
.
clean
.
bind
(
this
))
pageEvents
.
add
(
this
.
autoplayCheckbox
,
"
change
"
,
this
.
toggleAutoplay
.
bind
(
this
))
this
.
offsetSlider
=
new
InputSlider
(
this
.
offsetDiv
,
-
60
,
60
,
3
)
this
.
offsetSlider
=
new
InputSlider
(
this
.
offsetDiv
,
-
60
,
60
,
3
)
this
.
offsetSlider
.
onchange
(
this
.
offsetChange
.
bind
(
this
))
this
.
offsetSlider
.
onchange
(
this
.
offsetChange
.
bind
(
this
))
...
@@ -85,6 +88,7 @@ class Debug{
...
@@ -85,6 +88,7 @@ class Debug{
updateStatus
(){
updateStatus
(){
if
(
debugObj
.
controller
&&
!
this
.
controller
){
if
(
debugObj
.
controller
&&
!
this
.
controller
){
this
.
restartBtn
.
style
.
display
=
"
block
"
this
.
restartBtn
.
style
.
display
=
"
block
"
this
.
autoplayLabel
.
style
.
display
=
"
block
"
this
.
controller
=
debugObj
.
controller
this
.
controller
=
debugObj
.
controller
var
selectedSong
=
this
.
controller
.
selectedSong
var
selectedSong
=
this
.
controller
.
selectedSong
...
@@ -109,16 +113,16 @@ class Debug{
...
@@ -109,16 +113,16 @@ class Debug{
var
circles
=
game
.
songData
.
circles
var
circles
=
game
.
songData
.
circles
for
(
var
i
in
circles
){
for
(
var
i
in
circles
){
game
.
currentCircle
=
i
game
.
currentCircle
=
i
if
(
circles
[
i
].
ms
<
measureMS
){
if
(
circles
[
i
].
endTime
>=
measureMS
){
game
.
currentCircle
=
i
}
else
{
break
break
}
}
}
}
}
}
this
.
autoplayCheckbox
.
checked
=
this
.
controller
.
autoPlayEnabled
}
}
if
(
this
.
controller
&&
!
debugObj
.
controller
){
if
(
this
.
controller
&&
!
debugObj
.
controller
){
this
.
restartBtn
.
style
.
display
=
""
this
.
restartBtn
.
style
.
display
=
""
this
.
autoplayLabel
.
style
.
display
=
""
this
.
controller
=
null
this
.
controller
=
null
}
}
}
}
...
@@ -149,14 +153,38 @@ class Debug{
...
@@ -149,14 +153,38 @@ class Debug{
this
.
controller
.
restartSong
()
this
.
controller
.
restartSong
()
}
}
}
}
toggleAutoplay
(){
if
(
this
.
controller
){
this
.
controller
.
autoPlayEnabled
=
this
.
autoplayCheckbox
.
checked
if
(
!
this
.
controller
.
autoPlayEnabled
){
var
keyboard
=
debugObj
.
controller
.
keyboard
var
kbd
=
keyboard
.
getBindings
()
keyboard
.
setKey
(
kbd
.
don_l
,
false
)
keyboard
.
setKey
(
kbd
.
don_r
,
false
)
keyboard
.
setKey
(
kbd
.
ka_l
,
false
)
keyboard
.
setKey
(
kbd
.
ka_r
,
false
)
}
}
}
clean
(){
clean
(){
this
.
offsetSlider
.
clean
()
this
.
offsetSlider
.
clean
()
pageEvents
.
remove
(
window
,
[
"
mousedown
"
,
"
mouseup
"
,
"
mousemove
"
,
"
blur
"
])
pageEvents
.
remove
(
window
,
[
"
mousedown
"
,
"
mouseup
"
,
"
mousemove
"
,
"
blur
"
])
pageEvents
.
remove
(
this
.
title
,
"
mousedown
"
)
pageEvents
.
remove
(
this
.
title
,
"
mousedown
"
)
pageEvents
.
remove
(
this
.
minimiseDiv
,
"
click
"
)
pageEvents
.
remove
(
this
.
restartBtn
,
"
click
"
)
pageEvents
.
remove
(
this
.
exitBtn
,
"
click
"
)
pageEvents
.
remove
(
this
.
autoplayCheckbox
,
"
change
"
)
delete
this
.
titleDiv
delete
this
.
titleDiv
delete
this
.
minimiseDiv
delete
this
.
minimiseDiv
delete
this
.
offsetDiv
delete
this
.
measureNumDiv
delete
this
.
restartCheckbox
delete
this
.
autoplayLabel
delete
this
.
autoplayCheckbox
delete
this
.
restartBtn
delete
this
.
exitBtn
delete
this
.
controller
delete
this
.
controller
debugObj
.
state
=
"
closed
"
debugObj
.
state
=
"
closed
"
...
...
public/src/js/game.js
View file @
0e1283c5
...
@@ -71,7 +71,7 @@ class Game{
...
@@ -71,7 +71,7 @@ class Game{
var
endTime
=
circle
.
getEndTime
()
+
(
drumrollNotes
?
0
:
this
.
rules
.
bad
)
var
endTime
=
circle
.
getEndTime
()
+
(
drumrollNotes
?
0
:
this
.
rules
.
bad
)
if
(
ms
>=
circle
.
getMS
()){
if
(
ms
>=
circle
.
getMS
()){
if
(
drumrollNotes
&&
!
circle
.
rendaPlayed
){
if
(
drumrollNotes
&&
!
circle
.
rendaPlayed
&&
ms
<
endTime
){
circle
.
rendaPlayed
=
true
circle
.
rendaPlayed
=
true
if
(
this
.
rules
.
difficulty
===
"
easy
"
){
if
(
this
.
rules
.
difficulty
===
"
easy
"
){
assets
.
sounds
[
"
renda
"
+
this
.
controller
.
snd
].
stop
()
assets
.
sounds
[
"
renda
"
+
this
.
controller
.
snd
].
stop
()
...
@@ -84,10 +84,6 @@ class Game{
...
@@ -84,10 +84,6 @@ class Game{
}
}
circle
.
beatMSCopied
=
true
circle
.
beatMSCopied
=
true
}
}
if
(
!
nextSet
){
nextSet
=
true
this
.
currentCircle
=
i
}
}
}
if
(
ms
>
endTime
){
if
(
ms
>
endTime
){
if
(
!
this
.
controller
.
autoPlayEnabled
){
if
(
!
this
.
controller
.
autoPlayEnabled
){
...
@@ -113,6 +109,9 @@ class Game{
...
@@ -113,6 +109,9 @@ class Game{
}
}
}
}
}
}
}
else
if
(
!
this
.
controller
.
autoPlayEnabled
&&
!
nextSet
){
nextSet
=
true
this
.
currentCircle
=
i
}
}
}
}
}
}
...
...
public/src/views/debug.html
View file @
0e1283c5
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<span
class=
"reset"
>
x
</span><input
type=
"text"
value=
""
readonly
><span
class=
"minus"
>
-
</span><span
class=
"plus"
>
+
</span>
<span
class=
"reset"
>
x
</span><input
type=
"text"
value=
""
readonly
><span
class=
"minus"
>
-
</span><span
class=
"plus"
>
+
</span>
</div>
</div>
<label><input
class=
"change-restart"
type=
"checkbox"
>
Restart on change
</label>
<label><input
class=
"change-restart"
type=
"checkbox"
>
Restart on change
</label>
<label
class=
"autoplay-label"
><input
class=
"autoplay"
type=
"checkbox"
>
Auto play
</label>
<div
class=
"bottom-btns"
>
<div
class=
"bottom-btns"
>
<div
class=
"restart-btn"
>
Restart song
</div>
<div
class=
"restart-btn"
>
Restart song
</div>
<div
class=
"exit-btn"
>
Exit debug
</div>
<div
class=
"exit-btn"
>
Exit debug
</div>
...
...
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