Commit 22f3be3d authored by 邱旭's avatar 邱旭

m

parent 5c19b872
This diff is collapsed.
{ {
"code": "000000", "code": "000000",
"data": { "data": {
"currentLevel": 11, "isVisitSuccess": true,
"isPrizeLevel": false,
"tool": {
"image": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png"
},
"prize": { "prize": {
"type": "HAMMERS", "type": 6,
"toolType": "steps",
"name": "aaaaa",
"_id": "_id",
"image": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png" "image": "https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png"
} }
}, },
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"code": "000000", "code": "000000",
"data": { "data": {
"currentLevel": 99, "currentLevel": 99,
"topLevelVisitSuccess": false, "topLevelVisitSuccess": true,
"isDrawTopLevelPrize": false,
"power": 10, "power": 10,
"tools": { "tools": {
"steps": 10, "steps": 10,
......
resource/SuccessPanel/star_en.png

16.9 KB | W: | H:

resource/SuccessPanel/star_en.png

23.4 KB | W: | H:

resource/SuccessPanel/star_en.png
resource/SuccessPanel/star_en.png
resource/SuccessPanel/star_en.png
resource/SuccessPanel/star_en.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"name": "StartPanel" "name": "StartPanel"
}, },
{ {
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png", "keys": "star_en.png,sucAgain.png,sucContinueL.png,sucContinueS.png,sucContinueSR.png,sucGet.png,sucGoPrize.png,sucPrizeTip.png,sucPropTip.png,successBgL.png,successBgS.png",
"name": "SuccessPanel" "name": "SuccessPanel"
}, },
{ {
...@@ -91,10 +91,6 @@ ...@@ -91,10 +91,6 @@
{ {
"keys": "chapterNum0.png,chapterNum1.png,chapterNum2.png,chapterNum3.png,chapterNum4.png,chapterNum5.png,chapterNum6.png,chapterNum7.png,chapterNum8.png,chapterNum9.png,chapterNum关.png,chapterNum第.png,propNum0.png,propNum1.png,propNum2.png,propNum3.png,propNum4.png,propNum5.png,propNum6.png,propNum7.png,propNum8.png,propNum9.png,scoreNum0.png,scoreNum1.png,scoreNum2.png,scoreNum3.png,scoreNum4.png,scoreNum5.png,scoreNum6.png,scoreNum7.png,scoreNum8.png,scoreNum9.png,stepNum0.png,stepNum1.png,stepNum2.png,stepNum3.png,stepNum4.png,stepNum5.png,stepNum6.png,stepNum7.png,stepNum8.png,stepNum9.png", "keys": "chapterNum0.png,chapterNum1.png,chapterNum2.png,chapterNum3.png,chapterNum4.png,chapterNum5.png,chapterNum6.png,chapterNum7.png,chapterNum8.png,chapterNum9.png,chapterNum关.png,chapterNum第.png,propNum0.png,propNum1.png,propNum2.png,propNum3.png,propNum4.png,propNum5.png,propNum6.png,propNum7.png,propNum8.png,propNum9.png,scoreNum0.png,scoreNum1.png,scoreNum2.png,scoreNum3.png,scoreNum4.png,scoreNum5.png,scoreNum6.png,scoreNum7.png,scoreNum8.png,scoreNum9.png,stepNum0.png,stepNum1.png,stepNum2.png,stepNum3.png,stepNum4.png,stepNum5.png,stepNum6.png,stepNum7.png,stepNum8.png,stepNum9.png",
"name": "playSceneNum" "name": "playSceneNum"
},
{
"keys": "star_light_0.png,star_light_1.png,star_light_10.png,star_light_11.png,star_light_12.png,star_light_13.png,star_light_14.png,star_light_15.png,star_light_2.png,star_light_3.png,star_light_4.png,star_light_5.png,star_light_6.png,star_light_7.png,star_light_8.png,star_light_9.png",
"name": "starLight"
} }
], ],
"path": "./resource/" "path": "./resource/"
......
...@@ -33,7 +33,7 @@ export const ResJson = { ...@@ -33,7 +33,7 @@ export const ResJson = {
"name": "StartPanel" "name": "StartPanel"
}, },
{ {
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png", "keys": "star_en.png,sucAgain.png,sucContinueL.png,sucContinueS.png,sucContinueSR.png,sucGet.png,sucGoPrize.png,sucPrizeTip.png,sucPropTip.png,successBgL.png,successBgS.png",
"name": "SuccessPanel" "name": "SuccessPanel"
}, },
{ {
...@@ -91,10 +91,6 @@ export const ResJson = { ...@@ -91,10 +91,6 @@ export const ResJson = {
{ {
"keys": "chapterNum0.png,chapterNum1.png,chapterNum2.png,chapterNum3.png,chapterNum4.png,chapterNum5.png,chapterNum6.png,chapterNum7.png,chapterNum8.png,chapterNum9.png,chapterNum关.png,chapterNum第.png,propNum0.png,propNum1.png,propNum2.png,propNum3.png,propNum4.png,propNum5.png,propNum6.png,propNum7.png,propNum8.png,propNum9.png,scoreNum0.png,scoreNum1.png,scoreNum2.png,scoreNum3.png,scoreNum4.png,scoreNum5.png,scoreNum6.png,scoreNum7.png,scoreNum8.png,scoreNum9.png,stepNum0.png,stepNum1.png,stepNum2.png,stepNum3.png,stepNum4.png,stepNum5.png,stepNum6.png,stepNum7.png,stepNum8.png,stepNum9.png", "keys": "chapterNum0.png,chapterNum1.png,chapterNum2.png,chapterNum3.png,chapterNum4.png,chapterNum5.png,chapterNum6.png,chapterNum7.png,chapterNum8.png,chapterNum9.png,chapterNum关.png,chapterNum第.png,propNum0.png,propNum1.png,propNum2.png,propNum3.png,propNum4.png,propNum5.png,propNum6.png,propNum7.png,propNum8.png,propNum9.png,scoreNum0.png,scoreNum1.png,scoreNum2.png,scoreNum3.png,scoreNum4.png,scoreNum5.png,scoreNum6.png,scoreNum7.png,scoreNum8.png,scoreNum9.png,stepNum0.png,stepNum1.png,stepNum2.png,stepNum3.png,stepNum4.png,stepNum5.png,stepNum6.png,stepNum7.png,stepNum8.png,stepNum9.png",
"name": "playSceneNum" "name": "playSceneNum"
},
{
"keys": "star_light_0.png,star_light_1.png,star_light_10.png,star_light_11.png,star_light_12.png,star_light_13.png,star_light_14.png,star_light_15.png,star_light_2.png,star_light_3.png,star_light_4.png,star_light_5.png,star_light_6.png,star_light_7.png,star_light_8.png,star_light_9.png",
"name": "starLight"
} }
], ],
"path": "./resource/" "path": "./resource/"
......
...@@ -3,280 +3,6 @@ export const SkinJson = { ...@@ -3,280 +3,6 @@ export const SkinJson = {
"y": 0, "y": 0,
"type": "container", "type": "container",
"children": [ "children": [
{
"name": "SuccessNoPrizePanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "light1",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light1"
},
{
"name": "light2",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light2"
},
{
"name": "闯关成功Bg",
"x": 55,
"y": 266,
"type": "sprite",
"props": {
"source": "闯关成功Bg.png"
}
},
{
"name": "继续闯关大",
"x": 163,
"y": 935,
"type": "button",
"props": {
"tUp": "继续闯关大.png"
},
"id": "totalContinueBtn"
},
{
"name": "继续闯关小",
"x": 381,
"y": 935,
"type": "button",
"props": {
"tUp": "继续闯关小.png"
},
"id": "continueBtn"
},
{
"name": "闯关成功不满星按钮",
"x": 91,
"y": 935,
"type": "button",
"props": {
"tUp": "闯关成功不满星按钮.png"
},
"id": "againBtn"
},
{
"name": "关卡文字",
"x": 300,
"y": 501,
"type": "text",
"props": {
"text": "第 24 关",
"size": 40,
"fillColor": "#df5942",
"textAlpha": 1,
"bold": true
},
"id": "checkTex"
},
{
"name": "提示文案",
"x": 210,
"y": 815,
"type": "text",
"props": {
"text": "太厉害了!\n再闯6关就即可抽奖!",
"size": 36,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "tipsTex"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{
"name": "SuccessPrizePanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "light1",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light1"
},
{
"name": "light2",
"x": 155,
"y": 280,
"alpha": 0.8,
"type": "sprite",
"props": {
"source": "comm_light.png"
},
"id": "light2"
},
{
"name": "闯关成功",
"x": 55,
"y": 266,
"type": "sprite",
"props": {
"source": "闯关成功.png"
}
},
{
"name": "继续闯关大",
"x": 163,
"y": 1086,
"type": "button",
"props": {
"tUp": "继续闯关大.png"
},
"id": "noPrizeAgainBtn"
},
{
"name": "继续闯关小",
"x": 93,
"y": 1086,
"type": "button",
"props": {
"tUp": "继续闯关小.png"
},
"id": "againBtn"
},
{
"name": "去抽奖",
"x": 383,
"y": 1086,
"type": "button",
"props": {
"tUp": "去抽奖.png"
},
"id": "goPrizeBtn"
},
{
"name": "关卡文字",
"x": 300,
"y": 501,
"type": "text",
"props": {
"text": "第 24 关",
"size": 40,
"fillColor": "#df5942",
"textAlpha": 1,
"bold": true
},
"id": "checkTex"
},
{
"name": "提示文案",
"x": 182,
"y": 810,
"type": "text",
"props": {
"text": "太厉害了!获得抽奖资格!",
"size": 34,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "tipsTex"
},
{
"name": "红包奖励",
"x": 130,
"y": 870,
"type": "sprite",
"props": {
"source": ""
},
"id": "prizeImg"
},
{
"name": "道具",
"x": 124,
"y": 858,
"type": "container",
"children": [
{
"name": "bg",
"x": 0,
"y": 0,
"alpha": 1,
"type": "sprite",
"props": {
"source": "圆角矩形 648.png"
}
},
{
"name": "label",
"x": 265,
"y": 85,
"alpha": 1,
"type": "text",
"props": {
"text": "步数道具 x1",
"size": 30,
"fillColor": "#df5942",
"textAlpha": 1
}
},
{
"name": "img",
"x": 86,
"y": 45,
"alpha": 1,
"type": "sprite",
"props": {
"source": "道具.png"
}
},
{
"name": "quanquan",
"x": 76,
"y": 24,
"alpha": 1,
"type": "sprite",
"props": {
"source": "道具圆圈.png"
}
}
],
"id": "prop"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{ {
"name": "RulePanel", "name": "RulePanel",
"x": 0, "x": 0,
......
...@@ -47,7 +47,8 @@ export class Tools { ...@@ -47,7 +47,8 @@ export class Tools {
prizeLevels: number[], prizeLevels: number[],
rule: string, rule: string,
currentLevel: any, currentLevel: any,
topLevelVisitSuccess: string, topLevelVisitSuccess: boolean,
isDrawTopLevelPrize: boolean,
power: number, power: number,
tools: { tools: {
steps: number, steps: number,
...@@ -109,12 +110,7 @@ export class Tools { ...@@ -109,12 +110,7 @@ export class Tools {
public static gameOver(data) { public static gameOver(data) {
if (!data.isVisitSuccess) { // 闯关失败 if (!data.isVisitSuccess) { // 闯关失败
showPanel(FailedPanel, data); showPanel(FailedPanel, data);
} else if ((data.prize && data.prize.image) || (data.tool && data.tool.type) || data.level == 120) { // 闯关成功,奖励关卡 } else if (data.prize && data.prize.type != 5) { // 闯关成功,奖励关卡
//120关,如果没有奖品图片,伪造一个
if (data.level == 99 && (!data.prize || !data.prize.image)) {
data.prize = data.prize || {};
data.prize.image = Tools.gameData.levelPrize['level99'];
}
showPanel(SuccessPrizePanel, data); showPanel(SuccessPrizePanel, data);
} else { // 闯关成功,不是奖励关卡 } else { // 闯关成功,不是奖励关卡
showPanel(SuccessNoPrizePanel, data); showPanel(SuccessNoPrizePanel, data);
......
This diff is collapsed.
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { SuccessStarGroup } from "./SuccessNoPrizePanel"; import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import Container = FYGE.Container;
import { PropType } from "../something/enum/PropType";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import TextField = FYGE.TextField;
import { changeScene } from "../../module/ctrls"; import { changeScene } from "../../module/ctrls";
import { MapScene } from "../scene/map/MapScene"; import { MapScene } from "../scene/map/MapScene";
import MouseEvent = FYGE.MouseEvent;
import { LotteryScene } from "../scene/LotteryScene"; import { LotteryScene } from "../scene/LotteryScene";
import { Tools } from "../Tools";
import { PropType } from "../something/enum/PropType";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import MouseEvent = FYGE.MouseEvent;
import Button = FYGE.Button;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
export class SuccessPrizePanel extends Panel { export class SuccessPrizePanel extends Panel {
get groupNames() { get groupNames() {
return ['SuccessPanel', 'starLight'] return ['SuccessPanel']
}
get skinName() {
return "SuccessPrizePanel"
} }
public showAni() { public showAni() {
...@@ -35,90 +30,66 @@ export class SuccessPrizePanel extends Panel { ...@@ -35,90 +30,66 @@ export class SuccessPrizePanel extends Panel {
}); });
} }
closeBtn: FYGE.Button;
tipsTex: FYGE.TextField;
checkTex: FYGE.TextField;
againBtn: FYGE.Button;
noPrizeAgainBtn: FYGE.Button;
goPrizeBtn: FYGE.Button;
prizeImg: Sprite;
prop: Container;
light1: Sprite;
light2: Sprite;
private starGroup: SuccessStarGroup = null;
initUi() { initUi() {
this.checkTex.text = `第\t${this.data.level}\t关`; const { prize, level, isVisitSuccess, score, stars } = this.data;
this.checkTex.textWidth = 750; const { name, _id, image, type, toolType } = prize;
this.checkTex.x = 0;
this.checkTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textWidth = 750;
this.tipsTex.x = 0;
this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.starGroup = this.addChild(new SuccessStarGroup());
this.starGroup.position.set(373, 678);
this.prizeImg.anchorTexture.x = 0.5; this.addChild(Tools.getSprite("successBgL.png")).position.set(79, 345);
this.prizeImg.x = 375;
this.lightEffect(); const starGroup = this.addChild(new SuccessStarGroup());
starGroup.position.set(375, 600);
starGroup.play(stars);
this.starGroup.play(this.data.stars); this.addChild(Tools.getText(
"闯关成功!获得奖励", 36, "#744f1d",
FYGE.TEXT_ALIGN.CENTER, 750, 0, 713
));
const propImg: Sprite = this.prop.getChildByName('img'); const prizeImg = this.addChild(new Sprite());
const propLabel: TextField = this.prop.getChildByName('label'); prizeImg.anchorTexture.set(0.5, 0.5);
prizeImg.position.set(375, 890);
if (this.data.tool && this.data.tool.type) { if (type == 6) { // 道具
this.againBtn.visible = false; switch (toolType) {
this.goPrizeBtn.visible = false;
this.prizeImg.visible = false;
this.tipsTex.text = '\t\t满星过关!';
switch (this.data.tool.type) {
case PropType.BOOMS: case PropType.BOOMS:
propImg.texture = RES.getRes('boomBtn.png'); prizeImg.texture = RES.getRes('boomBtn.png');
propImg.y += 5;
propImg.x += 15;
propLabel.text = '炸弹道具\tx1';
break; break;
case PropType.HAMMERS: case PropType.HAMMERS:
propImg.texture = RES.getRes('hammerBtn.png'); prizeImg.texture = RES.getRes('hammerBtn.png');
propImg.x += 10;
propLabel.text = '锤子道具\tx1';
break; break;
case PropType.STEPS: case PropType.STEPS:
propImg.texture = RES.getRes('stepBtn.png'); prizeImg.texture = RES.getRes('stepBtn.png');
propLabel.text = '步数道具\tx1';
break; break;
} }
} else if (this.data.prize && this.data.prize.image) { if (stars >= 3) { //三星
if (this.data.level == 120) {//120关不显示闯关按钮,换图 this.addChild(new Button(RES.getRes('sucContinueL.png')))
this.againBtn.visible = false; .addEventListener(MouseEvent.CLICK, this.continue, this)
this.goPrizeBtn.visible = false; .position.set(190, 1050);
this.noPrizeAgainBtn.changeTexture(RES.getRes("开奖按钮120.png")) } else { // 不是三星
} else { this.addChild(Tools.getSprite("sucPropTip.png")).position.set(142, 1010);
this.noPrizeAgainBtn.visible = false; this.addChild(new Button(RES.getRes("sucAgain.png")))
.addEventListener(MouseEvent.CLICK, this.again, this)
.position.set(100, 1089);
this.addChild(new Button(RES.getRes("sucGet.png")))
.addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(385, 1089);
} }
} else { // 不是道具
this.prop.visible = false; prizeImg.texture = Texture.fromUrl(image);
this.prizeImg.texture = Texture.fromUrl(this.data.prize.image); this.addChild(Tools.getSprite("sucPrizeTip.png")).position.set(142, 1010);
// this.tipsTex.text = '\t\t闯关成功!获得抽大奖机会!'; this.addChild(new Button(RES.getRes("sucContinueS.png")))
this.tipsTex.text = '\t闯关成功!有机会抽取如下奖品'; .addEventListener(MouseEvent.CLICK, this.continue, this)
.position.set(100, 1089);
this.addChild(new Button(RES.getRes("sucGet.png")))
.addEventListener(MouseEvent.CLICK, this.getPrize, this)
.position.set(385, 1089);
} }
}
private lightEffect() {
Tween.get(this.light1, { loop: true })
.set({ anchorX: 219.5, anchorY: 219.5 })
.to({ rotation: 360 }, 12000);
Tween.get(this.light2, { loop: true }) this.addChild(new Button(RES.getRes('关闭按钮.png')))
.set({ anchorX: 219.5, anchorY: 219.5 }) .addEventListener(MouseEvent.CLICK, this.hidePanel, this)
.to({ rotation: -360 }, 12000); .position.set(640, 460);
} }
start(data) { start(data) {
...@@ -137,7 +108,7 @@ export class SuccessPrizePanel extends Panel { ...@@ -137,7 +108,7 @@ export class SuccessPrizePanel extends Panel {
* 继续闯关 * 继续闯关
*/ */
private continue() { private continue() {
if (this.data.level == 120) { if (this.data.level == 99) {
changeScene(MapScene); changeScene(MapScene);
} else { } else {
changeScene(MapScene, { level: this.data.level + 1 }); changeScene(MapScene, { level: this.data.level + 1 });
...@@ -152,20 +123,17 @@ export class SuccessPrizePanel extends Panel { ...@@ -152,20 +123,17 @@ export class SuccessPrizePanel extends Panel {
super.hidePanel(); super.hidePanel();
} }
/**
* 领奖
*/
public getPrize() {
/// TODO 领奖
}
public hidePanel() { public hidePanel() {
changeScene(MapScene); changeScene(MapScene);
super.hidePanel(); super.hidePanel();
} }
initEvents() {
super.initEvents();
this.againBtn.addEventListener(MouseEvent.CLICK, this.continue, this);
this.noPrizeAgainBtn.addEventListener(MouseEvent.CLICK, this.continue, this);
this.goPrizeBtn.addEventListener(MouseEvent.CLICK, this.goPrize, this);
}
removeEvents() {
super.removeEvents();
}
} }
...@@ -42,8 +42,6 @@ export default class CheckBtn extends Container { ...@@ -42,8 +42,6 @@ export default class CheckBtn extends Container {
private star: CheckStar[] = null; private star: CheckStar[] = null;
private curAni: Lottie = null;
private checkNum: number = null; private checkNum: number = null;
private _data: any = null; private _data: any = null;
......
...@@ -55,6 +55,7 @@ export class MapScene extends Scene { ...@@ -55,6 +55,7 @@ export class MapScene extends Scene {
if (this.data && this.data.from == 'loading') { if (this.data && this.data.from == 'loading') {
this.uiLayer = this.addChild(new MapUI()); this.uiLayer = this.addChild(new MapUI());
this.initMapByData(Tools.gameData); this.initMapByData(Tools.gameData);
this.uiLayer.updateUI();
if (Tools.globalData.isNewUser) { if (Tools.globalData.isNewUser) {
this.initGuide(); this.initGuide();
} }
...@@ -63,6 +64,7 @@ export class MapScene extends Scene { ...@@ -63,6 +64,7 @@ export class MapScene extends Scene {
if (success) {//不考虑失败的情况 if (success) {//不考虑失败的情况
this.uiLayer = this.addChild(new MapUI()); this.uiLayer = this.addChild(new MapUI());
this.initMapByData(Tools.gameData); this.initMapByData(Tools.gameData);
this.uiLayer.updateUI();
} }
}); });
} }
...@@ -117,7 +119,6 @@ export class MapScene extends Scene { ...@@ -117,7 +119,6 @@ export class MapScene extends Scene {
} }
private initMapByData(data) { private initMapByData(data) {
this.uiLayer.energyBox.count = data.power;
const currentLevel = data.currentLevel; const currentLevel = data.currentLevel;
...@@ -206,19 +207,13 @@ export class MapScene extends Scene { ...@@ -206,19 +207,13 @@ export class MapScene extends Scene {
public start(data?: any) { public start(data?: any) {
super.start(data); super.start(data);
// Tools.gameOver({ Tools.gameOver({
// level: 1, "isVisitSuccess": true,
// score: 666, "prize": undefined,
// stars: 3, "level": 99,
// isVisitSuccess: true, "score": 58940,
// isPrizeLevel: false, "stars": 3
// // tool: { });
// // type: 'HAMMERS',
// // },
// prize: {
// image: 'https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png',
// }]
// });
} }
public initEvents() { public initEvents() {
......
...@@ -2,9 +2,9 @@ import Container = FYGE.Container; ...@@ -2,9 +2,9 @@ import Container = FYGE.Container;
import Button = FYGE.Button; import Button = FYGE.Button;
import TextField = FYGE.TextField; import TextField = FYGE.TextField;
import TEXT_ALIGN = FYGE.TEXT_ALIGN; import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import MouseEvent = FYGE.MouseEvent;
import { RES } from "../../../module/RES"; import { RES } from "../../../module/RES";
import { Tools } from "../../Tools"; import { Tools } from "../../Tools";
import MouseEvent = FYGE.MouseEvent;
import { showPanel } from "../../../module/ctrls"; import { showPanel } from "../../../module/ctrls";
import { RulePanel } from "../../panels/RulePanel"; import { RulePanel } from "../../panels/RulePanel";
import { sendTbNet, TbNetName } from "../../TaoBaoNet"; import { sendTbNet, TbNetName } from "../../TaoBaoNet";
...@@ -15,6 +15,7 @@ export default class MapUI extends Container { ...@@ -15,6 +15,7 @@ export default class MapUI extends Container {
private myPrizeBtn: Button = null; private myPrizeBtn: Button = null;
private ruleBtn: Button = null; private ruleBtn: Button = null;
private taskBtn: Button = null; private taskBtn: Button = null;
private clearanceBtn: Button = null;
constructor() { constructor() {
super(); super();
...@@ -28,12 +29,14 @@ export default class MapUI extends Container { ...@@ -28,12 +29,14 @@ export default class MapUI extends Container {
this.ruleBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this); this.ruleBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.myPrizeBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this); this.myPrizeBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.taskBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this); this.taskBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.clearanceBtn.addEventListener(MouseEvent.CLICK, this.clickBtn, this);
} }
private removeEvent() { private removeEvent() {
this.ruleBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this); this.ruleBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.myPrizeBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this); this.myPrizeBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.taskBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this); this.taskBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
this.clearanceBtn.removeEventListener(MouseEvent.CLICK, this.clickBtn, this);
} }
private clickBtn(e) { private clickBtn(e) {
...@@ -54,6 +57,11 @@ export default class MapUI extends Container { ...@@ -54,6 +57,11 @@ export default class MapUI extends Container {
case this.taskBtn: case this.taskBtn:
Tools.openTask(); Tools.openTask();
break; break;
case this.clearanceBtn:
/// TODO 打开通关抽奖
console.error("TODO 打开通关抽奖");
break;
} }
} }
...@@ -79,10 +87,15 @@ export default class MapUI extends Container { ...@@ -79,10 +87,15 @@ export default class MapUI extends Container {
this.energyBox = this.addChild(new EnergyBox({})); this.energyBox = this.addChild(new EnergyBox({}));
this.clearanceBtn = this.addChild(new Button(RES.getRes('clearanceBtn.png')));
this.clearanceBtn.position.set(0, 387);
this.clearanceBtn.visible = false;
} }
public updateUI() { public updateUI() {
this.energyBox.count = Tools.gameData.power; this.energyBox.count = Tools.gameData.power;
const { topLevelVisitSuccess, isDrawTopLevelPrize } = Tools.gameData;
this.clearanceBtn.visible = topLevelVisitSuccess && !isDrawTopLevelPrize;
} }
} }
...@@ -91,7 +104,6 @@ export default class MapUI extends Container { ...@@ -91,7 +104,6 @@ export default class MapUI extends Container {
*/ */
class EnergyBox extends Container { class EnergyBox extends Container {
private addBtn: Button = null;
private countLabel: TextField = null; private countLabel: TextField = null;
private _count = 0; private _count = 0;
......
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