Skip to content

Commit

Permalink
Merge pull request #1076 from solaris-games/dev
Browse files Browse the repository at this point in the history
Hotfix for 241: Fix stars being not selectable in object menu
  • Loading branch information
SpacialCircumstances authored Jul 8, 2024
2 parents cf28e0b + 5ccb88a commit 4f03b57
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions client/src/game/star.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,23 @@ class Star extends EventEmitter {
onClicked(e, tryMultiSelect = true) {
const eventData = e ? e.data : null

const click = () => {
this.emit('onStarClicked', {
starData: this.data,
tryMultiSelect,
eventData,
permitCallback: () => {
// Need to do this otherwise sometimes text gets highlighted.
this.deselectAllText()

if (this._getStarPlayer()) {
this.updateVisibility()
// this.setScale()
}
}
})
};

if (e?.data?.originalEvent) {
const button = e.data.originalEvent.button;

Expand All @@ -798,21 +815,10 @@ class Star extends EventEmitter {
eventData
});
} else {
this.emit('onStarClicked', {
starData: this.data,
tryMultiSelect,
eventData,
permitCallback: () => {
// Need to do this otherwise sometimes text gets highlighted.
this.deselectAllText()

if (this._getStarPlayer()) {
this.updateVisibility()
// this.setScale()
}
}
})
click();
}
} else {
click();
}
}

Expand Down

0 comments on commit 4f03b57

Please sign in to comment.