Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for 241: Fix stars being not selectable in object menu #1076

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading