ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.64k stars 370 forks source link

Marketplace window, do not cancel the current trade by closing the Gift window if there are sufficient resources to execute the trade #4751

Open LeHerosInconnu opened 2 years ago

LeHerosInconnu commented 2 years ago

Preliminary checks

Describe the problem requiring a solution

Currently, if the player starts a trade and opens the Gift window, the trade is cancelled when the Gift window is closed.

In fheroes2:

Do not cancel current trade when gift window 001

Do not cancel current trade when gift window 002

Do not cancel current trade when gift window 003

https://user-images.githubusercontent.com/43583994/144721740-ae6fc22b-9e0a-472f-a8c6-5fd3647f3e83.mp4

Describe the possible solution

I suggest to not cancel the current trade by closing the Gift window if there are sufficient resources to execute the trade. (Same for Trading Post window.)

Additional info

No response

zenseii commented 2 years ago

I had to make it like this on purpose because if not then someone would be able to spend the same resources twice with how the menu currently worked, and I also thought that no one would care because who would setup their trade and then go to the gift menu before finalizing their trade, right? Well I guess I was wrong 😂. Anyways I also explained why I did this in the PR, but if this is still deemed necessary then I have no objections.

LeHerosInconnu commented 2 years ago

@zenseii.

I had to make it like this on purpose because if not then someone would be able to spend the same resources twice with how the menu currently worked, and I also thought that no one would care because who would setup their trade and then go to the gift menu before finalizing their trade, right? Well I guess I was wrong joy. Anyways I also explained why I did this in the PR, but if this is still deemed necessary then I have no objections.

The user can start a trade to see how many resources he can give, then make the gift and return to finish the started trade. :)

zenseii commented 2 years ago

@zenseii.

I had to make it like this on purpose because if not then someone would be able to spend the same resources twice with how the menu currently worked, and I also thought that no one would care because who would setup their trade and then go to the gift menu before finalizing their trade, right? Well I guess I was wrong joy. Anyways I also explained why I did this in the PR, but if this is still deemed necessary then I have no objections.

The user can start a trade to see how many resources he can give, then make the gift and return to finish the started trade. :)

But you can see how much you can give in the gift window? Or do you mean that you want to check what the exchange rate of that resource is first? That would be a valid reason, yes.

LeHerosInconnu commented 2 years ago

@zenseii.

...I also explained why I did this in the PR...

Sorry I squashed your plan. :) I always make sure to try as many possibilities when I use an interface because people use it in different ways.

@zenseii.

I had to make it like this on purpose because if not then someone would be able to spend the same resources twice with how the menu currently worked, and I also thought that no one would care because who would setup their trade and then go to the gift menu before finalizing their trade, right? Well I guess I was wrong joy. Anyways I also explained why I did this in the PR, but if this is still deemed necessary then I have no objections.

The user can start a trade to see how many resources he can give, then make the gift and return to finish the started trade. :)

But you can see how much you can give in the gift window? Or do you mean that you want to check what the exchange rate of that resource is first? That would be a valid reason, yes.

Yes just this way. :)