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
3c701dc2
Commit
3c701dc2
authored
Nov 21, 2018
by
Bui
Committed by
GitHub
Nov 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77 from LoveEevee/view-add-category-info
View: Add category info
parents
a3ebf990
0533ae77
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
28 deletions
+96
-28
README.md
README.md
+3
-3
public/src/js/about.js
public/src/js/about.js
+1
-0
public/src/js/canvasdraw.js
public/src/js/canvasdraw.js
+13
-7
public/src/js/view.js
public/src/js/view.js
+79
-18
No files found.
README.md
View file @
3c701dc2
...
...
@@ -3,17 +3,17 @@ A web version of Taiko no Tatsujin
Running instance: https://taiko.bui.pm
Still in develop
e
ment. Works best with Chrome.
Still in development. Works best with Chrome.
## Setup
**Requirements**
: Python 2.7,
[
Flask
](
https://pypi.org/project/Flask/
)
Create a SQLite databse named
`taiko.db`
with the following schema:
Create a SQLite datab
a
se named
`taiko.db`
with the following schema:
CREATE TABLE "songs" ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `title` TEXT NOT NULL, `title_en` TEXT, `subtitle` TEXT, `subtitle_en` TEXT, `easy` INTEGER, `normal` INTEGER, `hard` INTEGER, `oni` INTEGER, `ura` INTEGER, `enabled` INTEGER NOT NULL, `category` INTEGER, `type` TEXT , `offset` REAL NOT NULL )
CREATE TABLE "categories" ( `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `title` TEXT NOT NULL, `title_en` TEXT NOT NULL )
When inserting song rows, leave any difficulty columns as NULL if you don't intend to add notecharts for them.
When inserting song rows, leave any difficulty columns as NULL if you don't intend to add note
charts for them.
Each song's data is contained within a directory under
`public/songs/`
. For example:
...
...
public/src/js/about.js
View file @
3c701dc2
...
...
@@ -48,6 +48,7 @@
diag
.
push
(
"
```
"
)
diag
.
push
(
"
Taiko-Web version:
"
+
this
.
version
)
diag
.
push
(
"
URL:
"
+
location
.
href
)
diag
.
push
(
"
User agent:
"
+
navigator
.
userAgent
)
diag
.
push
(
"
Screen size:
"
+
innerWidth
+
"
x
"
+
innerHeight
+
"
, outer:
"
+
outerWidth
+
"
x
"
+
outerHeight
+
"
, ratio:
"
+
(
window
.
devicePixelRatio
||
1
).
toFixed
(
2
))
if
(
this
.
touchEnabled
){
...
...
public/src/js/canvasdraw.js
View file @
3c701dc2
...
...
@@ -68,8 +68,7 @@
em
:
/
[
mwmw
]
/
,
emCap
:
/
[
MWMW
]
/
,
rWidth
:
/
[
abdfIjo-rtvabdfIjo-rtv
]
/
,
lWidth
:
/
[
ilil
]
/
,
uppercaseDigit
:
/
[
A-ZA-Z0-90-9
]
/
lWidth
:
/
[
ilil
]
/
}
var
numbersFull
=
"
0123456789
"
...
...
@@ -548,6 +547,9 @@
drawn
.
push
({
text
:
"
,
"
,
x
:
0
,
y
:
-
15
,
w
:
7
,
scale
:
[
1
,
0.7
]})
}
else
if
(
symbol
===
"
∀
"
){
drawn
.
push
({
text
:
symbol
,
x
:
-
3
,
y
:
0
,
w
:
55
})
}
else
if
(
r
.
comma
.
test
(
symbol
)){
// Comma, full stop
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
w
:
13
})
}
else
if
(
r
.
en
.
test
(
symbol
)){
// n-width
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
w
:
28
})
...
...
@@ -563,11 +565,15 @@
}
else
if
(
r
.
emCap
.
test
(
symbol
)){
// m-width uppercase
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
w
:
38
})
}
else
if
(
r
.
numbers
.
test
(
symbol
)){
// Numbers
var
number
=
this
.
numbersFullToHalf
[
symbol
]
drawn
.
push
({
text
:
number
,
x
:
0
,
y
:
0
,
w
:
32
})
}
else
if
(
r
.
degree
.
test
(
symbol
)){
// Degree
drawn
.
push
({
text
:
symbol
,
x
:
5
,
y
:
0
,
w
:
0
})
}
else
if
(
r
.
uppercase
Digit
.
test
(
symbol
)){
// Latin script uppercase
, digits
}
else
if
(
r
.
uppercase
.
test
(
symbol
)){
// Latin script uppercase
drawn
.
push
({
text
:
symbol
,
x
:
0
,
y
:
0
,
w
:
32
})
}
else
if
(
r
.
exclamation
.
test
(
symbol
)){
// Exclamation mark
...
...
@@ -598,7 +604,7 @@
if
(
config
.
letterSpacing
){
symbol
.
w
+=
config
.
letterSpacing
}
drawnWidth
+=
symbol
.
w
drawnWidth
+=
symbol
.
w
*
mul
}
ctx
.
translate
(
config
.
x
,
config
.
y
)
...
...
@@ -651,7 +657,7 @@
var
offsetX
=
0
for
(
let
symbol
of
drawn
){
var
saved
=
false
var
currentX
=
offsetX
+
symbol
.
x
+
(
layer
.
x
||
0
)
+
symbol
.
w
/
2
var
currentX
=
offsetX
+
symbol
.
x
*
mul
+
(
layer
.
x
||
0
)
+
symbol
.
w
*
mul
/
2
var
currentY
=
symbol
.
y
+
(
layer
.
y
||
0
)
var
isLatin
=
r
.
latin
.
test
(
symbol
.
text
)
...
...
@@ -1104,7 +1110,7 @@
text
:
"
クリア
"
,
fontSize
:
18
,
fontFamily
:
config
.
font
,
x
:
gaugeClear
-
6
,
x
:
gaugeClear
+
3
,
y
:
config
.
multiplayer
?
22
:
11
,
letterSpacing
:
-
2
},
[
...
...
public/src/js/view.js
View file @
3c701dc2
...
...
@@ -16,6 +16,40 @@
"
はじめからやりなおす
"
,
"
「曲をえらぶ」にもどる
"
]
this
.
categories
=
{
"
J-POP
"
:
{
sort
:
0
,
infoFill
:
"
#004d68
"
},
"
アニメ
"
:
{
sort
:
1
,
infoFill
:
"
#9c4002
"
},
"
ボーカロイド™曲
"
:
{
sort
:
2
,
infoFill
:
"
#546184
"
},
"
バラエティ
"
:
{
sort
:
3
,
infoFill
:
"
#3c6800
"
},
"
クラシック
"
:
{
sort
:
4
,
infoFill
:
"
#865800
"
},
"
ゲームミュージック
"
:
{
sort
:
5
,
infoFill
:
"
#4f2886
"
},
"
ナムコオリジナル
"
:
{
sort
:
6
,
infoFill
:
"
#961e00
"
},
"
default
"
:
{
sort
:
7
,
infoFill
:
"
#656565
"
}
}
this
.
currentScore
=
{
ms
:
-
Infinity
,
...
...
@@ -128,7 +162,7 @@
this
.
canvas
.
style
.
width
=
(
winW
/
this
.
pixelRatio
)
+
"
px
"
this
.
canvas
.
style
.
height
=
(
winH
/
this
.
pixelRatio
)
+
"
px
"
this
.
titleCache
.
resize
(
640
,
8
0
,
ratio
)
this
.
titleCache
.
resize
(
640
,
9
0
,
ratio
)
}
if
(
!
this
.
multiplayer
){
this
.
pauseCache
.
resize
(
81
*
this
.
pauseOptions
.
length
*
2
,
464
,
ratio
)
...
...
@@ -179,12 +213,14 @@
x
:
winW
-
(
touchMultiplayer
&&
fullScreenSupported
?
750
:
650
),
y
:
touchMultiplayer
?
75
:
10
,
w
:
640
,
h
:
8
0
,
h
:
9
0
,
id
:
"
title
"
},
ctx
=>
{
var
selectedSong
=
this
.
controller
.
selectedSong
this
.
draw
.
layeredText
({
ctx
:
ctx
,
text
:
this
.
controller
.
selectedSong
.
title
,
text
:
selectedSong
.
title
,
fontSize
:
40
,
fontFamily
:
this
.
font
,
x
:
620
,
...
...
@@ -195,6 +231,38 @@
{
outline
:
"
#000
"
,
letterBorder
:
10
},
{
fill
:
"
#fff
"
}
])
if
(
selectedSong
.
category
){
var
_w
=
142
var
_h
=
22
var
_x
=
628
-
_w
var
_y
=
88
-
_h
if
(
selectedSong
.
category
in
this
.
categories
){
ctx
.
fillStyle
=
this
.
categories
[
selectedSong
.
category
].
infoFill
}
else
{
ctx
.
fillStyle
=
this
.
categories
.
default
.
infoFill
}
this
.
draw
.
roundedRect
({
ctx
:
ctx
,
x
:
_x
,
y
:
_y
,
w
:
_w
,
h
:
_h
,
radius
:
11
})
ctx
.
fill
()
this
.
draw
.
layeredText
({
ctx
:
ctx
,
text
:
selectedSong
.
category
,
fontSize
:
15
,
fontFamily
:
this
.
font
,
align
:
"
center
"
,
x
:
_x
+
_w
/
2
,
y
:
_y
+
3
,
width
:
122
},
[
{
fill
:
"
#fff
"
}
])
}
})
}
...
...
@@ -885,23 +953,16 @@
setBackground
(){
var
gameDiv
=
document
.
getElementById
(
"
game
"
)
var
selectedSong
=
this
.
controller
.
selectedSong
var
bg
=
gameConfig
.
songs_baseurl
+
selectedSong
.
folder
+
"
/bg.png
"
if
(
selectedSong
.
defaultBg
){
var
categories
=
{
"
J-POP
"
:
0
,
"
アニメ
"
:
1
,
"
ボーカロイド™曲
"
:
2
,
"
バラエティ
"
:
3
,
"
クラシック
"
:
4
,
"
ゲームミュージック
"
:
5
,
"
ナムコオリジナル
"
:
6
}
var
catId
=
7
if
(
selectedSong
.
category
in
categories
){
catId
=
categories
[
selectedSong
.
category
]
}
bg
=
assets
.
image
[
"
bg_genre_
"
+
catId
].
src
if
(
selectedSong
.
category
in
this
.
categories
){
var
catId
=
this
.
categories
[
selectedSong
.
category
].
sort
}
else
{
var
catId
=
this
.
categories
.
default
.
sort
}
var
bg
=
assets
.
image
[
"
bg_genre_
"
+
catId
].
src
gameDiv
.
classList
.
add
(
"
default-bg
"
)
}
else
{
var
bg
=
gameConfig
.
songs_baseurl
+
selectedSong
.
folder
+
"
/bg.png
"
}
gameDiv
.
style
.
backgroundImage
=
"
url('
"
+
bg
+
"
')
"
}
...
...
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