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
f72c09f4
Commit
f72c09f4
authored
Sep 26, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scoresheet keys, songsel background, auto/p2 for gamepad
parent
71e180c7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
16 deletions
+79
-16
public/src/css/game.css
public/src/css/game.css
+2
-3
public/src/css/main.css
public/src/css/main.css
+16
-0
public/src/css/scoresheet.css
public/src/css/scoresheet.css
+2
-1
public/src/js/scoresheet.js
public/src/js/scoresheet.js
+32
-1
public/src/js/songselect.js
public/src/js/songselect.js
+26
-10
public/src/views/scoresheet.html
public/src/views/scoresheet.html
+1
-1
No files found.
public/src/css/game.css
View file @
f72c09f4
...
@@ -32,13 +32,12 @@
...
@@ -32,13 +32,12 @@
font-family
:
TnT
;
font-family
:
TnT
;
font-size
:
3.5vmin
;
font-size
:
3.5vmin
;
border-radius
:
1.5vmin
;
border-radius
:
1.5vmin
;
outline
:
none
;
}
}
#pause-menu
button
:hover
,
#pause-menu
button
:hover
,
#pause-menu
button
.selected
{
#pause-menu
.window
:not
(
:hover
)
button
.selected
{
color
:
white
;
color
:
white
;
background
:
#0c6577
;
background
:
#0c6577
;
}
#pause-menu
button
:hover
{
border-color
:
#fa5d3a
;
border-color
:
#fa5d3a
;
}
}
#cursor
{
#cursor
{
...
...
public/src/css/main.css
View file @
f72c09f4
...
@@ -188,6 +188,22 @@ kbd{
...
@@ -188,6 +188,22 @@ kbd{
#tutorial-end-button
{
#tutorial-end-button
{
font-size
:
22pt
;
font-size
:
22pt
;
}
}
@keyframes
bgscroll
{
from
{
background-position
:
0
0
;
}
to
{
background-position
:
-30vmin
0
;
}
}
#song-select
{
width
:
100%
;
height
:
100%
;
background
:
url("/assets/img/bg-pattern-1.png")
;
background-size
:
30vmin
;
animation
:
bgscroll
8s
infinite
linear
;
white-space
:
nowrap
;
}
#song-sel-canvas
{
#song-sel-canvas
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
...
...
public/src/css/scoresheet.css
View file @
f72c09f4
...
@@ -46,7 +46,8 @@
...
@@ -46,7 +46,8 @@
left
:
23%
;
left
:
23%
;
}
}
.scoresheet
button
:hover
{
.scoresheet
button
:hover
,
.scoresheet
.bottom-part
:not
(
:hover
)
button
.selected
{
border-color
:
#fa5d3a
;
border-color
:
#fa5d3a
;
color
:
white
;
color
:
white
;
background
:
#0c6577
;
background
:
#0c6577
;
...
...
public/src/js/scoresheet.js
View file @
f72c09f4
...
@@ -81,7 +81,9 @@ class Scoresheet{
...
@@ -81,7 +81,9 @@ class Scoresheet{
this
.
setResults
(
this
.
score
,
scoreCont
)
this
.
setResults
(
this
.
score
,
scoreCont
)
this
.
altText
(
this
.
elem
(
"
result-song
"
,
this
.
scoresheet
),
this
.
score
.
song
)
this
.
altText
(
this
.
elem
(
"
result-song
"
,
this
.
scoresheet
),
this
.
score
.
song
)
pageEvents
.
once
(
this
.
elem
(
"
song-select
"
,
this
.
scoresheet
),
"
click
"
).
then
(()
=>
{
this
.
songSelect
=
this
.
elem
(
"
song-select
"
,
this
.
scoresheet
)
this
.
replay
=
this
.
elem
(
"
replay
"
,
this
.
scoresheet
)
pageEvents
.
once
(
this
.
songSelect
,
"
click
"
).
then
(()
=>
{
this
.
clean
()
this
.
clean
()
assets
.
sounds
[
"
don
"
].
play
()
assets
.
sounds
[
"
don
"
].
play
()
this
.
controller
.
songSelection
()
this
.
controller
.
songSelection
()
...
@@ -91,6 +93,16 @@ class Scoresheet{
...
@@ -91,6 +93,16 @@ class Scoresheet{
assets
.
sounds
[
"
don
"
].
play
()
assets
.
sounds
[
"
don
"
].
play
()
this
.
controller
.
restartSong
()
this
.
controller
.
restartSong
()
})
})
pageEvents
.
keyAdd
(
this
,
"
all
"
,
"
down
"
,
this
.
keyDown
.
bind
(
this
))
this
.
gamepad
=
new
Gamepad
({
"
13
"
:
[
"
b
"
,
"
start
"
],
"
37
"
:
[
"
l
"
,
"
r
"
,
"
lb
"
,
"
lt
"
,
"
rb
"
,
"
rt
"
]
},
(
pressed
,
key
)
=>
{
if
(
pressed
){
this
.
keyDown
(
false
,
key
)
}
})
if
(
this
.
multiplayer
&&
p2
.
results
){
if
(
this
.
multiplayer
&&
p2
.
results
){
var
scoreCont2
=
document
.
createElement
(
"
div
"
)
var
scoreCont2
=
document
.
createElement
(
"
div
"
)
scoreCont2
.
classList
.
add
(
"
score-cont
"
)
scoreCont2
.
classList
.
add
(
"
score-cont
"
)
...
@@ -99,8 +111,27 @@ class Scoresheet{
...
@@ -99,8 +111,27 @@ class Scoresheet{
this
.
setResults
(
p2
.
results
,
scoreCont2
)
this
.
setResults
(
p2
.
results
,
scoreCont2
)
}
}
}
}
keyDown
(
event
,
code
){
if
(
!
code
){
code
=
event
.
keyCode
}
var
selected
=
this
.
elem
(
"
selected
"
,
this
.
scoresheet
)
if
(
code
==
13
){
// Enter
selected
.
click
()
}
else
if
(
code
==
37
||
code
==
39
){
// Left, Right
selected
.
classList
.
remove
(
"
selected
"
)
var
next
=
selected
.
nextElementSibling
if
(
!
next
){
next
=
selected
.
previousElementSibling
}
next
.
classList
.
add
(
"
selected
"
)
}
}
clean
(){
clean
(){
assets
.
sounds
[
"
bgm_result
"
].
stop
()
assets
.
sounds
[
"
bgm_result
"
].
stop
()
pageEvents
.
keyRemove
(
this
,
"
all
"
)
pageEvents
.
remove
(
window
,
"
resize
"
)
pageEvents
.
remove
(
window
,
"
resize
"
)
}
}
}
}
public/src/js/songselect.js
View file @
f72c09f4
...
@@ -211,7 +211,9 @@ class SongSelect{
...
@@ -211,7 +211,9 @@ class SongSelect{
"
13
"
:
[
"
b
"
,
"
start
"
],
"
13
"
:
[
"
b
"
,
"
start
"
],
"
8
"
:
[
"
a
"
],
"
8
"
:
[
"
a
"
],
"
37
"
:
[
"
l
"
,
"
lb
"
,
"
lt
"
],
"
37
"
:
[
"
l
"
,
"
lb
"
,
"
lt
"
],
"
39
"
:
[
"
r
"
,
"
rb
"
,
"
rt
"
]
"
39
"
:
[
"
r
"
,
"
rb
"
,
"
rt
"
],
"
ctrl
"
:
[
"
y
"
],
"
shift
"
:
[
"
x
"
]
})
})
this
.
startP2
()
this
.
startP2
()
...
@@ -224,8 +226,20 @@ class SongSelect{
...
@@ -224,8 +226,20 @@ class SongSelect{
}
}
keyDown
(
event
,
code
){
keyDown
(
event
,
code
){
if
(
!
code
){
if
(
code
){
var
modifiers
=
{
shift
:
this
.
pressedKeys
[
"
shift
"
],
ctrl
:
this
.
pressedKeys
[
"
ctrl
"
]
}
}
else
{
code
=
event
.
keyCode
code
=
event
.
keyCode
var
modifiers
=
{
shift
:
event
.
shiftKey
,
ctrl
:
event
.
ctrlKey
}
}
if
(
code
===
"
ctrl
"
&&
code
===
"
shift
"
){
return
}
}
var
key
=
{
var
key
=
{
confirm
:
code
==
13
||
code
==
32
||
code
==
86
||
code
==
66
,
confirm
:
code
==
13
||
code
==
32
||
code
==
86
||
code
==
66
,
...
@@ -255,7 +269,7 @@ class SongSelect{
...
@@ -255,7 +269,7 @@ class SongSelect{
if
(
this
.
selectedDiff
===
0
){
if
(
this
.
selectedDiff
===
0
){
this
.
toSongSelect
()
this
.
toSongSelect
()
}
else
{
}
else
{
this
.
toLoadSong
(
this
.
selectedDiff
-
1
,
event
.
shiftKey
,
event
.
ctrlKey
)
this
.
toLoadSong
(
this
.
selectedDiff
-
1
,
modifiers
.
shift
,
modifiers
.
ctrl
)
}
}
}
else
if
(
key
.
cancel
){
}
else
if
(
key
.
cancel
){
this
.
toSongSelect
()
this
.
toSongSelect
()
...
@@ -431,7 +445,7 @@ class SongSelect{
...
@@ -431,7 +445,7 @@ class SongSelect{
assets
.
sounds
[
"
don
"
].
play
()
assets
.
sounds
[
"
don
"
].
play
()
localStorage
[
"
selectedSong
"
]
=
this
.
selectedSong
localStorage
[
"
selectedSong
"
]
=
this
.
selectedSong
localStorage
[
"
selectedDiff
"
]
=
this
.
selectedDiff
localStorage
[
"
selectedDiff
"
]
=
difficulty
+
1
new
loadSong
({
new
loadSong
({
"
title
"
:
selectedSong
.
title
,
"
title
"
:
selectedSong
.
title
,
...
@@ -473,7 +487,7 @@ class SongSelect{
...
@@ -473,7 +487,7 @@ class SongSelect{
})
})
for
(
var
key
in
this
.
pressedKeys
){
for
(
var
key
in
this
.
pressedKeys
){
if
(
this
.
pressedKeys
[
key
]){
if
(
this
.
pressedKeys
[
key
]){
if
(
ms
>=
this
.
pressedKeys
[
key
]
+
10
0
){
if
(
ms
>=
this
.
pressedKeys
[
key
]
+
5
0
){
this
.
keyDown
(
false
,
key
)
this
.
keyDown
(
false
,
key
)
this
.
pressedKeys
[
key
]
=
ms
this
.
pressedKeys
[
key
]
=
ms
}
}
...
@@ -619,7 +633,7 @@ class SongSelect{
...
@@ -619,7 +633,7 @@ class SongSelect{
}
}
if
(
songSelMoving
){
if
(
songSelMoving
){
if
(
this
.
previewing
){
if
(
this
.
previewing
!==
null
){
this
.
endPreview
()
this
.
endPreview
()
}
}
}
else
if
(
screen
!==
"
title
"
){
}
else
if
(
screen
!==
"
title
"
){
...
@@ -770,12 +784,14 @@ class SongSelect{
...
@@ -770,12 +784,14 @@ class SongSelect{
opacity
:
highlight
===
2
?
0.8
:
1
,
opacity
:
highlight
===
2
?
0.8
:
1
,
radius
:
24
radius
:
24
})
})
if
(
this
.
selectedDiff
===
0
){
this
.
drawDiffCursor
({
this
.
drawDiffCursor
({
x
:
_x
,
x
:
_x
,
y
:
_y
-
45
y
:
_y
-
45
})
})
}
}
}
}
}
for
(
var
i
=
0
;
currentSong
.
stars
&&
i
<
4
;
i
++
){
for
(
var
i
=
0
;
currentSong
.
stars
&&
i
<
4
;
i
++
){
if
(
currentSong
.
stars
[
i
]){
if
(
currentSong
.
stars
[
i
]){
if
(
songSel
){
if
(
songSel
){
...
...
public/src/views/scoresheet.html
View file @
f72c09f4
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</div>
</div>
<div
class=
"bottom-part"
>
<div
class=
"bottom-part"
>
<div
class=
"gradient-overlay"
></div>
<div
class=
"gradient-overlay"
></div>
<button
type=
"button"
class=
"song-select"
>
Song select
</button>
<button
type=
"button"
class=
"replay"
>
Replay
</button>
<button
type=
"button"
class=
"replay"
>
Replay
</button>
<button
type=
"button"
class=
"song-select selected"
>
Song select
</button>
</div>
</div>
</div>
</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