Commit c43bbd2e authored by zhangjinzhou's avatar zhangjinzhou

暂存5

parent ada01e85
......@@ -142,7 +142,7 @@
window['signconfigs'] = [
{ nums: '*20', type: 'money' },
{ nums: '*20', type: 'money' },
{ nums: '*40', type: 'money' },
{ nums: '*1', type: 'hammer' },
{ nums: '*20', type: 'money' },
{ nums: '*20', type: 'money' },
......
......@@ -16,7 +16,9 @@ import QuitPanel from "../../src/panels/QuitPanel";
import ShopPanel from "../../src/panels/ShopPanel";
import SignPanel from "../../src/panels/SignPanel";
import StartPanel from "../../src/panels/StartPanel";
import { getBgOn, playBg, stopBg } from "../../src/soundCtrl";
// import StartPanelNew from "../../src/panels/StartPanelNew";
import { getSoundOn, playBg, stopBg } from "../../src/soundCtrl";
import { playGameBg, stopGamebg } from "../../src/soundCtrl2";
import StartScene from "../../src/startScene/StartScene";
import getResPath from "../new_tc/getResPath";
......@@ -115,7 +117,6 @@ export default class MainBase extends eui.UILayer {
protected getData() {
}
protected createChildren(): void {
super.createChildren();
egret.lifecycle.addLifecycleListener((context) => {
......@@ -248,7 +249,7 @@ export default class MainBase extends eui.UILayer {
for (var i = 0; i <= 9; i++) {
RES.getResAsync("curScoreNum" + i + "_png")
}
for (var i = 5; i <= 14; i++) {
for (var i = 5; i <= 15; i++) {
RES.getResAsync("ele" + i + "_png")
}
for (var i = 1; i <= 10; i++) {
......@@ -257,6 +258,11 @@ export default class MainBase extends eui.UILayer {
for (var i = 1; i <= 13; i++) {
RES.getResAsync("lineLight" + i + "_png")
}
//三个星星宝箱
RES.getResAsync("starbox1_png");
RES.getResAsync("starbox2_png");
RES.getResAsync("starbox3_png");
var arr = [
"redDoorBg", "blueDoorBg", "yellowDoorBg", "doorOpen", "doorClosed",
"rectLatWhite",
......@@ -422,7 +428,7 @@ export default class MainBase extends eui.UILayer {
// if (document.visibilityState == "visible") {
// if (getBgOn()) {
// if (getSoundOn()) {
// if (SceneCtrl.instance.currentScene instanceof MapScene)
// playBg();
// else if (SceneCtrl.instance.currentScene instanceof MainScene)
......@@ -458,7 +464,7 @@ export default class MainBase extends eui.UILayer {
stopGamebg();
}
window["webviewShow"] = () => {
if (getBgOn()) {
if (getSoundOn()) {
if (SceneCtrl.instance.currentScene instanceof MapScene)
playBg();
else if (SceneCtrl.instance.currentScene instanceof MainScene)
......
{"file":"albhtxxl.png","frames":{
"0":{"x":27,"y":36,"w":24,"h":34,"offX":0,"offY":0,"sourceW":24,"sourceH":34},
"1":{"x":78,"y":70,"w":18,"h":32,"offX":0,"offY":0,"sourceW":18,"sourceH":32},
"2":{"x":27,"y":72,"w":24,"h":33,"offX":0,"offY":0,"sourceW":24,"sourceH":33},
"3":{"x":53,"y":36,"w":23,"h":34,"offX":0,"offY":0,"sourceW":23,"sourceH":34},
"4":{"x":95,"y":0,"w":25,"h":32,"offX":0,"offY":0,"sourceW":25,"sourceH":32},
"5":{"x":53,"y":72,"w":23,"h":33,"offX":0,"offY":0,"sourceW":23,"sourceH":33},
"6":{"x":0,"y":36,"w":25,"h":34,"offX":0,"offY":0,"sourceW":25,"sourceH":34},
"7":{"x":78,"y":36,"w":23,"h":32,"offX":0,"offY":0,"sourceW":23,"sourceH":32},
"8":{"x":0,"y":72,"w":25,"h":34,"offX":0,"offY":0,"sourceW":25,"sourceH":34},
"9":{"x":68,"y":0,"w":25,"h":34,"offX":0,"offY":0,"sourceW":25,"sourceH":34},
"次":{"x":0,"y":0,"w":66,"h":34,"offX":0,"offY":0,"sourceW":67,"sourceH":34}}}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="MapSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect id="rectbg" width="750" height="1206"/>
<e:Scroller id="scroll" width="750" height="1624" x="0" y="0" scrollPolicyH="off" scrollPolicyV="on" locked="true">
<e:Scroller id="scroll" width="750" height="1624" x="0" y="0" scrollPolicyH="off" scrollPolicyV="on">
<e:Group id="scrollGroup">
</e:Group>
</e:Scroller>
<e:Group id="treasureboxBtn" y="-3.06" x="518.26" scaleX="1" scaleY="1">
<e:Image source="宝箱bg_png" y="22" x="3.75"/>
<e:Group x="41.08" y="35.48">
<e:Rect id="rect" width="124" height="45" x="0" y="0" visible="false"/>
<e:Image id="progressbg" source="progress2_png" y="0" x="0" visible="false"/>
<e:Image id="progressfront" source="progress1_png" y="0" x="0" visible="false"/>
<e:Image source="星星_png" verticalCenter="-2.5" x="-14.31"/>
<e:Label id="totalStarTxt" text="0/0" x="24.04" verticalAlign="middle" textAlign="left" size="22" verticalCenter="0.5" bold="true" fontFamily="FZY3JW"/>
</e:Group>
<e:Image id="box" source="宝箱_png" right="24" verticalCenter="9.5" anchorOffsetX="34" anchorOffsetY="34"/>
<e:Group id="boxiconWrapper" x="166.08" y="34.86" touchEnabled="false" touchChildren="false">
<e:Image x="8.32" y="0" source="iconbg_png"/>
<e:Label id="boxNumsTxt" text="0" x="-2.25" verticalAlign="middle" textAlign="center" size="18" width="46" y="3.64" fontFamily="FZY3JW"/>
</e:Group>
</e:Group>
<e:Group id="top" x="170.04" y="18.05">
<e:Image source="元宝bg_png" x="0" y="0"/>
<e:Label id="bloodTxt" text="5" x="3.96" y="22.84" width="49" verticalAlign="middle" textAlign="center" size="22" fontFamily="FZY3JW" bold="true"/>
<e:Label id="fullTxt" text="已满" x="57.96" y="22.34" width="82" verticalAlign="middle" textAlign="center" size="24" visible="false"/>
<e:Label id="goldTxt" text="0" x="247.23" y="24.94" width="88" verticalAlign="middle" textAlign="center" fontFamily="FZY3JW" size="22"/>
<e:Button id="bloodBtn" label="" x="147.13" y="15.35">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="goldBtn" label="" x="385.2" y="16.6" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="关闭 拷贝_png" source.down="关闭 拷贝_png" source.disabled="关闭 拷贝_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="countdown" text="00:00:00" x="63.64" y="24.94" verticalAlign="middle" textAlign="center" size="22" fontFamily="FZY3JW"/>
</e:Group>
<e:Button id="shopBtn" label="" x="613.08" y="174.01" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="道具_png" source.down="道具_png" source.disabled="道具_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="recordBtn" label="" x="594.14" y="175">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="recordbtn_png" source.down="recordbtn_png" source.disabled="recordbtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="wuhanGroup" y="325" right="30">
<e:Button label="" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="wuhanIcon_png" source.down="wuhanIcon_png" source.disabled="wuhanIcon_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group x="-24">
<e:Image id="wuhanTips" y="0" touchEnabled="false" source="dailingqu_png"/>
</e:Group>
</e:Group>
<e:Group id="tuiaGroup" y="325" right="30">
<e:Button label="" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="tuiaIcon_png" source.down="tuiaIcon_png" source.disabled="tuiaIcon_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group x="-24">
<e:Image id="tuiaTips" y="0" touchEnabled="false" source="dailingqu_png"/>
</e:Group>
</e:Group>
<e:Group id="friendBtn" x="-0.12" y="22.31" width="171" height="120">
<e:Image source="avatar_png" y="0" horizontalCenter="0"/>
<e:Group x="38.5" y="10">
<e:Image id="avatar" y="0" source="" width="96" height="96" x="0"/>
<e:Rect id="avatarMask" width="96" height="96" x="0" y="0" ellipseWidth="96" ellipseHeight="96"/>
<e:Group id="topcont" width="750" height="150" x="0" top="0">
<e:Image source="topban_png" horizontalCenter="0" y="0"/>
<e:BitmapLabel id="bloodTxt" width="164" height="48" x="120" y="32" text="次数 5" font="albhtxxl_fnt"/>
<e:BitmapLabel id="goldTxt" width="81" height="48" x="376" y="32" text="231" font="albhtxxl_fnt"/>
<e:Image id="exchangebtn" source="exchangebtn2_png" x="462" y="17"/>
<e:Group id="soundbtn" width="80" height="80" y="7" x="632">
<e:Image id="stopsoundimg" source="stopsoundbtn_png" scaleX="1" scaleY="1" x="10" y="9"/>
<e:Image id="opensoundimg" source="opensoundbtn_png" scaleX="1" scaleY="1" x="10" y="9"/>
</e:Group>
<e:Image source="namebg_png" horizontalCenter="-4" bottom="-4"/>
<e:Label id="nameTxt" text="La121233bel" y="91.5" size="20" horizontalCenter="1" fontFamily="FZY3JW"/>
</e:Group>
<e:Image id="adBtn" y="478" source="ad_icon_png" right="602" width="122" height="122" visible="false"/>
<e:Group id="signGroup" x="26.69" y="172.57">
<e:Group id="signGroup" x="26" y="172">
<e:Button id="signBtn" label="" x="0" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
......@@ -111,70 +31,18 @@
<e:Image id="sign_s2" source="map明日可领_png" x="0" y="0" visible="false"/>
</e:Group>
</e:Group>
<e:Group id="rankGroup" width="115" height="121" y="172" x="609">
<e:Image source="rankbtn_png" scaleX="1" scaleY="1"/>
</e:Group>
<e:Group id="turnGroup" width="115" height="121" x="609" y="322">
<e:Image source="turnpbtn_png"/>
<e:Image source="turnpbtnicon_png" x="-35" y="9"/>
</e:Group>
<e:Group id="settingsx" x="30" scaleX="1.4" scaleY="1.4" bottom="23" touchEnabled="false" locked="true">
<e:Group id="settingGroup" x="2" y="6.08" visible="false">
<e:Image id="settingbg" source="设置bg_png" y="0" x="0" scale9Grid="9,84,54,76" height="231"/>
<e:Button id="soundBtn" label="" y="59.65" horizontalCenter="0.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="声音_png" source.down="声音_png" source.disabled="声音_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="questionBtn" label="" y="109.41" horizontalCenter="0.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="问题_png" source.down="问题_png" source.disabled="问题_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="musicBtn" label="" y="14.36" horizontalCenter="0.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="音乐_png" source.down="音乐_png" source.disabled="音乐_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="musicOffBtn" label="" y="13.69" horizontalCenter="0.5" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="音乐关闭_png" source.down="音乐关闭_png" source.disabled="音乐关闭_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="soundOffBtn" label="" y="60.32" horizontalCenter="0.5" visible="false">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="声音关闭_png" source.down="声音关闭_png" source.disabled="声音关闭_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
<e:Button id="settingBtn" label="" y="162.34" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="设置_png" source.down="设置_png" source.disabled="设置_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
<e:Group id="boxLayer" x="0" y="0" visible="false">
<e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/>
<e:Group id="boxani">
</e:Group>
<e:Label text="点击开宝箱" y="791" size="37" horizontalCenter="0" bold="true"/>
</e:Group>
<w:Config id="16c89f4ae1a"/>
</e:Skin>
\ No newline at end of file
......@@ -37,7 +37,7 @@ import { ElementTargets } from '../something/uis/ElementTargets';
import { PropGuide } from '../something/uis/PropGuide';
import { ScoreProgress } from '../something/uis/ScoreProgress';
import { StepNumber } from '../something/uis/StepNumber';
import { getBgOn, getSoundOn, playSound, SoundType, stopBg, toggleSound } from '../soundCtrl';
import { getSoundOn, playSound, SoundType, stopBg, toggleSound } from '../soundCtrl';
import { playGameBg, toggleGameBg } from '../soundCtrl2';
import { createData } from '../startScene/StartScene';
import { DataManager } from './../../libs/tw/manager/DataManager';
......@@ -68,7 +68,6 @@ import { FesRedBombShowAni } from '../something/anisCall/FesRedBombShowAni';
import { RectsWaveAni } from '../something/anisCall/RectsWaveAni';
import { Door } from '../something/class/Door';
import Utils, { CouponJoinScene } from '../Utils';
import { Candy } from '../../../../../../../node_modules/@spark/guideact/types/something/class/Candy';
const aniClass = {
"BoomAni": BoomAni,
......@@ -461,7 +460,7 @@ export default class MainScene extends Scene {
} else {
this.soundBtn.source = "mainSoundBtnOff_png"
}
if (getBgOn()) {
if (getSoundOn()) {
this.musicBtn.source = "mainMusicBtnOn_png";
stopBg();
playGameBg();
......@@ -978,7 +977,7 @@ export default class MainScene extends Scene {
onTap_musicBtn() {
// toggleBg();
toggleGameBg();
if (getBgOn()) {
if (getSoundOn()) {
this.musicBtn.source = "mainMusicBtnOn_png"
} else {
this.musicBtn.source = "mainMusicBtnOff_png"
......
......@@ -13,8 +13,7 @@ import { loadSvga } from "../loadSvga";
import { getlogItem } from "../Main";
import setGlow from "../setGlow";
import setGray from "../setGray";
import { getBgOn, getSoundOn, playBg, toggleBg, toggleSound } from "../soundCtrl";
import { stopGamebg } from "../soundCtrl2";
import {getSoundOn, playBg, toggleBg, toggleSound } from "../soundCtrl";
import Utils from "../Utils";
import AvatarComp from "./AvatarComp";
import CountDown from "./CountDown";
......@@ -46,52 +45,14 @@ export default class MapScene extends Scene {
private inviteTimer: egret.Timer;
private cutTime: number;
pic:egret.Bitmap;
async start(data?) {
super.start();
//新增icon,还有埋点
this["wuhanGroup"].visible = false;
this["tuiaGroup"].visible = false;
NetManager.ins.getIconInfo((s, res) => {
//成功才显示,且有剩余次数remainAwardTimes
if (s && res.data && res.data.remainAwardTimes) {
this["tuiaGroup"].visible = true;
NetManager.ins.showLog(getlogItem(13))
this["tuiaGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(13))
NetManager.ins.getTuiaAd(
() => {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
this["tuiaGroup"].visible = false;
}
} else {
showToast("领取失败");
}
})
//关闭弹框
// window['TAIsdk'].iframeNode.remove()
// setTimeout(function () {
// window['TAIsdk'].iframeNode.src = ''
// })
// window['TAIsdk'].closeBtn.style.display = 'none'
},
() => {
showToast("活动未完成,无法领取奖励");
},
window["slotIdsTuia"][0]
)
}, this)
}
})
// const configData = DataManager.ins.getData('getConfig')
// const configDetData = configData.data.list ? configData.data.list : configData.data
// PanelCtrl.instance.show('RedBombAlert');
// NetManager.ins.hc_submit(()=>{
// // const submitData = DataManager.ins.getData('hc_submit').data;
......@@ -99,10 +60,10 @@ export default class MapScene extends Scene {
// },1,1,'','')
//隐藏一些icon 为了下面那些去掉
var icons = ["adBtn"]
for (var i = 0; i < icons.length; i++) {
this[icons[i]].visible = false;
}
// var icons = ["adBtn"]
// for (var i = 0; i < icons.length; i++) {
// this[icons[i]].visible = false;
// }
this.updateMyInfo();
......@@ -110,14 +71,7 @@ export default class MapScene extends Scene {
// this.updateAdData();
GDispatcher.dispatchEvent("getInviteInfo"); // 查询邀请信息,控制邀请有礼角标
this['avatar'].mask = this['avatarMask'];
if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg();
}
stopGamebg();
// this['avatar'].mask = this['avatarMask'];
NetManager.ins.getSignInfo(() => {
const panels = [];
const date = new Date();
......@@ -171,8 +125,8 @@ export default class MapScene extends Scene {
//滚动的背景变黑
this['rectbg'].height = this.stage.stageHeight;
//进度条的遮罩
this['progressfront'].mask = this['rect'];
this['rect'].scaleX = 0.5
// this['progressfront'].mask = this['rect'];
// this['rect'].scaleX = 0.5
//进度条文本发光
// setGlow(this['totalStarTxt'], 0x0083e8, 1);
......@@ -250,7 +204,7 @@ export default class MapScene extends Scene {
this.stage.once(egret.TouchEvent.TOUCH_TAP, () => {
if (!MapScene['firstPlayBgTag']) {
if (getBgOn()) {
if (getSoundOn()) {
playBg();
}
MapScene['firstPlayBgTag'] = true;
......@@ -310,6 +264,7 @@ export default class MapScene extends Scene {
}
updateMyInfo() {
return;
this['avatar'].visible = true;
this['nameTxt'].text = '';
......@@ -318,7 +273,6 @@ export default class MapScene extends Scene {
//注意dcustom里大小写
var nickName = getUrl("nickname");
if (nickName) this['nameTxt'].text = getNick(nickName);
}
updateSign() {
......@@ -332,6 +286,7 @@ export default class MapScene extends Scene {
}
updateAdData() {
return;
const hc_advert = DataManager.ins.getData('hc_advert').data || {};
let { mapAdvert } = hc_advert;
if (mapAdvert == null)
......@@ -427,6 +382,7 @@ export default class MapScene extends Scene {
}
updateBox() {
return;
const homeData = getHomeData();
if (homeData.canReceiveTreasureBoxNum <= 0)
setGray(this['box']);
......@@ -494,22 +450,22 @@ export default class MapScene extends Scene {
updateTimerView() {
//更新倒计时
if (this._countDown == null) {
this._countDown = new CountDown(this['countdown']);
}
// if (this._countDown == null) {
// this._countDown = new CountDown(this['countdown']);
// }
const data = getHomeData();
if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
this._countDown.stop();
this['fullTxt'].visible = true;
this['countdown'].visible = false;
} else {
const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000);
this._countDown.reset(left);
this['countdown'].visible = true;
this['fullTxt'].visible = false;
}
this['bloodTxt'].text = `${data.remainEnargy}`;
// if (data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
// this._countDown.stop();
// this['fullTxt'].visible = true;
// this['countdown'].visible = false;
// } else {
// const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000);
// this._countDown.reset(left);
// this['countdown'].visible = true;
// this['fullTxt'].visible = false;
// }
this['bloodTxt'].text = `${data.remainEnargy}`;
}
loadsvga(res) {
......@@ -537,6 +493,7 @@ export default class MapScene extends Scene {
* 查询邀请信息
*/
getInviteInfo() {
return;
const hc_advert = DataManager.ins.getData('hc_advert').data || {};
const { mapAdvert } = hc_advert;
// tslint:disable-next-line: cyclomatic-complexity
......@@ -627,6 +584,7 @@ export default class MapScene extends Scene {
// 倒计时
private inviteCutTimer() {
return;
const timer = this.convertTime(this.cutTime -= 1000);
if (timer.hour === "00"
&& timer.min === "00"
......@@ -669,37 +627,39 @@ export default class MapScene extends Scene {
// this['goldBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_goldBtn, this)
this['friendBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_friendBtn, this)
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_adBtn, this)
this['signBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_signBtn, this)
this['bloodBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_bloodBtn, this)
this['settingBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.toggleSettings, this)
this['shopBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_shopBtn, this)
this['questionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this);
this['box'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_boxLayer, this);
this['boxani'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_box, this);
this['soundBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_sound, this);
this['soundOffBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_sound, this);
this['musicOffBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_music, this);
this['musicBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_music, this);
this['recordBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
PanelCtrl.instance.show('bag');
}, this);
// this['friendBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_friendBtn, this)
// this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_adBtn, this)
this['signGroup'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_signBtn, this)
// this['bloodBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_bloodBtn, this)
// this['settingBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.toggleSettings, this)
// this['shopBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_shopBtn, this)
// this['questionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this);
// this['box'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_boxLayer, this);
// this['boxani'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_box, this);
this['soundbtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_sound, this);
// this['stopsoundimg'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_sound, this);
// this['musicOffBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_music, this);
// this['musicBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_music, this);
// this['recordBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// PanelCtrl.instance.show('bag');
// }, this);
// 消消乐查询信息
// GDispatcher.addEvent('getInviteInfo', this.getInviteInfo, this);
this["rankGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_friendBtn,this);
this["turnGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_turnGroup,this);
this["exchangebtn"].addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTap_exchangeBtn,this);
}
initSound() {
this['soundBtn'].visible = getSoundOn();
this['soundOffBtn'].visible = !getSoundOn();
this['musicBtn'].visible = getBgOn();
this['musicOffBtn'].visible = !getBgOn();
this['opensoundimg'].visible = getSoundOn();
this['stopsoundimg'].visible = !getSoundOn();
}
onTap_sound() {
this['soundBtn'].visible = !this['soundBtn'].visible;
this['soundOffBtn'].visible = !this['soundOffBtn'].visible;
this['opensoundimg'].visible = !this['opensoundimg'].visible;
this['stopsoundimg'].visible = !this['stopsoundimg'].visible;
toggleSound();
}
......@@ -891,6 +851,15 @@ export default class MapScene extends Scene {
});
})
}
//打开转盘
onTap_turnGroup(){
console.log("打开转盘");
}
//兑换
onTap_exchangeBtn(){
console.log("打开兑换");
}
}
export const getNick = (nickname, max = 4) => {
if (!nickname) return nickname;
......
......@@ -18,7 +18,6 @@ import { HairballBlackState } from "../states/HairballBlackState";
import { Tool } from "../Tool";
import { FestivalEle } from "./FestivalEle";
import {loadImageByUrl} from "../../../libs/new_wx/loadSpriteSheet";
/**
* 考虑到底继承白鹭的啥Component还是Container
* 坐标原点需要坐落在格子的中心点
......@@ -173,12 +172,10 @@ export class Element extends eui.Component {
async changeSource(source: string) {
// this.showImage.source = source;
var texture: egret.Texture;
if(this.type==ElementType.BLIND_BOX){
texture = await loadImageByUrl("//yun.duiba.com.cn/aurora/assets/730048e95b89906c3a8076b88910ab272bc47d6f.jpeg");
}else{
texture = RES.getRes(source);
if(this.type==ElementType.BLIND_BOX){
console.error('盲盒的',source,texture);
}
this.showImage.texture = texture
this.showImage.x = -texture.textureWidth / 2;
......
import { loadImageByUrl } from "../../../libs/new_wx/loadSpriteSheet";
import setGray from "../../setGray";
import Utils, { CouponJoinScene } from "../../Utils";
import { CurScoreNum } from "./CurScoreNum";
......@@ -127,29 +128,22 @@ export class ScoreProgress {
let starboxwid = 50;
let starboxhei = 50;
let starboxy = 25;
let starbox1x = 423;
let starbox2x = 498;
let starbox3x = 573;
this.starbox1 = new eui.Image();
this.starbox1.width = starboxwid;
this.starbox1.height = starboxhei;
p.addChild(this.starbox1);
this.starbox1.x = starbox1x;//-starboxwid/2;
this.starbox1.y = starboxy;
this.starbox2 = new eui.Image();
this.starbox2.width = starboxwid;
this.starbox2.height = starboxhei;
p.addChild(this.starbox2);
this.starbox2.x = starbox2x;//-starboxwid/2;
this.starbox2.y = starboxy;
this.starbox3 = new eui.Image();
this.starbox3.width = starboxwid;
this.starbox3.height = starboxhei;
p.addChild(this.starbox3);
this.starbox3.x = starbox3x;//-starboxwid/2;
this.starbox3.y = starboxy;
......@@ -169,16 +163,11 @@ export class ScoreProgress {
starbox2: eui.Image;
starbox3: eui.Image;
box1wid = 50;
box1hei = 50;
box2wid = 70;
box2hei = 70;
sbox1x = 423;
sbox2x = 498;
sbox3x = 573;
starwid = 46;
sboxy = 50;
sboxy = 35;
updateStarBox(data) {
this.starboxdata = data;
......@@ -196,17 +185,24 @@ export class ScoreProgress {
let data = this.starboxdata[idx];
let spx = this["sbox" + (idx + 1) + "x"];
let texurl = data == 2 ? "//yun.duiba.com.cn/aurora/assets/8312db117356184c07b0d67153ec67ba3ed16f9f.png" : "//yun.duiba.com.cn/aurora/assets/f565872fe14ec885c7a9935bc0cfc40515b81898.png";
sp.texture = await loadImageByUrl(texurl);
sp.width = data == 2 ? this.box2wid : this.box1wid;
sp.height = data == 2 ? this.box2hei : this.box1hei;
// let texurl = data == 2 ? "//yun.duiba.com.cn/aurora/assets/8312db117356184c07b0d67153ec67ba3ed16f9f.png" : "//yun.duiba.com.cn/aurora/assets/f565872fe14ec885c7a9935bc0cfc40515b81898.png";
sp.texture = RES.getRes("starbox"+(idx+1)+"_png");
// await loadImageByUrl(texurl);
// sp.width = data == 2 ? this.box2wid : this.box1wid;
// sp.height = data == 2 ? this.box2hei : this.box1hei;
sp.anchorOffsetX = sp.width / 2;
sp.anchorOffsetY = sp.height / 2;
sp.x = spx + this.starwid / 2;// - sp.width / 2;
sp.y = this.sboxy;// - sp.height / 2;
if(data==0){
setGray(sp);
}else{
sp.filters = [];
}
if (data == 1) {
if (!this["s" + (idx + 1) + "havetween"]) {
this["s" + (idx + 1) + "havetween"] = true;
......
......@@ -19,9 +19,9 @@ let loading = false;
export const getSoundOn = () => {
return soundOn
}
export const getBgOn = () => {
return bgOn
}
// export const getBgOn = () => {
// return bgOn
// }
export const toggleSound = () => {
soundOn = !soundOn;
......
import { getBgOn, toggleBgStatus } from "./soundCtrl";
import { getSoundOn, toggleBgStatus } from "./soundCtrl";
let bgChannel: egret.SoundChannel;
let loading = false;
export const toggleGameBg = () => {
toggleBgStatus();
const bgOn=getBgOn();
const bgOn=getSoundOn();
if (bgChannel) {
if (!bgOn) {
bgChannel.stop();
......
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