Commit f6ecede4 authored by wildfirecode's avatar wildfirecode

1

parent 7dce9413
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<e:Label id="nums2Txt" text="888" size="26" bold="true" x="189.03" y="728.04" width="52" textAlign="center" textColor="0xc33700" verticalAlign="middle"/> <e:Label id="nums2Txt" text="888" size="26" bold="true" x="189.03" y="728.04" width="52" textAlign="center" textColor="0xc33700" verticalAlign="middle"/>
<e:Label id="nums1Txt" text="888" size="26" bold="true" x="358.99" y="728.04" width="52" textAlign="center" textColor="0xc33700" verticalAlign="middle"/> <e:Label id="nums1Txt" text="888" size="26" bold="true" x="358.99" y="728.04" width="52" textAlign="center" textColor="0xc33700" verticalAlign="middle"/>
<e:Label id="nums3Txt" text="888" size="26" bold="true" x="518.15" y="728.04" textAlign="center" width="52" textColor="0xc33700" verticalAlign="middle"/> <e:Label id="nums3Txt" text="888" size="26" bold="true" x="518.15" y="728.04" textAlign="center" width="52" textColor="0xc33700" verticalAlign="middle"/>
<e:Button id="closeBtn" label="" x="616" y="230"> <e:Button id="closeBtn" label="" x="614" y="252">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/> <e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......
...@@ -27,7 +27,7 @@ import { PassType } from '../something/enum/PassType'; ...@@ -27,7 +27,7 @@ import { PassType } from '../something/enum/PassType';
import { ElementTargetData } from '../something/interface/ElementTargetData'; import { ElementTargetData } from '../something/interface/ElementTargetData';
import { ScoreAni } from '../something/anis/ScoreAni'; import { ScoreAni } from '../something/anis/ScoreAni';
import { ScoreProgress } from '../something/uis/ScoreProgress'; import { ScoreProgress } from '../something/uis/ScoreProgress';
import { playSound, SoundType, toggleSound, toggleBg, getSoundOn, getBgOn } from '../soundCtrl'; import { playSound, SoundType, toggleSound, toggleBg, getSoundOn, getBgOn, stopBg } from '../soundCtrl';
import Scene from '../../libs/new_wx/components/Scene'; import Scene from '../../libs/new_wx/components/Scene';
import { showToast } from '../../libs/new_wx/ctrls/toastCtrl'; import { showToast } from '../../libs/new_wx/ctrls/toastCtrl';
import getResPath from '../../libs/new_tc/getResPath'; import getResPath from '../../libs/new_tc/getResPath';
...@@ -48,6 +48,7 @@ import { createData } from '../startScene/StartScene'; ...@@ -48,6 +48,7 @@ import { createData } from '../startScene/StartScene';
import { Loading2 } from '../something/uis/Loading2'; import { Loading2 } from '../something/uis/Loading2';
import { BonusTime } from '../something/uis/BonusTime'; import { BonusTime } from '../something/uis/BonusTime';
import { NetName } from '../../libs/tw/enum/NetName'; import { NetName } from '../../libs/tw/enum/NetName';
import { playGameBg } from '../soundCtrl2';
const aniClass = { const aniClass = {
"BoomAni": BoomAni, "BoomAni": BoomAni,
...@@ -197,6 +198,8 @@ export default class MainScene extends Scene { ...@@ -197,6 +198,8 @@ export default class MainScene extends Scene {
bonusTime: BonusTime; bonusTime: BonusTime;
start(data) { start(data) {
super.start(); super.start();
stopBg();
playGameBg();
//初始化索引信息 //初始化索引信息
Tool.init(); Tool.init();
//第几关 //第几关
......
...@@ -8,11 +8,12 @@ import { NetManager } from "../../libs/tw/manager/NetManager"; ...@@ -8,11 +8,12 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { getlogItem } from "../Main"; import { getlogItem } from "../Main";
import setGlow from "../setGlow"; import setGlow from "../setGlow";
import { playBg, toggleBg, toggleSound } from "../soundCtrl"; import { playBg, toggleBg, toggleSound, getBgOn, getSoundOn } from "../soundCtrl";
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 { readCache, GuideCon } from "./GuideCon"; import { readCache, GuideCon } from "./GuideCon";
import { stopGamebg } from "../soundCtrl2";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -25,7 +26,10 @@ export default class MapScene extends Scene { ...@@ -25,7 +26,10 @@ export default class MapScene extends Scene {
_data; _data;
async start(data?) { async start(data?) {
super.start(); super.start();
if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg();
}
stopGamebg();
if (!readCache()) { if (!readCache()) {
var guide = new GuideCon(); var guide = new GuideCon();
this.addChild(guide); this.addChild(guide);
...@@ -33,6 +37,8 @@ export default class MapScene extends Scene { ...@@ -33,6 +37,8 @@ export default class MapScene extends Scene {
console.log(guide) console.log(guide)
} }
this.initSound();
// window['gameover'] = ()=>{ // window['gameover'] = ()=>{
// NetManager.ins.hc_submit(() => { }, 1, 1, null, ''); // NetManager.ins.hc_submit(() => { }, 1, 1, null, '');
// NetManager.ins.getPlugOrderStatus(() => { }, 1, () => { return false }) // NetManager.ins.getPlugOrderStatus(() => { }, 1, () => { return false })
...@@ -251,6 +257,14 @@ export default class MapScene extends Scene { ...@@ -251,6 +257,14 @@ export default class MapScene extends Scene {
window.location.href = window['__link__'] window.location.href = window['__link__']
}, this); }, this);
} }
initSound(){
this['soundBtn'].visible = getSoundOn();
this['soundOffBtn'].visible = !getSoundOn();
this['musicBtn'].visible = getBgOn();
this['musicOffBtn'].visible = !getBgOn();
}
onTap_sound() { onTap_sound() {
this['soundBtn'].visible = !this['soundBtn'].visible; this['soundBtn'].visible = !this['soundBtn'].visible;
this['soundOffBtn'].visible = !this['soundOffBtn'].visible; this['soundOffBtn'].visible = !this['soundOffBtn'].visible;
......
...@@ -26,6 +26,13 @@ export const toggleBg = () => { ...@@ -26,6 +26,13 @@ export const toggleBg = () => {
} }
} }
export const stopBg = () => {
if (bgChannel) {
bgChannel.stop();
bgChannel = null;
}
};
export const playBg = async () => { export const playBg = async () => {
if (bgChannel) return; if (bgChannel) return;
if (loading) return; if (loading) return;
......
...@@ -16,6 +16,12 @@ export const toggleGameBg = () => { ...@@ -16,6 +16,12 @@ export const toggleGameBg = () => {
} }
} }
export const stopGamebg= ()=>{
if(!bgChannel)return;
bgChannel.stop();
bgChannel = null;
}
export const playGameBg = async () => { export const playGameBg = async () => {
if (bgChannel) return; if (bgChannel) return;
if (loading) return; if (loading) return;
......
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