Skip to content

Commit

Permalink
Fix showing item context menu in chests & corpses when quickpickup en…
Browse files Browse the repository at this point in the history
…abled

Closes: #583
  • Loading branch information
AntumDeluge committed Dec 2, 2023
1 parent f6a76c3 commit 298615b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions srcjs/stendhal/ui/component/ItemContainerImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ export class ItemContainerImplementation {
}
let event = stendhal.ui.html.extractPosition(evt);
if ((event.target as any).dataItem) {
if (this.quickPickup) {
const long_touch = stendhal.ui.touch.isLongTouch();
const context_action = (evt instanceof MouseEvent && this.isRightClick(evt)) || long_touch;
if (this.quickPickup && !context_action) {
marauroa.clientFramework.sendAction({
type: "equip",
"source_path": (event.target as any).dataItem.getIdPath(),
Expand All @@ -271,7 +273,6 @@ export class ItemContainerImplementation {
return;
}

const long_touch = stendhal.ui.touch.isLongTouch();
if (this.isRightClick(event) || long_touch) {
const append = [];
if (window['TouchEvent'] && evt instanceof TouchEvent && long_touch) {
Expand Down

0 comments on commit 298615b

Please sign in to comment.