Commit b716f83f authored by wildfirecode's avatar wildfirecode

1

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