diff --git a/VERSION b/VERSION index 03e5161d..7b5753f5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.5 \ No newline at end of file +1.4.6 \ No newline at end of file diff --git a/acp/package.json b/acp/package.json index 2d6bcc99..9b9d7f41 100644 --- a/acp/package.json +++ b/acp/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.4.5", + "version": "1.4.6", "description": "", "main": "index.js", "scripts": { diff --git a/client/assets/icons/mnml.png b/client/assets/icons/mnml.png new file mode 100644 index 00000000..068e30c1 Binary files /dev/null and b/client/assets/icons/mnml.png differ diff --git a/client/assets/styles/game.less b/client/assets/styles/game.less index 43e9d795..0a71051c 100644 --- a/client/assets/styles/game.less +++ b/client/assets/styles/game.less @@ -295,7 +295,7 @@ background-size: contain; background-repeat: no-repeat; background-position: top; - pointer-events: none; + // pointer-events: none; } .animating .skills { diff --git a/client/assets/styles/instance.less b/client/assets/styles/instance.less index ee7a1898..9d3ea05a 100644 --- a/client/assets/styles/instance.less +++ b/client/assets/styles/instance.less @@ -201,7 +201,7 @@ background-size: contain; background-repeat: no-repeat; background-position: center; - pointer-events: none; + // pointer-events: none; } .name { diff --git a/client/assets/styles/menu.less b/client/assets/styles/menu.less index bafdaa29..a1320161 100644 --- a/client/assets/styles/menu.less +++ b/client/assets/styles/menu.less @@ -55,7 +55,7 @@ background-size: contain; background-repeat: no-repeat; background-position: center; - pointer-events: none; + // pointer-events: none; height: 100%; } } diff --git a/client/manifest.webmanifest b/client/manifest.webmanifest index 1e8a3408..afb2065e 100644 --- a/client/manifest.webmanifest +++ b/client/manifest.webmanifest @@ -4,12 +4,12 @@ "short_name": "mnml", "icons": [ { - "src": "./assets/icons/726.png", + "src": "./assets/icons/mnml.png", "sizes": "32x32", "type": "image/png" }, { - "src": "./assets/icons/726.png", + "src": "./assets/icons/mnml.png", "sizes": "512x512", "type": "image/png" } diff --git a/client/package.json b/client/package.json index f03cab0e..13676814 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "mnml-client", - "version": "1.4.5", + "version": "1.4.6", "description": "", "main": "index.js", "scripts": { diff --git a/client/src/components/anims/wiggle.jsx b/client/src/components/anims/wiggle.jsx new file mode 100644 index 00000000..c4f06b9b --- /dev/null +++ b/client/src/components/anims/wiggle.jsx @@ -0,0 +1,21 @@ +const anime = require('animejs').default; + +function wiggle(id, idle) { + const duration = 300; + const target = document.getElementById(id); + const x = (window.screen.width / anime.random(-100, 100)) * 0.1; + const y = (window.screen.height / anime.random(-20, 100)) * 0.1; + return anime({ + targets: target, + rotate: 0, + translateX: [x, -x, 0], + translateY: [y, -y, 0], + duration, + easing: 'easeInOutSine', + // direction: 'alternate', + begin: idle.pause, + complete: idle.restart, + }); +} + +module.exports = wiggle; diff --git a/client/src/components/construct.jsx b/client/src/components/construct.jsx index c502be9e..151b9846 100644 --- a/client/src/components/construct.jsx +++ b/client/src/components/construct.jsx @@ -7,13 +7,14 @@ const { connect } = require('preact-redux'); const banish = require('./anims/banish'); const idleAnimation = require('./anims/idle'); const invert = require('./anims/invert'); +const wiggle = require('./anims/wiggle'); const sourceCast = require('./anims/source.cast'); const { ConstructAnimation } = require('./animations'); const addState = connect( function receiveState(state) { - const { animSource, animTarget } = state; - return { animSource, animTarget }; + const { animSource, animTarget, animText } = state; + return { animSource, animTarget, animText }; } ); @@ -33,12 +34,17 @@ class ConstructAvatar extends Component {
); } + onClick() { + return this.animations.push(wiggle(this.props.construct.id, this.idle)); + } + componentDidMount() { this.idle = idleAnimation(this.props.construct.id); return this.animations.push(this.idle); @@ -54,11 +60,17 @@ class ConstructAvatar extends Component { this.resetAnimations(); } - shouldComponentUpdate({ animSource, animTarget, construct }) { + shouldComponentUpdate(newProps) { + const { animSource, animTarget, animText, construct } = newProps; + if (construct !== this.props.construct) { return true; } + if (animText && animText.constructId === construct.id) { + return wiggle(construct.id, this.idle); + } + if (animSource === this.props.animSource && animTarget === this.props.animTarget) { // console.warn(construct.name, 'thinks its same props') return false; @@ -73,6 +85,7 @@ class ConstructAvatar extends Component { return sourceCast(animSource.constructId, animSource.direction, this.idle); } + // this is the target if (animTarget && animTarget.constructId.includes(construct.id)) { // console.warn(construct.name, 'should update') diff --git a/ops/package.json b/ops/package.json index 5314c598..a7f08e96 100755 --- a/ops/package.json +++ b/ops/package.json @@ -1,6 +1,6 @@ { "name": "mnml-ops", - "version": "1.4.5", + "version": "1.4.6", "description": "", "main": "index.js", "scripts": { diff --git a/server/Cargo.toml b/server/Cargo.toml index d3970fb5..89ecb188 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mnml" -version = "1.4.5" +version = "1.4.6" authors = ["ntr "] [dependencies]