diff --git "a/ui/web-mobile/src/project.f12e5.js" "b/ui/web-mobile/src/project.f12e5.js" new file mode 100644--- /dev/null +++ "b/ui/web-mobile/src/project.f12e5.js" @@ -0,0 +1 @@ +__require=function e(n,t,o){function i(r,c){if(!t[r]){if(!n[r]){var d=r.split("/");if(d=d[d.length-1],!n[d]){var w="function"==typeof __require&&__require;if(!c&&w)return w(d,!0);if(a)return a(d,!0);throw new Error("Cannot find module '"+r+"'")}}var s=t[r]={exports:{}};n[r][0].call(s.exports,function(e){return i(n[r][1][e]||e)},s,s.exports,e,n,t,o)}return t[r].exports}for(var a="function"==typeof __require&&__require,r=0;rn.records.length-1&&(n.time_line=n.records.length-1),n.do(),this.flush_bg()},n.do=function(){window.creativeCanvas.points_XYRGBR=JSON.parse(n.records[n.time_line]),n.finish()},n.ini=function(e,t){return n.canvas.width=parseInt(e),n.canvas.height=parseInt(t),n.ctx=n.canvas.getContext("2d"),n.ctx.clearRect(0,0,n.canvas.width,n.canvas.height),n.source=n.ctx.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.records=[JSON.stringify([])],n.points_XYRGBR=[],n.time_line=0,n.finish(),n.spriteFrame},n.ini_image=function(e,t,o){return ctx=n.canvas.getContext("2d"),n.canvas.width=parseInt(t),n.canvas.height=parseInt(o),ctx.drawImage(e,0,0,n.canvas.width,n.canvas.height),n.source=ctx.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.create_k(),this.flush_bg(),n.spriteFrame},n.flush=function(){var e=n.canvas.getContext("2d");n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height)},n.flush_bg=function(){},n.kill_preview=function(){window.pendingNode.active=!1,window.previewNode.opacity=255},n.get_color=function(e,t){if(null==n.source)return new[0,0,0,0];var o=0;return o=parseInt((1-t)*n.canvas.height),o=parseInt(o*n.canvas.width),o=parseInt(o+e*n.canvas.width),o=parseInt(4*o),[n.source.data[o+0],n.source.data[o+1],n.source.data[o+2],n.source.data[o+3]]},n.set_big_point=function(e,t,o,i,a,r,c){n.ctx.fillStyle="rgba("+o+","+i+","+a+","+r+")",n.ctx.fillRect(e-c,t-c,2*c+1,2*c+1)},n.set_line=function(e,t,o,i,a,r,c,d,w){for(var s=Math.abs(o-e),l=Math.abs(i-t),h=e-l&&(g-=l,e+=h),u-1&&n.current_index-1?document.body.style.cursor="move":document.body.style.cursor="auto"},n.if_point_in_color=function(e){var t=n.points_XYRGBR[e],o=t[2],i=t[3],a=t[4];return(1!=o||233!=i||0!=a)&&(0!=o||233!=i||1!=a)},n.finish=function(){if(null!=n.ctx){n.ctx.clearRect(0,0,n.canvas.width,n.canvas.height);for(var e=0;e1024&&parseInt(a)>1024){var r=window.regulator.minRegulate([parseInt(i),parseInt(a)],1024);n.canvas.width=r[0],n.canvas.height=r[1]}else n.canvas.width=parseInt(i),n.canvas.height=parseInt(a);var c=n.canvas.getContext("2d");return c.drawImage(e,t,o,parseInt(i),parseInt(a),0,0,n.canvas.width,n.canvas.height),n.dataurl=n.canvas.toDataURL("image/png"),n.source=c.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.load_canvas=function(e){n.canvas.width=e.width,n.canvas.height=e.height;var t=n.canvas.getContext("2d");return t.drawImage(e,0,0,n.canvas.width,n.canvas.height),n.source=t.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.clear=function(){n.canvas.width=100,n.canvas.height=100;var e=n.canvas.getContext("2d");return e.clearRect(0,0,100,100),n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.dark=function(){n.canvas.width=100,n.canvas.height=100;var e=n.canvas.getContext("2d");return e.fillStyle="rgba(0,0,0,0.5)",e.fillRect(0,0,100,100),n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.spriteFrame},n.load_alpha=function(){var e=n.canvas.getContext("2d");n.dataurl=n.canvas.toDataURL("image/png"),n.source=e.getImageData(0,0,n.canvas.width,n.canvas.height);for(var t=0;t",i.style.display="none",i.style.visibility="hidden",document.body.appendChild(i),n.image=document.getElementById(o),n.on_process=null,n.on_error=null,n.on_finish=null,n.load_url=function(e,t){console.log(e),n.image.onload=function(){t(document.getElementById(o))},n.image.onerror=function(){null!=n.on_error&&n.on_error()};var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onprogress=function(t){t.lengthComputable&&(console.log(e+" - "+t.loaded+" / "+t.total),null!=n.on_process&&n.on_process(t.loaded/t.total))},i.onreadystatechange=function(){if(4==i.readyState&&200==i.status)try{null!=n.on_finish&&(console.log(e+" - on_finish called"),n.on_finish());var t=i.getAllResponseHeaders().match(/^Content-Type\:\s*(.*?)$/im)[1]||"image/png",o=new Blob([this.response],{type:t});console.log(e+" - finished"),n.image.src=window.URL.createObjectURL(o),console.log(e+" - blobed")}catch(e){console.log(e),null!=n.on_error&&n.on_error(),window.controller.net_unlock("error")}else 4==i.readyState&&null!=n.on_error&&n.on_error()};try{i.send(),console.log(e+"->xmlHTTP.send();"),window.controller.net_unlock("finished")}catch(e){console.log(e),null!=n.on_error&&n.on_error(),window.controller.net_unlock("error")}},n.load_result=function(e,t){console.log(e),n.name=e,n.image.onload=function(){t(document.getElementById(o))},n.image.onerror=function(){null!=n.on_error&&n.on_error()};var i=new XMLHttpRequest;i.open("POST",window.server_url.split("/file")[0]+"/run/download_result",!0),i.setRequestHeader("Content-Type","application/json;"),i.onreadystatechange=function(){if(4==i.readyState&&200==i.status){var e=JSON.parse(i.responseText).data[0];n.image.src=e}else 4==i.readyState&&null!=n.on_error&&n.on_error()},i.send(JSON.stringify({data:[JSON.stringify({room:window.current_room,step:window.current_step,name:e}),null]}))},n},cc._RF.pop()},{}],PickCanvas:[function(e,n,t){"use strict";cc._RF.push(n,"076a0aT+NZGT7xs77Y6v1Zy","PickCanvas"),n.exports=function(e){var n=Object();return n.spriteFrame=new cc.SpriteFrame,n.texture2d=null,n.source=null,n.canvas=document.createElement("canvas"),n.canvas.id="canvas_"+e,n.canvas.width=300,n.canvas.height=1078,n.currentColor=new Array(255,230,200),n.floatingColor=new Array(0,255,0),n.bigall=[47079079,112128144,119136153,105105105,169169169,211211211,220220220,176196222,139,25025112,72061139,75000130,205,123104238,65105225,100149237,139187,70130180,30144255,191255,135206250,135206235,173216230,255255,95158160,32178170,102205170,206209,72209204,64224208,176224230,175238238,107142035,85107047,1e5,34139034,46139087,60179113,50205050,154205050,127255212,250154,255127,124252e3,127255e3,173255047,144238144,152251152,139000139,106090205,138043226,148000211,153050204,186085211,147112219,143188143,139e6,139069019,165042042,178034034,160082045,205092092,210105030,189183107,220020060,255020147,255105180,255000255,218112214,238130238,221160221,216191216,188143143,199021133,219112147,233150122,240128128,255160122,255182193,255192203,255069e3,255099071,255079080,250128114,25514e4,255165e3,244164096,230230250,184134011,205133063,218165032,210180140,222184135,255215e3,255228225,224255255,240230140,238232170,250250210,255250205,245245220,255248220,255255224,255218185,245222179,255222173,255228181,255228196,255235205,255239213,250235215,255240245,240221195,234182156,240221208,247206181,238187153,240208182,234169143,221169143,247217214,226199179,247195156,221169130,234208182,240186173,166149141,240221182,234195169,212128107,158139130,234182143,247208195,247182156,235178133,247195169,247208182,240195169,195116077,240208169,234195182,240169130,69042029,247208169,247221195,240182143,236221202,249249249],n.record=[],n.ctx=n.canvas.getContext("2d"),n.ring=null,n.tring=null,n.ini=function(e){return n.ctx.drawImage(e,0,0,300,300),n.ring=n.ctx.getImageData(0,0,300,300),n.tring=n.ctx.getImageData(0,0,164,164),n.source=n.ctx.getImageData(0,0,n.canvas.width,n.canvas.height),n.texture2d=new cc.Texture2D,n.spriteFrame.setTexture(n.texture2d),n.texture2d.initWithElement(n.canvas),n.texture2d.handleLoadedTexture(!0),n.ctx=n.texture2d.getHtmlElementObj().getContext("2d"),n.finish(),n.spriteFrame},n.finish=function(e){if(null!=n.ring){var t=0;n.ctx.fillStyle="rgb(80, 80, 80)",n.ctx.fillRect(0,0,n.canvas.width,n.canvas.height),n.ctx.putImageData(n.ring,0,t),t+=300;for(var o=1*Math.min(Math.min(n.currentColor[0],n.currentColor[1]),n.currentColor[2]),i=1*Math.max(Math.max(n.currentColor[0],n.currentColor[1]),n.currentColor[2])-o+1e-4,a=(1*n.currentColor[0]-o+1e-4)/i*255,r=(1*n.currentColor[1]-o+1e-4)/i*255,c=(1*n.currentColor[2]-o+1e-4)/i*255,d=0;d<164;d++)for(var w=0;w<164;w++){var s=4*(164*d+163-w),l=s+1,h=s+2,p=s+3,g=1*d/164*255,u=1*w/164*(255-g)/255;n.tring.data[s]=g+a*u,n.tring.data[l]=g+r*u,n.tring.data[h]=g+c*u,n.tring.data[p]=255}n.ctx.putImageData(n.tring,68,68),t+=0,n.ctx.fillStyle="rgb("+n.currentColor[0]+","+n.currentColor[1]+", "+n.currentColor[2]+")",n.ctx.fillRect(8,t+5,142,30),n.ctx.fillStyle="rgb("+n.floatingColor[0]+","+n.floatingColor[1]+", "+n.floatingColor[2]+")",n.ctx.fillRect(150,t+5,142,30),t+=40;for(var _=0;_t?(t*=n/o,o=n):(o*=n/t,t=n),[parseInt(t),parseInt(o)]},cc._RF.pop()},{}],TripleCanvas:[function(e,n,t){"use strict";cc._RF.push(n,"7319cMXNsxIhLHpuS9egChN","TripleCanvas"),n.exports=function(e){var n=Object();return n.spriteFrame=new cc.SpriteFrame,n.texture2d=null,n.spriteFrame_p=new cc.SpriteFrame,n.texture2d_p=null,n.source=null,n.source_light=null,n.source_color=null,n.canvas_light=document.createElement("canvas"),n.canvas_light.id="canvas_light"+e,n.canvas_color=document.createElement("canvas"),n.canvas_color.id="canvas_color"+e,n.canvas_shade=document.createElement("canvas"),n.canvas_shade.id="canvas_shade"+e,n.load_local=function(){n.canvas=window.previewImageCanvas.canvas;var e=n.canvas.width,t=n.canvas.height;if(window.hasColor){n.canvas_light.width=parseInt(e),n.canvas_light.height=parseInt(t),n.canvas_color.width=parseInt(e),n.canvas_color.height=parseInt(t);var o=n.canvas.getContext("2d");n.source=o.getImageData(0,0,n.canvas.width,n.canvas.height),n.source_light=o.getImageData(0,0,n.canvas.width,n.canvas.height),n.source_color=o.getImageData(0,0,n.canvas.width,n.canvas.height);for(var i=0;i255&&(I=255),y>255&&(y=255),k>255&&(k=255),n.source.data[_]=parseInt(I),n.source.data[v]=parseInt(y),n.source.data[f]=parseInt(k),n.source.data[m]=255}n.canvas_shade.getContext("2d").putImageData(n.source,0,0)}}},n},cc._RF.pop()},{}],colorpicker:[function(e,n,t){"use strict";cc._RF.push(n,"292e9Clf/5EoYjj7Il6urD/","colorpicker"),Array.prototype.indexOf=function(e){for(var n=0;n-1&&this.splice(n,1)},cc.Class({extends:cc.Component,properties:{dropNode:{default:null,type:cc.Node}},onLoad:function(){window.color_picker_main=this},start:function(){var n=e("./ImageLoader"),t=e("./PickCanvas");window.pickCanvas=t("paletteImage"),window.right_color_picker=this.getComponent("cc.Sprite"),window.right_color_picker_node=this.node,window.color_picker_main=this,window.dropper_node=this.dropNode,this.last_record=0,n("paletteImage").load_url(window.server_url+"/res/Texture/ring.png",function(e){window.right_color_picker.spriteFrame=window.pickCanvas.ini(e),window.right_color_picker_node.on("mousemove",function(e){window.mousePosition=e.getLocation();var n=window.right_color_picker_node,t=(n.convertToWorldSpace(n.position),cc.winSize.width-300),o=window.mousePosition.x-t,i=window.mousePosition.y-362;if(o>0&&i>0&&o0&&a>0&&i<1&&a<1)if(window.creativeCanvas.re=!0,window.creativeCanvas.rex=i,window.creativeCanvas.rey=a,window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1){var r=window.creativeCanvas.points_XYRGBR[window.creativeCanvas.current_index],c=[r[2],r[3],r[4]];window.color_picker_main.float_do(new cc.color(c[0],c[1],c[2])),window.minecraft.set_cur_color([c[0],c[1],c[2]])}else{var d=window.previewImageCanvas;window.girdNode.active&&(d=window.girdImageCanvas);var w=d.get_color(i,a);window.color_picker_main.float_do(w),window.minecraft.set_cur_color([w.r,w.g,w.b])}else window.creativeCanvas.re=!1}},pick_float:function(){window.controller.on_pen(),window.pickCanvas.currentColor[0]=window.pickCanvas.floatingColor[0],window.pickCanvas.currentColor[1]=window.pickCanvas.floatingColor[1],window.pickCanvas.currentColor[2]=window.pickCanvas.floatingColor[2],window.pickCanvas.finish()},make_record:function(){var e=1e6*window.pickCanvas.currentColor[0]+1e3*window.pickCanvas.currentColor[1]+window.pickCanvas.currentColor[2];this.last_record!=e&&(window.pickCanvas.record.remove(e),window.pickCanvas.record.push(e),window.pickCanvas.finish(),this.last_record=e)}}),cc._RF.pop()},{"./ImageLoader":"ImageLoader","./PickCanvas":"PickCanvas"}],controller:[function(e,n,t){"use strict";cc._RF.push(n,"a55dcSJ4f1CEaD9OSsdYeLl","controller"),cc.Class({extends:cc.Component,properties:{sketchNode:{default:null,type:cc.Node},alphaSketchNode:{default:null,type:cc.Node},hintNode:{default:null,type:cc.Node},bghintNode:{default:null,type:cc.Node},girdNode:{default:null,type:cc.Node},previewNode:{default:null,type:cc.Node},labelNode:{default:null,type:cc.Node},pendingNode:{default:null,type:cc.Node},fileBtnNode:{default:null,type:cc.Node},real_fileBtnNode:{default:null,type:cc.Node},aiBtnNode:{default:null,type:cc.Node},magicBtnNode:{default:null,type:cc.Node},leftNode:{default:null,type:cc.Node},confirmNode:{default:null,type:cc.Node},c9Node:{default:null,type:cc.Node},logoNode:{default:null,type:cc.Node},cpNode:{default:null,type:cc.Node},cpNode2:{default:null,type:cc.Node},lightNode:{default:null,type:cc.Node},processingNode:{default:null,type:cc.Node},V4_toggle:{default:null,type:cc.Toggle},c1BtnNode:{default:null,type:cc.Node},c2BtnNode:{default:null,type:cc.Node},c3BtnNode:{default:null,type:cc.Node},c4BtnNode:{default:null,type:cc.Node},c5BtnNode:{default:null,type:cc.Node},c6BtnNode:{default:null,type:cc.Node},c7BtnNode:{default:null,type:cc.Node},c8BtnNode:{default:null,type:cc.Node},c9BtnNode:{default:null,type:cc.Node},claNode:{default:null,type:cc.Node}},show_light:function(){window.controller.lightNode.y=181,window.in_color=!1,window.bghintNode.active=!0,window.creativeCanvas.finish(),window.minecraft.shift(),window.girdNode.active=!1,0==window.hasRender&&window.faceSeletor.flush_preview_light(),console.log("show_light")},hide_light:function(){window.controller.lightNode.y=4096,window.in_color=!0,window.bghintNode.active=!1,window.creativeCanvas.finish(),window.minecraft.shift(),window.girdNode.active=!1,console.log("hide_light"),window.hasGird&&(window.hasColor||window.faceSeletor.download_gird_color())},to_gird:function(){window.controller.lightNode.y=4096,window.in_color=!0,window.bghintNode.active=!1,window.creativeCanvas.finish(),window.minecraft.shift(),window.girdNode.active=!0,console.log("to_gird"),window.hasGird||window.hasColor&&window.faceSeletor.download_gird_color()},on_pen:function(){window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1,console.log("on_pen")},on_eraser:function(){window.isPen=!1,window.in_move=!1,window.minecraft.set_index(-233),window.eraser_masker.active=!0,console.log("on_eraser")},on_upload_hints:function(){if(0!=window.hasSketch){var e=prompt("Points?");null!=e&&(window.creativeCanvas.points_XYRGBR=JSON.parse(e),window.creativeCanvas.finish(),window.creativeCanvas.create_k())}},on_download_hints:function(){if(0!=window.hasSketch){var e=window.open("about:blank").document;e.body.style.backgroundColor="#000000",e.writeln(JSON.stringify(window.creativeCanvas.points_XYRGBR))}},on_logo:function(){var e="https://style2paints.github.io/";"zh"==navigator.language.substring(0,2)&&(e="https://style2paints.github.io/README_zh"),"ja"==navigator.language.substring(0,2)&&(e="https://style2paints.github.io/README_ja"),window.open(e)},on_logo_en:function(){window.open("https://style2paints.github.io/")},on_logo_zh:function(){window.open("https://style2paints.github.io/README_zh")},on_logo_ja:function(){window.open("https://style2paints.github.io/README_ja")},on_twitter:function(){window.open("https://twitter.com/hashtag/style2paints?f=tweets&vertical=default")},on_github:function(){window.open("https://github.com/lllyasviel/style2paints")},on_file:function(){window.uploading||window.fileSelector.activate(window.controller.load_sketch)},on_magic:function(){window.faceSeletor.flush_preview()},on_ai:function(){if(!window.uploading&&0!=window.hasSketch){var e=window.open("about:blank").document;window.tripleCanvas.load_local();var n="";n+='',n+='',n+="


";for(var t=window.finImageLoaders.length-1;t>=0;--t){var o=window.finImageLoaders[t],i=o.image.src;n+="

"+o.name+".png

",n+='
'}n+="
"+JSON.stringify(window.creativeCanvas.points_XYRGBR)+"
",window.confirmNode.active=!1,e.writeln(''+n+"")}},on_big_error:function(){var e="Network error. Please refresh this page.";"zh"==navigator.language.substring(0,2)&&(e="\u4e25\u91cd\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u5237\u65b0\u3002"),"ja"==navigator.language.substring(0,2)&&(e="\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u3001\u30da\u30fc\u30b8\u3092\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002"),alert(e)},net_lock:function(e,n){console.log(e+" - net_lock -"+n),window.uploading=!0,window.fileBtnNode.active=!1,window.aiBtnNode.active=!1,window.magicBtnNode.active=!1,window.processingNode.active=!0,window.state_label.change(e,n)},net_unlock:function(e){try{console.log(e+" - net_unlock"),window.uploading=!1,window.fileBtnNode.active=!0,window.aiBtnNode.active=!0,window.magicBtnNode.active=!0,window.processingNode.active=!1,window.state_label.change(e,1)}catch(e){console.log(e)}},on_c0_event:function(){window.current_cid=0,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c1BtnNode.y},on_c1_event:function(){window.current_cid=1,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c2BtnNode.y},on_c2_event:function(){window.current_cid=2,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c3BtnNode.y},on_c3_event:function(){window.current_cid=3,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c4BtnNode.y},on_c4_event:function(){window.current_cid=4,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c5BtnNode.y},on_c5_event:function(){window.current_cid=5,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c6BtnNode.y},on_c6_event:function(){window.current_cid=6,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c7BtnNode.y},on_c7_event:function(){window.current_cid=7,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c8BtnNode.y},on_c8_event:function(){window.current_cid=8,window.previewSprite.spriteFrame=window.previewImageCanvas.load_canvas(window.finImageCanvass[window.current_cid].canvas),window.claNode.y=window.c9BtnNode.y},onLoad:function(){window.controller=this,window.uploading=!1,window.server_url=window.location.href.split("/file/")[0]+"/file",window.fileSelector=e("./FileInputs"),window.regulator=e("./SizeRegulator"),window.fileBtnNode=this.fileBtnNode,window.aiBtnNode=this.aiBtnNode,window.magicBtnNode=this.magicBtnNode,window.confirmNode=this.confirmNode,window.c9Node=this.c9Node,window.c1BtnNode=this.c1BtnNode,window.c2BtnNode=this.c2BtnNode,window.c3BtnNode=this.c3BtnNode,window.c4BtnNode=this.c4BtnNode,window.c5BtnNode=this.c5BtnNode,window.c6BtnNode=this.c6BtnNode,window.c7BtnNode=this.c7BtnNode,window.c8BtnNode=this.c8BtnNode,window.c9BtnNode=this.c9BtnNode,window.claNode=this.claNode,window.c1BtnSprite=this.c1BtnNode.getComponent("cc.Sprite"),window.c2BtnSprite=this.c2BtnNode.getComponent("cc.Sprite"),window.c3BtnSprite=this.c3BtnNode.getComponent("cc.Sprite"),window.c4BtnSprite=this.c4BtnNode.getComponent("cc.Sprite"),window.c5BtnSprite=this.c5BtnNode.getComponent("cc.Sprite"),window.c6BtnSprite=this.c6BtnNode.getComponent("cc.Sprite"),window.c7BtnSprite=this.c7BtnNode.getComponent("cc.Sprite"),window.c8BtnSprite=this.c8BtnNode.getComponent("cc.Sprite"),window.c9BtnSprite=this.c9BtnNode.getComponent("cc.Sprite"),window.confirmNode.active=!1,window.c9Node.active=!1,window.sketchNode=this.sketchNode,window.sketchSprite=this.sketchNode.getComponent("cc.Sprite"),window.alphaSketchNode=this.alphaSketchNode,window.alphaSketchSprite=this.alphaSketchNode.getComponent("cc.Sprite"),window.cpNode=this.cpNode,window.cpNodeSprite=this.cpNode.getComponent("cc.Sprite"),window.hasSketch=!1,window.hasGird=!1,window.hasColor=!1,window.hasRender=!1,window.in_color=!0,window.current_cid=0,window.claNode.y=window.c1BtnNode.y,window.hintNode=this.hintNode,window.hintSprite=this.hintNode.getComponent("cc.Sprite"),window.bghintNode=this.bghintNode,window.bghintSprite=this.bghintNode.getComponent("cc.Sprite"),window.bghintNode.active=!1,window.girdNode=this.girdNode,window.girdSprite=this.girdNode.getComponent("cc.Sprite"),window.girdNode.active=!1,window.previewNode=this.previewNode,window.previewSprite=this.previewNode.getComponent("cc.Sprite"),window.cpNode2=this.cpNode2,window.cpNode2Sprite=this.cpNode2.getComponent("cc.Sprite"),window.state_label=this.labelNode.getComponent("fake_bar"),window.pendingNode=this.pendingNode,window.pendingNode.active=!1,window.V4_toggle=this.V4_toggle;var n=e("./ImageLoader"),t=e("./ImageCanvas"),o=e("./BoxCanvas"),i=e("./TripleCanvas");window.finImageLoaders=[n("finImage1"),n("finImage2"),n("finImage3"),n("finImage4"),n("finImage5"),n("finImage6"),n("finImage7"),n("finImage8"),n("finImage9")],window.finImageCanvass=[t("finImage1"),t("finImage2"),t("finImage3"),t("finImage4"),t("finImage5"),t("finImage6"),t("finImage7"),t("finImage8"),t("finImage9")],window.sketchImageLoader=n("sketchImage"),window.sketchImageCanvas=t("sketchImage"),window.sketchImageCanvas_bf=t("sketchImage_bf"),window.renderImageLoader=n("renderImage"),window.renderImageCanvas=t("renderImage"),window.cropImageLoader=n("cropImage"),window.cropImageCanvas=t("cropImage"),window.cropMaskCanvas=t("cropMask"),window.girdImageLoader=n("girdImage"),window.girdImageCanvas=t("girdImage"),window.sketchBoxCanvas=o("sketchBox"),window.tripleCanvas=i("tripleCanvas"),window.hintImageLoader=n("hintImage"),window.resultImageLoader=n("resultImage"),window.previewImageLoader=n("previewImage"),window.previewImageCanvas=t("previewImage"),window.creativeCanvas=e("./CreativeCanvas"),window.boxLoader=n("boxLoader"),window.boxLoader.load_url(window.server_url+"/res/Texture/board.png",function(e){}),window.leftNode=this.leftNode,window.isPen=!0,window.in_move=!1,window.current_room="new",window.current_step="new",window.logoNode=this.logoNode,window.processingNode=this.processingNode,window.processingNode.active=!1,window.cp_drager=[],window.crop_dragger_A=null},start:function(){setTimeout(this.on_pen,500),setTimeout(this.hide_light,500)},load_sketch:function(e){window.cropImageLoader.load_url(e,function(e){window.confirmNode.active=!0,window.cpNode.width=cc.winSize.width-100,window.cpNode.height=cc.winSize.height-300,window.cpNodeSprite.spriteFrame=window.cropImageCanvas.load_image(e,e.width,e.height),window.cpNode2Sprite.spriteFrame=window.cropMaskCanvas.dark();var n=1*window.cpNode.width/(1*window.cropImageCanvas.canvas.width),t=1*window.cpNode.height/(1*window.cropImageCanvas.canvas.height),o=Math.min(n,t);window.cpNode.width=parseInt(1*window.cropImageCanvas.canvas.width*o),window.cpNode.height=parseInt(1*window.cropImageCanvas.canvas.height*o),window.cp_drager[0].x=-window.cpNode.width/3.23,window.cp_drager[0].y=0,window.cp_drager[1].x=window.cpNode.width/3.23,window.cp_drager[1].y=0,window.cp_drager[2].x=0,window.cp_drager[2].y=-window.cpNode.height/3.23,window.cp_drager[3].x=0,window.cp_drager[3].y=window.cpNode.height/3.23,null!=window.crop_dragger_A&&window.crop_dragger_A.ontiii(null)})},load_hints:function(e){window.sketchImageLoader.load_url(e,function(e){window.previewSprite.spriteFrame=window.previewImageCanvas.clear(),window.hintSprite.spriteFrame=window.creativeCanvas.ini_image(e,e.width,e.height)})},confirm_ok:function(){var e=window.cropImageCanvas.image,n=parseInt(window.sketch_crop_w),t=parseInt(window.sketch_crop_h),o=parseInt(window.sketch_crop_l),i=parseInt(window.cropImageCanvas.canvas.height-window.sketch_crop_u);console.log([o,i,n,t]),window.sketchImageCanvas.load_image_adv(e,o,i,n,t),window.sketchImageCanvas_bf.load_image_adv(e,o,i,n,t),window.alphaSketchSprite.spriteFrame=window.sketchImageCanvas.load_alpha(),window.hasGird=!1,window.hasColor=!1,window.hasRender=!1,window.previewSprite.spriteFrame=window.previewImageCanvas.clear(),window.girdSprite.spriteFrame=window.girdImageCanvas.clear(),window.bghintSprite.spriteFrame=window.renderImageCanvas.clear(),window.current_room="new",window.current_step="new";var a=window.regulator.minRegulate([n,t],2048),r=window.regulator.maxRegulate([n,t],140);window.sketchSprite.spriteFrame=window.sketchBoxCanvas.ini(n,t),window.hintSprite.spriteFrame=window.creativeCanvas.ini(a[0],a[1]),window.sketchNode.width=a[0],window.sketchNode.height=a[1],window.sketchNode.scaleX=1*(cc.winSize.height-420)/window.sketchNode.height*1,window.sketchNode.scaleY=window.sketchNode.scaleX,window.c9Node.active=!0,window.sketchNode.x=105/1440*cc.winSize.height,window.sketchNode.y=.5*cc.winSize.height-window.sketchNode.scaleY*window.sketchNode.height*.5-100,window.hasSketch=!0,window.logoNode.active=!1,window.confirmNode.active=!1,window.c1BtnSprite.spriteFrame=window.finImageCanvass[0].load_image_adv(e,o,i,n,t),window.c1BtnNode.width=r[0],window.c1BtnNode.height=r[1],window.c2BtnSprite.spriteFrame=window.finImageCanvass[1].load_image_adv(e,o,i,n,t),window.c2BtnNode.width=r[0],window.c2BtnNode.height=r[1],window.c3BtnSprite.spriteFrame=window.finImageCanvass[2].load_image_adv(e,o,i,n,t),window.c3BtnNode.width=r[0],window.c3BtnNode.height=r[1],window.c4BtnSprite.spriteFrame=window.finImageCanvass[3].load_image_adv(e,o,i,n,t),window.c4BtnNode.width=r[0],window.c4BtnNode.height=r[1],window.c5BtnSprite.spriteFrame=window.finImageCanvass[4].load_image_adv(e,o,i,n,t),window.c5BtnNode.width=r[0],window.c5BtnNode.height=r[1],window.c6BtnSprite.spriteFrame=window.finImageCanvass[5].load_image_adv(e,o,i,n,t),window.c6BtnNode.width=r[0],window.c6BtnNode.height=r[1],window.c7BtnSprite.spriteFrame=window.finImageCanvass[6].load_image_adv(e,o,i,n,t),window.c7BtnNode.width=r[0],window.c7BtnNode.height=r[1],window.c8BtnSprite.spriteFrame=window.finImageCanvass[7].load_image_adv(e,o,i,n,t),window.c8BtnNode.width=r[0],window.c8BtnNode.height=r[1],window.c9BtnSprite.spriteFrame=window.finImageCanvass[8].load_image_adv(e,o,i,n,t),window.c9BtnNode.width=r[0],window.c9BtnNode.height=r[1],window.controller.uploadSketch()},confirm_failed:function(){window.confirmNode.active=!1},uploadSketch:function(){if(!window.uploading&&null!=window.sketchImageCanvas.source){window.controller.net_lock("initializing",0),window.current_room="new",window.current_step="new",window.creativeCanvas.kill_preview();var e=new XMLHttpRequest;e.open("POST",window.server_url.split("/file")[0]+"/run/upload_sketch",!0),e.setRequestHeader("Content-Type","application/json;"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var n=JSON.parse(e.responseText).data[0].split("_");window.current_room=n[0],window.current_step=n[1],console.log("get room id "+window.current_room),console.log("get step id "+window.current_step),window.controller.net_unlock("finished"),window.current_cid=0,window.claNode.y=window.c1BtnNode.y,window.controller.hide_light(),window.creativeCanvas.flush_bg(),window.faceSeletor.flush_preview()}else 4==e.readyState&&(window.state_label.change("error",1),window.controller.on_big_error(),window.location.reload())},e.send(JSON.stringify({data:[JSON.stringify({room:window.current_room,sketch:window.sketchImageCanvas.dataurl}),null]})),console.log("sketch uploaded")}}}),cc._RF.pop()},{"./BoxCanvas":"BoxCanvas","./CreativeCanvas":"CreativeCanvas","./FileInputs":"FileInputs","./ImageCanvas":"ImageCanvas","./ImageLoader":"ImageLoader","./SizeRegulator":"SizeRegulator","./TripleCanvas":"TripleCanvas"}],dragbox:[function(e,n,t){"use strict";cc._RF.push(n,"6591e257m1DWrS+H2/IDVmm","dragbox"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.drag_box=this},start:function(){window.mouse_l=!1,window.mouse_r=!1,window.mouse_m=!1,window.ctrl=!1,window.alt=!1,window.drag_box=this,this.node.on(cc.Node.EventType.MOUSE_DOWN,this.onMouseDown,this),this.node.on(cc.Node.EventType.MOUSE_UP,this.onMouseUp,this),this.node.on(cc.Node.EventType.MOUSE_WHEEL,this.onMouseWheel,this),this.node.on(cc.Node.EventType.TOUCH_MOVE,this.onTouchMove,this),this.node.on("mousemove",function(e){window.mousePosition=e.getLocation();var n=.5*window.leftNode.width+1*window.drag_target.x-.5*window.drag_target.width*window.drag_target.scaleX+300,t=.5*window.leftNode.height+1*window.drag_target.y-.5*window.drag_target.height*window.drag_target.scaleX,o=(window.mousePosition.x-n)/(window.drag_target.width*window.drag_target.scaleX),i=(window.mousePosition.y-t)/(window.drag_target.height*window.drag_target.scaleX);o>0&&i>0&&o<1&&i<1?(window.creativeCanvas.re=!0,window.creativeCanvas.rex=o,window.creativeCanvas.rey=i,window.creativeCanvas.in_drag||window.creativeCanvas.refresh_current_point_index()):window.creativeCanvas.re=!1,window.alt&&(window.mouse_l||window.mouse_r||window.mouse_m||window.in_color&&window.drag_box.do_picking())}),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,function(e){e.keyCode==cc.KEY.z&&window.creativeCanvas.undo()}),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,function(e){e.keyCode==cc.KEY.y&&window.creativeCanvas.redo()}),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,function(e){switch(e.keyCode){case cc.KEY.ctrl:window.ctrl=!0;break;case cc.KEY.alt:window.alt||(window.alt=!0,window.in_color&&(window.drag_box.begin_picking(),window.drag_box.do_picking()))}},this),cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP,function(e){switch(e.keyCode){case cc.KEY.ctrl:window.ctrl=!1;break;case cc.KEY.alt:window.alt=!1,window.in_color&&window.drag_box.end_picking()}},this)},onTouchMove:function(e){if(void 0!==window.drag_target)if(window.mouse_m||window.mouse_r||window.in_move){var n=e.touch.getDelta();window.drag_target.x+=n.x,window.drag_target.y+=n.y}else window.mouse_l&&(window.isPen?window.creativeCanvas.in_drag&&(window.creativeCanvas.relocate_current_point(),window.creativeCanvas.finish()):(window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1&&window.creativeCanvas.if_point_in_color(window.creativeCanvas.current_index)==window.in_color&&(window.creativeCanvas.points_XYRGBR.splice(window.creativeCanvas.current_index,1),window.creativeCanvas.finish())))},onMouseDown:function(e){var n=e.getButton();n===cc.Event.EventMouse.BUTTON_LEFT?(window.mouse_l=!0,window.creativeCanvas.re&&0==window.in_move&&(window.isPen?(window.creativeCanvas.current_index<0&&(window.creativeCanvas.add_point(),window.creativeCanvas.finish()),window.creativeCanvas.in_drag=!0):(window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1&&window.creativeCanvas.if_point_in_color(window.creativeCanvas.current_index)==window.in_color&&(window.creativeCanvas.points_XYRGBR.splice(window.creativeCanvas.current_index,1),window.creativeCanvas.finish())))):n===cc.Event.EventMouse.BUTTON_MIDDLE?window.mouse_m=!0:n===cc.Event.EventMouse.BUTTON_RIGHT&&(window.mouse_r=!0)},onMouseUp:function(e){var n=e.getButton();n===cc.Event.EventMouse.BUTTON_LEFT?(window.mouse_l=!1,window.creativeCanvas.in_drag=!1,window.creativeCanvas.create_k()):n===cc.Event.EventMouse.BUTTON_MIDDLE?window.mouse_m=!1:n===cc.Event.EventMouse.BUTTON_RIGHT&&(window.mouse_r=!1)},onMouseWheel:function(e){void 0!==window.drag_target&&(e.getScrollY()>0?window.drag_target.runAction(cc.scaleTo(.1,1.2*window.drag_target.scaleX)):window.drag_target.runAction(cc.scaleTo(.1,window.drag_target.scaleX/1.2)))},begin_picking:function(){void 0!==window.dropper_node&&window.creativeCanvas.flush()},do_picking:function(){if(void 0!==window.dropper_node){window.dropper_node.x=window.mousePosition.x-cc.winSize.width+150+30,window.dropper_node.y=window.mousePosition.y-cc.winSize.height/2-181+30;var e=.5*window.leftNode.width+1*window.drag_target.x-.5*window.drag_target.width*window.drag_target.scaleX+300,n=.5*window.leftNode.height+1*window.drag_target.y-.5*window.drag_target.height*window.drag_target.scaleX,t=(window.mousePosition.x-e)/(window.drag_target.width*window.drag_target.scaleX),o=(window.mousePosition.y-n)/(window.drag_target.height*window.drag_target.scaleX);if(t>0&&o>0&&t<1&&o<1)if(window.creativeCanvas.re=!0,window.creativeCanvas.rex=t,window.creativeCanvas.rey=o,window.creativeCanvas.refresh_current_point_index(),window.creativeCanvas.current_index>-1){var i=window.creativeCanvas.points_XYRGBR[window.creativeCanvas.current_index],a=[i[2],i[3],i[4]];window.color_picker_main.float_do(new cc.color(a[0],a[1],a[2])),window.minecraft.set_cur_color([a[0],a[1],a[2]]),window.pickCanvas.currentColor[0]=a[0],window.pickCanvas.currentColor[1]=a[1],window.pickCanvas.currentColor[2]=a[2]}else{var r=window.previewImageCanvas;window.girdNode.active&&(r=window.girdImageCanvas);var c=r.get_color(t,o);window.color_picker_main.float_do(c),window.minecraft.set_cur_color([c.r,c.g,c.b]),window.pickCanvas.currentColor[0]=c.r,window.pickCanvas.currentColor[1]=c.g,window.pickCanvas.currentColor[2]=c.b}}},end_picking:function(){void 0!==window.dropper_node&&(this.do_picking(),window.pickCanvas.floatingColor[0]=window.dropper_node.color.r,window.pickCanvas.floatingColor[1]=window.dropper_node.color.g,window.pickCanvas.floatingColor[2]=window.dropper_node.color.b,window.dropper_node.x=122,window.dropper_node.y=268,window.color_picker_main.pick_do())}}),cc._RF.pop()},{}],dragtarget:[function(e,n,t){"use strict";cc._RF.push(n,"16ac9dXjiBLKrkojVzbW1dk","dragtarget"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.drag_target=this.node}}),cc._RF.pop()},{}],eraser_masker:[function(e,n,t){"use strict";cc._RF.push(n,"d389dAkX0JBZruQtEeVulcE","eraser_masker"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.eraser_masker=this.node},update:function(e){this.node.x=window.mousePosition.x-cc.winSize.width/2,this.node.y=window.mousePosition.y-cc.winSize.height/2}}),cc._RF.pop()},{}],faceSelector:[function(e,n,t){"use strict";cc._RF.push(n,"8c11b3zCbJK37zCkjWNkHWp","faceSelector"),cc.Class({extends:cc.Component,properties:{bigFaceNode:{default:null,type:cc.Node},faceNodes:{default:[],type:cc.Node}},onLoad:function(){window.faceSeletor=this},start:function(){var n=this;window.faceID=-233,window.faceSeletor=this,window.bigFaceNode=this.bigFaceNode,window.bigFaceSprite=this.bigFaceNode.getComponent("cc.Sprite");for(var t=function(e){n.faceNodes[e].getComponent(cc.Sprite).spriteFrame=new cc.SpriteFrame,n.faceNodes[e].getComponent(cc.Sprite).spriteFrame.setTexture(cc.textureCache.addImage(window.server_url+"/res/face_128/"+(e+1)+".jpg")),n.faceNodes[e].on(cc.Node.EventType.MOUSE_UP,function(n){window.faceSeletor.on_face_selected(e)})},o=0;o<32;o++)t(o);var i=e("./ImageLoader"),a=e("./ImageCanvas");window.faceImageLoader=i("faceImage"),window.faceImageCanvas=a("faceImage"),this.on_face_selected(Math.floor(32*Math.random())),this.bigFaceNode.on("mousemove",function(e){window.mousePosition=e.getLocation();var n=150-.5*window.bigFaceNode.width,t=1290-.5*window.bigFaceNode.height,o=(1*window.mousePosition.x-n)/(1*window.bigFaceNode.width),i=(1*window.mousePosition.y-t)/(1*window.bigFaceNode.height);if(o>0&&i>0&&o<1&&i<1){var a=window.faceImageCanvas.get_color(o,i);window.color_picker_main.float_do(a)}}),this.bigFaceNode.on("mousedown",function(e){window.color_picker_main.pick_do()})},on_face_selected:function(e){window.faceID=e,window.faceImageLoader.load_url(window.server_url+"/res/face_512/"+(e+1)+".jpg",function(e){window.bigFaceSprite.spriteFrame=window.faceImageCanvas.load_image(e,240,240),window.bigFaceNode.width=240,window.bigFaceNode.height=240}),window.girdNode.active?window.controller.to_gird():window.controller.hide_light(),window.creativeCanvas.flush_bg(),this.flush_preview()},on_upload:function(){0!=window.hasSketch&&window.fileSelector.activate(window.faceSeletor.load_reference)},flush_preview:function(){window.in_color?this.flush_preview_color():this.flush_preview_light()},on_toggle_v4v2:function(){window.controller.hide_light(),window.faceSeletor.flush_preview()},flush_preview_color:function(){if(!window.uploading&&0!=window.hasSketch){window.hasGird=!1,window.hasColor=!1,window.hasRender=!1,window.controller.net_lock("painting",0);var e=new XMLHttpRequest;e.open("POST",window.server_url.split("/file")[0]+"/run/request_result",!0),e.setRequestHeader("Content-Type","application/json;"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var n=JSON.parse(e.responseText).data[0].split("_");window.current_room=n[0],window.current_step=n[1],console.log("get room id "+window.current_room),console.log("get step id "+window.current_step),window.controller.net_unlock("finished"),window.faceSeletor.download_gird_color()}else 4==e.readyState&&window.controller.net_unlock("error")},e.send(JSON.stringify({data:[JSON.stringify({room:window.current_room,points:JSON.stringify(window.creativeCanvas.points_XYRGBR),face:window.faceID<0?window.faceImageCanvas.canvas.toDataURL("image/png"):null,faceID:window.faceID+65535,need_render:0,skipper:null,inv4:window.V4_toggle.isChecked?1:0,r:window.lighter.color_tog.isChecked?window.lighter.light_R_slider.progress:-1,g:window.lighter.color_tog.isChecked?window.lighter.light_G_slider.progress:-1,b:window.lighter.color_tog.isChecked?window.lighter.light_B_slider.progress:-1,h:window.lighter.light_H_slider.progress,d:window.light_direction}),null]})),console.log("request sended")}},download_gird_color:function(){window.resultImageLoader.on_error=function(e){window.controller.net_unlock("error")},window.resultImageLoader.on_finish=function(e){window.controller.net_unlock("finished")};for(var e=["sketch","flat_careless","blended_flat_careless","smoothed_careless","blended_smoothed_careless","flat_careful","blended_flat_careful","smoothed_careful","blended_smoothed_careful"],n=function(n){window.finImageLoaders[n].load_result(e[n],function(e){window.finImageLoaders[n].hidden||(window.c9BtnSprite.spriteFrame=window.finImageCanvass[n].load_image(e,e.width,e.height),8==window.current_cid&&(window.previewSprite.spriteFrame=window.previewImageCanvas.load_image(e,e.width,e.height),window.alphaSketchSprite.spriteFrame=window.sketchImageCanvas.clear(),window.hasColor=!0,window.controller.net_unlock("finished"),window.controller.hide_light()))})},t=0;t2.5*e.height||e.height>2.5*e.width)){var n=window.regulator.maxRegulate([e.width,e.height],240);window.bigFaceSprite.spriteFrame=window.faceImageCanvas.load_image(e,n[0],n[1]),window.bigFaceNode.width=n[0],window.bigFaceNode.height=n[1],window.faceID=-233,window.controller.hide_light(),window.faceSeletor.flush_preview()}})}}),cc._RF.pop()},{"./ImageCanvas":"ImageCanvas","./ImageLoader":"ImageLoader"}],fake_bar:[function(e,n,t){"use strict";cc._RF.push(n,"61dcdov4D1Nc6gCTDSTIWPe","fake_bar"),cc.Class({extends:cc.Component,properties:{lab:{default:null,type:cc.Label},lab2:{default:null,type:cc.Label},prof:{default:null,type:cc.Node},prob:{default:null,type:cc.Node}},onLoad:function(){window.fake_bar_pro=this,this.text="finished",this.progress=1},change:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.text=e,this.progress=n},update:function(e){this.progress+=2e-4*(1-this.progress),this.progress>1&&(this.progress=1),this.lab.string=this.text+" ("+parseInt(100*this.progress)+"%)",this.lab2.string=this.lab.string,this.prof.width=parseInt(this.prob.width*this.progress),this.prob.active=this.progress<1}}),cc._RF.pop()},{}],lighter:[function(e,n,t){"use strict";cc._RF.push(n,"90b3at5d8FPDJEjfZXvwb7o","lighter"),cc.Class({extends:cc.Component,properties:{light_R_slider:{default:null,type:cc.Slider},light_G_slider:{default:null,type:cc.Slider},light_B_slider:{default:null,type:cc.Slider},light_H_slider:{default:null,type:cc.Slider},light_TT_slider:{default:null,type:cc.Toggle},light_TF_slider:{default:null,type:cc.Toggle},light_FT_slider:{default:null,type:cc.Toggle},light_FF_slider:{default:null,type:cc.Toggle},bgs:{default:null,type:cc.Node},colors:{default:null,type:cc.Node},color_tog:{default:null,type:cc.Toggle}},onLoad:function(){window.lighter=this},start:function(){this.light_R_slider.progress=.99,this.light_G_slider.progress=.83,this.light_B_slider.progress=.66,this.light_H_slider.progress=100/600,window.lighter=this,window.light_direction=0,this.reflush()},light_direction_0:function(){window.light_direction=0},light_direction_1:function(){window.light_direction=1},light_direction_2:function(){window.light_direction=2},light_direction_3:function(){window.light_direction=3},on_shift:function(){window.lighter.color_tog.isChecked?window.lighter.colors.active=!0:window.lighter.colors.active=!1,window.lighter.reflush()},reflush:function(){window.lighter.color_tog.isChecked?this.bgs.color=cc.color(parseInt(255*this.light_R_slider.progress),parseInt(255*this.light_G_slider.progress),parseInt(255*this.light_B_slider.progress),255):this.bgs.color=cc.color(255,255,255,255)}}),cc._RF.pop()},{}],mc:[function(e,n,t){"use strict";cc._RF.push(n,"9f420tBdblH772q0XTCwvMY","mc"),cc.Class({extends:cc.Component,properties:{c0:{default:null,type:cc.Sprite},c1:{default:null,type:cc.Sprite},c2:{default:null,type:cc.Sprite},c3:{default:null,type:cc.Sprite},c4:{default:null,type:cc.Sprite},c5:{default:null,type:cc.Sprite},c6:{default:null,type:cc.Sprite},c7:{default:null,type:cc.Sprite},c8:{default:null,type:cc.Sprite},kuang:{default:null,type:cc.Sprite}},onLoad:function(){window.minecraft=this},start:function(){this.sps=[this.c0,this.c1,this.c2,this.c3,this.c4,this.c5,this.c6,this.c7,this.c8],window.minecraft=this,this.big9=[[255,255,255],[255,230,200],[137,148,170],[150,164,141],[229,202,209],[249,233,218],[0,233,1],[1,233,0],[154,81,255]],this.reload_all(),this.index=4,this.set_index(0),window.in_color=!0,this.shift(),setTimeout("window.pickCanvas.record=window.pickCanvas.bigall;window.pickCanvas.finish();",200)},set_0:function(){this.set_index(0)},set_1:function(){this.set_index(1)},set_2:function(){this.set_index(2)},set_3:function(){this.set_index(3)},set_4:function(){this.set_index(4)},set_5:function(){this.set_index(5)},set_6:function(){this.set_index(6)},set_7:function(){this.set_index(7)},set_8:function(){this.set_index(8)},refresh:function(){for(var e=0;e<9;e++)this.set_color(e,[0,0,0]);setTimeout("window.minecraft.reload_all();window.minecraft.set_index(window.minecraft.index);",100)},reload_all:function(){for(var e=0;e<9;e++)this.set_color(e,this.big9[e])},set_index:function(e){if(-233==e)return this.index=e,void(this.kuang.node.active=!1);this.kuang.node.active=!0,e<0&&(e=0),e>8&&(e=8),this.index=e,this.kuang.node.x=100*e-400,this.index>-1&&this.index<5&&(window.pickCanvas.floatingColor[0]=this.sps[this.index].node.color.r,window.pickCanvas.floatingColor[1]=this.sps[this.index].node.color.g,window.pickCanvas.floatingColor[2]=this.sps[this.index].node.color.b,window.color_picker_main.pick_float(),window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1),5==this.index&&(window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1),6==this.index&&(window.isPen=!0,window.in_move=!1,window.eraser_masker.active=!1),7==this.index&&(window.isPen=!0,window.in_move=!0,window.eraser_masker.active=!1),8==this.index&&(window.isPen=!1,window.in_move=!1,window.eraser_masker.active=!0)},set_color:function(e,n){e>-1&&e<5&&(this.sps[e].node.color=cc.color(n[0],n[1],n[2],255))},shift:function(){for(var e=0;e<5;e++)this.sps[e].node.active=window.in_color;for(var n=5;n<7;n++)this.sps[n].node.active=!window.in_color;7!=this.index&&8!=this.index&&(window.in_color&&this.index>4&&this.set_index(0),window.in_color||this.index<5&&this.set_index(5))},go_pen:function(){5!=this.index&&6!=this.index&&7!=this.index&&8!=this.index||(this.index=0,this.kuang.node.x=-400)},set_cur_color:function(e){this.index>-1&&this.index<5&&(this.sps[this.index].node.color=cc.color(e[0],e[1],e[2],255))}}),cc._RF.pop()},{}],movebig:[function(e,n,t){"use strict";cc._RF.push(n,"baf29QBazxFQ4PCL2/AHscA","movebig"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){this.node.on(cc.Node.EventType.TOUCH_MOVE,function(e){if(null!=e){for(var n=e.touch.getDelta(),t=0;t<4;t++)window.cp_drager[t].x+=n.x,window.cp_drager[t].y+=n.y,window.cp_drager[t].x<-window.cpNode.width/2&&(window.cp_drager[t].x=-window.cpNode.width/2),window.cp_drager[t].x>window.cpNode.width/2&&(window.cp_drager[t].x=window.cpNode.width/2),window.cp_drager[t].y<-window.cpNode.height/2&&(window.cp_drager[t].y=-window.cpNode.height/2),window.cp_drager[t].y>window.cpNode.height/2&&(window.cp_drager[t].y=window.cpNode.height/2);window.crop_dragger_A.ontiii(null)}},this.node)},update:function(e){}}),cc._RF.pop()},{}],movertiny:[function(e,n,t){"use strict";cc._RF.push(n,"050d97BhuFBcogu1X1n+Eah","movertiny"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.crop_dragger_A=this,self.spriteFrame=new cc.SpriteFrame,self.texture2d=null,window.cp_drager.push(this.node),this.node.on(cc.Node.EventType.TOUCH_MOVE,this.ontiii,this.node),this.ontiii(null)},start:function(){this.ontiii(null)},ontiii:function(e){if(null!=e){var n=e.touch.getDelta();this.x+=n.x,this.y+=n.y}if(!(window.cp_drager.length<4)){this.x<-window.cpNode.width/2&&(this.x=-window.cpNode.width/2),this.x>window.cpNode.width/2&&(this.x=window.cpNode.width/2),this.y<-window.cpNode.height/2&&(this.y=-window.cpNode.height/2),this.y>window.cpNode.height/2&&(this.y=window.cpNode.height/2),window.sketch_crop_l=.5+1*Math.min(window.cp_drager[0].x,window.cp_drager[1].x,window.cp_drager[2].x,window.cp_drager[3].x)/(1*window.cpNode.width),window.sketch_crop_r=.5+1*Math.max(window.cp_drager[0].x,window.cp_drager[1].x,window.cp_drager[2].x,window.cp_drager[3].x)/(1*window.cpNode.width),window.sketch_crop_d=.5+1*Math.min(window.cp_drager[0].y,window.cp_drager[1].y,window.cp_drager[2].y,window.cp_drager[3].y)/(1*window.cpNode.height),window.sketch_crop_u=.5+1*Math.max(window.cp_drager[0].y,window.cp_drager[1].y,window.cp_drager[2].y,window.cp_drager[3].y)/(1*window.cpNode.height),window.sketch_crop_l*=window.cropImageCanvas.canvas.width,window.sketch_crop_r*=window.cropImageCanvas.canvas.width,window.sketch_crop_d*=window.cropImageCanvas.canvas.height,window.sketch_crop_u*=window.cropImageCanvas.canvas.height,window.sketch_crop_w=window.sketch_crop_r-window.sketch_crop_l,window.sketch_crop_h=window.sketch_crop_u-window.sketch_crop_d,window.controller.real_fileBtnNode.active=!0,window.sketch_crop_w>2.6*window.sketch_crop_h&&(window.controller.real_fileBtnNode.active=!1),window.sketch_crop_h>2.6*window.sketch_crop_w&&(window.controller.real_fileBtnNode.active=!1),self.canvas=window.cropMaskCanvas.canvas,self.canvas.width=window.cropImageCanvas.canvas.width,self.canvas.height=window.cropImageCanvas.canvas.height;var t=self.canvas.getContext("2d");t.fillStyle="rgba(0,0,0,0.8)",t.fillRect(0,0,canvas.width,canvas.height);var o=parseInt(window.sketch_crop_w),i=parseInt(window.sketch_crop_h),a=parseInt(window.sketch_crop_l),r=parseInt(window.cropImageCanvas.canvas.height-window.sketch_crop_u);t.clearRect(a,r,o,i),self.texture2d=new cc.Texture2D,self.spriteFrame.setTexture(self.texture2d),self.texture2d.initWithElement(self.canvas),self.texture2d.handleLoadedTexture(!0),window.cpNode2Sprite.spriteFrame=self.spriteFrame}},update:function(e){}}),cc._RF.pop()},{}],selfrot:[function(e,n,t){"use strict";cc._RF.push(n,"985733m0s1I44Gbui8XNyvc","selfrot"),cc.Class({extends:cc.Component,properties:{},start:function(){},update:function(e){this.node.rotation+=30*e}}),cc._RF.pop()},{}],shift50:[function(e,n,t){"use strict";cc._RF.push(n,"e8cf1Q/isJAM4tJYI+kKutU","shift50"),cc.Class({extends:cc.Component,properties:{},onLoad:function(){window.shifter_50=this},up50:function(){this.node.x=50},down50:function(){this.node.x=-50}}),cc._RF.pop()},{}],shiftlr:[function(e,n,t){"use strict";cc._RF.push(n,"ff80e/rKS5NvaF8zKm4aA06","shiftlr"),cc.Class({extends:cc.Component,properties:{btn_show:{default:null,type:cc.Node},btn_hide:{default:null,type:cc.Node},btn_a:{default:null,type:cc.Node},btn_b:{default:null,type:cc.Node}},show:function(){this.btn_show.active=!1,this.btn_hide.active=!0,this.btn_a.active=!0,this.btn_b.active=!0},hide:function(){this.btn_show.active=!0,this.btn_hide.active=!1,this.btn_a.active=!1,this.btn_b.active=!1}}),cc._RF.pop()},{}]},{},["BoxCanvas","CreativeCanvas","FileInputs","ImageCanvas","ImageLoader","PickCanvas","SizeRegulator","TripleCanvas","colorpicker","controller","dragbox","dragtarget","eraser_masker","faceSelector","fake_bar","lighter","mc","movebig","movertiny","selfrot","shift50","shiftlr"]); \ No newline at end of file