refactor: 着色器 & fix: 移动报错

This commit is contained in:
unanmed 2024-11-01 17:07:41 +08:00
parent 7bcd9ebeb2
commit 0989c82a6b
5 changed files with 922 additions and 393 deletions

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,14 @@
"22": "There is already an active camera for delivered render item. Consider using 'Camera.for' or diable the active camera to avoid some exceptions.", "22": "There is already an active camera for delivered render item. Consider using 'Camera.for' or diable the active camera to avoid some exceptions.",
"23": "Render item with id of '$1' has already exists.", "23": "Render item with id of '$1' has already exists.",
"24": "Uniform block can only be used in glsl version es 300.", "24": "Uniform block can only be used in glsl version es 300.",
"25": "Cannot activate weather since there's no weather with id of '$1'.",
"26": "Cannot set attribute when only element number specified. Use 'pointer' or 'pointerI' instead.",
"27": "Cannot vertex attribute integer point when specified as float. Use 'set' or 'pointer' instead.",
"28": "Redefinition of shader $1: '$2'",
"29": "Cannot define new texture since texture index is larger than max texture count.",
"30": "Cannot use indices named $1 since no definition for it. Please define it in advance.",
"31": "Cannot use indices since the indices instance is not belongs to the program.",
"32": "Sub-image exceeds texture dimensions, auto adjusting size.",
"1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency.", "1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency.",
"1101": "Cannot add new effect to point effect instance, for there's no more reserve space for it. Please increase the max count of the instance." "1101": "Cannot add new effect to point effect instance, for there's no more reserve space for it. Please increase the max count of the instance."
} }

View File

@ -487,14 +487,18 @@ export class HeroMover extends ObjectMoverBase {
if (!adapter || !viewport) return; if (!adapter || !viewport) return;
await adapter.all('readyMove'); await adapter.all('readyMove');
// 这里要检查前面那一格能不能走,不能走则不触发平滑视角,以避免撞墙上视角卡住 // 这里要检查前面那一格能不能走,不能走则不触发平滑视角,以避免撞墙上视角卡住
if (!this.ignoreTerrain) {
const { x, y } = core.status.hero.loc; const { x, y } = core.status.hero.loc;
const firstDir = controller.queue.find(v => v.type === 'dir')?.value; const firstDir = controller.queue.find(
if (firstDir) { v => v.type === 'dir'
)?.value;
if (firstDir && firstDir !== 'backward' && firstDir !== 'forward') {
const data = this.checkCanMove(x, y, toDir(firstDir as Dir)); const data = this.checkCanMove(x, y, toDir(firstDir as Dir));
if (data.canMove && !data.noPass) { if (data.canMove && !data.noPass) {
viewport.sync('startMove'); viewport.sync('startMove');
} }
} }
}
adapter.sync('startAnimate'); adapter.sync('startAnimate');
} }

View File

@ -307,7 +307,7 @@ export function init() {
core.status.replay.animate = false; core.status.replay.animate = false;
Mota.require('var', 'hook').emit( Mota.require('var', 'hook').emit(
'afterOpenDoor', 'afterOpenDoor',
block.event.id, block.event.id as AllIdsOf<'animates'>,
x, x,
y y
); );
@ -323,7 +323,12 @@ export function init() {
core.maps._removeBlockFromMap(core.status.floorId, block); core.maps._removeBlockFromMap(core.status.floorId, block);
if (!locked) core.unlockControl(); if (!locked) core.unlockControl();
core.status.replay.animate = false; core.status.replay.animate = false;
hook.emit('afterOpenDoor', block.event.id, x, y); hook.emit(
'afterOpenDoor',
block.event.id as AllIdsOf<'animates'>,
x,
y
);
callback?.(); callback?.();
}; };

View File

@ -164,7 +164,7 @@ interface EnemySpecialBase {
special: number[]; special: number[];
} }
interface BookEnemyInfo extends Enemy, EnemyInfo { interface BookEnemyInfo extends Enemy {
/** /**
* *
*/ */