1 line
354 KiB
JavaScript
1 line
354 KiB
JavaScript
|
|
window.fgui={},window.fairygui=window.fgui,window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,r){function s(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){t.done?o(t.value):new i(function(e){e(t.value)}).then(s,a)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,n=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],n=0}finally{i=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};!function(t){var e=function(){function e(){this._itemList=new Array,this._objectPool=new Array}return e.prototype.createObject=function(e,i){var n=t.UIPackage.getByName(e);if(!n)throw new Error("package not found: "+e);var o=n.getItemByName(i);if(!o)throw new Error("resource not found: "+i);this.internalCreateObject(o)},e.prototype.createObjectFromURL=function(e){var i=t.UIPackage.getItemByURL(e);if(!i)throw new Error("resource not found: "+e);this.internalCreateObject(i)},e.prototype.cancel=function(){t.GTimers.inst.remove(this.run,this),this._itemList.length=0;var e=this._objectPool.length;if(e>0){for(var i=0;i<e;i++)this._objectPool[i].dispose();this._objectPool.length=0}},e.prototype.internalCreateObject=function(e){this._itemList.length=0,this._objectPool.length=0;var n=new i(e,0);n.childCount=this.collectComponentChildren(e),this._itemList.push(n),this._index=0,t.GTimers.inst.add(1,0,this.run,this)},e.prototype.collectComponentChildren=function(e){var n,o,r,s,a,h,l=e.rawData;l.seek(0,2);var c=l.readShort();for(r=0;r<c;r++){s=l.readShort(),a=l.position,l.seek(a,0);var u=l.readByte(),_=l.readS(),p=l.readS();l.position=a,null!=_?(o=null!=(h=null!=p?t.UIPackage.getById(p):e.owner)?h.getItemById(_):null,n=new i(o,u),null!=o&&o.type==t.PackageItemType.Component&&(n.childCount=this.collectComponentChildren(o))):(n=new i(null,u),u==t.ObjectType.List&&(n.listItemCount=this.collectListChildren(l))),this._itemList.push(n),l.position=a+s}return c},e.prototype.collectListChildren=function(e){e.seek(e.position,8);var n,o,r,s,a,h=0,l=e.readS(),c=e.readShort();for(n=0;n<c;n++)o=e.readShort(),o+=e.position,null==(r=e.readS())&&(r=l),r&&null!=(s=t.UIPackage.getItemByURL(r))&&(a=new i(s,s.objectType),s.type==t.PackageItemType.Component&&(a.childCount=this.collectComponentChildren(s)),this._itemList.push(a),h++),e.position=o;return h},e.prototype.run=function(){for(var e,i,n,o,r=egret.getTimer(),s=t.UIConfig.frameTimeForAsyncUIConstruction,a=this._itemList.length;this._index<a;){if(null!=(i=this._itemList[this._index]).packageItem)(e=t.UIObjectFactory.newObject(i.packageItem)).packageItem=i.packageItem,this._objectPool.push(e),t.UIPackage._constructing++,i.packageItem.type==t.PackageItemType.Component?(n=this._objectPool.length-i.childCount-1,e.constructFromResource2(this._objectPool,n),this._ob
|