Skip to content

Conversation

@Mosch0512
Copy link

@Mosch0512 Mosch0512 commented Dec 24, 2025

Adds feature to right click sell items in shops.

Open Question should it even be possible to unequip items in shop? possible accidential sell of non valuable items. we could add an additional check if you realy want to sell the item if it was equiped previously and still allow to unequip items on right click when shop is visible. Note this might be a bit more tricky

closes #252

- Implemented logic to support selling items by right-clicking in the inventory when the NPC shop is open.
- Added safeguards for high-value items, displaying a confirmation dialog before selling.
- Adjusted NPC shop behavior to allow right-click interactions to propagate to the inventory.
- Included handling to restore picked items on failed sell attempts.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Mosch0512, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience within the game's inventory and NPC shop systems by adding a convenient right-click sell feature. It also includes important preventative measures to avoid accidental item unequipping when interacting with shops and ensures a confirmation step for selling high-value items, making the selling process more intuitive and safer for players.

Highlights

  • Right-Click Sell Feature: Introduced the ability to sell items directly from the inventory to an NPC shop by right-clicking on them, streamlining the selling process.
  • Accidental Unequip Prevention: Implemented a safeguard to prevent players from accidentally unequipping items via right-click while the NPC shop interface is open, addressing a potential usability concern.
  • High-Value Item Confirmation: Integrated a confirmation dialog for selling high-value items, ensuring players are prompted before disposing of valuable gear.
  • Item Restoration on Sell Failure: Added logic to restore a 'picked item' to the inventory if a sell operation, particularly for high-value items requiring confirmation, is cancelled or fails.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a quality-of-life feature allowing players to sell items by right-clicking them in their inventory while an NPC shop is open. The implementation is thoughtful, including a safeguard to prevent accidental unequipping of items when the shop is open. The code for handling high-value items with a confirmation dialog is also correctly implemented.

My review identified a critical bug in the item selling logic. There's a scenario where an item could visually disappear from the inventory if an unexpected error occurs, which could be alarming for players. I've provided a code suggestion to fix this by reordering operations to ensure UI consistency and prevent this apparent item loss. Other than this issue, the changes look good and the new feature is a great addition.

@Mosch0512 Mosch0512 marked this pull request as ready for review December 24, 2025 02:03
@sven-n
Copy link
Owner

sven-n commented Dec 28, 2025

Nice feature, but I have the feeling this is a bit risky. Could we add a condition for a pressed key, e.g. 'Ctrl'?

@Mosch0512
Copy link
Author

so you mean when holding ctrl and right or left clicken the item in shop only then selling items should be allowed?

i mean i dont the the risky part ... maybe you could explain me in short what you think could go wrong.

we would have one more complicated option of adding this by acutally extending funcionallity of the games ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right click to sell items

2 participants