Skip to content

Commit

Permalink
add history entry for moving entity, fix #270
Browse files Browse the repository at this point in the history
  • Loading branch information
Vegita2 committed Jun 27, 2024
1 parent 6eee884 commit ca3476e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Layers on same level are rendered based on their position in the list
- Show exact match at first position in search [#296](https://github.com/CCDirectLink/crosscode-map-editor/issues/296)
- Changed GlowingLine Step size from 16 to 8 [#276](https://github.com/CCDirectLink/crosscode-map-editor/issues/276)
- Moving an Entity is now tracked in the history [#270](https://github.com/CCDirectLink/crosscode-map-editor/issues/270)

## [1.5.0] 2024-03-20
### Added
Expand Down
5 changes: 4 additions & 1 deletion webapp/src/app/services/phaser/entities/entity-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ export class EntityManager extends BaseObject {

if (this.gameObjectDown) {
this.gameObjectDown = false;
Globals.stateHistoryService.saveState({
name: 'Entity moved',
icon: 'open_with'
});
} else {
const entities = this.selectionBox.onInputUp();

Expand All @@ -211,7 +215,6 @@ export class EntityManager extends BaseObject {
entity = gameObject[0].getData('entity');
}
if (entity) {
console.log(entity);
const p = {x: pointer.worldX, y: pointer.worldY};
if (this.leftClickOpts.timer < 200 && Vec2.distance2(p, this.leftClickOpts.pos) < 10) {
this.selectEntity(entity, this.multiSelectKey.isDown);
Expand Down

0 comments on commit ca3476e

Please sign in to comment.