ivanwfr / GQSB

ESO Greymind Quick Slot Bar
1 stars 1 forks source link

Hide bar in menus #2

Open sho-87 opened 4 years ago

sho-87 commented 4 years ago

I have the quickslot bar set to always shown, but this means it is also shown inside menu (map, inventory, traders etc). Would it be possible to have an option where the bar is hidden when any main menu/UI is shown, but shown at all other times (depending on settings)?

ivanwfr commented 4 years ago

Hi, I think you could contribute to the solution by specifying how you would modify the logic of this page from my site:

ShowOrHide.lua

...that should be under: vis == VIS_ALWAYS

sho-87 commented 4 years ago

@ivanwfr what I'm looking for is something like this:

    elseif     vis == VIS_ALWAYS        then
        if     inventory_showing        then hide_msg = "VIS-"..vis.." .. INVENTORY SHOWING"
        else   show_msg = "VIS-"..vis
        end

I tested it and that hides the quickslot bar when inventory opens. But really I want it to hide when any main menu screen is opened (e.g. inventory, map, settings etc). I'm not familiar with the ESO API ... is there a catch all function that checks if any menu screen is open, instead of manually specifying each individually?

ivanwfr commented 4 years ago

Exactly my point, and I hoped you would be somehow in a position to help at finding a solution so that I wouldn't have to go through the usual guesswork you just started. I had that hope, considering you chose the GitHub channel instead of the usual ESO forums comment stream. But you're right,the API is not a friendly structure to work with and it's much easier to come up with a bunch of messy side effects rather than with a smart answer while solving a problem.

But, this is mostly why you can bind a keyboard shortcut to Block and Force bar visibility so you can quickly control the display by hand. The added Prepare Key Modifiers for using alt, control and shift modifiers when you run out of unused keys is also there to help. Let me know if you haven't tried using those and, if that's the case, would it kind of solve your problem when you give it a shot.

sho-87 commented 4 years ago

well right now my way of solving the problem is just registering events for the different types of interactions and calling show/hide_delayed:

EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_OPEN_BANK, Hide_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_CLOSE_BANK, Show_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_OPEN_GUILD_BANK, Hide_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_CLOSE_GUILD_BANK, Show_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_OPEN_STORE, Hide_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_CLOSE_STORE, Show_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_CRAFTING_STATION_INTERACT, Hide_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_END_CRAFTING_STATION_INTERACT, Show_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_MAIL_OPEN_MAILBOX, Hide_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_MAIL_CLOSE_MAILBOX, Show_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_OPEN_TRADING_HOUSE, Hide_delayed)
EVENT_MANAGER:RegisterForEvent(GreymindQuickSlotBar.Name, EVENT_CLOSE_TRADING_HOUSE, Show_delayed)

that seems to work well for menus where an event exists, but that is not the case for things like the world map or inventory.

Im guessing the correct way to do this would be to add QSB as a scene fragment to the scene that the action bar is on, because presumably whenever the action bar is hidden by the game then it will also hide QSB automatically. Someone on gitter directed me to this: https://wiki.esoui.com/SimpleNotebookTutorial/part6

ivanwfr commented 4 years ago

I see you found some material to work with in order to handle the visibility to your liking. And you also made it obvious how it wont be a simple matter of adding a few lines of code!

The scene construct is one of those framed scripting pattern that are perfect for standard behavior, like adding a few buttons to some accessory module UI. But GQSB is expected, as the in-game QSB wheel, to be accessible while editing and in-combat as well. That's not the standard scene bundle handling situation... While editing, you have to drag items from your bag to the standard QSB wheel -- with a chance to see the result in the GQSB UI that must be visible too at that time.

That's why, among other things, all events handling is hand-crafted in those 5000 lines of code. The choice of low-level coding is on purpose, trying to set dependency to the lower possible level instead of the work of others, who may -or not- be willing to adapt and improve. (see how the LibAddonMenu single dependency is already an issue on the PTS and how you can't get any request considered by the dev's deaf ears).

So, I appreciate your suggested experimentation and the time you spent on it but, if it does not provide the complete solution, having to reorganize the whole visibility logic on the standard API scheme would defeat a core choice.

Now, unless you can put your finger on some compatible and complete solution, the Force and Block manual handling (you are not even considering in your comment) will be the closest solution at the moment. When you find something compatible, I'm ready to setup a dedicated visibility feature choice in the addon Settings menu.