-
Notifications
You must be signed in to change notification settings - Fork 149
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 - Change option selection to Single click instead of Double click #1486
Conversation
Also maybe single scroll click is a good idea instead of double left click for menu call (if it possible). |
Now context menu invoked by LBDblClick event (returns selected element). If we replace it with MouseButtonUp for LMB - it will work (click will select item in the listbox, so it's possible to track curSel element), but now option menu will be opened each time we click somewhere inside listbox too. For MMB it won't even select item in listbox, so it's not easy to get item that was clicked. Maybe if we can track mouse coursor over specific listbox item... EDIT: // Getting listbox's displayed size
private _lbHeight = getNumber (configFile >> "RscDisplayInventory" >> "controls" >> _containerConfigClass >> "h");
private _lbTopPos = getNumber (configFile >> "RscDisplayInventory" >> "controls" >> _containerConfigClass >> "y");
private _lbBottomPos = _lbTopPos + _lbHeight;
// Gettings full listbox's size
private _lbRowHeight = getNumber (configFile >> "RscDisplayInventory" >> "controls" >> _containerConfigClass >> "rowHeight");
private _lbRowOffset = getNumber (configFile >> "RscDisplayInventory" >> "controls" >> _containerConfigClass >> "itemSpacing");
private _lbSize = lbSize _control;
// Magic here! There is some offset in the bottom of the inventory listbox for Uniform/Vest/Backpack
private _lbBottomOffset = [0, _lbRowHeight * 0.9] select (_containerType in ["UNIFORM_CONTAINER","VEST_CONTAINER","BACKPACK_CONTAINER"]);
private _lbTotalItemsHeight = (_lbSize * _lbRowHeight) + (_lbSize - 1) * _lbRowOffset + _lbBottomOffset;
// Position (top and bottom) of the displayed part of the Listbox
private _lbScrollVertical = (ctrlScrollValues _control) select 0;
private _scrolledTopPos = _lbScrollVertical * (_lbTotalItemsHeight - _lbHeight);
private _scrolledBottomPos = _scrolledTopPos + _lbHeight;
// Getting row number under mouse position by interpolation position of the mouse over listbox viewport to actual listbox position displayed
private _scrolledToLBPos = linearConversion [_lbTopPos, _lbBottomPos, _yPos, _scrolledTopPos, _scrolledBottomPos, false];
private _index = -1 + ceil (_scrolledToLBPos / (_lbRowHeight + _lbRowOffset)); So the only option i can imagine now is <ctrl/shift/alt> + LMB click alternative. |
This will highlight selected option at least for 1 frame
This setting seems like bloat to me. It is a setting about how you can either use single or double clicks in an ui... CBA devs should make the choice whatever makes more sense. I am open to this being changed, but a setting for this? Just no. |
Single click makes more sense to me. |
I prefer single click (reason in PR first message). Removed setting. |
Does this single-click implementation work reliably? |
I don't have A3 now and it's like 1 year old, so someone needs to test =) |
Could put this into next update if somebody tests it. |
I tested this, it works. |
When merged this pull request will:
Note:
Currently to use inventory action player needs to double click the item, then find needed option and double click it again.
It's work fine in tests and without much interactions available.
But after hours of playing it becomes not so trivial. Especially when there is a need to interact with multiple items in short period of time (e.g. pack individual magazines manually - 4x clicks (to open menu and select options) * number of items in backpack of the average milsimer = ∞ number of clicks!).
So new options is just a small step to reduce number of the clicks needed.
p.s. Maybe option to open menu via Ctrl+Click is also needed, but didn't investigated possibility of this.