Commit 41b020e6 authored by zjz1994's avatar zjz1994

代码暂存

parent 0ee1c419
...@@ -19,11 +19,16 @@ export default class MapBottomPart extends ComponentBase { ...@@ -19,11 +19,16 @@ export default class MapBottomPart extends ComponentBase {
const icon = this.getIcon(i); const icon = this.getIcon(i);
icon.addChild(star); icon.addChild(star);
icon.show = ()=>{this.addChild(icon)}; icon.show = ()=>{icon.visible = true;};
icon.hide = ()=>{this.removeChild(icon)}; icon.hide = ()=>{icon.visible = false;};
icon['nums'] = icon.getChildAt(0); icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1); icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star; icon['starsp'] = star;
icon.touchEnabled = true;
icon['nums'].touchEnabled = false;
icon['bmptxt'].touchEnabled = false;
icon['starsp'].touchEnabled = false;
} }
// const repeatCount =getRepeatCount(); // const repeatCount =getRepeatCount();
// for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) { // for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) {
......
...@@ -24,12 +24,17 @@ export default class MapRpeatPart extends ComponentBase { ...@@ -24,12 +24,17 @@ export default class MapRpeatPart extends ComponentBase {
const icon = this.getIcon(i); const icon = this.getIcon(i);
icon.addChild(star); icon.addChild(star);
icon.show = ()=>{this.addChild(icon)}; icon.show = ()=>{icon.visible = true;};
icon.hide = ()=>{this.removeChild(icon)}; icon.hide = ()=>{icon.visible = false;};
icon['nums'] = icon.getChildAt(0); icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1); icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star; icon['starsp'] = star;
// icon.hide(); // icon.hide();
icon.touchEnabled = true;
icon['nums'].touchEnabled = false;
icon['bmptxt'].touchEnabled = false;
icon['starsp'].touchEnabled = false;
} }
......
...@@ -133,8 +133,10 @@ export default class MapScene extends Scene { ...@@ -133,8 +133,10 @@ export default class MapScene extends Scene {
if(!this.pic){ if(!this.pic){
let light = RES.getRes('lightani_png'); let light = RES.getRes('lightani_png');
this.pic = new egret.Bitmap(light); this.pic = new egret.Bitmap(light);
this.pic.name = 'water_light';
this.pic.anchorOffsetX = 76; this.pic.anchorOffsetX = 76;
this.pic.anchorOffsetY = 61; this.pic.anchorOffsetY = 61;
this.pic.touchEnabled = false;
} }
} }
initMapScene(){ initMapScene(){
...@@ -813,15 +815,24 @@ export default class MapScene extends Scene { ...@@ -813,15 +815,24 @@ export default class MapScene extends Scene {
for(var i=0;i<mapnums;i++){ for(var i=0;i<mapnums;i++){
const levelOrder = startlevel + i + 1; const levelOrder = startlevel + i + 1;
let icon = mappart.getIcon(i); let icon = mappart.getIcon(i);
let havewater_light = icon.getChildByName('water_light');
icon.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd); icon.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd);
mappart.getTxt(i).text = levelOrder + ''; mappart.getTxt(i).text = levelOrder + '';
if(levelOrder>last_level){ if(levelOrder>last_level){
if(havewater_light){
console.log("当前关卡,移除water_light",levelOrder);
icon.removeChild(this.pic);
}
(icon['nums'] as eui.Image).source = 'icongray_png'; (icon['nums'] as eui.Image).source = 'icongray_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = false; (icon['bmptxt'] as eui.BitmapLabel).visible = false;
icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd,this); icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd,this);
(icon['starsp'] as MapStarComp).visible = false; (icon['starsp'] as MapStarComp).visible = false;
setGray(icon); setGray(icon);
}else if(levelOrder<homeData.levels.length+1){ }else if(levelOrder<homeData.levels.length+1){
if(havewater_light){
console.log("当前关卡,移除water_light",levelOrder);
icon.removeChild(this.pic);
}
icon.filters = null; icon.filters = null;
var leveldata = homeData.levels[levelOrder-1]; var leveldata = homeData.levels[levelOrder-1];
console.log("关卡测试:"+levelOrder); console.log("关卡测试:"+levelOrder);
...@@ -837,8 +848,11 @@ export default class MapScene extends Scene { ...@@ -837,8 +848,11 @@ export default class MapScene extends Scene {
(icon['bmptxt'] as eui.BitmapLabel).font = 'nums_fnt'; (icon['bmptxt'] as eui.BitmapLabel).font = 'nums_fnt';
(icon['starsp'] as MapStarComp).setStar(0); (icon['starsp'] as MapStarComp).setStar(0);
(icon['starsp'] as MapStarComp).visible = true; (icon['starsp'] as MapStarComp).visible = true;
this.pic.x = icon.x+50; if(!havewater_light){
this.pic.y = icon.y+37+7; this.pic.x = 50;
this.pic.y = 37+7;
icon.addChild(this.pic);
egret.Tween.removeTweens(this.pic); egret.Tween.removeTweens(this.pic);
egret.Tween.get(this.pic, { loop: true }) egret.Tween.get(this.pic, { loop: true })
.set({ .set({
...@@ -847,11 +861,17 @@ export default class MapScene extends Scene { ...@@ -847,11 +861,17 @@ export default class MapScene extends Scene {
alpha:1 alpha:1
}) })
.to({ scaleX: 2, scaleY: 2, alpha: 0 }, 1000).wait(1000); .to({ scaleX: 2, scaleY: 2, alpha: 0 }, 1000).wait(1000);
console.log("当前关卡,添加water_light",levelOrder,this.pic);
}
}else{ }else{
icon.filters = null; icon.filters = null;
(icon['nums'] as eui.Image).source = 'icongray_png'; (icon['nums'] as eui.Image).source = 'icongray_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = false; (icon['bmptxt'] as eui.BitmapLabel).visible = false;
(icon['starsp'] as MapStarComp).visible = false; (icon['starsp'] as MapStarComp).visible = false;
if(havewater_light){
console.log("当前关卡,移除water_light",levelOrder);
icon.removeChild(this.pic);
}
} }
if(!icon.hasEventListener(egret.TouchEvent.TOUCH_TAP)){ if(!icon.hasEventListener(egret.TouchEvent.TOUCH_TAP)){
icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickIcon,this); icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickIcon,this);
......
...@@ -14,12 +14,16 @@ export default class MapTopPart extends ComponentBase { ...@@ -14,12 +14,16 @@ export default class MapTopPart extends ComponentBase {
const icon = this.getIcon(i); const icon = this.getIcon(i);
icon.addChild(star); icon.addChild(star);
icon.show = ()=>{this.addChild(icon)}; icon.show = ()=>{icon.visible = true;};
icon.hide = ()=>{this.removeChild(icon)}; icon.hide = ()=>{icon.visible = false;};
icon['nums'] = icon.getChildAt(0); icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1); icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star; icon['starsp'] = star;
icon.touchEnabled = true;
icon['nums'].touchEnabled = false;
icon['bmptxt'].touchEnabled = false;
icon['starsp'].touchEnabled = false;
} }
// for (let i = 0; i < MapTopPart.LEVEL_NUMS; i++) { // for (let i = 0; i < MapTopPart.LEVEL_NUMS; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment