Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
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
劳工
zeroing-libs
Commits
ca381601
Commit
ca381601
authored
Aug 12, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整storage兼容
parent
83a2ee94
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
22 deletions
+44
-22
recycling.json
dist/customs/recycling.json
+1
-1
main.js
src/custom/recycling/debug/main.js
+21
-6
main.js.map
src/custom/recycling/debug/main.js.map
+1
-1
GameView.ts
src/custom/recycling/src/game/GameView.ts
+4
-7
getGuideInfo.ts
src/custom/recycling/src/game/utils/getGuideInfo.ts
+17
-7
No files found.
dist/customs/recycling.json
View file @
ca381601
This diff is collapsed.
Click to expand it.
src/custom/recycling/debug/main.js
View file @
ca381601
...
...
@@ -598,14 +598,28 @@
//# sourceMappingURL=uiConfig.js.map
var
getGuideInfo
=
(
function
()
{
if
(
!
window
.
localStorage
)
{
try
{
if
(
window
.
localStorage
&&
window
.
localStorage
.
getItem
)
{
return
localStorage
.
getItem
(
'recyclingGuide'
);
}
else
{
return
0
;
}
}
catch
(
e
)
{
console
.
log
(
"getguideinfo--error"
,
e
);
return
0
;
}
return
localStorage
.
getItem
(
'recyclingGuide'
);
});
var
setGuide
=
function
()
{
if
(
window
.
localStorage
)
try
{
if
(
window
.
localStorage
&&
window
.
localStorage
.
setItem
)
{
localStorage
.
setItem
(
'recyclingGuide'
,
'1'
);
}
}
catch
(
e
)
{
console
.
log
(
"setguide--err"
,
e
);
}
};
//# sourceMappingURL=getGuideInfo.js.map
...
...
@@ -838,6 +852,7 @@
function
GameView
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
_timeCounter
=
0
;
_this
.
guidenew
=
false
;
_this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
_this
.
setup
,
_this
);
return
_this
;
}
...
...
@@ -927,13 +942,13 @@
return
tslib
.
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
console
.
log
(
'on start'
);
this
.
_timeCounter
=
0
;
if
(
!
!
getGuideInfo
(
))
return
[
3
,
2
];
if
(
!
(
!
getGuideInfo
()
&&
!
this
.
guidenew
))
return
[
3
,
2
];
return
[
4
,
this
.
guide
.
startGuide
()];
case
1
:
_a
.
sent
();
setGuide
();
this
.
guidenew
=
true
;
_a
.
label
=
2
;
case
2
:
this
.
conveyors
.
clear
();
...
...
src/custom/recycling/debug/main.js.map
View file @
ca381601
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/custom/recycling/src/game/GameView.ts
View file @
ca381601
...
...
@@ -124,22 +124,19 @@ export default class GameView extends engine.Container {
engine
.
Tween
.
removeTweens
(
i
);
})
}
guidenew
:
boolean
=
false
;
async
start
()
{
console
.
log
(
'on start'
)
// console.log('on start',getGuideInfo());
this
.
_timeCounter
=
0
;
if
(
!
getGuideInfo
())
{
if
(
!
getGuideInfo
()
&&!
this
.
guidenew
)
{
await
this
.
guide
.
startGuide
();
setGuide
();
this
.
guidenew
=
true
;
}
this
.
conveyors
.
clear
()
await
this
.
countdown
.
startCountDown
();
this
.
startGame
();
engine
.
globalEvent
.
dispatchEvent
(
'recycling-time-update'
,
{
second
:
this
.
getSecond
(),
});
...
...
src/custom/recycling/src/game/utils/getGuideInfo.ts
View file @
ca381601
export
default
()
=>
{
//0 未引导
if
(
!
window
.
localStorage
)
{
try
{
if
(
window
.
localStorage
&&
window
.
localStorage
.
getItem
){
return
localStorage
.
getItem
(
'recyclingGuide'
)
}
else
{
return
0
}
return
localStorage
.
getItem
(
'recyclingGuide'
)
}
catch
(
e
){
console
.
log
(
"getguideinfo--error"
,
e
);
return
0
;
}
}
export
const
setGuide
=
()
=>
{
if
(
window
.
localStorage
)
localStorage
.
setItem
(
'recyclingGuide'
,
'1'
)
try
{
if
(
window
.
localStorage
&&
window
.
localStorage
.
setItem
){
localStorage
.
setItem
(
'recyclingGuide'
,
'1'
);
}
}
catch
(
e
){
console
.
log
(
"setguide--err"
,
e
);
}
}
\ No newline at end of file
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