mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-12 00:24:30 +08:00
fix: 大地图会一次性把所有伤害渲染完
This commit is contained in:
1 parent
5685efd4d5
commit
a05981e675
5 files changed
+36
-41
No files matched your search
@@ -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)) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user