2021-07-21 23:11:13 +08:00

7961 lines
356 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function (exports, Laya) {
'use strict';
class StringTool {
constructor() {
}
static toUpCase(str) {
return str.toUpperCase();
}
static toLowCase(str) {
return str.toLowerCase();
}
static toUpHead(str) {
var rst;
if (str.length <= 1)
return str.toUpperCase();
rst = str.charAt(0).toUpperCase() + str.substr(1);
return rst;
}
static toLowHead(str) {
var rst;
if (str.length <= 1)
return str.toLowerCase();
rst = str.charAt(0).toLowerCase() + str.substr(1);
return rst;
}
static packageToFolderPath(packageName) {
var rst;
rst = packageName.replace(".", "/");
return rst;
}
static insert(str, iStr, index) {
return str.substring(0, index) + iStr + str.substr(index);
}
static insertAfter(str, iStr, tarStr, isLast = false) {
var i;
if (isLast) {
i = str.lastIndexOf(tarStr);
}
else {
i = str.indexOf(tarStr);
}
if (i >= 0) {
return StringTool.insert(str, iStr, i + tarStr.length);
}
return str;
}
static insertBefore(str, iStr, tarStr, isLast = false) {
var i;
if (isLast) {
i = str.lastIndexOf(tarStr);
}
else {
i = str.indexOf(tarStr);
}
if (i >= 0) {
return StringTool.insert(str, iStr, i);
}
return str;
}
static insertParamToFun(funStr, params) {
var oldParam;
oldParam = StringTool.getParamArr(funStr);
var inserStr;
inserStr = params.join(",");
if (oldParam.length > 0) {
inserStr = "," + inserStr;
}
return StringTool.insertBefore(funStr, inserStr, ")", true);
}
static trim(str, vList = null) {
if (!vList) {
vList = [" ", "\r", "\n", "\t", String.fromCharCode(65279)];
}
var rst;
var i;
var len;
rst = str;
len = vList.length;
for (i = 0; i < len; i++) {
rst = StringTool.getReplace(rst, vList[i], "");
}
return rst;
}
static isEmpty(str) {
if (str.length < 1)
return true;
return StringTool.emptyStrDic.hasOwnProperty(str);
}
static trimLeft(str) {
var i;
i = 0;
var len;
len = str.length;
while (StringTool.isEmpty(str.charAt(i)) && i < len) {
i++;
}
if (i < len) {
return str.substr(i);
}
return "";
}
static trimRight(str) {
var i;
i = str.length - 1;
while (StringTool.isEmpty(str.charAt(i)) && i >= 0) {
i--;
}
var rst;
rst = str.substring(0, i);
if (i >= 0) {
return str.substring(0, i + 1);
}
return "";
}
static trimSide(str) {
var rst;
rst = StringTool.trimLeft(str);
rst = StringTool.trimRight(rst);
return rst;
}
static isOkFileName(fileName) {
if (StringTool.trimSide(fileName) == "")
return false;
var i, len;
len = fileName.length;
for (i = 0; i < len; i++) {
if (StringTool.specialChars[fileName.charAt(i)])
return false;
}
return true;
}
static trimButEmpty(str) {
return StringTool.trim(str, ["\r", "\n", "\t"]);
}
static removeEmptyStr(strArr) {
var i;
i = strArr.length - 1;
var str;
for (i = i; i >= 0; i--) {
str = strArr[i];
str = StringTool.trimSide(str);
if (StringTool.isEmpty(str)) {
strArr.splice(i, 1);
}
else {
strArr[i] = str;
}
}
return strArr;
}
static ifNoAddToTail(str, sign) {
if (str.indexOf(sign) >= 0) {
return str;
}
return str + sign;
}
static trimEmptyLine(str) {
var i;
var tLines;
var tLine;
tLines = str.split("\n");
for (i = tLines.length - 1; i >= 0; i--) {
tLine = tLines[i];
if (StringTool.isEmptyLine(tLine)) {
tLines.splice(i, 1);
}
}
return tLines.join("\n");
}
static isEmptyLine(str) {
str = StringTool.trim(str);
if (str == "")
return true;
return false;
}
static removeCommentLine(lines) {
var rst;
rst = [];
var i;
var tLine;
var adptLine;
i = 0;
var len;
var index;
len = lines.length;
while (i < len) {
adptLine = tLine = lines[i];
index = tLine.indexOf("/**");
if (index >= 0) {
adptLine = tLine.substring(0, index - 1);
StringTool.addIfNotEmpty(rst, adptLine);
while (i < len) {
tLine = lines[i];
index = tLine.indexOf("*/");
if (index >= 0) {
adptLine = tLine.substring(index + 2);
StringTool.addIfNotEmpty(rst, adptLine);
break;
}
i++;
}
}
else if (tLine.indexOf("//") >= 0) {
if (StringTool.trim(tLine).indexOf("//") == 0) ;
else {
StringTool.addIfNotEmpty(rst, adptLine);
}
}
else {
StringTool.addIfNotEmpty(rst, adptLine);
}
i++;
}
return rst;
}
static addIfNotEmpty(arr, str) {
if (!str)
return;
var tStr;
tStr = StringTool.trim(str);
if (tStr != "") {
arr.push(str);
}
}
static trimExt(str, vars) {
var rst;
rst = StringTool.trim(str);
var i;
var len;
len = vars.length;
for (i = 0; i < len; i++) {
rst = StringTool.getReplace(rst, vars[i], "");
}
return rst;
}
static getBetween(str, left, right, ifMax = false) {
if (!str)
return "";
if (!left)
return "";
if (!right)
return "";
var lId;
var rId;
lId = str.indexOf(left);
if (lId < 0)
return "";
if (ifMax) {
rId = str.lastIndexOf(right);
if (rId < lId)
return "";
}
else {
rId = str.indexOf(right, lId + 1);
}
if (rId < 0)
return "";
return str.substring(lId + left.length, rId);
}
static getSplitLine(line, split = " ") {
return line.split(split);
}
static getLeft(str, sign) {
var i;
i = str.indexOf(sign);
return str.substr(0, i);
}
static getRight(str, sign) {
var i;
i = str.indexOf(sign);
return str.substr(i + 1);
}
static delelteItem(arr) {
while (arr.length > 0) {
if (arr[0] == "") {
arr.shift();
}
else {
break;
}
}
}
static getWords(line) {
var rst = StringTool.getSplitLine(line);
StringTool.delelteItem(rst);
return rst;
}
static getLinesI(startLine, endLine, lines) {
var i;
var rst = [];
for (i = startLine; i <= endLine; i++) {
rst.push(lines[i]);
}
return rst;
}
static structfy(str, inWidth = 4, removeEmpty = true) {
if (removeEmpty) {
str = StringTool.trimEmptyLine(str);
}
var lines;
var tIn;
tIn = 0;
var tInStr;
tInStr = StringTool.getEmptyStr(0);
lines = str.split("\n");
var i;
var len;
var tLineStr;
len = lines.length;
for (i = 0; i < len; i++) {
tLineStr = lines[i];
tLineStr = StringTool.trimLeft(tLineStr);
tLineStr = StringTool.trimRight(tLineStr);
tIn += StringTool.getPariCount(tLineStr);
if (tLineStr.indexOf("}") >= 0) {
tInStr = StringTool.getEmptyStr(tIn * inWidth);
}
tLineStr = tInStr + tLineStr;
lines[i] = tLineStr;
tInStr = StringTool.getEmptyStr(tIn * inWidth);
}
return lines.join("\n");
}
static getEmptyStr(width) {
if (!StringTool.emptyDic.hasOwnProperty(width)) {
var i;
var len;
len = width;
var rst;
rst = "";
for (i = 0; i < len; i++) {
rst += " ";
}
StringTool.emptyDic[width] = rst;
}
return StringTool.emptyDic[width];
}
static getPariCount(str, inChar = "{", outChar = "}") {
var varDic;
varDic = {};
varDic[inChar] = 1;
varDic[outChar] = -1;
var i;
var len;
var tChar;
len = str.length;
var rst;
rst = 0;
for (i = 0; i < len; i++) {
tChar = str.charAt(i);
if (varDic.hasOwnProperty(tChar)) {
rst += varDic[tChar];
}
}
return rst;
}
static readInt(str, startI = 0) {
var rst;
rst = 0;
var tC;
var i;
var isBegin;
isBegin = false;
var len;
len = str.length;
for (i = startI; i < len; i++) {
tC = str.charAt(i);
if (Number(tC) > 0 || tC == "0") {
rst = 10 * rst + Number(tC);
if (rst > 0)
isBegin = true;
}
else {
if (isBegin)
return rst;
}
}
return rst;
}
static getReplace(str, oStr, nStr) {
if (!str)
return "";
var rst;
rst = str.replace(new RegExp(oStr, "g"), nStr);
return rst;
}
static getWordCount(str, findWord) {
var rg = new RegExp(findWord, "g");
return str.match(rg).length;
}
static getResolvePath(path, basePath) {
if (StringTool.isAbsPath(path)) {
return path;
}
var tSign;
tSign = "\\";
if (basePath.indexOf("/") >= 0) {
tSign = "/";
}
if (basePath.charAt(basePath.length - 1) == tSign) {
basePath = basePath.substr(0, basePath.length - 1);
}
var parentSign;
parentSign = ".." + tSign;
var tISign;
tISign = "." + tSign;
var pCount;
pCount = StringTool.getWordCount(path, parentSign);
path = StringTool.getReplace(path, parentSign, "");
path = StringTool.getReplace(path, tISign, "");
var i;
var len;
len = pCount;
for (i = 0; i < len; i++) {
basePath = StringTool.removeLastSign(path, tSign);
}
return basePath + tSign + path;
}
static isAbsPath(path) {
if (path.indexOf(":") >= 0)
return true;
return false;
}
static removeLastSign(str, sign) {
var iPos;
iPos = str.lastIndexOf(sign);
str = str.substring(0, iPos);
return str;
}
static getParamArr(str) {
var paramStr;
paramStr = StringTool.getBetween(str, "(", ")", true);
if (StringTool.trim(paramStr).length < 1)
return [];
return paramStr.split(",");
}
static copyStr(str) {
return str.substring(0);
}
static ArrayToString(arr) {
var rst;
rst = "[{items}]".replace(new RegExp("\\{items\\}", "g"), StringTool.getArrayItems(arr));
return rst;
}
static getArrayItems(arr) {
var rst;
if (arr.length < 1)
return "";
rst = StringTool.parseItem(arr[0]);
var i;
var len;
len = arr.length;
for (i = 1; i < len; i++) {
rst += "," + StringTool.parseItem(arr[i]);
}
return rst;
}
static parseItem(item) {
return "";
}
static initAlphaSign() {
if (StringTool.alphaSigns)
return;
StringTool.alphaSigns = {};
StringTool.addSign("a", "z", StringTool.alphaSigns);
StringTool.addSign("A", "Z", StringTool.alphaSigns);
StringTool.addSign("0", "9", StringTool.alphaSigns);
}
static addSign(ss, e, tar) {
var i;
var len;
var s;
s = ss.charCodeAt(0);
len = e.charCodeAt(0);
for (i = s; i <= len; i++) {
tar[String.fromCharCode(i)] = true;
console.log("add :" + String.fromCharCode(i));
}
}
static isPureAlphaNum(str) {
StringTool.initAlphaSign();
if (!str)
return true;
var i, len;
len = str.length;
for (i = 0; i < len; i++) {
if (!StringTool.alphaSigns[str.charAt(i)])
return false;
}
return true;
}
}
StringTool.emptyStrDic = {
" ": true,
"\r": true,
"\n": true,
"\t": true
};
StringTool.specialChars = { "*": true, "&": true, "%": true, "#": true, "?": true };
StringTool.emptyDic = {};
StringTool.alphaSigns = null;
class ObjectTools {
constructor() {
}
static getFlatKey(tKey, aKey) {
if (tKey == "")
return aKey;
return tKey + ObjectTools.sign + aKey;
}
static flatObj(obj, rst = null, tKey = "") {
rst = rst ? rst : {};
var key;
var tValue;
for (key in obj) {
if (obj[key] instanceof Object) {
ObjectTools.flatObj(obj[key], rst, ObjectTools.getFlatKey(tKey, key));
}
else {
tValue = obj[key];
rst[ObjectTools.getFlatKey(tKey, key)] = obj[key];
}
}
return rst;
}
static recoverObj(obj) {
var rst = {};
var tKey;
for (tKey in obj) {
ObjectTools.setKeyValue(rst, tKey, obj[tKey]);
}
return rst;
}
static differ(objA, objB) {
var tKey;
objA = ObjectTools.flatObj(objA);
objB = ObjectTools.flatObj(objB);
var rst = {};
for (tKey in objA) {
if (!objB.hasOwnProperty(tKey)) {
rst[tKey] = "被删除";
}
}
for (tKey in objB) {
if (objB[tKey] != objA[tKey]) {
rst[tKey] = { "pre": objA[tKey], "now": objB[tKey] };
}
}
return rst;
}
static traceDifferObj(obj) {
var key;
var tO;
for (key in obj) {
if (obj[key] instanceof String) {
console.log(key + ":", obj[key]);
}
else {
tO = obj[key];
console.log(key + ":", "now:", tO["now"], "pre:", tO["pre"]);
}
}
}
static setKeyValue(obj, flatKey, value) {
if (flatKey.indexOf(ObjectTools.sign) >= 0) {
var keys = flatKey.split(ObjectTools.sign);
var tKey;
while (keys.length > 1) {
tKey = keys.shift();
if (!obj[tKey]) {
obj[tKey] = {};
console.log("addKeyObj:", tKey);
}
obj = obj[tKey];
if (!obj) {
console.log("wrong flatKey:", flatKey);
return;
}
}
obj[keys.shift()] = value;
}
else {
obj[flatKey] = value;
}
}
static clearObj(obj) {
var key;
for (key in obj) {
delete obj[key];
}
}
static copyObjFast(obj) {
var jsStr;
jsStr = ObjectTools.getJsonString(obj);
return ObjectTools.getObj(jsStr);
}
static copyObj(obj) {
if (obj instanceof Array)
return ObjectTools.copyArr(obj);
var rst = {};
var key;
for (key in obj) {
if (obj[key] === null || obj[key] === undefined) {
rst[key] = obj[key];
}
else if (obj[key] instanceof Array) {
rst[key] = ObjectTools.copyArr(obj[key]);
}
else if (obj[key] instanceof Object) {
rst[key] = ObjectTools.copyObj(obj[key]);
}
else {
rst[key] = obj[key];
}
}
return rst;
}
static copyArr(arr) {
var rst;
rst = [];
var i, len;
len = arr.length;
for (i = 0; i < len; i++) {
rst.push(ObjectTools.copyObj(arr[i]));
}
return rst;
}
static concatArr(src, a) {
if (!a)
return src;
if (!src)
return a;
var i, len = a.length;
for (i = 0; i < len; i++) {
src.push(a[i]);
}
return src;
}
static insertArrToArr(src, insertArr, pos = 0) {
if (pos < 0)
pos = 0;
if (pos > src.length)
pos = src.length;
var preLen = src.length;
var i, len;
src.length += insertArr.length;
var moveLen;
moveLen = insertArr.length;
for (i = src.length - 1; i >= pos; i--) {
src[i] = src[i - moveLen];
}
len = insertArr.length;
for (i = 0; i < len; i++) {
src[pos + i] = insertArr[i];
}
return src;
}
static clearArr(arr) {
if (!arr)
return arr;
arr.length = 0;
return arr;
}
static removeFromArr(arr, item) {
var i, len;
len = arr.length;
for (i = 0; i < len; i++) {
if (arr[i] == item) {
arr[i].splice(i, 1);
return;
}
}
}
static setValueArr(src, v) {
src || (src = []);
src.length = 0;
return ObjectTools.concatArr(src, v);
}
static getFrom(rst, src, count) {
var i;
for (i = 0; i < count; i++) {
rst.push(src[i]);
}
return rst;
}
static getFromR(rst, src, count) {
var i;
for (i = 0; i < count; i++) {
rst.push(src.pop());
}
return rst;
}
static enableDisplayTree(dis) {
while (dis) {
dis.mouseEnabled = true;
dis = dis.parent;
}
}
static getJsonString(obj) {
var rst;
rst = JSON.stringify(obj);
return rst;
}
static getObj(jsonStr) {
var rst;
rst = JSON.parse(jsonStr);
return rst;
}
static getKeyArr(obj) {
var rst;
var key;
rst = [];
for (key in obj) {
rst.push(key);
}
return rst;
}
static getObjValues(dataList, key) {
var rst;
var i, len;
len = dataList.length;
rst = [];
for (i = 0; i < len; i++) {
rst.push(dataList[i][key]);
}
return rst;
}
static hasKeys(obj, keys) {
var i, len;
len = keys.length;
for (i = 0; i < len; i++) {
if (!obj.hasOwnProperty(keys[i]))
return false;
}
return true;
}
static copyValueByArr(tar, src, keys) {
var i, len = keys.length;
for (i = 0; i < len; i++) {
if (!(src[keys[i]] === null))
tar[keys[i]] = src[keys[i]];
}
}
static getNoSameArr(arr) {
var i, len;
var rst;
rst = [];
var tItem;
len = arr.length;
for (i = 0; i < len; i++) {
tItem = arr[i];
if (rst.indexOf(tItem) < 0) {
rst.push(tItem);
}
}
return rst;
}
static insertValue(tar, src) {
var key;
for (key in src) {
tar[key] = src[key];
}
}
static replaceValue(obj, replaceO) {
var key;
for (key in obj) {
if (replaceO.hasOwnProperty(obj[key])) {
obj[key] = replaceO[obj[key]];
}
if (obj[key] instanceof Object) {
ObjectTools.replaceValue(obj[key], replaceO);
}
}
}
static setKeyValues(items, key, value) {
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
items[i][key] = value;
}
}
static findItemPos(items, sign, value) {
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
if (items[i][sign] == value) {
return i;
}
}
return -1;
}
static setObjValue(obj, key, value) {
obj[key] = value;
return obj;
}
static setAutoTypeValue(obj, key, value) {
if (obj.hasOwnProperty(key)) {
if (ObjectTools.isNumber(obj[key])) {
obj[key] = parseFloat(value);
}
else {
obj[key] = value;
}
}
else {
obj[key] = value;
}
return obj;
}
static getAutoValue(value) {
var tFloat = parseFloat(value);
if (typeof (value) == "string") {
if (tFloat + "" === StringTool.trimSide(value))
return tFloat;
}
return value;
}
static isNumber(value) {
return (parseFloat(value) == value);
}
static isNaNS(value) {
return (value.toString() == "NaN");
}
static isNaN(value) {
if (typeof (value) == "number")
return false;
if (typeof (value) == "string") {
if (parseFloat(value).toString() != "NaN") {
return false;
}
}
return true;
}
static getStrTypedValue(value) {
if (value == "false") {
return false;
}
else if (value == "true") {
return true;
}
else if (value == "null") {
return null;
}
else if (value == "undefined") {
return null;
}
else {
return ObjectTools.getAutoValue(value);
}
}
static createKeyValueDic(dataList, keySign) {
var rst;
rst = {};
var i, len;
len = dataList.length;
var tItem;
var tKey;
for (i = 0; i < len; i++) {
tItem = dataList[i];
tKey = tItem[keySign];
rst[tKey] = tItem;
}
return rst;
}
}
ObjectTools.sign = "_";
class ClassTool {
constructor() {
}
static defineProperty(obj, name, des) {
Object.defineProperty(obj, name, des);
}
static getOwnPropertyDescriptor(obj, name) {
var rst;
rst = Object.getOwnPropertyDescriptor(obj, name);
return rst;
}
static getOwnPropertyDescriptors(obj) {
var rst;
rst = Object.getOwnPropertyDescriptors(obj);
return rst;
}
static getOwnPropertyNames(obj) {
var rst;
rst = Object.getOwnPropertyNames(obj);
return rst;
}
static getObjectGetSetKeys(obj, rst = null) {
if (!rst)
rst = [];
var keys;
keys = ClassTool.getOwnPropertyNames(obj);
var key;
for (key in keys) {
key = keys[key];
if (key.indexOf("_$get_") >= 0) {
key = key.replace("_$get_", "");
rst.push(key);
}
}
if (obj["__proto__"]) {
ClassTool.getObjectGetSetKeys(obj["__proto__"], rst);
}
return rst;
}
static getObjectDisplayAbleKeys(obj, rst = null) {
if (!rst)
rst = [];
for (let key in obj) {
let tValue = obj[key];
let tType = typeof (tValue);
if (key.charAt(0) == "_" || !this.displayTypes[tType])
continue;
rst.push(key);
}
let temp = obj;
while (temp) {
let descript = Object.getOwnPropertyDescriptors(temp);
for (let element in descript) {
let tValue = descript[element];
if (!tValue.get)
continue;
rst.push(element);
}
temp = Object.getPrototypeOf(temp);
}
ClassTool.getObjectGetSetKeys(obj, rst);
rst = ObjectTools.getNoSameArr(rst);
return rst;
}
static getClassName(tar) {
if (tar instanceof Function)
return tar.name;
return tar["constructor"].name;
}
static getNodeClassAndName(tar) {
if (!tar)
return "null";
var rst;
if (tar.name) {
rst = ClassTool.getClassName(tar) + "(" + tar.name + ")";
}
else {
rst = ClassTool.getClassName(tar);
}
return rst;
}
static getClassNameByClz(clz) {
return clz["name"];
}
static getClassByName(className) {
var rst;
rst = window["eval"](className);
return rst;
}
static createObjByName(className) {
var clz;
clz = ClassTool.getClassByName(className);
return new clz();
}
}
ClassTool.displayTypes = { "boolean": true, "number": true, "string": true };
class TraceTool {
constructor() { }
static closeAllLog() {
var logFun;
logFun = TraceTool.emptyLog;
Laya.Browser.window.console.log = logFun;
}
static emptyLog() {
}
static traceObj(obj) {
TraceTool.tempArr.length = 0;
var key;
for (key in obj) {
TraceTool.tempArr.push(key + ":" + obj[key]);
}
var rst;
rst = TraceTool.tempArr.join("\n");
console.log(rst);
return rst;
}
static traceObjR(obj) {
TraceTool.tempArr.length = 0;
var key;
for (key in obj) {
TraceTool.tempArr.push(obj[key] + ":" + key);
}
var rst;
rst = TraceTool.tempArr.join("\n");
console.log(rst);
return rst;
}
static traceSize(tar) {
TraceTool._debugtrace("Size: x:" + tar.x + " y:" + tar.y + " w:" + tar.width + " h:" + tar.height + " scaleX:" + tar.scaleX + " scaleY:" + tar.scaleY);
}
static traceSplit(msg) {
console.log("---------------------" + msg + "---------------------------");
}
static group(gName) {
console.group(gName);
}
static groupEnd() {
console.groupEnd();
}
static getCallStack(life = 1, s = 1) {
var caller;
caller = TraceTool.getCallStack;
caller = caller.caller.caller;
var msg;
msg = "";
while (caller && life > 0) {
if (s <= 0) {
msg += caller + "<-";
life--;
}
caller = caller.caller;
s--;
}
return msg;
}
static getCallLoc(index = 2) {
var loc;
try {
TraceTool.Erroer.i++;
}
catch (e) {
var arr;
arr = this.e.stack.replace(/Error\n/).split(/\n/);
if (arr[index]) {
loc = arr[index].replace(/^\s+|\s+$/, "");
}
else {
loc = "unknow";
}
}
return loc;
}
static traceCallStack() {
var loc;
try {
TraceTool.Erroer.i++;
}
catch (e) {
loc = this.e.stack;
}
console.log(loc);
return loc;
}
static getPlaceHolder(len) {
if (!TraceTool.holderDic.hasOwnProperty(len)) {
var rst;
rst = "";
var i;
for (i = 0; i < len; i++) {
rst += "-";
}
TraceTool.holderDic[len] = rst;
}
return TraceTool.holderDic[len];
}
static traceTree(tar, depth = 0, isFirst = true) {
if (isFirst) {
console.log("traceTree");
}
if (!tar)
return;
var i;
var len;
if (tar.numChildren < 1) {
console.log(tar);
return;
}
TraceTool.group(tar);
len = tar.numChildren;
depth++;
for (i = 0; i < len; i++) {
TraceTool.traceTree(tar.getChildAt(i), depth, false);
}
TraceTool.groupEnd();
}
static getClassName(tar) {
return tar["constructor"].name;
}
static traceSpriteInfo(tar, showBounds = true, showSize = true, showTree = true) {
if (!(tar instanceof Laya.Sprite)) {
console.log("not Sprite");
return;
}
if (!tar) {
console.log("null Sprite");
return;
}
TraceTool.traceSplit("traceSpriteInfo");
TraceTool._debugtrace(TraceTool.getClassName(tar) + ":" + tar.name);
if (showTree) {
TraceTool.traceTree(tar);
}
else {
console.log(tar);
}
if (showSize) {
TraceTool.traceSize(tar);
}
if (showBounds) {
console.log("bounds:" + tar.getBounds());
}
}
}
TraceTool.tempArr = [];
TraceTool.Erroer = null;
TraceTool.holderDic = {};
class CountTool {
constructor() {
this.data = {};
this.preO = {};
this.changeO = {};
}
reset() {
this.data = {};
this.count = 0;
}
add(name, num = 1) {
this.count++;
if (!this.data.hasOwnProperty(name)) {
this.data[name] = 0;
}
this.data[name] = this.data[name] + num;
}
getKeyCount(key) {
if (!this.data.hasOwnProperty(key)) {
this.data[key] = 0;
}
return this.data[key];
}
getKeyChange(key) {
if (!this.changeO[key])
return 0;
return this.changeO[key];
}
record() {
var key;
for (key in this.changeO) {
this.changeO[key] = 0;
}
for (key in this.data) {
if (!this.preO[key])
this.preO[key] = 0;
this.changeO[key] = this.data[key] - this.preO[key];
this.preO[key] = this.data[key];
}
}
getCount(dataO) {
var rst = 0;
var key;
for (key in dataO) {
rst += dataO[key];
}
return rst;
}
traceSelf(dataO = null) {
if (!dataO)
dataO = this.data;
var tCount;
tCount = this.getCount(dataO);
console.log("total:" + tCount);
return "total:" + tCount + "\n" + TraceTool.traceObj(dataO);
}
traceSelfR(dataO = null) {
if (!dataO)
dataO = this.data;
var tCount;
tCount = this.getCount(dataO);
console.log("total:" + tCount);
return "total:" + tCount + "\n" + TraceTool.traceObjR(dataO);
}
}
class RecInfo {
constructor() {
this.oX = 0;
this.oY = 0;
this.hX = 1;
this.hY = 0;
this.vX = 0;
this.vY = 1;
}
get x() {
return this.oX;
}
get y() {
return this.oY;
}
get width() {
return Math.sqrt((this.hX - this.oX) * (this.hX - this.oX) + (this.hY - this.oY) * (this.hY - this.oY));
}
get height() {
return Math.sqrt((this.vX - this.oX) * (this.vX - this.oX) + (this.vY - this.oY) * (this.vY - this.oY));
}
get rotation() {
return this.rotationRad / Math.PI * 180;
}
get rotationRad() {
var dx = this.hX - this.oX;
var dy = this.hY - this.oY;
return Math.atan2(dy, dx);
}
get rotationV() {
return this.rotationRadV / Math.PI * 180;
}
get rotationRadV() {
var dx = this.vX - this.oX;
var dy = this.vY - this.oY;
return Math.atan2(dy, dx);
}
initByPoints(oPoint, ePoint, vPoint) {
this.oX = oPoint.x;
this.oY = oPoint.y;
this.hX = ePoint.x;
this.hY = ePoint.y;
this.vX = vPoint.x;
this.vY = vPoint.y;
}
static createByPoints(oPoint, ePoint, vPoint) {
var rst;
rst = new RecInfo();
rst.initByPoints(oPoint, ePoint, vPoint);
return rst;
}
static getGlobalPoints(sprite, x, y) {
return sprite.localToGlobal(new Laya.Point(x, y));
}
static getGlobalRecInfo(sprite, x0 = 0, y0 = 0, x1 = 1, y1 = 0, x2 = 0, y2 = 1) {
return RecInfo.createByPoints(RecInfo.getGlobalPoints(sprite, x0, y0), RecInfo.getGlobalPoints(sprite, x1, y1), RecInfo.getGlobalPoints(sprite, x2, y2));
}
}
class SimpleResizer {
constructor() {
}
static setResizeAble(clickItem, tar, minWidth = 150, minHeight = 150) {
clickItem.on(Laya.Event.MOUSE_DOWN, null, SimpleResizer.onMouseDown, [tar, minWidth, minHeight]);
}
static onMouseDown(tar, minWidth, minHeight, e) {
SimpleResizer.clearEvents();
if (!tar)
return;
SimpleResizer.preMousePoint.setTo(Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
SimpleResizer.preTarSize.setTo(tar.width, tar.height);
SimpleResizer.preScale.setTo(1, 1);
var rTar;
rTar = tar;
while (rTar && rTar != Laya.Laya.stage) {
SimpleResizer.preScale.x *= rTar.scaleX;
SimpleResizer.preScale.y *= rTar.scaleY;
rTar = rTar.parent;
}
Laya.Laya.stage.on(Laya.Event.MOUSE_UP, null, SimpleResizer.onMouseMoveEnd);
Laya.Laya.timer.loop(100, null, SimpleResizer.onMouseMoving, [tar, minWidth, minHeight]);
}
static onMouseMoving(tar, minWidth, minHeight, e) {
var tWidth = (Laya.Laya.stage.mouseX - SimpleResizer.preMousePoint.x) / SimpleResizer.preScale.x + SimpleResizer.preTarSize.x;
var tHeight = (Laya.Laya.stage.mouseY - SimpleResizer.preMousePoint.y) / SimpleResizer.preScale.y + SimpleResizer.preTarSize.y;
tar.width = tWidth > minWidth ? tWidth : minWidth;
tar.height = tHeight > minHeight ? tHeight : minHeight;
}
static onMouseMoveEnd(e) {
SimpleResizer.clearEvents();
}
static clearEvents() {
Laya.Laya.timer.clear(null, SimpleResizer.onMouseMoving);
Laya.Laya.stage.off(Laya.Event.MOUSE_UP, null, SimpleResizer.onMouseMoveEnd);
}
}
SimpleResizer.preMousePoint = new Laya.Point();
SimpleResizer.preTarSize = new Laya.Point();
SimpleResizer.preScale = new Laya.Point();
class DisControlTool {
constructor() {
}
static getObjectsUnderPoint(sprite, x, y, rst = null, filterFun = null) {
rst = rst ? rst : [];
if (filterFun != null && !filterFun(sprite))
return rst;
if (sprite.getBounds().contains(x, y)) {
rst.push(sprite);
var tempP = new Laya.Point();
tempP.setTo(x, y);
tempP = sprite.fromParentPoint(tempP);
x = tempP.x;
y = tempP.y;
for (var i = sprite._children.length - 1; i > -1; i--) {
var child = sprite._children[i];
if (child instanceof Laya.Sprite)
DisControlTool.getObjectsUnderPoint(child, x, y, rst, filterFun);
}
}
return rst;
}
static getObjectsUnderGlobalPoint(sprite, filterFun = null) {
var point = new Laya.Point();
point.setTo(Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
if (sprite.parent)
point = sprite.parent.globalToLocal(point);
return DisControlTool.getObjectsUnderPoint(sprite, point.x, point.y, null, filterFun);
}
static findFirstObjectsUnderGlobalPoint() {
var disList;
disList = DisControlTool.getObjectsUnderGlobalPoint(Laya.Laya.stage);
if (!disList)
return null;
var i, len;
var tDis;
len = disList.length;
for (i = len - 1; i >= 0; i--) {
tDis = disList[i];
if (tDis && tDis.numChildren < 1) {
return tDis;
}
}
return tDis;
}
static visibleAndEnableObjFun(tar) {
return tar.visible && tar.mouseEnabled;
}
static visibleObjFun(tar) {
return tar.visible;
}
static getMousePoint(sprite) {
var point = new Laya.Point();
point.setTo(Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
point = sprite.globalToLocal(point);
return point;
}
static isChildE(parent, child) {
if (!parent)
return false;
while (child) {
if (child.parent == parent)
return true;
child = child.parent;
}
return false;
}
static isInTree(pNode, child) {
return pNode == child || DisControlTool.isChildE(pNode, child);
}
static setTop(tar) {
if (tar && tar.parent) {
var tParent;
tParent = tar.parent;
tParent.setChildIndex(tar, tParent.numChildren - 1);
}
}
static clearItemRelativeInfo(item) {
var Nan = "NaN";
item.getLayout().left = Nan;
item.getLayout().right = Nan;
item.getLayout().top = Nan;
item.getLayout().bottom = Nan;
}
static swap(tarA, tarB) {
if (tarA == tarB)
return;
var iA;
iA = tarA.parent.getChildIndex(tarA);
var iB;
iB = tarB.parent.getChildIndex(tarB);
var bP;
bP = tarB.parent;
tarA.parent.addChildAt(tarB, iA);
bP.addChildAt(tarA, iB);
}
static insertToTarParent(tarA, tars, after = false) {
var tIndex;
var parent;
if (!tarA)
return;
parent = tarA.parent;
if (!parent)
return;
tIndex = parent.getChildIndex(tarA);
if (after)
tIndex++;
DisControlTool.insertToParent(parent, tars, tIndex);
}
static insertToParent(parent, tars, index = -1) {
if (!parent)
return;
if (index < 0)
index = parent.numChildren;
var i, len;
len = tars.length;
for (i = 0; i < len; i++) {
DisControlTool.transParent(tars[i], parent);
parent.addChildAt(tars[i], index);
}
}
static transParent(tar, newParent) {
if (!tar || !newParent)
return;
if (!tar.parent)
return;
var preParent;
preParent = tar.parent;
var pos;
pos = new Laya.Point(tar.x, tar.y);
pos = preParent.localToGlobal(pos);
pos = newParent.globalToLocal(pos);
tar.pos(pos.x, pos.y);
}
static transPoint(nowParent, tarParent, point) {
point = nowParent.localToGlobal(point);
point = tarParent.globalToLocal(point);
return point;
}
static removeItems(itemList) {
var i, len;
len = itemList.length;
for (i = 0; i < len; i++) {
itemList[i].removeSelf();
}
}
static addItems(itemList, parent) {
var i, len;
len = itemList.length;
for (i = 0; i < len; i++) {
parent.addChild(itemList[i]);
}
}
static getAllChild(tar) {
if (!tar)
return [];
var i;
var len;
var rst = [];
len = tar.numChildren;
for (i = 0; i < len; i++) {
rst.push(tar.getChildAt(i));
}
return rst;
}
static upDis(child) {
if (child && child.parent) {
var tParent;
tParent = child.parent;
var newIndex;
newIndex = tParent.getChildIndex(child) + 1;
if (newIndex >= tParent.numChildren) {
newIndex = tParent.numChildren - 1;
}
console.log("setChildIndex:" + newIndex);
tParent.setChildIndex(child, newIndex);
}
}
static downDis(child) {
if (child && child.parent) {
var tParent;
tParent = child.parent;
var newIndex;
newIndex = tParent.getChildIndex(child) - 1;
if (newIndex < 0)
newIndex = 0;
console.log("setChildIndex:" + newIndex);
tParent.setChildIndex(child, newIndex);
}
}
static setResizeAbleEx(node) {
var clickItem;
clickItem = node.getChildByName("resizeBtn");
if (clickItem) {
SimpleResizer.setResizeAble(clickItem, node);
}
}
static setResizeAble(node) {
node.on(Laya.Event.CLICK, null, DisControlTool.resizeHandler, [node]);
}
static setDragingItem(dragBar, tar) {
dragBar.on(Laya.Event.MOUSE_DOWN, null, DisControlTool.dragingHandler, [tar]);
tar.on(Laya.Event.DRAG_END, null, DisControlTool.dragingEnd, [tar]);
}
static dragingHandler(tar) {
if (tar) {
tar.startDrag();
}
}
static dragingEnd(tar) {
DisControlTool.intFyDisPos(tar);
console.log(tar.x, tar.y);
}
static showToStage(dis, offX = 0, offY = 0) {
var rec = dis.getBounds();
dis.x = Laya.Laya.stage.mouseX + offX;
dis.y = Laya.Laya.stage.mouseY + offY;
if (dis.x + rec.width > Laya.Laya.stage.width) {
dis.x -= rec.width + offX;
}
if (dis.y + rec.height > Laya.Laya.stage.height) {
dis.y -= rec.height + offY;
}
DisControlTool.intFyDisPos(dis);
}
static intFyDisPos(dis) {
if (!dis)
return;
dis.x = Math.round(dis.x);
dis.y = Math.round(dis.y);
}
static showOnly(disList, showItem) {
var i, len;
len = disList.length;
for (i = 0; i < len; i++) {
disList[i].visible = disList[i] == showItem;
}
}
static showOnlyByIndex(disList, index) {
DisControlTool.showOnly(disList, disList[index]);
}
static addOnly(disList, showItem, parent) {
var i, len;
len = disList.length;
for (i = 0; i < len; i++) {
if (disList[i] != showItem) {
disList[i].removeSelf();
}
else {
parent.addChild(disList[i]);
}
}
}
static addOnlyByIndex(disList, index, parent) {
DisControlTool.addOnly(disList, disList[index], parent);
}
}
DisControlTool.tempP = new Laya.Point();
class Rect extends Laya.Sprite {
constructor() {
super();
this.recWidth = 10;
this.drawMe();
}
drawMe() {
var g;
g = this.graphics;
g.clear();
g.drawRect(0, 0, this.recWidth, this.recWidth, "#22ff22");
this.size(this.recWidth, this.recWidth);
}
posTo(x, y) {
this.x = x - this.recWidth * 0.5;
this.y = y - this.recWidth * 0.5;
}
}
class ValueChanger {
constructor() {
this.preValue = 0;
}
get value() {
if (this.target) {
this._tValue = this.target[this.key];
}
return this._tValue;
}
set value(nValue) {
this._tValue = nValue;
if (this.target) {
this.target[this.key] = nValue;
}
}
get dValue() {
return this.value - this.preValue;
}
get scaleValue() {
return this.value / this.preValue;
}
record() {
this.preValue = this.value;
}
showValueByAdd(addValue) {
this.value = this.preValue + addValue;
}
showValueByScale(scale) {
this.value = this.preValue * scale;
}
recover() {
this.value = this.preValue;
}
dispose() {
this.target = null;
}
static create(target, key) {
var rst;
rst = new ValueChanger();
rst.target = target;
rst.key = key;
return rst;
}
}
class ArrowLine extends Laya.Sprite {
constructor(sign = "X") {
super();
this.lineLen = 160;
this.arrowLen = 10;
this.lenControl = new Rect();
this.rotationControl = new Rect();
this.sign = "Y";
this.lenChanger = ValueChanger.create(this, "lineLen");
this.lenControlXChanger = ValueChanger.create(this.lenControl, "x");
this._isMoving = false;
this.sign = sign;
this.addChild(this.lenControl);
this.addChild(this.rotationControl);
this.lenControl.on(Laya.Event.MOUSE_DOWN, this, this.controlMouseDown);
this.drawMe();
}
drawMe() {
var g;
g = this.graphics;
g.clear();
g.drawLine(0, 0, this.lineLen, 0, "#ffff00");
g.drawLine(this.lineLen, 0, this.lineLen - this.arrowLen, -this.arrowLen, "#ff0000");
g.drawLine(this.lineLen, 0, this.lineLen - this.arrowLen, this.arrowLen, "#ff0000");
g.fillText(this.sign, 50, -5, "", "#ff0000", "left");
if (this._isMoving && this._targetChanger) {
g.fillText(this._targetChanger.key + ":" + this._targetChanger.value.toFixed(2), this.lineLen - 15, -25, "", "#ffff00", "center");
}
this.lenControl.posTo(this.lineLen - 15, 0);
this.rotationControl.posTo(this.lineLen + 10, 0);
this.size(this.arrowLen, this.lineLen);
}
set targetChanger(changer) {
if (this._targetChanger) {
this._targetChanger.dispose();
}
this._targetChanger = changer;
}
get targetChanger() {
return this._targetChanger;
}
clearMoveEvents() {
Laya.Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
Laya.Laya.stage.off(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
}
controlMouseDown(e) {
this.clearMoveEvents();
this.lenControlXChanger.record();
this.lenChanger.record();
if (this.targetChanger) {
this.targetChanger.record();
}
this._isMoving = true;
Laya.Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
Laya.Laya.stage.on(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
}
stageMouseMove(e) {
this.lenControlXChanger.value = this.mouseX;
this.lenChanger.showValueByScale(this.lenControlXChanger.scaleValue);
if (this.targetChanger) {
this.targetChanger.showValueByScale(this.lenControlXChanger.scaleValue);
}
this.drawMe();
}
stageMouseUp(e) {
this._isMoving = false;
this.noticeChange();
this.clearMoveEvents();
this.lenControlXChanger.recover();
this.lenChanger.recover();
this.drawMe();
}
noticeChange() {
var dLen;
dLen = this.lenChanger.dValue;
console.log("lenChange:", dLen);
}
}
class Axis extends Laya.Sprite {
constructor() {
super();
this.xAxis = new ArrowLine("X");
this.yAxis = new ArrowLine("Y");
this.controlBox = new Rect();
this._lenType = [["width", "height"],
["scaleX", "scaleY"]];
this._type = 1;
this._point = new Laya.Point();
this.oPoint = new Laya.Point();
this.myRotationChanger = ValueChanger.create(this, "rotation");
this.targetRotationChanger = ValueChanger.create(null, "rotation");
this.stageMouseRotationChanger = new ValueChanger();
this.mouseEnabled = true;
this.size(1, 1);
this.initMe();
this.xAxis.rotationControl.on(Laya.Event.MOUSE_DOWN, this, this.controlMouseDown);
this.yAxis.rotationControl.on(Laya.Event.MOUSE_DOWN, this, this.controlMouseDown);
this.controlBox.on(Laya.Event.MOUSE_DOWN, this, this.controlBoxMouseDown);
this.on(Laya.Event.DRAG_MOVE, this, this.dragging);
}
set target(tar) {
this._target = tar;
this.updateChanges();
}
updateChanges() {
if (this._target) {
var params;
params = this._lenType[this._type];
this.xAxis.targetChanger = ValueChanger.create(this._target, params[0]);
this.yAxis.targetChanger = ValueChanger.create(this._target, params[1]);
}
}
set type(lenType) {
this._type = lenType;
this.updateChanges();
}
get type() {
return this._type;
}
switchType() {
this._type++;
this._type = this._type % this._lenType.length;
this.type = this._type;
}
controlBoxMouseDown(e) {
this.startDrag();
}
dragging() {
if (this._target) {
this._point.setTo(this.x, this.y);
DisControlTool.transPoint(this.parent, this._target.parent, this._point);
this._target.pos(this._point.x, this._point.y);
}
}
get target() {
return this._target;
}
initMe() {
this.addChild(this.xAxis);
this.addChild(this.yAxis);
this.yAxis.rotation = 90;
this.addChild(this.controlBox);
this.controlBox.posTo(0, 0);
}
clearMoveEvents() {
Laya.Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
Laya.Laya.stage.off(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
}
controlMouseDown(e) {
this.targetRotationChanger.target = this.target;
this.clearMoveEvents();
this.oPoint.setTo(0, 0);
this.myRotationChanger.record();
this.oPoint = this.localToGlobal(this.oPoint);
this.stageMouseRotationChanger.value = this.getStageMouseRatation();
this.stageMouseRotationChanger.record();
this.targetRotationChanger.record();
Laya.Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
Laya.Laya.stage.on(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
}
getStageMouseRatation() {
return Laya.MathUtil.getRotation(this.oPoint.x, this.oPoint.y, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
}
stageMouseMove(e) {
this.stageMouseRotationChanger.value = this.getStageMouseRatation();
var dRotation;
dRotation = -this.stageMouseRotationChanger.dValue;
if (this.target) {
this.targetRotationChanger.showValueByAdd(dRotation);
}
else {
this.myRotationChanger.showValueByAdd(dRotation);
}
}
stageMouseUp(e) {
this.noticeChange();
this.clearMoveEvents();
}
noticeChange() {
console.log("rotate:", -this.stageMouseRotationChanger.dValue);
}
}
class DisController {
constructor() {
DisController.init();
this.arrowAxis = new Axis();
this.arrowAxis.mouseEnabled = true;
}
static init() {
if (DisController._container) {
DisControlTool.setTop(DisController._container);
return;
}
DisController._container = new Laya.Sprite();
DisController._container.mouseEnabled = true;
Laya.Laya.stage.addChild(DisController._container);
}
set target(target) {
this._target = target;
if (target) {
DisController._container.addChild(this.arrowAxis);
Laya.Laya.timer.loop(100, this, this.updateMe);
}
else {
this.arrowAxis.removeSelf();
Laya.Laya.timer.clear(this, this.updateMe);
}
this.arrowAxis.target = target;
this.updateMe();
}
get target() {
return this._target;
}
set type(lenType) {
this.arrowAxis.type = lenType;
}
get type() {
return this.arrowAxis.type;
}
switchType() {
this.arrowAxis.switchType();
}
updateMe() {
if (!this._target)
return;
this.recInfo = RecInfo.getGlobalRecInfo(this._target, 0, 0, 1, 0, 0, 1);
console.log("rotation:", this.recInfo.rotation);
console.log("pos:", this.recInfo.x, this.recInfo.y);
console.log("scale:", this.recInfo.width, this.recInfo.height);
this.arrowAxis.x = this.recInfo.x;
this.arrowAxis.y = this.recInfo.y;
this.arrowAxis.rotation = this.recInfo.rotation;
this.arrowAxis.yAxis.rotation = this.recInfo.rotationV - this.recInfo.rotation;
}
static get I() {
if (!DisController._instance) {
DisController._instance = new DisController();
}
return DisController._instance;
}
static set I(value) {
DisController._instance = value;
}
}
class DTrace {
constructor() {
}
static getArgArr(arg) {
var rst;
rst = [];
var i, len = arg.length;
for (i = 0; i < len; i++) {
rst.push(arg[i]);
}
return rst;
}
static dTrace(...arg) {
arg = DTrace.getArgArr(arg);
arg.push(TraceTool.getCallLoc(2));
console.log.apply(console, arg);
var str;
str = arg.join(" ");
}
static timeStart(sign) {
console.time(sign);
}
static timeEnd(sign) {
console.timeEnd(sign);
}
static traceTable(data) {
console.table(data);
}
}
class RunProfile {
constructor() {
}
static run(funName, callLen = 3) {
var tCount;
if (!RunProfile.infoDic.hasOwnProperty(funName)) {
RunProfile.infoDic[funName] = new CountTool();
}
tCount = RunProfile.infoDic[funName];
var msg;
msg = TraceTool.getCallLoc(callLen) + "\n" + TraceTool.getCallStack(1, callLen - 3);
tCount.add(msg);
if (RunProfile._runShowDic[funName]) {
console.log("Create:" + funName);
console.log(msg);
}
}
static showClassCreate(funName) {
RunProfile._runShowDic[funName] = true;
}
static hideClassCreate(funName) {
RunProfile._runShowDic[funName] = false;
}
static getRunInfo(funName) {
var rst;
rst = RunProfile.infoDic[funName];
return RunProfile.infoDic[funName];
}
static runTest(fun, count, sign = "runTest") {
DTrace.timeStart(sign);
var i;
for (i = 0; i < count; i++) {
fun();
}
DTrace.timeEnd(sign);
}
static runTest2(fun, count, sign = "runTest") {
var preTime;
preTime = Laya.Browser.now();
var i;
for (i = 0; i < count; i++) {
fun();
}
return Laya.Browser.now() - preTime;
}
}
RunProfile.infoDic = {};
RunProfile._runShowDic = {};
class WalkTools {
constructor() {
}
static walkTarget(target, fun, _this = null) {
fun.apply(_this, [target]);
var i;
var len;
var tChild;
len = target.numChildren;
for (i = 0; i < len; i++) {
tChild = target.getChildAt(i);
WalkTools.walkTarget(tChild, fun, tChild);
}
}
static walkTargetEX(target, fun, _this = null, filterFun = null) {
if (filterFun != null && !filterFun(target))
return;
fun.apply(_this, [target]);
var i;
var len;
var tChild;
var childs;
childs = target._children;
len = childs.length;
for (i = 0; i < len; i++) {
tChild = childs[i];
WalkTools.walkTarget(tChild, fun, tChild);
}
}
static walkChildren(target, fun, _this = null) {
if (!target || target.numChildren < 1)
return;
WalkTools.walkArr(DisControlTool.getAllChild(target), fun, _this);
}
static walkArr(arr, fun, _this = null) {
if (!arr)
return;
var i;
var len;
len = arr.length;
for (i = 0; i < len; i++) {
fun.apply(_this, [arr[i], i]);
}
}
}
class DebugInfoLayer extends Laya.Sprite {
constructor() {
super();
this.nodeRecInfoLayer = new Laya.Sprite();
this.lineLayer = new Laya.Sprite();
this.txtLayer = new Laya.Sprite();
this.popLayer = new Laya.Sprite();
this.graphicLayer = new Laya.Sprite();
this.cacheViewLayer = new Laya.Sprite();
this.nodeRecInfoLayer.name = "nodeRecInfoLayer";
this.lineLayer.name = "lineLayer";
this.txtLayer.name = "txtLayer";
this.popLayer.name = "popLayer";
this.graphicLayer.name = "graphicLayer";
this.cacheViewLayer.name = "cacheViewLayer";
this.addChild(this.lineLayer);
this.addChild(this.cacheViewLayer);
this.addChild(this.nodeRecInfoLayer);
this.addChild(this.txtLayer);
this.addChild(this.popLayer);
this.addChild(this.graphicLayer);
DebugInfoLayer.I = this;
this.zOrder = 999;
Laya.Laya.stage.on(Laya.Event.DOUBLE_CLICK, this, this.setTop);
}
static init() {
if (!DebugInfoLayer.I) {
new DebugInfoLayer();
Laya.Laya.stage.addChild(DebugInfoLayer.I);
}
}
setTop() {
DisControlTool.setTop(this);
}
isDebugItem(sprite) {
return DisControlTool.isInTree(this, sprite);
}
}
class IDTools {
constructor() {
this.tID = 1;
}
getID() {
return this.tID++;
}
static getAID() {
return IDTools._ID.getID();
}
static idObjE(obj, sign = "default") {
if (obj[IDTools.idSign])
return obj;
if (!sign) {
sign = "default";
}
if (!IDTools._idDic[sign]) {
IDTools._idDic[sign] = new IDTools();
}
obj[IDTools.idSign] = IDTools._idDic[sign].getAID();
return obj;
}
static setObjID(obj, id) {
obj[IDTools.idSign] = id;
return obj;
}
static idObj(obj) {
if (obj[IDTools.idSign])
return obj;
obj[IDTools.idSign] = IDTools.getAID();
return obj;
}
static getObjID(obj) {
if (!obj)
return -1;
return obj[IDTools.idSign];
}
}
IDTools._ID = new IDTools();
IDTools._idDic = { "default": new IDTools() };
IDTools.idSign = "_M_id_";
class NodeInfosItem extends Laya.Sprite {
constructor() {
super();
this._infoTxt = new Laya.Text();
this._infoTxt.color = "#ff0000";
this._infoTxt.bgColor = "#00ff00";
this._infoTxt.fontSize = 12;
}
static init() {
if (!NodeInfosItem.NodeInfoContainer) {
DebugInfoLayer.init();
NodeInfosItem.NodeInfoContainer = DebugInfoLayer.I;
Laya.Laya.stage.addChild(NodeInfosItem.NodeInfoContainer);
}
}
static getNodeInfoByNode(node) {
IDTools.idObj(node);
var key;
key = IDTools.getObjID(node);
if (!NodeInfosItem._nodeInfoDic[key]) {
NodeInfosItem._nodeInfoDic[key] = new NodeInfosItem();
}
return NodeInfosItem._nodeInfoDic[key];
}
static hideAllInfos() {
var key;
var tInfo;
for (key in NodeInfosItem._nodeInfoDic) {
tInfo = NodeInfosItem._nodeInfoDic[key];
tInfo.removeSelf();
}
NodeInfosItem.clearRelations();
}
removeSelf() {
this._infoTxt.removeSelf();
return super.removeSelf();
}
showToUI() {
NodeInfosItem.NodeInfoContainer.nodeRecInfoLayer.addChild(this);
this._infoTxt.removeSelf();
NodeInfosItem.NodeInfoContainer.txtLayer.addChild(this._infoTxt);
this.findOkPos();
}
randomAPos(r) {
this._infoTxt.x = this.x + Laya.Laya.stage.width * Math.random();
this._infoTxt.y = this.y + r * Math.random();
}
findOkPos() {
var len;
len = 20;
this.randomAPos(len);
return;
}
isPosOk() {
var tParent;
tParent = NodeInfosItem.NodeInfoContainer.nodeRecInfoLayer;
var i, len;
var cList;
cList = tParent._children;
len = cList.length;
var tChild;
var mRec;
mRec = this._infoTxt.getBounds();
if (mRec.x < 0)
return false;
if (mRec.y < 0)
return false;
if (mRec.right > Laya.Laya.stage.width)
return false;
for (i = 0; i < len; i++) {
tChild = cList[i];
if (tChild == this._infoTxt)
continue;
if (mRec.intersects(tChild.getBounds()))
return false;
}
return true;
}
static showNodeInfo(node) {
var nodeInfo;
nodeInfo = NodeInfosItem.getNodeInfoByNode(node);
nodeInfo.showInfo(node);
nodeInfo.showToUI();
}
static showDisInfos(node) {
var _node;
_node = node;
if (!node)
return;
while (node) {
NodeInfosItem.showNodeInfo(node);
node = node.parent;
}
DisControlTool.setTop(NodeInfosItem.NodeInfoContainer);
NodeInfosItem.apdtTxtInfoPoss(_node);
NodeInfosItem.updateRelations();
}
static apdtTxtInfoPoss(node) {
var disList;
disList = [];
while (node) {
disList.push(node);
node = node.parent;
}
var i, len;
var tInfo;
var tTxt;
len = disList.length;
var xPos;
xPos = Laya.Laya.stage.width - 150;
var heightLen;
heightLen = 100;
node = disList[0];
if (node) {
tInfo = NodeInfosItem.getNodeInfoByNode(node);
if (tInfo) {
tTxt = tInfo._infoTxt;
xPos = Laya.Laya.stage.width - tTxt.width - 10;
heightLen = tTxt.height + 10;
}
}
disList = disList.reverse();
for (i = 0; i < len; i++) {
node = disList[i];
tInfo = NodeInfosItem.getNodeInfoByNode(node);
if (tInfo) {
tTxt = tInfo._infoTxt;
tTxt.pos(xPos, heightLen * i);
}
}
}
static clearRelations() {
var g;
g = NodeInfosItem.NodeInfoContainer.lineLayer.graphics;
g.clear();
}
static updateRelations() {
var g;
g = NodeInfosItem.NodeInfoContainer.lineLayer.graphics;
g.clear();
var key;
var tInfo;
for (key in NodeInfosItem._nodeInfoDic) {
tInfo = NodeInfosItem._nodeInfoDic[key];
if (tInfo.parent) {
g.drawLine(tInfo.x, tInfo.y, tInfo._infoTxt.x, tInfo._infoTxt.y, "#0000ff");
}
}
}
static getNodeValue(node, key) {
var rst;
NodeInfosItem._nodePoint.setTo(0, 0);
switch (key) {
case "x":
rst = node["x"] + " (g:" + node.localToGlobal(NodeInfosItem._nodePoint).x + ")";
break;
case "y":
rst = node["y"] + " (g:" + node.localToGlobal(NodeInfosItem._nodePoint).y + ")";
break;
default:
rst = node[key];
}
return rst;
}
showInfo(node) {
this._tar = node;
if (!node)
return;
NodeInfosItem._txts.length = 0;
var i, len;
var tKey;
len = NodeInfosItem.showValues.length;
if (node.name) {
NodeInfosItem._txts.push(ClassTool.getClassName(node) + "(" + node.name + ")");
}
else {
NodeInfosItem._txts.push(ClassTool.getClassName(node));
}
for (i = 0; i < len; i++) {
tKey = NodeInfosItem.showValues[i];
NodeInfosItem._txts.push(tKey + ":" + NodeInfosItem.getNodeValue(node, tKey));
}
this._infoTxt.text = NodeInfosItem._txts.join("\n");
this.graphics.clear();
var pointList;
pointList = node._getBoundPointsM(true);
if (!pointList || pointList.length < 1)
return;
pointList = Laya.GrahamScan.pListToPointList(pointList, true);
WalkTools.walkArr(pointList, node.localToGlobal, node);
pointList = Laya.GrahamScan.pointListToPlist(pointList);
NodeInfosItem._disBoundRec = Laya.Rectangle._getWrapRec(pointList, NodeInfosItem._disBoundRec);
this.graphics.drawRect(0, 0, NodeInfosItem._disBoundRec.width, NodeInfosItem._disBoundRec.height, null, "#00ffff");
this.pos(NodeInfosItem._disBoundRec.x, NodeInfosItem._disBoundRec.y);
}
fresh() {
this.showInfo(this._tar);
}
clearMe() {
this._tar = null;
}
recover() {
Laya.Pool.recover("NodeInfosItem", this);
}
}
NodeInfosItem.showValues = ["x", "y", "scaleX", "scaleY", "width", "height", "visible", "mouseEnabled"];
NodeInfosItem._nodeInfoDic = {};
NodeInfosItem._disBoundRec = new Laya.Rectangle();
NodeInfosItem._txts = [];
NodeInfosItem._nodePoint = new Laya.Point();
class NodeInfoPanel extends Laya.Sprite {
constructor() {
super();
this._stateDic = {};
this.isWorkState = false;
}
static init() {
if (!NodeInfoPanel.I) {
NodeInfoPanel.I = new NodeInfoPanel();
NodeInfosItem.init();
}
}
showDisInfo(node) {
this.recoverNodes();
NodeInfosItem.showDisInfos(node);
this.showOnly(node);
this.isWorkState = true;
}
showOnly(node) {
if (!node)
return;
this.hideBrothers(node);
this.showOnly(node.parent);
}
recoverNodes() {
NodeInfosItem.hideAllInfos();
var key;
var data;
var tTar;
for (key in this._stateDic) {
data = this._stateDic[key];
tTar = data["target"];
if (tTar) {
try {
tTar.visible = data.visible;
}
catch (e) {
}
}
}
this.isWorkState = false;
}
hideOtherChain(node) {
if (!node)
return;
while (node) {
this.hideBrothers(node);
node = node.parent;
}
}
hideChilds(node) {
if (!node)
return;
var i, len;
var cList;
cList = node._children;
len = cList.length;
var tChild;
for (i = 0; i < len; i++) {
tChild = cList[i];
if (tChild == NodeInfosItem.NodeInfoContainer)
continue;
this.saveNodeInfo(tChild);
tChild.visible = false;
}
}
hideBrothers(node) {
if (!node)
return;
var p;
p = node.parent;
if (!p)
return;
var i, len;
var cList;
cList = p._children;
len = cList.length;
var tChild;
for (i = 0; i < len; i++) {
tChild = cList[i];
if (tChild == NodeInfosItem.NodeInfoContainer)
continue;
if (tChild != node) {
this.saveNodeInfo(tChild);
tChild.visible = false;
}
}
}
saveNodeInfo(node) {
IDTools.idObj(node);
if (this._stateDic.hasOwnProperty(IDTools.getObjID(node)))
return;
var data;
data = {};
data.target = node;
data.visible = node.visible;
this._stateDic[IDTools.getObjID(node)] = data;
}
recoverNodeInfo(node) {
IDTools.idObj(node);
if (this._stateDic.hasOwnProperty(IDTools.getObjID(node))) {
var data;
data = this._stateDic[IDTools.getObjID(node)];
node["visible"] = data.visible;
}
}
}
class NodeConsts {
constructor() {
}
}
NodeConsts.defaultFitlerStr = "x,y,width,height,scaleX,scaleY,alpha,renderCost";
NodeConsts.RenderCostMaxTime = 3000;
class RenderAnalyser {
constructor() {
this.timeDic = {};
this.resultDic = {};
this.countDic = {};
this.resultCountDic = {};
this.nodeDic = {};
this.isWorking = false;
this.working = true;
}
static get I() {
if (!RenderAnalyser._instance) {
RenderAnalyser._instance = new RenderAnalyser();
}
return RenderAnalyser._instance;
}
static set I(value) {
RenderAnalyser._instance = value;
}
render(sprite, time) {
this.addTime(sprite, time);
}
addTime(sprite, time) {
IDTools.idObj(sprite);
var key;
key = IDTools.getObjID(sprite);
if (!this.timeDic.hasOwnProperty(key)) {
this.timeDic[key] = 0;
}
this.timeDic[key] = this.timeDic[key] + time;
if (!this.countDic.hasOwnProperty(key)) {
this.countDic[key] = 0;
}
this.countDic[key] = this.countDic[key] + 1;
this.nodeDic[key] = sprite;
}
getTime(sprite) {
IDTools.idObj(sprite);
var key;
key = IDTools.getObjID(sprite);
if (!this.resultDic[key])
return 0;
return this.resultDic[key];
}
getCount(sprite) {
IDTools.idObj(sprite);
var key;
key = IDTools.getObjID(sprite);
return this.resultCountDic[key];
}
reset() {
var key;
for (key in this.timeDic) {
this.timeDic[key] = 0;
this.countDic[key] = 0;
}
ObjectTools.clearObj(this.nodeDic);
}
updates() {
ObjectTools.clearObj(this.resultDic);
ObjectTools.insertValue(this.resultDic, this.timeDic);
ObjectTools.clearObj(this.resultCountDic);
ObjectTools.insertValue(this.resultCountDic, this.countDic);
this.reset();
}
set working(v) {
this.isWorking = v;
if (v) {
Laya.Laya.timer.loop(NodeConsts.RenderCostMaxTime, this, this.updates);
}
else {
Laya.Laya.timer.clear(this, this.updates);
}
}
}
class NodeUtils {
constructor() {
}
static getFilterdTree(sprite, keys) {
if (!keys)
keys = NodeUtils.defaultKeys;
var me;
me = {};
var key;
var i, len;
len = keys.length;
for (i = 0; i < len; i++) {
key = keys[i];
me[key] = sprite[key];
}
var cList;
var tChild;
cList = sprite._children;
len = cList.length;
var mClist;
mClist = [];
for (i = 0; i < len; i++) {
tChild = cList[i];
mClist.push(NodeUtils.getFilterdTree(tChild, keys));
}
me.childs = mClist;
return me;
}
static getNodeValue(node, key) {
var rst;
if (node instanceof Laya.Sprite) {
var tNode;
tNode = node;
switch (key) {
case "gRec":
rst = NodeUtils.getGRec(tNode).toString();
break;
case "gAlpha":
rst = NodeUtils.getGAlpha(tNode) + "";
break;
case "cmdCount":
rst = NodeUtils.getNodeCmdCount(tNode) + "";
break;
case "cmdAll":
rst = NodeUtils.getNodeCmdTotalCount(tNode) + "";
break;
case "nodeAll":
rst = "" + NodeUtils.getNodeCount(tNode);
break;
case "nodeVisible":
rst = "" + NodeUtils.getNodeCount(tNode, true);
break;
case "nodeRender":
rst = "" + NodeUtils.getRenderNodeCount(tNode);
break;
case "nodeReCache":
rst = "" + NodeUtils.getReFreshRenderNodeCount(tNode);
break;
case "renderCost":
rst = "" + RenderAnalyser.I.getTime(tNode);
break;
case "renderCount":
rst = "" + RenderAnalyser.I.getCount(tNode);
break;
default:
rst = node[key] + "";
}
}
else {
rst = node[key] + "";
}
return rst;
}
static getPropertyDesO(tValue, keys) {
if (!keys)
keys = NodeUtils.defaultKeys;
var rst = {};
if (typeof (tValue) == 'object') {
rst.label = "" + ClassTool.getNodeClassAndName(tValue);
}
else {
rst.label = "" + tValue;
}
rst.type = "";
rst.path = tValue;
rst.childs = [];
rst.isDirectory = false;
var key;
var i, len;
var tChild;
if (tValue instanceof Laya.Node) {
rst.des = ClassTool.getNodeClassAndName(tValue);
rst.isDirectory = true;
len = keys.length;
for (i = 0; i < len; i++) {
key = keys[i];
tChild = NodeUtils.getPropertyDesO(tValue[key], keys);
if (tValue.hasOwnProperty(key)) {
tChild.label = "" + key + ":" + tChild.des;
}
else {
tChild.label = "" + key + ":" + NodeUtils.getNodeValue(tValue, key);
}
rst.childs.push(tChild);
}
key = "_children";
tChild = NodeUtils.getPropertyDesO(tValue[key], keys);
tChild.label = "" + key + ":" + tChild.des;
tChild.isChilds = true;
rst.childs.push(tChild);
}
else if (tValue instanceof Array) {
rst.des = "Array[" + tValue.length + "]";
rst.isDirectory = true;
var tList;
tList = tValue;
len = tList.length;
for (i = 0; i < len; i++) {
tChild = NodeUtils.getPropertyDesO(tList[i], keys);
tChild.label = "" + i + ":" + tChild.des;
rst.childs.push(tChild);
}
}
else if (typeof (tValue) == 'object') {
rst.des = ClassTool.getNodeClassAndName(tValue);
rst.isDirectory = true;
for (key in tValue) {
tChild = NodeUtils.getPropertyDesO(tValue[key], keys);
tChild.label = "" + key + ":" + tChild.des;
rst.childs.push(tChild);
}
}
else {
rst.des = "" + tValue;
}
rst.hasChild = rst.childs.length > 0;
return rst;
}
static adptShowKeys(keys) {
var i, len;
len = keys.length;
for (i = len - 1; i >= 0; i--) {
keys[i] = StringTool.trimSide(keys[i]);
if (keys[i].length < 1) {
keys.splice(i, 1);
}
}
return keys;
}
static getNodeTreeData(sprite, keys) {
NodeUtils.adptShowKeys(keys);
var treeO;
treeO = NodeUtils.getPropertyDesO(sprite, keys);
var treeArr;
treeArr = [];
NodeUtils.getTreeArr(treeO, treeArr);
return treeArr;
}
static getTreeArr(treeO, arr, add = true) {
if (add)
arr.push(treeO);
var tArr = treeO.childs;
var i, len = tArr.length;
for (i = 0; i < len; i++) {
if (!add) {
tArr[i].nodeParent = null;
}
else {
tArr[i].nodeParent = treeO;
}
if (tArr[i].isDirectory) {
NodeUtils.getTreeArr(tArr[i], arr);
}
else {
arr.push(tArr[i]);
}
}
}
static traceStage() {
console.log(NodeUtils.getFilterdTree(Laya.Laya.stage, null));
console.log("treeArr:", NodeUtils.getNodeTreeData(Laya.Laya.stage, null));
}
static getNodeCount(node, visibleRequire = false) {
if (visibleRequire) {
if (!node.visible)
return 0;
}
var rst;
rst = 1;
var i, len;
var cList;
cList = node._children;
len = cList.length;
for (i = 0; i < len; i++) {
rst += NodeUtils.getNodeCount(cList[i], visibleRequire);
}
return rst;
}
static getGVisible(node) {
while (node) {
if (!node.visible)
return false;
node = node.parent;
}
return true;
}
static getGAlpha(node) {
var rst;
rst = 1;
while (node) {
rst *= node.alpha;
node = node.parent;
}
return rst;
}
static getGPos(node) {
var point;
point = new Laya.Point();
node.localToGlobal(point);
return point;
}
static getGRec(node) {
var pointList;
pointList = node._getBoundPointsM(true);
if (!pointList || pointList.length < 1)
return Laya.Rectangle.TEMP.setTo(0, 0, 0, 0);
pointList = Laya.GrahamScan.pListToPointList(pointList, true);
WalkTools.walkArr(pointList, node.localToGlobal, node);
pointList = Laya.GrahamScan.pointListToPlist(pointList);
var _disBoundRec;
_disBoundRec = Laya.Rectangle._getWrapRec(pointList, _disBoundRec);
return _disBoundRec;
}
static getGGraphicRec(node) {
var pointList;
pointList = node.getGraphicBounds()._getBoundPoints();
if (!pointList || pointList.length < 1)
return Laya.Rectangle.TEMP.setTo(0, 0, 0, 0);
pointList = Laya.GrahamScan.pListToPointList(pointList, true);
WalkTools.walkArr(pointList, node.localToGlobal, node);
pointList = Laya.GrahamScan.pointListToPlist(pointList);
var _disBoundRec;
_disBoundRec = Laya.Rectangle._getWrapRec(pointList, _disBoundRec);
return _disBoundRec;
}
static getNodeCmdCount(node) {
var rst;
if (node.graphics) {
if (node.graphics.cmds) {
rst = node.graphics.cmds.length;
}
else {
if (node.graphics._one) {
rst = 1;
}
else {
rst = 0;
}
}
}
else {
rst = 0;
}
return rst;
}
static getNodeCmdTotalCount(node) {
var rst;
var i, len;
var cList;
cList = node._children;
len = cList.length;
rst = NodeUtils.getNodeCmdCount(node);
for (i = 0; i < len; i++) {
rst += NodeUtils.getNodeCmdTotalCount(cList[i]);
}
return rst;
}
static getRenderNodeCount(node) {
if (node.cacheAs != "none")
return 1;
var rst;
var i, len;
var cList;
cList = node._children;
len = cList.length;
rst = 1;
for (i = 0; i < len; i++) {
rst += NodeUtils.getRenderNodeCount(cList[i]);
}
return rst;
}
static getReFreshRenderNodeCount(node) {
var rst;
var i, len;
var cList;
cList = node._children;
len = cList.length;
rst = 1;
for (i = 0; i < len; i++) {
rst += NodeUtils.getRenderNodeCount(cList[i]);
}
return rst;
}
static showCachedSpriteRecs() {
NodeUtils.g = DebugInfoLayer.I.graphicLayer.graphics;
NodeUtils.g.clear();
WalkTools.walkTarget(Laya.Laya.stage, NodeUtils.drawCachedBounds, null);
}
static drawCachedBounds(sprite) {
if (sprite.cacheAs == "none")
return;
if (DebugInfoLayer.I.isDebugItem(sprite))
return;
var rec;
rec = NodeUtils.getGRec(sprite);
NodeUtils.g.drawRect(rec.x, rec.y, rec.width, rec.height, null, "#0000ff", 2);
}
}
NodeUtils.defaultKeys = ["x", "y", "width", "height"];
class DifferTool {
constructor(sign = "", autoTrace = true) {
this.autoTrace = true;
this.sign = "";
this.sign = sign;
this.autoTrace = autoTrace;
}
update(data, msg = null) {
if (msg) {
console.log(msg);
}
var tObj = ObjectTools.copyObj(data);
if (!this.obj)
this.obj = {};
var rst;
rst = ObjectTools.differ(this.obj, tObj);
this.obj = tObj;
if (this.autoTrace) {
console.log(this.sign + " differ:");
ObjectTools.traceDifferObj(rst);
}
return rst;
}
static differ(sign, data, msg = null) {
if (!DifferTool._differO[sign])
DifferTool._differO[sign] = new DifferTool(sign, true);
var tDiffer;
tDiffer = DifferTool._differO[sign];
return tDiffer.update(data, msg);
}
}
DifferTool._differO = {};
class FunHook {
constructor() {
}
static hook(obj, funName, preFun = null, aftFun = null) {
FunHook.hookFuns(obj, funName, [preFun, obj[funName], aftFun], 1);
}
static hookAllFun(obj) {
var key;
var arr;
arr = ClassTool.getOwnPropertyNames(obj);
for (key in arr) {
key = arr[key];
if (FunHook.special[key])
continue;
console.log("try hook:", key);
if (obj[key] instanceof Function) {
console.log("hook:", key);
FunHook.hookFuns(obj, key, [FunHook.getTraceMsg("call:" + key), obj[key]], 1);
}
}
if (obj["__proto__"]) {
FunHook.hookAllFun(obj["__proto__"]);
}
else {
console.log("end:", obj);
}
}
static getTraceMsg(msg) {
var rst;
rst = function () {
console.log(msg);
};
return rst;
}
static hookFuns(obj, funName, funList, rstI = -1) {
var _preFun = obj[funName];
var newFun;
newFun = function (...args) {
var rst;
var i;
var len;
len = funList.length;
for (i = 0; i < len; i++) {
if (!funList[i])
continue;
if (i == rstI) {
rst = funList[i].apply(this, args);
}
else {
funList[i].apply(this, args);
}
}
return rst;
};
newFun["pre"] = _preFun;
obj[funName] = newFun;
}
static removeHook(obj, funName) {
if (obj[funName].pre != null) {
obj[funName] = obj[funName].pre;
}
}
static debugHere() {
debugger;
}
static traceLoc(level = 0, msg = "") {
console.log(msg, "fun loc:", TraceTool.getCallLoc(3 + level));
}
static getLocFun(level = 0, msg = "") {
level += 1;
var rst;
rst = function () {
FunHook.traceLoc(level, msg);
};
return rst;
}
}
FunHook.special = {
"length": true,
"name": true,
"arguments": true,
"caller": true,
"prototype": true,
"is": true,
"isExtensible": true,
"isFrozen": true,
"isSealed": true,
"preventExtensions": true,
"seal": true,
"apply": true,
"call": true,
"bind": true,
"freeze": true,
"unobserve": true
};
class VarHook {
constructor() {
}
static hookVar(obj, name, setHook = null, getHook = null) {
if (!setHook)
setHook = [];
if (!getHook)
getHook = [];
var preO = obj;
var preValue = obj[name];
var des;
des = ClassTool.getOwnPropertyDescriptor(obj, name);
var ndes = {};
var mSet = function (value) {
console.log("var hook set " + name + ":", value);
preValue = value;
};
var mGet = function () {
console.log("var hook get" + name + ":", preValue);
return preValue;
};
if (des) {
ndes.set = mSet;
ndes.get = mGet;
ndes.enumerable = des.enumerable;
setHook.push(ndes.set);
getHook.push(ndes.get);
FunHook.hookFuns(ndes, "set", setHook);
FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
ClassTool.defineProperty(obj, name, ndes);
return;
}
while (!des && obj["__proto__"]) {
obj = obj["__proto__"];
des = ClassTool.getOwnPropertyDescriptor(obj, name);
}
if (des) {
ndes.set = des.set ? des.set : mSet;
ndes.get = des.get ? des.get : mGet;
ndes.enumerable = des.enumerable;
setHook.push(ndes.set);
getHook.push(ndes.get);
FunHook.hookFuns(ndes, "set", setHook);
FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
ClassTool.defineProperty(preO, name, ndes);
}
if (!des) {
console.log("get des fail add directly");
ndes.set = mSet;
ndes.get = mGet;
setHook.push(ndes.set);
getHook.push(ndes.get);
FunHook.hookFuns(ndes, "set", setHook);
FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
ClassTool.defineProperty(obj, name, ndes);
}
}
static getLocFun(msg = "", level = 0) {
level += 1;
var rst;
rst = function () {
FunHook.traceLoc(level, msg);
};
return rst;
}
}
class Watcher {
constructor() {
}
static watch(obj, name, funs) {
VarHook.hookVar(obj, name, funs);
}
static traceChange(obj, name, sign = "var changed:") {
VarHook.hookVar(obj, name, [Watcher.getTraceValueFun(name), VarHook.getLocFun(sign)]);
}
static debugChange(obj, name) {
VarHook.hookVar(obj, name, [VarHook.getLocFun("debug loc"), FunHook.debugHere]);
}
static differChange(obj, name, sign, msg = "") {
VarHook.hookVar(obj, name, [Watcher.getDifferFun(obj, name, sign, msg)]);
}
static getDifferFun(obj, name, sign, msg = "") {
var rst;
rst = function () {
DifferTool.differ(sign, obj[name], msg);
};
return rst;
}
static traceValue(value) {
console.log("value:", value);
}
static getTraceValueFun(name) {
var rst;
rst = function (value) {
console.log("set " + name + " :", value);
};
return rst;
}
}
class DebugTool {
constructor() {
}
static getMenuShowEvent() {
if (Laya.Browser.onMobile) {
return Laya.Event.DOUBLE_CLICK;
}
else {
return Laya.Event.RIGHT_CLICK;
}
}
static initBasicFunctions() {
if (!DebugTool.debugLayer) {
DebugInfoLayer.init();
DebugTool.debugLayer = DebugInfoLayer.I.graphicLayer;
DebugTool.debugLayer.mouseEnabled = false;
DebugTool.debugLayer.mouseThrough = true;
DebugTool.showStatu = true;
Laya.Laya.stage.on(Laya.Event.KEY_DOWN, null, DebugTool.keyHandler);
DebugTool.export();
}
}
static dTrace(str) {
if (DebugTool._traceFun != null) {
DebugTool._traceFun(str);
}
console.log(str);
}
static keyHandler(e) {
var key;
key = String.fromCharCode(e.keyCode);
if (!e.altKey)
return;
switch (e.keyCode) {
case 38:
DebugTool.showParent();
break;
case 40:
DebugTool.showChild();
break;
case 37:
DebugTool.showBrother(DebugTool.target, 1);
break;
case 39:
DebugTool.showBrother(DebugTool.target, -1);
break;
}
DebugTool.dealCMDKey(key);
}
static dealCMDKey(key) {
switch (key) {
case "上":
DebugTool.showParent();
break;
case "下":
DebugTool.showChild();
break;
case "左":
DebugTool.showBrother(DebugTool.target, 1);
break;
case "右":
DebugTool.showBrother(DebugTool.target, -1);
break;
case "B":
DebugTool.showAllBrother();
break;
case "C":
DebugTool.showAllChild();
break;
case "E":
DebugTool.traceDisMouseEnable();
break;
case "S":
DebugTool.traceDisSizeChain();
break;
case "D":
DisControlTool.downDis(DebugTool.target);
break;
case "U":
DisControlTool.upDis(DebugTool.target);
break;
case "N":
DebugTool.getNodeInfo();
break;
case "M":
DebugTool.showAllUnderMosue();
break;
case "I":
break;
case "O":
break;
case "L":
DisController.I.switchType();
break;
case "Q":
DebugTool.showNodeInfo();
break;
case "F":
DebugTool.showToolPanel();
break;
case "P":
DebugTool.showToolFilter();
break;
case "V":
DebugTool.selectNodeUnderMouse();
break;
case "A":
break;
case "K":
NodeUtils.traceStage();
break;
case "T":
DebugTool.switchNodeTree();
break;
case "R":
break;
case "X":
break;
case "mCMD":
DebugTool.traceCMD();
break;
case "allCMD":
DebugTool.traceCMDR();
break;
}
}
static switchNodeTree() {
}
static selectNodeUnderMouse() {
DebugTool.showDisBound();
return;
}
static showToolPanel() {
}
static showToolFilter() {
}
static showNodeInfo() {
if (NodeInfoPanel.I.isWorkState) {
NodeInfoPanel.I.recoverNodes();
}
else {
NodeInfoPanel.I.showDisInfo(DebugTool.target);
}
}
static switchDisController() {
if (DisController.I.target) {
DisController.I.target = null;
}
else {
if (DebugTool.target) {
DisController.I.target = DebugTool.target;
}
}
}
static get isThisShow() {
return false;
}
static showParent(sprite = null) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
DebugTool.target = sprite.parent;
DebugTool.autoWork();
}
static showChild(sprite = null) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
if (sprite.numChildren > 0) {
DebugTool.target = sprite.getChildAt(0);
DebugTool.autoWork();
}
}
static showAllChild(sprite = null) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
DebugTool.selectedNodes = DisControlTool.getAllChild(sprite);
DebugTool.showSelected();
}
static showAllUnderMosue() {
DebugTool.selectedNodes = DisControlTool.getObjectsUnderGlobalPoint(Laya.Laya.stage);
DebugTool.showSelected();
}
static showParentChain(sprite = null) {
if (!sprite)
return;
DebugTool.selectedNodes = [];
var tar;
tar = sprite.parent;
while (tar) {
DebugTool.selectedNodes.push(tar);
tar = tar.parent;
}
DebugTool.showSelected();
}
static showAllBrother(sprite = null) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
if (!sprite.parent)
return;
DebugTool.selectedNodes = DisControlTool.getAllChild(sprite.parent);
DebugTool.showSelected();
}
static showBrother(sprite, dID = 1) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
var p;
p = sprite.parent;
if (!p)
return;
var n;
n = p.getChildIndex(sprite);
n += dID;
if (n < 0)
n += p.numChildren;
if (n >= p.numChildren)
n -= p.numChildren;
DebugTool.target = p.getChildAt(n);
DebugTool.autoWork();
}
static set showStatu(value) {
if (value) {
Laya.Stat.show();
}
else {
Laya.Stat.hide();
DebugTool.clearDebugLayer();
}
}
static clearDebugLayer() {
if (DebugTool.debugLayer.graphics)
DebugTool.debugLayer.graphics.clear();
}
static set target(v) {
DebugTool._target = v;
}
static get target() {
return DebugTool._target;
}
static showSelected() {
if (!DebugTool.autoShowSelected)
return;
if (!DebugTool.selectedNodes || DebugTool.selectedNodes.length < 1)
return;
console.log("selected:", DebugTool.selectedNodes);
var i;
var len;
len = DebugTool.selectedNodes.length;
DebugTool.clearDebugLayer();
for (i = 0; i < len; i++) {
DebugTool.showDisBound(DebugTool.selectedNodes[i], false);
}
}
static getClassCreateInfo(className) {
return RunProfile.getRunInfo(className);
}
static set showBound(value) {
DebugTool._showBound = value;
if (!DebugTool._showBound) {
DebugTool.clearDebugLayer();
}
}
static get showBound() {
return DebugTool._showBound;
}
static autoWork() {
if (!DebugTool.isThisShow)
return;
if (DebugTool.showBound)
DebugTool.showDisBound();
if (DebugTool.autoTraceSpriteInfo && DebugTool.target) {
TraceTool.traceSpriteInfo(DebugTool.target, DebugTool.autoTraceBounds, DebugTool.autoTraceSize, DebugTool.autoTraceTree);
}
if (!DebugTool.target)
return;
if (DebugTool.autoTraceCMD) {
DebugTool.traceCMD();
}
if (DebugTool.autoTraceCMDR) {
DebugTool.traceCMDR();
}
if (DebugTool.autoTraceEnable) {
DebugTool.traceDisMouseEnable(DebugTool.target);
}
}
static traceDisMouseEnable(tar = null) {
console.log("----------------traceDisMouseEnable--------------------");
if (!tar)
tar = DebugTool.target;
if (!tar) {
console.log("no targetAvalible");
return null;
}
var strArr;
strArr = [];
DebugTool.selectedNodes = [];
while (tar) {
strArr.push(ClassTool.getNodeClassAndName(tar) + ": mouseEnabled:" + tar.mouseEnabled + " hitFirst:" + tar.hitTestPrior);
DebugTool.selectedNodes.push(tar);
tar = tar.parent;
}
console.log(strArr.join("\n"));
DebugTool.showSelected();
return strArr.join("\n");
}
static traceDisSizeChain(tar = null) {
console.log("---------------------traceDisSizeChain-------------------");
if (!tar)
tar = DebugTool.target;
if (!tar) {
console.log("no targetAvalible");
return null;
}
DebugTool.selectedNodes = [];
var strArr;
strArr = [];
while (tar) {
strArr.push(ClassTool.getNodeClassAndName(tar) + ": x:" + tar.x + " y:" + tar.y + " w:" + tar.width + " h:" + tar.height + " scaleX:" + tar.scaleX + " scaleY:" + tar.scaleY);
DebugTool.selectedNodes.push(tar);
tar = tar.parent;
}
console.log(strArr.join("\n"));
DebugTool.showSelected();
return strArr.join("\n");
}
static showDisBound(sprite = null, clearPre = true, color = "#ff0000") {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
if (clearPre)
DebugTool.clearDebugLayer();
var pointList;
pointList = sprite._getBoundPointsM(true);
if (!pointList || pointList.length < 1)
return;
pointList = Laya.GrahamScan.pListToPointList(pointList, true);
WalkTools.walkArr(pointList, sprite.localToGlobal, sprite);
pointList = Laya.GrahamScan.pointListToPlist(pointList);
DebugTool._disBoundRec = Laya.Rectangle._getWrapRec(pointList, DebugTool._disBoundRec);
DebugTool.debugLayer.graphics.drawRect(DebugTool._disBoundRec.x, DebugTool._disBoundRec.y, DebugTool._disBoundRec.width, DebugTool._disBoundRec.height, null, color);
DebugInfoLayer.I.setTop();
}
static showDisBoundToSprite(sprite = null, graphicSprite = null, color = "#ff0000", lineWidth = 1) {
var pointList;
pointList = sprite._getBoundPointsM(true);
if (!pointList || pointList.length < 1)
return;
pointList = Laya.GrahamScan.pListToPointList(pointList, true);
WalkTools.walkArr(pointList, sprite.localToGlobal, sprite);
pointList = Laya.GrahamScan.pointListToPlist(pointList);
DebugTool._disBoundRec = Laya.Rectangle._getWrapRec(pointList, DebugTool._disBoundRec);
graphicSprite.graphics.drawRect(DebugTool._disBoundRec.x, DebugTool._disBoundRec.y, DebugTool._disBoundRec.width, DebugTool._disBoundRec.height, null, color, lineWidth);
}
static getNodeInfo() {
DebugTool.counter.reset();
WalkTools.walkTarget(Laya.Laya.stage, DebugTool.addNodeInfo);
console.log("node info:");
DebugTool.counter.traceSelf();
return DebugTool.counter.data;
}
static findByClass(className) {
DebugTool._classList = [];
DebugTool._tFindClass = className;
WalkTools.walkTarget(Laya.Laya.stage, DebugTool.addClassNode);
DebugTool.selectedNodes = DebugTool._classList;
DebugTool.showSelected();
return DebugTool._classList;
}
static addClassNode(node) {
var type;
type = node["constructor"].name;
if (type == DebugTool._tFindClass) {
DebugTool._classList.push(node);
}
}
static traceCMD(sprite = null) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return null;
}
console.log("self CMDs:");
console.log(sprite.graphics.cmds);
var renderSprite;
renderSprite = Laya.RenderSprite.renders[sprite._renderType];
console.log("renderSprite:", renderSprite);
DebugTool._rSpList.length = 0;
while (renderSprite && renderSprite["_sign"] > 0) {
DebugTool._rSpList.push(DebugTool.cmdToTypeO[renderSprite["_sign"]]);
renderSprite = renderSprite._next;
}
console.log("fun:", DebugTool._rSpList.join(","));
DebugTool.counter.reset();
DebugTool.addCMDs(sprite.graphics.cmds);
DebugTool.counter.traceSelf();
return DebugTool.counter.data;
}
static addCMDs(cmds) {
WalkTools.walkArr(cmds, DebugTool.addCMD);
}
static addCMD(cmd) {
DebugTool.counter.add(cmd.callee);
}
static traceCMDR(sprite = null) {
if (!sprite)
sprite = DebugTool.target;
if (!sprite) {
console.log("no targetAvalible");
return 0;
}
DebugTool.counter.reset();
WalkTools.walkTarget(sprite, DebugTool.getCMdCount);
console.log("cmds include children");
DebugTool.counter.traceSelf();
return DebugTool.counter.data;
}
static getCMdCount(target) {
if (!target)
return 0;
if (!(target instanceof Laya.Sprite))
return 0;
if (!target.graphics.cmds)
return 0;
DebugTool.addCMDs(target.graphics.cmds);
var rst = target.graphics.cmds.length;
return rst;
}
static addNodeInfo(node) {
var type;
type = node["constructor"].name;
DebugTool.counter.add(type);
}
static find(filter, ifShowSelected = true) {
var rst;
rst = DebugTool.findTarget(Laya.Laya.stage, filter);
DebugTool.selectedNodes = rst;
if (DebugTool.selectedNodes) {
DebugTool.target = DebugTool.selectedNodes[0];
}
if (ifShowSelected)
DebugTool.showSelected();
return rst;
}
static findByName(name) {
DebugTool.nameFilter.name = name;
return DebugTool.find(DebugTool.nameFilter);
}
static findNameStartWith(startStr) {
DebugTool.nameFilter.name = DebugTool.getStartWithFun(startStr);
return DebugTool.find(DebugTool.nameFilter);
}
static findNameHas(hasStr, showSelected = true) {
DebugTool.nameFilter.name = DebugTool.getHasFun(hasStr);
return DebugTool.find(DebugTool.nameFilter, showSelected);
}
static getStartWithFun(startStr) {
var rst = function (str) {
if (!str)
return false;
if (str.indexOf(startStr) == 0)
return true;
return false;
};
return rst;
}
static getHasFun(hasStr) {
var rst = function (str) {
if (!str)
return false;
if (str.indexOf(hasStr) >= 0)
return true;
return false;
};
return rst;
}
static findTarget(target, filter) {
var rst = [];
if (DebugTool.isFit(target, filter))
rst.push(target);
var i;
var len;
var tChild;
len = target.numChildren;
for (i = 0; i < len; i++) {
tChild = target.getChildAt(i);
if (tChild instanceof Laya.Sprite) {
rst = rst.concat(DebugTool.findTarget(tChild, filter));
}
}
return rst;
}
static findClassHas(target, str) {
var rst = [];
if (ClassTool.getClassName(target).indexOf(str) >= 0)
rst.push(target);
var i;
var len;
var tChild;
len = target.numChildren;
for (i = 0; i < len; i++) {
tChild = target.getChildAt(i);
if (tChild instanceof Laya.Sprite) {
rst = rst.concat(DebugTool.findClassHas(tChild, str));
}
}
return rst;
}
static isFit(tar, filter) {
if (!tar)
return false;
if (!filter)
return true;
if (filter instanceof Function) {
return filter(tar);
}
var key;
for (key in filter) {
if (filter[key] instanceof Function) {
if (!filter[key](tar[key]))
return false;
}
else {
if (tar[key] != filter[key])
return false;
}
}
return true;
}
static log(...args) {
var arr;
arr = DTrace.getArgArr(args);
if (DebugTool._logFun != null) {
DebugTool._logFun(arr.join(" "));
}
}
static export() {
var _window;
_window = window;
var key;
for (key in DebugTool._exportsDic) {
_window[key] = DebugTool._exportsDic[key];
}
}
}
DebugTool.enableCacheAnalyse = false;
DebugTool.enableNodeCreateAnalyse = true;
DebugTool.text = new Laya.Stat();
DebugTool.selectedNodes = [];
DebugTool.autoShowSelected = true;
DebugTool._showBound = true;
DebugTool.autoTraceEnable = false;
DebugTool.autoTraceBounds = false;
DebugTool.autoTraceSize = false;
DebugTool.autoTraceTree = true;
DebugTool.autoTraceCMD = true;
DebugTool.autoTraceCMDR = false;
DebugTool.autoTraceSpriteInfo = true;
DebugTool.cmdToTypeO = {};
DebugTool._rSpList = [];
DebugTool.counter = new CountTool();
DebugTool.nameFilter = { "name": "name" };
DebugTool._exportsDic = {
"DebugTool": DebugTool,
"Watcher": Watcher
};
TraceTool._debugtrace = DebugTool.dTrace;
class ByteEx {
constructor(data = null) {
this._xd_ = true;
this._allocated_ = 8;
this._pos_ = 0;
this._length = 0;
if (data) {
this._u8d_ = new Uint8Array(data);
this._d_ = new DataView(this._u8d_.buffer);
this._length = this._d_.byteLength;
}
else {
this._resizeBuffer(this._allocated_);
}
}
static getSystemEndian() {
if (!ByteEx._sysEndian) {
var buffer = new ArrayBuffer(2);
new DataView(buffer).setInt16(0, 256, true);
ByteEx._sysEndian = (new Int16Array(buffer))[0] === 256 ? ByteEx.LITTLE_ENDIAN : ByteEx.BIG_ENDIAN;
}
return ByteEx._sysEndian;
}
get buffer() {
var rstBuffer = this._d_.buffer;
if (rstBuffer.byteLength === this._length)
return rstBuffer;
return rstBuffer.slice(0, this._length);
}
get endian() {
return this._xd_ ? ByteEx.LITTLE_ENDIAN : ByteEx.BIG_ENDIAN;
}
set endian(value) {
this._xd_ = (value === ByteEx.LITTLE_ENDIAN);
}
set length(value) {
if (this._allocated_ < value)
this._resizeBuffer(this._allocated_ = Math.floor(Math.max(value, this._allocated_ * 2)));
else if (this._allocated_ > value)
this._resizeBuffer(this._allocated_ = value);
this._length = value;
}
get length() {
return this._length;
}
_resizeBuffer(len) {
try {
var newByteView = new Uint8Array(len);
if (this._u8d_ != null) {
if (this._u8d_.length <= len)
newByteView.set(this._u8d_);
else
newByteView.set(this._u8d_.subarray(0, len));
}
this._u8d_ = newByteView;
this._d_ = new DataView(newByteView.buffer);
}
catch (err) {
throw "Invalid typed array length:" + len;
}
}
getString() {
return this.readString();
}
readString() {
return this._rUTF(this.getUint16());
}
getFloat32Array(start, len) {
return this.readFloat32Array(start, len);
}
readFloat32Array(start, len) {
var end = start + len;
end = (end > this._length) ? this._length : end;
var v = new Float32Array(this._d_.buffer.slice(start, end));
this._pos_ = end;
return v;
}
getUint8Array(start, len) {
return this.readUint8Array(start, len);
}
readUint8Array(start, len) {
var end = start + len;
end = (end > this._length) ? this._length : end;
var v = new Uint8Array(this._d_.buffer.slice(start, end));
this._pos_ = end;
return v;
}
getInt16Array(start, len) {
return this.readInt16Array(start, len);
}
readInt16Array(start, len) {
var end = start + len;
end = (end > this._length) ? this._length : end;
var v = new Int16Array(this._d_.buffer.slice(start, end));
this._pos_ = end;
return v;
}
getFloat32() {
return this.readFloat32();
}
readFloat32() {
if (this._pos_ + 4 > this._length)
throw "getFloat32 error - Out of bounds";
var v = this._d_.getFloat32(this._pos_, this._xd_);
this._pos_ += 4;
return v;
}
getFloat64() {
return this.readFloat64();
}
readFloat64() {
if (this._pos_ + 8 > this._length)
throw "getFloat64 error - Out of bounds";
var v = this._d_.getFloat64(this._pos_, this._xd_);
this._pos_ += 8;
return v;
}
writeFloat32(value) {
this._ensureWrite(this._pos_ + 4);
this._d_.setFloat32(this._pos_, value, this._xd_);
this._pos_ += 4;
}
writeFloat64(value) {
this._ensureWrite(this._pos_ + 8);
this._d_.setFloat64(this._pos_, value, this._xd_);
this._pos_ += 8;
}
getInt32() {
return this.readInt32();
}
readInt32() {
if (this._pos_ + 4 > this._length)
throw "getInt32 error - Out of bounds";
var float = this._d_.getInt32(this._pos_, this._xd_);
this._pos_ += 4;
return float;
}
getUint32() {
return this.readUint32();
}
readUint32() {
if (this._pos_ + 4 > this._length)
throw "getUint32 error - Out of bounds";
var v = this._d_.getUint32(this._pos_, this._xd_);
this._pos_ += 4;
return v;
}
writeInt32(value) {
this._ensureWrite(this._pos_ + 4);
this._d_.setInt32(this._pos_, value, this._xd_);
this._pos_ += 4;
}
writeUint32(value) {
this._ensureWrite(this._pos_ + 4);
this._d_.setUint32(this._pos_, value, this._xd_);
this._pos_ += 4;
}
getInt16() {
return this.readInt16();
}
readInt16() {
if (this._pos_ + 2 > this._length)
throw "getInt16 error - Out of bounds";
var us = this._d_.getInt16(this._pos_, this._xd_);
this._pos_ += 2;
return us;
}
getUint16() {
return this.readUint16();
}
readUint16() {
if (this._pos_ + 2 > this._length)
throw "getUint16 error - Out of bounds";
var us = this._d_.getUint16(this._pos_, this._xd_);
this._pos_ += 2;
return us;
}
writeUint16(value) {
this._ensureWrite(this._pos_ + 2);
this._d_.setUint16(this._pos_, value, this._xd_);
this._pos_ += 2;
}
writeInt16(value) {
this._ensureWrite(this._pos_ + 2);
this._d_.setInt16(this._pos_, value, this._xd_);
this._pos_ += 2;
}
getUint8() {
return this.readUint8();
}
readUint8() {
if (this._pos_ + 1 > this._length)
throw "getUint8 error - Out of bounds";
return this._d_.getUint8(this._pos_++);
}
writeUint8(value) {
this._ensureWrite(this._pos_ + 1);
this._d_.setUint8(this._pos_, value);
this._pos_++;
}
_getUInt8(pos) {
return this._readUInt8(pos);
}
_readUInt8(pos) {
return this._d_.getUint8(pos);
}
_getUint16(pos) {
return this._readUint16(pos);
}
_readUint16(pos) {
return this._d_.getUint16(pos, this._xd_);
}
_getMatrix() {
return this._readMatrix();
}
_readMatrix() {
var rst = new Laya.Matrix(this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32());
return rst;
}
_rUTF(len) {
var v = "", max = this._pos_ + len, c, c2, c3, f = String.fromCharCode;
var u = this._u8d_;
while (this._pos_ < max) {
c = u[this._pos_++];
if (c < 0x80) {
if (c != 0)
v += f(c);
}
else if (c < 0xE0) {
v += f(((c & 0x3F) << 6) | (u[this._pos_++] & 0x7F));
}
else if (c < 0xF0) {
c2 = u[this._pos_++];
v += f(((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (u[this._pos_++] & 0x7F));
}
else {
c2 = u[this._pos_++];
c3 = u[this._pos_++];
v += f(((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 << 6) & 0x7F) | (u[this._pos_++] & 0x7F));
}
}
return v;
}
getCustomString(len) {
return this.readCustomString(len);
}
readCustomString(len) {
var v = "", ulen = 0, c, c2, f = String.fromCharCode;
var u = this._u8d_;
while (len > 0) {
c = u[this._pos_];
if (c < 0x80) {
v += f(c);
this._pos_++;
len--;
}
else {
ulen = c - 0x80;
this._pos_++;
len -= ulen;
while (ulen > 0) {
c = u[this._pos_++];
c2 = u[this._pos_++];
v += f((c2 << 8) | c);
ulen--;
}
}
}
return v;
}
get pos() {
return this._pos_;
}
set pos(value) {
this._pos_ = value;
}
get bytesAvailable() {
return this._length - this._pos_;
}
clear() {
this._pos_ = 0;
this.length = 0;
}
__getBuffer() {
return this._d_.buffer;
}
writeUTFBytes(value) {
value = value + "";
for (var i = 0, sz = value.length; i < sz; i++) {
var c = value.charCodeAt(i);
if (c <= 0x7F) {
this.writeByte(c);
}
else if (c <= 0x7FF) {
this._ensureWrite(this._pos_ + 2);
this._u8d_.set([0xC0 | (c >> 6), 0x80 | (c & 0x3F)], this._pos_);
this._pos_ += 2;
}
else if (c <= 0xFFFF) {
this._ensureWrite(this._pos_ + 3);
this._u8d_.set([0xE0 | (c >> 12), 0x80 | ((c >> 6) & 0x3F), 0x80 | (c & 0x3F)], this._pos_);
this._pos_ += 3;
}
else {
this._ensureWrite(this._pos_ + 4);
this._u8d_.set([0xF0 | (c >> 18), 0x80 | ((c >> 12) & 0x3F), 0x80 | ((c >> 6) & 0x3F), 0x80 | (c & 0x3F)], this._pos_);
this._pos_ += 4;
}
}
}
writeUTFString(value) {
var tPos = this.pos;
this.writeUint16(1);
this.writeUTFBytes(value);
var dPos = this.pos - tPos - 2;
this._d_.setUint16(tPos, dPos, this._xd_);
}
readUTFString() {
return this.readUTFBytes(this.getUint16());
}
getUTFString() {
return this.readUTFString();
}
readUTFBytes(len = -1) {
if (len === 0)
return "";
var lastBytes = this.bytesAvailable;
if (len > lastBytes)
throw "readUTFBytes error - Out of bounds";
len = len > 0 ? len : lastBytes;
return this._rUTF(len);
}
getUTFBytes(len = -1) {
return this.readUTFBytes(len);
}
writeByte(value) {
this._ensureWrite(this._pos_ + 1);
this._d_.setInt8(this._pos_, value);
this._pos_ += 1;
}
readByte() {
if (this._pos_ + 1 > this._length)
throw "readByte error - Out of bounds";
return this._d_.getInt8(this._pos_++);
}
getByte() {
return this.readByte();
}
_ensureWrite(lengthToEnsure) {
if (this._length < lengthToEnsure)
this._length = lengthToEnsure;
if (this._allocated_ < lengthToEnsure)
this.length = lengthToEnsure;
}
writeArrayBuffer(arraybuffer, offset = 0, length = 0) {
if (offset < 0 || length < 0)
throw "writeArrayBuffer error - Out of bounds";
if (length == 0)
length = arraybuffer.byteLength - offset;
this._ensureWrite(this._pos_ + length);
var uint8array = new Uint8Array(arraybuffer);
this._u8d_.set(uint8array.subarray(offset, offset + length), this._pos_);
this._pos_ += length;
}
}
ByteEx.BIG_ENDIAN = "bigEndian";
ByteEx.LITTLE_ENDIAN = "littleEndian";
ByteEx._sysEndian = null;
class Base64Tool {
constructor() {
}
static init() {
if (Base64Tool.lookup)
return;
Base64Tool.lookup = new Uint8Array(256);
for (var i = 0; i < Base64Tool.chars.length; i++) {
Base64Tool.lookup[Base64Tool.chars.charCodeAt(i)] = i;
}
}
static encode(arraybuffer) {
var bytes = new Uint8Array(arraybuffer), i, len = bytes["length"], base64 = "";
for (i = 0; i < len; i += 3) {
base64 += Base64Tool.chars[bytes[i] >> 2];
base64 += Base64Tool.chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
base64 += Base64Tool.chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
base64 += Base64Tool.chars[bytes[i + 2] & 63];
}
if ((len % 3) === 2) {
base64 = base64.substring(0, base64.length - 1) + "=";
}
else if (len % 3 === 1) {
base64 = base64.substring(0, base64.length - 2) + "==";
}
return base64;
}
static encodeStr(str) {
var byte;
byte = new ByteEx();
byte.writeUTFString(str);
return Base64Tool.encodeByte(byte);
}
static encodeStr2(str) {
var byte;
byte = new ByteEx();
byte.writeUTFBytes(str);
return Base64Tool.encodeByte(byte);
}
static encodeByte(byte, start = 0, end = -1) {
if (end < 0) {
end = byte.length;
}
return Base64Tool.encode(byte.buffer.slice(start, end));
}
static decodeToByte(base64) {
return new ByteEx(Base64Tool.decode(base64));
}
static decode(base64) {
Base64Tool.init();
var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
if (base64[base64.length - 1] === "=") {
bufferLength--;
if (base64[base64.length - 2] === "=") {
bufferLength--;
}
}
var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);
for (i = 0; i < len; i += 4) {
encoded1 = Base64Tool.lookup[base64.charCodeAt(i)];
encoded2 = Base64Tool.lookup[base64.charCodeAt(i + 1)];
encoded3 = Base64Tool.lookup[base64.charCodeAt(i + 2)];
encoded4 = Base64Tool.lookup[base64.charCodeAt(i + 3)];
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
}
return arraybuffer;
}
;
}
Base64Tool.chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
Base64Tool.lookup = null;
class DivScripts {
constructor() {
}
static init() {
var script;
script = Base64Tool.decodeToByte(DivScripts.data).readUTFBytes();
window["eval"](script);
}
}
DivScripts.data = "ZnVuY3Rpb24gZGh0bWx4RXZlbnQoZSx0LGkpe2UuYWRkRXZlbnRMaXN0ZW5lcj9lLmFkZEV2ZW50TGlzdGVuZXIodCxpLCExKTplLmF0dGFjaEV2ZW50JiZlLmF0dGFjaEV2ZW50KCJvbiIrdCxpKX1mdW5jdGlvbiBkaHRtbFhUcmVlT2JqZWN0KGUsdCxpLG4pe2lmKGRodG1seEV2ZW50LmluaXRUb3VjaCYmZGh0bWx4RXZlbnQuaW5pdFRvdWNoKCksX2lzSUUpdHJ5e2RvY3VtZW50LmV4ZWNDb21tYW5kKCJCYWNrZ3JvdW5kSW1hZ2VDYWNoZSIsITEsITApfWNhdGNoKG8pe310aGlzLnBhcmVudE9iamVjdD0ib2JqZWN0IiE9dHlwZW9mIGU/ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZSk6ZSx0aGlzLnBhcmVudE9iamVjdC5zdHlsZS5vdmVyZmxvdz0iaGlkZGVuIix0aGlzLl9pdGltX2RnPSEwLHRoaXMuZGxtdHI9IiwiLHRoaXMuZHJvcExvd2VyPSExLHRoaXMuZW5hYmxlSUVJbWFnZUZpeCghM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fZGVidWdfdmlldy5vblJlZnJlc2g9ZnVuY3Rpb24oZSl7cmVmcmVzaF9jb250cm9sLm9uY2xpY2s9ZX0sbGF5YWFpcl9kZWJ1Z192aWV3Lm9uUHJpbnRFbmFibGVkTm9kZUNoYWluPWZ1bmN0aW9uKGUpe2VuYWJsZWRfbm9kZV9jaGFpbl9jb250cm9sLm9uY2xpY2s9ZX0sbGF5YWFpcl9kZWJ1Z192aWV3Lm9uUHJpbnRTaXplQ2hhaW49ZnVuY3Rpb24oZSl7c2l6ZV9jaGFpbl9jb250cm9sLm9uY2xpY2s9ZX0sbGF5YWFpcl9kZWJ1Z192aWV3Lm9uVG9nZ2xlVmlzaWJpbGl0eT1mdW5jdGlvbihlKXt2aXNpYmlsaXR5X2NvbnRyb2wub25jaGFuZ2U9ZX0sbGF5YWFpcl9kZWJ1Z192aWV3Lm9uVG9nZ2xlRGVidWdCb3JkZXI9ZnVuY3Rpb24oZSl7c2hvd19ib3JkZXJfY29udHJvbC5vbmNoYW5nZT1lfSxsYXlhYWlyX2RlYnVnX3ZpZXcub25Ub2dnbGVTaG93Q3VycmVudENhY2hlPWZ1bmN0aW9uKGUpe3Nob3dfY3VycmVudF9jYWNoZV9jb250cm9sLm9uY2hhbmdlPWV9LGxheWFhaXJfZGVidWdfdmlldy5vblRvZ2dsZVNob3dBbGxDYWNoZT1mdW5jdGlvbihlKXtzaG93X2FsbF9jYWNoZV9jb250cm9sLm9uY2hhbmdlPWV9LGxheWFhaXJfZGVidWdfdmlldy5vblRvZ2dsZVNob3dBdGxhcz1mdW5jdGlvbihlKXtzaG93X2F0bGFzX2NvbnRyb2wub25jaGFuZ2U9ZX07";
class AtlasTools {
constructor() {
this.mIndex = 0;
this.mTextureDic = {};
}
static getInstance() {
return AtlasTools.mInstance = AtlasTools.mInstance || new AtlasTools();
}
start() {
if (this.mSprite == null) {
this.mSprite = new Laya.Sprite();
}
Laya.Laya.stage.addChild(this.mSprite);
this.showNext();
}
end() {
if (this.mSprite) {
Laya.Laya.stage.removeChild(this.mSprite);
}
}
showNext() {
if (this.mSprite == null) {
this.mSprite = new Laya.Sprite();
}
Laya.Laya.stage.addChild(this.mSprite);
this.mIndex++;
var tTexture;
if (this.mTextureDic[this.mIndex]) {
tTexture = this.mTextureDic[this.mIndex];
}
}
}
class ObjTimeCountTool {
constructor() {
this.timeDic = {};
this.resultDic = {};
this.countDic = {};
this.resultCountDic = {};
this.nodeDic = {};
this.resultNodeDic = {};
}
addTime(sprite, time) {
IDTools.idObj(sprite);
var key;
key = IDTools.getObjID(sprite);
if (!this.timeDic.hasOwnProperty(key)) {
this.timeDic[key] = 0;
}
this.timeDic[key] = this.timeDic[key] + time;
if (!this.countDic.hasOwnProperty(key)) {
this.countDic[key] = 0;
}
this.countDic[key] = this.countDic[key] + 1;
this.nodeDic[key] = sprite;
}
getTime(sprite) {
IDTools.idObj(sprite);
var key;
key = IDTools.getObjID(sprite);
if (!this.resultDic[key])
return 0;
return this.resultDic[key];
}
getCount(sprite) {
IDTools.idObj(sprite);
var key;
key = IDTools.getObjID(sprite);
return this.resultCountDic[key];
}
reset() {
var key;
for (key in this.timeDic) {
this.timeDic[key] = 0;
this.countDic[key] = 0;
}
ObjectTools.clearObj(this.nodeDic);
}
updates() {
ObjectTools.clearObj(this.resultDic);
ObjectTools.insertValue(this.resultDic, this.timeDic);
ObjectTools.clearObj(this.resultCountDic);
ObjectTools.insertValue(this.resultCountDic, this.countDic);
ObjectTools.insertValue(this.resultNodeDic, this.nodeDic);
this.reset();
}
}
class DebugConsts {
constructor() {
}
}
DebugConsts.CLICK_SELECT_COLOR = "#ff0000";
DebugConsts.CANVAS_REC_COLOR = "#FF00FF";
DebugConsts.RECACHE_REC_COLOR = "#00ff00";
DebugConsts.SPRITE_REC_COLOR = "#ff0000";
DebugConsts.SPRITE_REC_LINEWIDTH = 2;
class NodeRecInfo extends Laya.Sprite {
constructor() {
super();
this.recColor = "#00ff00";
this.txt = new Laya.Text();
this.txt.color = "#ff0000";
this.txt.bgColor = "#00ff00";
this.txt.fontSize = 12;
this.addChild(this.txt);
}
setInfo(str) {
this.txt.text = str;
}
setTarget(tar) {
this._tar = tar;
}
showInfo(node) {
this._tar = node;
if (!node)
return;
if (node.destroyed)
return;
this.graphics.clear();
var pointList;
pointList = node._getBoundPointsM(true);
if (!pointList || pointList.length < 1)
return;
pointList = Laya.GrahamScan.pListToPointList(pointList, true);
WalkTools.walkArr(pointList, node.localToGlobal, node);
pointList = Laya.GrahamScan.pointListToPlist(pointList);
NodeRecInfo._disBoundRec = Laya.Rectangle._getWrapRec(pointList, NodeRecInfo._disBoundRec);
this.graphics.drawRect(0, 0, NodeRecInfo._disBoundRec.width, NodeRecInfo._disBoundRec.height, null, DebugConsts.RECACHE_REC_COLOR, 2);
this.pos(NodeRecInfo._disBoundRec.x, NodeRecInfo._disBoundRec.y);
}
fresh() {
this.showInfo(this._tar);
}
clearMe() {
this._tar = null;
}
}
NodeRecInfo._disBoundRec = new Laya.Rectangle();
class ReCacheRecInfo extends NodeRecInfo {
constructor() {
super();
this.isWorking = false;
this.mTime = 0;
this.txt.fontSize = 12;
}
addCount(time = 0) {
this.count++;
this.mTime += time;
if (!this.isWorking) {
this.working = true;
}
}
updates() {
if (!this._tar["displayedInStage"]) {
this.working = false;
this.removeSelf();
}
this.txt.text = ClassTool.getNodeClassAndName(this._tar) + "\n" + "reCache:" + this.count + "\ntime:" + this.mTime;
if (this.count > 0) {
this.fresh();
Laya.Laya.timer.clear(this, this.removeSelfLater);
}
else {
this.working = false;
Laya.Laya.timer.once(ReCacheRecInfo.showTime, this, this.removeSelfLater);
}
this.count = 0;
this.mTime = 0;
}
removeSelfLater() {
this.working = false;
this.removeSelf();
}
set working(v) {
this.isWorking = v;
if (v) {
Laya.Laya.timer.loop(1000, this, this.updates);
}
else {
Laya.Laya.timer.clear(this, this.updates);
}
}
}
ReCacheRecInfo.showTime = 3000;
class CacheAnalyser {
constructor() {
}
static renderLoopBegin() {
DebugInfoLayer.I.cacheViewLayer.graphics.clear();
}
static get I() {
if (!CacheAnalyser._instance) {
CacheAnalyser._instance = new CacheAnalyser();
}
return CacheAnalyser._instance;
}
static set I(value) {
CacheAnalyser._instance = value;
}
static getNodeInfoByNode(node) {
IDTools.idObj(node);
var key;
key = IDTools.getObjID(node);
if (!CacheAnalyser._nodeInfoDic[key]) {
CacheAnalyser._nodeInfoDic[key] = new ReCacheRecInfo();
}
CacheAnalyser._nodeInfoDic[key].setTarget(node);
return CacheAnalyser._nodeInfoDic[key];
}
renderCanvas(sprite, time = 0) {
if (!CacheAnalyser.showCacheSprite)
return;
if (DebugInfoLayer.I.isDebugItem(sprite))
return;
DebugTool.showDisBoundToSprite(sprite, DebugInfoLayer.I.cacheViewLayer, DebugConsts.CANVAS_REC_COLOR, 4);
}
reCacheCanvas(sprite, time = 0) {
if (!CacheAnalyser.showRecacheSprite)
return;
if (DebugInfoLayer.I.isDebugItem(sprite))
return;
var info;
info = CacheAnalyser.getNodeInfoByNode(sprite);
info.addCount(time);
CacheAnalyser.counter.addTime(sprite, time);
if (!info.parent) {
DebugInfoLayer.I.nodeRecInfoLayer.addChild(info);
}
}
}
CacheAnalyser.counter = new ObjTimeCountTool();
CacheAnalyser._nodeInfoDic = {};
CacheAnalyser.showCacheSprite = false;
CacheAnalyser.showRecacheSprite = true;
class Notice extends Laya.EventDispatcher {
constructor() { super(); }
static get I() {
if (!Notice._instance) {
Notice._instance = new Notice();
}
return Notice._instance;
}
static set I(value) {
Notice._instance = value;
}
static notify(type, data = null) {
Notice.I.event(type, data);
}
static listen(type, _scope, fun, args = null, cancelBefore = false) {
if (cancelBefore)
Notice.cancel(type, _scope, fun);
Notice.I.on(type, _scope, fun, args);
}
static cancel(type, _scope, fun) {
Notice.I.off(type, _scope, fun);
}
}
class DButton extends Laya.Text {
constructor() {
super();
this.bgColor = "#ffff00";
this.wordWrap = false;
this.mouseEnabled = true;
}
}
class DisplayHook {
constructor() {
this._matrix = new Laya.Matrix();
this._point = new Laya.Point();
this._rect = new Laya.Rectangle();
this._event = Laya.Event.EMPTY;
this.isGetting = false;
this._stage = Laya.Laya.stage;
this.init(Laya.Render.context.canvas);
}
static initMe() {
if (!DisplayHook.instance) {
DisplayHook.instance = new DisplayHook();
DisplayHook.selectNodeUnderMouse = DebugTool.selectNodeUnderMouse;
DebugTool.selectNodeUnderMouse = () => {
DisplayHook.instance.selectDisUnderMouse();
DisplayHook.selectNodeUnderMouse();
};
}
}
init(canvas) {
if (window.navigator.msPointerEnabled) {
canvas.style['-ms-content-zooming'] = 'none';
canvas.style['-ms-touch-action'] = 'none';
}
var _this = this;
document.addEventListener('mousedown', (e) => {
this._event._stoped = false;
DisplayHook.isFirst = true;
_this.check(_this._stage, e.offsetX, e.offsetY, _this.onMouseDown, true, false);
}, true);
document.addEventListener('touchstart', (e) => {
this._event._stoped = false;
DisplayHook.isFirst = true;
var touches = e.changedTouches;
for (var i = 0, n = touches.length; i < n; i++) {
var touch = touches[i];
initEvent(touch, e);
_this.check(_this._stage, _this.mouseX, _this.mouseY, _this.onMouseDown, true, false);
}
}, true);
function initEvent(e, event = null) {
_this._event._stoped = false;
_this._event.nativeEvent = event || e;
_this._target = null;
if (e.offsetX) {
_this.mouseX = e.offsetX;
_this.mouseY = e.offsetY;
}
else {
_this.mouseX = e.clientX - Laya.Laya.stage.offset.x;
_this.mouseY = e.clientY - Laya.Laya.stage.offset.y;
}
}
}
onMouseMove(ele, hit) {
this.sendEvent(ele, Laya.Event.MOUSE_MOVE);
return;
}
onMouseUp(ele, hit) {
hit && this.sendEvent(ele, Laya.Event.MOUSE_UP);
}
onMouseDown(ele, hit) {
if (hit) {
ele.$_MOUSEDOWN = true;
this.sendEvent(ele, Laya.Event.MOUSE_DOWN);
}
}
sendEvent(ele, type) {
if (!this._event._stoped) {
ele.event(type, this._event.setTo(type, ele, ele));
if (type === Laya.Event.MOUSE_UP && ele.$_MOUSEDOWN) {
ele.$_MOUSEDOWN = false;
ele.event(Laya.Event.CLICK, this._event.setTo(Laya.Event.CLICK, ele, ele));
}
}
}
selectDisUnderMouse() {
DisplayHook.isFirst = true;
this.check(Laya.Laya.stage, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY, null, true, false);
}
getDisUnderMouse() {
this.isGetting = true;
DisplayHook.isFirst = true;
DebugTool.target = null;
this.check(Laya.Laya.stage, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY, null, true, false);
this.isGetting = false;
return DebugTool.target;
}
check(sp, mouseX, mouseY, callBack, hitTest, mouseEnable) {
if (sp == DebugTool.debugLayer)
return false;
if (sp == DebugInfoLayer.I)
return false;
if (this.isGetting && sp == DebugInfoLayer.I)
return false;
if (!sp.visible || sp.getSelfBounds().width <= 0)
return false;
var isHit = false;
mouseEnable = true;
if (mouseEnable) {
var graphicHit = false;
if (hitTest) {
this._rect = sp.getBounds();
isHit = this._rect.contains(mouseX, mouseY);
this._point.setTo(mouseX, mouseY);
sp.fromParentPoint(this._point);
mouseX = this._point.x;
mouseY = this._point.y;
}
if (isHit) {
var flag = false;
for (var i = sp._children.length - 1; i > -1; i--) {
var child = sp._children[i];
(flag = this.check(child, mouseX, mouseY, callBack, hitTest, true));
if (flag)
break;
}
graphicHit = sp.getGraphicBounds().contains(mouseX, mouseY);
isHit = flag || graphicHit;
if (isHit && !flag && DisplayHook.isFirst) {
DisplayHook.isFirst = false;
if (!(sp instanceof DButton)) {
DebugTool.target = sp;
if (!this.isGetting) {
DebugTool.autoWork();
Notice.notify(DisplayHook.ITEM_CLICKED, sp);
}
}
}
}
}
return isHit;
}
}
DisplayHook.ITEM_CLICKED = "ItemClicked";
DisplayHook.isFirst = false;
class ClickSelectTool {
constructor() {
this._selectTip = new Laya.Sprite();
this._selectTip.setSelfBounds(new Laya.Rectangle(0, 0, 0, 0));
Notice.listen(DisplayHook.ITEM_CLICKED, this, this.itemClicked);
}
static get I() {
if (!ClickSelectTool._I)
ClickSelectTool._I = new ClickSelectTool();
return ClickSelectTool._I;
}
beginClickSelect(complete = null) {
this.completeHandler = complete;
ClickSelectTool.isClickSelectState = true;
this.clickSelectChange();
}
clickSelectChange() {
if (!Laya.Browser.onPC)
return;
this.tSelectTar = null;
this.clearSelectTip();
if (ClickSelectTool.isClickSelectState) {
Laya.Laya.timer.loop(200, this, this.updateSelectTar, null, true);
}
else {
Laya.Laya.timer.clear(this, this.updateSelectTar);
}
}
clearSelectTip() {
this._selectTip.removeSelf();
}
updateSelectTar() {
this.clearSelectTip();
this.tSelectTar = DisplayHook.instance.getDisUnderMouse();
if (!this.tSelectTar) {
return;
}
if (DebugInfoLayer.I.isDebugItem(this.tSelectTar))
return;
var g;
g = this._selectTip.graphics;
g.clear();
var rec;
rec = NodeUtils.getGRec(this.tSelectTar);
DebugInfoLayer.I.popLayer.addChild(this._selectTip);
g.drawRect(0, 0, rec.width, rec.height, null, DebugConsts.CLICK_SELECT_COLOR, 2);
this._selectTip.pos(rec.x, rec.y);
}
itemClicked(tar) {
if (!ClickSelectTool.isClickSelectState)
return;
if (ClickSelectTool.ignoreDebugTool) {
if (DebugInfoLayer.I.isDebugItem(tar))
return;
}
DebugTool.showDisBound(tar);
if (this.completeHandler) {
this.completeHandler.runWith(tar);
}
ClickSelectTool.isClickSelectState = false;
this.clickSelectChange();
}
}
ClickSelectTool.isClickSelectState = false;
ClickSelectTool.ignoreDebugTool = false;
class RenderSpriteHook {
constructor() {
}
static init() {
if (RenderSpriteHook._oldCanvas)
return;
RenderSpriteHook._oldCanvas = Laya.RenderSprite["prototype"]["_canvas"];
Laya.RenderSprite["prototype"]["_canvas"] = RenderSpriteHook["prototype"]["_canvas"];
}
_canvas(sprite, context, x, y) {
var _cacheStyle = sprite._cacheStyle;
var _next = this._next;
var _repaint;
if (!_cacheStyle.enableCanvasRender) {
RenderSpriteHook._oldCanvas.call(this, sprite, context, x, y);
return;
}
if (sprite._needRepaint() || (!_cacheStyle.canvas)) {
_repaint = true;
}
else {
_repaint = false;
}
var preTime;
preTime = Laya.Browser.now();
RenderSpriteHook._oldCanvas.call(this, sprite, context, x, y);
if (_repaint) {
CacheAnalyser.I.reCacheCanvas(sprite, Laya.Browser.now() - preTime);
}
else {
CacheAnalyser.I.renderCanvas(sprite, Laya.Browser.now() - preTime);
}
}
}
RenderSpriteHook.IMAGE = 0x01;
RenderSpriteHook.FILTERS = 0x02;
RenderSpriteHook.ALPHA = 0x04;
RenderSpriteHook.TRANSFORM = 0x08;
RenderSpriteHook.CANVAS = 0x10;
RenderSpriteHook.BLEND = 0x20;
RenderSpriteHook.CLIP = 0x40;
RenderSpriteHook.STYLE = 0x80;
RenderSpriteHook.GRAPHICS = 0x100;
RenderSpriteHook.CUSTOM = 0x200;
RenderSpriteHook.ENABLERENDERMERGE = 0x400;
RenderSpriteHook.CHILDS = 0x800;
RenderSpriteHook.INIT = 0x11111;
RenderSpriteHook.renders = [];
class SpriteRenderHook {
constructor() {
this._repaint = 1;
this._renderType = 1;
}
static init() {
if (SpriteRenderHook.I)
return;
SpriteRenderHook.I = new SpriteRenderHook();
SpriteRenderHook.setRenderHook();
}
static setRenderHook() {
Laya.Sprite["prototype"]["render"] = SpriteRenderHook.I.render;
}
static showDisplayBorder(sprite, ifShowBorder = true) {
sprite[SpriteRenderHook.ShowBorderSign] = ifShowBorder;
}
static isDisplayShowBorder(sprite) {
return sprite[SpriteRenderHook.ShowBorderSign];
}
render(context, x, y) {
if (this == Laya.Laya.stage) {
CacheAnalyser.renderLoopBegin();
}
var preTime;
preTime = Laya.Browser.now();
if (this[SpriteRenderHook.ShowBorderSign]) {
DebugTool.showDisBoundToSprite(this, DebugInfoLayer.I.cacheViewLayer, DebugConsts.SPRITE_REC_COLOR, DebugConsts.SPRITE_REC_LINEWIDTH);
}
Laya.RenderSprite.renders[this._renderType]._fun(this, context, x + this._x, y + this._y);
this._repaint = 0;
RenderAnalyser.I.render(this, Laya.Browser.now() - preTime);
}
}
SpriteRenderHook.ShowBorderSign = "ShowBorderSign";
class JSTools {
constructor() {
}
static showToBody(el, x = 0, y = 0) {
Laya.Browser.document.body.appendChild(el);
var style;
style = el.style;
style.position = "absolute";
style.top = y + "px";
style.left = x + "px";
}
static showToParent(el, x = 0, y = 0, parent = null) {
parent.appendChild(el);
var style;
style = el.style;
style.position = "absolute";
style.top = y + "px";
style.left = x + "px";
}
static addToBody(el) {
Laya.Browser.document.body.appendChild(el);
}
static setPos(el, x, y) {
var style;
style = el.style;
style.top = y + "px";
style.left = x + "px";
}
static setSize(el, width, height) {
var style;
style = el.style;
style.width = width + "px";
style.height = height + "px";
}
static setTransform(el, mat) {
var style;
style = el.style;
style.transformOrigin = style.webkitTransformOrigin = style.msTransformOrigin = style.mozTransformOrigin = style.oTransformOrigin = "0px 0px 0px";
style.transform = style.webkitTransform = style.msTransform = style.mozTransform = style.oTransform = "matrix(" + mat.toString() + ")";
}
static noMouseEvent(el) {
var style;
style = el.style;
style["pointer-events"] = "none";
}
static setMouseEnable(el, enable) {
var style;
style = el.style;
style["pointer-events"] = enable ? "auto" : "none";
}
static setZIndex(el, zIndex) {
var style;
style = el.style;
style["z-index"] = zIndex;
}
static showAboveSprite(el, sprite, dx = 0, dy = 0) {
var pos;
pos = new Laya.Point();
pos = sprite.localToGlobal(pos);
pos.x += dx;
pos.y += dy;
pos.x += Laya.Laya.stage.offset.x;
pos.y += Laya.Laya.stage.offset.y;
JSTools.showToBody(el, pos.x, pos.y);
}
static removeElement(el) {
Laya.Browser.removeElement(el);
}
static isElementInDom(el) {
return el && el.parentNode;
}
static getImageSpriteByFile(file, width = 0, height = 0) {
var reader;
reader = new FileReader();
reader.readAsDataURL(file);
var sprite;
sprite = new Laya.Sprite();
reader.onload = function (e) {
var txt;
txt = new Laya.Texture();
txt.load(reader.result);
sprite.graphics.drawTexture(txt, 0, 0, width, height);
};
return sprite;
}
static getPixelRatio() {
if (JSTools._pixelRatio > 0)
return JSTools._pixelRatio;
var canvas = Laya.Browser.createElement("canvas");
var context = canvas.getContext('2d');
var devicePixelRatio = Laya.Browser.window.devicePixelRatio || 1;
var backingStoreRatio = context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;
var ratio = devicePixelRatio / backingStoreRatio;
console.log("pixelRatioc:", ratio);
JSTools._pixelRatio = ratio;
return ratio;
}
}
JSTools._pixelRatio = -1;
class DebugPanel {
constructor() {
this.preValueO = {};
this.height = 300;
this.width = 600;
this.dragArea = 10;
this.fromMe = false;
this._init();
}
static enable(underGame = true, bgColor = "#ffffff") {
if (!DebugPanel._enable && !DebugPanel.I) {
DebugPanel._enable = true;
DebugPanel.overlay = !underGame;
DivScripts.init();
DisplayHook.initMe();
DebugTool.initBasicFunctions();
RenderSpriteHook.init();
SpriteRenderHook.init();
DebugPanel.I = new DebugPanel();
DebugPanel.I.setRoot(Laya.Laya.stage);
CacheAnalyser.showRecacheSprite = false;
if (bgColor) {
DebugPanel.I.div.style.background = bgColor;
}
}
}
static getSpriteTreeArr(sprite) {
var rst;
rst = {};
rst[DebugPanel.LabelSign] = "" + ClassTool.getNodeClassAndName(sprite);
rst.target = sprite;
IDTools.idObj(sprite);
rst.id = IDTools.getObjID(sprite);
var childs;
childs = sprite._children;
var i, len;
len = childs.length;
var childsList;
childsList = [];
rst[DebugPanel.ChildrenSign] = childsList;
for (i = 0; i < len; i++) {
childsList.push(DebugPanel.getSpriteTreeArr(childs[i]));
}
return rst;
}
removeNoDisplayKeys(arr) {
var i;
for (i = arr.length - 1; i >= 0; i--) {
if (DebugPanel.noDisplayKeys[arr[i]]) {
arr.splice(i, 1);
}
}
}
updateShowKeys() {
DebugPanel.tObjKeys.length = 0;
if (!this.tShowObj)
return;
DebugPanel.tObjKeys = ClassTool.getObjectDisplayAbleKeys(this.tShowObj, DebugPanel.tObjKeys);
if (this.tShowObj == Laya.Laya.stage) {
this.removeNoDisplayKeys(DebugPanel.tObjKeys);
}
DebugPanel.tObjKeys.sort(Laya.MathUtil.sortSmallFirst);
}
static getObjectData(data) {
var dataList;
var tData;
var key;
var tValue;
var tType;
dataList = [];
var keys;
keys = DebugPanel.tObjKeys;
var i, len;
len = keys.length;
for (i = 0; i < len; i++) {
key = keys[i];
tValue = data[key];
tType = typeof (tValue);
if (key.charAt(0) == "_")
continue;
if (DebugPanel.displayTypes[tType]) {
tData = {};
tData["key"] = key;
tData["value"] = tValue;
tData["type"] = tType;
dataList.push(tData);
}
}
return dataList;
}
_init() {
this.div = Laya.Browser.document.createElement('div');
Laya.Browser.document.body.appendChild(this.div);
this.clickedHandler = new Laya.Handler(this, this.onClickSelected);
this.debug_view = Laya.Browser.window.layaair_debug_view;
this.debug_view.initLayaAirDebugView(this.div);
this.debug_view.tree.attachEvent("onSelect", (id) => {
var dataO;
dataO = this.getDataByID(id, this._treeDataList[0]);
if (dataO.target) {
DebugTool.showDisBound(dataO.target);
this.showTargetInfo(dataO.target);
}
});
this.debug_view.setValueChangeHandler((data, new_value) => {
this.onValueChange(data, new_value);
});
this.debug_view.onRefresh(() => {
DebugPanel.I.setRoot(Laya.Laya.stage);
});
this.debug_view.onInspectElement(() => {
ClickSelectTool.I.beginClickSelect(this.clickedHandler);
});
this.debug_view.onLogInfo(() => {
console.log(this.tShowObj);
});
this.debug_view.onPrintEnabledNodeChain(() => {
DebugTool.traceDisMouseEnable(this.tShowObj);
});
this.debug_view.onPrintSizeChain(() => {
DebugTool.traceDisSizeChain(this.tShowObj);
});
this.debug_view.onToggleVisibility((selectd) => {
if (this.tShowObj) {
this.tShowObj.visible = this.debug_view.getVisibility();
}
});
this.debug_view.onToggleDebugBorder((selectd) => {
if (!this.tShowObj)
return;
SpriteRenderHook.showDisplayBorder(this.tShowObj, this.debug_view.getShowDebugBorder());
});
this.debug_view.onToggleShowCurrentCache((selectd) => {
CacheAnalyser.showRecacheSprite = this.debug_view.getShowCurrentCache();
});
this.debug_view.onToggleShowAllCache((selectd) => {
CacheAnalyser.showCacheSprite = this.debug_view.getShowAllCache();
});
this.debug_view.onToggleShowAtlas((selectd) => {
console.log("toggle show atlas:", this.debug_view.getShowAtlas());
if (this.debug_view.getShowAtlas()) {
AtlasTools.getInstance().start();
}
else {
AtlasTools.getInstance().end();
}
});
JSTools.showToBody(this.div, 0, 0);
this.initNewDivs();
this.initDragWork();
this.initTreeWidthDrag();
Laya.Laya.stage.on(Laya.Event.RESIZE, this, this.adptPos);
this.adptPos();
}
initNewDivs() {
var parentNode;
parentNode = Laya.Browser.document.getElementById("show_current_cache_control").parentNode;
var switchNode;
switchNode = Laya.Browser.createElement("input");
switchNode.type = "checkbox";
parentNode.appendChild(switchNode);
parentNode.append("右侧");
function onSwitchChange(e) {
if (e.target.checked) {
DebugPanel.sideType = DebugPanel.Right;
}
else {
DebugPanel.sideType = DebugPanel.Bottom;
}
this.adptPos();
}
switchNode.addEventListener("change", onSwitchChange.bind(this));
}
static getOffset(e, sign) {
var target;
target = e.target;
var cTarget;
cTarget = e.currentTarget;
var kSign;
if (sign == "X") {
kSign = "offsetLeft";
}
else {
kSign = "offsetTop";
}
var value;
value = e["offset" + sign];
while (target && target != cTarget) {
value += target[kSign];
target = target.offsetParent;
}
return value;
}
initTreeWidthDrag() {
var leftDiv;
var rightDiv;
leftDiv = Laya.Browser.document.getElementById("tree_container");
var parentNode;
parentNode = leftDiv.parentNode;
rightDiv = parentNode.children[1];
var isMouseDown = false;
function onDivMouseMove(e) {
var abs;
abs = Math.abs(DebugPanel.getOffset(e, "X") - leftDiv.clientWidth);
if (abs < this.dragArea) {
this.div.style.cursor = "e-resize";
}
else {
this.div.style.cursor = "auto";
}
}
function onDivMouseDown(e) {
var abs;
abs = Math.abs(DebugPanel.getOffset(e, "X") - leftDiv.clientWidth);
if (abs < this.dragArea) {
this.div.style.cursor = "e-resize";
isMouseDown = true;
}
else {
isMouseDown = false;
return;
}
e.stopPropagation();
}
function onBodyMouseMove(e) {
if (!isMouseDown)
return;
leftDiv.style.width = DebugPanel.getOffset(e, "X") + "px";
e.stopPropagation();
}
function onDivMouseUp(e) {
if (!isMouseDown)
return;
isMouseDown = false;
e.stopPropagation();
}
parentNode.addEventListener("mousedown", onDivMouseDown.bind(this), true);
parentNode.addEventListener("mousemove", onDivMouseMove.bind(this), true);
Laya.Browser.document.body.addEventListener("mousemove", onBodyMouseMove.bind(this));
Laya.Browser.document.body.addEventListener("mouseup", onDivMouseUp.bind(this));
}
initDragWork() {
var isMouseDown = false;
var preX;
var preY;
function onDivMouseMove(e) {
if (DebugPanel.sideType == DebugPanel.Bottom) {
if (DebugPanel.getOffset(e, "Y") < this.dragArea) {
this.div.style.cursor = "n-resize";
}
else {
this.div.style.cursor = "auto";
}
}
else {
if (DebugPanel.getOffset(e, "X") < this.dragArea) {
this.div.style.cursor = "e-resize";
}
else {
this.div.style.cursor = "auto";
}
}
}
function onDivMouseDown(e) {
if (DebugPanel.sideType == DebugPanel.Bottom) {
if (DebugPanel.getOffset(e, "Y") > this.dragArea)
return;
}
else {
if (DebugPanel.getOffset(e, "X") > this.dragArea)
return;
}
isMouseDown = true;
preX = e.pageX;
preY = e.pageY;
e.stopPropagation();
}
function onBodyMouseMove(e) {
if (!isMouseDown)
return;
var curX;
var curY;
var dX;
var dY;
curX = e.pageX;
curY = e.pageY;
dX = curX - preX;
dY = curY - preY;
if (DebugPanel.sideType == DebugPanel.Bottom) {
this.height -= dY;
}
else {
this.width -= dX;
}
this.adptPos();
preX = curX;
preY = curY;
e.stopPropagation();
}
function onDivMouseUp(e) {
if (!isMouseDown)
return;
isMouseDown = false;
e.stopPropagation();
}
this.div.addEventListener("mousedown", onDivMouseDown.bind(this), true);
this.div.addEventListener("mousemove", onDivMouseMove.bind(this), true);
Laya.Browser.document.body.addEventListener("mousemove", onBodyMouseMove.bind(this));
Laya.Browser.document.body.addEventListener("mouseup", onDivMouseUp.bind(this));
}
onClickSelected(target) {
if (!this._treeDataList)
return;
this.debug_view.tree.selectItem(IDTools.getObjID(target));
this.debug_view.bounceUpInspectButton();
}
updateLoop() {
if (this.tShowObj) {
this.showTargetInfo(this.tShowObj);
}
}
onSelectItem(obj) {
var tTarget;
tTarget = obj.target;
this.showTargetInfo(tTarget);
}
static mParseFloat(v) {
var rst;
rst = parseFloat(v);
if (isNaN(rst))
return 0;
return rst;
}
onValueChange(obj, newValue) {
if (obj["type"] == "number") {
newValue = DebugPanel.mParseFloat(newValue);
}
if (obj["type"] == "boolean") {
newValue = newValue.toString() == "true";
}
if (this.tShowObj) {
var key;
key = obj["key"];
this.tShowObj[key] = this.preValueO[key] = newValue;
}
}
showTargetInfo(tTarget) {
if (!tTarget)
return;
this.debug_view.setVisibility(tTarget.visible);
this.debug_view.setShowDebugBorder(SpriteRenderHook.isDisplayShowBorder(tTarget));
var i, len;
len = DebugPanel.tObjKeys.length;
var key;
if (this.tShowObj == tTarget) {
for (i = 0; i < len; i++) {
key = DebugPanel.tObjKeys[i];
if (this.preValueO[key] != tTarget[key]) {
this.debug_view.changeValueByLabel(key, tTarget[key]);
}
}
}
else {
this.tShowObj = tTarget;
this.updateShowKeys();
var dataList;
dataList = DebugPanel.getObjectData(tTarget);
this.debug_view.setContents(dataList);
}
for (i = 0; i < len; i++) {
key = DebugPanel.tObjKeys[i];
if (key !== "__proto__") {
this.preValueO[key] = tTarget[key];
}
}
}
adptPos() {
if (this.fromMe)
return;
this.fromMe = true;
if (DebugPanel.sideType == DebugPanel.Bottom) {
JSTools.setPos(this.div, 0, Laya.Browser.clientHeight - this.height);
this.debug_view.resize(Laya.Browser.clientWidth, this.height);
if (!DebugPanel.overlay) {
Laya.Laya.stage.setScreenSize(Laya.Browser.clientWidth * Laya.Browser.pixelRatio, (Laya.Browser.clientHeight - this.height) * Laya.Browser.pixelRatio);
}
}
else {
JSTools.setPos(this.div, Laya.Browser.clientWidth - this.width, 0);
this.debug_view.resize(this.width, Laya.Browser.clientHeight);
if (!DebugPanel.overlay) {
let newWidth = 0;
if (Laya.Browser.clientWidth > this.width) {
newWidth = (Laya.Browser.clientWidth - this.width) * Laya.Browser.pixelRatio;
}
Laya.Laya.stage.setScreenSize(newWidth, Laya.Browser.clientHeight * Laya.Browser.pixelRatio);
}
}
this.fromMe = false;
}
setRoot(sprite) {
var mtreeo;
mtreeo = DebugPanel.getSpriteTreeArr(sprite);
this._treeDataList = [mtreeo];
var wraped;
wraped = {};
wraped.id = 0;
wraped.item = [mtreeo];
this.debug_view.setTree(wraped);
Laya.Laya.timer.loop(500, this, this.updateLoop);
}
getDataByID(targetID, nodeO) {
if (!nodeO)
return null;
if (targetID == nodeO.id)
return nodeO;
var childs;
childs = nodeO[DebugPanel.ChildrenSign];
if (!childs)
return null;
var i, len;
len = childs.length;
var tRst;
for (i = 0; i < len; i++) {
tRst = this.getDataByID(targetID, childs[i]);
if (tRst)
return tRst;
}
return null;
}
getDataByTarget(target, nodeO) {
if (!nodeO)
return null;
if (target == nodeO.target)
return nodeO;
var childs;
childs = nodeO[DebugPanel.ChildrenSign];
if (!childs)
return null;
var i, len;
len = childs.length;
var tRst;
for (i = 0; i < len; i++) {
tRst = this.getDataByTarget(target, childs[i]);
if (tRst)
return tRst;
}
return null;
}
}
DebugPanel._enable = false;
DebugPanel.ChildrenSign = "item";
DebugPanel.LabelSign = "text";
DebugPanel.displayTypes = { "boolean": true, "number": true, "string": true };
DebugPanel.displayKeys = [["x", "number"], ["y", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"]];
DebugPanel.tObjKeys = [];
DebugPanel.noDisplayKeys = { "desginWidth": true, "desginHeight": true };
DebugPanel.Bottom = "bottom";
DebugPanel.Right = "right";
DebugPanel.sideType = DebugPanel.Bottom;
class Base64ImageTool {
constructor() {
}
static getCanvasPic(img) {
img = img.bitmap;
var canvas = Laya.Browser.createElement("canvas");
var ctx = canvas.getContext('2d');
canvas.height = img.height;
canvas.width = img.width;
ctx.drawImage(img.bitmap, 0, 0);
return canvas;
}
static getBase64Pic(img) {
return Base64ImageTool.getCanvasPic(img).toDataURL("image/png");
}
static getPreloads(base64Data) {
var rst;
rst = [];
var key;
for (key in base64Data) {
rst.push({ url: base64Data[key], type: Laya.Loader.IMAGE });
}
return rst;
}
}
class Base64Atlas {
constructor(data, idKey = null) {
this.data = data;
if (!idKey)
idKey = Math.random() + "key";
this.idKey = idKey;
this.init();
}
init() {
this.replaceO = {};
var key;
for (key in this.data) {
this.replaceO[key] = this.idKey + "/" + key;
}
}
getAdptUrl(url) {
return this.replaceO[url];
}
preLoad(completeHandler = null) {
this._loadedHandler = completeHandler;
Laya.Laya.loader.load(Base64ImageTool.getPreloads(this.data), new Laya.Handler(this, this.preloadEnd));
}
preloadEnd() {
var key;
for (key in this.data) {
var tx;
tx = Laya.Laya.loader.getRes(this.data[key]);
Laya.Loader.cacheRes(this.replaceO[key], tx);
}
if (this._loadedHandler) {
this._loadedHandler.run();
}
}
replaceRes(uiObj) {
ObjectTools.replaceValue(uiObj, this.replaceO);
}
}
class Base64AtlasManager {
constructor() {
}
static replaceRes(uiO) {
Base64AtlasManager.base64.replaceRes(uiO);
}
}
Base64AtlasManager.dataO = { "comp/button1.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABRCAYAAAApS3MNAAABSUlEQVR4Xu3a0QmFMADFUJ1JXM0h3moPZ6qg4AoNeLqAIenFn65jjLE40w2sQkxvcAMI0eggRKSDEEJUDEQ4/COEiBiIYFiEEBEDEQyLECJiIIJhEUJEDEQwLEKIiIEIhkUIETEQwbAIISIGIhgWIUTEQATDIoSIGIhgWIQQEQMRDIsQImIggnEvYvv9IzjfxDiP/XlgJsTcCyDEXP/v14UQImIggmERQkQMRDAsQoiIgQiGRQgRMRDBsAghIgYiGBYhRMRABMMihIgYiGBYhBARAxEMixAiYiCCYRFCRAxEMCxCiIiBCMa7iAjPpzG8fY3kF0KIiIEIhkUIETEQwbAIISIGIhgWIUTEQATDIoSIGIhgWIQQEQMRDIsQImIggmERQkQMRDAsQoiIgQiGRQgRMRDBsAghIgYiGBYhRMRABMMihIgYiGBcGJiOHTRZjZAAAAAASUVORK5CYII=", "comp/line2.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAAG0lEQVQYV2NkoDJgpLJ5DIxtra3/qWko1V0IAJvgApS1libIAAAAAElFTkSuQmCC", "view/create.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAkCAYAAAC9itu8AAAAdElEQVQ4T2NkwAIWLFjwH5t4QkICIyM2CXQxmAHka/j///9mXDYxMjL6YtgwBDUg+w8crIT8MBQ0oEca55JvWNPS9xgu4tISzADyNfz///8MnrRkgmHDENSALWng9fRQ0DA40xLecglbWhpqGoZCMUNKUQkANAHAJVkE5XwAAAAASUVORK5CYII=", "view/rendertime.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAkCAYAAAC9itu8AAABeUlEQVQ4T+2Uv0tCURSAvyNdcwiXBlsaaomWFgeHlqAtCPsDJHwIiUtDSxERtErtmQ6CjkHo4FpDBQ0tbVFR0BYE0eQvOnFF7T17QlOTd3m88873OD8+rtA9uVzOBIPBlIisAwvd8B1QajQahXQ63bIx6QHFYrEEJHrv7qeqZhzHOfYA+Xw+Yow5B+YHoGwymdxW1QAQEFWNAk8i8uEDuZM3gUcLZIEJYNcNqWrVcZyd7p9t8jLwYIFTYBx47UHlcjmcSCQ+B5JtpU0LnAFj3br7kE+yTalb4BCYczVqoT3AjteW4T73FlgFNgY+1IGQz4hPLGCAI2DGbweu2Auw1Vmcqk4C+8DsEOgZOBCR9/6mVdU2vgIsAdOuIVwANRFpezatuahpTYVSop1m+y6pasm8NQqSvvW61KwslkSHuCRkgvErr0taiUXaal1Sr0siWRO/9HfpF+RN9nfpB/qqmrXrv7mktVhYVm5GLo1cct9LI5e8d84/3UvfAgdlKH0EO7MAAAAASUVORK5CYII=", "view/cache.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAkCAYAAABSSLCCAAAAcElEQVQ4T2NcsGDB/4SEBEYGBgYGYtmMxCpENhhsA6mA8f///5tHNTEwkBcQpIYcSD15kUtWigi51vR/jVYdOGUQy2YkViGywWSnvTOkhiAonkY1gZIRqSEHTntkRe4g10RWQIyWe5Bgo2O5R7dkBADztyP+yFzirAAAAABJRU5ErkJggg==", "comp/clip_selectBox.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAoCAYAAAAIeF9DAAAAsElEQVRoQ+3ZQQ0AMQzEwAuqEgh/Sj2pKObhIrBsrfLonHPu12MMTEGYFg+kIFaPgmA9ClIQzQDG0w0pCGYAw2khBcEMYDgtpCCYAQynhRQEM4DhtJCCYAYwnBZSEMwAhtNCCoIZwHBmd/tTh6IUBIrx/tRbiFWkIFaPFoL1KEhBNAMYTzekIJgBDKeFFAQzgOG0kIJgBjCcFlIQzACG00IKghnAcFpIQTADGE4LwYL8U/BE1dCJ3PsAAAAASUVORK5CYII=", "comp/label.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAASCAYAAACQCxruAAAAmElEQVRoQ+3aMQqAQBBDUef+hx4Zq1mrbPnhWylECHmghVZ397OOqqp97TlugdNzgEXFIaaFuwROt0LmBEay5aXb920+FjIpMJItLy1wvhUyKTCSLS8tcL4VMikwki0vLXC+FTIpMJItLy1wvhUyKTCSLS89wPP1Qeh8M0zy+84gMMbruqjA15OxbtjAu7mPa5bj0fb/A8cLgD4n/wQKNiIAAAAASUVORK5CYII=", "comp/clip_tree_arrow.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQCAYAAAArij59AAAAwUlEQVQoU5WRPRKCMBCFWUt6vYQeB06RUDpoBbFDa7yDwm30FGi9dHnOMiQDBgvT5c3b7+0PRVEUlVV9A3NmzL6T//SRfMz5CgCdtVafjlmzaHAigAbM2tE8YVo1pf0yvABoc9D3wACgBbMKIgD4qqDJsqqlMV8VGL5n/88geCJKlijSMBXFZUNx/CSi9WwX1r7R99thzKKqkxXRbMUWSE2u2sEwHsxHCbrMVSq6N4xRD9HAvJstylEkarhurlqnfQC58YP5+CvQNwAAAABJRU5ErkJggg==", "view/bg_panel.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QQREAAAjDMGZk/l2CDD6pgl7SduexGCBAgAABAgQIECBAgAABAgS+BQ4oyStBhXcy5AAAAABJRU5ErkJggg==", "view/bg_top.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QQREAAAjDMKZp/rWBDD6pgl7SduexGCBAgAABAgQIECBAgAABAgS+BQ6WyDMhXMLeQgAAAABJRU5ErkJggg==", "view/clickselect.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAqCAYAAACDdWrxAAACfElEQVRIS8WVO2iTYRSGn5OWqpMOurg0VRBdVVCsg7GgDjpZECyirl4GEYfSgBlaB5VSpApdxCJIoeKgg7dKC21ALahIiyiKKUjxAiI4qCH1lRP/hPhfAnHpGZPv+c4573nP95ukO/xHmINmtq8RtswsPiipB/gAPAFem5nCbcSWKukIsD84/A2YBh4DL8ysWLkk0qOkDcD5GLF+Ac+Ap35ZHGjAdWB5gtJvgZFYVSWdBHaFwBlg1Mw8K0ngFiAbAm+a2XBij/6HpBbgBrAEmAVeAZ1AFU40QDCWrcBZL0/S4Vq4HtgB7DWzU5XyauDBMhhWz70ryVVdb2ZuhGpI2g1MODjfiMFrxZk3s9WNwJ6snHFxQUlXgXfAPeC5mf2O2Y5oqZLcMceCw1+AseCSSTP7mSiOpM3A7RixfvgYgAd+WUQcSSnfPWBlgtIvgf5YVSVdBA6GQF/mS2bmWcvbERmHJF+payFw0MzO1TWApKXBViwL3h5/Pk4AVTjRAMFY9njJXl6wLccrcD3wAHDUzBwuRw18JtbkbkFJruomM7sf2o4u4Jals/mFRgxeFcfBQm97UyOwM+WMiwums/k3QnMps+HWpuLIRC5TCrcRW2pbT35MRiY4XDRsVmiU5uJQIZfxb0k5Ij229eQPySJ287MLGO8Rd1M0XY6AO3LjzYVSy3fAH+VICL4a6o9VtTWbnzbYGKI+IrtQ6Ns2EFuq/5jOTnWD9f4DikeFvvbqhyg2Yzo3voJSy2fAjfEJMYPRQQ2caAAfC7AW2WkvrzU79dCwnRW4Hjgg6JrrbV9VKbkKw1Csyd2Ca7on1y2krHOub3t16//2n79SarbsH7BKtfejoCjmAAAAAElFTkSuQmCC", "view/resize.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAqCAYAAACDdWrxAAABeUlEQVRIS+2UvUpdURCFvxXRKJpIEBURsVAIiiBoaaGCjY2VLyH4MBaCPoWlnQlpI6SxsQmkURQL5eK/6JK57iuRnMPZtxAkuOFUhzWz96xvjcg8tluAT5LOQqJMHba/AgPAD0nOEtruAOaB6Lon6U+ucAoYTLe7Bb5XCm1/BCaAXqAVOAHyOkYn27PA5/TGWmXHxvBeT2i7TVIM4MUp7ZhGPlY3V/pVKUxEjAIjyac74LIAjK70PwCoyfYXYDJwyqDoHtiRdFOfql0naBgIrILF/ZIi1yH6h1XbYXCPpKOq7s34GEX7JB00m445YBzYlPSQ1dF2N7CaWN2W9DNXuJxAj1uGVeuVQtvh32LyuR34DexWCv+CfAXoBzYkHb8Boe1OSRcFkBdfNY18IQiUtFUpTJjNAPEFHVfAaQFyjZ3zNBzbQ8BSWkZViEbk1uIpjXR8AKbT7jwEvpVUqEk6L0pHLN5hSWWxeq7XjI/v6Sgz0vZ7Ov7DdDwCkcb1m86tSukAAAAASUVORK5CYII=", "view/clickanalyse.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAqCAYAAACDdWrxAAAC7UlEQVRIS5WWT2hUZxTFfyfGFolkoUVKrHQiEaX+IfgHa54UQzUqpWYhLbQU6ULNwgYXuog6yiiTgK2LgtAu6yqbFkpRBEURQzJEBN200NqKkxoDLnQhFUrizJU7vje8SSbzZr7FwDy+c75z7z3nfU80uMxMDin9JC0zewvYAHwIrAH65w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Oa1Wq1jYRg+ZR6A2DxjzP/mPRupfwAf56Q4urCh6QAAAABJRU5ErkJggg==", "view/tab_panel.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAABICAYAAADyMAW8AAAAcUlEQVRYR+3WsQ3AMAhE0TCMeyTvP1tShRQo7lxYegxA8fUPLuac97VhwuKXKhTlFxRQ9GPDClawYvGEDwxIZu7pFRZXr4ACinY1ghWsYMX/NxWQr22edyvGGHt6hcV1NqGAon8QVrCCFYteISDnBuQB3xJuQcDkEngAAAAASUVORK5CYII=", "view/btn_close.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAqCAYAAACz+XvQAAACmUlEQVRIS7WWS0/bUBCFz7mJmyZxENm06mNVoVZC7LqGn9FNqy55/BSWSEhs2/4uuqFVoA150JLKJvGdaiIH2TfXNoKQpeP5PHPO3GMTK/5xxTwsAUWkBeBZ+qAByb/Zh4pIA8CL9NqY5Dj7vw9YA/ABwDsAfwB8ITnUIhF5CuATgNcAfgH4RnJSCkwLl6AA/lXBtLZQQxFxoTr6q6LOFl2WmuJAtcY7ZuXIixsczfRyTlPfhpSN7BpwBeBtFdQLFJE2gI8AXi7GBBBl3Fdnv5L87XbpWxuFfQbw3NXM0dQLLdrDIH3ylGTiLLYB8CS9lpCc3tmU+xzL1Z9lEXl/n06KavjowCiK1uM4fqMd1Ov1s3a7fZntZjabtSeTiQYHgiC4aLVavZwpbofT6TQYDAaH1tod3bMwDHc7nc5PLZrNZmG/3z8WkS1jzGm32z1oNBqjUqD+6YM2m81xFWyeNkUaulAAlyKyWdTZbdqUmZKFakEVrLRDV7P5zY6m3rQp6tA1AMC5tXY7he51Op0fdwbGcdwdDodHWc2MMdcL9wGM1tbW9sMw/L6UNm6HChuNRifW2g1XM0dTL3TJZS1KkkTDFbVaLQqCIJcm6k0URRpxuvg39Xo9rtzDh5zt1Z/lXq+32rR5dKC1dt0YM08bAGd65BxN1ZB52ojIBcl82rgdWmsDkocAdgDoW22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tYKCPLEFWNpSYmsFBXliC7C0pZfY2oWY/zeBP8uaLni/AFTVAAAAAElFTkSuQmCC", "comp/textinput.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFsAAAAWCAYAAACv8OArAAAAZElEQVRYR+3UQQkAMAwEwcZI/LtsoSL2NTGwMByZ3b3HJQIDO3H+EdidNezQGjbsUiBs+dmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4Ew9QBe0R29X9x+dwAAAABJRU5ErkJggg==", "comp/vscroll.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAhCAYAAAA/F0BXAAAAOklEQVRIS2N8+OzVf2YWFgYmJiYGcgHjqCEYQTcaJpipaTRMRsOEmDJmNJ2MppPRdEJMCIymE2JCCQAYonwDuu2VMAAAAABJRU5ErkJggg==", "comp/vscroll$down.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAzCAYAAABxCePHAAAC/klEQVRIS+2WS0wTURSG/zszBcrLFVvjio0LiAqRRDAmGpRodFE1MQQQkOKGqBujRo3ExLjB4MaKgDzUaGQhvoJGYwAjYoioERcuDGxYEIwPkBY6nWvObXuLnXZaSklYOIu5M/fxzZn/nvPPsInJKa5qGhRFQaIH+w8xSbcymtTd+gBFYXAdyjM9sf7ORxgGR0t5/j9jpkhq2t5B0xQwBrgqNsnJ9V0j4BzQdQNtNYXWkKz0NDiaXkBTFTCFoaWmCHVtQ+AGh+4z0HNiO2bmPNYQGiXQvkuPoaqqiIgi8Pl8eHBqtwlA86MKS6Cy8z1gjIFzjqcXHBEBlpBgRNuOd+HVlYqogJiQIChcg/BtW5k8SaSSkxPJ5PRPTttHfkI7kcghIpn8NYfp33NLXp+TnYG1OWvA3ox9499nPSjdkCsgHJxOIjc43VMrugL9dEUD4Oj/PA4CsUfDX/jOjbmisHTDCCzi4t4QgLDrQF+qTYOmqhgYGw9BvLpv0ZNjQwieaU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zjpJItGLlcmhmSkptAB83h9MTuCICxBRUkMwUmY5+uFPY7LmJ7GW05SZycsSos9xUsmSr8BfgGeWI6+BgEAAAAASUVORK5CYII=", "comp/button.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAABFCAYAAAAPWmvdAAABA0lEQVR4Xu3ZMRGDUBRFwXwfKSgxFhfRgAbUxEakkCEO3qmX+p9m5w7NW9v7cz18I4EFbeT1fwxtbgYtmEGDVgRC458GLQiExNKgBYGQWBq0IBASS4MWBEJiadCCQEgsDVoQCImlQQsCIbE0aEEgJJZW0Pbj64Q3hFvQhmL3CQ8atLlAKCwNWhAIiaVBCwIhsTRoQSAklgYtCITE0qAFgZBYGrQgEBJLgxYEQmJp0IJASCwNWhAIiaUVtOfrdMIbwi1oQ7H7hAcN2lwgFJYGLQiExNKgBYGQWBq0IBASS4MWBEJiadCCQEgsDVoQCImlQQsCIbE0aEEgJJYGLQiExNIC2g/MxaMp6CSauwAAAABJRU5ErkJggg==", "view/bg_tool.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMklEQVRYR+3QQREAAAjDMCYG/DsEGXxSBb2ke7YeiwECBAgQIECAAAECBAgQIEDgW+AAAeIuAVS/mngAAAAASUVORK5CYII=", "comp/minBtn.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAA8CAYAAAB1odqiAAAArUlEQVRYR+3X0QmAMAwE0GQN19B9nM193CmiIH7ZXOAoRc/fpjl8jVDdOj/eOc8USBcXqUjLAtDQRMSOdHb3JatTYCZUXodIy10bGxTI1Lx6/YA0Ima6W2tKFcjmdpGKtCow7NBAdxozy+804Gfx/cDqbLzWDzs0ekNY4B9nOMEehMKTVIEEyKeFSKmc18+MppRtipJuYPCa1SkwEyqvo6Tlxm8bFEijvBt9n/QA/fOPydLHcUIAAAAASUVORK5CYII=", "view/zoom_out.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAA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Ua7QdKLapY8015ePrWMJVtembhewLI0YWU4eZvck/Q525pXo4M/AY+TLMP40u+SuooseVjsitm/IakzItz5QcXhKSZsBCyrpdjlwuZwfSO8mLOkdYAHqFXSrRKWvErtXFdOcJcnp0AX96ZwuldQ5uxtTrD+VUmWWXqfujwk8eQ4f68rsuRG+d/gZVb9eIk9kPS6miXvIv91rNc12TXPc5MkTyO/AFhJCujHqZlCAAAAAElFTkSuQmCC", "comp/checkbox.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAqCAYAAACDdWrxAAABbUlEQVRIS+2TP0gCURzHv88GRYsrExyOo5cEQVEtWdQQpE4N0R+HxmirXXCrKYigqMF2IRqCQByaLJqNIFpyUIzu4rIwpExODy88ITD/cJ603Rsf7/OGz+/zI5TSEAE20cZRgBMySKni8XrbwICrWAwG2ESZIadFS53J0R25brCyHZNud1vbcRuPV7fDAOu9GXJatNSZHN2R6wb/PfJCrxOZCR8Gbk6hWc6Xg8PrcgBETMIVPdIGSjYG/NoOSHcfkLqDK3qsBSRIrgRAuBF1quUPEUPhYGMwb2dhywrqQ3F0Dt++jSokJMBdhmDO52pB2WwFP7OK8rgH9os99IgppNf3QWwMFP4RNHKALrmoflIj53l6CaWpRcBkgiIkYHl6gDTrh5JJg57v/kJ1YOUixw7jfWELxMpAKUmAXAR7tg3LZ7am3IbjKDBOvPiDqkUmcoj+9H1d7k3nmHdweBubB70ON9wRzQH8pVVQb+Q/zZAEfpwDCU4AAAAASUVORK5CYII=", "comp/btn_close.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAA8CAYAAAB1odqiAAAE6UlEQVRYR+3Y30+bVRgH8G/T0t/0Jy0USrIsC0E2GMKAVYcRpmSbEzIGZhqyxCxeceGVF3pjvJl/wYyJWZYY4hZBFnBuBBUW2ewYAxlsSMiyLKH8aEt/0vZtSxvM+562We15C6jlxr53zfO8z+ec5z2nOTmCk598tY19fAQs+Hlvz76QX1zpAwd+1NMNXzieU1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WmvDodysB65saEFtZ5cX8Hi+YQDBrS2VKBVRa/jONqKwU05NTBKyrexWxlRUquOnfBBNidrVoZHIZClWF1DqisjLMzPxBwNraasRsdHDD6c7ApDIJVzTMRDJiRQb6EUNkLsPs7DwBa6qrELPZqCNzu/1pG1siEUOhkHK5wWAYkUg0La7T0U9tIrMZc/MLBKw+XImtZTrIMBFEouQkIBEXQJaYXXJ0O8WTeQXlZsw/XSRg1SsVvGDWpbuHIAsu/LlEwMrKCsQDAcQ93j2U2H2qUKuBUKnE4uISBF9f/Hj7wJwVhyordl/hH2Q+W1zCixoLOdNUj98Ei+byYbH5lnPkmJhL6O+18/c0/1m38/c0qVbm72nYVuTvadgu5O9pUtsif0+Tv6dhF8P/657mLz4NfQVdLmZiAAAAAElFTkSuQmCC", "comp/textarea.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFsAAAAXCAYAAABkrDOOAAAA4klEQVRoQ+3ZvQrCMBiF4e9rU+sPOErRqxDRe/KG9Fp0EAc3VzuIg1ML4uDmlkaaquDenMUTyJoDD+8W3ZyKlaoshSeogHOy1m1euOmoI1EU+auqQUf/8XHnnBzLp3jsWdaVJEnEGEPsADXU2Ifro8Gej/uSpqnHruvmaVegqirZX+4N9mIy8Nh13XEct7vE18RaK7vzjdiIFoiNUH5vEJvYQAHgFMsmNlAAOMWyiQ0UAE6xbGIDBYBTLJvYQAHgFMsmNlAAOMWyiQ0UAE79lM2fmrDy358a/q6Hhf68ng175QueKdEXxUGVVwAAAABJRU5ErkJggg==", "view/re.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAACpklEQVRIS+WWPUgcQRiG3+8O70QEUwTB1EJgsTGdRRrhOMjOtEtSRbBIBMFKuCtkZleES2uRQoWQJggKKW7Of7GyTRvBLkVShhS73OXMfWGOU85Es7uXs0m2XeZh+OZ95xnCHX10R1ykBvu+P5fP59+VSqVvf9pUarBS6jWAR0Q0rbWOboP3BCaiOQAHA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MH61RpdQ0Mx8z8zMzHxLRAYBlAG0Al2ma7hpjHqxbqgNeAJgHcKW1XutEMeE4Ttv3/axXC1dh9XPgbZqmW8aYd9t3ohCVUt4BWARwkyTJZhzHH7Zgdq4MvQbw7ThOw/f9zypgKVoVsS7UX+C+v+kgeI0Oklrvb0Yw03rwlZW8Hnz14OvqjXrw1e/pPyfwCww91CttlMG7AAAAAElFTkSuQmCC", "view/save.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAAA1klEQVRIS+2VzQ3DIAyFwxwdoMMAA/VQ8ZByyEBhmA7QOVxxKLIaOcIoSZUfrlifHw/wM91Ky6zE7SZgANTaDEDhzYJ5odSMC7nA5U7+b4X2dVQr3ic4hHCTlMcY33xPZUUGcwBvdEJwjcfGGIQQ4rd2qenWA3hyAUuABwCP31NtN+i1v02qP4DicRybM885J2ceB/NCyUupfuLxBS4WbmKF9rNUv4p9gq21d0l5SunF91RWZDAH8EYnBNd4nDPPWitnXst0I6Leez+feVowEQ3e+wNk3ge7C/Qp3GfwkgAAAABJRU5ErkJggg==" };
Base64AtlasManager.base64 = new Base64Atlas(Base64AtlasManager.dataO);
class CallLaterTool {
constructor() {
}
static initCallLaterRecorder() {
if (CallLaterTool.oldCallLater)
return;
CallLaterTool.oldCallLater = Laya.Laya.timer["callLater"];
Laya.Laya.timer["callLater"] = CallLaterTool["prototype"]["callLater"];
}
static beginRecordCallLater() {
CallLaterTool.initCallLaterRecorder();
CallLaterTool._isRecording = true;
}
static runRecordedCallLaters() {
CallLaterTool._isRecording = false;
var timer;
timer = Laya.Laya.timer;
var laters = timer["_laters"];
laters = CallLaterTool._recordedCallLaters;
for (var i = 0, n = laters.length - 1; i <= n; i++) {
var handler = laters[i];
if (CallLaterTool._recordedCallLaters.indexOf(handler) < 0)
continue;
handler.method !== null && handler.run(false);
timer["_recoverHandler"](handler);
laters.splice(i, 1);
}
CallLaterTool._recordedCallLaters.length = 0;
}
callLater(caller, method, args = null) {
if (this._getHandler(caller, method) == null) {
CallLaterTool.oldCallLater.call(this, caller, method, args);
if (CallLaterTool._isRecording) {
CallLaterTool._recordedCallLaters.push(this._laters[this._laters.length - 1]);
}
}
}
}
CallLaterTool._recordedCallLaters = [];
CallLaterTool._isRecording = false;
class CanvasTools {
constructor() {
}
static createCanvas(width, height) {
return null;
}
static renderSpriteToCanvas(sprite, canvas, offsetX, offsetY) {
Laya.RenderSprite.renders[sprite._renderType]._fun(sprite, canvas.context, offsetX, offsetY);
}
static getImageDataFromCanvas(canvas, x = 0, y = 0, width = 0, height = 0) {
if (width <= 0)
width = canvas.width;
if (height <= 0)
height = canvas.height;
var imgdata = canvas.context.getImageData(x, y, width, height);
return imgdata;
}
static getImageDataFromCanvasByRec(canvas, rec) {
var imgdata = canvas.context.getImageData(rec.x, rec.y, rec.width, rec.height);
return imgdata;
}
static getDifferCount(imageData1, imageData2) {
var data1 = imageData1.data;
var data2 = imageData2.data;
var differCount;
differCount = 0;
CanvasTools.walkImageData(imageData1, myWalkFun);
return differCount;
function myWalkFun(i, j, tarPos, data) {
if (!CanvasTools.isPoinSame(tarPos, data1, data2))
differCount++;
}
}
static getDifferRate(imageData1, imageData2) {
return CanvasTools.getDifferCount(imageData1, imageData2) / (imageData1.width * imageData1.height);
}
static getCanvasDisRec(canvas) {
var rst;
rst = new Laya.Rectangle;
var imgdata;
imgdata = CanvasTools.getImageDataFromCanvas(canvas, 0, 0);
var maxX;
var minX;
var maxY;
var minY;
maxX = maxY = 0;
minX = imgdata.width;
minY = imgdata.height;
var i, iLen;
var j, jLen;
iLen = imgdata.width;
jLen = imgdata.height;
var data;
data = imgdata.data;
var tarPos = 0;
for (j = 0; j < jLen; j++) {
for (i = 0; i < iLen; i++) {
if (!CanvasTools.isEmptyPoint(data, tarPos)) {
if (minX > i)
minX = i;
if (maxX < i)
maxX = i;
if (minY > j)
minY = j;
if (maxY < j)
maxY = j;
}
tarPos += 4;
}
}
rst.setTo(minX, minY, maxX - minX + 1, maxY - minY + 1);
return rst;
}
static fillCanvasRec(canvas, rec, color) {
var ctx = canvas.context;
ctx.fillStyle = color;
ctx.fillRect(rec.x, rec.y, rec.width, rec.height);
}
static isEmptyPoint(data, pos) {
if (data[pos] == 0 && data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0) {
return true;
}
else {
return false;
}
}
static isPoinSame(pos, data1, data2) {
if (data1[pos] == data2[pos] && data1[pos + 1] == data2[pos + 1] && data1[pos + 2] == data2[pos + 2] && data1[pos + 3] == data2[pos + 3]) {
return true;
}
else {
return false;
}
}
static walkImageData(imgdata, walkFun) {
var i, iLen;
var j, jLen;
iLen = imgdata.width;
jLen = imgdata.height;
var tarPos = 0;
var data = imgdata.data;
for (i = 0; i < iLen; i++) {
for (j = 0; j < jLen; j++) {
walkFun(i, j, tarPos, data);
tarPos += 4;
}
}
}
static renderSpritesToCanvas(canvas, sprites, offx = 0, offy = 0, startIndex = 0) {
var i, len;
len = sprites.length;
for (i = startIndex; i < len; i++) {
CanvasTools.renderSpriteToCanvas(sprites[i], canvas, offx, offy);
}
}
static clearCanvas(canvas) {
var preWidth;
var preHeight;
preWidth = canvas.width;
preHeight = canvas.height;
canvas.size(preWidth + 1, preHeight);
canvas.size(preWidth, preHeight);
}
static getImagePixels(x, y, width, data, colorLen = 4) {
var pos;
pos = (x * width + y) * colorLen;
var i, len;
var rst;
rst = [];
len = colorLen;
for (i = 0; i < len; i++) {
rst.push(data[pos + i]);
}
return rst;
}
}
class MathTools {
constructor() {
}
static sortBigFirst(a, b) {
if (a == b)
return 0;
return b > a ? 1 : -1;
}
static sortSmallFirst(a, b) {
if (a == b)
return 0;
return b > a ? -1 : 1;
}
static sortNumBigFirst(a, b) {
return parseFloat(b) - parseFloat(a);
}
static sortNumSmallFirst(a, b) {
return parseFloat(a) - parseFloat(b);
}
static sortByKey(key, bigFirst = false, forceNum = true) {
var _sortFun;
if (bigFirst) {
_sortFun = forceNum ? MathTools.sortNumBigFirst : MathTools.sortBigFirst;
}
else {
_sortFun = forceNum ? MathTools.sortNumSmallFirst : MathTools.sortSmallFirst;
}
return function (a, b) {
return _sortFun(a[key], b[key]);
};
}
}
class ColorTool {
constructor() {
}
static toHexColor(color) {
return Laya.Utils.toHexColor(color);
}
static getRGBByRGBStr(str) {
str.charAt(0) == '#' && (str = str.substr(1));
var color = parseInt(str, 16);
var flag = (str.length == 8);
var _color;
_color = [((0x00FF0000 & color) >> 16), ((0x0000FF00 & color) >> 8), (0x000000FF & color)];
return _color;
}
static getColorBit(value) {
var rst;
rst = Math.floor(value).toString(16);
rst = rst.length > 1 ? rst : "0" + rst;
return rst;
}
static getRGBStr(rgb, coefficient = 1) {
return "#" + ColorTool.getColorBit(rgb[0] * coefficient) + ColorTool.getColorBit(rgb[1] * coefficient) + ColorTool.getColorBit(rgb[2] * coefficient);
}
static traseHSB(hsb) {
console.log("hsb:", hsb[0], hsb[1], hsb[2]);
}
static rgb2hsb(rgbR, rgbG, rgbB) {
var rgb = [rgbR, rgbG, rgbB];
rgb.sort(MathTools.sortNumSmallFirst);
var max = rgb[2];
var min = rgb[0];
var hsbB = max / 255.0;
var hsbS = max == 0 ? 0 : (max - min) / max;
var hsbH = 0;
if (max == min) {
hsbH = 1;
}
else if (rgbR == 0 && rgbG == 0 && rgbB == 0) ;
else if (max == rgbR && rgbG >= rgbB) {
hsbH = (rgbG - rgbB) * 60 / (max - min) + 0;
}
else if (max == rgbR && rgbG < rgbB) {
hsbH = (rgbG - rgbB) * 60 / (max - min) + 360;
}
else if (max == rgbG) {
hsbH = (rgbB - rgbR) * 60 / (max - min) + 120;
}
else if (max == rgbB) {
hsbH = (rgbR - rgbG) * 60 / (max - min) + 240;
}
return [hsbH, hsbS, hsbB];
}
static hsb2rgb(h, s, v) {
var r = 0, g = 0, b = 0;
var i = Math.floor((h / 60) % 6);
var f = (h / 60) - i;
var p = v * (1 - s);
var q = v * (1 - f * s);
var t = v * (1 - (1 - f) * s);
switch (i) {
case 0:
r = v;
g = t;
b = p;
break;
case 1:
r = q;
g = v;
b = p;
break;
case 2:
r = p;
g = v;
b = t;
break;
case 3:
r = p;
g = q;
b = v;
break;
case 4:
r = t;
g = p;
b = v;
break;
case 5:
r = v;
g = p;
b = q;
break;
}
return [Math.floor(r * 255.0), Math.floor(g * 255.0), Math.floor(b * 255.0)];
}
}
class CommonTools {
constructor() {
}
static bind(fun, scope) {
var rst;
rst = fun.bind(scope);
return rst;
}
static insertP(tar, x, y, scaleX, scaleY, rotation) {
var nSp;
nSp = new Laya.Sprite();
tar.parent.addChild(nSp);
nSp.x = x;
nSp.y = y;
nSp.scaleX = scaleX;
nSp.scaleY = scaleY;
nSp.rotation = rotation;
nSp.addChild(tar);
CommonTools.count++;
nSp.name = "insertP:" + CommonTools.count;
}
static insertChild(tar, x, y, scaleX, scaleY, rotation, color = "#ff00ff") {
var nSp;
nSp = new Laya.Sprite();
tar.addChild(nSp);
nSp.x = x;
nSp.y = y;
nSp.scaleX = scaleX;
nSp.scaleY = scaleY;
nSp.rotation = rotation;
nSp.graphics.drawRect(0, 0, 20, 20, color);
nSp.name = "child:" + tar.numChildren;
return nSp;
}
static createSprite(width, height, color = "#ff0000") {
var sp;
sp = new Laya.Sprite();
sp.graphics.drawRect(0, 0, width, height, color);
sp.size(width, height);
return sp;
}
static createBtn(txt, width = 100, height = 40) {
var sp;
sp = new Laya.Sprite();
sp.size(width, height);
sp.graphics.drawRect(0, 0, sp.width, sp.height, "#ff0000");
sp.graphics.fillText(txt, sp.width * 0.5, sp.height * 0.5, null, "#ffff00", "center");
return sp;
}
}
CommonTools.count = 0;
class DebugTxt {
constructor() {
}
static init() {
if (DebugTxt._txt)
return;
DebugTxt._txt = new Laya.Text();
DebugTxt._txt.pos(100, 100);
DebugTxt._txt.color = "#ff00ff";
DebugTxt._txt.zOrder = 999;
DebugTxt._txt.fontSize = 24;
DebugTxt._txt.text = "debugTxt inited";
Laya.Laya.stage.addChild(DebugTxt._txt);
}
static getArgArr(arg) {
var rst;
rst = [];
var i, len = arg.length;
for (i = 0; i < len; i++) {
rst.push(arg[i]);
}
return rst;
}
static dTrace(...arg) {
arg = DebugTxt.getArgArr(arg);
var str;
str = arg.join(" ");
if (DebugTxt._txt) {
DebugTxt._txt.text = str + "\n" + DebugTxt._txt.text;
}
}
static getTimeStr() {
var dateO = new Date();
return dateO.toTimeString();
}
static traceTime(msg) {
DebugTxt.dTrace(DebugTxt.getTimeStr());
DebugTxt.dTrace(msg);
}
static show(...arg) {
arg = DebugTxt.getArgArr(arg);
var str;
str = arg.join(" ");
if (DebugTxt._txt) {
DebugTxt._txt.text = str;
}
}
}
class DisEditor {
constructor() {
this.rec = new Laya.Sprite();
this.rootContainer = new Laya.Sprite();
}
setTarget(target) {
this.tar = target;
var g;
g = this.rec.graphics;
g.clear();
var bounds;
bounds = this.tar.getSelfBounds();
g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height, null, "#00ff00");
this.createSameDisChain();
Laya.Laya.stage.addChild(this.rootContainer);
}
createSameDisChain() {
var tParent;
var cpParent;
var preTar;
preTar = this.rec;
tParent = this.tar;
while (tParent && tParent != Laya.Laya.stage) {
cpParent = new Laya.Sprite();
cpParent.addChild(preTar);
cpParent.x = tParent.x;
cpParent.y = tParent.y;
cpParent.scaleX = tParent.scaleX;
cpParent.scaleY = tParent.scaleY;
cpParent.rotation = tParent.rotation;
cpParent.scrollRect = tParent.scrollRect;
preTar = cpParent;
tParent = tParent.parent;
}
this.rootContainer.removeChildren();
this.rootContainer.addChild(preTar);
}
}
class DisPool {
constructor() {
}
static getDis(clz) {
var clzName;
clzName = ClassTool.getClassNameByClz(clz);
if (!DisPool._objDic[clzName]) {
DisPool._objDic[clzName] = [];
}
var disList;
disList = DisPool._objDic[clzName];
var i, len;
len = disList.length;
for (i = 0; i < len; i++) {
if (!disList[i].parent) {
return disList[i];
}
}
disList.push(new clz());
return disList[disList.length - 1];
}
}
DisPool._objDic = {};
class DragBox extends Laya.Sprite {
constructor(type) {
super();
this._left = this.drawBlock();
this._right = this.drawBlock();
this._top = this.drawBlock();
this._bottom = this.drawBlock();
this._topLeft = this.drawBlock();
this._topRight = this.drawBlock();
this._bottomLeft = this.drawBlock();
this._bottomRight = this.drawBlock();
this._lastPoint = new Laya.Point();
this._type = type = 3;
this.addChild(this._box = this.drawBorder(0, 0, 0xff0000));
if (type == 1 || type == 3) {
this.addChild(this._left);
this.addChild(this._right);
}
if (type == 2 || type == 3) {
this.addChild(this._top);
this.addChild(this._bottom);
}
if (type == 3) {
this.addChild(this._topLeft);
this.addChild(this._topRight);
this.addChild(this._bottomLeft);
this.addChild(this._bottomRight);
}
this.on(Laya.Event.MOUSE_DOWN, this, this.onMouseDown);
this.mouseThrough = true;
}
onMouseDown(e) {
this._currDir = e.target;
if (e.nativeEvent.shiftKey) {
this.initFixScale();
}
if (this._currDir != this) {
this._lastPoint.x = Laya.Laya.stage.mouseX;
this._lastPoint.y = Laya.Laya.stage.mouseY;
Laya.Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.onMouseMove);
Laya.Laya.stage.on(Laya.Event.MOUSE_UP, this, this.onMouseUp);
e.stopPropagation();
}
}
onMouseUp(e) {
Laya.Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.onMouseMove);
Laya.Laya.stage.off(Laya.Event.MOUSE_UP, this, this.onMouseUp);
}
initFixScale() {
this.fixScale = this._target.height / this._target.width;
}
onMouseMove(e) {
var scale = 1;
var tx = (Laya.Laya.stage.mouseX - this._lastPoint.x) / scale;
var ty = (Laya.Laya.stage.mouseY - this._lastPoint.y) / scale;
var sameScale = false;
var adptX;
var adptY;
if (e.nativeEvent.shiftKey) {
if (this.fixScale < 0)
this.initFixScale();
adptY = tx * this.fixScale;
adptX = ty / this.fixScale;
sameScale = true;
switch (this._currDir) {
case this._topLeft:
case this._bottomLeft:
this._currDir = this._left;
break;
case this._topRight:
case this._bottomRight:
this._currDir = this._right;
break;
}
}
if (tx != 0 || ty != 0) {
this._lastPoint.x += tx * scale;
this._lastPoint.y += ty * scale;
var tw = tx / this._target.scaleX;
var th = ty / this._target.scaleY;
if (this._currDir == this._left) {
this._target.x += tx;
this._target.width -= tw;
if (sameScale) {
this._target.height = this._target.width * this.fixScale;
}
}
else if (this._currDir == this._right) {
this._target.width += tw;
if (sameScale) {
this._target.height = this._target.width * this.fixScale;
}
}
else if (this._currDir == this._top) {
this._target.y += ty;
this._target.height -= th;
if (sameScale) {
this._target.width = this._target.height / this.fixScale;
}
}
else if (this._currDir == this._bottom) {
this._target.height += th;
if (sameScale) {
this._target.width = this._target.height / this.fixScale;
}
}
else if (this._currDir == this._topLeft) {
this._target.x += tx;
this._target.y += ty;
this._target.width -= tw;
this._target.height -= th;
}
else if (this._currDir == this._topRight) {
this._target.y += ty;
this._target.width += tw;
this._target.height -= th;
}
else if (this._currDir == this._bottomLeft) {
this._target.x += tx;
this._target.width -= tw;
this._target.height += th;
}
else if (this._currDir == this._bottomRight) {
this._target.width += tw;
this._target.height += th;
}
if (this._target.width < 1) {
this._target.width = 1;
}
if (this._target.height < 1) {
this._target.height = 1;
}
this._target.width = Math.round(this._target.width);
this._target.x = Math.round(this._target.x);
this._target.y = Math.round(this._target.y);
this._target.height = Math.round(this._target.height);
this.refresh();
}
}
drawBorder(width, height, color, alpha = 1) {
var box = new Laya.Sprite();
var g = box.graphics;
g.clear();
g.drawRect(0, 0, width, height, null, "#" + color);
return box;
}
drawBlock() {
var box = new Laya.Sprite();
var g = box.graphics;
g.clear();
box.width = DragBox.BLOCK_WIDTH;
box.height = DragBox.BLOCK_WIDTH;
g.drawRect(-DragBox.BLOCK_WIDTH * 0.5, -DragBox.BLOCK_WIDTH * 0.5, DragBox.BLOCK_WIDTH, DragBox.BLOCK_WIDTH, "#ffffff", "#ff0000", 1);
box.mouseEnabled = true;
box.mouseThrough = true;
return box;
}
setTarget(target) {
this._target = target;
this.refresh();
}
refresh() {
this.changePoint();
this.changeSize();
}
changePoint() {
var p = this._target.localToGlobal(new Laya.Point());
var np = this.parent.globalToLocal(p);
this.x = np.x;
this.y = np.y;
}
changeSize() {
var width = this._target.width * this._target.scaleX;
var height = this._target.height * this._target.scaleY;
console.log("change size");
this.rotation = this._target.rotation;
if (this._box.width != width || this._box.height != height) {
this._box.graphics.clear();
this._box.graphics.drawRect(0, 0, Math.abs(width), Math.abs(height), null, "#ff0000");
this._box.size(width, height);
this.size(width, height);
this._box.scaleX = Math.abs(this._box.scaleX) * (this._target.scaleX > 0 ? 1 : -1);
this._box.scaleY = Math.abs(this._box.scaleY) * (this._target.scaleY > 0 ? 1 : -1);
this._left.x = 0;
this._left.y = height * 0.5;
this._right.x = width;
this._right.y = height * 0.5;
this._top.x = width * 0.5;
this._top.y = 0;
this._bottom.x = width * 0.5;
this._bottom.y = height;
this._topLeft.x = this._topLeft.y = 0;
this._topRight.x = width;
this._topRight.y = 0;
this._bottomLeft.x = 0;
this._bottomLeft.y = height;
this._bottomRight.x = width;
this._bottomRight.y = height;
}
}
}
DragBox.BLOCK_WIDTH = 6;
class FilterTool {
constructor() {
}
static getArrByFilter(arr, filterFun) {
var i, len = arr.length;
var rst = [];
for (i = 0; i < len; i++) {
if (filterFun(arr[i]))
rst.push(arr[i]);
}
return rst;
}
static getArr(arr, sign, value) {
var i, len = arr.length;
var rst = [];
for (i = 0; i < len; i++) {
if (arr[i][sign] == value)
rst.push(arr[i]);
}
return rst;
}
}
class GetSetProfile {
static removeNoDisplayKeys(arr) {
var i;
for (i = arr.length - 1; i >= 0; i--) {
if (GetSetProfile.noDisplayKeys[arr[i]]) {
arr.splice(i, 1);
}
}
}
static getClassCount(className) {
return GetSetProfile.countDic[className];
}
static addClassCount(className) {
if (!GetSetProfile.countDic[className]) {
GetSetProfile.countDic[className] = 1;
}
else {
GetSetProfile.countDic[className] = GetSetProfile.countDic[className] + 1;
}
}
static init() {
if (GetSetProfile._inited)
return;
GetSetProfile._inited = true;
var createFun = function (sp) {
GetSetProfile.classCreated(sp);
};
FunHook.hook(Node, "call", null, createFun);
GetSetProfile.handlerO = {};
GetSetProfile.handlerO["get"] = function (target, key, receiver) {
console.log("get", target, key, receiver);
return Reflect.get(target, key, receiver);
};
GetSetProfile.handlerO["set"] = function (target, key, value, receiver) {
console.log("set", target, key, value, receiver);
return Reflect.set(target, key, value, receiver);
};
}
static classCreated(obj, oClas = null) {
if (GetSetProfile.fromMe)
return;
var className;
className = ClassTool.getClassName(obj);
GetSetProfile.addClassCount(className);
GetSetProfile.addClassCount(GetSetProfile.ALL);
IDTools.idObj(obj);
var classDes;
classDes = GetSetProfile.hookClassDic[className];
if (!classDes) {
GetSetProfile.profileClass(obj["constructor"]);
classDes = GetSetProfile.hookClassDic[className];
if (!classDes)
return;
}
GetSetProfile.hookObj2(obj, classDes);
}
static hookObj(obj, keys) {
var handler = GetSetProfile.handlerO;
new Proxy(obj, handler);
}
static hookObj2(obj, keys) {
var i, len;
len = keys.length;
for (i = 0; i < len; i++) {
GetSetProfile.hookVar(obj, keys[i]);
}
}
static profileClass(clz) {
var className;
className = ClassTool.getClassName(clz);
GetSetProfile.fromMe = true;
var tO = new clz();
GetSetProfile.fromMe = false;
var keys;
keys = ClassTool.getObjectDisplayAbleKeys(tO);
keys = ObjectTools.getNoSameArr(keys);
var i, len;
len = keys.length;
var tV;
var key;
for (i = len - 1; i >= 0; i--) {
key = keys[i];
tV = tO[key];
if (tV instanceof Function) {
keys.splice(i, 1);
}
}
len = keys.length;
GetSetProfile.removeNoDisplayKeys(keys);
GetSetProfile.hookClassDic[className] = keys;
}
static hookPrototype(tO, key) {
console.log("hook:", key);
try {
GetSetProfile.hookVar(tO, key);
}
catch (e) {
console.log("fail", key);
}
}
static reportCall(obj, name, type) {
IDTools.idObj(obj);
var objID;
objID = IDTools.getObjID(obj);
var className;
className = ClassTool.getClassName(obj);
GetSetProfile.recordInfo(className, name, type, objID);
GetSetProfile.recordInfo(GetSetProfile.ALL, name, type, objID);
}
static recordInfo(className, name, type, objID) {
var propCallsDic;
if (!GetSetProfile.infoDic[className]) {
GetSetProfile.infoDic[className] = {};
}
propCallsDic = GetSetProfile.infoDic[className];
var propCalls;
if (!propCallsDic[name]) {
propCallsDic[name] = {};
}
propCalls = propCallsDic[name];
var propCallO;
if (!propCalls[type]) {
propCalls[type] = {};
}
propCallO = propCalls[type];
if (!propCallO[objID]) {
propCallO[objID] = 1;
if (!propCallO["objCount"]) {
propCallO["objCount"] = 1;
}
else {
propCallO["objCount"] = propCallO["objCount"] + 1;
}
}
else {
propCallO[objID] = propCallO[objID] + 1;
}
if (!propCallO["count"]) {
propCallO["count"] = 1;
}
else {
propCallO["count"] = propCallO["count"] + 1;
}
}
static showInfo() {
var rstO;
rstO = {};
var rstO1;
rstO1 = {};
var arr;
arr = [];
var arr1;
arr1 = [];
var className;
var keyName;
var type;
for (className in GetSetProfile.infoDic) {
var tClassO;
var tClassO1;
tClassO = GetSetProfile.infoDic[className];
rstO[className] = tClassO1 = {};
for (keyName in tClassO) {
var tKeyO;
var tKeyO1;
tKeyO = tClassO[keyName];
tClassO1[keyName] = tKeyO1 = {};
for (type in tKeyO) {
var tDataO;
tDataO = tKeyO[type];
tDataO["rate"] = tDataO["objCount"] / GetSetProfile.getClassCount(className);
tKeyO1[type] = tDataO["rate"];
var tSKey;
tSKey = className + "_" + keyName + "_" + type;
rstO1[tSKey] = tDataO["rate"];
if (className == GetSetProfile.ALL) {
if (type == "get") {
arr.push([tSKey, tDataO["rate"], tDataO["count"]]);
}
else {
arr1.push([tSKey, tDataO["rate"], tDataO["count"]]);
}
}
}
}
}
console.log(GetSetProfile.infoDic);
console.log(GetSetProfile.countDic);
console.log(rstO);
console.log(rstO1);
console.log("nodeCount:", GetSetProfile.getClassCount(GetSetProfile.ALL));
console.log("sort by rate");
GetSetProfile.showStaticInfo(arr, arr1, "1");
console.log("sort by count");
GetSetProfile.showStaticInfo(arr, arr1, "2");
}
static showStaticInfo(arr, arr1, sortKey) {
console.log("get:");
GetSetProfile.showStaticArray(arr, sortKey);
console.log("set:");
GetSetProfile.showStaticArray(arr1, sortKey);
}
static showStaticArray(arr, sortKey = "1") {
arr.sort(Laya.MathUtil.sortByKey(sortKey, true, true));
var i, len;
len = arr.length;
var tArr;
for (i = 0; i < len; i++) {
tArr = arr[i];
console.log(tArr[0], Math.floor(tArr[1] * 100), tArr[2]);
}
}
static hookVar(obj, name, setHook = null, getHook = null) {
if (!setHook)
setHook = [];
if (!getHook)
getHook = [];
var preO = obj;
var preValue;
var des;
des = ClassTool.getOwnPropertyDescriptor(obj, name);
var ndes = {};
var mSet = function (value) {
preValue = value;
};
var mGet = function () {
return preValue;
};
var mSet1 = function (value) {
var _t = this;
GetSetProfile.reportCall(_t, name, "set");
};
var mGet1 = function () {
var _t = this;
GetSetProfile.reportCall(_t, name, "get");
return preValue;
};
getHook.push(mGet1);
setHook.push(mSet1);
while (!des && obj["__proto__"]) {
obj = obj["__proto__"];
des = ClassTool.getOwnPropertyDescriptor(obj, name);
}
if (des) {
ndes.set = des.set ? des.set : mSet;
ndes.get = des.get ? des.get : mGet;
if (!des.get) {
preValue = preO[name];
}
ndes.enumerable = des.enumerable;
setHook.push(ndes.set);
getHook.push(ndes.get);
FunHook.hookFuns(ndes, "set", setHook);
FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
ClassTool.defineProperty(preO, name, ndes);
}
if (!des) {
ndes.set = mSet;
ndes.get = mGet;
preValue = preO[name];
setHook.push(ndes.set);
getHook.push(ndes.get);
FunHook.hookFuns(ndes, "set", setHook);
FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
ClassTool.defineProperty(preO, name, ndes);
}
}
}
GetSetProfile._inited = false;
GetSetProfile.noDisplayKeys = { "conchModel": true };
GetSetProfile.ALL = "ALL";
GetSetProfile.countDic = {};
GetSetProfile.fromMe = false;
GetSetProfile.hookClassDic = {};
GetSetProfile.infoDic = {};
class JsonTool {
constructor() {
this.meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"': '\\"',
'\\': '\\\\'
};
}
static getJsonString(obj, singleLine = true, split = "\n", depth = 0, Width = 4) {
var preStr = "";
preStr = JsonTool.getEmptyStr(depth * Width);
var rst;
var keyValues;
keyValues = {};
var tKey;
var tValue;
var keys;
keys = [];
for (tKey in obj) {
keys.push(tKey);
tValue = obj[tKey];
if (JsonTool.singleLineKey[tKey]) {
keyValues[tKey] = JsonTool.getValueStr(tValue, true, split, depth + 1, Width);
}
else {
keyValues[tKey] = JsonTool.getValueStr(tValue, singleLine, split, depth + 1, Width);
}
}
var i, len;
len = keys.length;
keys.sort();
keys = keys.reverse();
var keyPreStr;
keyPreStr = JsonTool.getEmptyStr((depth + 1) * Width);
if (singleLine) {
split = "";
preStr = "";
keyPreStr = "";
}
var keyValueStrArr;
keyValueStrArr = [];
for (i = 0; i < len; i++) {
tKey = keys[i];
keyValueStrArr.push(keyPreStr + JsonTool.wrapValue(tKey) + ":" + keyValues[tKey]);
}
rst = "{" + split + keyValueStrArr.join("," + split) + split + preStr + "}";
return rst;
}
static wrapValue(value, wraper = "\"") {
return wraper + value + wraper;
}
static getArrStr(arr, singleLine = true, split = "\n", depth = 0, Width = 4) {
var rst;
var i, len;
len = arr.length;
var valueStrArr;
valueStrArr = [];
for (i = 0; i < len; i++) {
valueStrArr.push(JsonTool.getValueStr(arr[i], singleLine, split, depth + 1, Width));
}
var preStr = "";
preStr = JsonTool.getEmptyStr((depth + 1) * Width);
if (singleLine) {
split = "";
preStr = "";
}
rst = "[" + split + preStr + valueStrArr.join("," + split + preStr) + "]";
return rst;
}
static quote(string) {
JsonTool.escapable.lastIndex = 0;
return JsonTool.escapable.test(string) ? '"' + string.replace(JsonTool.escapable, function (a) {
var c = this.meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
static getValueStr(tValue, singleLine = true, split = "\n", depth = 0, Width = 0) {
var rst;
if (typeof (tValue) == 'string') {
rst = JsonTool.quote(tValue);
}
else if (tValue == null) {
rst = "null";
}
else if (typeof (tValue) == 'number' || typeof (tValue) == 'number' || tValue instanceof Boolean) {
rst = tValue;
}
else if (tValue instanceof Array) {
rst = JsonTool.getArrStr(tValue, singleLine, split, depth, Width);
}
else if (typeof (tValue) == 'object') {
rst = JsonTool.getJsonString(tValue, singleLine, split, depth, Width);
}
else {
rst = tValue;
}
return rst;
}
static getEmptyStr(width) {
if (!JsonTool.emptyDic.hasOwnProperty(width)) {
var i;
var len;
len = width;
var rst;
rst = "";
for (i = 0; i < len; i++) {
rst += " ";
}
JsonTool.emptyDic[width] = rst;
}
return JsonTool.emptyDic[width];
}
}
JsonTool.singleLineKey = {
"props": true
};
JsonTool.escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
JsonTool.emptyDic = {};
class LayoutTools {
constructor() {
}
static layoutToXCount(items, xCount = 1, dx = 0, dY = 0, sx = 0, sy = 0) {
var tX, tY;
var tItem;
var i, len;
var tCount;
var maxHeight;
tCount = 0;
maxHeight = 0;
tX = sx;
tY = sy;
len = items.length;
for (i = 0; i < len; i++) {
tItem = items[i];
tItem.x = tX;
tItem.y = tY;
if (tItem.height > maxHeight) {
maxHeight = tItem.height;
}
tCount++;
if (tCount >= xCount) {
tCount = tCount % xCount;
tItem.y += maxHeight + dY;
maxHeight = 0;
}
else {
tX += tItem.width + dx;
}
}
}
static layoutToWidth(items, width, dX, dY, sx, sy) {
var tX, tY;
var tItem;
var i, len;
tX = sx;
tY = sy;
len = items.length;
for (i = 0; i < len; i++) {
tItem = items[i];
if (tX + tItem.width + dX > width) {
tX = sx;
tY += dY + tItem.height;
}
tItem.x = tX;
tItem.y = tY;
tX += dX + tItem.width;
}
}
}
class MouseEventAnalyser {
constructor() {
}
static analyseNode(node) {
DebugTool.showDisBound(node, true);
var _node;
_node = node;
ObjectTools.clearObj(MouseEventAnalyser.infoO);
ObjectTools.clearObj(MouseEventAnalyser.nodeO);
ObjectTools.clearObj(MouseEventAnalyser.hitO);
var nodeList;
nodeList = [];
while (node) {
IDTools.idObj(node);
MouseEventAnalyser.nodeO[IDTools.getObjID(node)] = node;
nodeList.push(node);
node = node.parent;
}
MouseEventAnalyser.check(Laya.Laya.stage, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY, null);
var canStr;
if (MouseEventAnalyser.hitO[IDTools.getObjID(_node)]) {
console.log("can hit");
canStr = "can hit";
}
else {
console.log("can't hit");
canStr = "can't hit";
}
var i, len;
nodeList = nodeList.reverse();
len = nodeList.length;
var rstTxts;
rstTxts = ["[分析对象]:" + ClassTool.getNodeClassAndName(_node) + ":" + canStr];
for (i = 0; i < len; i++) {
node = nodeList[i];
if (MouseEventAnalyser.hitO[IDTools.getObjID(node)]) {
console.log("can hit:", ClassTool.getNodeClassAndName(node));
console.log("原因:", MouseEventAnalyser.infoO[IDTools.getObjID(node)]);
rstTxts.push("can hit:" + " " + ClassTool.getNodeClassAndName(node));
rstTxts.push("原因:" + " " + MouseEventAnalyser.infoO[IDTools.getObjID(node)]);
}
else {
console.log("can't hit:" + ClassTool.getNodeClassAndName(node));
console.log("原因:", MouseEventAnalyser.infoO[IDTools.getObjID(node)] ? MouseEventAnalyser.infoO[IDTools.getObjID(node)] : "鼠标事件在父级已停止派发");
rstTxts.push("can't hit:" + " " + ClassTool.getNodeClassAndName(node));
rstTxts.push("原因:" + " " + (MouseEventAnalyser.infoO[IDTools.getObjID(node)] ? MouseEventAnalyser.infoO[IDTools.getObjID(node)] : "鼠标事件在父级已停止派发"));
}
}
var rstStr;
rstStr = rstTxts.join("\n");
}
static check(sp, mouseX, mouseY, callBack) {
IDTools.idObj(sp);
var isInAnlyseChain;
isInAnlyseChain = MouseEventAnalyser.nodeO[IDTools.getObjID(sp)];
MouseEventAnalyser._point.setTo(mouseX, mouseY);
sp.fromParentPoint(MouseEventAnalyser._point);
mouseX = MouseEventAnalyser._point.x;
mouseY = MouseEventAnalyser._point.y;
var scrollRect = sp.scrollRect;
if (scrollRect) {
MouseEventAnalyser._rect.setTo(scrollRect.x, scrollRect.y, scrollRect.width, scrollRect.height);
var isHit = MouseEventAnalyser._rect.contains(mouseX, mouseY);
if (!isHit) {
if (isInAnlyseChain) {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "scrollRect没有包含鼠标" + MouseEventAnalyser._rect.toString() + ":" + mouseX + "," + mouseY;
}
return false;
}
}
var i, len;
var cList;
cList = sp._children;
len = cList.length;
var child;
var childInChain;
childInChain = null;
for (i = 0; i < len; i++) {
child = cList[i];
IDTools.idObj(child);
if (MouseEventAnalyser.nodeO[IDTools.getObjID(child)]) {
childInChain = child;
break;
}
}
var coverByOthers;
coverByOthers = childInChain ? true : false;
var flag = false;
if (sp.hitTestPrior && !sp.mouseThrough && !MouseEventAnalyser.hitTest(sp, mouseX, mouseY)) {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "hitTestPrior=true宽高区域不包含鼠标:" + ":" + mouseX + "," + mouseY + " size:" + sp.width + "," + sp.height;
return false;
}
for (i = sp._children.length - 1; i > -1; i--) {
child = sp._children[i];
if (child == childInChain) {
if (!childInChain.mouseEnabled) {
MouseEventAnalyser.infoO[IDTools.getObjID(childInChain)] = "mouseEnabled=false";
}
if (!childInChain.visible) {
MouseEventAnalyser.infoO[IDTools.getObjID(childInChain)] = "visible=false";
}
coverByOthers = false;
}
if (child.mouseEnabled && child.visible) {
flag = MouseEventAnalyser.check(child, mouseX, mouseY, callBack);
if (flag) {
MouseEventAnalyser.hitO[IDTools.getObjID(sp)] = true;
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象被击中";
if (child == childInChain) {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象被击中," + "击中对象在分析链中";
}
else {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象被击中," + "击中对象不在分析链中";
if (coverByOthers) {
MouseEventAnalyser.infoO[IDTools.getObjID(childInChain)] = "被兄弟节点挡住,兄弟节点信息:" + ClassTool.getNodeClassAndName(child) + "," + child.getBounds().toString();
DebugTool.showDisBound(child, false, "#ffff00");
}
}
return true;
}
else {
if (child == childInChain) {
coverByOthers = false;
}
}
}
}
var mHitRect = new Laya.Rectangle();
var graphicHit = false;
graphicHit = sp.getGraphicBounds().contains(mouseX, mouseY);
if (sp.width > 0 && sp.height > 0) {
var hitRect = MouseEventAnalyser._rect;
if (!sp.mouseThrough) {
if (sp.hitArea)
hitRect = sp.hitArea;
else
hitRect.setTo(0, 0, sp.width, sp.height);
mHitRect.copyFrom(hitRect);
isHit = hitRect.contains(mouseX, mouseY);
}
else {
isHit = graphicHit;
mHitRect.copyFrom(sp.getGraphicBounds());
}
if (isHit) {
MouseEventAnalyser.hitO[IDTools.getObjID(sp)] = true;
}
}
if (!isHit) {
if (graphicHit) {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象未包含鼠标,实际绘图区域包含鼠标,设置的宽高区域不包含鼠标:" + ":" + mouseX + "," + mouseY + " hitRec:" + mHitRect.toString() + " graphicBounds:" + sp.getGraphicBounds().toString() + "设置mouseThrough=true或将宽高设置到实际绘图区域可解决问题";
}
else {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象未包含鼠标,实际绘图区域不包含鼠标,设置的宽高区域不包含鼠标:" + ":" + mouseX + "," + mouseY + " hitRec:" + mHitRect.toString() + " graphicBounds:" + sp.getGraphicBounds().toString();
}
}
else {
MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "自身区域被击中";
}
return isHit;
}
static hitTest(sp, mouseX, mouseY) {
var isHit = false;
if (sp.hitArea instanceof Laya.HitArea) {
return Laya.MouseManager.instance.hitTest(sp, mouseX, mouseY);
}
if (sp.width > 0 && sp.height > 0 || sp.mouseThrough || sp.hitArea) {
var hitRect = MouseEventAnalyser._rect;
if (!sp.mouseThrough) {
if (sp.hitArea)
hitRect = sp.hitArea;
else
hitRect.setTo(0, 0, sp.width, sp.height);
isHit = hitRect.contains(mouseX, mouseY);
}
else {
isHit = sp.getGraphicBounds().contains(mouseX, mouseY);
}
}
return isHit;
}
}
MouseEventAnalyser.infoO = {};
MouseEventAnalyser.nodeO = {};
MouseEventAnalyser.hitO = {};
MouseEventAnalyser._matrix = new Laya.Matrix();
MouseEventAnalyser._point = new Laya.Point();
MouseEventAnalyser._rect = new Laya.Rectangle();
DebugTool.analyseMouseHit = () => {
if (DebugTool.target)
MouseEventAnalyser.analyseNode(DebugTool.target);
};
class ResTools {
constructor() {
}
static getCachedResList() {
return ResTools.getWebGlResList();
}
static getWebGlResList() {
var rst;
rst = [];
return rst;
}
static getCanvasResList() {
var picDic;
picDic = {};
var dataO;
dataO = Laya.Loader.loadedMap;
ResTools.collectPics(dataO, picDic);
return ResTools.getArrFromDic(picDic);
}
static getArrFromDic(dic) {
var key;
var rst;
rst = [];
for (key in dic) {
rst.push(key);
}
return rst;
}
static collectPics(dataO, picDic) {
if (!dataO)
return;
var key;
var tTexture;
for (key in dataO) {
tTexture = dataO[key];
if (tTexture) {
if (tTexture.bitmap && tTexture.bitmap.src) {
var url = tTexture.bitmap.src;
if (url.indexOf("data:image/png;base64") < 0)
picDic[tTexture.bitmap.src] = true;
}
}
}
}
}
class SingleTool {
constructor() {
this._objDic = {};
}
static get I() {
if (!SingleTool._instance) {
SingleTool._instance = new SingleTool();
}
return SingleTool._instance;
}
static set I(value) {
SingleTool._instance = value;
}
getArr(sign) {
var dic;
dic = this.getTypeDic("Array");
if (!dic[sign])
dic[sign] = [];
return dic[sign];
}
getObject(sign) {
var dic;
dic = this.getTypeDic("Object");
if (!dic[sign])
dic[sign] = {};
return dic[sign];
}
getByClass(sign, clzSign, clz) {
var dic;
dic = this.getTypeDic(clzSign);
if (!dic[sign])
dic[sign] = new clz();
return dic[sign];
}
getTypeDic(type) {
if (!this._objDic[type])
this._objDic[type] = {};
return this._objDic[type];
}
}
class TimeTool {
constructor() {
}
static getTime(sign, update = true) {
if (!TimeTool.timeDic[sign]) {
TimeTool.timeDic[sign] = 0;
}
var tTime;
tTime = Laya.Browser.now();
var rst;
rst = tTime - TimeTool.timeDic[sign];
TimeTool.timeDic[sign] = tTime;
return rst;
}
static runAllCallLater() {
if (TimeTool._deep > 0)
debugger;
TimeTool._deep++;
var timer;
timer = Laya.Laya.timer;
var laters = timer["_laters"];
for (var i = 0, n = laters.length - 1; i <= n; i++) {
var handler = laters[i];
if (handler) {
handler.method !== null && handler.run(false);
timer["_recoverHandler"](handler);
}
else {
debugger;
}
i === n && (n = laters.length - 1);
}
laters.length = 0;
TimeTool._deep--;
}
}
TimeTool.timeDic = {};
TimeTool._deep = 0;
class TimerControlTool {
constructor() {
}
static now() {
if (TimerControlTool._timeRate != 1)
return TimerControlTool.getRatedNow();
return Date.now();
}
static getRatedNow() {
var dTime;
dTime = TimerControlTool.getNow() - TimerControlTool._startTime;
return dTime * TimerControlTool._timeRate + TimerControlTool._startTime;
}
static getNow() {
return Date.now();
}
static setTimeRate(rate) {
if (TimerControlTool._browerNow == null)
TimerControlTool._browerNow = Laya.Browser["now"];
TimerControlTool._startTime = TimerControlTool.getNow();
TimerControlTool._timeRate = rate;
if (rate != 1) {
Laya.Browser["now"] = TimerControlTool.now;
}
else {
if (TimerControlTool._browerNow != null)
Laya.Browser["now"] = TimerControlTool._browerNow;
}
}
static recoverRate() {
TimerControlTool.setTimeRate(1);
}
}
TimerControlTool._timeRate = 1;
class TouchDebugTools {
constructor() {
}
static getTouchIDs(events) {
var rst;
rst = [];
var i, len;
len = events.length;
for (i = 0; i < len; i++) {
rst.push(events[i].identifier || 0);
}
return rst;
}
static traceTouchIDs(msg, events) {
DebugTxt.dTrace(msg + ":" + TouchDebugTools.getTouchIDs(events).join(","));
}
}
class UVTools {
constructor() {
}
static getUVByRec(x, y, width, height) {
return [x, y, x + width, y, x + width, y + height, x, y + height];
}
static getRecFromUV(uv) {
var rst;
rst = new Laya.Rectangle(uv[0], uv[1], uv[2] - uv[0], uv[5] - uv[1]);
return rst;
}
static isUVRight(uv) {
if (uv[0] != uv[6])
return false;
if (uv[1] != uv[3])
return false;
if (uv[2] != uv[4])
return false;
if (uv[5] != uv[7])
return false;
return true;
}
static getTextureRec(texture) {
var rst;
rst = UVTools.getRecFromUV((texture.uv));
rst.x *= texture.bitmap.width;
rst.y *= texture.bitmap.height;
rst.width *= texture.bitmap.width;
rst.height *= texture.bitmap.height;
return rst;
}
}
class VisibleAnalyser {
constructor() {
}
static analyseTarget(node) {
var isInstage;
isInstage = node.displayedInStage;
var gRec;
gRec = NodeUtils.getGRec(node);
var stageRec = new Laya.Rectangle();
stageRec.setTo(0, 0, Laya.Laya.stage.width, Laya.Laya.stage.height);
var isInVisibleRec;
var visibleRec;
visibleRec = stageRec.intersection(gRec);
if (visibleRec.width > 0 && visibleRec.height > 0) {
isInVisibleRec = true;
}
else {
isInVisibleRec = false;
}
var gAlpha;
gAlpha = NodeUtils.getGAlpha(node);
var gVisible;
gVisible = NodeUtils.getGVisible(node);
var msg;
msg = "";
msg += "isInstage:" + isInstage + "\n";
msg += "isInVisibleRec:" + isInVisibleRec + "\n";
msg += "gVisible:" + gVisible + "\n";
msg += "gAlpha:" + gAlpha + "\n";
if (isInstage && isInVisibleRec && gVisible && gAlpha > 0) {
VisibleAnalyser.anlyseRecVisible(node);
msg += "coverRate:" + VisibleAnalyser.coverRate + "\n";
if (VisibleAnalyser._coverList.length > 0) {
Laya.Laya.timer.once(1000, null, VisibleAnalyser.showListLater);
}
}
console.log(msg);
}
static showListLater() {
}
static isCoverByBrother(node) {
var parent = node.parent;
if (!parent)
return;
var _childs = parent._children;
var index;
index = _childs.indexOf(node);
if (index < 0)
return;
var rec;
rec = parent.getSelfBounds();
if (rec.width <= 0 || rec.height <= 0)
return;
}
static anlyseRecVisible(node) {
VisibleAnalyser.isNodeWalked = false;
VisibleAnalyser._analyseTarget = node;
if (!VisibleAnalyser.mainCanvas)
VisibleAnalyser.mainCanvas = CanvasTools.createCanvas(Laya.Laya.stage.width, Laya.Laya.stage.height);
CanvasTools.clearCanvas(VisibleAnalyser.mainCanvas);
VisibleAnalyser.tColor = 1;
VisibleAnalyser.resetCoverList();
WalkTools.walkTargetEX(Laya.Laya.stage, VisibleAnalyser.recVisibleWalker, null, VisibleAnalyser.filterFun);
if (!VisibleAnalyser.isTarRecOK) {
VisibleAnalyser.coverRate = 0;
}
else {
VisibleAnalyser.coverRate = CanvasTools.getDifferRate(VisibleAnalyser.preImageData, VisibleAnalyser.tarImageData);
}
console.log("coverRate:", VisibleAnalyser.coverRate);
}
static getRecArea(rec) {
return rec.width * rec.height;
}
static addCoverNode(node, coverRate) {
var data;
data = {};
data.path = node;
data.label = ClassTool.getNodeClassAndName(node) + ":" + coverRate;
data.coverRate = coverRate;
VisibleAnalyser._coverList.push(data);
console.log("coverByNode:", node, coverRate);
}
static resetCoverList() {
VisibleAnalyser._coverList.length = 0;
}
static recVisibleWalker(node) {
if (node == VisibleAnalyser._analyseTarget) {
VisibleAnalyser.isNodeWalked = true;
VisibleAnalyser.tarRec.copyFrom(NodeUtils.getGRec(node));
console.log("tarRec:", VisibleAnalyser.tarRec.toString());
if (VisibleAnalyser.tarRec.width > 0 && VisibleAnalyser.tarRec.height > 0) {
VisibleAnalyser.isTarRecOK = true;
VisibleAnalyser.tColor++;
CanvasTools.fillCanvasRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec, ColorTool.toHexColor(VisibleAnalyser.tColor));
VisibleAnalyser.preImageData = CanvasTools.getImageDataFromCanvasByRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec);
VisibleAnalyser.tarImageData = CanvasTools.getImageDataFromCanvasByRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec);
}
else {
console.log("tarRec Not OK:", VisibleAnalyser.tarRec);
}
}
else {
if (VisibleAnalyser.isTarRecOK) {
var tRec;
tRec = NodeUtils.getGRec(node);
VisibleAnalyser.interRec = VisibleAnalyser.tarRec.intersection(tRec, VisibleAnalyser.interRec);
if (VisibleAnalyser.interRec && VisibleAnalyser.interRec.width > 0 && VisibleAnalyser.interRec.height > 0) {
VisibleAnalyser.tColor++;
CanvasTools.fillCanvasRec(VisibleAnalyser.mainCanvas, tRec, ColorTool.toHexColor(VisibleAnalyser.tColor));
VisibleAnalyser.tImageData = CanvasTools.getImageDataFromCanvasByRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec);
var dRate;
dRate = CanvasTools.getDifferRate(VisibleAnalyser.preImageData, VisibleAnalyser.tImageData);
VisibleAnalyser.preImageData = VisibleAnalyser.tImageData;
VisibleAnalyser.addCoverNode(node, dRate);
}
}
}
}
static filterFun(node) {
if (node.visible == false)
return false;
if (node.alpha < 0)
return false;
if (DebugInfoLayer.I.isDebugItem(node))
return false;
return true;
}
}
VisibleAnalyser.tarRec = new Laya.Rectangle();
VisibleAnalyser.interRec = new Laya.Rectangle();
VisibleAnalyser._coverList = [];
class XML2Object {
static parse(node, isFirst = true) {
var obj = {};
if (isFirst)
obj.Name = node.localName;
var numOfChilds = node.children.length;
var childs = [];
var children = {};
obj.c = children;
obj.cList = childs;
for (var i = 0; i < numOfChilds; i++) {
var childNode = node.children[i];
var childNodeName = childNode.localName;
var value;
var numOfAttributes;
value = XML2Object.parse(childNode, true);
childs.push(value);
if (children[childNodeName]) {
if (XML2Object.getTypeof(children[childNodeName]) == "array") {
children[childNodeName].push(value);
}
else {
children[childNodeName] = [children[childNodeName], value];
}
}
else if (XML2Object.isArray(childNodeName)) {
children[childNodeName] = [value];
}
else {
children[childNodeName] = value;
}
}
numOfAttributes = 0;
if (node.attributes) {
numOfAttributes = node.attributes.length;
var prop = {};
obj.p = prop;
for (i = 0; i < numOfAttributes; i++) {
prop[node.attributes[i].name.toString()] = String(node.attributes[i].nodeValue);
}
}
if (numOfChilds == 0) {
if (numOfAttributes == 0) {
obj = "";
}
}
return obj;
}
static getArr(v) {
if (!v)
return [];
if (XML2Object.getTypeof(v) == "array")
return v;
return [v];
}
static get arrays() {
if (!XML2Object._arrays) {
XML2Object._arrays = [];
}
return XML2Object._arrays;
}
static set arrays(a) {
XML2Object._arrays = a;
}
static isArray(nodeName) {
var numOfArrays = XML2Object._arrays ? XML2Object._arrays.length : 0;
for (var i = 0; i < numOfArrays; i++) {
if (nodeName == XML2Object._arrays[i]) {
return true;
}
}
return false;
}
static getTypeof(o) {
if (typeof (o) == "object") {
if (o.length == null) {
return "object";
}
else if (typeof (o.length) == "number") {
return "array";
}
else {
return "object";
}
}
else {
return typeof (o);
}
}
}
class XML2ObjectNodejs {
static parse(node, isFirst = true) {
var obj = {};
if (isFirst)
obj.Name = node.localName;
var numOfChilds = node[XML2ObjectNodejs.ChildrenSign] ? node[XML2ObjectNodejs.ChildrenSign].length : 0;
var childs = [];
var children = {};
obj.c = children;
obj.cList = childs;
for (var i = 0; i < numOfChilds; i++) {
var childNode = node[XML2ObjectNodejs.ChildrenSign][i];
var childNodeName = childNode.localName;
var value;
var numOfAttributes;
if (!childNodeName)
continue;
value = XML2ObjectNodejs.parse(childNode, true);
childs.push(value);
if (children[childNodeName]) {
if (XML2ObjectNodejs.getTypeof(children[childNodeName]) == "array") {
children[childNodeName].push(value);
}
else {
children[childNodeName] = [children[childNodeName], value];
}
}
else if (XML2ObjectNodejs.isArray(childNodeName)) {
children[childNodeName] = [value];
}
else {
children[childNodeName] = value;
}
}
numOfAttributes = 0;
if (node.attributes) {
numOfAttributes = node.attributes.length;
var prop = {};
obj.p = prop;
for (i = 0; i < numOfAttributes; i++) {
prop[node.attributes[i].name.toString()] = String(node.attributes[i].nodeValue);
}
}
return obj;
}
static getArr(v) {
if (!v)
return [];
if (XML2ObjectNodejs.getTypeof(v) == "array")
return v;
return [v];
}
static get arrays() {
if (!XML2ObjectNodejs._arrays) {
XML2ObjectNodejs._arrays = [];
}
return XML2ObjectNodejs._arrays;
}
static set arrays(a) {
XML2ObjectNodejs._arrays = a;
}
static isArray(nodeName) {
var numOfArrays = XML2ObjectNodejs._arrays ? XML2ObjectNodejs._arrays.length : 0;
for (var i = 0; i < numOfArrays; i++) {
if (nodeName == XML2ObjectNodejs._arrays[i]) {
return true;
}
}
return false;
}
static getTypeof(o) {
if (typeof (o) == "object") {
if (o.length == null) {
return "object";
}
else if (typeof (o.length) == "number") {
return "array";
}
else {
return "object";
}
}
else {
return typeof (o);
}
}
}
XML2ObjectNodejs.ChildrenSign = "childNodes";
class Arrow extends Laya.Sprite {
constructor() {
super();
this.drawMe();
}
drawMe() {
var g;
g = this.graphics;
g.clear();
g.drawLine(0, 0, -1, -1, "#ff0000");
g.drawLine(0, 0, 1, -1, "#ff0000");
}
}
class AutoSizeRec extends Laya.Sprite {
constructor(type) {
super();
this._color = "#ffffff";
}
set height(value) {
super.height = value;
this.changeSize();
}
set width(value) {
super.width = value;
this.changeSize();
}
setColor(color) {
this._color = color;
this.reRender();
}
changeSize() {
this.reRender();
}
reRender() {
var g = this.graphics;
g.clear();
g.drawRect(0, 0, this.width, this.height, this._color);
}
record() {
this.preX = this.x;
this.preY = this.y;
}
getDx() {
return this.x - this.preX;
}
getDy() {
return this.y - this.preY;
}
}
class DInput extends Laya.Input {
constructor() {
super();
this.bgColor = "#11ff00";
}
}
class ClassCreateHook {
constructor() {
this.createInfo = {};
}
static get I() {
if (!ClassCreateHook._instance) {
ClassCreateHook._instance = new ClassCreateHook();
}
return ClassCreateHook._instance;
}
static set I(value) {
ClassCreateHook._instance = value;
}
hookClass(clz) {
if (ClassCreateHook.isInited)
return;
ClassCreateHook.isInited = true;
var createFun = function (sp) {
this.classCreated(sp, clz);
};
FunHook.hook(clz, "call", createFun);
}
classCreated(clz, oClass) {
var key;
key = ClassTool.getNodeClassAndName(clz);
var depth = 0;
var tClz;
tClz = clz;
while (tClz && tClz != oClass) {
tClz = tClz.prototype;
depth++;
}
if (!ClassCreateHook.I.createInfo[key]) {
ClassCreateHook.I.createInfo[key] = 0;
}
ClassCreateHook.I.createInfo[key] = ClassCreateHook.I.createInfo[key] + 1;
RunProfile.run(key, depth + 6);
}
getClassCreateInfo(clz) {
var key;
key = ClassTool.getClassName(clz);
return RunProfile.getRunInfo(key);
}
}
ClassCreateHook.isInited = false;
class FunctionTimeHook {
constructor() {
}
static hookFun(obj, funName) {
if (!obj)
return;
if (obj.timeHooked)
return;
var myKey;
FunctionTimeHook.HookID++;
myKey = ClassTool.getNodeClassAndName(obj) + "." + funName + "():" + FunctionTimeHook.HookID;
var timePreFun = function (...args) {
FunctionTimeHook.funBegin(myKey);
};
var timeEndFun = function (...args) {
FunctionTimeHook.funEnd(myKey);
};
obj.timeHooked = true;
FunHook.hook(obj, funName, timePreFun, timeEndFun);
}
static funBegin(funKey) {
FunctionTimeHook.funPre[funKey] = Laya.Browser.now();
}
static funEnd(funKey) {
if (!FunctionTimeHook.funPre[funKey])
FunctionTimeHook.funPre[funKey] = 0;
FunctionTimeHook.counter.add(funKey, Laya.Browser.now() - FunctionTimeHook.funPre[funKey]);
}
static fresh() {
FunctionTimeHook.funEnd(FunctionTimeHook.TotalSign);
FunctionTimeHook.counter.record();
FunctionTimeHook.funBegin(FunctionTimeHook.TotalSign);
}
}
FunctionTimeHook.HookID = 1;
FunctionTimeHook.counter = new CountTool();
FunctionTimeHook.funPre = {};
FunctionTimeHook.TotalSign = "TotalSign";
class LoaderHook extends Laya.LoaderManager {
constructor() {
super();
}
static init() {
if (LoaderHook.isInited)
return;
LoaderHook.isInited = true;
Laya.Laya.loader = new LoaderHook();
Laya.Laya.loader.on(Laya.Event.ERROR, null, LoaderHook.onFail);
LoaderHook.preFails = Laya.LocalStorage.getJSON(LoaderHook.FailSign);
if (!LoaderHook.preFails)
LoaderHook.preFails = {};
}
static onFail(failFile) {
LoaderHook.nowFails[failFile] = true;
Laya.LocalStorage.setJSON(LoaderHook.FailSign, LoaderHook.nowFails);
}
static resetFails() {
LoaderHook.nowFails = {};
Laya.LocalStorage.setJSON(LoaderHook.FailSign, LoaderHook.nowFails);
}
checkUrls(url) {
var tarUrl;
if (typeof (url) == 'string') {
tarUrl = url;
}
else {
tarUrl = url.url;
}
if (LoaderHook.preFails[tarUrl]) {
if (LoaderHook.enableFailDebugger) {
debugger;
}
}
}
chekUrlList(urls) {
var i, len;
len = urls.length;
for (i = 0; i < len; i++) {
this.checkUrls(urls[i]);
}
}
load(url, complete = null, progress = null, type = null, priority = 1, cache = true, group = null, ignoreCache = false, useWorkerLoader = false) {
if (url instanceof Array) {
this.chekUrlList(url);
}
else {
this.checkUrls(url);
}
return super.load(url, complete, progress, type, priority, cache, group, ignoreCache, useWorkerLoader);
}
}
LoaderHook.preFails = {};
LoaderHook.nowFails = {};
LoaderHook.enableFailDebugger = true;
LoaderHook.FailSign = "LoadFailItems";
LoaderHook.isInited = false;
class Observer {
constructor() {
}
static observe(obj, callBack) {
}
static unobserve(obj, callBack) {
}
static observeDiffer(obj, sign, msg = "obDiffer") {
var differFun = function () {
DifferTool.differ(sign, obj, msg);
};
Observer.observe(obj, differFun);
}
}
class Watch {
constructor() {
}
static watch(obj, name, callBack) {
obj.watch(name, callBack);
}
static unwatch(obj, name, callBack) {
obj.unwatch(name, callBack);
}
}
class Layouter {
constructor() {
this._sX = 0;
this._width = 0;
}
layout() {
this.layoutFun(this._width, this._items, this.data, this._sX);
}
set items(arr) {
this._items = arr;
this.calSize();
}
get items() {
return this._items;
}
set x(v) {
this._sX = v;
this.changed();
}
get x() {
return this._sX;
}
set width(v) {
this._width = v;
this.changed();
}
get width() {
return this._width;
}
changed() {
Laya.Laya.timer.callLater(this, this.layout);
}
calSize() {
var i, len;
var tItem;
tItem = this.items[0];
this._sX = tItem.x;
var maxX;
maxX = this._sX + tItem.width;
len = this.items.length;
for (i = 1; i < len; i++) {
tItem = this.items[i];
if (this._sX > tItem.x) {
this._sX = tItem.x;
}
if (maxX < tItem.x + tItem.width) {
maxX = tItem.x + tItem.width;
}
}
this._width = maxX - this._sX;
}
}
class LayoutFuns {
constructor() {
}
static sameWidth(totalWidth, items, data = null, sX = 0) {
var dWidth = 0;
if (data && data.dWidth)
dWidth = data.dWidth;
var perWidth;
perWidth = (totalWidth - (items.length - 1) * dWidth) / items.length;
var tItem;
var i, len;
var tX;
tX = sX;
len = items.length;
for (i = 0; i < len; i++) {
tItem = items[i];
tItem.x = tX;
tItem.width = perWidth;
tX += dWidth + perWidth;
}
}
static getSameWidthLayout(items, dWidth) {
var data;
data = {};
data.dWidth = dWidth;
return LayoutFuns.getLayouter(items, data, LayoutFuns.sameWidth);
}
static getLayouter(items, data, fun) {
var layouter;
layouter = new Layouter();
layouter.items = items;
layouter.data = data;
layouter.layoutFun = fun;
return layouter;
}
static sameDis(totalWidth, items, data = null, sX = 0) {
var dWidth;
dWidth = totalWidth;
var tItem;
var i, len;
len = items.length;
LayoutFuns.prepareForLayoutWidth(totalWidth, items);
for (i = 0; i < len; i++) {
tItem = items[i];
dWidth -= tItem.width;
}
if (items.length > 1)
dWidth = dWidth / (items.length - 1);
var tX;
tX = sX;
len = items.length;
for (i = 0; i < len; i++) {
tItem = items[i];
tItem.x = tX;
tX += dWidth + tItem.width;
}
}
static getSameDisLayout(items, rateSame = false) {
var data;
data = {};
if (rateSame) {
var i, len;
len = items.length;
var tItem;
var totalWidth;
totalWidth = 0;
for (i = 0; i < len; i++) {
tItem = items[i];
totalWidth += tItem.width;
}
totalWidth = tItem.x + tItem.width;
for (i = 0; i < len; i++) {
tItem = items[i];
LayoutFuns.setItemRate(tItem, tItem.width / totalWidth);
}
}
return LayoutFuns.getLayouter(items, data, LayoutFuns.sameDis);
}
static fullFill(totalWidth, items, data = null, sX = 0) {
var dL = 0, dR = 0;
if (data) {
if (data.dL)
dL = data.dL;
if (data.dR)
dR = data.dR;
}
var item;
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
item = items[i];
item.x = sX + dL;
item.width = totalWidth - dL - dR;
}
}
static getFullFillLayout(items, dL = 0, dR = 0) {
var data;
data = {};
data.dL = dL;
data.dR = dR;
return LayoutFuns.getLayouter(items, data, LayoutFuns.fullFill);
}
static fixPos(totalWidth, items, data = null, sX = 0) {
var dLen = 0;
var poss = [];
var isRate = false;
if (data) {
if (data.dLen)
dLen = data.dLen;
if (data.poss)
poss = data.poss;
if (data.isRate)
isRate = data.isRate;
}
var item;
var i, len;
len = poss.length;
var tValue;
var preItem;
preItem = null;
for (i = 0; i < len; i++) {
item = items[i];
tValue = sX + poss[i];
if (isRate) {
tValue = sX + poss[i] * totalWidth;
}
item.x = tValue;
if (preItem) {
preItem.width = item.x - dLen - preItem.x;
}
preItem = item;
}
var lastItem;
lastItem = items[items.length - 1];
lastItem.width = sX + totalWidth - dLen - lastItem.x;
}
static getFixPos(items, dLen = 0, isRate = false, poss = null) {
var data;
data = {};
var layout;
layout = LayoutFuns.getLayouter(items, data, LayoutFuns.fixPos);
var i, len;
var sX;
var totalWidth;
sX = layout.x;
totalWidth = layout.width;
if (!poss) {
poss = [];
len = items.length;
var tValue;
for (i = 0; i < len; i++) {
tValue = items[i].x - sX;
if (isRate) {
tValue = tValue / totalWidth;
}
poss.push(tValue);
}
}
data.dLen = dLen;
data.poss = poss;
data.isRate = isRate;
return layout;
}
static clearItemsRelativeInfo(items) {
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
LayoutFuns.clearItemRelativeInfo(items[i]);
}
}
static clearItemRelativeInfo(item) {
var Nan = "NaN";
item.left = Nan;
item.right = Nan;
}
static prepareForLayoutWidth(totalWidth, items) {
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
LayoutFuns.prepareItemForLayoutWidth(totalWidth, items[i]);
}
}
static getSumWidth(items) {
var sum;
sum = 0;
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
sum += items[i].width;
}
return sum;
}
static prepareItemForLayoutWidth(totalWidth, item) {
if (LayoutFuns.getItemRate(item) > 0) {
item.width = totalWidth * LayoutFuns.getItemRate(item);
}
}
static setItemRate(item, rate) {
item[LayoutFuns.RateSign] = rate;
}
static getItemRate(item) {
return item[LayoutFuns.RateSign] ? item[LayoutFuns.RateSign] : -1;
}
static setItemFreeSize(item, free = true) {
item[LayoutFuns.FreeSizeSign] = free;
}
static isItemFreeSize(item) {
return item[LayoutFuns.FreeSizeSign];
}
static lockedDis(totalWidth, items, data = null, sX = 0) {
var dists;
dists = data.dists;
var sumDis;
sumDis = data.sumDis;
var sumWidth;
var i, len;
var tItem;
var preItem;
LayoutFuns.prepareForLayoutWidth(totalWidth, items);
sumWidth = LayoutFuns.getSumWidth(items);
var dWidth;
dWidth = totalWidth - sumDis - sumWidth;
var freeItem;
freeItem = LayoutFuns.getFreeItem(items);
if (freeItem) {
freeItem.width += dWidth;
}
preItem = items[0];
preItem.x = sX;
len = items.length;
for (i = 1; i < len; i++) {
tItem = items[i];
tItem.x = preItem.x + preItem.width + dists[i - 1];
preItem = tItem;
}
}
static getFreeItem(items) {
var i, len;
len = items.length;
for (i = 0; i < len; i++) {
if (LayoutFuns.isItemFreeSize(items[i])) {
return items[i];
}
}
return null;
}
static getLockedDis(items) {
var data;
data = {};
var dists;
var i, len;
var tItem;
var preItem;
var sumDis;
sumDis = 0;
var tDis;
preItem = items[0];
dists = [];
len = items.length;
for (i = 1; i < len; i++) {
tItem = items[i];
tDis = tItem.x - preItem.x - preItem.width;
dists.push(tDis);
sumDis += tDis;
preItem = tItem;
}
data.dists = dists;
data.sumDis = sumDis;
return LayoutFuns.getLayouter(items, data, LayoutFuns.lockedDis);
}
}
LayoutFuns.RateSign = "layoutRate";
LayoutFuns.FreeSizeSign = "layoutFreeSize";
class AutoFillRec extends Laya.Sprite {
constructor(type) {
super();
}
set width(value) {
super.width = value;
this.changeSize();
}
set height(value) {
super.height = value;
this.changeSize();
}
changeSize() {
var g = this.graphics;
g.clear();
g.drawRect(0, 0, this.width, this.height, "#33c5f5");
}
record() {
this.preX = this.x;
this.preY = this.y;
}
getDx() {
return this.x - this.preX;
}
getDy() {
return this.y - this.preY;
}
}
class DisResizer {
constructor() { }
static init() {
if (DisResizer._up)
return;
DisResizer._up = new AutoFillRec("T");
DisResizer._up.height = DisResizer.barWidth;
DisResizer._up.type = DisResizer.Horizon;
DisResizer._down = new AutoFillRec("T");
DisResizer._down.height = DisResizer.barWidth;
DisResizer._down.type = DisResizer.Horizon;
DisResizer._left = new AutoFillRec("R");
DisResizer._left.width = DisResizer.barWidth;
DisResizer._left.type = DisResizer.Vertical;
DisResizer._right = new AutoFillRec("R");
DisResizer._right.width = DisResizer.barWidth;
DisResizer._right.type = DisResizer.Vertical;
DisResizer._barList = [DisResizer._up, DisResizer._down, DisResizer._left, DisResizer._right];
DisResizer.addEvent();
}
static stageDown(e) {
var target;
target = e.target;
if (DisResizer._tar && DisControlTool.isInTree(DisResizer._tar, target)) {
return;
}
DisResizer.clear();
}
static clear() {
DisResizer._tar = null;
Laya.Laya.stage.off(Laya.Event.MOUSE_UP, null, DisResizer.stageDown);
DisControlTool.removeItems(DisResizer._barList);
DisResizer.clearDragEvents();
}
static addEvent() {
var i, len;
var tBar;
len = DisResizer._barList.length;
for (i = 0; i < len; i++) {
tBar = DisResizer._barList[i];
tBar.on(Laya.Event.MOUSE_DOWN, null, DisResizer.barDown);
}
}
static barDown(e) {
DisResizer.clearDragEvents();
DisResizer.tBar = e.target;
if (!DisResizer.tBar)
return;
var area;
area = new Laya.Rectangle();
if (DisResizer.tBar.type == DisResizer.Horizon) {
area.x = DisResizer.tBar.x;
area.width = 0;
area.y = DisResizer.tBar.y - 200;
area.height = 400;
}
else {
area.x = DisResizer.tBar.x - 200;
area.width = 400;
area.y = 0;
area.height = 0;
}
var option;
option = {};
option.area = area;
DisResizer.tBar.record();
DisResizer.tBar.startDrag(area);
DisResizer.tBar.on(Laya.Event.DRAG_MOVE, null, DisResizer.draging);
DisResizer.tBar.on(Laya.Event.DRAG_END, null, DisResizer.dragEnd);
}
static draging(e) {
console.log("draging");
if (!DisResizer.tBar)
return;
if (!DisResizer._tar)
return;
switch (DisResizer.tBar) {
case DisResizer._left:
DisResizer._tar.x += DisResizer.tBar.getDx();
DisResizer._tar.width -= DisResizer.tBar.getDx();
DisResizer._up.width -= DisResizer.tBar.getDx();
DisResizer._down.width -= DisResizer.tBar.getDx();
DisResizer._right.x -= DisResizer.tBar.getDx();
DisResizer.tBar.x -= DisResizer.tBar.getDx();
break;
case DisResizer._right:
DisResizer._tar.width += DisResizer.tBar.getDx();
DisResizer._up.width += DisResizer.tBar.getDx();
DisResizer._down.width += DisResizer.tBar.getDx();
break;
case DisResizer._up:
DisResizer._tar.y += DisResizer.tBar.getDy();
DisResizer._tar.height -= DisResizer.tBar.getDy();
DisResizer._right.height -= DisResizer.tBar.getDy();
DisResizer._left.height -= DisResizer.tBar.getDy();
DisResizer._down.y -= DisResizer.tBar.getDy();
DisResizer.tBar.y -= DisResizer.tBar.getDy();
break;
case DisResizer._down:
DisResizer._tar.height += DisResizer.tBar.getDy();
DisResizer._right.height += DisResizer.tBar.getDy();
DisResizer._left.height += DisResizer.tBar.getDy();
break;
}
DisResizer.tBar.record();
}
static dragEnd(e) {
console.log("dragEnd");
DisResizer.clearDragEvents();
DisResizer.updates();
}
static clearDragEvents() {
if (!DisResizer.tBar)
return;
DisResizer.tBar.off(Laya.Event.DRAG_MOVE, null, DisResizer.draging);
DisResizer.tBar.off(Laya.Event.DRAG_END, null, DisResizer.dragEnd);
}
static setUp(dis, force = false) {
if (force && dis == DisResizer._tar) {
return;
}
DisControlTool.removeItems(DisResizer._barList);
if (DisResizer._tar == dis) {
DisResizer._tar = null;
DisResizer.clearDragEvents();
if (!force)
return;
}
DisResizer._tar = dis;
DisResizer.updates();
DisControlTool.addItems(DisResizer._barList, dis);
Laya.Laya.stage.off(Laya.Event.MOUSE_UP, null, DisResizer.stageDown);
Laya.Laya.stage.on(Laya.Event.MOUSE_UP, null, DisResizer.stageDown);
}
static updates() {
var dis;
dis = DisResizer._tar;
if (!dis)
return;
var bounds;
bounds = new Laya.Rectangle(0, 0, dis.width, dis.height);
DisResizer._up.x = bounds.x;
DisResizer._up.y = bounds.y;
DisResizer._up.width = bounds.width;
DisResizer._down.x = bounds.x;
DisResizer._down.y = bounds.y + bounds.height - DisResizer.barWidth;
DisResizer._down.width = bounds.width;
DisResizer._left.x = bounds.x;
DisResizer._left.y = bounds.y;
DisResizer._left.height = bounds.height;
DisResizer._right.x = bounds.x + bounds.width - DisResizer.barWidth;
DisResizer._right.y = bounds.y;
DisResizer._right.height = bounds.height;
}
}
DisResizer.Side = 2;
DisResizer.Vertical = 1;
DisResizer.Horizon = 0;
DisResizer.barWidth = 2;
DisResizer.useGetBounds = false;
DisControlTool.resizeHandler = DisResizer.setUp;
class StyleConsts {
constructor() {
}
static setViewScale(view) {
view.scaleX = view.scaleY = StyleConsts.PanelScale;
}
}
StyleConsts.PanelScale = Laya.Browser.onPC ? 1 : Laya.Browser.pixelRatio;
exports.Arrow = Arrow;
exports.ArrowLine = ArrowLine;
exports.AtlasTools = AtlasTools;
exports.AutoFillRec = AutoFillRec;
exports.AutoSizeRec = AutoSizeRec;
exports.Axis = Axis;
exports.Base64Atlas = Base64Atlas;
exports.Base64AtlasManager = Base64AtlasManager;
exports.Base64ImageTool = Base64ImageTool;
exports.Base64Tool = Base64Tool;
exports.ByteEx = ByteEx;
exports.CacheAnalyser = CacheAnalyser;
exports.CallLaterTool = CallLaterTool;
exports.CanvasTools = CanvasTools;
exports.ClassCreateHook = ClassCreateHook;
exports.ClassTool = ClassTool;
exports.ClickSelectTool = ClickSelectTool;
exports.ColorTool = ColorTool;
exports.CommonTools = CommonTools;
exports.CountTool = CountTool;
exports.DButton = DButton;
exports.DInput = DInput;
exports.DTrace = DTrace;
exports.DebugConsts = DebugConsts;
exports.DebugInfoLayer = DebugInfoLayer;
exports.DebugPanel = DebugPanel;
exports.DebugTool = DebugTool;
exports.DebugTxt = DebugTxt;
exports.DifferTool = DifferTool;
exports.DisControlTool = DisControlTool;
exports.DisController = DisController;
exports.DisEditor = DisEditor;
exports.DisPool = DisPool;
exports.DisResizer = DisResizer;
exports.DisplayHook = DisplayHook;
exports.DivScripts = DivScripts;
exports.DragBox = DragBox;
exports.FilterTool = FilterTool;
exports.FunHook = FunHook;
exports.FunctionTimeHook = FunctionTimeHook;
exports.GetSetProfile = GetSetProfile;
exports.IDTools = IDTools;
exports.JSTools = JSTools;
exports.JsonTool = JsonTool;
exports.LayoutFuns = LayoutFuns;
exports.LayoutTools = LayoutTools;
exports.Layouter = Layouter;
exports.LoaderHook = LoaderHook;
exports.MathTools = MathTools;
exports.MouseEventAnalyser = MouseEventAnalyser;
exports.NodeConsts = NodeConsts;
exports.NodeInfoPanel = NodeInfoPanel;
exports.NodeInfosItem = NodeInfosItem;
exports.NodeRecInfo = NodeRecInfo;
exports.NodeUtils = NodeUtils;
exports.Notice = Notice;
exports.ObjTimeCountTool = ObjTimeCountTool;
exports.ObjectTools = ObjectTools;
exports.Observer = Observer;
exports.ReCacheRecInfo = ReCacheRecInfo;
exports.RecInfo = RecInfo;
exports.Rect = Rect;
exports.RenderAnalyser = RenderAnalyser;
exports.RenderSpriteHook = RenderSpriteHook;
exports.ResTools = ResTools;
exports.RunProfile = RunProfile;
exports.SimpleResizer = SimpleResizer;
exports.SingleTool = SingleTool;
exports.SpriteRenderHook = SpriteRenderHook;
exports.StringTool = StringTool;
exports.StyleConsts = StyleConsts;
exports.TimeTool = TimeTool;
exports.TimerControlTool = TimerControlTool;
exports.TouchDebugTools = TouchDebugTools;
exports.TraceTool = TraceTool;
exports.UVTools = UVTools;
exports.ValueChanger = ValueChanger;
exports.VarHook = VarHook;
exports.VisibleAnalyser = VisibleAnalyser;
exports.WalkTools = WalkTools;
exports.Watch = Watch;
exports.Watcher = Watcher;
exports.XML2Object = XML2Object;
exports.XML2ObjectNodejs = XML2ObjectNodejs;
}(window.Laya = window.Laya || {}, Laya));