fix: 大地图会一次性把所有伤害渲染完

This commit is contained in:
AncTe committed 2024-10-19 21:18:54 +08:00
1 parent 5685efd4d5
commit a05981e675
5 files changed
+36 -41

No files matched your search

+4 -5
View File
@@ -66,8 +66,8 @@ export class FloorItemDetail implements ILayerGroupRenderExtends {
if (!mainSetting.getValue('screen.itemDetail')) return;
if (this.dirtyBlock.has(block)) {
this.sprite.block.clearCache(block, 1);
this.render(block);
}
this.render(block);
};
private onUpdateMapSize = (width: number, height: number) => {
@@ -216,14 +216,13 @@ export class FloorItemDetail implements ILayerGroupRenderExtends {
* @param block 需要渲染的格子
*/
render(block: number) {
this.calAllItems(new Set([block]));
if (this.dirtyBlock.has(block)) {
this.calAllItems(new Set([block]));
}
const data = this.detailData;
if (!this.dirtyBlock.has(block)) return;
this.dirtyBlock.delete(block);
const info = data.get(block);
if (!info) return;
info.forEach(({ x, y, diff }) => {
let n = 0;
for (const [key, value] of Object.entries(diff)) {
+1 -2
View File
@@ -217,10 +217,9 @@ export function getSkillFromIndex(index: number) {
/**
* 获取技能等级
* @param {number} skill
*/
export function getSkillLevel(skill: number) {
return (levels[skill] ??= 0);
return levels[skill] ?? 0;
}
export function getSkillConsume(skill: number) {