Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wildfirecode13
xiaoxiaole
Commits
5b1737e8
Commit
5b1737e8
authored
Sep 05, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
61085011
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+3
-1
soundCtrl.ts
egret/src/soundCtrl.ts
+18
-1
No files found.
egret/src/mapScene/MapScene.ts
View file @
5b1737e8
...
...
@@ -126,7 +126,9 @@ export default class MapScene extends Scene {
this
.
stage
.
once
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
!
MapScene
[
'firstPlayBgTag'
])
{
playBg
();
if
(
getBgOn
())
{
playBg
();
}
MapScene
[
'firstPlayBgTag'
]
=
true
;
}
},
this
);
...
...
egret/src/soundCtrl.ts
View file @
5b1737e8
let
soundOn
=
true
;
if
(
localStorage
.
getItem
(
'soundOn'
)
==
null
)
{
soundOn
=
true
;
localStorage
.
setItem
(
'soundOn'
,
"1"
);
}
else
soundOn
=
localStorage
.
getItem
(
'soundOn'
)
==
'1'
;
let
bgOn
=
true
;
if
(
localStorage
.
getItem
(
'bgOn'
)
==
null
)
{
bgOn
=
true
;
localStorage
.
setItem
(
'bgOn'
,
"1"
);
}
else
bgOn
=
localStorage
.
getItem
(
'bgOn'
)
==
'1'
;
let
bgChannel
:
egret
.
SoundChannel
;
let
loading
=
false
;
export
const
getSoundOn
=
()
=>
{
...
...
@@ -11,14 +25,17 @@ export const getBgOn = () => {
export
const
toggleSound
=
()
=>
{
soundOn
=
!
soundOn
;
localStorage
.
setItem
(
'soundOn'
,
soundOn
?
"1"
:
"0"
)
}
export
const
toggleBgStatus
=
()
=>
{
export
const
toggleBgStatus
=
()
=>
{
bgOn
=
!
bgOn
;
localStorage
.
setItem
(
'bgOn'
,
bgOn
?
"1"
:
"0"
)
}
export
const
toggleBg
=
()
=>
{
bgOn
=
!
bgOn
;
localStorage
.
setItem
(
'bgOn'
,
bgOn
?
"1"
:
"0"
)
if
(
bgChannel
)
{
if
(
!
bgOn
)
{
bgChannel
.
stop
();
...
...
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