Skip to content

Make items usable via the inventory screen #1441

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Make items usable via the inventory screen #1441

wants to merge 4 commits into from

Conversation

CorruptedHeart
Copy link
Contributor

This is WIP, this pull request is meant as a discussion platform and a means to demonstrate how the behaviour could be implemented.

This allows the player to double click directly on items within their inventory and it would execute actions associated with that item.

// Example
class AGM_myItem: ItemCore {
  class AGM_Action {
    condition = "true"; // the condition under which to allow the action
    statement = "hint 'item is good';"; // code to execute when double clicking on the item
  };
};

Potential issues caused by this

  • Player unfamiliarity
  • Confusion around where to find actions, some actions occur via the inventory screen, others via interaction menu
  • Less visible context for what an action will do (fixable via adjustment of descriptionShort text or potentially other means)
  • No interaction with items underwater (BIS bug/feature/short sight)

Known issues currently in this implementation

  • Clicking cancel when selecting trigger will open the interaction menu (due to not overriding a ton of behaviour when implementing this code)

Gains

  • Potential for intuitive interaction with the game (double click on Clacker to use it, double click on magazine to repack, etc.)
  • Clears the Interaction menu for interactions that simply cannot be assigned directly to an item

@PabstMirror
Copy link
Collaborator

Interesting idea. Instead of hooking "LBDblClick" for the double click, what about hooking "LBSelChanged" and showing the selected item's info and possible action. Allows people to see what action would happen.

Had to slightly modify the ground/container listbox height.

invprototype

@KoffeinFlummi
Copy link
Owner

Regarding double clicks: While I love the idea, especially for simple things like earplugs, I think if we implement it, it shouldn't outright replace the interaction menu options for those actions. If you, for example, just carefully place 2 or 3 explosives, you kind of expect the detonation action to be found in the same place.

@PabstMirror That looks nice, but the cutdown selection screen is a bummer. In fact, I always wanted to increase the space that has. Maybe even go bonkers and make the inventory take up the whole screen. That would just make it way easier to select stuff out of large crates.

@jonpas
Copy link
Contributor

jonpas commented Nov 8, 2014

Making whole inventory screen larger would be nice IMO.

@PabstMirror
Copy link
Collaborator

https://community.bistudio.com/wiki/File:UI_all.jpg does great job of showing how user interface size effects the inventory dialog size, but bigger isn't really useful because it scales row height as well.

Here's an edited RscDisplayInventory at 1080p, Very Small User interface:

2014-11-08_00005

So Much Room For Activities. Without the use-item box, it's close to twice as many rows.

@jonpas
Copy link
Contributor

jonpas commented Nov 8, 2014

I am all for making this happen. It looks pretty neat.

@KoffeinFlummi
Copy link
Owner

👍

@PabstMirror
Copy link
Collaborator

https://www.youtube.com/watch?v=ETsVleCcueA

Moved the infoBox from a static window on the bottom left to a floating window next to the item itself. Allows multiple actions (right now it's a max of 8) and doesn't take up space when not needed.

For the crate lists, row/text size is still determined by user interface size, so people with monitors/eyesight that need big text shouldn't be effected. It just makes the overall size bigger.

There's also an option to make the infoBox appear on either single or double click, so it shouldn't be in the way too much for people who don't want it.

@KoffeinFlummi
Copy link
Owner

Looks good!

@jonpas
Copy link
Contributor

jonpas commented Nov 12, 2014

Very nice! 👍

@CorruptedHeart
Copy link
Contributor Author

Nice work.

@KoffeinFlummi
Copy link
Owner

Can we expect a pull request soon? 😄

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.

4 participants