Commit 86ab2670 authored by 邱旭's avatar 邱旭

m

parent 9d8779cd
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="0d3cb18d-e144-41a0-bc8b-4877c2e1fef1" name="默认的" comment=""> <list default="true" id="0d3cb18d-e144-41a0-bc8b-4877c2e1fef1" name="默认的" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/output.js" beforeDir="false" afterPath="$PROJECT_DIR$/output.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/resource/loadingScene/loadingBg.jpg" beforeDir="false" afterPath="$PROJECT_DIR$/resource/loadingScene/loadingBg.jpg" afterDir="false" />
<change beforePath="$PROJECT_DIR$/output.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/output.js.map" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/scene/LoadingScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/LoadingScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/NoEnergyPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/NoEnergyPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/StartPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/StartPanel.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -65,7 +63,7 @@ ...@@ -65,7 +63,7 @@
<recent name="$PROJECT_DIR$/lotties" /> <recent name="$PROJECT_DIR$/lotties" />
</key> </key>
</component> </component>
<component name="RunManager" selected="npm.buildTS"> <component name="RunManager" selected="npm.dev">
<configuration name="build" type="js.build_tools.npm" temporary="true" nameIsGenerated="true"> <configuration name="build" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" /> <package-json value="$PROJECT_DIR$/package.json" />
<command value="run" /> <command value="run" />
...@@ -118,10 +116,10 @@ ...@@ -118,10 +116,10 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="npm.dev" />
<item itemvalue="npm.buildTS" /> <item itemvalue="npm.buildTS" />
<item itemvalue="npm.build" /> <item itemvalue="npm.build" />
<item itemvalue="npm.flushRes" /> <item itemvalue="npm.flushRes" />
<item itemvalue="npm.dev" />
<item itemvalue="npm.copyJs" /> <item itemvalue="npm.copyJs" />
</list> </list>
</recent_temporary> </recent_temporary>
...@@ -137,7 +135,7 @@ ...@@ -137,7 +135,7 @@
<workItem from="1612576979459" duration="13000" /> <workItem from="1612576979459" duration="13000" />
<workItem from="1612577003915" duration="21094000" /> <workItem from="1612577003915" duration="21094000" />
<workItem from="1612662929222" duration="40609000" /> <workItem from="1612662929222" duration="40609000" />
<workItem from="1613698993022" duration="7731000" /> <workItem from="1613698993022" duration="11457000" />
</task> </task>
<task id="LOCAL-00001" summary="斐乐消消乐"> <task id="LOCAL-00001" summary="斐乐消消乐">
<created>1612581213298</created> <created>1612581213298</created>
...@@ -272,7 +270,14 @@ ...@@ -272,7 +270,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1613706865023</updated> <updated>1613706865023</updated>
</task> </task>
<option name="localTasksCounter" value="20" /> <task id="LOCAL-00020" summary="m">
<created>1613707149083</created>
<option name="number" value="00020" />
<option name="presentableId" value="LOCAL-00020" />
<option name="project" value="LOCAL" />
<updated>1613707149083</updated>
</task>
<option name="localTasksCounter" value="21" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
......
...@@ -4,9 +4,10 @@ import { ProgressBarS } from "../common/ProgressBarS"; ...@@ -4,9 +4,10 @@ import { ProgressBarS } from "../common/ProgressBarS";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { sendTbNet, TbNetName } from "../TaoBaoNet"; import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import { changeScene, showPanel, showToast } from "../../module/ctrls"; import { showToast } from "../../module/ctrls";
import { LotteryPanel } from "../panels/LotteryPanel"; import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { MapScene } from "./map/MapScene"; import TextField = FYGE.TextField;
import Tween = FYGE.Tween;
export class LoadingScene extends Scene { export class LoadingScene extends Scene {
get groupNames() { get groupNames() {
...@@ -14,6 +15,7 @@ export class LoadingScene extends Scene { ...@@ -14,6 +15,7 @@ export class LoadingScene extends Scene {
} }
progressBar: ProgressBarS; progressBar: ProgressBarS;
loadingTxt: TextField;
initUi() { initUi() {
//适配 //适配
...@@ -27,6 +29,32 @@ export class LoadingScene extends Scene { ...@@ -27,6 +29,32 @@ export class LoadingScene extends Scene {
//@ts-ignore 进度条托管 //@ts-ignore 进度条托管
this.progressBar = new ProgressBarS(pro); this.progressBar = new ProgressBarS(pro);
this.loadingTxt = this.addChild(Tools.getText(
`loading...`, 28, "#feeeea",
TEXT_ALIGN.CENTER, 750, 0, 841
));
this.dotTween = Tween.get(FYGE, { loop: true })
.to({}, 500)
.call(() => {
this.dotCount = ++this.dotCount % 3 || 3;
this.loadingTxt.text = `loading${this.strMul('.', this.dotCount)}`;
});
}
dotTween = null;
dotCount = 0;
/**
* string 乘法
* @param str
* @param by
*/
strMul(str, by) {
by = (by >> 0);
const t = (by > 1 ? this.strMul(str, by / 2) : '');
return t + (by % 2 ? t + str : t);
} }
async start() { async start() {
...@@ -65,16 +93,16 @@ export class LoadingScene extends Scene { ...@@ -65,16 +93,16 @@ export class LoadingScene extends Scene {
progressEvent(e: FYGE.Event) { progressEvent(e: FYGE.Event) {
let pro = e.data; let pro = e.data;
FYGE.Tween.get(this.progressBar, null, null, true) FYGE.Tween.get(this.progressBar, null, null, true)
.to({value: pro}, 2000/**(p-this.lastP)*/) .to({ value: pro }, 2000/**(p-this.lastP)*/)
.call(() => { .call(() => {
if (pro >= 1) { if (pro >= 1) {
this.removeEventListener(FYGE.Event.PROGRESS, this.progressEvent, this); this.removeEventListener(FYGE.Event.PROGRESS, this.progressEvent, this);
changeScene(MapScene, {from: "loading"}) // changeScene(MapScene, {from: "loading"});
// showPanel(LotteryPanel); // showPanel(LotteryPanel);
// changeScene(PlayScene, { chapter: 1 }); // changeScene(PlayScene, { chapter: 1 });
// changeScene(LotteryScene,{level:1}); // changeScene(LotteryScene,{level:1});
} }
}) });
// this.lastP=p // this.lastP=p
} }
...@@ -83,6 +111,8 @@ export class LoadingScene extends Scene { ...@@ -83,6 +111,8 @@ export class LoadingScene extends Scene {
// FYGE.Tween.removeTweens() // FYGE.Tween.removeTweens()
super.destroy() super.destroy()
//到时如果内存炸了,考虑销毁用过的贴图缓存,待测试,在RES里写个根据销毁组内贴图的方法 //到时如果内存炸了,考虑销毁用过的贴图缓存,待测试,在RES里写个根据销毁组内贴图的方法
Tween.removeTweenSelf(this.dotTween);
} }
} }
......
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