mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-10-20 13:02:58 +08:00
chore: 同步 template 在 packages/ 的更改
This commit is contained in:
parent
9e6d2e9924
commit
26a3daac68
@ -179,6 +179,7 @@ export function getMapData(
|
|||||||
const floor = core.floors[now];
|
const floor = core.floors[now];
|
||||||
const change = floor.changeFloor;
|
const change = floor.changeFloor;
|
||||||
for (const [loc, ev] of Object.entries(change)) {
|
for (const [loc, ev] of Object.entries(change)) {
|
||||||
|
if (!ev) continue;
|
||||||
const target = ev.floorId as FloorIds;
|
const target = ev.floorId as FloorIds;
|
||||||
if (target.startsWith(':')) continue;
|
if (target.startsWith(':')) continue;
|
||||||
const [x, y] = loc.split(',').map(v => parseInt(v));
|
const [x, y] = loc.split(',').map(v => parseInt(v));
|
||||||
|
@ -133,7 +133,6 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
// 画布监听
|
// 画布监听
|
||||||
const canvas = this.target.canvas;
|
const canvas = this.target.canvas;
|
||||||
canvas.addEventListener('mousedown', ev => {
|
canvas.addEventListener('mousedown', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
const mouse = this.getMouseType(ev);
|
const mouse = this.getMouseType(ev);
|
||||||
this.lastMouse = mouse;
|
this.lastMouse = mouse;
|
||||||
this.captureEvent(
|
this.captureEvent(
|
||||||
@ -142,13 +141,11 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
canvas.addEventListener('mouseup', ev => {
|
canvas.addEventListener('mouseup', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
const event = this.createMouseAction(ev, ActionType.Up);
|
const event = this.createMouseAction(ev, ActionType.Up);
|
||||||
this.captureEvent(ActionType.Up, event);
|
this.captureEvent(ActionType.Up, event);
|
||||||
this.captureEvent(ActionType.Click, event);
|
this.captureEvent(ActionType.Click, event);
|
||||||
});
|
});
|
||||||
canvas.addEventListener('mousemove', ev => {
|
canvas.addEventListener('mousemove', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
const event = this.createMouseAction(
|
const event = this.createMouseAction(
|
||||||
ev,
|
ev,
|
||||||
ActionType.Move,
|
ActionType.Move,
|
||||||
@ -171,7 +168,6 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
canvas.addEventListener('mouseleave', ev => {
|
canvas.addEventListener('mouseleave', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
const id = this.getMouseIdentifier(
|
const id = this.getMouseIdentifier(
|
||||||
ActionType.Leave,
|
ActionType.Leave,
|
||||||
this.getMouseType(ev)
|
this.getMouseType(ev)
|
||||||
@ -183,13 +179,11 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
this.beforeHovered.clear();
|
this.beforeHovered.clear();
|
||||||
});
|
});
|
||||||
document.addEventListener('touchstart', ev => {
|
document.addEventListener('touchstart', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
this.createTouchAction(ev, ActionType.Down).forEach(v => {
|
this.createTouchAction(ev, ActionType.Down).forEach(v => {
|
||||||
this.captureEvent(ActionType.Down, v);
|
this.captureEvent(ActionType.Down, v);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
document.addEventListener('touchend', ev => {
|
document.addEventListener('touchend', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
this.createTouchAction(ev, ActionType.Up).forEach(v => {
|
this.createTouchAction(ev, ActionType.Up).forEach(v => {
|
||||||
this.captureEvent(ActionType.Up, v);
|
this.captureEvent(ActionType.Up, v);
|
||||||
this.captureEvent(ActionType.Click, v);
|
this.captureEvent(ActionType.Click, v);
|
||||||
@ -199,7 +193,6 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
document.addEventListener('touchcancel', ev => {
|
document.addEventListener('touchcancel', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
this.createTouchAction(ev, ActionType.Up).forEach(v => {
|
this.createTouchAction(ev, ActionType.Up).forEach(v => {
|
||||||
this.captureEvent(ActionType.Up, v);
|
this.captureEvent(ActionType.Up, v);
|
||||||
});
|
});
|
||||||
@ -208,7 +201,6 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
document.addEventListener('touchmove', ev => {
|
document.addEventListener('touchmove', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
this.createTouchAction(ev, ActionType.Move).forEach(v => {
|
this.createTouchAction(ev, ActionType.Move).forEach(v => {
|
||||||
const list = this.touchInfo.values();
|
const list = this.touchInfo.values();
|
||||||
if (!list.some(vv => v.identifier === vv.identifier)) {
|
if (!list.some(vv => v.identifier === vv.identifier)) {
|
||||||
@ -228,7 +220,6 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
canvas.addEventListener('wheel', ev => {
|
canvas.addEventListener('wheel', ev => {
|
||||||
ev.preventDefault();
|
|
||||||
this.captureEvent(
|
this.captureEvent(
|
||||||
ActionType.Wheel,
|
ActionType.Wheel,
|
||||||
this.createWheelAction(ev, ActionType.Wheel)
|
this.createWheelAction(ev, ActionType.Wheel)
|
||||||
|
@ -192,6 +192,7 @@ export class Transform {
|
|||||||
if (this.modified) {
|
if (this.modified) {
|
||||||
const result = new Transform();
|
const result = new Transform();
|
||||||
mat3.multiply(result.mat, this.mat, transform.mat);
|
mat3.multiply(result.mat, this.mat, transform.mat);
|
||||||
|
result.modified = true;
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
return transform.clone();
|
return transform.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user