diff --git a/README.md b/README.md index 5e6bf8a..f74684c 100644 --- a/README.md +++ b/README.md @@ -142,11 +142,11 @@ A: Sure. You can open an issue here, or message me on [Discord](https://discord. ## Todo -- ⏹️ Zoom in and out with mouse scroll wheel. - ⬜ Support for small movement when microphone is detected. - ⬜ Support for loop through predefined frames when microphone is detected. - ⬜ Support for second set of frames for mouth movement when microphone is detected. - ⬜ Support for idle set of frames. +- 🟥 (Removed - Too Buggy) Zoom in and out with mouse scroll wheel. - ✅ (1.1.1) Touch Portal plugin. - ✅ (1.1) Party mode (be able to see someone else's character and frames). - ✅ (0.3.0) Remove load from the player (make server send a base64 encoded image ready to use). diff --git a/app.js b/app.js index b67f8fc..d0578d1 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -const _VERSION = "1.1.1" +const _VERSION = "1.1.2" var _PORT = 3000 var _FRAMES = {} diff --git a/resources/editor.js b/resources/editor.js index fc9f6c5..60955f1 100644 --- a/resources/editor.js +++ b/resources/editor.js @@ -1,6 +1,31 @@ jQuery(($) => { - var stSocket + var _spritesheetFile = null + // var _zoomCurrent = 3 + var stSocket = null + // const _zoomLevels = [0.15, 0.25, 0.5, 1, 1.5, 2, 2.15] + const _actionsDone = [] + const spritesheetMain = $("#spritesheet_main") + const spritesheetBoxed = $("#spritesheet_boxed") + const resizeBox = $("#resize_box") + const snapshotIconBox = $("#snapshot_icon_box") + const framesContainer = $("#frames__container") + const tabsContainer = $("#tabs__container") + const tabsTitles = $("#tabs__titles") + + /* + $(document).on('mousewheel', function(e) { + console.log(e.deltaX, e.deltaY, e.deltaFactor); + if( 0 < e.deltaY ){ + // UP + }else{ + // DOWN + } + }); + */ + /* + * ST SOCKET + */ function makeStSocket() { stSocket = new WebSocket(`ws://127.0.0.1:${_PORT}`) @@ -67,18 +92,9 @@ jQuery(($) => { } makeStSocket() - - var _spritesheetFile = null - var _zoomCurrent = 3 - const _zoomLevels = [0.15, 0.25, 0.5, 1, 1.5, 2, 2.15] - const _actionsDone = [] - const spritesheetMain = $("#spritesheet_main") - const spritesheetBoxed = $("#spritesheet_boxed") - const resizeBox = $("#resize_box") - const snapshotIconBox = $("#snapshot_icon_box") - const framesContainer = $("#frames__container") - const tabsContainer = $("#tabs__container") - const tabsTitles = $("#tabs__titles") + /* + * /ST SOCKET + */ /* * TABS STUFF @@ -661,6 +677,7 @@ jQuery(($) => { if (data.ok) { alert("Saved!") + window.location.href = `http://127.0.0.1:${_PORT}/editor.html` } else { alert("Error on save!") } @@ -813,6 +830,7 @@ jQuery(($) => { resizeBox.mazeResize("100px", "100px") spritesheetMain.mazeReposition(0, 0) $(document).trigger("maze-editor-reset") + framesContainer.scrollTop(0).find(".frame:eq(0)").trigger("click") tabsContainer.mazeSetTab("tabFrames") } @@ -852,6 +870,7 @@ jQuery(($) => { resizeBox.mazeResize(frameW, frameH) spritesheetMain.mazeReposition(framePX, framePY) framesContainer.mazeFrameAdd({ name: frame.name }) + tabsContainer.mazeSetTab("tabFrames") }) } @@ -968,6 +987,7 @@ jQuery(($) => { spritesheetMain.mazeReposition(framePX, framePY) framesContainer.mazeFrameAdd({ name: frame.name }) }) + framesContainer.scrollTop(0).find(".frame:eq(0)").trigger("click") }, error: function (err) {}, }) diff --git a/resources/jquery.mousewheel.min.js b/resources/jquery.mousewheel.min.js new file mode 100644 index 0000000..ec2d25c --- /dev/null +++ b/resources/jquery.mousewheel.min.js @@ -0,0 +1,5 @@ +/*! + * jQuery Mousewheel 3.1.13 + * Copyright OpenJS Foundation and other contributors + */ +!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(a){var u,r,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in window.document||9<=window.document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],f=Array.prototype.slice;if(a.event.fixHooks)for(var n=e.length;n;)a.event.fixHooks[e[--n]]=a.event.mouseHooks;var d=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],i,!1);else this.onmousewheel=i;a.data(this,"mousewheel-line-height",d.getLineHeight(this)),a.data(this,"mousewheel-page-height",d.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],i,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=a(e),e=t["offsetParent"in a.fn?"offsetParent":"parent"]();return e.length||(e=a("body")),parseInt(e.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return a(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function i(e){var t,n=e||window.event,i=f.call(arguments,1),o=0,l=0,s=0,h=0;if((e=a.event.fix(n)).type="mousewheel","detail"in n&&(s=-1*n.detail),"wheelDelta"in n&&(s=n.wheelDelta),"wheelDeltaY"in n&&(s=n.wheelDeltaY),"wheelDeltaX"in n&&(l=-1*n.wheelDeltaX),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(l=-1*s,s=0),o=0===s?l:s,"deltaY"in n&&(o=s=-1*n.deltaY),"deltaX"in n&&(l=n.deltaX,0===s&&(o=-1*l)),0!==s||0!==l)return 1===n.deltaMode?(o*=t=a.data(this,"mousewheel-line-height"),s*=t,l*=t):2===n.deltaMode&&(o*=t=a.data(this,"mousewheel-page-height"),s*=t,l*=t),h=Math.max(Math.abs(s),Math.abs(l)),(!r||h + - +