Commit 68423c83 authored by 邱旭's avatar 邱旭

换了点皮

parent 92754240
......@@ -3,8 +3,12 @@
<component name="ChangeListManager">
<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$/src/scene/PlayScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/PlayScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapUI.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapUI.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/libs/fyge.min.js.map1" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/libs/fyge.min.js1" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/handleLotS1.js" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/Lottie.ts" beforeDir="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/scene/map/CheckBtn.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -97,7 +101,7 @@
<recent name="$PROJECT_DIR$/lotties" />
</key>
</component>
<component name="RunManager" selected="npm.flushRes">
<component name="RunManager" selected="npm.dev">
<configuration name="build" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
......@@ -157,8 +161,8 @@
</list>
<recent_temporary>
<list>
<item itemvalue="npm.flushRes" />
<item itemvalue="npm.dev" />
<item itemvalue="npm.flushRes" />
<item itemvalue="npm.handleLotS" />
<item itemvalue="npm.buildTS" />
<item itemvalue="npm.build" />
......@@ -194,14 +198,7 @@
<workItem from="1617348724978" duration="4857000" />
<workItem from="1617673451602" duration="17243000" />
<workItem from="1617702978246" duration="12255000" />
<workItem from="1617847690167" duration="5213000" />
</task>
<task id="LOCAL-00022" summary="m">
<created>1613716046739</created>
<option name="number" value="00022" />
<option name="presentableId" value="LOCAL-00022" />
<option name="project" value="LOCAL" />
<updated>1613716046739</updated>
<workItem from="1617847690167" duration="5683000" />
</task>
<task id="LOCAL-00023" summary="m">
<created>1613719810975</created>
......@@ -539,7 +536,14 @@
<option name="project" value="LOCAL" />
<updated>1617853076796</updated>
</task>
<option name="localTasksCounter" value="71" />
<task id="LOCAL-00071" summary="换了点皮">
<created>1617853416092</created>
<option name="number" value="00071" />
<option name="presentableId" value="LOCAL-00071" />
<option name="project" value="LOCAL" />
<updated>1617853416092</updated>
</task>
<option name="localTasksCounter" value="72" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
var fs = require("fs");
var iconv = require('iconv-lite');
var path = require('path');
//用于处理带base64图片的lottie文件,取出图片,同名lottie文件夹,写入代码"./src/lotties/"中;
var pathName = "./lotties"
//读文件夹
var files = fs.readdirSync(pathName);
//对每个json文件作处理
files.forEach(function (lottiesFileName) {
//后缀不是json的,不处理
if (path.extname(lottiesFileName).indexOf(".json") < 0) return;
//读数据
var data = iconv.decode(fs.readFileSync(pathName + "/" + lottiesFileName), "utf-8");//GBK
//反序列化
data = JSON.parse(data);
//存图片
var assets = data.assets;
if (!assets || !assets.length) return;
//删除属性
delete data.assets;
var imgOutPath = pathName + "/" + data.nm
//建文件夹data.nm
if (!fs.existsSync(imgOutPath)) fs.mkdirSync(imgOutPath);
assets.forEach((e) => {
//没有base64数据
if (!e.p) return
let id = e.id;
let uuid = guid();
//存图片
var base64 = e.p.replace(/^data:image\/\w+;base64,/, "");//去掉图片base64码前面部分data:image/png;base64
var dataBuffer = new Buffer(base64, 'base64'); //把base64码转成buffer对象,
fs.writeFile(imgOutPath + "/" + uuid + ".png", dataBuffer, ()=>0);
//修改用到id的所有refId
data.layers.forEach((l) => { l.refId === id && (l.refId = uuid) })
})
//开始删东西
delete data.ddd;
//遍历删除图层东西
for (var i = 0; i < data.layers.length; i++) {
var l = data.layers[i];
//是否3d,后缀,sr,ap,开始时间,混合模式,特效
["ddd", "cl", "sr", "ao", "st", "bm", "ef"].forEach((e) => { delete l[e]; });
//ks删除
["o", "r", "p", "a", "s"].forEach((e) => {
var d = l.ks[e];
//ix不知道干嘛用,删了
delete d.ix;
//删除k里数据
if (d.k.length && typeof d.k[0] == "object") {
d.k.forEach((ee) => {
["i", "o", "ti", "to"].forEach((eee) => { delete ee[eee]; })
})
}
})
}
//导出代码到src的lotties文件夹,名字就是lottie动画名字,资源名字临时处理了,首页加载动画用图层的nm,bonustime用refid
var endPath = './src/lotties';
if (!fs.existsSync(endPath)) fs.mkdirSync(endPath);
//导出对象直接用lottie动画名字
var endFile = `export const ${data.nm} = ${JSON.stringify(data, "", "\t")}`
//文件名字用lottie动画名字
fs.writeFileSync(endPath + "/" + data.nm + ".ts", endFile);
})
function guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
This diff is collapsed.
......@@ -5,13 +5,10 @@ import { RES } from "../../module/RES";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { layers } from "../../module/views/layers";
import { changeScene, showToast } from "../../module/ctrls";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { MapScene } from "./map/MapScene";
import TextField = FYGE.TextField;
import Tween = FYGE.Tween;
import { MapScene } from "./map/MapScene";
import { PlayScene } from "./PlayScene";
import FrameAni = FYGE.FrameAni;
import Texture = FYGE.Texture;
export class LoadingScene extends Scene {
get groupNames() {
......
......@@ -9,8 +9,6 @@ import { RES } from "../../../module/RES";
import { Tools } from "../../Tools";
import { showPanel } from "../../../module/ctrls";
import { StartPanel } from "../../panels/StartPanel";
import { Lottie } from "../../Lottie";
import { CheckTip } from "../../lotties/checkTip";
export enum CHECK_TYPE {
COM, // 普通
......
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