From 5c1b64c93cb9026c4eb53decaad4062fc936f762 Mon Sep 17 00:00:00 2001 From: Miao_Spring <539943419@qq.com> Date: Sat, 20 Jul 2024 19:58:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86EventContent.chooseT?= =?UTF-8?q?arget=EF=BC=8C=E4=BD=BF=E5=85=B6=E4=B8=8D=E5=86=8D=E6=8A=A5warn?= =?UTF-8?q?ing=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BA=86$damagepop=E4=B8=ADnode?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A2=AB=E5=8F=8A=E6=97=B6=E9=87=8A=E6=94=BE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/extension.js b/extension.js index 15aa1a2..73ccc21 100644 --- a/extension.js +++ b/extension.js @@ -393,7 +393,9 @@ game.import('extension', async function(lib, game, ui, get, ai, _status){ } if (event.result.bool && event.animate !== false) { for (var i = 0; i < event.result.targets.length; i++) { - event.result.targets[i].animate('target'); + // animate已被废弃 -miao + // event.result.targets[i].animate('target'); + event.result.targets[i].addTempClass('target'); } } if (event.dialog) event.dialog.close(); @@ -4986,12 +4988,12 @@ game.import('extension', async function(lib, game, ui, get, ai, _status){ }, this, num, nature, font); } - var node; - if (this.popupNodeCache && this.popupNodeCache.length) { - node = this.popupNodeCache.shift(); - } else { - node = decadeUI.element.create('damage'); - } + // let node; + // if (this.popupNodeCache && this.popupNodeCache.length) { + // node = this.popupNodeCache.shift(); + // } else { + let node = decadeUI.element.create('damage'); + // } if (font) { node.classList.add('normal-font'); @@ -5020,7 +5022,7 @@ game.import('extension', async function(lib, game, ui, get, ai, _status){ } if (this.damagepopups.length && !this.damagepopLocked) { - var node = this.damagepopups.shift(); + let node = this.damagepopups.shift(); this.damagepopLocked = true; if (this != node.parentNode) this.appendChild(node); @@ -5062,9 +5064,12 @@ game.import('extension', async function(lib, game, ui, get, ai, _status){ node.style.animation = 'open-fade-in-out 1.2s'; setTimeout(function (player, node) { - if (!player.popupNodeCache) player.popupNodeCache = []; - node.style.animation = ''; - player.popupNodeCache.push(node); + // if (!player.popupNodeCache) player.popupNodeCache = []; + // node.style.animation = ''; + // 释放播放完成动画后的node + node.remove() + // player.popupNodeCache.push(node); + // console.log(player.popupNodeCache.length) }, 1210, player, node); setTimeout(function (player) {