Commit 0ee1c419 authored by zjz1994's avatar zjz1994

代码暂存

parent c0b4c569
......@@ -29,7 +29,7 @@ export default class MapRpeatPart extends ComponentBase {
icon['nums'] = icon.getChildAt(0);
icon['bmptxt']=icon.getChildAt(1);
icon['starsp'] = star;
icon.hide();
// icon.hide();
}
......
......@@ -761,6 +761,8 @@ export default class MapScene extends Scene {
break;
}
}
if(lidx<0)lidx = 0;
if(nidx<0)nidx = 0;
for(var i3=lidx;i3<nidx;i3++){
var i3mapy = this.scrollMapy[i3];
var i3map:any;
......@@ -780,8 +782,9 @@ export default class MapScene extends Scene {
if(i3map.y!=i3mapy){
i3map.y = i3mapy;
var i3startlevel = MapTopPart.LEVEL_NUMS+(i3-1)*MapRpeatPart.LEVEL_NUMS;
console.log("局部显示",i3,i3mapy,i3startlevel,lidx,nidx);
this.changePartLevelShow(i3map,i3startlevel,"mid");
console.log("局部显示",i3,i3mapy,i3startlevel);
}
}
// this.scrollGroup.addChild(i3map);
......@@ -804,6 +807,7 @@ export default class MapScene extends Scene {
}else if(mappartype=="bot"){
mapnums = MapBottomPart.LEVEL_NUMS;
}
console.log("修改类型",mappartype,startlevel,mappart);
var last_level = window['last_level'];
var homeData = getHomeData();
for(var i=0;i<mapnums;i++){
......@@ -812,21 +816,42 @@ export default class MapScene extends Scene {
icon.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd);
mappart.getTxt(i).text = levelOrder + '';
if(levelOrder>last_level){
setGray(icon);
(icon['nums'] as eui.Image).source = 'icongray_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = false;
icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.showToastQd,this);
}else if(levelOrder<homeData.levels.length){
var leveldata = homeData.levels[levelOrder];
(icon['starsp'] as MapStarComp).visible = false;
setGray(icon);
}else if(levelOrder<homeData.levels.length+1){
icon.filters = null;
var leveldata = homeData.levels[levelOrder-1];
console.log("关卡测试:"+levelOrder);
(icon['nums'] as eui.Image).source = 'icon_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = true;
(icon['bmptxt'] as eui.BitmapLabel).font = 'nums_fnt';
(icon['startsp'] as MapStarComp).setStar(leveldata.stars);
(icon['startsp'] as MapStarComp).visible = true;
(icon['starsp'] as MapStarComp).setStar(leveldata.stars);
(icon['starsp'] as MapStarComp).visible = true;
}else if(levelOrder==homeData.levels.length+1){
icon.filters = null;
(icon['nums'] as eui.Image).source = 'iconnow_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = true;
(icon['bmptxt'] as eui.BitmapLabel).font = 'nums_fnt';
(icon['startsp'] as MapStarComp).setStar(0);
(icon['startsp'] as MapStarComp).visible = true;
(icon['starsp'] as MapStarComp).setStar(0);
(icon['starsp'] as MapStarComp).visible = true;
this.pic.x = icon.x+50;
this.pic.y = icon.y+37+7;
egret.Tween.removeTweens(this.pic);
egret.Tween.get(this.pic, { loop: true })
.set({
scaleX:1,
scaleY:1,
alpha:1
})
.to({ scaleX: 2, scaleY: 2, alpha: 0 }, 1000).wait(1000);
}else{
icon.filters = null;
(icon['nums'] as eui.Image).source = 'icongray_png';
(icon['bmptxt'] as eui.BitmapLabel).visible = false;
(icon['starsp'] as MapStarComp).visible = false;
}
if(!icon.hasEventListener(egret.TouchEvent.TOUCH_TAP)){
icon.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickIcon,this);
......@@ -835,6 +860,7 @@ export default class MapScene extends Scene {
}
//点击
clickIcon(e){
console.log(e);
let icon = e.target as eui.Group;
let txt = icon['bmptxt'] as eui.BitmapLabel;
console.log('关卡点击',txt.text);
......
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