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
d1efbf01
Commit
d1efbf01
authored
Sep 27, 2018
by
Bui
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39 from LoveEevee/parsesong-drumroll-timing
Parsesong: Fix drumroll timing again
parents
dc01102a
9cd4bca0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
17 deletions
+20
-17
public/src/js/parsesong.js
public/src/js/parsesong.js
+15
-12
public/src/js/songselect.js
public/src/js/songselect.js
+5
-5
No files found.
public/src/js/parsesong.js
View file @
d1efbf01
class
ParseSong
{
constructor
(
fileContent
){
this
.
data
=
fileContent
this
.
osu
=
{
OFFSET
:
0
,
MSPERBEAT
:
1
,
...
...
@@ -35,8 +34,16 @@ class ParseSong{
EDGEHITSOUNDS
:
3
,
EDGEADDITIONS
:
4
}
this
.
data
=
[]
for
(
let
line
of
fileContent
){
line
=
line
.
trim
().
replace
(
/
\/\/
.*/
,
""
)
if
(
line
!==
""
){
this
.
data
.
push
(
line
)
}
}
this
.
beatInfo
=
{
beatInterval
:
0
,
lastBeatInterval
:
0
,
bpm
:
0
}
this
.
generalInfo
=
this
.
parseGeneralInfo
()
...
...
@@ -53,7 +60,7 @@ class ParseSong{
end
:
0
}
while
(
indexes
.
start
<
this
.
data
.
length
){
if
(
this
.
data
[
indexes
.
start
]
.
match
(
type
)
){
if
(
this
.
data
[
indexes
.
start
]
===
"
[
"
+
type
+
"
]
"
){
break
}
indexes
.
start
++
...
...
@@ -61,7 +68,7 @@ class ParseSong{
indexes
.
start
++
indexes
.
end
=
indexes
.
start
while
(
indexes
.
end
<
this
.
data
.
length
){
if
(
this
.
data
[
indexes
.
end
].
match
(
/^
\
s
*
$/
)){
if
(
this
.
data
[
indexes
.
end
].
match
(
/^
\
[\w
+
\]
$/
)){
break
}
indexes
.
end
++
...
...
@@ -122,8 +129,7 @@ class ParseSong{
start
:
start
,
sliderMultiplier
:
sliderMultiplier
,
measure
:
parseInt
(
values
[
this
.
osu
.
METER
]),
gogoTime
:
parseInt
(
values
[
this
.
osu
.
KIAIMODE
]),
beatLength
:
msOrPercent
gogoTime
:
parseInt
(
values
[
this
.
osu
.
KIAIMODE
])
})
}
return
timingPoints
...
...
@@ -235,13 +241,13 @@ class ParseSong{
var
osuType
=
parseInt
(
values
[
this
.
osu
.
TYPE
])
var
hitSound
=
parseInt
(
values
[
this
.
osu
.
HITSOUND
])
var
beatLength
=
speed
var
lastMultiplier
=
this
.
difficulty
.
lastMultiplier
for
(
var
j
=
0
;
j
<
this
.
timingPoints
.
length
;
j
++
){
if
(
this
.
timingPoints
[
j
].
start
>
start
){
break
}
speed
=
this
.
timingPoints
[
j
].
sliderMultiplier
beatLength
=
this
.
timingPoints
[
j
].
beatLength
gogoTime
=
this
.
timingPoints
[
j
].
gogoTime
}
...
...
@@ -264,13 +270,10 @@ class ParseSong{
}
else
if
(
osuType
&
this
.
osu
.
SLIDER
){
var
extras
=
values
.
slice
(
this
.
osu
.
EXTRAS
)
var
distance
=
parseFloat
(
extras
[
this
.
osu
.
PIXELLENGTH
])
var
speedMultiplier
=
beatLength
<
0
?
100.0
/
-
beatLength
:
1
var
speedAdjustedBeatLength
=
this
.
beatInfo
.
beatInterval
/
speedMultiplier
var
taikoVelocity
=
100
*
this
.
difficulty
.
sliderMultiplier
/
speedAdjustedBeatLength
var
taikoDuration
=
distance
/
taikoVelocity
var
endTime
=
start
+
taikoDuration
var
distance
=
parseFloat
(
extras
[
this
.
osu
.
PIXELLENGTH
])
var
velocity
=
this
.
difficulty
.
sliderMultiplier
*
speed
/
10
var
endTime
=
start
+
distance
/
velocity
if
(
hitSound
&
this
.
osu
.
FINISH
){
type
=
"
daiDrumroll
"
...
...
public/src/js/songselect.js
View file @
d1efbf01
...
...
@@ -83,19 +83,19 @@ class SongSelect{
this
.
songs
.
push
({
id
:
song
.
id
,
title
:
song
.
title
,
skin
:
this
.
songSkin
[
song
.
category
||
"
default
"
]
,
skin
:
song
.
category
in
this
.
songSkin
?
this
.
songSkin
[
song
.
category
]
:
this
.
songSkin
.
default
,
stars
:
song
.
stars
,
category
:
song
.
category
,
preview
:
song
.
preview
||
0
})
}
this
.
songs
.
sort
((
a
,
b
)
=>
{
var
sortA
=
this
.
songSkin
[
a
.
category
||
"
default
"
].
sor
t
var
sortB
=
this
.
songSkin
[
b
.
category
||
"
default
"
].
sor
t
if
(
sortA
===
sortB
){
var
catA
=
a
.
category
in
this
.
songSkin
?
this
.
songSkin
[
a
.
category
]
:
this
.
songSkin
.
defaul
t
var
catB
=
b
.
category
in
this
.
songSkin
?
this
.
songSkin
[
b
.
category
]
:
this
.
songSkin
.
defaul
t
if
(
catA
.
sort
===
catB
.
sort
){
return
a
.
id
>
b
.
id
?
1
:
-
1
}
else
{
return
sortA
>
sortB
?
1
:
-
1
return
catA
.
sort
>
catB
.
sort
?
1
:
-
1
}
})
this
.
songs
.
push
({
...
...
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