Commit 11a0fe50 authored by 邱旭's avatar 邱旭

1

parent 9c5e1e09
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"redbombalert","version":5,"files":["../assets/redbombalert/redbombalert文案.png"]} {"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"redbombalert","version":5,"files":["../assets/redbombalert/redbombalert文案.png","../assets/redbombalert/redAlert_btn.png"]}
\ No newline at end of file \ No newline at end of file
...@@ -149,9 +149,9 @@ ...@@ -149,9 +149,9 @@
</e:Group> </e:Group>
<e:Group id="activitys" x="13.4" y="620.55" touchEnabled="false"> <e:Group id="activitys" x="13.4" y="620.55" touchEnabled="false">
<e:Group id="actIconsGroup" x="12.12" y="0"> <e:Group id="actIconsGroup" x="12.12" y="0">
<e:Image id="actIconsBg1" source="map2+bg_png" x="-27.15" y="0"/> <e:Image id="actIconsBg2" source="map2+bg_png" x="-27.15" y="0" visible="false"/>
<e:Image id="actIconsBg2" x="-29.27" y="10" source="map2+bg2_png" visible="false"/> <e:Image id="actIconsBg1" x="-29.27" y="10" source="map2+bg2_png" visible="false"/>
<e:Group id="hbRainGroup" x="4.27" y="157.5" width="120" height="120"> <e:Group id="hbRainGroup" x="5" y="158" width="120" height="120">
<e:Button id="hbRainBtn" label="" y="-1" x="0"> <e:Button id="hbRainBtn" label="" y="-1" x="0">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
...@@ -161,7 +161,9 @@ ...@@ -161,7 +161,9 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
</e:Group> </e:Group>
<e:Image id="act2Btn" source="map2红包大作战_png" x="157.76" y="159"/> <e:Group id="act2Group" x="157" y="158">
<e:Image id="act2Btn" source="map2红包大作战_png" x="0" y="0"/>
</e:Group>
</e:Group> </e:Group>
<e:Image id="actsShowBtn" source="map2+_png" x="-7.64" y="5.45"/> <e:Image id="actsShowBtn" source="map2+_png" x="-7.64" y="5.45"/>
<e:Image id="actTips" source="maphot_png" x="91.52" y="15.72"/> <e:Image id="actTips" source="maphot_png" x="91.52" y="15.72"/>
......
...@@ -25,12 +25,12 @@ import TurntableIcon from "./icon/TurntableIcon"; ...@@ -25,12 +25,12 @@ import TurntableIcon from "./icon/TurntableIcon";
import MapBottomPart from "./MapBottomPart"; import MapBottomPart from "./MapBottomPart";
import MapRpeatPart from "./MapRpeatPart"; import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart"; import MapTopPart from "./MapTopPart";
import createRegTriangle from "../playScene/factory/createRegTriangle";
import RedBagAni, { createRedBagIcon } from "./RedBagAni"; import RedBagAni, { createRedBagIcon } from "./RedBagAni";
import { createEffect2MovieClip } from "../effect/createEffect2"; import { createEffect2MovieClip } from "../effect/createEffect2";
import ActIcon from "./icon/ActIcon"; import ActIcon from "./icon/ActIcon";
import { NetName } from "../../libs/tw/enum/NetName"; import { NetName } from "../../libs/tw/enum/NetName";
import TaskCenterIcon from "./icon/TaskCenterIcon"; import TaskCenterIcon from "./icon/TaskCenterIcon";
import HbBombIcon from "./icon/HbBombIcon";
let doHelpFlag = false; let doHelpFlag = false;
// let doScratchHelpFlag = false; // let doScratchHelpFlag = false;
...@@ -131,11 +131,6 @@ export default class MapScene extends Scene { ...@@ -131,11 +131,6 @@ export default class MapScene extends Scene {
async start(data?) { async start(data?) {
super.start(); super.start();
// PanelCtrl.instance.show('RedBombAlert');
// NetManager.ins.hc_submit(()=>{
// // const submitData = DataManager.ins.getData('hc_submit').data;
// // PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL,{ level:1, option: submitData.option })
// },1,1,'','')
this.addIcon(); // 添加Icon this.addIcon(); // 添加Icon
this.sendInvite(); this.sendInvite();
...@@ -390,8 +385,10 @@ export default class MapScene extends Scene { ...@@ -390,8 +385,10 @@ export default class MapScene extends Scene {
"taskCenterIcon": new TaskCenterIcon("taskCenterIcon", this["taskGroup"], this["taskBtn"], this["taskTipsBg"], this["taskTips"]), "taskCenterIcon": new TaskCenterIcon("taskCenterIcon", this["taskGroup"], this["taskBtn"], this["taskTipsBg"], this["taskTips"]),
}; };
this.actIcon = new ActIcon(this['actsShowBtn'], this['actTips'], this['actIconsGroup']); this.actIcon = new ActIcon(this['actsShowBtn'], this['actTips'], this['actIconsGroup'], this);
this.actIcon.addActIcon("hbRainIcon", new HbRainIcon("hbRainIcon", this["hbRainGroup"], this["hbRainBtn"])); this.actIcon.addActIcon("hbRainIcon", new HbRainIcon("hbRainIcon", this["hbRainGroup"], this["hbRainBtn"]));
this.actIcon.addActIcon('hbBombIcon', new HbBombIcon('hbBombIcon', this['act2Group'], this['act2Btn']));
this.actIcon.setGroup(); // 整理图标
} }
private removeIcon() { private removeIcon() {
...@@ -518,9 +515,6 @@ export default class MapScene extends Scene { ...@@ -518,9 +515,6 @@ export default class MapScene extends Scene {
} }
disableIcon(level) { disableIcon(level) {
if(level >= 200) {
let s = 1
}
this.setGray(level); this.setGray(level);
MapScene.starHash[level].visible = false; MapScene.starHash[level].visible = false;
} }
...@@ -871,7 +865,7 @@ export default class MapScene extends Scene { ...@@ -871,7 +865,7 @@ export default class MapScene extends Scene {
protected initEvents() { protected initEvents() {
this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this); this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this);
this['guide'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_guide, this); this['guide'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_guide, this);
this['act2Btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_act2btn, this); // this['act2Btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_act2btn, this);
this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_inviteBtn, this); this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_inviteBtn, this);
this['friendBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_friendBtn, this); this['friendBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_friendBtn, this);
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_adBtn, this); this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_adBtn, this);
......
import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import IconBase from "./IconBase"; import IconBase from "./IconBase";
let posArr = [
{x: 5, y: 158},
{x: 157, y: 158}
];
export default class ActIcon { export default class ActIcon {
private actsShowBtn; private actsShowBtn;
...@@ -9,10 +14,13 @@ export default class ActIcon { ...@@ -9,10 +14,13 @@ export default class ActIcon {
private icons = {}; private icons = {};
constructor(actsShowBtn, actTips, actIconGroup) { parent;
constructor(actsShowBtn, actTips, actIconGroup, parent) {
this.actsShowBtn = actsShowBtn; this.actsShowBtn = actsShowBtn;
this.actTips = actTips; this.actTips = actTips;
this.actIconsGroup = actIconGroup; this.actIconsGroup = actIconGroup;
this.parent = parent;
this.initUI(); this.initUI();
this.initEvents(); this.initEvents();
} }
...@@ -43,12 +51,31 @@ export default class ActIcon { ...@@ -43,12 +51,31 @@ export default class ActIcon {
for(let k in this.icons) { for(let k in this.icons) {
if(this.icons[k].visible) { if(this.icons[k].visible) {
this.visible = true; this.visible = true;
this.setGroup();
return; return;
} }
} }
this.visible = false; this.visible = false;
} }
public setGroup() {
let iconArr = [];
for(let k in this.icons) {
if(this.icons[k].visible) {
iconArr.push(this.icons[k]);
}
}
for(let i = 0; i < iconArr.length; i++) {
iconArr[i].x = posArr[i].x;
iconArr[i].y = posArr[i].y;
}
for(let i = 1; i <= 10; i++) { /// TODO when > 10 ??
this.parent[`actIconsBg${i}`] && (this.parent[`actIconsBg${i}`].visible = (i == iconArr.length));
}
}
public set visible(visible: boolean) { public set visible(visible: boolean) {
this.actsShowBtn.visible = visible; this.actsShowBtn.visible = visible;
this.actTips.visible = visible; this.actTips.visible = visible;
...@@ -60,9 +87,9 @@ export default class ActIcon { ...@@ -60,9 +87,9 @@ export default class ActIcon {
private onTap_actsShowBtn() { private onTap_actsShowBtn() {
this.actIconsGroup.visible = !this.actIconsGroup.visible; this.actIconsGroup.visible = !this.actIconsGroup.visible;
if(this.actIconsGroup.visible){ if(this.actIconsGroup.visible) {
for(let k in this.icons){ for(let k in this.icons) {
if(this.icons[k].visible){ if(this.icons[k].visible) {
this.icons[k].showLog(); this.icons[k].showLog();
} }
} }
......
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 { getlogItem } from "../../Main";
import CutTimer from "../../CutTimer";
import { DataManager } from "../../../libs/tw/manager/DataManager";
export default class HbBombIcon extends IconBase {
private cutTimer: CutTimer = null;
constructor(name: string, group: eui.Group, btn: eui.Button | eui.Image, tipsBg?: eui.Image, tipsLabel?: eui.Label) {
super(name, group, btn, tipsBg, tipsLabel);
this.setIcon();
}
private setIcon() {
let res = DataManager.ins.getData('hc_redBombBaseInfo');
if(res.success) {
this.visible = true;
NetManager.ins.showLog(getlogItem(77));
} else {
this.visible = false;
}
}
/**
* 点击icon
* @param e 点击事件
*/
protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e);
NetManager.ins.clickLog(getlogItem(77));
PanelCtrl.instance.show('BombTips2Panel');
GDispatcher.dispatchEvent('closeActBtn');
}
protected initEvents() {
super.initEvents();
}
protected removeEvents() {
super.removeEvents();
}
public destory() {
super.destory();
this.cutTimer.stop();
}
}
\ No newline at end of file
...@@ -7,7 +7,7 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher"; ...@@ -7,7 +7,7 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
export default class IconBase { export default class IconBase {
protected iconGroup: eui.Group; protected iconGroup: eui.Group;
protected iconBtn: eui.Button; protected iconBtn: eui.Button | eui.Image;
protected iconTipsBg: eui.Image; protected iconTipsBg: eui.Image;
protected iconTips: eui.Label; protected iconTips: eui.Label;
...@@ -16,7 +16,7 @@ export default class IconBase { ...@@ -16,7 +16,7 @@ export default class IconBase {
return this._name; return this._name;
} }
constructor(name: string, group: eui.Group, btn: eui.Button, tipsBg?: eui.Image, tipsLabel?: eui.Label) { constructor(name: string, group: eui.Group, btn: eui.Button | eui.Image, tipsBg?: eui.Image, tipsLabel?: eui.Label) {
this.iconGroup = group; this.iconGroup = group;
this.iconBtn = btn; this.iconBtn = btn;
this.iconTipsBg = tipsBg; this.iconTipsBg = tipsBg;
......
{ {
"success": true, "success": true,
"code": "0000000000", "code": "600054",
"desc": "OK", "desc": "OK",
"timestamp": 1573210800000, "timestamp": 1573210800000,
"data": { "data": {
......
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