Commit b716f83f authored by wildfirecode's avatar wildfirecode

1

parent c609f9c9
import Panel from "./Panel";
import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import StartScene, { createData } from "../../../src/startScene/StartScene";
import StartScene, { createData, changeMapScene } from "../../../src/startScene/StartScene";
export default class Alert extends Panel {
start(data) {
super.start(data);
......@@ -21,6 +21,6 @@ export default class Alert extends Panel {
hidePanel() {
super.hidePanel();
if (!(SceneCtrl.instance.currentScene instanceof StartScene))
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ import { NetManager } from "../../tw/manager/NetManager";
import Panel from "./Panel";
import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import { createData } from "../../../src/startScene/StartScene";
import { createData, changeMapScene } from "../../../src/startScene/StartScene";
import { DataManager } from "../../tw/manager/DataManager";
import getShowOffPic from "../../../src/getShowOffPic";
import { showShare } from "../../../src/shareCtrl";
......@@ -21,7 +21,7 @@ export default class NoPrizePanel extends Panel {
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(16));
if (iswx()) {
getShowOffPic(this.stage,this);
getShowOffPic(this.stage, this);
} else
showShare(2);
}, this);
......@@ -34,10 +34,12 @@ export default class NoPrizePanel extends Panel {
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel();
if (this._level + 1 <= 70)
SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level + 1 });
changeMapScene({ level: this._level + 1 });
else
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}, this);
}
showlog() {
......@@ -46,7 +48,7 @@ export default class NoPrizePanel extends Panel {
onTouchTap_closeBtn() {
super.onTouchTap_closeBtn();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
// if (this._level + 1 <= 70)
// SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level + 1 });
// else
......@@ -76,9 +78,9 @@ export default class NoPrizePanel extends Panel {
this['pic3'].visible = true;
await this.playAni3();
}
if(nums>=1) {
if (nums >= 1) {
this['light'].visible = true;
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0 ,alpha:0,}).to({ scaleX: 1, scaleY: 1,alpha:1 }, 300).call(() => {
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0, alpha: 0, }).to({ scaleX: 1, scaleY: 1, alpha: 1 }, 300).call(() => {
egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 3000);
});
}
......
......@@ -9,6 +9,7 @@ import { ModuleTypes } from "../types/sceneTypes";
import Panel from "./Panel";
import getShowOffPic from "../../../src/getShowOffPic";
import wait from "../../new_tc/wait";
import { changeMapScene } from "../../../src/startScene/StartScene";
export default class PrizePanel extends Panel {
_level;
start(data) {
......@@ -30,9 +31,9 @@ export default class PrizePanel extends Panel {
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel();
if (this._level + 1 <= 70)
SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level + 1 });
changeMapScene({ level: this._level + 1 });
else
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}, this);
this.showlog();
NetManager.ins.hc_home(() => { }, window['collectRuleId']);
......@@ -68,13 +69,13 @@ export default class PrizePanel extends Panel {
this['pic3'].visible = true;
await this.playAni3();
}
if(nums>=1) {
if (nums >= 1) {
this['light'].visible = true;
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0 ,alpha:0,}).to({ scaleX: 1, scaleY: 1,alpha:1 }, 300).call(() => {
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0, alpha: 0, }).to({ scaleX: 1, scaleY: 1, alpha: 1 }, 300).call(() => {
egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 3000);
});
}
}
async playAni1() {
......@@ -100,7 +101,7 @@ export default class PrizePanel extends Panel {
onTouchTap_closeBtn(): any {
super.onTouchTap_closeBtn();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
// if (this._level +1 <= 70)
// SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level + 1 });
// else
......
......@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { changeMapScene } from "../startScene/StartScene";
export default class FailedPanel extends Panel {
_level;
......@@ -14,16 +15,16 @@ export default class FailedPanel extends Panel {
this['againBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel();
if (this._level)
SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level });
changeMapScene({ level: this._level });
else
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}, this);
}
onTouchTap_closeBtn() {
super.onTouchTap_closeBtn();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
......
......@@ -9,6 +9,7 @@ import getShowOffPic from "../getShowOffPic";
import { showShare } from "../shareCtrl";
import { iswx } from "../iswx";
import wait from "../../libs/new_tc/wait";
import { changeMapScene } from "../startScene/StartScene";
export default class Prize2Panel extends Panel {
_level;
......@@ -26,7 +27,7 @@ export default class Prize2Panel extends Panel {
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(15));
if (iswx()) {
getShowOffPic(this.stage,this);
getShowOffPic(this.stage, this);
} else
showShare(2);
}, this);
......@@ -34,9 +35,9 @@ export default class Prize2Panel extends Panel {
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel();
if (this._level + 1 <= 70)
SceneCtrl.instance.change(ModuleTypes.START_SCENE, { level: this._level + 1 });
changeMapScene({ level: this._level + 1 });
else
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}, this);
this.showlog();
......@@ -71,9 +72,9 @@ export default class Prize2Panel extends Panel {
this['pic3'].visible = true;
await this.playAni3();
}
if(nums>=1) {
if (nums >= 1) {
this['light'].visible = true;
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0 ,alpha:0,}).to({ scaleX: 1, scaleY: 1,alpha:1 }, 300).call(() => {
egret.Tween.get(this['light']).set({ scaleX: 0, scaleY: 0, alpha: 0, }).to({ scaleX: 1, scaleY: 1, alpha: 1 }, 300).call(() => {
egret.Tween.get(this['light'], { loop: true }).to({ rotation: 360 }, 3000);
});
}
......@@ -100,7 +101,7 @@ export default class Prize2Panel extends Panel {
}
onTouchTap_closeBtn(): any {
super.onTouchTap_closeBtn();
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}
get picBigWidth() { return 510 };
......
......@@ -3,6 +3,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import { changeMapScene } from "../startScene/StartScene";
export default class QuitPanel extends Panel {
_level;
......@@ -20,7 +21,7 @@ export default class QuitPanel extends Panel {
this['quitBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(18));
SceneCtrl.instance.change(ModuleTypes.START_SCENE);
changeMapScene();
}, this);
this.showlog();
......
......@@ -14,8 +14,8 @@ export default class StartScene extends Scene {
level;
async start(data?) {
super.start();
if(data)
this.level = data.level;
if (data)
this.level = data.level;
this['container1'].x = 20;
this['container4'].mask = this['progressmask'];
this['maskwrapper'].mask = this['progressmask2'];
......@@ -23,7 +23,7 @@ export default class StartScene extends Scene {
this['progressmask2'].scaleX = 0;
this['percentTxt'].text = `0%`;
if (data && Array.isArray(data)) {
if (data && Array.isArray(data)) {
this['container3'].addChild(data[0]);
this['container2'].addChild(data[1]);
this['container1'].addChild(data[2]);
......@@ -80,7 +80,7 @@ export default class StartScene extends Scene {
setTimeout(() => {
egret.Tween.removeTweens(this['progressmask2']);
egret.Tween.get(this['progressmask2']).to({ scaleX: 1 }, 200).wait(200).call(() => {
d.level=this.level;
d.level = this.level;
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE, d);
});
this['percentTxt'].text = `100%`
......@@ -91,6 +91,13 @@ export default class StartScene extends Scene {
get skinKey() { return 'Start' }
}
export const changeMapScene = (p?) => {
const data = createData();
if (p)
data.level = p.level;
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE, data);
}
export const createData = () => {
const startSceneData: any = {};
startSceneData.top = new MapTopPart();
......
......@@ -4,7 +4,7 @@
"desc":"OK",
"timestamp":1566546925981,
"data":{
"prizeType":null,
"prizeType":2,
"prizeResponse":{
"errorCode":null,
"changeMoney":190,
......
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