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
6e61e24d
Commit
6e61e24d
authored
Dec 02, 2018
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongSel: Fix title cache
parent
a5b60508
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
13 deletions
+45
-13
public/src/js/canvascache.js
public/src/js/canvascache.js
+8
-0
public/src/js/songselect.js
public/src/js/songselect.js
+37
-13
No files found.
public/src/js/canvascache.js
View file @
6e61e24d
...
@@ -72,6 +72,14 @@ class CanvasCache{
...
@@ -72,6 +72,14 @@ class CanvasCache{
set
(
config
,
callback
){
set
(
config
,
callback
){
return
this
.
get
(
config
,
callback
,
true
)
return
this
.
get
(
config
,
callback
,
true
)
}
}
clear
(){
this
.
x
=
0
this
.
y
=
0
this
.
lastW
=
0
this
.
lastH
=
0
this
.
map
.
clear
()
this
.
ctx
.
clearRect
(
0
,
0
,
this
.
canvas
.
width
*
this
.
scale
,
this
.
canvas
.
height
*
this
.
scale
)
}
clean
(){
clean
(){
delete
this
.
map
delete
this
.
map
delete
this
.
ctx
delete
this
.
ctx
...
...
public/src/js/songselect.js
View file @
6e61e24d
...
@@ -179,6 +179,7 @@ class SongSelect{
...
@@ -179,6 +179,7 @@ class SongSelect{
this
.
categoryCache
=
new
CanvasCache
()
this
.
categoryCache
=
new
CanvasCache
()
this
.
difficultyCache
=
new
CanvasCache
()
this
.
difficultyCache
=
new
CanvasCache
()
this
.
sessionCache
=
new
CanvasCache
()
this
.
sessionCache
=
new
CanvasCache
()
this
.
currentSongCache
=
new
CanvasCache
()
this
.
difficulty
=
[
"
かんたん
"
,
"
ふつう
"
,
"
むずかしい
"
,
"
おに
"
]
this
.
difficulty
=
[
"
かんたん
"
,
"
ふつう
"
,
"
むずかしい
"
,
"
おに
"
]
this
.
difficultyId
=
[
"
easy
"
,
"
normal
"
,
"
hard
"
,
"
oni
"
,
"
ura
"
]
this
.
difficultyId
=
[
"
easy
"
,
"
normal
"
,
"
hard
"
,
"
oni
"
,
"
ura
"
]
...
@@ -721,9 +722,15 @@ class SongSelect{
...
@@ -721,9 +722,15 @@ class SongSelect{
var
borders
=
(
this
.
songAsset
.
border
+
this
.
songAsset
.
innerBorder
)
*
2
var
borders
=
(
this
.
songAsset
.
border
+
this
.
songAsset
.
innerBorder
)
*
2
this
.
songTitleCache
.
resize
(
this
.
songTitleCache
.
resize
(
(
this
.
songAsset
.
width
-
borders
+
1
)
*
this
.
songs
.
length
,
(
this
.
songAsset
.
width
-
borders
+
1
)
*
Math
.
ceil
(
this
.
songs
.
length
/
3
)
,
(
this
.
songAsset
.
height
-
borders
+
1
)
*
3
,
(
this
.
songAsset
.
height
-
borders
+
1
)
*
3
,
ratio
+
0.5
ratio
+
0.2
)
this
.
currentSongCache
.
resize
(
(
this
.
songAsset
.
width
-
borders
+
1
)
*
2
,
this
.
songAsset
.
height
-
borders
+
1
,
ratio
+
0.2
)
)
this
.
selectTextCache
.
resize
((
280
+
53
+
60
+
1
)
*
2
,
this
.
songAsset
.
marginTop
+
15
,
ratio
+
0.5
)
this
.
selectTextCache
.
resize
((
280
+
53
+
60
+
1
)
*
2
,
this
.
songAsset
.
marginTop
+
15
,
ratio
+
0.5
)
...
@@ -1016,6 +1023,11 @@ class SongSelect{
...
@@ -1016,6 +1023,11 @@ class SongSelect{
highlight
=
0
highlight
=
0
}
}
if
(
this
.
currentSongTitle
!==
currentSong
.
title
){
this
.
currentSongTitle
=
currentSong
.
title
this
.
currentSongCache
.
clear
()
}
this
.
draw
.
songFrame
({
this
.
draw
.
songFrame
({
ctx
:
ctx
,
ctx
:
ctx
,
x
:
winW
/
2
-
selectedWidth
/
2
+
xOffset
,
x
:
winW
/
2
-
selectedWidth
/
2
+
xOffset
,
...
@@ -1312,13 +1324,13 @@ class SongSelect{
...
@@ -1312,13 +1324,13 @@ class SongSelect{
var
textY
=
opened
*
12
+
(
1
-
opened
)
*
7
var
textY
=
opened
*
12
+
(
1
-
opened
)
*
7
if
(
currentSong
.
subtitle
){
if
(
currentSong
.
subtitle
){
this
.
songTitle
Cache
.
get
({
this
.
currentSong
Cache
.
get
({
ctx
:
ctx
,
ctx
:
ctx
,
x
:
x
+
textX
-
textW
,
x
:
x
+
textX
-
textW
,
y
:
y
+
textY
,
y
:
y
+
textY
,
w
:
textW
,
w
:
textW
,
h
:
textH
,
h
:
textH
,
id
:
currentSong
.
subtitle
,
id
:
"
subtitle
"
,
},
ctx
=>
{
},
ctx
=>
{
this
.
draw
.
verticalText
({
this
.
draw
.
verticalText
({
ctx
:
ctx
,
ctx
:
ctx
,
...
@@ -1353,14 +1365,7 @@ class SongSelect{
...
@@ -1353,14 +1365,7 @@ class SongSelect{
ctx
.
fillStyle
=
selectedSkin
.
background
ctx
.
fillStyle
=
selectedSkin
.
background
ctx
.
fillRect
(
x
,
y
,
w
,
h
)
ctx
.
fillRect
(
x
,
y
,
w
,
h
)
ctx
.
globalAlpha
=
1
ctx
.
globalAlpha
=
1
this
.
songTitleCache
.
get
({
var
verticalTitle
=
ctx
=>
{
ctx
:
ctx
,
x
:
x
+
textX
,
y
:
y
+
textY
-
7
,
w
:
textW
,
h
:
textH
,
id
:
currentSong
.
title
+
selectedSkin
.
outline
,
},
ctx
=>
{
this
.
draw
.
verticalText
({
this
.
draw
.
verticalText
({
ctx
:
ctx
,
ctx
:
ctx
,
text
:
currentSong
.
title
,
text
:
currentSong
.
title
,
...
@@ -1374,7 +1379,26 @@ class SongSelect{
...
@@ -1374,7 +1379,26 @@ class SongSelect{
fontSize
:
40
,
fontSize
:
40
,
fontFamily
:
this
.
font
fontFamily
:
this
.
font
})
})
})
}
if
(
selectedSkin
.
outline
===
"
#000
"
){
this
.
currentSongCache
.
get
({
ctx
:
ctx
,
x
:
x
+
textX
,
y
:
y
+
textY
-
7
,
w
:
textW
,
h
:
textH
,
id
:
"
title
"
,
},
verticalTitle
)
}
else
{
this
.
songTitleCache
.
get
({
ctx
:
ctx
,
x
:
x
+
textX
,
y
:
y
+
textY
-
7
,
w
:
textW
,
h
:
textH
,
id
:
currentSong
.
title
+
selectedSkin
.
outline
,
},
verticalTitle
)
}
if
(
!
songSel
&&
this
.
selectableText
!==
currentSong
.
title
){
if
(
!
songSel
&&
this
.
selectableText
!==
currentSong
.
title
){
this
.
draw
.
verticalText
({
this
.
draw
.
verticalText
({
ctx
:
ctx
,
ctx
:
ctx
,
...
...
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