ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   The corrrect way to exit looting a container? (https://www.esoui.com/forums/showthread.php?t=10223)

Lykeion 06/10/22 11:47 AM

The corrrect way to exit looting a container?
 
I am working on my autoloot plugin. I use EndLooting() to exit the loot window, which works fine on monsters or nodes. But using EndLooting() on containers (like Mirri's hidden treasure bag) leaves the container stuck in the loot window, even though the looting process is actually over. I also tried EndInteraction(INTERACTION_LOOT), but again it didn't work.

Can anyone tell me the correct way to exit a container loot window?

Baertram 06/10/22 12:41 PM

https://www.esoui.com/forums/showthr...highlight=Loot

Check this thread at the end the user told he solved it by hiding the scene again. Maybe contact him or check the addon he mentioned there hiw it was done.

Should be something like
SceneName:Hide()

Where sceneName would be something like KEYBOARD_LOOT_SCENE or similar. My posts above the last post show you some links to the code where you should find the scene name. Else check with the addon merTorchbug e. G. by using the slash command /tbsc to show the SCENE_MANAGER and then see which scene is shown as currentScene

Lykeion 06/10/22 02:38 PM

Quote:

Originally Posted by Baertram (Post 46115)
https://www.esoui.com/forums/showthr...highlight=Loot

Check this thread at the end the user told he solved it by hiding the scene again. Maybe contact him or check the addon he mentioned there hiw it was done.

Should be something like
SceneName:Hide()

Where sceneName would be something like KEYBOARD_LOOT_SCENE or similar. My posts above the last post show you some links to the code where you should find the scene name. Else check with the addon merTorchbug e. G. by using the slash command /tbsc to show the SCENE_MANAGER and then see which scene is shown as currentScene

I did some searching before posting this thread and found users have encountered the same problem as me and solved it later, which included the poster of the thread you mentioned. Sadly not Askedal nor the poster of this thread https://www.esoui.com/forums/showthr...highlight=loot provided the solution directly. I have also searched for answers in Lazy Writ, but so far no luck. And SCENE_MANAGER indicates that I have been in scene "inventory" without change, strange.

Still, I'm actively contacting these users for help. Many thanks for your information.

Askedal 06/10/22 03:31 PM

Hi,

I solved it by using something like this:
Code:

            local n = SCENE_MANAGER:GetCurrentScene().name
            if n == 'hudui' or n == 'interact' or n == 'hud' then
              SCENE_MANAGER:Show('hud')
                else
              SCENE_MANAGER:Show(n)
            end

This closes the still open empty loot window.

I have worked on the "smarter autoloot" addon and extended it a loot, I would be happy to share it with you, maybe it already solves your autoloot needs :)

Best regards
Askedal

Lykeion 06/10/22 03:58 PM

Quote:

Originally Posted by Askedal (Post 46118)
Hi,

I solved it by using something like this:
Code:

            local n = SCENE_MANAGER:GetCurrentScene().name
            if n == 'hudui' or n == 'interact' or n == 'hud' then
              SCENE_MANAGER:Show('hud')
                else
              SCENE_MANAGER:Show(n)
            end

This closes the still open empty loot window.

I have worked on the "smarter autoloot" addon and extended it a loot, I would be happy to share it with you, maybe it already solves your autoloot needs :)

Best regards
Askedal

Thanks a lot! I was starting to learn the concept of the scene and just found a way that could exit the container loot window correctly like below. Unfortunately, it is incompatible with the other looting process that does not start from a container in your bag, cuz they're using EndLooting(). That means my codes need a looting type pre-check.

Code:

SCENE_MANAGER:Toggle("inventory")
But your method works well in any situation without any check, you are awesome! Besides, I also have been working on Agathorn's Smarter AutoLoot's rework for a while https://www.esoui.com/downloads/info...rAutoLoot.html. It seems that SAL is such a simple addon with great ideas that even without maintenance, its legacy still benefits players so much.


All times are GMT -6. The time now is 04:34 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI