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
3f7b3e32
Commit
3f7b3e32
authored
Nov 07, 2019
by
wjf
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev
parents
d3d91ccf
f14b20bc
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
248 additions
and
141 deletions
+248
-141
MapScene.ts
egret/src/mapScene/MapScene.ts
+163
-136
ActIcon.ts
egret/src/mapScene/icon/ActIcon.ts
+74
-0
HbRainIcon.ts
egret/src/mapScene/icon/HbRainIcon.ts
+1
-2
IconBase.ts
egret/src/mapScene/icon/IconBase.ts
+8
-1
ScratchIcon.ts
egret/src/mapScene/icon/ScratchIcon.ts
+1
-1
TurntableIcon.ts
egret/src/mapScene/icon/TurntableIcon.ts
+1
-1
No files found.
egret/src/mapScene/MapScene.ts
View file @
3f7b3e32
This diff is collapsed.
Click to expand it.
egret/src/mapScene/icon/ActIcon.ts
0 → 100644
View file @
3f7b3e32
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
import
IconBase
from
"./IconBase"
;
export
default
class
ActIcon
{
private
actIconsGroup
;
private
actsShowBtn
;
private
icons
=
{};
constructor
(
actsShowBtn
,
actIconGroup
)
{
this
.
actsShowBtn
=
actsShowBtn
;
this
.
actIconsGroup
=
actIconGroup
;
this
.
initUI
();
this
.
initEvents
();
}
public
addActIcon
(
name
:
string
,
actIcon
:
IconBase
)
{
this
.
icons
[
name
]
=
actIcon
;
}
public
removeActIcon
(
name
:
string
){
if
(
this
.
icons
[
name
]){
this
.
icons
[
name
].
destory
();
delete
this
.
icons
[
name
];
}
}
public
destory
()
{
for
(
let
k
in
this
.
icons
){
this
.
removeActIcon
(
this
.
icons
[
k
]);
}
this
.
removeEvents
();
}
private
initUI
()
{
this
.
actIconsGroup
.
x
=
-
999
;
}
private
updateActIcon
(){
for
(
let
k
in
this
.
icons
){
if
(
this
.
icons
[
k
].
visible
){
this
.
visible
=
true
;
return
;
}
}
this
.
visible
=
false
;
}
public
set
visible
(
visible
:
boolean
){
this
.
actsShowBtn
.
visible
=
visible
;
this
.
actIconsGroup
.
visible
=
visible
;
}
private
onTap_actsShowBtn
()
{
this
.
actIconsGroup
.
visible
=
!
this
.
actIconsGroup
.
visible
;
this
.
actIconsGroup
.
x
=
12.12
;
if
(
this
.
actIconsGroup
.
visible
==
false
)
{
this
.
actIconsGroup
.
x
=
-
999
;
}
}
private
initEvents
()
{
this
.
actsShowBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_actsShowBtn
,
this
);
GDispatcher
.
addEvent
(
'closeActBtn'
,
this
.
onTap_actsShowBtn
,
this
);
GDispatcher
.
addEvent
(
'updateActIcon'
,
this
.
updateActIcon
,
this
);
}
private
removeEvents
()
{
this
.
actsShowBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_actsShowBtn
,
this
);
GDispatcher
.
removeEvent
(
'closeActBtn'
,
this
.
onTap_actsShowBtn
,
this
);
GDispatcher
.
removeEvent
(
'updateActIcon'
,
this
.
updateActIcon
,
this
);
}
}
\ No newline at end of file
egret/src/mapScene/icon/HbRainIcon.ts
View file @
3f7b3e32
...
...
@@ -2,7 +2,6 @@ import IconBase from "./IconBase";
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
CutTimer
from
"../../CutTimer"
;
export
default
class
HbRainIcon
extends
IconBase
{
...
...
@@ -56,7 +55,7 @@ export default class HbRainIcon extends IconBase {
GDispatcher
.
removeEvent
(
'updateHbRainIcon'
,
this
.
updateIcon
,
this
);
}
p
rotected
destory
()
{
p
ublic
destory
()
{
super
.
destory
();
}
...
...
egret/src/mapScene/icon/IconBase.ts
View file @
3f7b3e32
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
/**
* 地图页图标基类
* Created on 2019/10/25
...
...
@@ -48,6 +50,11 @@ export default class IconBase {
this
.
iconBtn
.
visible
=
visible
;
// this.iconTipsBg.visible = visible;
// this.iconTips.visible = visible;
GDispatcher
.
dispatchEvent
(
'updateActIcon'
);
}
public
get
visible
():
boolean
{
return
this
.
iconGroup
.
visible
;
}
public
get
position
():
{
x
,
y
}
{
...
...
@@ -95,7 +102,7 @@ export default class IconBase {
this
.
iconBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchBtn
,
this
);
}
p
rotected
destory
()
{
p
ublic
destory
()
{
this
.
removeEvents
();
}
...
...
egret/src/mapScene/icon/ScratchIcon.ts
View file @
3f7b3e32
...
...
@@ -118,7 +118,7 @@ export default class ScratchIcon extends IconBase {
super
.
removeEvents
();
}
p
rotected
destory
()
{
p
ublic
destory
()
{
super
.
destory
();
}
...
...
egret/src/mapScene/icon/TurntableIcon.ts
View file @
3f7b3e32
...
...
@@ -61,7 +61,7 @@ export default class TurntableIcon extends IconBase {
GDispatcher
.
removeEvent
(
'updateTurntableIcon'
,
this
.
updateIcon
,
this
);
}
p
rotected
destory
()
{
p
ublic
destory
()
{
super
.
destory
();
}
...
...
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