Go to Page... |
Compatibility: | Update 43 (10.1.0) Gold Road (10.0.0) Scions of Ithelia (9.3.0) Endless Archive (9.2.5) base-game patch (9.1.5) Necrom (9.0.0) Scribes of Fate (8.3.5) |
Updated: | 07/12/24 12:08 PM |
Created: | 05/16/21 12:49 PM |
Monthly downloads: | 639 |
Total downloads: | 13,602 |
Favorites: | 34 |
MD5: |
File Name |
Version |
Size |
Uploader |
Date |
1.1.6 |
10kB |
mightyjo |
10/30/23 09:25 PM |
|
1.1.5 |
10kB |
mightyjo |
04/14/23 06:52 PM |
|
1.1.4 |
10kB |
mightyjo |
06/06/22 09:02 PM |
|
1.1.3 |
10kB |
mightyjo |
03/18/22 05:59 PM |
|
1.1.2 |
10kB |
mightyjo |
08/23/21 08:01 PM |
|
1.1.1 |
10kB |
mightyjo |
05/26/21 12:13 AM |
|
1.1.0 |
10kB |
mightyjo |
05/25/21 11:02 PM |
|
1.0.2 |
9kB |
mightyjo |
05/21/21 06:14 PM |
|
1.0.1 |
9kB |
mightyjo |
05/20/21 09:57 PM |
|
1.0.0 |
9kB |
05/16/21 12:49 PM |
Comment Options |
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
07/14/24, 12:34 PM | |||||
|
I had a look at my FCOIS code and actually I do not hook ShowMenu etc.
AddCustomSubMenuItem does not return the index as it seems. So I'm using contMenuVars.contextMenuIndex = AddCustomMenuItem(...) and in that normal non submenu item I have the normal callback function. And after the ShowMenu() call of my addon I check if the entry with index contMenuVars.contextMenuIndex exists and manipulate it to disable the mouse if it's just a header entyr without function (not your usecase, just as an example) and with a hook to ZO_Menu_OnHide I can change that SetMouseEnabled(true) again So actually I did not manipulate a submenu entry to run a callback as the callback (looking at LCM code) opens the submenu! What you could do though is SecurePostHook AddMenuItem function and find out if the data passed in is the one of your submenu entry (as LCM uses that too to add the submenu opener entries) and then use ZO_Menu.currentIndex to get the index of the submenu entry. That way you can manipulate ZO_Menu.items[ZO_Menu.currentIndex] to use ZO_PreHookHandler(ZO_Menu.items[ZO_Menu.currentIndex].item, "OnClick", function(ctrl) runYourCallbackFunction now and return true to hopefully supress the original submenu opening callback OnClick function) Or you need to replace the OnCliCk handler in total and set it nil again at ZO_Menu_OnHide
|
||||
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
07/14/24, 09:18 AM | ||||
|
|
|||
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
07/14/24, 08:44 AM | ||||||
|
LCM is just using ZO_Menu functions so you must do 2 things:
1st is to get the index off the entry that got the submenu (ZO_Menu.items[index]) which LCm should return by AddCustomSubmenuItem, I think. 2nd you need to hook into ZO_Menu code (not sure where it was but something like ShowMenu maybe or any other ZO_Menu func that is called within ShowMenu) and then add the callback to that ZO_Menu.items[indexOfSubmenu] properly so you can click it too. Else it only opens the submenu. Yeah I would love to see that directly in LCM API call to AddCustomSubMenuItem too, and had asked Votan for that but never got a feedback ;-) Oh remember that ShowMenu get's called from ZOs code AND each addon! So multiple times. And in ClearMenu you need to PreHook and remove the callback at the ZO_Menu.items[submenuIndex] again else it will stay there for next menu as the controls are used from a pool and are reused!
|
|||||
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
07/14/24, 08:33 AM | |||||
|
To improve users' target acquisition/click flow, I don't want to put the primary function behind a submenu. If I could get a single target to open the menu on mouseOver and still run a callback on mouseClick I'd love to use just one context menu item.
|
||||
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
07/14/24, 06:03 AM | ||||||
|
So I can split the item stack in my inv (at mail panel e.g.) and theen "manually" attach the 1 split item. No need to auto attach 1 item (unless this works fine, go ahead and add it, sure. Should be easily doable, spy the code of my addon "DoItAll" it got a mail "Attach" routines and calls the ZOs API functions to try to attach items to a mail. Same should work for "Deposit" to bank, code is in there too).
I just meant 1 submenu e.g. named like your addon name and below that show all possible actions like "Take / Deposit / Attach 1" "Leave 1" And you asked if there is a way to show a submenu and if you click the submenu opening line it would do something (call a callback function)? That would be possible yes, but only with hacking into ZO_Menu code I'm doing this in FCOItemSaver e.g. to click teh FCOIS submenu opening line and open the LAM settings menu that way / or remove all marker icons. But that's tricky to do and should not be used for your addon I guess. One day when I make LibScrollableMenu work with Invenory context menus we will have the possibility to do so more easily! But that's future work
Last edited by Baertram : 07/14/24 at 06:05 AM.
|
|||||
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
07/13/24, 04:58 PM | ||||
|
So if I can turn Code:
Take 1 Leave 1 Code:
-- Do the normal Take 1 action | ---- Open the sub-menu v v Take 1 > Leave 1 |
|||
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
07/13/24, 07:14 AM | ||||
Forum posts: 0
File comments: 46
Uploads: 0
|
Re: Re: Re: New option
|
|||
|
InsaneShad0w92 |
View Public Profile |
Send a private message to InsaneShad0w92 |
Find More Posts by InsaneShad0w92 |
Add InsaneShad0w92 to Your Buddy List |
07/12/24, 02:36 PM | |
Forum posts: 0
File comments: 102
Uploads: 0
|
Very nice and useful.
|
|
Alessondria |
View Public Profile |
Send a private message to Alessondria |
Find More Posts by Alessondria |
Add Alessondria to Your Buddy List |
07/12/24, 12:13 PM | |
|
I think it does but just asking in case it does not (yet): Does your addon support CraftBag stack's "Take 1" and "All but 1" too?
And does it support the "Take 1" and "All but 1" at the normal inventory too? I often have the problem that I got a stack of items in my inv and only want to kepp 1 or only take 1 to send by mail to friends etc. Would be such a timesaver if that works in normal inv too. And, as inventory context menus can get very long due to many addons: Do you add 2 new entries, 1 each for "Take 1" and "All but 1" or do you use a LibCustomMenu submenu with 2 entries? The submenu would be a very great thing to keep the base context menu shorter by 1 item).
Last edited by Baertram : 07/12/24 at 12:16 PM.
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
07/12/24, 12:12 PM | |||
|
Re: Re: New option
|
||
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
07/11/24, 05:03 PM | ||
|
Re: New option
|
|
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
06/18/24, 11:58 AM | |
Forum posts: 0
File comments: 46
Uploads: 0
|
New option
Hey any thoughts on adding Take All but One option?
|
|
InsaneShad0w92 |
View Public Profile |
Send a private message to InsaneShad0w92 |
Find More Posts by InsaneShad0w92 |
Add InsaneShad0w92 to Your Buddy List |
05/26/21, 12:17 AM | |
|
v1.1.1
Everything is fine. Nothing is ruined. Hope nobody saw that embarrassing display.
|
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |
05/25/21, 11:41 PM | |
|
Broke something in v1.1.0
Just broke something. I'll have it fixed in a jiffy.
|
|
mightyjo |
View Public Profile |
Send a private message to mightyjo |
Find More Posts by mightyjo |
Add mightyjo to Your Buddy List |