Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM4-11
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
YM4-11
Commits
49f5d470
Commit
49f5d470
authored
Jan 10, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix
parent
63d5d00f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
14 deletions
+38
-14
play.component.ts
src/app/play/play.component.ts
+38
-14
No files found.
src/app/play/play.component.ts
View file @
49f5d470
...
@@ -529,6 +529,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -529,6 +529,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
initWordLines
()
{
initWordLines
()
{
let
totalCount
=
this
.
g_formData
.
bgItem
.
questions
.
length
this
.
g_formData
.
bgItem
.
questions
.
forEach
((
item
,
index
)
=>
{
this
.
g_formData
.
bgItem
.
questions
.
forEach
((
item
,
index
)
=>
{
let
textAll
=
[]
let
textAll
=
[]
item
.
combin
.
forEach
(
combinIndex
=>
{
item
.
combin
.
forEach
(
combinIndex
=>
{
...
@@ -555,19 +556,36 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -555,19 +556,36 @@ export class PlayComponent implements OnInit, OnDestroy {
sy
:
46
*
this
.
g_mapScale
/
h
sy
:
46
*
this
.
g_mapScale
/
h
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
let
y
=
0
;
if
(
totalCount
<=
6
)
{
if
(
index
>
3
)
{
let
y
=
0
;
y
=
this
.
g_cartoon
.
getOrigin
().
y
+
(
509
+
46
/
2
)
*
this
.
g_mapScale
if
(
index
>
2
)
{
y
=
this
.
g_cartoon
.
getOrigin
().
y
+
(
509
+
46
/
2
)
*
this
.
g_mapScale
}
else
{
y
=
this
.
g_cartoon
.
getOrigin
().
y
+
(
383
+
46
/
2
)
*
this
.
g_mapScale
}
let
xIndex
=
index
%
3
return
{
x
:
170
*
this
.
g_mapScale
+
this
.
g_cartoon
.
getOrigin
().
x
+
(
58
+
250
/
2
)
*
this
.
g_mapScale
+
295
*
this
.
g_mapScale
*
xIndex
,
y
:
y
}
}
else
{
}
else
{
y
=
this
.
g_cartoon
.
getOrigin
().
y
+
(
383
+
46
/
2
)
*
this
.
g_mapScale
let
y
=
0
;
}
if
(
index
>
3
)
{
y
=
this
.
g_cartoon
.
getOrigin
().
y
+
(
509
+
46
/
2
)
*
this
.
g_mapScale
let
xIndex
=
index
%
4
}
else
{
return
{
y
=
this
.
g_cartoon
.
getOrigin
().
y
+
(
383
+
46
/
2
)
*
this
.
g_mapScale
x
:
this
.
g_cartoon
.
getOrigin
().
x
+
(
58
+
250
/
2
)
*
this
.
g_mapScale
+
295
*
this
.
g_mapScale
*
xIndex
,
}
y
:
y
let
xIndex
=
index
%
4
return
{
x
:
this
.
g_cartoon
.
getOrigin
().
x
+
(
58
+
250
/
2
)
*
this
.
g_mapScale
+
295
*
this
.
g_mapScale
*
xIndex
,
y
:
y
}
}
}
})
})
element
.
questionIndex
=
index
;
element
.
questionIndex
=
index
;
element
.
done
=
false
;
element
.
done
=
false
;
element
.
audio_url
=
item
.
audio_url
?
item
.
audio_url
:
""
element
.
audio_url
=
item
.
audio_url
?
item
.
audio_url
:
""
...
@@ -612,6 +630,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -612,6 +630,7 @@ export class PlayComponent implements OnInit, OnDestroy {
textShow
.
isShown
=
false
;
textShow
.
isShown
=
false
;
textShow
.
ref
.
alpha
=
0
;
textShow
.
ref
.
alpha
=
0
;
textShow
.
ref
.
x
=
startX
+
textShow
.
ref
.
width
/
2
textShow
.
ref
.
x
=
startX
+
textShow
.
ref
.
width
/
2
textShow
.
ref
.
y
=
-
10
startX
+=
textShow
.
ref
.
width
startX
+=
textShow
.
ref
.
width
totalWidth
+=
textShow
.
ref
.
width
totalWidth
+=
textShow
.
ref
.
width
element
.
ref
.
addChild
(
textShow
.
ref
)
element
.
ref
.
addChild
(
textShow
.
ref
)
...
@@ -647,21 +666,26 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -647,21 +666,26 @@ export class PlayComponent implements OnInit, OnDestroy {
return
;
return
;
}
}
let
right
=
false
;
for
(
let
index
=
0
;
index
<
answerIndex
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
answerIndex
.
length
;
index
++
)
{
if
(
dragElement
.
hotZooIndex
==
answerIndex
[
index
])
{
if
(
dragElement
.
hotZooIndex
==
answerIndex
[
index
])
{
let
textShow
=
this
.
g_cartoon
.
getCartoonElement
(
`word-part-
${
this
.
m_currentQuestionIndex
}
-
${
dragElement
.
hotZooIndex
}
-
${
index
}
`
)
let
textShow
=
this
.
g_cartoon
.
getCartoonElement
(
`word-part-
${
this
.
m_currentQuestionIndex
}
-
${
dragElement
.
hotZooIndex
}
-
${
index
}
`
)
if
(
!
textShow
.
isShown
)
{
if
(
!
textShow
.
isShown
)
{
textShow
.
isShown
=
true
;
textShow
.
isShown
=
true
;
textShow
.
ref
.
alpha
=
1
;
textShow
.
ref
.
alpha
=
1
;
this
.
g_cartoon
.
playAudio
(
"
sm-choice-correct
"
)
right
=
true
;
break
;
break
;
}
}
}
else
{
this
.
g_cartoon
.
stopAllAudio
()
this
.
g_cartoon
.
playAudio
(
"
cuowu
"
)
}
}
}
}
this
.
g_cartoon
.
stopAllAudio
();
if
(
right
)
{
this
.
g_cartoon
.
playAudio
(
"
sm-choice-correct
"
);
}
else
{
this
.
g_cartoon
.
playAudio
(
"
cuowu
"
);
}
if
(
this
.
checkQuestionDone
())
{
if
(
this
.
checkQuestionDone
())
{
this
.
m_currentQuestionIndex
++
this
.
m_currentQuestionIndex
++
element
.
done
=
true
;
element
.
done
=
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