diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes index 8d5b358..441477a 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes @@ -1,2 +1,2 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1),n(5),n(13),n(14),n(9),n(10),n(15),n(16)],o=function(e,t,n,r,o,i,a,s){window.sampleUI=window.sampleUI||{};var c=window.sampleUI;c.commonUI=e,c.dialog=t,c.dpad=n,c.input=r,c.misc=o,c.mobileHacks=i,c.strings=a,c.touch=s}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(3),n(8),n(4),n(5),n(6),n(2),n(9),n(10),n(11),n(12)],o=function(e,t,n,r,o,i,a,s,c,u){function l(e){if(e=e||"",!v){v=document.createElement("div");var t=document.getElementById("hft-menu");t.parentNode.insertBefore(v,t)}e.indexOf("portrait")>=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){var t=g(e);m(t,e)},b=function(n){for(var r=0;r=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){e.preventDefault();var t=g(e);m(t,e)},b=function(n){for(var r=0;rr&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;n>r&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(n){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.propagate(e,this.leave,!1)},enterOver:function(e){this.over(e),this.propagate(e,this.enter,!0)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),e._handledByPE=!0}},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(t,n){this.captureInfo[n.pointerId]&&(n.relatedTarget=null);var r=new e(t,n);return n.preventDefault&&(r.preventDefault=n.preventDefault),r._target=r._target||n.target,r},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;ri&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(N>=s&&N>=c)return!0}},prepareEvent:function(e){var t=E.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=F.get(this.POINTER_ID);0!==t.which&&n?e.buttons=n.buttons:e.buttons=0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);D||(n.buttons=A[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),F.set(this.POINTER_ID,e),t&&0!==t.buttons?E.move(n):E.down(n)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);if(!D){var r=A[n.button];n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons}F.set(this.POINTER_ID,e),n.buttons&=~A[n.button],0===n.buttons?E.up(n):E.move(n)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,E.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.deactivateMouse()},deactivateMouse:function(){F["delete"](this.POINTER_ID)}},z=E.captureInfo,q=w.findTarget.bind(w),X=w.allShadows.bind(w),j=E.pointermap,B=2500,U=200,K="touch-action",W={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){Y.enableOnSubtree(e)},unregister:function(){},elementAdded:function(e){var t=e.getAttribute(K),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,E.listen(e,this.events),X(e).forEach(function(e){e._scrollType=n,E.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,E.unlisten(e,this.events),X(e).forEach(function(e){e._scrollType=void 0,E.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(K),r=this.touchActionToScrollType(n),o=this.touchActionToScrollType(t);r&&o?(e._scrollType=r,X(e).forEach(function(e){e._scrollType=r},this)):o?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,n=this.scrollTypes;return"none"===t?"none":t===n.XSCROLLER?"X":t===n.YSCROLLER?"Y":n.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===j.size||1===j.size&&j.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,U)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return"touchstart"!==e&&"touchmove"!==e||(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,n=E.cloneEvent(e),r=n.pointerId=e.identifier+2;n.target=z[r]||q(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=2*(e.radiusX||e.webkitRadiusX||0),n.height=2*(e.radiusY||e.webkitRadiusY||0),n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,n.altKey=t.altKey,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey;var o=this;return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;o=s}return this.firstXY=null,t}},findTouch:function(e,t){for(var n,r=0,o=e.length;o>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(j.size>=t.length){var n=[];j.forEach(function(e,r){if(1!==r&&!this.findTouch(t,r-2)){var o=e.out;n.push(o)}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){j.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),E.enterOver(e),E.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,n=j.get(t.pointerId);if(n){var r=n.out,o=n.outTarget;E.move(t),r&&o!==t.target&&(r.relatedTarget=t.target,t.relatedTarget=o,r.target=o,t.target?(E.leaveOut(r),E.enterOver(t)):(t.target=o,t.relatedTarget=null,this.cancelOut(t))),n.out=t,n.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(E.up(e),E.leaveOut(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){E.cancel(e),E.leaveOut(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){j["delete"](e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=H.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var o=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(o,B)}}};Y=new n(W.elementAdded,W.elementRemoved,W.elementChanged,W);var G,V,J,$=E.pointermap,Q=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,Z={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){E.listen(e,this.events)},unregister:function(e){E.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return Q&&(t=E.cloneEvent(e),t.pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){$["delete"](e)},MSPointerDown:function(e){$.set(e.pointerId,e);var t=this.prepareEvent(e);E.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);E.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);E.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);E.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);E.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=E.makeEvent("lostpointercapture",e);E.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=E.makeEvent("gotpointercapture",e);E.dispatchEvent(t)}},ee=window.navigator;ee.msPointerEnabled?(G=function(e){c(e),u(this),l(e)&&(E.setCapture(e,this,!0),this.msSetPointerCapture(e))},V=function(e){c(e),E.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(G=function(e){c(e),u(this),l(e)&&E.setCapture(e,this)},V=function(e){c(e),E.releaseCapture(e)}),J=function(e){return!!E.captureInfo[e]},a(),s(),d();var te={dispatcher:E,Installer:n,PointerEvent:e,PointerMap:v,targetFinding:w};return te})}]); \ No newline at end of file diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.css.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.css.bytes index 7ff06b2..9e6aec8 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.css.bytes +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.css.bytes @@ -1,7 +1,7 @@ /* set all elements to use border-box sizing. Yay! */ html { box-sizing: border-box; - height: 100%; + height: 100vh; } *, *:before, *:after { box-sizing: inherit; @@ -12,8 +12,8 @@ html { } body { - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; margin: 0; font-family: Helvetica, Arial, sans-serif; overflow: hidden; @@ -21,8 +21,8 @@ body { /* class to make something full size */ .hft-fullsize { - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; } .hft-top-left { position: absolute; @@ -31,8 +31,8 @@ body { } /* class to make a column based flexbox with everything centered */ .hft-fullcenter { - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; display: -webkit-box; display: -webkit-flex; @@ -61,13 +61,13 @@ body { */ #hft-everything { position: relative; - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; } #hft-content { position: relative; - width: 100%; - height: 100%; + width: 100vw; + height: 100vh; } /* left header area */ #hft-nameentry { @@ -76,7 +76,7 @@ body { left: 0px; top: 0xp; z-index: 5000; - width: 100%; + width: 100vw; background: -webkit-linear-gradient(top, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%); background: linear-gradient(to bottom, #f2f6f8 0%,#d8e1e7 88%,#b5c6d0 91%,#e0eff9 100%); } diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js index 8d5b358..441477a 100644 --- a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js +++ b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js @@ -1,2 +1,2 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1),n(5),n(13),n(14),n(9),n(10),n(15),n(16)],o=function(e,t,n,r,o,i,a,s){window.sampleUI=window.sampleUI||{};var c=window.sampleUI;c.commonUI=e,c.dialog=t,c.dpad=n,c.input=r,c.misc=o,c.mobileHacks=i,c.strings=a,c.touch=s}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(3),n(8),n(4),n(5),n(6),n(2),n(9),n(10),n(11),n(12)],o=function(e,t,n,r,o,i,a,s,c,u){function l(e){if(e=e||"",!v){v=document.createElement("div");var t=document.getElementById("hft-menu");t.parentNode.insertBefore(v,t)}e.indexOf("portrait")>=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){var t=g(e);m(t,e)},b=function(n){for(var r=0;r=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){e.preventDefault();var t=g(e);m(t,e)},b=function(n){for(var r=0;rr&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;n>r&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(n){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.propagate(e,this.leave,!1)},enterOver:function(e){this.over(e),this.propagate(e,this.enter,!0)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),e._handledByPE=!0}},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(t,n){this.captureInfo[n.pointerId]&&(n.relatedTarget=null);var r=new e(t,n);return n.preventDefault&&(r.preventDefault=n.preventDefault),r._target=r._target||n.target,r},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;ri&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(N>=s&&N>=c)return!0}},prepareEvent:function(e){var t=E.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=F.get(this.POINTER_ID);0!==t.which&&n?e.buttons=n.buttons:e.buttons=0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);D||(n.buttons=A[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),F.set(this.POINTER_ID,e),t&&0!==t.buttons?E.move(n):E.down(n)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);if(!D){var r=A[n.button];n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons}F.set(this.POINTER_ID,e),n.buttons&=~A[n.button],0===n.buttons?E.up(n):E.move(n)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,E.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.deactivateMouse()},deactivateMouse:function(){F["delete"](this.POINTER_ID)}},z=E.captureInfo,q=w.findTarget.bind(w),X=w.allShadows.bind(w),j=E.pointermap,B=2500,U=200,K="touch-action",W={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){Y.enableOnSubtree(e)},unregister:function(){},elementAdded:function(e){var t=e.getAttribute(K),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,E.listen(e,this.events),X(e).forEach(function(e){e._scrollType=n,E.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,E.unlisten(e,this.events),X(e).forEach(function(e){e._scrollType=void 0,E.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(K),r=this.touchActionToScrollType(n),o=this.touchActionToScrollType(t);r&&o?(e._scrollType=r,X(e).forEach(function(e){e._scrollType=r},this)):o?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,n=this.scrollTypes;return"none"===t?"none":t===n.XSCROLLER?"X":t===n.YSCROLLER?"Y":n.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===j.size||1===j.size&&j.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,U)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return"touchstart"!==e&&"touchmove"!==e||(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,n=E.cloneEvent(e),r=n.pointerId=e.identifier+2;n.target=z[r]||q(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=2*(e.radiusX||e.webkitRadiusX||0),n.height=2*(e.radiusY||e.webkitRadiusY||0),n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,n.altKey=t.altKey,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey;var o=this;return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;o=s}return this.firstXY=null,t}},findTouch:function(e,t){for(var n,r=0,o=e.length;o>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(j.size>=t.length){var n=[];j.forEach(function(e,r){if(1!==r&&!this.findTouch(t,r-2)){var o=e.out;n.push(o)}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){j.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),E.enterOver(e),E.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,n=j.get(t.pointerId);if(n){var r=n.out,o=n.outTarget;E.move(t),r&&o!==t.target&&(r.relatedTarget=t.target,t.relatedTarget=o,r.target=o,t.target?(E.leaveOut(r),E.enterOver(t)):(t.target=o,t.relatedTarget=null,this.cancelOut(t))),n.out=t,n.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(E.up(e),E.leaveOut(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){E.cancel(e),E.leaveOut(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){j["delete"](e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=H.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var o=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(o,B)}}};Y=new n(W.elementAdded,W.elementRemoved,W.elementChanged,W);var G,V,J,$=E.pointermap,Q=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,Z={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){E.listen(e,this.events)},unregister:function(e){E.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return Q&&(t=E.cloneEvent(e),t.pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){$["delete"](e)},MSPointerDown:function(e){$.set(e.pointerId,e);var t=this.prepareEvent(e);E.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);E.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);E.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);E.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);E.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=E.makeEvent("lostpointercapture",e);E.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=E.makeEvent("gotpointercapture",e);E.dispatchEvent(t)}},ee=window.navigator;ee.msPointerEnabled?(G=function(e){c(e),u(this),l(e)&&(E.setCapture(e,this,!0),this.msSetPointerCapture(e))},V=function(e){c(e),E.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(G=function(e){c(e),u(this),l(e)&&E.setCapture(e,this)},V=function(e){c(e),E.releaseCapture(e)}),J=function(e){return!!E.captureInfo[e]},a(),s(),d();var te={dispatcher:E,Installer:n,PointerEvent:e,PointerMap:v,targetFinding:w};return te})}]); \ No newline at end of file diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js index 3da75b3..e79dbc4 100644 --- a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js +++ b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js @@ -3486,6 +3486,7 @@ }; var onPointerDown = function(e) { + e.preventDefault(); var padId = getClosestPad(e); checkStart(padId, e); }; @@ -3631,6 +3632,7 @@ //}; var handleButtonDown = function(e, buttonInfo) { + e.preventDefault(); addPointerId(buttonInfo, e.pointerId, e.timeStamp); };