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
38f1384f
Commit
38f1384f
authored
Mar 15, 2020
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ParseSong: Separate events from notes
parent
0a578578
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
33 deletions
+46
-33
public/src/js/debug.js
public/src/js/debug.js
+2
-2
public/src/js/game.js
public/src/js/game.js
+4
-17
public/src/js/parseosu.js
public/src/js/parseosu.js
+16
-3
public/src/js/parsetja.js
public/src/js/parsetja.js
+12
-3
public/src/js/view.js
public/src/js/view.js
+12
-8
No files found.
public/src/js/debug.js
View file @
38f1384f
...
@@ -147,8 +147,8 @@ class Debug{
...
@@ -147,8 +147,8 @@ class Debug{
return
i
===
0
||
Math
.
abs
(
measure
.
ms
-
array
[
i
-
1
].
ms
)
>
0.01
return
i
===
0
||
Math
.
abs
(
measure
.
ms
-
array
[
i
-
1
].
ms
)
>
0.01
})
})
this
.
measureNumSlider
.
setMinMax
(
0
,
measures
.
length
-
1
)
this
.
measureNumSlider
.
setMinMax
(
0
,
measures
.
length
-
1
)
if
(
this
.
measureNum
&&
measures
.
length
>
this
.
measureNum
){
if
(
this
.
measureNum
>
0
&&
measures
.
length
>=
this
.
measureNum
){
var
measureMS
=
measures
[
this
.
measureNum
].
ms
var
measureMS
=
measures
[
this
.
measureNum
-
1
].
ms
var
game
=
this
.
controller
.
game
var
game
=
this
.
controller
.
game
game
.
started
=
true
game
.
started
=
true
var
timestamp
=
Date
.
now
()
var
timestamp
=
Date
.
now
()
...
...
public/src/js/game.js
View file @
38f1384f
...
@@ -5,6 +5,7 @@ class Game{
...
@@ -5,6 +5,7 @@ class Game{
this
.
songData
=
songData
this
.
songData
=
songData
this
.
elapsedTime
=
0
this
.
elapsedTime
=
0
this
.
currentCircle
=
-
1
this
.
currentCircle
=
-
1
this
.
currentEvent
=
0
this
.
updateCurrentCircle
()
this
.
updateCurrentCircle
()
this
.
combo
=
0
this
.
combo
=
0
this
.
rules
=
new
GameRules
(
this
)
this
.
rules
=
new
GameRules
(
this
)
...
@@ -47,13 +48,7 @@ class Game{
...
@@ -47,13 +48,7 @@ class Game{
}
}
initTiming
(){
initTiming
(){
// Date when the chrono is started (before the game begins)
// Date when the chrono is started (before the game begins)
var
firstCircle
var
firstCircle
=
this
.
songData
.
circles
[
0
]
for
(
var
i
=
0
;
i
<
this
.
songData
.
circles
.
length
;
i
++
){
firstCircle
=
this
.
songData
.
circles
[
i
]
if
(
firstCircle
.
type
!==
"
event
"
){
break
}
}
if
(
this
.
controller
.
calibrationMode
){
if
(
this
.
controller
.
calibrationMode
){
var
offsetTime
=
0
var
offsetTime
=
0
}
else
{
}
else
{
...
@@ -238,9 +233,6 @@ class Game{
...
@@ -238,9 +233,6 @@ class Game{
}
}
}
}
skipNote
(
circle
){
skipNote
(
circle
){
if
(
circle
.
type
===
"
event
"
){
return
}
if
(
circle
.
section
){
if
(
circle
.
section
){
this
.
resetSection
()
this
.
resetSection
()
}
}
...
@@ -258,9 +250,6 @@ class Game{
...
@@ -258,9 +250,6 @@ class Game{
checkPlays
(){
checkPlays
(){
var
circles
=
this
.
songData
.
circles
var
circles
=
this
.
songData
.
circles
var
circle
=
circles
[
this
.
currentCircle
]
var
circle
=
circles
[
this
.
currentCircle
]
if
(
circle
&&
circle
.
type
===
"
event
"
){
this
.
updateCurrentCircle
()
}
if
(
this
.
controller
.
autoPlayEnabled
){
if
(
this
.
controller
.
autoPlayEnabled
){
while
(
circle
&&
this
.
controller
.
autoPlay
(
circle
)){
while
(
circle
&&
this
.
controller
.
autoPlay
(
circle
)){
...
@@ -469,9 +458,7 @@ class Game{
...
@@ -469,9 +458,7 @@ class Game{
}
}
getLastCircle
(
circles
){
getLastCircle
(
circles
){
for
(
var
i
=
circles
.
length
;
i
--
;){
for
(
var
i
=
circles
.
length
;
i
--
;){
if
(
circles
[
i
].
type
!==
"
event
"
){
return
circles
[
i
]
return
circles
[
i
]
}
}
}
}
}
whenLastCirclePlayed
(){
whenLastCirclePlayed
(){
...
@@ -623,7 +610,7 @@ class Game{
...
@@ -623,7 +610,7 @@ class Game{
var
circles
=
this
.
songData
.
circles
var
circles
=
this
.
songData
.
circles
do
{
do
{
var
circle
=
circles
[
++
this
.
currentCircle
]
var
circle
=
circles
[
++
this
.
currentCircle
]
}
while
(
circle
&&
(
circle
.
branch
&&
!
circle
.
branch
.
active
||
circle
.
type
===
"
event
"
))
}
while
(
circle
&&
(
circle
.
branch
&&
!
circle
.
branch
.
active
))
}
}
getCurrentCircle
(){
getCurrentCircle
(){
return
this
.
currentCircle
return
this
.
currentCircle
...
...
public/src/js/parseosu.js
View file @
38f1384f
...
@@ -48,6 +48,7 @@ class ParseOsu{
...
@@ -48,6 +48,7 @@ class ParseOsu{
lastBeatInterval
:
0
,
lastBeatInterval
:
0
,
bpm
:
0
bpm
:
0
}
}
this
.
events
=
[]
this
.
generalInfo
=
this
.
parseGeneralInfo
()
this
.
generalInfo
=
this
.
parseGeneralInfo
()
this
.
metadata
=
this
.
parseMetadata
()
this
.
metadata
=
this
.
parseMetadata
()
this
.
editor
=
this
.
parseEditor
()
this
.
editor
=
this
.
parseEditor
()
...
@@ -244,6 +245,18 @@ class ParseOsu{
...
@@ -244,6 +245,18 @@ class ParseOsu{
var
circles
=
[]
var
circles
=
[]
var
circleID
=
0
var
circleID
=
0
var
indexes
=
this
.
getStartEndIndexes
(
"
HitObjects
"
)
var
indexes
=
this
.
getStartEndIndexes
(
"
HitObjects
"
)
var
lastBeatMS
=
this
.
beatInfo
.
beatInterval
var
lastGogo
=
false
var
pushCircle
=
circle
=>
{
circles
.
push
(
circle
)
if
(
lastBeatMS
!==
circle
.
beatMS
||
lastGogo
!==
circle
.
gogoTime
){
lastBeatMS
=
circle
.
beatMS
lastGogo
=
circle
.
gogoTime
this
.
events
.
push
(
circle
)
}
}
for
(
var
i
=
indexes
.
start
;
i
<=
indexes
.
end
;
i
++
){
for
(
var
i
=
indexes
.
start
;
i
<=
indexes
.
end
;
i
++
){
circleID
++
circleID
++
var
values
=
this
.
data
[
i
].
split
(
"
,
"
)
var
values
=
this
.
data
[
i
].
split
(
"
,
"
)
...
@@ -277,7 +290,7 @@ class ParseOsu{
...
@@ -277,7 +290,7 @@ class ParseOsu{
var
endTime
=
parseInt
(
values
[
this
.
osu
.
ENDTIME
])
var
endTime
=
parseInt
(
values
[
this
.
osu
.
ENDTIME
])
var
hitMultiplier
=
this
.
difficultyRange
(
this
.
difficulty
.
overallDifficulty
,
3
,
5
,
7.5
)
*
1.65
var
hitMultiplier
=
this
.
difficultyRange
(
this
.
difficulty
.
overallDifficulty
,
3
,
5
,
7.5
)
*
1.65
var
requiredHits
=
Math
.
floor
(
Math
.
max
(
1
,
(
endTime
-
start
)
/
1000
*
hitMultiplier
))
var
requiredHits
=
Math
.
floor
(
Math
.
max
(
1
,
(
endTime
-
start
)
/
1000
*
hitMultiplier
))
circles
.
push
(
new
Circle
({
pushCircle
(
new
Circle
({
id
:
circleID
,
id
:
circleID
,
start
:
start
+
this
.
offset
,
start
:
start
+
this
.
offset
,
type
:
"
balloon
"
,
type
:
"
balloon
"
,
...
@@ -304,7 +317,7 @@ class ParseOsu{
...
@@ -304,7 +317,7 @@ class ParseOsu{
type
=
"
drumroll
"
type
=
"
drumroll
"
txt
=
strings
.
note
.
drumroll
txt
=
strings
.
note
.
drumroll
}
}
circles
.
push
(
new
Circle
({
pushCircle
(
new
Circle
({
id
:
circleID
,
id
:
circleID
,
start
:
start
+
this
.
offset
,
start
:
start
+
this
.
offset
,
type
:
type
,
type
:
type
,
...
@@ -339,7 +352,7 @@ class ParseOsu{
...
@@ -339,7 +352,7 @@ class ParseOsu{
emptyValue
=
true
emptyValue
=
true
}
}
if
(
!
emptyValue
){
if
(
!
emptyValue
){
circles
.
push
(
new
Circle
({
pushCircle
(
new
Circle
({
id
:
circleID
,
id
:
circleID
,
start
:
start
+
this
.
offset
,
start
:
start
+
this
.
offset
,
type
:
type
,
type
:
type
,
...
...
public/src/js/parsetja.js
View file @
38f1384f
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
this
.
metadata
=
this
.
parseMetadata
()
this
.
metadata
=
this
.
parseMetadata
()
this
.
measures
=
[]
this
.
measures
=
[]
this
.
beatInfo
=
{}
this
.
beatInfo
=
{}
this
.
events
=
[]
if
(
!
metaOnly
){
if
(
!
metaOnly
){
this
.
circles
=
this
.
parseCircles
()
this
.
circles
=
this
.
parseCircles
()
}
}
...
@@ -248,7 +249,12 @@
...
@@ -248,7 +249,12 @@
lastDrumroll
=
circleObj
lastDrumroll
=
circleObj
}
}
circles
.
push
(
circleObj
)
if
(
note
.
event
){
this
.
events
.
push
(
circleObj
)
}
if
(
note
.
type
!==
"
event
"
){
circles
.
push
(
circleObj
)
}
}
else
if
(
!
(
currentMeasure
.
length
>=
24
&&
(
!
currentMeasure
[
i
+
1
]
||
currentMeasure
[
i
+
1
].
type
))
}
else
if
(
!
(
currentMeasure
.
length
>=
24
&&
(
!
currentMeasure
[
i
+
1
]
||
currentMeasure
[
i
+
1
].
type
))
&&
!
(
currentMeasure
.
length
>=
48
&&
(
!
currentMeasure
[
i
+
2
]
||
currentMeasure
[
i
+
2
].
type
||
!
currentMeasure
[
i
+
3
]
||
currentMeasure
[
i
+
3
].
type
)))
{
&&
!
(
currentMeasure
.
length
>=
48
&&
(
!
currentMeasure
[
i
+
2
]
||
currentMeasure
[
i
+
2
].
type
||
!
currentMeasure
[
i
+
3
]
||
currentMeasure
[
i
+
3
].
type
)))
{
if
(
note_chain
.
length
>
1
&&
currentMeasure
.
length
>=
8
)
{
if
(
note_chain
.
length
>
1
&&
currentMeasure
.
length
>=
8
)
{
...
@@ -266,9 +272,12 @@
...
@@ -266,9 +272,12 @@
}
}
}
}
var
insertNote
=
circleObj
=>
{
var
insertNote
=
circleObj
=>
{
lastBpm
=
bpm
lastGogo
=
gogo
if
(
circleObj
){
if
(
circleObj
){
if
(
bpm
!==
lastBpm
||
gogo
!==
lastGogo
){
circleObj
.
event
=
true
lastBpm
=
bpm
lastGogo
=
gogo
}
currentMeasure
.
push
(
circleObj
)
currentMeasure
.
push
(
circleObj
)
}
}
}
}
...
...
public/src/js/view.js
View file @
38f1384f
...
@@ -1584,17 +1584,21 @@
...
@@ -1584,17 +1584,21 @@
// Start animation to gauge
// Start animation to gauge
circle
.
animate
(
ms
)
circle
.
animate
(
ms
)
}
}
if
(
ms
-
this
.
controller
.
audioLatency
>=
circle
.
ms
&&
!
circle
.
beatMSCopied
&&
(
!
circle
.
branch
||
circle
.
branch
.
active
)){
}
if
(
this
.
beatInterval
!==
circle
.
beatMS
){
var
game
=
this
.
controller
.
game
this
.
changeBeatInterval
(
circle
.
beatMS
)
for
(
var
i
=
0
;
i
<
game
.
songData
.
events
.
length
;
i
++
){
var
event
=
game
.
songData
.
events
[
i
]
if
(
ms
-
this
.
controller
.
audioLatency
>=
event
.
ms
&&
!
event
.
beatMSCopied
&&
(
!
event
.
branch
||
event
.
branch
.
active
)){
if
(
this
.
beatInterval
!==
event
.
beatMS
){
this
.
changeBeatInterval
(
event
.
beatMS
)
}
}
circle
.
beatMSCopied
=
true
event
.
beatMSCopied
=
true
}
}
if
(
ms
-
this
.
controller
.
audioLatency
>=
circle
.
ms
&&
!
circle
.
gogoChecked
&&
(
!
circle
.
branch
||
circle
.
branch
.
active
)){
if
(
ms
-
this
.
controller
.
audioLatency
>=
event
.
ms
&&
!
event
.
gogoChecked
&&
(
!
event
.
branch
||
event
.
branch
.
active
)){
if
(
this
.
gogoTime
!=
circle
.
gogoTime
){
if
(
this
.
gogoTime
!=
event
.
gogoTime
){
this
.
toggleGogoTime
(
circle
)
this
.
toggleGogoTime
(
event
)
}
}
circle
.
gogoChecked
=
true
event
.
gogoChecked
=
true
}
}
}
}
}
}
...
...
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