mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 13:55:04 +02:00
Archive update 0.53.1
This commit is contained in:
@@ -924,8 +924,8 @@ export class PonyTownGame implements Game {
|
||||
const hover = screenToWorld(camera, point(input.pointerX / scale, input.pointerY / scale));
|
||||
|
||||
if (input.usingTouch && !input.wasPressed(Key.TOUCH_CLICK) && !input.isPressed(Key.TOUCH)) {
|
||||
hover.x = 0;
|
||||
hover.y = 0;
|
||||
hover.x = -1;
|
||||
hover.y = -1;
|
||||
}
|
||||
|
||||
this.hover = hover;
|
||||
@@ -957,11 +957,13 @@ export class PonyTownGame implements Game {
|
||||
const pickedEntities = pickEntities(this.map, hover, shift, this.mod);
|
||||
const pickedEntity = pickedEntities[(pickedEntities.indexOf(this.selected!) + 1) % pickedEntities.length];
|
||||
const holdingRemoveTool = player.hold === removeEntitiesTool.type;
|
||||
const holdingPlaceTool = player.hold === placeEntitiesTool.type;
|
||||
const editableMap = hasFlag(this.map.flags, MapFlags.EditableEntities);
|
||||
const holdingTool = holdingRemoveTool || holdingPlaceTool;
|
||||
|
||||
if (BETA && this.editor.selectingEntities) {
|
||||
editorSelectEntities(this, hover, shift);
|
||||
} else if (pickedEntity && (!holdingRemoveTool || !editableMap || hasFlag(pickedEntity.flags, EntityFlags.IgnoreTool))) {
|
||||
} else if (pickedEntity && (!holdingTool || !editableMap || hasFlag(pickedEntity.flags, EntityFlags.IgnoreTool))) {
|
||||
if (pickedEntity.type === PONY_TYPE) {
|
||||
this.select(pickedEntity as Pony);
|
||||
} else if (entityInRange(pickedEntity, player)) {
|
||||
@@ -987,7 +989,7 @@ export class PonyTownGame implements Game {
|
||||
} else if (holdingRemoveTool && this.highlightEntity && editableMap) {
|
||||
const id = this.highlightEntity.id;
|
||||
this.send(server => server.actionParam(Action.RemoveEntity, id));
|
||||
} else if (player.hold === placeEntitiesTool.type && this.highlightEntity && editableMap) {
|
||||
} else if (holdingPlaceTool && this.highlightEntity && editableMap) {
|
||||
const { x, y, type } = this.highlightEntity;
|
||||
this.send(server => server.actionParam(Action.PlaceEntity, { x, y, type }));
|
||||
} else if (this.selected) {
|
||||
|
||||
@@ -27,6 +27,9 @@ export {
|
||||
faTrash,
|
||||
faLock,
|
||||
faApple,
|
||||
faFolderOpen,
|
||||
faDownload,
|
||||
faUpload,
|
||||
faEdit,
|
||||
faImage,
|
||||
faLaughBeam,
|
||||
|
||||
@@ -17,6 +17,7 @@ export class MouseController implements InputController {
|
||||
element.addEventListener('mousedown', this.mousedown);
|
||||
element.addEventListener('mouseup', this.mouseup);
|
||||
element.addEventListener('mousewheel', this.mousewheel);
|
||||
element.addEventListener('wheel', this.mousewheel);
|
||||
element.addEventListener('contextmenu', this.contextmenu);
|
||||
element.addEventListener('click', this.click);
|
||||
window.addEventListener('blur', this.blur);
|
||||
@@ -30,6 +31,7 @@ export class MouseController implements InputController {
|
||||
this.element.removeEventListener('mousedown', this.mousedown);
|
||||
this.element.removeEventListener('mouseup', this.mouseup);
|
||||
this.element.removeEventListener('mousewheel', this.mousewheel);
|
||||
this.element.removeEventListener('wheel', this.mousewheel);
|
||||
this.element.removeEventListener('contextmenu', this.contextmenu);
|
||||
this.element.removeEventListener('click', this.click);
|
||||
this.element = undefined;
|
||||
|
||||
Reference in New Issue
Block a user