Commit 0f73eef7 authored by wildfirecode's avatar wildfirecode

1

parent 459fa35e
...@@ -226,6 +226,7 @@ export default class MainBase extends eui.UILayer { ...@@ -226,6 +226,7 @@ export default class MainBase extends eui.UILayer {
loadSvga(getResPath() + 'resource/assets/svgas/loading_animals.svga'), loadSvga(getResPath() + 'resource/assets/svgas/loading_animals.svga'),
loadSvga(getResPath() + 'resource/assets/svgas/loading_title.svga') loadSvga(getResPath() + 'resource/assets/svgas/loading_title.svga')
]); ]);
loadSvga(getResPath() + 'resource/assets/svgas/box.svga');
} }
catch (e) { catch (e) {
console.error(e); console.error(e);
......
...@@ -112,11 +112,7 @@ ...@@ -112,11 +112,7 @@
</e:Group> </e:Group>
<e:Group id="boxLayer" x="0" y="0" visible="false"> <e:Group id="boxLayer" x="0" y="0" visible="false">
<e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/> <e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/>
<e:Group id="boxani" x="19" y="251"> <e:Group id="boxani">
<e:Image id="lightbg" source="光 副本 4_png" y="0" x="0"/>
<e:Image id="boxFrame1" source="宝箱1_png" x="156" y="95"/>
<e:Image id="boxFrame2" source="宝箱2_png" x="69.06" y="32.7"/>
<e:Image id="boxFrame3" source="宝箱3_png" x="68.78" y="-30.72"/>
</e:Group> </e:Group>
</e:Group> </e:Group>
<w:Config id="16c89f4ae1a"/> <w:Config id="16c89f4ae1a"/>
......
...@@ -15,6 +15,8 @@ import MapTopPart from "./MapTopPart"; ...@@ -15,6 +15,8 @@ import MapTopPart from "./MapTopPart";
import { readCache, GuideCon } from "./GuideCon"; import { readCache, GuideCon } from "./GuideCon";
import { stopGamebg } from "../soundCtrl2"; import { stopGamebg } from "../soundCtrl2";
import setGray from "../setGray"; import setGray from "../setGray";
import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -30,6 +32,7 @@ export default class MapScene extends Scene { ...@@ -30,6 +32,7 @@ export default class MapScene extends Scene {
if (getBgOn() && MapScene['firstPlayBgTag'] == true) { if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
playBg(); playBg();
} }
stopGamebg(); stopGamebg();
if (!readCache()) { if (!readCache()) {
var guide = new GuideCon(); var guide = new GuideCon();
...@@ -289,33 +292,38 @@ export default class MapScene extends Scene { ...@@ -289,33 +292,38 @@ export default class MapScene extends Scene {
toggleBg(); toggleBg();
} }
onTap_boxLayer() { private _mc;
async onTap_boxLayer() {
NetManager.ins.clickLog(getlogItem(1)); NetManager.ins.clickLog(getlogItem(1));
const data = getHomeData(); const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) { if (data.canReceiveTreasureBoxNum > 0) {
this['boxLayer'].visible = true; this['boxLayer'].visible = true;
this['boxFrame1'].visible = true; this._mc = await loadSvga(getResPath() + 'resource/assets/svgas/box.svga', this['boxani']);
this['boxFrame2'].visible = false; this._mc.stop();
this['boxFrame3'].visible = false; this._mc.visible=false;
await wait(50);
this._mc.visible=true;
} }
} }
async playAni() { async playAni() {
this['boxFrame1'].visible = true; if (this._mc) {
this['boxFrame2'].visible = false; this._mc.gotoAndPlay(1, true);
this['boxFrame3'].visible = false; await this.onPlaySTOP();
await wait(1000 / 10); }
this['boxFrame1'].visible = false;
this['boxFrame2'].visible = true;
this['boxFrame3'].visible = false;
await wait(1000 / 10);
this['boxFrame1'].visible = false;
this['boxFrame2'].visible = false;
this['boxFrame3'].visible = true;
await wait(300);
this['boxLayer'].visible = false; this['boxLayer'].visible = false;
} }
async onPlaySTOP() {
return new Promise((r) => {
this._mc.once(egret.Event.COMPLETE, () => {
this._mc.stop();
r();
}, this);
});
}
async onTap_box() { async onTap_box() {
console.log(1) console.log(1)
// const data = getHomeData(); // const data = getHomeData();
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
], ],
"remainEnargy": 10, "remainEnargy": 10,
"askForEnergy": false, "askForEnergy": false,
"canReceiveTreasureBoxNum": 0, "canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 150 "nextRangeStarsNum": 150
} }
} }
\ No newline at end of file
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