Skip to content
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

Item Context Menu - Add icon for items that have context menu options #1375

Open
Freddo3000 opened this issue Oct 3, 2020 · 9 comments
Open

Comments

@Freddo3000
Copy link
Contributor

Is your enhancement related to a problem?
Currently it is difficult to tell which items have context menu items on them without prior knowledge

Solution you'd like:
Having say, a white dot or arrow at the corner of items could help identifying which items have context menu items, as currently unless you know about it being there it is very difficult to tell.

Quick mock-up:
Mock-up

Alternatives you've considered:
N/A

@Freddo3000 Freddo3000 changed the title Item Context Menu - Add icon for items that have context menu Item Context Menu - Add icon for items that have context menu options Oct 3, 2020
@commy2
Copy link
Contributor

commy2 commented Oct 3, 2020

How is this supposed to work? The listboxes don't have support for arbitrary icons in Arma. Unless you find a method, this is not viable.

Still not liking feature requests on an issue tracker.

@Freddo3000
Copy link
Contributor Author

I'd imagine it would work similarly to the DLC banners, or magazine capacity.

@commy2
Copy link
Contributor

commy2 commented Oct 3, 2020

Ok, how does that work :) ?

@Freddo3000
Copy link
Contributor Author

Unsure as of yet, but there's RscDisplayInventory_DLCTemplate that GroundContainer uses

Config snippet
class RscDisplayInventory_DLCTemplate
{
	class controls
	{
		class DlcBg
		{
			idc = 101;
			text = "\A3\Ui_f\data\GUI\Rsc\RscDisplayInventory\InventoryStripe_ca.paa";
			color[] = {1,1,1,1};
			x = 0;
			y = 0;
			w = "1.8 * 					(			((safezoneW / safezoneH) min 1.2) / 40)";
			h = "1.8 * 					(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
		};
		class DlcIcon
		{
			idc = 100;
			text = "";
			color[] = {1,1,1,1};
			x = "0 * 					(			((safezoneW / safezoneH) min 1.2) / 40)";
			y = "0 * 					(			((safezoneW / safezoneH) min 1.2) / 40)";
			w = "1 * 					(			((safezoneW / safezoneH) min 1.2) / 40)";
			h = "1 * 					(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
		};
	};
};
class GroundContainer: RscListBox
{
	class DLCTemplate: RscDisplayInventory_DLCTemplate
	{
		class Controls;
	};
};

@commy2
Copy link
Contributor

commy2 commented Oct 3, 2020

I don't see how this helps at all. How to turn that on or off?

@commy2
Copy link
Contributor

commy2 commented Oct 3, 2020

Not feasible, unless someone finds a way to do something like this.

@PabstMirror
Copy link
Contributor

PabstMirror commented Oct 4, 2020

2 big problems

  • Scanning for all actions on all times might take a noticeable amount of time
    (unqiue items * all actions). Normally you just check for actions on the single item you click on.
  • The list is updated by the engine
    if someone else puts an item into your backpack, we'd have to handle it (need code always running, not just on open)

tested how to show it has actions

        sleep 1; // some delay needed
        for "_index" from 1 to ((lbSize _uniformItems) - 1) do {
            _uniformItems lbSetText [_index, str _index]; // worked on mags but not items
            _uniformItems lbSetTooltip [_index, format ["Double click for actions<br/>" + "real tooltip...."]]; // no Effect
            _uniformItems lbSetColor [_index, [1,0,1,1]]; // works
        };

moving item to ground and then back to uniform would cause everything to reset

@Freddo3000
Copy link
Contributor Author

Freddo3000 commented Oct 4, 2020

The second issue could possibly be handled by player "loadout" eventhandler.
You could create an overlay control over the container listbox, and use the new ctrlSetScrollValues and ctrlScrollValues commands to mirror.
Rechecking I'd imagine might be doable with some degree of caching.

@10Dozen
Copy link
Contributor

10Dozen commented Jul 28, 2021

Very useful feature, tbh.

Caching will be a pretty good solution, as loadouts doesn't change completely all the time, so most of invetory changes will cause only a few real config reads. Basically we don't need all actions now, just any 1 non-disabled per item to mark item as interactive. Plus items in non-active containers may be skipped until container is opened.

As alternative: bind some key to inventory display, on press/hold - start scanning all items for actions and draw icons. From user side it will be like 'show interactive' mode, which may be used when needed.

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

No branches or pull requests

4 participants