Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DG_FAF
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
DG_FAF
Commits
3bc18849
Commit
3bc18849
authored
Mar 22, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加独立选项文字选择的划掉热区功能
修复正确判断逻辑错误的问题
parent
b0639eac
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+24
-12
defaultData_DG_FAF.ts
assets/DG_FAF/script/defaultData_DG_FAF.ts
+1
-1
No files found.
assets/DG_FAF/scene/DG_FAF.ts
View file @
3bc18849
...
...
@@ -1657,11 +1657,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
optionList
=
[];
if
(
contentData
.
useSelectOptionList
)
{
contentData
.
selectOptionList
.
forEach
((
option
,
index
)
=>
{
let
strikeOutHotZoneNode
=
null
;
if
(
option
.
selectStrikeOutHotZoneIndex
!=
null
&&
!
isNaN
(
Number
(
option
.
selectStrikeOutHotZoneIndex
))
&&
Number
(
option
.
selectStrikeOutHotZoneIndex
)
>=
0
)
{
const
strikeOutHotZoneData
=
this
.
data
.
hotZoneItemArr
[
option
.
selectStrikeOutHotZoneIndex
];
strikeOutHotZoneNode
=
this
.
newRectNode
(
strikeOutHotZoneData
,
layer_3
,
debugMode
);
const
lineNode
=
this
.
newStrikeOutNode
(
strikeOutHotZoneNode
.
width
,
strikeOutHotZoneNode
.
height
);
strikeOutHotZoneNode
.
addChild
(
lineNode
);
strikeOutHotZoneNode
.
active
=
false
;
strikeOutHotZoneNode
.
refCount
=
0
;
}
optionList
.
push
({
index
:
index
,
label
:
option
.
optionShowText
?
option
.
optionShowText
:
option
.
text
,
value
:
option
.
text
,
strikeOutNode
:
null
strikeOutNode
:
strikeOutHotZoneNode
})
});
}
...
...
@@ -1672,16 +1682,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
newDecorativeFrame
(
hotZoneItemData
,
layer_1
,
"
#FFFFFF
"
,
"
#6dbef6
"
,
debugMode
);
const
rect
=
this
.
newRectNode
(
hotZoneItemData
,
layer_3
,
debugMode
);
let
strikeOutHotZoneNode
=
null
;
if
(
option
.
selectStrikeOutHotZoneIndex
!=
null
&&
!
isNaN
(
Number
(
option
.
selectStrikeOutHotZoneIndex
))
&&
Number
(
option
.
selectStrikeOutHotZoneIndex
)
>=
0
)
{
const
strikeOutHotZoneData
=
this
.
data
.
hotZoneItemArr
[
option
.
selectStrikeOutHotZoneIndex
];
strikeOutHotZoneNode
=
this
.
newRectNode
(
strikeOutHotZoneData
,
layer_3
,
debugMode
);
const
lineNode
=
this
.
newStrikeOutNode
(
strikeOutHotZoneNode
.
width
,
strikeOutHotZoneNode
.
height
);
strikeOutHotZoneNode
.
addChild
(
lineNode
);
strikeOutHotZoneNode
.
active
=
false
;
strikeOutHotZoneNode
.
refCount
=
0
;
}
resultRects
.
push
({
detail
:
{
contentType
:
TEXT_SELECT
,
...
...
@@ -1701,6 +1701,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 如果不是独立选项数据
if
(
!
contentData
.
useSelectOptionList
)
{
let
strikeOutHotZoneNode
=
null
;
if
(
option
.
selectStrikeOutHotZoneIndex
!=
null
&&
!
isNaN
(
Number
(
option
.
selectStrikeOutHotZoneIndex
))
&&
Number
(
option
.
selectStrikeOutHotZoneIndex
)
>=
0
)
{
const
strikeOutHotZoneData
=
this
.
data
.
hotZoneItemArr
[
option
.
selectStrikeOutHotZoneIndex
];
strikeOutHotZoneNode
=
this
.
newRectNode
(
strikeOutHotZoneData
,
layer_3
,
debugMode
);
const
lineNode
=
this
.
newStrikeOutNode
(
strikeOutHotZoneNode
.
width
,
strikeOutHotZoneNode
.
height
);
strikeOutHotZoneNode
.
addChild
(
lineNode
);
strikeOutHotZoneNode
.
active
=
false
;
strikeOutHotZoneNode
.
refCount
=
0
;
}
optionList
.
push
({
index
:
index
,
label
:
option
.
optionShowText
?
option
.
optionShowText
:
option
.
text
,
...
...
@@ -1772,8 +1782,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
score
:
0
}
// 正确答案序号 - 单独列表的和正常顺序来源不同
const
correctIndex
=
contentData
.
useSelectOptionList
?
option
.
selectOptionListIndex
:
index
;
// 选择数据的索引 和 当前索引是否相等 判断是否选择正确
if
(
selectData
.
index
==
i
ndex
)
{
if
(
selectData
.
index
==
correctI
ndex
)
{
// 正确 返回分数
result
.
score
=
option
.
score
&&
!
isNaN
(
Number
(
option
.
score
))
?
Number
(
option
.
score
)
:
0
;
return
[
result
]
...
...
assets/DG_FAF/script/defaultData_DG_FAF.ts
View file @
3bc18849
This diff is collapsed.
Click to expand it.
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