timhjersted / tsorcRevamp

The Story of Red Cloud's Dark Souls mod, updated to TModLoader
GNU General Public License v3.0
23 stars 15 forks source link

Disable usage of held item while hovering in potion bag #23

Closed stinky-lizard closed 2 years ago

stinky-lizard commented 2 years ago

The Issue

As it is now, hovering your mouse between the slots in the potion bag will use the item you're holding. This is bad, because the potion bag is specifically designed for holding potions, which are consumable! A simple misclick or even just a poorly-timed shake of the mouse can cause a player to waste a potentially valuable potion.

What This Does

This updates PotionBagUIState.cs and adds a new function to the potion bag's UIPanel's Update procedure. Now, on Update, it checks if the mouse position is covered by the UIPanel, and if it is, it disables using the held items. This does not affect placing items in the slots (I triple-checked!).

Here's a video of it in action: https://youtu.be/KH7F1_vztMI